# HG changeset patch # User cvs # Date 1186996841 -7200 # Node ID 697ef44129c688b7ed0b904f23df3427945f5943 # Parent 12e008d41344d2325de371f536af9b590b92b334 Import from CVS: tag r21-2-14 diff -r 12e008d41344 -r 697ef44129c6 .cvsignore --- a/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ b/.cvsignore Mon Aug 13 11:20:41 2007 +0200 @@ -7,7 +7,3 @@ GNUmakefile Makefile.in so_locations -xemacs-packages -mule-packages -site-packages -gmon.out diff -r 12e008d41344 -r 697ef44129c6 CHANGES-beta --- a/CHANGES-beta Mon Aug 13 11:19:22 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 11:20:41 2007 +0200 @@ -1,336 +1,6 @@ -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 glyps 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 neccessary --- 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 --- Make --without-x work again. --- Detect Xaw3d and friends using #include --- Experimental Drag-N-Drop now defaults to "no" until there is again - active development. --- SGI dumping fixes should make XEmacs work again on Irix 6. --- More warning flags on by default when building with gcc. --- process coding changes, Kirill Katsnelson --- help now knows how to print macro arglists, Yoshiki Hayashi --- Windows printing support, Kirill Katsnelson --- Obscure crash fixes, Martin Buchholz --- Memory leak fixes, Martin Buchholz --- We now always use our own realpath(), never the system-provided one. --- More gutter/tab widget changes, Andy Piper --- Crash fix when using dead processes, Gunnar Evermann (fix PR#1061) --- Pdump stability fixes, Olivier Galibert --- New coding system alias implementation, Ben Wing and Martin Buchholz --- New internal data conversion infrastructure, Ben Wing and Martin Buchholz --- IPv6 support, URA Hiroshi --- Runtime Athena mismatch warnings added, Daniel Pittman --- Removal of old MSDOS support, Kirill Katsnelson --- Correctly define Latin-3 and Latin-4 character syntax as "w". --- Auto-define all X-defined keysyms as self-inserting, not just Latin-1. --- Workaround egcs-20000131 c++ compiler bug --- Byte-optimize (length "foo") to 3. --- (define-key ctl-x-4-map "p" global-map) no longer causes stack overflow crash. --- Partially implement dontusethis-set-symbol-value-handler. --- Fix bug: (getf nil t t) ==> Lisp nesting exceeds `max-lisp-eval-depth' --- lib-src partially C++ized, Zack Weinberg. - -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 --- Mail locking overhaul, Michael Sperber --- Info-visit-file can now be used non-interactively, Martin Buchholz --- FAQ updates, Sandra Wambold --- Document lisp-level error handling, Hrvoje Niksic --- Windows changes, Kirill Katsnelson --- Portable dumper ported to Windows, Kirill Katsnelson --- idlwave-mode added, Carsten Dominik --- Info changes, Yoshiki Hayashi and Didier Verna. --- Again support BSD/OS 2.0 --- minibuf.* changes, Yoshiki Hayashi --- hyper-apropos changes, Yoshiki Hayashi --- buffers tab has its own face, Andy Piper --- modeline scrolling changes, Didier Verna - -to 21.2.26 "Millenium" --- Fix unpredictable results, perhaps even crashes, if using the - `return from debugger feature' and errors in `eval' or `funcall'. --- fix for Tab widgets causing X errors in XMapWindow(). - -to 21.2.25 "Hephaestus" --- the LATEST.IS.* file has been renamed to LATEST-IS-*. --- the CVS tag to checkout the latest tarball is `r21-2-latest-beta'. --- 3 crashes in mapcar1 have been fixed. --- lwlib arg passing cleanup --- yet more widget and tab fixes --- yet another Tab sync --- specifier copying fix for widgets --- preparation for proper layouts --- native widgets used for some custom widgets --- (+ 1) is no longer incorrectly compiled --- char-before no longer has performance penalty --- xpm again works on Windows --- native Windows fixes from Adrian Aichner --- Mule fixes from Yoshiki Hayashi --- properly detect Athena widgets headers and libs, preventing crashes - from misdetection and from libraries and headers that don't match, - from Daniel Pittman - -to 21.2.24 "Hecate" --- Tabs fixes from Andy Piper --- Widget leak fixes from Andy Piper --- (coding-system-list) deals properly with coding system aliases, Shenghuo ZHU --- configure support for ESD sound rewritte, Martin Buchholz --- directory separator fix from Mike Alexander --- Windows process support cleanup, Adrian Aichner --- NT now encapsulates fstat to get correct file mod time, Adrian Aichner - -to 21.2.23 "Hebe" --- MS-Windows selection fixes from Mike Alexander --- MS-WIndows process handling fixes from Mike Alexander --- Subwindow GC fix from Andy Piper --- Various minor fixes from Andy Piper --- Rewrite module configure support, Martin Buchholz --- Various Windows fixes, Martin Buchholz, Adrian Aichner, Andy Piper --- HP native compiler compilation fixes, Martin Buchholz --- Workarounds for Cygnus compiler bugs, Martin Buchholz --- Workarounds for Cygwin broken header files, Martin Buchholz --- itimers work again, Kyle Jones --- random code cleanup, Martin Buchholz --- various redisplay fixes, Andy Piper, Jan Vroonhof --- various fixes from Hrvoje Niksic, Yoshiki Hayashi - -to 21.2.22 "Mercedes" --- ESD Sound support from Robert Bihlmeyer --- 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 --- Fix detection of coding: cookie in -*- first line. --- More xim-xlib work by Kazuyuki Ienaga --- Fix crash in abbrev.c (abbrev_location), Eric Darve - -to 21.2.20 "Yoko" --- UTF-8 & file-coding magic cookie fix from MORIOKA Tomohiko --- bug fixes from Adrian Aichner, Sean MacLennan, and Jeff Miller --- glyph widget support under X/Athena from Andy Piper --- tab widget support under X (all variants) from Andy Piper --- many gutter, redisplay & widget fixes from Andy Piper --- mswindows mousewheel support from Mike Woolley --- combo box support under X/Motif from Andy Piper --- buffer tab grouping from Andy Piper --- layout widget support from Andy Piper --- partial display line scrolling support from Andy Piper --- cleanup patches from Gleb Arshinov --- hash table FSF API sync from Martin Buchholz --- widget cleanup from Martin Buchholz --- process-environment fix for nt from Julian Back --- widget to frame fix from Jan Vroonhof --- animated glyph support from Andy Piper --- glyph redisplay improvements from Andy Piper --- color cells allocation fix from Lee Kindness --- recover file fix for windows nt --- mingw install fix from Craig Lanning --- recognize keypad keys under MS-Windows from Jonathan Harris --- Switch gui dialogs to native widgets from Andy Piper --- fixes from Yoshiki Hayashi and Norbert Koch - -to 21.2.19 "Shinjuku" --- various fixes from Gunnar Evermann --- XIM fixes from Kazuyuki IENAGA --- keymap fix from Katsumi Yamaoka --- Microsoft build fixes from Adrian Aichner --- documentation update from Adrian Aichner --- rect.el rewrite from Didier Verna --- custom comment fields from Didier Verna --- various fixes from Karl Hegbloom --- filling fix from Yoshiki Hayashi --- miscellaneous changes from Jeff Miller and Didier Verna --- configure hacking from Steve Baur --- various fixes from Bob Weiner --- Mule synching from MORIOKA Tomohiko --- various fixes from Steve Baur --- LDAP configure changes from Gregory Neil Shapiro --- gutter implementation from Andy Piper --- tab widgets in gutter from Andy Piper --- Custom themes, API part. See etc/custom/theme-examples from Jan Vroonhof - -to 21.2.18 "Toshima" --- miscellaneous fixes from Steve Baur --- miscellaneous fixes from Didier Verna --- various bug fixes from Karl Hegbloom --- miscellaneous fixes from Bob Weiner --- fix for XIM server crashing and taking down XEmacs from Kazuyuki IENAGA --- valid-image-instantiator-format-p tightened up by Andy Piper. --- glyph widget support under X/Motif from Andy Piper --- Make docdir configurable, update package searching rules from Michael - Sperber --- Fix for Japanese word/character movements from MORIOKA Tomohiko --- lrecord struct header size fix from Olivier Galibert - -to 21.2.17 "Chiyoda" --- miscellaneous bug fixes from Steve Baur --- font menu fix from Robert Pluim --- ldap API update from Oscar Figueiredo --- Fix thai-xtis charset width from MORIOKA Tomohiko --- CCL engine fix from MORIOKA Tomohiko --- mswindows build fixes from Norbert Koch --- miscellaneous fixes from Andy Piper --- automated tests for mswindows from Adrian Aichner --- tree-view and tab-control widget glyph support from Andy Piper - -to 21.2.16 "Sumida" --- miscellaneous fixes from Hrvoje Niksic and Olivier Galibert --- make selection more mswindows conformant. --- Make customize use specifiers from Jan Vroonhof --- Cyrillic CCL crash fix from MORIOKA Tomohiko --- DEC OSF Build fix and miscellaneous Lisp fix from Steve Baur --- raw-text coding system synch from MORIOKA Tomohiko - -to 21.2.15 "Sakuragawa" --- new self tests from Oscar Figueiredo and Hrvoje Niksic --- Miscellaneous bug fixes from Yoshiki Hayashi, Jerry James, Hirokazu FUKUI, - Hrvoje Niksic, MORIOKA Tomohiko --- LDAP internationalization from Oscar Figueiredo --- DEC OSF build fixes from Steve Baur --- Documentation fixes from Mike McEwan, Vin Shelton and Gunnar Evermann --- Build fixes from Jan Vroonhof --- Miscellaneous fixes from Hrvoje Niksic --- Documentation updates from Hrvoje Niksic and Albert Chin-A-Young --- mule-charset.el synch with Mule from Steve Baur --- miscellaneous build and cosmetic fixes from Steve Baur --- font-menu for mswindows from Andy Piper --- select rationalisation for window systems from Andy Piper --- reinstate sheap adjustment + mingw32 fixes from Andy Piper - -to 21.2.14 "Dionysos" + -*- indented-text -*- +to 21.2.14 "" -- mingw32 port from Andy Piper --- fix for Solaris build lossage from Hrvoje Niksic --- THAI/Cyrillic-KOI8, Vietnamese, Ethiopic support from MORIOKA Tomohiko --- miscellaneous bug fixes from Gunnar Evermann --- Internal purespace cleanup from Olivier Galibert --- documentation updates from Hrvoje Niksic --- dump time tuning from Hrvoje Niksic --- miscellaneous bug fixes from Giacomo Boffi --- font hacking from Jan Vroonhof --- Czech language support from David Sauer --- `delete-key-deletes-forward' now defaults to t --- `locate-file' update from Hrvoje Niksic --- MS Windows build fixes from Adrian Aichner --- LDAP updates from Oscar Figueiredo --- miscellaneous bug fixes from Colin Rafferty and Kai Haberzettl --- disable display of images in buffers by file format --- miscellaneous Mule fixes from Olivier Galibert --- documentation updates from Albert Chin-A-Young --- documentation updates from Gunnar Evermann and Stephen Turnbull --- MS Windows build fix from Norbert Koch --- miscellaneous MS Windows fixes from Andy Piper --- redisplay bug fixes from Jan Vroonhof --- miscellaneous bug fixes from Robert Pluim, MORIOKA Tomohiko --- many, many bug fixes and enhancements from Hrvoje Niksic and Olivier - Galibert --- miscellaneous bug fixes from Martin Buchholz --- Miscellaneous MS Windows fixes from Philip Aston --- lots of new tests from Hrvoje Niksic to 21.2.13 "Demeter" -- Build fixes from Martin Buchholz diff -r 12e008d41344 -r 697ef44129c6 ChangeLog --- a/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,831 +1,3 @@ -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 - - * configure.in: Backout the /etc/ld.so.conf patch of 2000-01-18. - -2000-01-24 Martin Buchholz - - * configure.in: Always use our own realpath(), not the system one. - -2000-01-25 Martin Buchholz - - * configure.in: Default Drag-N-Drop to "no" - -1999-12-28 Max Matveev - - * configure.in: add new machine type for IRIX 6.[2-5] to - switch from using unexelf.o to unexelfsgi.o for just those - versions of IRIX. - In the ideal world it would be handled by the s/irix6-0.h but - since machine config is included AFTER OS config, I had to add a - new machine type. - -2000-01-22 Andy Piper - - * configure.in: add winspool to windows libraries. - -2000-01-22 Martin Buchholz - - * configure.in: Add more warnings to default gcc flags. - -2000-01-20 Daniel Pittman - - * configure.in: Find Athena headers hidden in even more obscure - places. That is, search Xaw3D/ as well as X11/Xaw3D/. - -2000-01-19 Martin Buchholz - - * configure.in: Add support for NetWinders. - Patch by Sean MacLennan - -2000-01-18 Martin Buchholz - - * configure.in: Use /etc/ld.so.conf at link-time, if available. - -2000-01-18 Martin Buchholz - - * XEmacs 21.2.27 is released. - -2000-01-15 Adrian Aichner - - * etc/TUTORIAL.de: Update copyright and fix typo. - -2000-01-14 Martin Buchholz - - * configure.in: Create a .dbxrc in the src directory, like .gdbinit. - - * configure.in: Add `tests' symlink to make it easier to find - automated tests directory. - -2000-01-14 Andy Piper - - * configure.in: for cygwin 1.0 we must pick up the mingw32 headers - before the cygwin headers. - -2000-01-08 Martin Buchholz - - * 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. - -2000-01-07 Marcus Thiessel - - * config.sub: Upgrade to 1.169, imported from autoconf's CVS - * config.guess: Upgrade to 1.158, imported from autoconf's CVS - -2000-01-03 Michael Sperber [Mr. Preprocessor] - - * etc/NEWS: Document mail spool locking overhaul. - - * configure.usage (--mail-locking): - * configure.in: Handle --mail-locking option correctly in - preparation for the movemail locking overhaul. - -2000-01-05 Daniel Pittman - - * configure.in (Installation): Report which Athena header/library - combo is being used. - -1999-12-31 Martin Buchholz - - * XEmacs 21.2.26 is released. - -1999-12-24 Martin Buchholz - - * XEmacs 21.2.25 is released. - -1999-12-17 Yoshiki Hayashi - - * README: Remove msdos part. - -1999-12-17 Martin Buchholz - - * configure.in: Oops. xpm doesn't actually depend on X11. - I got confused by the name (like others get confused by `xemacs'?) - -1999-12-14 Martin Buchholz - - * XEmacs 21.2.24 is released. - -1999-12-13 Martin Buchholz - - * configure.in: - * configure.usage: - - Autodetect NAS. Change Docs accordingly. - - * configure.in: Warn if configure --with-xpm --without-x11. - -1999-12-09 Martin Buchholz - - * configure.in: Clean up sound support. - - variable `old_nas' was used but never set. - - change `with_esd' to `with_esd_sound' for consistency. - - Don't trust the output of `esd-config --libs`; test it. - - Add `esd-config --cflags` to c_switch_site. - - Die if ESD sound requested, but not available. - - ESD is not dependent on X, therefore use LIBS, not libs_x. - -1999-12-07 Martin Buchholz - - * configure.in (--with-sound): Variable with_esd was mispelled. - -1999-12-07 Martin Buchholz - - * XEmacs 21.2.23 is released. - -1999-11-30 Martin Buchholz - - * configure.in: Fix module support. - --with-modules=yes was completely broken. - AC_DEFINE(HAVE_DLFCN_H) was invoked twice. - Remove linking test for _dlopen - seems totally bogus. - Die if --with-modules=yes but no module support found. - Do nothing, not even msg, if --with-modules=no. - -1999-11-17 Isaac Hollander - - * Makefile.in.in: add and use TAR macro. Sometimes tar only copies - symlinks instead of the actual files - -1999-11-30 Martin Buchholz - - * aclocal.m4: Shared library support for hpux >= version 11 - -1999-11-29 Martin Buchholz - - * Makefile.in.in (beta): `make beta' should rebuild info. - -1999-11-29 XEmacs Build Bot - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz - - * XEmacs 21.2.21 is released. - -1999-11-26 Martin Buchholz - - * configure.in: - Add configure support for Unix 98 type ssize_t. - -1999-11-27 Martin Buchholz - - * Makefile.in.in: - Make sure config.values.sh is up to date. - Use $(SHELL) instead of sh or /bin/sh consistently. - Delegate `depend' target to src/Makefile.in.in. - -1999-10-27 Yoshiki Hayashi - - * INSTALL: Update configure option. - -1999-10-12 Alexandre Oliva - - * configure.in (native_sound_lib, *-sgi-*): Check for audio.h. - (LIBS): Check for libCsup. - - * etc/sample.Xdefaults: adds a reference to beNiceToColormap, - so that the user can guess what to do if xemacs' dialogs are - butt ugly. - -1999-10-24 Jan Vroonhof - - * config.h.in: define HAVE_ESD_SOUND - - * configure.in: Add support for esd sound. --with-sound - now accepts a list of options. - * configure.usage (--native-sound-lib): ditto. - -1999-11-17 Martin Buchholz - - * Makefile.in.in (install-arch-dep): - Fix `make install' if prefix != exec_prefix. - -1999-11-15 Martin Buchholz - - * configure.in: - - Accept --with-database=gdbm as an alias for - --with-database=gnudbm. - - rename with_database_gnudbm to with_database_gdbm. - - * aclocal.m4 (ld_dynamic_link_flags): Just use empty value for - ld_dynamic_link_flags on Solaris. Else CC gives us: - CC: Warning: Option -Wl,-Bdynamic passed to ld, if ld is invoked, ignored otherwise - /usr/ccs/bin/ld: illegal option -- W - - -1999-11-13 Jason R Mastaler - - * etc/FTP: Updated FTP mirrors list. Replaced GNU FTP document - with a URL. - -1999-11-13 Jason R Mastaler - - * etc/MAILINGLISTS: Updated mailing list subscription information. - Replaced GNU MAILINGLISTS document with a URL. - -1999-11-10 XEmacs Build Bot - - * XEmacs 21.2.20 is released - -1999-09-21 Martin Buchholz - * configure.in: Autodetect Unix98 PTY - -1999-08-30 Robert Pluim - - * README.packages: Add description of package-get-provider - -1999-10-22 Vin Shelton - - * INSTALL: Added more information about README.packages, and - re-numbered some bullets. - -1999-10-24 Jan Vroonhof - - * INSTALL: Update disk requirements. Refer to README.packages - -1999-10-21 Andy Piper - - * configure.in (all_widgets): Only use xaw3d if we really have it. - -1999-10-06 Andy Piper - - * Makefile.in.in: use WINDOWSNT for mingw install. - -1999-08-01 Adrian Aichner - - * etc/DISTRIB: Update IP address of ftp.xemacs.org. - * etc/NEWS: Fix typo - -1999-09-25 Andy Piper - - * configure.in: check for Xaw3d and use in preference to Xaw - -1999-09-21 Martin Buchholz - - * Makefile.in.in: All Makefiles should #include config.h - -1999-09-19 Michael Sperber [Mr. Preprocessor] - - * configure.in (EMACS_CONFIGURATION): Use $configuration, not - $canonical, so that installation paths and dynamic path setup will - stay in synch. - -1999-09-20 Andy Piper - - * Makefile.in.in: use __CYGWIN32__ and __MINGW32__ to predicate - installation linkage. - -1999-08-29 Andreas Jaeger - - * configure.in (machine): Recognize MIPS/Linux. - -1999-08-27 Jan Vroonhof - - * 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 - (SUBDIR_DISTCLEAN): New variable, add module directories - -1999-09-01 Martin Buchholz - - * 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. - - * Makefile.in.in: fix install-arch-dep for mingw32. - -1999-07-28 Andy Piper - - * config.h.in: add new LWLIB defines. - - * configure.in: fix definitions of widget defines with various - toolkit options. - -1999-07-30 XEmacs Build Bot - - * XEmacs 21.2.19 is released - -1999-07-28 Michael Sperber [Mr. Preprocessor] - - * configure.in: Removed superfluous call to AC_FUNC_MMAP. - -1999-03-07 Gregory Neil Shapiro - - * configure.in: Check for Kerberos and the need for the DES - library before checking for LDAP in case LDAP requires these - libraries. - -1999-07-26 SL Baur - - * configure.in: Rename --with-shlib to --with-modules for - consistency with the other two options that use that name. - - * configure.usage (--with-modules): Document it. - -1999-07-23 Jan Vroonhof - - * 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. - -1999-07-17 MORIOKA Tomohiko - - * etc/HELLO (Thai): Modify for new font. - -1999-07-22 SL Baur - - * configure.in: add sco7 support - From Bob Weiner - -1999-07-22 SL Baur - - * Makefile.in.in (install-arch-dep): Install config.values into - docdir. - From Karl M. Hegbloom - -1999-07-21 SL Baur - - * Makefile.in.in (inststaticdir): New variable. - (instvardir): Ditto. - (install-arch-dep): Use them. - - * configure.in (sitelispdir): Need to use ${PROGNAME}. - (sitemoduledir): Ditto. - (inststaticdir): New variable. - (instvardir): Ditto. - (infodir): Use them. - (lispdir): Ditto. - (moduledir): Ditto. - (pkgdir): Ditto. - (etcdir): Ditto. - (lockdir): Ditto. - (archlibdir): Ditto. - -1999-07-14 SL Baur - - * InfoDock 4.0.8 is released - -1999-07-13 XEmacs Build Bot - - * XEmacs 21.2.18 is released - -1999-07-06 SL Baur - - * config.guess (main): Synch with newer config.guess for HP - support. - From Marcus Thiessel - -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 - binary. - -1999-07-03 Andy Piper - - * configure.usage (--with-widgets): add. - -1999-07-02 Andy Piper - - * configure.in: Make sure we get motif in lwlib if we have widgets - and motif. - -1999-06-25 SL Baur - - * configure.in (version): Fix --with-infodock test. - -1999-06-15 Michael Sperber [Mr. Preprocessor] - - * configure.in: --prefix and --exec-prefix are now only compiled - into the binary if user-defined. - -1999-03-23 Michael Sperber [Mr. Preprocessor] - - * configure.in: Made docdir configurable. - - * Makefile.in (docdir): Added variable for custom DOC directory. - -1999-06-22 XEmacs Build Bot - - * XEmacs 21.2.17 is released - -1999-06-13 Oscar Figueiredo - - * configure.in (with_ldap): Check libldap independently of liblber - Do not test alternate library names such as libldap10 - Test the presence of a variety of LDAP API functions which were - formerly assumed to be present according to dubious heuristics - -1999-06-11 XEmacs Build Bot - - * XEmacs 21.2.16 is released - -1999-06-04 SL Baur - - * configure.in (CPP): Correct test for locating $site_prefix - include directories. - -1999-06-04 XEmacs Build Bot - - * XEmacs 21.2.15 is released - -1999-06-01 Gunnar Evermann - - * README.packages: fix typos: user pacakge hierarchy is ~/.xemacs - From: Eric Veldhuyzen - -1999-05-25 Jan Vroonhof - - * configure.in: For non-beta's use x.y.z format for version strings. - -1999-06-03 SL Baur - - * version.sh: add emacs_is_beta initialization - - * configure.in: Implement patch levels in version number - From Jan Vroonhof - - * configure.in: - * configure.usage: - * config.h.in: Rename session option to wmcommand. - From Oliver Graf - -1999-05-16 Mike McEwan - - * info/dir: Add `emodules.info' entry to the top info dir. - -1999-05-31 SL Baur - - * configure.in (CPP): Don't check for include subdirectories in - site-prefix directories. This check loses in valid configurations - like /usr/jp in TurboLinux. Conditionally add include directory to - site switches. - -1999-05-14 Hrvoje Niksic - - * configure.in (quoted_arguments): Support - --error-checking=byte-code. - 1999-05-14 XEmacs Build Bot * XEmacs 21.2.14 is released @@ -836,7 +8,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 @@ -906,7 +78,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 @@ -927,29 +99,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 @@ -984,10 +156,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 @@ -1136,7 +308,7 @@ * etc/check_cygwin_setup.sh: fix a couple of buglets. -1998-08-23 Adrian Aichner +1998-08-23 Adrian Aichner * etc/sample.emacs: Enable sound support on mswindows devices. @@ -1147,7 +319,7 @@ conditions for both PNG and XPM, stop screaming if png is not found and no window-system is selected, and fixed a bug in the XPM checking. -1998-08-06 Adrian Aichner +1998-08-06 Adrian Aichner * etc/TUTORIAL.de: Fixing typos and grammatical errors. Fixing inconsistent usage of RET, , and (only using @@ -1702,7 +874,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. @@ -1965,7 +1137,7 @@ * etc/aliases.ksh: Add `mak' function to create beta.err for build-report. - From Adrian Aichner + From Adrian Aichner Suggested by Karl M. Hegbloom 1998-01-27 SL Baur @@ -2047,7 +1219,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. @@ -2363,7 +1535,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 @@ -2379,13 +1551,13 @@ * lwlib/lwlib-Xm.c(update_one_menu_entry): Add missing variable. From Skip Montanaro -1997-11-04 Adrian Aichner +1997-11-04 Adrian Aichner * etc/TUTORIAL.de: Updated copyright information. Translated most of the COPYING section. Translated the <<.*>> didactic line. -1997-10-22 Adrian Aichner +1997-10-22 Adrian Aichner * etc/TUTORIAL.de: Fixed two issues reported by Achim Oppelt @@ -2398,12 +1570,12 @@ Applied patches supplied by Marc Aurel <4-tea-2@bong.saar.de>. They fix yet more typos and quite a few awkward sentences. -1997-10-21 Adrian Aichner +1997-10-21 Adrian Aichner * etc/TUTORIAL.de: Manually merged a few more corrections by Carsten Leonhardt -1997-10-20 Adrian Aichner +1997-10-20 Adrian Aichner * etc/TUTORIAL.de: Applied patches from Andreas Jaeger to 1.2, @@ -2534,7 +1706,7 @@ 1997-10-18 SL Baur - * XEmacs 20.3-beta91 is released. + * XEmacs 20.3-beta91 is released. 1997-10-16 Hrvoje Niksic @@ -3856,7 +3028,7 @@ Sat Mar 22 21:27:41 1997 Tomasz J. Cholewo - * configure.in: Echo only current configuration using 'tee -a'. + * configure.in: Echo only current configuration using 'tee -a'. Fri Mar 21 21:26:01 1997 Steven L Baur @@ -4284,3 +3456,5 @@ Thu Dec 5 11:56:05 1996 Joseph J Nuspl * configure.in (LIBS): Fix typo in dialog box test. + + diff -r 12e008d41344 -r 697ef44129c6 INSTALL --- a/INSTALL Mon Aug 13 11:19:22 2007 +0200 +++ b/INSTALL Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,8 @@ XEmacs Installation Guide Copyright (c) 1994, 1995, 1996 Board of Trustees, University of Illinois -Copyright (c) 1994-1999 Free Software Foundation, Inc. +Copyright (c) 1994 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 @@ -16,40 +18,32 @@ of the Free Software Foundation are approved by the Foundation. -BUILDING AND INSTALLATION FOR UNIX AND CYGWIN +BUILDING AND INSTALLATION (Unix and Cygwin, see the file nt/README +for instructions on building under Microsoft Windows): -(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. 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. - -Building XEmacs requires about 100 Mb of disk space (including the -XEmacs sources). Once installed, XEmacs occupies between 20 and 100 Mb -in the file system where it is installed; this includes the executable files, -Lisp libraries, miscellaneous data files, and on-line documentation. The -exact amount depends greatly on the number of extra lisp packages that are -installed +Building XEmacs requires about 41 Mb of disk space (including the +XEmacs sources). Once installed, XEmacs occupies about 16 Mb in the +file system where it is installed; this includes the executable files, +Lisp libraries, miscellaneous data files, and on-line documentation. +The amount of storage of the Lisp directories may be reduced by +compressing the .el files. If the building and installation take place +in different directories, then the installation procedure temporarily +requires 41+16 Mb. Adjust this value upwards depending upon what +additional Lisp support is installed. XEmacs requires an ANSI C compiler, such as GCC. If you wish to build the documentation yourself, you will need at least version 1.68 of makeinfo (GNU texinfo-3.11). -ADD-ON LIBRARIES -================ -Decide on what other software packages you would like to use with +2) 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 @@ -71,24 +65,28 @@ XEmacs to allow configure to find the external software packages. If you link with dynamic (``.so'') external package libraries, which is not recommended, you will also need to add the library directories -to the --site-runtime-libraries option. For your convenience these can -be set together by using the --with-site-prefix command. This will set -these variables as needed assuming your libraries are organised as a -typical /usr tree. +to the --site-runtime-libraries option. -PACKAGE SYSTEM -============== -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! +3) 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. See the file etc/PACKAGES for an overview +of what is available and which packages need to be installed prior to +building XEmacs. At this point you only need a minimum to get started +at which point you may install what you wish without further changes +to the XEmacs binary. A sample minimum configuration for a Linux +system using Mule and Wnn6 from OMRON corporation would be the +packages `mule-base' and `egg-its'. By default, packages will be +searched for in the path -CONFIGURATION OPTIONS -===================== +~/.xemacs::$prefix/lib/xemacs-${version}/mule-packages:$prefix/lib/xemacs/mule-packages:$prefix/lib/xemacs-${version}/xemacs-packages:$prefix/lib/xemacs/xemacs-packages -In the top level directory of the XEmacs distribution, run the -program `configure' as follows: +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: ./configure [CONFIGURATION-NAME] [--OPTION[=VALUE]] ... @@ -162,9 +160,13 @@ 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'. Create separate +supports the `VPATH' variable, such as GNU `make'. Make 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. @@ -188,17 +190,12 @@ EXECDIR/lib/xemacs-VERSION/CONFIGURATION-NAME. EXECDIR/bin should be a directory that is normally in users' PATHs. -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. +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. The `--with-menubars=TYPE' option allows you to specify which X toolkit you wish to use for the menubar. The valid options are @@ -292,17 +289,17 @@ of the relocating allocator. Turning on --rel-alloc will allow XEmacs to return unused memory to the operating system, thereby reducing its memory footprint. However, it may make XEmacs runs more slowly, -especially if your system's `mmap' implementation is missing or +especially if your system's `mmap' implemntation is missing or inefficient. Generally, it's best to go with the default configuration for your system. You can tweak this based on how you use XEmacs, and the memory and cpu resources available on your system. -The `--with-system-malloc' option can be use to either enable or +The `--use-system-malloc' option can be use to either enable or disable use of the system malloc. Generally, it's best to go with the default configuration for your system. Note that on many systems using the system malloc disables the use of the relocating allocator. -The `--with-debug-malloc' option can be used to link a special debugging +The `--use-debug-malloc' option can be used to link a special debugging version of malloc. Debug Malloc is not included with XEmacs, is intended for use only by the developers and may be obtained from . @@ -320,7 +317,7 @@ contains the results of the compile and link tests used by configure. The `--with-mule' option enables (MUlti-Lingual Emacs) support, needed -to support non-Latin-1 (including Asian) languages. The Mule support +to suport 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: @@ -370,35 +367,24 @@ `--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'. -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, +4) 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") @@ -417,16 +403,17 @@ XEmacs cannot detect, you may need to change the value of `directory-abbrev-alist'. -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 +5) 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. @@ -435,18 +422,12 @@ The `site-*.el' files are nonexistent in the distribution. You do not need to create them if you have nothing to put in them. -TERMCAP CONFIGURATION -===================== - -Refer to the file `./etc/TERMS' for information on fields you may +6) 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. -RUNNING MAKE -============ - -Run `make' in the top directory of the XEmacs distribution to finish +7) 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 @@ -518,7 +499,27 @@ 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. +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. + +8) 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. + +9) 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'. + +10) 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 You can change where the build process installs XEmacs and its data files by specifying values for `make' variables as part of the `make' @@ -629,18 +630,14 @@ above), is `/usr/local/lib/xemacs-VERSION/CONFIGURATION-NAME' (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 to the value of `archlibdir' - (see above). - `moduledir' indicates where XEmacs installs and expects to find any dynamic modules. Its default value, based on `archlibdir' (see above) is `/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- - dependent, and care should be taken not to set this directory - to a system- or architecture-independent directory. + dependant, and care should be taken not to set this directory + to a system- or architecture-independant 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 @@ -654,37 +651,130 @@ Makefiles for the subdirectories, so you don't have to specify them when running make in the subdirectories. -Using GNU Make allows for simultaneous builds with and without the ---srcdir option. + +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'. -MAIL-LOCKING POST-INSTALLATION -============================== +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. + +2) 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'. -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. +3) 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'. -CLEANING UP -========== +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'. -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'. +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. -READ README.packages -==================== +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'. -Do it! +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. + 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 -without downloading some additional packages. 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 12e008d41344 -r 697ef44129c6 Makefile.in.in --- a/Makefile.in.in Mon Aug 13 11:19:22 2007 +0200 +++ b/Makefile.in.in Mon Aug 13 11:20:41 2007 +0200 @@ -49,9 +49,6 @@ ## make extraclean ## Still more severe - delete backup and autosave files, too. -#define NOT_C_CODE -#include "src/config.h" - #ifdef USE_GNU_MAKE RECURSIVE_MAKE=$(MAKE) #else @@ -63,9 +60,7 @@ LANG = C LC_ALL = C RM = rm -f -MAKEPATH=./lib-src/make-path pwd = /bin/pwd -TAR = tar ## ==================== Things `configure' Might Edit ==================== @@ -98,14 +93,6 @@ ## not need to change them. This defaults to /usr/local. prefix=@prefix@ -## Variable data (as per each program update) goes here -## The default is ${PROGNAME} -inststaticdir=@inststaticdir@ - -## Static data (constant across program updates) goes here -## The default is ${PROGNAME}-${version} -instvardir=@instvardir@ - ## Like `prefix', but used for architecture-specific files. exec_prefix=@exec_prefix@ @@ -204,9 +191,6 @@ ## currently being edited. lockdir=@lockdir@ -## Where to put the DOC file. -docdir=@docdir@ - ## Where to put executables to be run by XEmacs rather than ## the user. This path usually includes the XEmacs version ## and configuration name, so that multiple configurations @@ -229,10 +213,7 @@ MAKE_SUBDIR = @MAKE_SUBDIR@ ## Subdirectories that can be made recursively. -SUBDIR = ${MAKE_SUBDIR} man - -## Subdirectories that must be cleaned on distclean -SUBDIR_DISTCLEAN = ${SUBDIR} modules/sample modules/ldap modules/zlib modules/base64 +SUBDIR = ${MAKE_SUBDIR} man ## The makefiles of the directories in ${MAKE_SUBDIR}. SUBDIR_MAKEFILES = @SUBDIR_MAKEFILES@ @@ -261,7 +242,7 @@ .PHONY: ${SUBDIR} all beta all-elc all-elcs dump-elc dump-elcs autoloads finder ## Convenience target for XEmacs beta testers -beta: clean all-elc finder info +beta: clean all-elc finder ## Convenience target for XEmacs maintainers ## This would run `make-xemacsdist' if I were really confident that everything @@ -275,49 +256,30 @@ ## - src/depend from src/*.[ch] .PHONY: config configure depend config: configure depend -configure: ${srcdir}/configure ${srcdir}/lib-src/config.values.in - -${srcdir}/configure : ${srcdir}/configure.in +configure: ${srcdir}/configure +${srcdir}/configure: ${srcdir}/configure.in cd ${srcdir} && autoconf + cd ${srcdir} && /bin/sh lib-src/config.values.sh -${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 ${srcdir}/src && \ + perl ./make-src-depend > depend.tmp && \ + $(RM) depend && mv depend.tmp 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 + MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-elc.sh ## Sub-target for all-elc. dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs cd ./src && $(RECURSIVE_MAKE) dump-elcs -autoloads: lisp/auto-autoloads.el lisp/custom-load.el +autoloads: src + MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-autoloads.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 +custom-loads: + MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-custom.sh finder: src @echo "Building finder database ..." @@ -344,7 +306,7 @@ @(echo "/* Do not edit this file!" ; \ echo " Automatically generated from ${srcdir}/etc/Emacs.ad" ; \ echo " */" ; \ - $(SHELL) ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \ + /bin/sh ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \ src/Emacs.ad.h src/sheap-adjust.h: @@ -431,33 +393,21 @@ if test -f ../Installation; then \ ${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \ fi; \ - ${INSTALL_DATA} lib-src/config.values ${docdir}/config.values; \ - ${INSTALL_DATA} lib-src/DOC ${docdir}/DOC; \ + for f in DOC config.values; do \ + ${INSTALL_DATA} lib-src/$${f} ${archlibdir}/$${f}; \ + done ; \ 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 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 CYGWIN - cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${PROGNAME} -# else cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME} -# endif /* CYGWIN */ -#endif /* WIN32_NATIVE */ if test "${prefix}" != "${exec_prefix}"; then \ - $(MAKEPATH) ${exec_prefix}/lib/${instvardir}; \ for dir in \ - lib/${inststaticdir} \ - lib/${instvardir}/etc \ - lib/${instvardir}/info \ - lib/${instvardir}/lisp; do \ + lib/${PROGNAME} \ + lib/${PROGNAME}-${version}/etc \ + lib/${PROGNAME}-${version}/info \ + lib/${PROGNAME}-${version}/lisp; do \ if test ! -d ${exec_prefix}/$${dir}; then \ $(LN_S) ${prefix}/$${dir} ${exec_prefix}/$${dir}; fi; \ done; \ @@ -482,8 +432,8 @@ -a "`(cd $${dir} && $(pwd))`" != \ "`(cd $${dest} && $(pwd))`" \ && (echo "Copying $${dir}..." ; \ - (cd $${dir} && $(TAR) -cf - . ) | \ - (cd $${dest} && umask 022 && $(TAR) -xf - );\ + (cd $${dir} && tar -cf - . ) | \ + (cd $${dest} && umask 022 && tar -xf - );\ chmod 0755 $${dest}; \ for subdir in `find $${dest} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \ (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \ @@ -499,6 +449,7 @@ chmod 0644 ${infodir}/$${file}; \ done ; \ fi + ## Note it's `xemacs' not ${PROGNAME} cd ${srcdir}/etc && \ for page in xemacs etags ctags gnuserv gnuclient gnuattach gnudoit; do \ ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext} ; \ @@ -512,14 +463,15 @@ @echo "${lispdir}" gzip-el: - $(SHELL) ${srcdir}/lib-src/gzip-el.sh ${lispdir} + ${srcdir}/lib-src/gzip-el.sh ${lispdir} +MAKEPATH=./lib-src/make-path ## Build all the directories to install XEmacs in. ## Since we may be creating several layers of directories, ## (e.g. /usr/local/lib/${PROGNAME}-20.5/sparc-sun-solaris2.6), we use ## make-path instead of mkdir. Not all mkdirs have the `-p' flag. mkdir: FRC.mkdir - ${MAKEPATH} ${COPYDESTS} ${lockdir} ${docdir} ${infodir} ${archlibdir} \ + ${MAKEPATH} ${COPYDESTS} ${lockdir} ${infodir} ${archlibdir} \ ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir} \ ${sitelispdir} ${moduledir} ${sitemoduledir} -chmod 0777 ${lockdir} @@ -591,10 +543,10 @@ $(RM) config.status config.log confdefs.h config-tmp-* build-install Installation ; \ $(RM) core .sbinit lock/* GNUmakefile Makefile Makefile.in ; \ $(RM) lisp/finder-inf.el* Installation.el Installation.elc ; \ - $(RM) -r site-packages xemacs-packages mule-packages site-lisp + $(RM) packages mule-packages site-lisp distclean: FRC.distclean - for d in $(SUBDIR_DISTCLEAN); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done -${top_distclean} ## `realclean' diff -r 12e008d41344 -r 697ef44129c6 PROBLEMS --- a/PROBLEMS Mon Aug 13 11:19:22 2007 +0200 +++ b/PROBLEMS Mon Aug 13 11:20:41 2007 +0200 @@ -41,8 +41,8 @@ There have been reports of egcs-1.1 not compiling XEmacs correctly on Alpha Linux. There have also been reports that egcs-1.0.3a is O.K. -*** Don't use -O2 or -O3 with Cygwin 1.0, CodeFusion-99070 or gcc 2.7.2 on x86 -without also using `-fno-strength-reduce'. +*** Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using +`-fno-strength-reduce'. gcc will generate incorrect code otherwise. This bug is present in at least 2.6.x and 2.7.[0-2]. This bug has been fixed in GCC 2.7.2.1 and @@ -50,25 +50,6 @@ This problem is known to be fixed in egcs (or pgcc) 1.0 or later. -Unfortunately, later releases of Cygnus-released compilers (not the -Net-released ones) have a bug with the same `problem signature'. - -If you're lucky, you'll get an error while compiling that looks like: - -event-stream.c:3189: internal error--unrecognizable insn: -(insn 256 14 15 (set (reg/v:SI 24) - (minus:SI (reg/v:SI 25) - (const_int 2))) -1 (insn_list 11 (nil)) - (nil)) - 0 0 [main] - -If you're unlucky, your code will simply execute incorrectly. - -*** Don't use gcc-2.95.2 with -mcpu=ultrasparc on Solaris 2.6. - -gcc will assume a 64-bit operating system, even though you've -merely told it to assume a 64-bit instruction set. - *** Don't use -O2 with gcc 2.7.2 under Intel architectures without also using `-fno-caller-saves'. @@ -144,15 +125,9 @@ ** AIX *** On AIX 4.3, you must specify --with-dialogs=athena with configure -*** 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. +*** 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. *** On AIX, you get this compiler error message: @@ -400,25 +375,24 @@ *** 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. - (also appears on AIX as reported in comp.emacs.xemacs) +*** On HP-UX 11.0 XEmacs causes excessive X11 errors when running. -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 + Unfortunately, XEmacs releases <21.0 don't work with Motif2.1. It + will compile but you will get excessive X11 errors like xemacs: X Error of failed request: BadGC (invalid GC parameter) @@ -431,19 +405,6 @@ 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: @@ -581,23 +542,17 @@ *** You type Control-H (Backspace) expecting to delete characters. Emacs has traditionally used Control-H for help; unfortunately this -interferes with its use as Backspace on TTY's. As of XEmacs 21, -XEmacs looks at the "erase" setting of TTY structures and maps C-h to -backspace when erase is set to C-h. This is sort of a special hack, -but it makes it possible for you to use the standard: - - stty erase ^H +interferes with its use as Backspace on TTY's. One way to solve this +problem is to put this in your .emacs: -to get your backspace key to erase characters. The erase setting is -recorded in the Lisp variable `tty-erase-char', which you can use to -tune the settings in your .emacs. + (when (eq tty-erase-char ?\C-h) + (keyboard-translate ?\C-h ?\C-?) + (global-set-key "\M-?" 'help-command)) -A major drawback of this is that when C-h becomes backspace, it no -longer invokes help. In that case, you need to use f1 for help, or -bind another key. An example of the latter is the following code, -which moves help to Meta-? (ESC ?): +This checks whether the TTY erase char is C-h, and if it is, makes +Control-H (Backspace) work sensibly, and moves help to Meta-? (ESC ?). - (global-set-key "\M-?" 'help-command) +Note that you can probably also access help using F1. *** Mail agents (VM, Gnus, rmail) cannot get new mail @@ -1458,60 +1413,6 @@ 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 12e008d41344 -r 697ef44129c6 README --- a/README Mon Aug 13 11:19:22 2007 +0200 +++ b/README Mon Aug 13 11:20:41 2007 +0200 @@ -16,9 +16,6 @@ See the file `nt/README' for instructions on building XEmacs for Microsoft Windows. -The file 'README.packages' will guide you in the installation of -(essential) add on packages. - Reports of bugs in XEmacs should be posted to the newsgroup comp.emacs.xemacs or sent to the mailing list xemacs@xemacs.org. See the "Bugs" section of the XEmacs manual for more information on how to @@ -59,5 +56,8 @@ `info' holds the Info documentation tree for XEmacs. `man' holds the source code for the XEmacs info documentation tree. +`msdos' holds configuration files for compiling XEmacs under MSDOG. + See the file etc/MSDOS for more information. + `nt' holds configuration files for compiling XEmacs under Microsoft Windows NT. The support for NT is very tentative right now. diff -r 12e008d41344 -r 697ef44129c6 README.packages --- a/README.packages Mon Aug 13 11:19:22 2007 +0200 +++ b/README.packages Mon Aug 13 11:20:41 2007 +0200 @@ -9,10 +9,8 @@ ------------------------ Q. Do I need to have the packages to compile XEmacs? -A. No, XEmacs will build and install just fine without any packages - installed. However, only the most basic editing functions will be - available with no packages installed, so installing packages is an - essential part of making your installed XEmacs _useful_. +A. If you want to compile with MULE, you need the mule-base package installed. + Otherwise, no package is required before compilation. Q. I really liked the old way that packages were bundled and do not want to mess with packages at all. @@ -22,11 +20,11 @@ A note of caution ----------------- -The XEmacs package system is still in its infancy. Please expect a few -minor hurdles on the way. Also neither the interface nor the structure is +The XEmacs package system is still in its infancy. Please expect a few +minor hurdles on the way. Also neither the interface nor the structure is set in stone. The XEmacs maintainers reserve the right to sacrifice backwards compatibility as quirks are worked out over the coming -releases. +releases. Some Package Theory ------------------- @@ -37,7 +35,7 @@ Each elisp add-on (or groups of them when they are small) now comes in its own tarball that contains a small search hierarchy. -You select just the ones you need. Install them by untarring them into +You select just the ones you need. Install them by untarring them into the right place. On startup XEmacs will find them, set up the load path correctly, install autoloads, etc, etc. @@ -62,7 +60,7 @@ ------------------------- Packages are available from ftp://ftp.xemacs.org/pub/xemacs/packages -and its mirrors. +and its mirror. How to install the packages --------------------------- @@ -75,14 +73,14 @@ ---------------- Those with little time, cheap connections and plenty of disk space can -install all the packages at once using the sumo tarballs. +install all packages at once using the sumo tarballs. Download the file -xemacs-sumo.tar.gz +xemacs-sumo-.tar.gz For an XEmacs compiled with Mule you also need -xemacs-mule-sumo.tar.gz +xemacs-mule-sumo-.tar.gz N.B. They are called 'Sumo Tarballs' for good reason. They are currently about 15MB and 2.3MB (gzipped) respectively. @@ -122,8 +120,8 @@ installing easier. It will notice if new packages or versions are available and will fetch them from the ftp site. -Unfortunately this requires that a few packages are already in place. -You will have to install them by hand as above or use a SUMO tarball. +Unfortunately this requires that a few packages are already in place. +You will have to install them by hand as above or use a SUMO tarball. This requirement will hopefully go away in the future. The packages you need are: @@ -134,7 +132,7 @@ mailcrypt - If you have PGP installed and want to verify the signature of the index file. - mule-base - Needed if you want to use XEmacs with MULE. + mule-base - Needed if you want to compile XEmacs with MULE. After installing these by hand, you can start XEmacs. (It is a good idea to use 'xemacs -vanilla' here as your startup files might need @@ -166,7 +164,7 @@ - When you are finished choosing packages, invoke 'Packages->Install/Remove Select' from the menu or type 'x' to begin installing packages. - + After Installation ------------------ @@ -175,7 +173,7 @@ Note to MULE users ------------------ -Unlike all other packages the mule-base package is used at build/dump +Unlike all other packages the mule-base package is used at build/dump time. This means that you need this available before compiling XEmacs with MULE. Also it is a good idea to keep packages that are MULE-only separate by putting them in the mule-packages hierarchy. @@ -202,7 +200,7 @@ --------------------------- As the exact files and their locations contained in a package may -change it is recommended to remove a package first before installing a +change it is recommend to remove a package first before installing a new version. In order to facilitate removal each package contains an pgkinfo/MANIFEST.pkgname file which list all the files belong to the package. M-x package-admin-delete-binary-package RET can be used to @@ -215,9 +213,10 @@ ------------------------ In addition to the system wide packages, each user can have his own -packages installed in "~/.xemacs/xemacs-packages". If you want to +packages installed in "./xemacs" (Note that this will most likely +change to "./xemacs/packages" in the near future). If you want to install packages there using the interactive tools, you need to set -'pui-package-install-dest-dir' to "~/.xemacs/xemacs-packages" +'pui-package-install-dest-dir' to "/xemacs" Site lisp/Site start -------------------- @@ -226,13 +225,3 @@ XEmacs no longer looks into a 'site-lisp' directly by default. A good place to put 'site-start.el' would be in $prefix/lib/xemacs/site-packages/lisp/ - -Finding the right packages --------------------------- - -If you want to find out which package contains the functionality you -are looking for, use M-x package-get-package-provider, and give it a -symbol that is likely to be in that package. For example, if some -code you want to use has a (require 'thingatpt) in it, try doing -M-x package-get-package-provider RET thingatpt , which will return -something like: (fsf-compat "1.06"). diff -r 12e008d41344 -r 697ef44129c6 aclocal.m4 --- a/aclocal.m4 Mon Aug 13 11:19:22 2007 +0200 +++ b/aclocal.m4 Mon Aug 13 11:20:41 2007 +0200 @@ -92,7 +92,7 @@ # PIC is the default for these OSes. ;; - aix3* | aix4* | os2*) + os2*) # We can build DLLs from non-PIC. ;; amigaos*) @@ -101,9 +101,6 @@ # like `-m68040'. dll_cflags='-m68020 -resident32 -malways-restore-a4' ;; - *cygwin* | *mingw* ) - # PIC is the default - ;; *) dll_cflags='-fPIC' ;; @@ -111,7 +108,7 @@ else # PORTME Check for PIC flags for the system compiler. case "$xehost_os" in - hpux9* | hpux1[[0-9]]*) + hpux9* | hpux10*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' dll_cflags='+Z' @@ -389,7 +386,6 @@ 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. @@ -573,7 +569,7 @@ ;; solaris2* | solaris7*) - ld_dynamic_link_flags= + ld_dynamic_link_flags="${wl}-Bdynamic" ;; sco3.2v5* | unixware* | sysv5* | sysv4*) diff -r 12e008d41344 -r 697ef44129c6 config.guess --- a/config.guess Mon Aug 13 11:19:22 2007 +0200 +++ b/config.guess Mon Aug 13 11:20:41 2007 +0200 @@ -1,10 +1,7 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. - -version='2000-05-30' - +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. +# # 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 @@ -25,7 +22,7 @@ # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . -# Please send patches to . +# The master version of this file is at the FSF in /home/gd/gnu/lib. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -38,60 +35,6 @@ # (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 - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then @@ -103,49 +46,11 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 +trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 # 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}'` @@ -154,62 +59,46 @@ # A Tn.n version is a released field test version. # 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 + cat <dummy.s .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 + .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 EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + ${CC-cc} dummy.s -o dummy 2>/dev/null if test "$?" = 0 ; then - case `./$dummy` in - 0-0) + ./dummy + case "$?" in + 7) UNAME_MACHINE="alpha" ;; - 1-0) + 15) UNAME_MACHINE="alphaev5" ;; - 1-1) + 14) UNAME_MACHINE="alphaev56" ;; - 1-101) + 10) UNAME_MACHINE="alphapca56" ;; - 2-303) + 16) UNAME_MACHINE="alphaev6" ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; esac fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 @@ -217,6 +106,9 @@ 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 ;; @@ -241,16 +133,16 @@ wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; 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;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 @@ -258,7 +150,7 @@ echo pyramid-pyramid-bsd fi exit 0 ;; - NILE*:*:*:dcosx) + NILE:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) @@ -303,38 +195,21 @@ 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 - # > 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 - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${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 ;; @@ -347,6 +222,9 @@ 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 ;; @@ -356,17 +234,12 @@ VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) + 2020:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; 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[]; { -#endif + sed 's/^ //' << EOF >dummy.c + int main (argc, argv) int argc; char **argv; { #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); @@ -381,10 +254,10 @@ exit (-1); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + ${CC-cc} dummy.c -o dummy \ + && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -402,18 +275,15 @@ AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then echo m88k-dg-dgux${UNAME_RELEASE} - else + else echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 @@ -439,7 +309,7 @@ exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >dummy.c #include main() @@ -450,8 +320,8 @@ exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -479,7 +349,7 @@ ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) @@ -498,27 +368,25 @@ case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE + 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + sed 's/^ //' << EOF >dummy.c #include #include - + int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); - #endif + #endif long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) + + switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: + case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) - switch (bits) + switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; @@ -526,20 +394,20 @@ } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; - #endif + #endif default: puts ("hppa1.0"); break; } exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy + ${CC-cc} dummy.c -o dummy && HP_ARCH=`./dummy` + rm -f dummy.c dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >dummy.c #include int main () @@ -564,8 +432,8 @@ exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -574,9 +442,6 @@ 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; @@ -593,9 +458,6 @@ parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -626,60 +488,48 @@ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 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:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + i?86:BSD/386:*:* | *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) 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 ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo ${UNAME_MACHINE}-pc-cygwin32 exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo powerpcle-unknown-cygwin32 exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -688,11 +538,15 @@ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` + # first see if it will tell us. + ld_help_string=`ld --help 2>&1` ld_supported_emulations=`echo $ld_help_string \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g @@ -700,146 +554,68 @@ s/ .*// p'` case "$ld_supported_emulations" in - *ia64) - echo "${UNAME_MACHINE}-unknown-linux" - exit 0 - ;; - i?86linux) - 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 - ;; - sparclinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - armlinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32arm*) - echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" - exit 0 - ;; - armelf_linux*) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; - m68klinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32ppc | elf32ppclinux) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) echo "powerpc-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 +EOF + LIBC="" + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >dummy.c </dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - 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 - 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 - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - 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[]; { -#endif #ifdef __MIPSEB__ printf ("%s-unknown-linux-gnu\n", argv[1]); #endif @@ -849,10 +625,8 @@ return 0; } 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 + ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. @@ -871,14 +645,12 @@ ;; esac # Determine whether the default compiler is a.out or elf - cat >$dummy.c <dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif +main(argc, argv) + int argc; + char *argv[]; +{ #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 @@ -895,8 +667,8 @@ return 0; } 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 + ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. @@ -912,20 +684,10 @@ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; i?86:*:3.2:*) @@ -937,20 +699,19 @@ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i?86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + i?86:UnixWare:*:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + fi + echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} 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 @@ -991,7 +752,7 @@ mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + i?86:LynxOS:2.*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) @@ -1003,9 +764,6 @@ SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; @@ -1036,7 +794,7 @@ news*:NEWS-OS:*:6*) echo mips-sony-newsos6 exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else @@ -1052,45 +810,12 @@ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *: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-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 #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 -cat >$dummy.c <dummy.c < # include @@ -1128,10 +853,7 @@ #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); exit (0); #endif @@ -1191,8 +913,8 @@ } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy +${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 +rm -f dummy.c dummy # Apollos put the system type in the environment. @@ -1224,47 +946,6 @@ esac fi -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 +#echo '(Unable to guess system type)' 1>&2 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 12e008d41344 -r 697ef44129c6 config.sub --- a/config.sub Mon Aug 13 11:19:22 2007 +0200 +++ b/config.sub Mon Aug 13 11:20:41 2007 +0200 @@ -1,10 +1,6 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. - -version='2000-05-31' - +# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. # 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. @@ -29,9 +25,6 @@ # 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. @@ -52,61 +45,30 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -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." +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 -# 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;; +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; 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 - nto-qnx* | linux-gnu*) + linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -136,21 +98,11 @@ os= basic_machine=$1 ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; -hiux*) os=-hiuxwe2 ;; -sco5) - os=-sco3.2v5 + os=sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) @@ -169,9 +121,6 @@ os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -194,36 +143,22 @@ -psos*) os=-psos ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + tahoe | i860 | 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 \ - | 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 | avr) + | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | v850) basic_machine=$basic_machine-unknown ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) - ;; - # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -236,49 +171,27 @@ exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | 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-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-*) + | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; alliant | fx80) basic_machine=fx80-alliant ;; @@ -308,10 +221,6 @@ basic_machine=m68k-apollo os=-sysv ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; aux) basic_machine=m68k-apple os=-aux @@ -388,10 +297,6 @@ encore | umax | mmax) basic_machine=ns32k-encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; fx2800) basic_machine=i860-alliant ;; @@ -410,14 +315,6 @@ basic_machine=h8300-hitachi os=-hms ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; harris) basic_machine=m88k-harris os=-sysv3 @@ -433,30 +330,13 @@ basic_machine=m68k-hp os=-hpux ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) + hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) @@ -465,16 +345,9 @@ hppa-next) os=-nextstep3 ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; i370-ibm* | ibm*) basic_machine=i370-ibm + os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[34567]86v32) @@ -493,22 +366,6 @@ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -537,10 +394,6 @@ miniframe) basic_machine=m68000-convergent ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu @@ -555,34 +408,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 - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos @@ -595,10 +424,6 @@ basic_machine=mips-sony os=-newsos ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; next | m*-next ) basic_machine=m68k-next case $os in @@ -624,28 +449,9 @@ basic_machine=i960-intel os=-nindy ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; np1) basic_machine=np1-gould ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -663,19 +469,19 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexen) + pentium | p5 | k5 | nexen) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | k6 | 6x86) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i786-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) + pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) + pentiumpro-* | p6-* | k6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) @@ -699,20 +505,12 @@ ps2) basic_machine=i386-ibm ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; sequent) basic_machine=i386-sequent ;; @@ -720,10 +518,6 @@ basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; sps7) basic_machine=m68k-bull os=-sysv2 @@ -731,13 +525,6 @@ spur) basic_machine=spur-unknown ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; sun2) basic_machine=m68000-sun ;; @@ -778,18 +565,10 @@ sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; symmetry) basic_machine=i386-sequent os=-dynix ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; tx39) basic_machine=mipstx39-unknown ;; @@ -807,10 +586,6 @@ basic_machine=a29k-nyu os=-sym1 ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; vaxv) basic_machine=vax-dec os=-sysv @@ -834,14 +609,6 @@ basic_machine=a29k-wrs os=-vxworks ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; xmp) basic_machine=xmp-cray os=-unicos @@ -849,10 +616,6 @@ xps | xps100) basic_machine=xps100-honeywell ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -860,15 +623,6 @@ # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown @@ -891,7 +645,7 @@ we32k) basic_machine=we32k-att ;; - sparc | sparcv9) + sparc) basic_machine=sparc-sun ;; cydra) @@ -903,16 +657,6 @@ orion105) basic_machine=clipper-highlevel ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -966,34 +710,13 @@ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit*) + | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos*) # 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* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1003,12 +726,6 @@ -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; -osfrose*) os=-osfrose ;; @@ -1024,18 +741,12 @@ -acis*) os=-aos ;; - -386bsd) - os=-bsd - ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; - -nsk) - os=-nsk - ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -1061,18 +772,9 @@ # This must come after -sysvr4. -sysv*) ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; -xenix) os=-xenix ;; - -*mint | -*MiNT) - os=-mint - ;; -none) ;; *) @@ -1098,9 +800,6 @@ *-acorn) os=-riscix1.2 ;; - arm*-rebel) - os=-linux - ;; arm*-semi) os=-aout ;; @@ -1122,15 +821,6 @@ # default. # os=-sunos4 ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -1143,15 +833,6 @@ *-ibm) os=-aix ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; *-hp) os=-hpux ;; @@ -1215,18 +896,6 @@ f301-fujitsu) os=-uxpv ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; *) os=-none ;; @@ -1248,15 +917,9 @@ -aix*) vendor=ibm ;; - -beos*) - vendor=be - ;; -hpux*) vendor=hp ;; - -mpeix*) - vendor=hp - ;; -hiux*) vendor=hitachi ;; @@ -1272,7 +935,7 @@ -genix*) vendor=ns ;; - -mvs* | -opened*) + -mvs*) vendor=ibm ;; -ptx*) @@ -1284,26 +947,9 @@ -aux*) vendor=apple ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; 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 12e008d41344 -r 697ef44129c6 configure --- a/configure Mon Aug 13 11:19:22 2007 +0200 +++ b/configure Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ #### Configuration script for XEmacs. Largely divergent from FSF. #### Guess values for system-dependent variables and create Makefiles. -#### Generated automatically using autoconf version 2.13 +#### Generated automatically using autoconf version 2.12 #### Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois. #### Copyright (C) 1996, 1997 Sun Microsystems, Inc. @@ -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.13 or later. +### in the this directory. You must have autoconf version 2.12 or later. ### This file is part of XEmacs. @@ -92,7 +92,6 @@ 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 @@ -200,8 +199,6 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no -ac_exeext= -ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -228,26 +225,22 @@ statedir='${prefix}/lib' libdir='${exec_prefix}/lib' mandir='${prefix}/man/man1' -inststaticdir='${PROGNAME}' -instvardir='${PROGNAME}-${version}' -infodir='${datadir}/${instvardir}/info' +infodir='${datadir}/${PROGNAME}-${version}/info' infopath='' install_pp='' -lispdir='${datadir}/${instvardir}/lisp' -moduledir='${datadir}/${instvardir}/${configuration}/modules' -sitelispdir='${datadir}/${inststaticdir}/site-lisp' -sitemoduledir='${datadir}/${inststaticdir}/site-modules' -pkgdir='${datadir}/${instvardir}/lisp' +lispdir='${datadir}/${PROGNAME}-${version}/lisp' +moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules' +sitelispdir='${datadir}/xemacs/site-lisp' +sitemoduledir='${datadir}/xemacs/site-modules' +pkgdir='${datadir}/${PROGNAME}-${version}/lisp' package_path='' -etcdir='${datadir}/${instvardir}/etc' -archlibdir='${datadir}/${instvardir}/${configuration}' -docdir='${archlibdir}' -with_prefix='yes' +etcdir='${datadir}/${PROGNAME}-${version}/etc' +lockdir='${statedir}/${PROGNAME}/lock' +archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}' with_site_lisp='no' with_site_modules='yes' with_menubars='' with_scrollbars='' -with_widgets='' with_dialogs='' with_file_coding='' cpp='' cppflags='' libs='' ldflags='' @@ -263,8 +256,6 @@ with_tty="" use_union_type="no" with_dnet="" -pdump="no" -with_dragndrop="no" @@ -313,8 +304,7 @@ case "$opt" in with_site_lisp | \ - with_prefix | \ - with_site_modules | \ + with_site_modules | \ with_x | \ with_x11 | \ with_msw | \ @@ -333,7 +323,7 @@ with_jpeg | \ with_png | \ with_tiff | \ - with_wmcommand | \ + with_session | \ with_xmu | \ with_purify | \ with_quantify | \ @@ -350,7 +340,6 @@ with_sparcworks | \ with_tooltalk | \ with_ldap | \ - with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ @@ -359,15 +348,15 @@ external_widget | \ verbose | \ extra_verbose | \ + const_is_losing | \ usage_tracking | \ use_union_type | \ - pdump | \ debug | \ use_assertions | \ memory_usage_stats | \ with_clash_detection | \ - with_modules | \ - quick_build ) + with_shlib | \ + no_doc_file ) case "$val" in y | ye | yes ) val=yes ;; n | no ) val=no ;; @@ -425,22 +414,22 @@ "with_database" ) with_database_berkdb=no with_database_dbm=no - with_database_gdbm=no + with_database_gnudbm=no for x in `echo "$val" | sed -e 's/,/ /g'` ; do case "$x" in - no ) ;; - b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;; - d | db | dbm ) with_database_dbm=yes ;; - g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes ;; - * ) (echo "$progname: Usage error:" + no ) ;; + b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;; + d | db | dbm ) with_database_dbm=yes ;; + g | gn | gnu | gnud | gnudb | gnudbm ) with_database_gnudbm=yes ;; + * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option value must be either \`no' or a comma-separated list of one or more of \`berkdb' and either \`dbm' or \`gnudbm'." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; esac done - if test "$with_database_dbm" = "yes" -a \ - "$with_database_gdbm" = "yes"; then + if test "$with_database_dbm" = "yes" -a \ + "$with_database_gnudbm" = "yes"; then (echo "$progname: Usage error:" echo " " "Only one of \`dbm' and \`gnudbm' may be specified with the \`--$optname' option." @@ -449,50 +438,15 @@ ;; "with_sound" ) - for x in `echo "$val" | sed -e 's/,/ /g'` ; do - case "$x" in - n | no | non | none ) new_sdefault=no ;; - a | al | all | both ) new_sdefault=yes ;; - - native ) with_native_sound=yes ;; - nonative ) with_native_sound=no ;; - - nas ) with_nas_sound=yes ;; - nonas ) with_nas_sound=no ;; - - esd ) with_esd_sound=yes ;; - noesd ) with_esd_sound=no ;; - - * ) bogus_sound=yes ;; - esac - if test "$bogus_sound" -o \ - \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then - types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'." - (echo "$progname: Usage error:" -echo " " "Valid types for the \`--$optname' option are: - $types. -The default is to autodetect all sound support." -echo " Use \`$progname --help' to show usage.") >&2 && exit 1 - elif test -n "$new_sdefault" ; then - with_native_sound=$new_sdefault - with_nas_sound=$new_sdefault - with_esd_sound=$new_sdefault - new_sdefault= # reset this - fi - sound_notfirst=true - done - ;; - - "with_athena" ) - case "$val" in - xa | xaw ) val=xaw ;; - 3 | 3d | xaw3d ) val=3d ;; - ne | nex | next | naxtaw) val=next ;; - 9 | 95 | xaw95 ) val=95 ;; - xp | xpm | xawxpm ) val=xpm ;; + case "$val" in + y | ye | yes ) val=native ;; + n | no | non | none ) val=no;; + na | nat | nati | nativ | native ) val=native ;; + ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas ;; + b | bo | bot | both ) val=both;; * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option must have one of these values: - \`xaw', \`3d', \`next', \`95', or \`xpm'." + \`native', \`nas', \`both', or \`none'." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; esac eval "$opt=\"$val\"" @@ -516,11 +470,10 @@ case "$val" in lockf ) val=lockf ;; flock ) val=flock ;; - file | dot ) val=file ;; - locking ) val=locking ;; + file ) val=file ;; * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option must have one of these values: - \`lockf', \`flock', \`file', \`locking', or \`mmdf'." + \`lockf', \`flock', or \`file'." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; esac eval "$opt=\"$val\"" @@ -548,20 +501,14 @@ malloc ) error_check_malloc=yes ;; nomalloc ) error_check_malloc=no ;; - 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', \`noglyphs' and \`nobyte-code'." + types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'." else - types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'." + types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'." fi (echo "$progname: Usage error:" echo " " "Valid types for the \`--$optname' option are: @@ -573,8 +520,6 @@ error_check_bufpos=$new_default 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 @@ -583,7 +528,7 @@ prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ + mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \ archlibdir | docdir | package_path ) if test "$valomitted" = "yes"; then if test "$#" = 0; then @@ -596,14 +541,6 @@ eval "$opt=\"$val\"" case "$opt" in - exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF - Defining EXEC_PREFIX_USER_DEFINED -EOF -cat >> confdefs.h <<\EOF -#define EXEC_PREFIX_USER_DEFINED 1 -EOF -} - ;; lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF Defining LISPDIR_USER_DEFINED EOF @@ -693,11 +630,11 @@ EOF } ;; - docdir ) { test "$extra_verbose" = "yes" && cat << \EOF - Defining DOCDIR_USER_DEFINED -EOF -cat >> confdefs.h <<\EOF -#define DOCDIR_USER_DEFINED 1 + statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF + Defining LOCKDIR_USER_DEFINED +EOF +cat >> confdefs.h <<\EOF +#define LOCKDIR_USER_DEFINED 1 EOF } ;; @@ -718,26 +655,22 @@ "with_menubars" | \ "with_scrollbars" | \ - "with_dialogs" | \ - "with_widgets" ) + "with_dialogs" ) case "$val" in l | lu | luc | luci | lucid ) val=lucid ;; m | mo | mot | moti | motif ) val=motif ;; + athena3d | athena-3d ) val=athena3d ;; a | at | ath | athe | athen | athena ) val=athena ;; - n | no | non | none ) val=no ;; - y | ye | yes ) val=yes ;; + n | no | non | none ) val=no ;; * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option must have one of these values: - \`lucid', \`motif', \`athena', \`yes', or \`no'." + \`lucid', \`motif', \`athena', \`athena3d', or \`no'." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; esac eval "$opt=\"$val\"" ;; - "use_minimal_tagbits" | \ - "use_indexed_lrecord_implementation" | \ - "run_in_place" | \ - "const_is_losing" | \ + "run_in_place" | \ "with_gnu_make" ) echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2 ;; @@ -830,7 +763,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:834: checking whether ln -s works" >&5 +echo "configure:767: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -848,7 +781,7 @@ fi -for dir in lisp etc man info tests; do +for dir in lisp etc man info; do if test ! -d "$dir" ; then echo Making symbolic link to "$srcdir/$dir" ${LN_S} "$srcdir/$dir" "$dir" @@ -895,7 +828,7 @@ fi . "$srcdir/version.sh" || exit 1; -if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi +if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi : "${extra_verbose=$beta}" version="${emacs_major_version}.${emacs_minor_version}" { test "$extra_verbose" = "yes" && cat << EOF @@ -914,10 +847,9 @@ EOF } -if test -n "$emacs_beta_version" ; then - if test "$beta" = "yes"; then - version="${version}-b${emacs_beta_version}" - { test "$extra_verbose" = "yes" && cat << EOF +if test -n "$emacs_beta_version"; then + version="${version}-b${emacs_beta_version}" + { test "$extra_verbose" = "yes" && cat << EOF Defining EMACS_BETA_VERSION = $emacs_beta_version EOF cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <<\EOF -#define ERROR_CHECK_BYTE_CODE 1 -EOF -} - -test "${error_check_glyphs=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF - Defining ERROR_CHECK_GLYPHS -EOF -cat >> 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 echo " xemacs will be linked with \"debug.o\"" fi - extra_objs="$extra_objs tests.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"tests.o\"" - fi { test "$extra_verbose" = "yes" && cat << \EOF Defining DEBUG_XEMACS EOF @@ -1095,7 +988,7 @@ echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:1099: checking "host system type"" >&5 +echo "configure:992: 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/'` @@ -1113,9 +1006,7 @@ alpha*-*-* ) machine=alpha ;; vax-*-* ) machine=vax ;; mips-dec-* ) machine=pmax ;; - mips-sgi-irix6* ) machine=iris6d ;; mips-sgi-* ) machine=iris4d ;; - mips*-linux ) machine=mips ;; romp-ibm-* ) machine=ibmrt ;; rs6000-ibm-aix* ) machine=ibmrs6000 ;; powerpc-ibm-aix* ) machine=ibmrs6000 ;; @@ -1125,9 +1016,8 @@ m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; - arm* ) machine=arm ;; + arm-* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; - s390-* ) machine=s390 ;; esac case "$canonical" in @@ -1481,7 +1371,6 @@ else NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE" ; fi ;; - *-sysv5* ) opsys=sco7 ;; *-386bsd* ) opsys=386bsd ;; *-freebsd* ) opsys=freebsd ;; *-nextstep* ) opsys=nextstep ;; @@ -1562,7 +1451,7 @@ fi fi -if test "$with_clash_detection" != "no"; then +if test "$with_clash_detection" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining CLASH_DETECTION EOF @@ -1591,14 +1480,13 @@ # 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:1595: checking for $ac_word" >&5 +echo "configure:1484: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -1618,15 +1506,14 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1622: checking for $ac_word" >&5 +echo "configure:1510: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -1660,42 +1547,11 @@ echo "$ac_t""no" 1>&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # 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:1670: checking for $ac_word" >&5 - -if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1555: 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' @@ -1706,14 +1562,12 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no -cat > conftest.$ac_ext << EOF - -#line 1712 "configure" -#include "confdefs.h" - +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1727,33 +1581,25 @@ ac_cv_prog_cc_works=no fi rm -fr conftest* -ac_ext=c -xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' -xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' -xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' -ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' -cross_compiling=no echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { 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:1745: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1591: 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:1750: checking whether we are using GNU C" >&5 +echo "configure:1596: 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:1603: \"$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 @@ -1763,15 +1609,11 @@ if test $ac_cv_prog_gcc = yes; then GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1775: checking whether ${CC-cc} accepts -g" >&5 + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1617: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1783,20 +1625,16 @@ echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then CFLAGS="-g -O2" else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then CFLAGS="-O2" - else - CFLAGS= - fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" fi if test "$with_gcc" = "no" -a "$GCC" = "yes"; then @@ -1804,14 +1642,13 @@ # 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:1808: checking for $ac_word" >&5 +echo "configure:1646: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -1831,15 +1668,14 @@ # 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:1835: checking for $ac_word" >&5 +echo "configure:1672: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -1873,42 +1709,11 @@ echo "$ac_t""no" 1>&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # 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:1883: checking for $ac_word" >&5 - -if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1912: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1717: 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' @@ -1919,14 +1724,12 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no -cat > conftest.$ac_ext << EOF - -#line 1925 "configure" -#include "confdefs.h" - +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1940,33 +1743,25 @@ ac_cv_prog_cc_works=no fi rm -fr conftest* -ac_ext=c -xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' -xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' -xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' -ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' -cross_compiling=no echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { 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:1958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1753: 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:1963: checking whether we are using GNU C" >&5 +echo "configure:1758: 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:1765: \"$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 @@ -1976,15 +1771,11 @@ if test $ac_cv_prog_gcc = yes; then GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1988: checking whether ${CC-cc} accepts -g" >&5 + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1779: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1996,20 +1787,16 @@ echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then CFLAGS="-g -O2" else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then CFLAGS="-O2" - else - CFLAGS= - fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" fi elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then @@ -2017,14 +1804,13 @@ # 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:2021: checking for $ac_word" >&5 +echo "configure:1808: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -2044,15 +1830,14 @@ # 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:2048: checking for $ac_word" >&5 +echo "configure:1834: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -2086,42 +1871,11 @@ echo "$ac_t""no" 1>&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # 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:2096: checking for $ac_word" >&5 - -if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2125: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1879: 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' @@ -2132,14 +1886,12 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cross_compiling=no -cat > conftest.$ac_ext << EOF - -#line 2138 "configure" -#include "confdefs.h" - +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2153,33 +1905,25 @@ ac_cv_prog_cc_works=no fi rm -fr conftest* -ac_ext=c -xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' -xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' -xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' -ac_cpp='$CPP '"$xe_cppflags" -ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' -cross_compiling=no echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { 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:2171: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1915: 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:2176: checking whether we are using GNU C" >&5 +echo "configure:1920: 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:1927: \"$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 @@ -2189,15 +1933,11 @@ if test $ac_cv_prog_gcc = yes; then GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2201: checking whether ${CC-cc} accepts -g" >&5 + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1941: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -2209,20 +1949,16 @@ echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then CFLAGS="-g -O2" else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then CFLAGS="-O2" - else - CFLAGS= - fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" fi fi @@ -2234,7 +1970,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:2238: checking how to run the C preprocessor" >&5 +echo "configure:1974: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2247,14 +1983,14 @@ # 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:2257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else @@ -2264,31 +2000,14 @@ 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:2274: \"$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 - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - 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:2291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:2010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else @@ -2301,8 +2020,6 @@ rm -f conftest* fi rm -f conftest* -fi -rm -f conftest* ac_cv_prog_CPP="$CPP" CPP="$ac_cv_prog_CPP" else @@ -2311,11 +2028,10 @@ echo "$ac_t""$CPP" 1>&6 - echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2317: checking for AIX" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&6 -echo "configure:2346: checking for GNU libc" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { @@ -2356,7 +2072,7 @@ ; return 0; } EOF -if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -2376,64 +2092,9 @@ } -case "$opsys" in - sol2) - { test "$extra_verbose" = "yes" && cat << \EOF - Defining __EXTENSIONS__ -EOF -cat >> 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 < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -2546,11 +2207,8 @@ configure___ ld_switch_shared=LD_SWITCH_SHARED -#define ORDINARY_LD "\$(CC) \$(CFLAGS)" -configure___ ordinary_ld=ORDINARY_LD - #ifdef ORDINARY_LINK -#define LD ORDINARY_LD +#define LD "\$(CC) \$(CFLAGS)" #else /* no ORDINARY LINK */ #ifdef COFF_ENCAPSULATE #define LD "\$(CC) -nostdlib" @@ -2621,12 +2279,6 @@ configure___ mail_use_lockf=no #endif -#ifdef MAIL_USE_LOCKING -configure___ mail_use_locking=yes -#else -configure___ mail_use_locking=no -#endif - #ifdef HAVE_WIN32_PROCESSES configure___ win32_processes=yes #else @@ -2641,31 +2293,16 @@ rm $tempcname -if test "$pdump" = "yes"; then - ordinary_link="yes" - ld="${ordinary_ld}" - start_files= - libs_standard= - unexec= - lib_gcc= -fi - test "$extra_verbose" = "yes" && \ for var in libs_machine libs_system libs_termcap libs_standard objects_machine objects_system c_switch_machine c_switch_system ld_switch_machine ld_switch_system unexec ld_switch_shared ld lib_gcc ld_text_start_addr start_files ordinary_link have_terminfo mail_use_flock mail_use_lockf; do eval "echo \"$var = '\$$var'\""; done && echo "" -case "$opsys" in mingw*) mingw_include=`eval "gcc -print-file-name=libc.a"` ; - mingw_include=`eval "dirname $mingw_include"` ; - mingw_include="-I$mingw_include/../include/mingw32" ; - c_switch_system="$c_switch_system $mingw_include" && if test "$extra_verbose" = "yes"; then echo " Appending \"$mingw_include\" to \$c_switch_system"; fi ;; -esac - test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc" -test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std1" && if test "$extra_verbose" = "yes"; then echo " Appending \"-std1\" to \$c_switch_site"; fi +test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" && if test "$extra_verbose" = "yes"; then echo " Appending \"-std\" to \$c_switch_site"; fi if test "$cflags_specified" = "no"; then if test "$GCC" = "yes"; then - CFLAGS="-g -O3 -Wall -Wno-switch -Wpointer-arith -Winline -Wmissing-prototypes -Wshadow" + CFLAGS="-g -O3 -Wall -Wno-switch" elif test "$__SUNPRO_C" = "yes"; then case "$opsys" in sol2 ) CFLAGS="-v -xO4" ;; @@ -2679,64 +2316,6 @@ CFLAGS="-O" ; fi fi -if test "$GCC" = "yes"; then -echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 -echo "configure:2685: 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 -fi -echo "$ac_t""No" 1>&6 - if test "$GCC" = "yes"; then set x $ld_switch_system; shift; ld_switch_system="" @@ -2796,15 +2375,12 @@ 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" && test ! "$pdump" = "yes" && extra_objs="$extra_objs $unexec" && if test "$extra_verbose" = "yes"; then +test -n "$unexec" && 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:2808: checking for dynodump" >&5 +echo "configure:2384: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2842,12 +2418,12 @@ done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:2846: checking for terminateAndUnload in -lC" >&5 +echo "configure:2422: 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:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2925,16 +2501,16 @@ case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac if test -n "$site_prefixes"; then for dir in $site_prefixes; do + inc_dir="${dir}/include" lib_dir="${dir}/lib" - inc_dir="${dir}/include" if test ! -d "$dir"; then { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; } + elif test ! -d "$inc_dir"; then + { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$inc_dir'" >&2; exit 1; } elif test ! -d "$lib_dir"; then { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; } else - if test -d "$inc_dir"; then - c_switch_site="$c_switch_site "-I$inc_dir"" && if test "$extra_verbose" = "yes"; then echo " Appending \""-I$inc_dir"\" to \$c_switch_site"; fi - fi + c_switch_site="$c_switch_site "-I$inc_dir"" && if test "$extra_verbose" = "yes"; then echo " Appending \""-I$inc_dir"\" to \$c_switch_site"; fi ld_switch_site="$ld_switch_site "-L$lib_dir"" && if test "$extra_verbose" = "yes"; then echo " Appending \""-L$lib_dir"\" to \$ld_switch_site"; fi fi done @@ -2942,7 +2518,7 @@ for dir in "/usr/ccs/lib"; do - test -d "$dir" && ld_switch_system="$ld_switch_system -L${dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${dir}\" to \$ld_switch_system"; fi + test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${dir}\" to \$ld_switch_site"; fi done case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac @@ -2952,11 +2528,7 @@ fi - - - -if test -n "$add_runtime_path"; then :; -elif test "$dynamic" = "no"; then add_runtime_path=no +if test "$dynamic" = "no"; then add_runtime_path=no elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes else case "$opsys" in sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;; @@ -2966,7 +2538,7 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:2970: checking "for runtime libraries flag"" >&5 +echo "configure:2542: checking "for runtime libraries flag"" >&5 case "$opsys" in sol2 ) dash_r="-R" ;; decosf* | linux* | irix*) dash_r="-rpath " ;; @@ -2988,14 +2560,14 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 2564 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* dash_r="$try_dash_r" else @@ -3096,11 +2668,57 @@ doug_lea_malloc=no fi after_morecore_hook_exists=yes +echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 +echo "configure:2673: 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:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_malloc_get_state=yes" +else + 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:3101: 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:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -3143,16 +2761,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3147: 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:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3166,20 +2784,22 @@ 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" -a "$GNU_MALLOC" = "yes" ; then - GNU_MALLOC_reason=" - - Using Doug Lea's new malloc from the GNU C Library." + (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 { test "$extra_verbose" = "yes" && cat << \EOF Defining DOUG_LEA_MALLOC EOF @@ -3190,7 +2810,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 @@ -3200,6 +2820,7 @@ } fi + use_minimal_tagbits=yes fi @@ -3208,14 +2829,13 @@ # 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:3212: checking for $ac_word" >&5 +echo "configure:2833: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" @@ -3258,28 +2878,26 @@ # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # 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:3267: checking for a BSD compatible install" >&5 +echo "configure:2886: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do + for ac_prog in ginstall installbsd scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -3308,8 +2926,6 @@ # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' for ac_prog in 'bison -y' byacc @@ -3317,14 +2933,13 @@ # 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:3321: checking for $ac_word" >&5 +echo "configure:2937: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_YACC="$ac_prog" @@ -3345,20 +2960,102 @@ test -n "$YACC" || YACC="yacc" -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/stropts.h sys/time.h sys/timeb.h sys/un.h kstat.h ulimit.h unistd.h utime.h +for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3353: 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:3361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + 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:3009: 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:3017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + 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:3050: 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:3058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -3387,10 +3084,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3391: checking for sys/wait.h that is POSIX.1 compatible" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3406,7 +3103,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3430,10 +3127,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3434: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3441,8 +3138,8 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:3142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes @@ -3458,7 +3155,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 @@ -3476,7 +3173,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 @@ -3494,7 +3191,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') @@ -3505,7 +3202,7 @@ exit (0); } EOF -if { (eval echo configure:3509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -3531,10 +3228,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3535: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3543,7 +3240,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3567,10 +3264,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3571: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3582,7 +3279,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3607,9 +3304,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:3611: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3628,7 +3325,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3329: \"$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 @@ -3648,10 +3345,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3652: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -3668,7 +3365,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3690,10 +3387,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3694: checking for size_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3702,7 +3399,7 @@ #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else @@ -3724,10 +3421,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3728: checking for pid_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3736,7 +3433,7 @@ #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else @@ -3758,10 +3455,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3762: checking for uid_t in sys/types.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF @@ -3797,10 +3494,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3801: checking for mode_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3809,7 +3506,7 @@ #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_mode_t=yes else @@ -3831,10 +3528,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3835: checking for off_t" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3843,7 +3540,7 @@ #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else @@ -3864,106 +3561,11 @@ fi -echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:3869: checking for ssize_t" >&5 - -cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_ssize_t=yes -else - rm -rf conftest* - ac_cv_type_ssize_t=no -fi -rm -f conftest* - -echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 -if test $ac_cv_type_ssize_t = no; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining ssize_t = int -EOF -cat >> confdefs.h <<\EOF -#define ssize_t int -EOF -} - -fi - - -echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:3904: checking for socklen_t" >&5 -cat > conftest.$ac_ext < -socklen_t x; - -int main() { - -; return 0; } -EOF -if { (eval echo configure:3915: \"$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:3933: \"$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:3965: checking for struct timeval" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < @@ -3979,7 +3581,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -4001,10 +3603,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:4005: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include @@ -4012,7 +3614,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:4016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -4036,10 +3638,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:4040: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -4047,7 +3649,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:4051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -4070,10 +3672,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4074: checking for tzname" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4083,7 +3685,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -4109,10 +3711,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4113: 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:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4186,7 +3788,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4190: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:3792: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -4211,12 +3813,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4215: checking whether byte ordering is bigendian" >&5 +echo "configure:3817: 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 @@ -4227,11 +3829,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:4231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3833: \"$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 @@ -4242,7 +3844,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4259,7 +3861,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:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_bigendian=no else @@ -4299,10 +3901,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4303: checking size of short" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4313,7 +3915,7 @@ exit(0); } EOF -if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4341,10 +3943,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4345: checking size of int" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4355,7 +3957,7 @@ exit(0); } EOF -if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4377,10 +3979,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4381: checking size of long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4391,7 +3993,7 @@ exit(0); } EOF -if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4413,10 +4015,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4417: checking size of long long" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4427,7 +4029,7 @@ exit(0); } EOF -if { (eval echo configure:4431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4033: \"$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 @@ -4449,10 +4051,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4453: checking size of void *" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main() @@ -4463,7 +4065,7 @@ exit(0); } EOF -if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4069: \"$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 @@ -4486,7 +4088,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:4490: checking for long file names" >&5 +echo "configure:4092: 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: @@ -4532,10 +4134,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4536: 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:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -4576,12 +4178,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4580: checking for sin in -lm" >&5 +echo "configure:4182: 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:4198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4636,14 +4238,14 @@ cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -4660,124 +4262,37 @@ rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:4664: 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:4668: 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:4694: \"$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 - +echo "configure:4266: checking type of mail spool file locking" >&5 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf -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 -cat >> confdefs.h <<\EOF -#define MAIL_LOCK_LOCKF 1 + Defining REAL_MAIL_USE_LOCKF +EOF +cat >> confdefs.h <<\EOF +#define REAL_MAIL_USE_LOCKF 1 EOF } elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining MAIL_LOCK_FLOCK -EOF -cat >> confdefs.h <<\EOF -#define MAIL_LOCK_FLOCK 1 -EOF -} - -elif test "$mail_locking" = "locking"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining MAIL_LOCK_LOCKING -EOF -cat >> confdefs.h <<\EOF -#define MAIL_LOCK_LOCKING 1 -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 -cat >> confdefs.h <<\EOF -#define MAIL_LOCK_DOT 1 -EOF -} - -fi -test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \ - { echo "Error:" "lockf mail locking requested but not available." >&2; exit 1; } -test "$mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \ - { echo "Error:" "flock mail locking requested but not available." >&2; exit 1; } -test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \ - { echo "Error:" "locking mail locking requested but not available." >&2; exit 1; } + Defining REAL_MAIL_USE_FLOCK +EOF +cat >> confdefs.h <<\EOF +#define REAL_MAIL_USE_FLOCK 1 +EOF +} + +else mail_locking="dot-locking" +fi case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4776: checking for cma_open in -lpthreads" >&5 +echo "configure:4291: 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:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4824,7 +4339,7 @@ esac echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4828: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:4343: 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; @@ -4833,21 +4348,19 @@ else echo "$ac_t""no" 1>&6 fi -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:4840: 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 +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:4354: 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 echo "checking "for specified window system"" 1>&6 -echo "configure:4851: checking "for specified window system"" >&5 +echo "configure:4364: checking "for specified window system"" >&5 if test "$with_x11" != "no"; then test "$x_includes $x_libraries" != "NONE NONE" && \ @@ -4880,7 +4393,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:4884: checking for X" >&5 +echo "configure:4397: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4940,13 +4453,13 @@ # 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:4949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:4462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* # We can compile using X headers with no special include directory. @@ -5014,14 +4527,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:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5130,17 +4643,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:5134: checking whether -R must be followed by a space" >&5 +echo "configure:4647: 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 4650 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -5156,14 +4669,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 4673 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -5199,12 +4712,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5203: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4716: 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:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5239,12 +4752,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:5243: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4756: 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:4772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5284,10 +4797,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:5288: 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:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -5331,12 +4844,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:5335: checking for gethostbyname in -lnsl" >&5 +echo "configure:4848: 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:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5377,10 +4890,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:5381: 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:4920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -5426,12 +4939,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:5430: checking "$xe_msg_checking"" >&5 +echo "configure:4943: 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:4959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5466,10 +4979,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:5470: 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:5009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -5513,12 +5026,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:5517: checking for remove in -lposix" >&5 +echo "configure:5030: 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:5046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5553,10 +5066,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5557: 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:5096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -5600,12 +5113,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5604: checking for shmat in -lipc" >&5 +echo "configure:5117: 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:5133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5649,15 +5162,13 @@ # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. -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:5656: checking "$xe_msg_checking"" >&5 +echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 +echo "configure:5167: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` -xe_check_libs=" -lICE $X_EXTRA_LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5837,7 +5348,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:5841: checking for X defines extracted by xmkmf" >&5 +echo "configure:5352: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -5852,48 +5363,33 @@ cd .. rm -fr conftestdir for word in $xmkmf_defines; do - 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 - if grep "^#define $sym " confdefs.h >/dev/null; then :; else - if test "$val" = "1" - then { test "$extra_verbose" = "yes" && cat << EOF - Defining $sym + case "$word" in + -D*=* ) ;; + -D* ) word=`echo '' $word | sed -e 's:^ *-D::'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $word EOF cat >> confdefs.h <> confdefs.h <&6 -echo "configure:5888: 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:5896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:5392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -5916,12 +5412,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5920: checking for XOpenDisplay in -lX11" >&5 +echo "configure:5416: 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:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5957,12 +5453,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:5961: checking "$xe_msg_checking"" >&5 +echo "configure:5457: 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:5473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6000,12 +5496,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:6004: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:5500: 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:5516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6039,12 +5535,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:6043: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:5539: 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:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6078,14 +5574,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:6082: checking the version of X11 being used" >&5 +echo "configure:5578: 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:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:5585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -6106,77 +5602,20 @@ } - for ac_func in XConvertCase -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6113: 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:6139: \"$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:6171: 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:6179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:5618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -6206,7 +5645,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:6210: checking for XFree86" >&5 +echo "configure:5649: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -6226,12 +5665,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:6230: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:5669: 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:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6281,19 +5720,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:6285: checking for main in -lXbsd" >&5 +echo "configure:5724: 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:5736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6330,22 +5769,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:6334: checking for MS-Windows" >&5 +echo "configure:5773: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:6337: checking for main in -lgdi32" >&5 +echo "configure:5776: 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:5788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6375,7 +5814,7 @@ } install_pp="$blddir/lib-src/installexe.sh" - 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 + libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" 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 @@ -6395,7 +5834,6 @@ && extra_objs="$extra_objs dialog-msw.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"dialog-msw.o\"" fi - test "$with_widgets" != "no" && with_widgets=msw else test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"scrollbar-msw.o\"" @@ -6411,12 +5849,12 @@ fi fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:6420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:5858: \"$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 @@ -6432,6 +5870,7 @@ 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\"" @@ -6468,7 +5907,7 @@ fi if test "$with_x11" != "yes"; then - for feature in tooltalk cde offix wmcommand xim xmu nas_sound + for feature in tooltalk cde offix session xim xmu do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then echo "configure: warning: --with-$feature ignored: Not valid without X support" 1>&2 @@ -6490,14 +5929,14 @@ test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" esac -echo "checking for WM_COMMAND option" 1>&6 -echo "configure:6495: checking for WM_COMMAND option" >&5; -if test "$with_wmcommand" != "no"; then +echo "checking for session-management option" 1>&6 +echo "configure:5934: checking for session-management option" >&5; +if test "$with_session" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_WMCOMMAND -EOF -cat >> confdefs.h <<\EOF -#define HAVE_WMCOMMAND 1 + Defining HAVE_SESSION +EOF +cat >> confdefs.h <<\EOF +#define HAVE_SESSION 1 EOF } @@ -6506,16 +5945,16 @@ 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:6510: 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:6518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:5957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -6537,12 +5976,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:6541: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:5980: 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:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6598,16 +6037,16 @@ 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:6602: 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:6610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -6621,13 +6060,13 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - tt_c_h_file="${dir}tt_c.h"; break + tt_c_h_path="${dir}tt_c.h"; break else echo "$ac_t""no" 1>&6 fi done - if test -z "$tt_c_h_file"; then + if test -z "$tt_c_h_path"; then if test "$with_tooltalk" = "yes"; then (echo "$progname: Usage error:" echo " " "Unable to find required tooltalk header files." @@ -6642,12 +6081,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:6646: checking "$xe_msg_checking"" >&5 +echo "configure:6085: 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:6101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6700,10 +6139,10 @@ } { test "$extra_verbose" = "yes" && cat << EOF - Defining TT_C_H_FILE = "$tt_c_h_file" + Defining TT_C_H_PATH = "$tt_c_h_path" EOF cat >> confdefs.h <&6 -echo "configure:6719: 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:6727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -6746,12 +6185,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:6750: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:6189: 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:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6831,7 +6270,7 @@ fi echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:6835: checking if drag and drop API is needed" >&5 +echo "configure:6274: checking if drag and drop API is needed" >&5 if test "$with_dragndrop" != "no" ; then if test -n "$dragndrop_proto" ; then with_dragndrop=yes @@ -6852,19 +6291,19 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:6856: checking for LDAP" >&5 +echo "configure:6295: 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:6859: 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:6867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -6886,16 +6325,16 @@ } 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:6890: 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:6898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -6916,55 +6355,16 @@ fi } if test "$with_ldap" != "no"; then - -echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:6922: 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 - 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_ldap_nolber=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_nolber=no -fi - - - test "$with_ldap_nolber" = "no" && { + test -z "$with_umich_ldap" && { 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:6963: checking "$xe_msg_checking"" >&5 +echo "configure:6363: 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:6379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6989,34 +6389,32 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_ldap_lber=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_lber=no + with_umich_ldap=yes +else + echo "$ac_t""no" 1>&6 +with_umich_ldap=no fi } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { -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:7004: 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 + test "$with_umich_ldap" = "no" && { +echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6 +echo "configure:6402: checking for ldap_set_option in -lldap10" >&5 +ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lldap10 " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7030,55 +6428,14 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_ldap_krb=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_krb=no + with_ns_ldap=yes +else + echo "$ac_t""no" 1>&6 +with_ns_ldap=no fi } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { -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:7045: 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 - 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_ldap_krbdes=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_krbdes=no -fi - - } - test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes + test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes fi if test "$with_ldap" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -7092,247 +6449,52 @@ extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"eldap.o\"" fi - if test "$with_ldap_nolber" = "yes" ; then - LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi - else - if test "$with_ldap_krb" = "yes" ; then - LIBS="-lkrb $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkrb\" to \$LIBS"; fi - fi - if test "$with_ldap_krbdes" = "yes" ; then - LIBS="-ldes $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldes\" to \$LIBS"; fi - LIBS="-lkrb $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkrb\" to \$LIBS"; fi - fi + if test "$with_umich_ldap" = "yes" ; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_UMICH_LDAP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_UMICH_LDAP 1 +EOF +} + LIBS="-llber $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-llber\" to \$LIBS"; fi LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi - fi - 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:7112: 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:7138: \"$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 - -fi - -if test "$with_postgresql" != "no"; then - echo "checking for PostgreSQL" 1>&6 -echo "configure:7169: 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:7174: 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:7182: \"$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:7206: 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 + elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then { 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:7255: 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; } + Defining HAVE_NS_LDAP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_NS_LDAP 1 +EOF +} + + LIBS="-lldap10 $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap10\" to \$LIBS"; fi + elif test "$with_ldap" = "yes" ; then + LIBS="-lldap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$LIBS"; fi fi fi if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:7319: checking for graphics libraries" >&5 +echo "configure:6482: 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:7324: checking for Xpm - no older than 3.4f" >&5 +echo "configure:6487: 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:7336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6498: \"$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 @@ -7374,17 +6536,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:7378: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:6540: 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:6550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* xpm_for_msw=no else @@ -7410,16 +6572,16 @@ 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:7414: 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:7422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -7441,12 +6603,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:7445: checking for UnGenFace in -lcompface" >&5 +echo "configure:6607: 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:6623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7509,12 +6671,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:7513: checking for inflate in -lc" >&5 +echo "configure:6675: 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:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7544,12 +6706,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:7548: checking for inflate in -lz" >&5 +echo "configure:6710: 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:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7579,12 +6741,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:7583: checking for inflate in -lgz" >&5 +echo "configure:6745: 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:6761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7625,16 +6787,16 @@ 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:7629: 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:7637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -7656,12 +6818,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:7660: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:6822: 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:6838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7708,10 +6870,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:7712: 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:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -7755,16 +6917,16 @@ } 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:7759: 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:7767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:6929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -7786,12 +6948,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:7790: checking for png_read_image in -lpng" >&5 +echo "configure:6952: 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:6968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7825,10 +6987,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:7829: checking for workable png version information" >&5 +echo "configure:6991: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -7836,7 +6998,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:7840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7002: \"$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 @@ -7879,16 +7041,16 @@ 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:7883: 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:7891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:7053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -7910,12 +7072,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7914: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:7076: 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:7092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7965,29 +7127,16 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:7969: checking for X11 graphics libraries" >&5 - - echo "checking for the Athena widgets" 1>&6 -echo "configure:7972: checking for the Athena widgets" >&5 - - case "$with_athena" in - "xaw" | "") athena_variant=Xaw athena_3d=no ;; - "3d") athena_variant=Xaw3d athena_3d=yes ;; - "next") athena_variant=neXtaw athena_3d=yes ;; - "95") athena_variant=Xaw95 athena_3d=yes ;; - "xpm") athena_variant=XawXpm athena_3d=yes ;; - *) { echo "Error:" "Unknown Athena widget set \`$with_athena'. This should not happen." >&2; exit 1; } ;; - esac - - if test "$athena_3d" = "no"; then +echo "configure:7131: checking for X11 graphics libraries" >&5 + -echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:7986: 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 <&6 +echo "configure:7135: checking for XawScrollbarSetThumb in -lXaw" >&5 +ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lXaw " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${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 - -echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:8018: 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 - 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 - echo "configure: warning: "Could not find a non-3d Athena widget library."" 1>&2 -else - echo "$ac_t""no" 1>&6 -athena_lib=$athena_variant -fi - - - -else - echo "$ac_t""no" 1>&6 -echo "configure: warning: "Could not find an Athena widget library."" 1>&2 -fi - - - else - -echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:8065: 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 - 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 - athena_lib=$athena_variant -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:8099: 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:7151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8125,391 +7161,26 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - athena_lib=Xaw; - echo "configure: warning: "Assuming that libXaw is actually $athena_variant."" 1>&2; - -else - echo "$ac_t""no" 1>&6 -echo "configure: warning: "Could not find a 3d Athena widget library that looked like $athena_variant."" 1>&2 -fi - - -fi - - - fi - - 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:8146: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8154: \"$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 - echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2 -else - 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:8174: checking for X11/Xaw/XawInit.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8182: \"$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 - athena_h_path=X11/Xaw -else - echo "$ac_t""no" 1>&6 -echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2 -fi - -fi - - 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:8208: checking for X11/$athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8216: \"$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_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:8233: checking for X11/$athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8241: \"$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 - athena_h_path=X11/$athena_variant -else - echo "$ac_t""no" 1>&6 -fi - -else - echo "$ac_t""no" 1>&6 -fi - - - 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:8269: checking for $athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8277: \"$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_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8294: checking for $athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8302: \"$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 - athena_h_path=$athena_variant -else - echo "$ac_t""no" 1>&6 -fi - -else - echo "$ac_t""no" 1>&6 -fi - - fi - - 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:8331: checking for X11/Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8339: \"$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_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8356: checking for X11/Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8364: \"$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 - - echo "configure: warning: "Assuming that X11/Xaw3d headers are suitable for $athena_variant."" 1>&2 - athena_h_path=X11/Xaw3d - -else - echo "$ac_t""no" 1>&6 -fi - -else - echo "$ac_t""no" 1>&6 -fi - - fi - - 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:8396: checking for Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8404: \"$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_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8421: checking for Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8429: \"$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 - - echo "configure: warning: "Assuming that Xaw3d headers are suitable for $athena_variant."" 1>&2 - athena_h_path=Xaw3d - -else - echo "$ac_t""no" 1>&6 -fi - -else - echo "$ac_t""no" 1>&6 -fi - - fi - - 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:8461: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8469: \"$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 - - echo "configure: warning: "Assuming that X11/Xaw headers are suitable for $athena_variant."" 1>&2 - athena_h_path=X11/Xaw - -else - echo "$ac_t""no" 1>&6 -echo "configure: warning: "Could not find a suitable 3d Athena header set."" 1>&2 -fi - - fi - fi - - if test -n "$athena_lib" -a -n "$athena_h_path"; then - have_xaw=yes - else - have_xaw=no - fi - + have_xaw=yes +else + echo "$ac_t""no" 1>&6 +have_xaw=no +fi + + + ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:8504: 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:8512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:7183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -8525,12 +7196,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:8529: checking for XmStringFree in -lXm" >&5 +echo "configure:7200: 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:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8570,9 +7241,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:8574: checking for Lesstif" >&5 +echo "configure:7245: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -8595,119 +7266,23 @@ fi -case "$with_menubars" in "" | "yes" | "athena" ) +case "$with_menubars" in "" | "yes" | "athena" | "athena3d" ) with_menubars="lucid" ;; esac case "$with_dialogs" in "" | "yes" | "lucid" ) - if test "$have_motif" = "yes"; then with_dialogs="motif" - elif test "$have_xaw" = "yes"; then with_dialogs="athena" + if test "$have_motif" = "yes"; then with_dialogs="motif" + elif test "$have_xaw" = "yes"; then with_dialogs="athena" else with_dialogs=no fi ;; esac case "$with_scrollbars" in "" | "yes" ) with_scrollbars="lucid" ;; esac -case "$with_widgets" in "" | "yes" | "lucid") - if test "$have_motif" = "yes"; then with_widgets="motif" - elif test "$have_xaw" = "yes"; then with_widgets="athena" - else with_widgets=no - fi ;; -esac - -all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets" - -case "$all_widgets" in - *athena* ) - if test "$have_xaw" != "yes"; then - { echo "Error:" "Could not find a suitable Athena library to build with." >&2; exit 1; } - fi - - lwlib_objs="$lwlib_objs lwlib-Xaw.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi - - 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_Scrollbar_h_ = "$athena_h_path/Scrollbar.h" -EOF -cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <<\EOF @@ -8715,7 +7290,7 @@ EOF } - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining NEED_ATHENA EOF cat >> confdefs.h <<\EOF @@ -8723,19 +7298,8 @@ EOF } - need_athena="yes" - - if test "$athena_3d" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_ATHENA_3D -EOF -cat >> confdefs.h <<\EOF -#define HAVE_ATHENA_3D 1 -EOF -} - - fi - ;; + lwlib_objs="$lwlib_objs lwlib-Xaw.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi + libs_x="-lXaw $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXaw\" to \$libs_x"; fi ;; esac case "$all_widgets" in *motif* ) @@ -8762,11 +7326,6 @@ test "$with_menubars" = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"xlwmenu.o\" to \$lwlib_objs"; fi test "$with_menubars" = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"xlwmenu.o\" to \$lwlib_objs"; fi test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi -test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \ - lwlib_objs="$lwlib_objs xlwtabs.o xlwgcs.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"xlwtabs.o xlwgcs.o\" to \$lwlib_objs"; fi -case "$with_widgets" in athena* ) - lwlib_objs="$lwlib_objs xlwradio.o xlwcheckbox.o xlwgauge.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"xlwradio.o xlwcheckbox.o xlwgauge.o\" to \$lwlib_objs"; fi;; -esac case "$all_widgets" in *lucid* ) { test "$extra_verbose" = "yes" && cat << \EOF Defining NEED_LUCID @@ -8781,25 +7340,23 @@ -test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF +case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF Defining LWLIB_SCROLLBARS_ATHENA EOF cat >> confdefs.h <<\EOF #define LWLIB_SCROLLBARS_ATHENA 1 EOF } - -test "$with_dialogs" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF +;; esac +case "$with_dialogs" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF Defining LWLIB_DIALOGS_ATHENA EOF cat >> confdefs.h <<\EOF #define LWLIB_DIALOGS_ATHENA 1 EOF } - - -if test "$athena_3d" = "yes"; then - test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF + ;; esac +test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF Defining LWLIB_SCROLLBARS_ATHENA3D EOF cat >> confdefs.h <<\EOF @@ -8807,7 +7364,7 @@ EOF } - test "$with_dialogs" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF +test "$with_dialogs" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF Defining LWLIB_DIALOGS_ATHENA3D EOF cat >> confdefs.h <<\EOF @@ -8815,25 +7372,6 @@ EOF } -fi - -case "$with_widgets" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF - Defining LWLIB_WIDGETS_ATHENA -EOF -cat >> confdefs.h <<\EOF -#define LWLIB_WIDGETS_ATHENA 1 -EOF -} -;; esac -test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \ - { test "$extra_verbose" = "yes" && cat << \EOF - Defining LWLIB_TABS_LUCID -EOF -cat >> confdefs.h <<\EOF -#define LWLIB_TABS_LUCID 1 -EOF -} - test "$with_menubars" != "no" && { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MENUBARS @@ -8867,14 +7405,6 @@ EOF } -test "$with_widgets" != "no" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_WIDGETS -EOF -cat >> confdefs.h <<\EOF -#define HAVE_WIDGETS 1 -EOF -} - test "$with_menubars" = "lucid" && { test "$extra_verbose" = "yes" && cat << \EOF Defining LWLIB_MENUBARS_LUCID @@ -8917,44 +7447,42 @@ EOF } -test "$with_widgets" = "motif" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining LWLIB_WIDGETS_MOTIF -EOF -cat >> confdefs.h <<\EOF -#define LWLIB_WIDGETS_MOTIF 1 -EOF -} - - -test "$with_menubars" != "no" && extra_objs="$extra_objs menubar.o" && if test "$extra_verbose" = "yes"; then + +test "$with_menubars" != "no" && extra_objs="$extra_objs menubar.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"menubar.o\"" fi -test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar.o" && if test "$extra_verbose" = "yes"; then +test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"scrollbar.o\"" fi -test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog.o" && if test "$extra_verbose" = "yes"; then +test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"dialog.o\"" fi -test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar.o" && if test "$extra_verbose" = "yes"; then +test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"toolbar.o\"" fi if test "$with_x11" = "yes"; then - test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-x.o" && if test "$extra_verbose" = "yes"; then + test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-x.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"menubar-x.o\"" fi - test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-x.o" && if test "$extra_verbose" = "yes"; then + test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-x.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"scrollbar-x.o\"" fi - test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-x.o" && if test "$extra_verbose" = "yes"; then + test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-x.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"dialog-x.o\"" fi - test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-x.o" && if test "$extra_verbose" = "yes"; then + test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-x.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"toolbar-x.o\"" fi - test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" && if test "$extra_verbose" = "yes"; then + test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"gui-x.o\"" fi +else + if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then + echo "Attempt to Build NAS sound without X" + echo "Please remove NAS configuration or build with X" + exit 1 + fi fi @@ -8978,7 +7506,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:8982: checking for Mule-related features" >&5 +echo "configure:7510: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -9003,16 +7531,16 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9007: 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:9015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:7543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -9042,12 +7570,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:9046: checking for strerror in -lintl" >&5 +echo "configure:7574: 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:7590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9091,18 +7619,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:9095: checking for Mule input methods" >&5 +echo "configure:7623: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:9098: checking for XIM" >&5 +echo "configure:7626: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:9101: checking for XOpenIM in -lX11" >&5 +echo "configure:7629: 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:7645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9137,12 +7665,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:9141: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:7669: 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:7685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9218,15 +7746,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:9222: checking for XFontSet" >&5 +echo "configure:7750: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:9225: checking for XmbDrawString in -lX11" >&5 +echo "configure:7753: 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:7769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9277,16 +7805,16 @@ 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:9281: 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:9289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:7817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -9310,10 +7838,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9314: 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:7868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9365,12 +7893,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:9369: checking for crypt in -lcrypt" >&5 +echo "configure:7897: 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:7913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9416,12 +7944,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:9420: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:7948: 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:7964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9450,12 +7978,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:9454: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:7982: 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:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9484,12 +8012,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:9488: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:8016: 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:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9518,12 +8046,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:9522: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:8050: 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:8066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9582,12 +8110,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:9586: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:8114: 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:8130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9633,16 +8161,16 @@ 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:9637: 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:9645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:8173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -9668,16 +8196,16 @@ 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:9672: 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:9680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -9704,16 +8232,16 @@ 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:9708: 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:9716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:8244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -9735,12 +8263,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:9739: checking for RkBgnBun in -lRKC" >&5 +echo "configure:8267: 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:8283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9774,12 +8302,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:9778: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:8306: 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:8322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9839,12 +8367,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:9843: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:8371: 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:8387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9938,13 +8466,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 gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9945: 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:8499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9995,17 +8523,23 @@ done -extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then + +case "$opsys" in + linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"realpath.o\"" - fi - -for ac_func in getloadavg + fi ;; + * ) + case "$canonical" in + *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"realpath.o\"" + fi ;; + * ) for ac_func in realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10006: 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:8566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_func +EOF +cat >> confdefs.h <&6 +fi +done + + test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"realpath.o\"" + fi ;; + esac ;; +esac + +for ac_func in getloadavg +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:8602: 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:8628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10064,12 +8660,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:10068: checking for kstat_open in -lkstat" >&5 +echo "configure:8664: 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:8680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10114,12 +8710,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:10118: checking for kvm_read in -lkvm" >&5 +echo "configure:8714: 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:8730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10164,16 +8760,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:10168: 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:10177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -10193,16 +8789,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:10197: 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:10206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8802: \"$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 @@ -10222,11 +8818,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:10226: checking whether localtime caches TZ" >&5 +echo "configure:8822: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -10261,7 +8857,7 @@ exit (0); } EOF -if { (eval echo configure:10265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:8861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -10291,9 +8887,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:10295: 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 + struct timezone dummy; + gettimeofday (&time, &dummy); + +; return 0; } +EOF +if { (eval echo configure:8915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""two" 1>&6 else @@ -10336,19 +8933,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:10340: checking for inline" >&5 +echo "configure:8937: 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:8949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -10380,25 +8977,35 @@ ;; esac -test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inline.o" && if test "$extra_verbose" = "yes"; then +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 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:10392: 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:10402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -10422,28 +9029,23 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:10426: checking for alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < -# define alloca _alloca +# if HAVE_ALLOCA_H +# include # else -# if HAVE_ALLOCA_H -# include +# ifdef _AIX + #pragma alloca # else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); -# endif # endif # endif # endif @@ -10453,7 +9055,7 @@ char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:10457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -10481,7 +9083,7 @@ # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} + ALLOCA=alloca.o { test "$extra_verbose" = "yes" && cat << \EOF Defining C_ALLOCA EOF @@ -10492,10 +9094,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:10496: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&6 -echo "configure:10523: 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:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10575,10 +9177,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:10579: 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:9203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -10626,16 +9228,16 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:10630: 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:10638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:9240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -10662,10 +9264,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:10666: checking for working vfork" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < @@ -10760,7 +9362,7 @@ } } EOF -if { (eval echo configure:10764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_vfork_works=yes else @@ -10786,10 +9388,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:10790: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main () @@ -10799,7 +9401,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:10803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -10827,10 +9429,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10831: 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:9459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10881,10 +9483,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:10885: 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:9545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -10966,10 +9568,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:10970: checking for working mmap" >&5 +echo "configure:9572: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -11002,7 +9604,7 @@ return 1; } EOF -if { (eval echo configure:11006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -11023,39 +9625,274 @@ EOF } - -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:11032: 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:11046: \"$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 +for ac_hdr in unistd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:9633: 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:9641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + 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_func in getpagesize +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:9673: 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:9699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $ac_tr_func +EOF +cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking for working mmap""... $ac_c" 1>&6 +echo "configure:9727: checking for working mmap" >&5 + +cat > conftest.$ac_ext < +#include +#include + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include +# endif + +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +#ifdef __cplusplus +extern "C" { void *malloc(unsigned); } +#else +char *malloc(); +#endif + +int +main() +{ + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize(); + + /* + * First, make a file with some known garbage in it. + */ + data = malloc(pagesize); + if (!data) + exit(1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand(); + umask(0); + fd = creat("conftestmmap", 0600); + if (fd < 0) + exit(1); + if (write(fd, data, pagesize) != pagesize) + exit(1); + close(fd); + + /* + * Next, try to mmap the file at a fixed address which + * already has something else allocated at it. If we can, + * also make sure that we see the same garbage. + */ + fd = open("conftestmmap", O_RDWR); + if (fd < 0) + exit(1); + data2 = malloc(2 * pagesize); + if (!data2) + exit(1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit(1); + + /* + * Finally, make sure that changes to the mapped area + * do not percolate back to the file as seen by read(). + * (This is a bug on some variants of i386 svr4.0.) + */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = malloc(pagesize); + if (!data3) + exit(1); + if (read(fd, data3, pagesize) != pagesize) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit(1); + close(fd); + unlink("conftestmmap"); + exit(0); +} + +EOF +if { (eval echo configure:9870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +then + ac_cv_func_mmap_fixed_mapped=yes +else + conftest_rc="$?" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_mmap_fixed_mapped=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +if test $ac_cv_func_mmap_fixed_mapped = yes; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_MMAP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_MMAP 1 +EOF +} + +fi + + +test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no +test "$rel_alloc" = "default" -a "$have_mmap" = "yes" && rel_alloc=yes test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF Defining REL_ALLOC EOF @@ -11067,16 +9904,16 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:11071: 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:11079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:9916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11118,16 +9955,16 @@ 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:11122: 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:11130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:9967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11158,10 +9995,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:11162: 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:10025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -11199,16 +10036,16 @@ 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:11203: 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:11211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11224,16 +10061,16 @@ 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:11228: 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:11236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11257,9 +10094,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:11261: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:10098: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -11270,7 +10107,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:11274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -11288,9 +10125,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:11292: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:10129: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -11300,7 +10137,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:11304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -11331,10 +10168,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:11335: 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:10198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -11372,16 +10209,16 @@ 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:11376: 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:11384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11397,16 +10234,16 @@ 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:11401: 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:11409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11443,16 +10280,16 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:11447: 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:11455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11478,16 +10315,16 @@ 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:11482: 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:11490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11519,16 +10356,16 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:11523: 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:11531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11557,23 +10394,27 @@ echo "checking "for sound support"" 1>&6 -echo "configure:11561: checking "for sound support"" >&5 +echo "configure:10398: checking "for sound support"" >&5 +case "$with_sound" in + native | both ) with_native_sound=yes;; + nas | no ) with_native_sound=no;; +esac 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:11568: 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:11576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11620,12 +10461,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:11624: checking for ALopenport in -laudio" >&5 +echo "configure:10465: 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:10481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11667,12 +10508,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:11671: checking for AOpenAudio in -lAlib" >&5 +echo "configure:10512: 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:10528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11721,16 +10562,16 @@ 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:11725: 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:11733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -11745,15 +10586,14 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 sound_found=yes - need_miscplay=yes extra_objs="$extra_objs linuxplay.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"linuxplay.o\"" fi { test "$extra_verbose" = "yes" && cat << EOF - Defining SOUNDCARD_H_FILE = "${dir}/soundcard.h" + Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h" EOF cat >> confdefs.h <&6 -echo "configure:11794: checking for audio/audiolib.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11802: \"$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 - - -echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:11820: 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 - 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_nas_sound=yes -else - echo "$ac_t""no" 1>&6 -fi - - -else - echo "$ac_t""no" 1>&6 -fi - - if test "$have_nas_sound" = "yes"; then - with_nas_sound=yes - { test "$extra_verbose" = "yes" && cat << \EOF +case "$with_sound" in both | nas ) + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_NAS_SOUND EOF cat >> confdefs.h <<\EOF @@ -11866,12 +10635,12 @@ EOF } - extra_objs="$extra_objs nas.o" && if test "$extra_verbose" = "yes"; then + extra_objs="$extra_objs nas.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"nas.o\"" fi - libs_x="-laudio $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$libs_x"; fi - cat > conftest.$ac_ext < conftest.$ac_ext < EOF @@ -11880,7 +10649,7 @@ : else rm -rf conftest* - old_nas=yes; { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining NAS_NO_ERROR_JUMP EOF cat >> confdefs.h <<\EOF @@ -11891,124 +10660,14 @@ fi rm -f conftest* - else - test "$with_nas_sound" = "yes" && \ - { echo "Error:" "Required NAS sound support cannot be provided." >&2; exit 1; } - with_nas_sound=no - fi -fi - -if test "$with_esd_sound" != "no"; then - # 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:11906: 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. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_have_esd_config="yes" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_have_esd_config" && ac_cv_prog_have_esd_config="no" -fi -have_esd_config="$ac_cv_prog_have_esd_config" -if test -n "$have_esd_config"; then - echo "$ac_t""$have_esd_config" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test "$have_esd_config" = "yes"; then - save_c_switch_site="$c_switch_site" save_LIBS="$LIBS" - 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:11935: checking for esd_play_stream" >&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 esd_play_stream(); - -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_esd_play_stream) || defined (__stub___esd_play_stream) -choke me -#else -esd_play_stream(); -#endif - -; return 0; } -EOF -if { (eval echo configure:11961: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_esd_play_stream=no" -fi -rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'esd_play_stream`\" = yes"; then - echo "$ac_t""yes" 1>&6 - have_esd_sound=yes -else - echo "$ac_t""no" 1>&6 -c_switch_site="$save_c_switch_site" LIBS="$save_LIBS" -fi - - fi - - if test "$have_esd_sound" = "yes"; then - with_esd_sound=yes - need_miscplay=yes - extra_objs="$extra_objs esd.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"esd.o\"" - fi - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_ESD_SOUND -EOF -cat >> confdefs.h <<\EOF -#define HAVE_ESD_SOUND 1 -EOF -} - - else - test "$with_esd_sound" = "yes" && \ - { echo "Error:" "Required ESD sound support cannot be provided." >&2; exit 1; } - with_esd_sound=no - fi -fi - -test "$need_miscplay" = "yes" && extra_objs="$extra_objs miscplay.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"miscplay.o\"" - fi +esac test -z "$with_tty" && with_tty=yes if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:12012: checking for TTY-related features" >&5 +echo "configure:10671: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -12024,12 +10683,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:12028: checking for tgetent in -lncurses" >&5 +echo "configure:10687: 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:10703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12073,16 +10732,16 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:12077: 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:12085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -12096,23 +10755,23 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - curses_h_file=ncurses/curses.h + curses_h_path=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:12107: 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:12115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -12126,7 +10785,7 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - term_h_file=ncurses/term.h + term_h_path=ncurses/term.h else echo "$ac_t""no" 1>&6 fi @@ -12141,16 +10800,16 @@ 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:12145: 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:12153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:10812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -12164,7 +10823,7 @@ rm -f conftest* if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - curses_h_file=ncurses/curses.h + curses_h_path=ncurses/curses.h else echo "$ac_t""no" 1>&6 fi @@ -12184,12 +10843,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:12188: checking for tgetent in -l$lib" >&5 +echo "configure:10847: 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:10863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12231,12 +10890,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:12235: checking for tgetent in -lcurses" >&5 +echo "configure:10894: 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:10910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12265,12 +10924,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:12269: checking for tgetent in -ltermcap" >&5 +echo "configure:10928: 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:10944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12311,34 +10970,34 @@ fi fi { test "$extra_verbose" = "yes" && cat << EOF - Defining CURSES_H_FILE = "${curses_h_file-curses.h}" + Defining CURSES_H_PATH = "${curses_h_path-curses.h}" EOF cat >> confdefs.h <> confdefs.h <&6 -echo "configure:12333: 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:12341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:11000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -12360,12 +11019,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:12364: checking for Gpm_Open in -lgpm" >&5 +echo "configure:11023: 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:11039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12424,23 +11083,23 @@ fi -test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ +test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:12430: checking for database support" >&5 - -if test "$with_database_gdbm $with_database_dbm" != "no no"; then +echo "configure:11089: checking for database support" >&5 + +if test "$with_database_gnudbm $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:12435: 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:12443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:11102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -12458,23 +11117,23 @@ else echo "$ac_t""no" 1>&6 - test "$with_database_gdbm" = "yes" -o \ - "$with_database_dbm" = "yes" && \ + test "$with_database_gnudbm" = "yes" -o \ + "$with_database_dbm" = "yes" && \ { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; } - with_database_gdbm=no with_database_dbm=no -fi - -fi - -if test "$with_database_gdbm" != "no"; then + with_database_gnudbm=no with_database_dbm=no +fi + +fi + +if test "$with_database_gnudbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:12473: checking for dbm_open in -lgdbm" >&5 +echo "configure:11132: 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:11148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12499,13 +11158,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm -else - echo "$ac_t""no" 1>&6 -if test "$with_database_gdbm" = "yes"; then + with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm +else + echo "$ac_t""no" 1>&6 +if test "$with_database_gnudbm" = "yes"; then { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; } fi - with_database_gdbm=no + with_database_gnudbm=no fi @@ -12513,10 +11172,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:12517: 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:11202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -12558,12 +11217,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:12562: checking for dbm_open in -ldbm" >&5 +echo "configure:11221: 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:11237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12602,8 +11261,8 @@ fi test -n "$libdbm" && LIBS=""$libdbm" $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$libdbm"\" to \$LIBS"; fi -test "$with_database_gdbm" = "yes" -o \ - "$with_database_dbm" = "yes" && \ +test "$with_database_gnudbm" = "yes" -o \ + "$with_database_dbm" = "yes" && \ { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DBM EOF @@ -12615,14 +11274,11 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:12619: checking for Berkeley db.h" >&5 - for header in "db/db.h" "db.h"; do +echo "configure:11278: checking for Berkeley db.h" >&5 + for path in "db/db.h" "db.h"; do cat > conftest.$ac_ext < -#if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) +#line 11281 "configure" +#include "confdefs.h" #ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ #include @@ -12633,34 +11289,33 @@ typedef uint64_t u_int64_t; #endif #endif -#endif -#include <$header> - -int main() { - -; return 0; } -EOF -if { (eval echo configure:12644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - db_h_file="$header"; break +#include <$path> + +int main() { + +; return 0; } +EOF +if { (eval echo configure:11299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + db_h_path="$path"; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done - if test -z "$db_h_file" + if test -z "$db_h_path" then echo "$ac_t""no" 1>&6; with_database_berkdb=no - else echo "$ac_t""$db_h_file" 1>&6 + else echo "$ac_t""$db_h_path" 1>&6 fi if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:12660: checking for Berkeley DB version" >&5 +echo "configure:11315: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < +#line 11317 "configure" +#include "confdefs.h" +#include <$db_h_path> #if DB_VERSION_MAJOR > 1 yes #endif @@ -12677,10 +11332,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:12681: 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:11362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$dbfunc=yes" else @@ -12722,12 +11377,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:12726: checking for $dbfunc in -ldb" >&5 +echo "configure:11381: 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:11397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12764,10 +11419,10 @@ if test "$with_database_berkdb" = "yes"; then { test "$extra_verbose" = "yes" && cat << EOF - Defining DB_H_FILE = "$db_h_file" + Defining DB_H_PATH = "$db_h_path" EOF cat >> confdefs.h <&6 -echo "configure:12806: checking for SOCKSinit in -lsocks" >&5 +echo "configure:11461: 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:11477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12871,25 +11526,20 @@ LIBS="-Bstatic -lut -Bdynamic $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi fi -if test "$with_modules" != "no"; then - echo "checking for module support" 1>&6 -echo "configure:12877: 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:12884: checking for dlfcn.h" >&5 - -cat > conftest.$ac_ext < +for ac_hdr in dlfcn.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:11534: 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:12892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (eval echo configure:11542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -12903,15 +11553,36 @@ 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 <> confdefs.h <<\EOF +#define HAVE_DLFCN_H 1 +EOF +} + +else + echo "$ac_t""no" 1>&6 +fi +done + +test -z "$with_shlib" && test ! -z "$have_dlfcn" && { echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:12910: checking for dlopen in -ldl" >&5 +echo "configure:11581: 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:11597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12936,28 +11607,38 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - have_dl=yes libdl=dl -else - echo "$ac_t""no" 1>&6 - -echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:12945: checking for dlopen in -lc" >&5 -ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_DLOPEN +EOF +cat >> confdefs.h <<\EOF +#define HAVE_DLOPEN 1 +EOF +} + DLL_LIB=dl; with_shlib=yes +else + echo "$ac_t""no" 1>&6 +fi + + } +test -z "$with_shlib" && test ! -z "$have_dlfcn" && { +echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6 +echo "configure:11626: 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 +#line 11631 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _dlopen(); + +int main() { +_dlopen() +; return 0; } +EOF +if { (eval echo configure:11642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12971,48 +11652,38 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - have_dl=yes -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -else - echo "$ac_t""no" 1>&6 -fi - - if test -n "$have_dl"; then - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLOPEN EOF cat >> confdefs.h <<\EOF #define HAVE_DLOPEN 1 EOF } - - else - -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:13000: 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 + DLL_LIB=; with_shlib=yes +else + echo "$ac_t""no" 1>&6 +fi + + } +test -z "$with_shlib" && test ! -z "$have_dlfcn" && { +echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 +echo "configure:11671: checking for dlopen in -lc" >&5 +ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lc " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13026,36 +11697,38 @@ 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 - Defining HAVE_SHL_LOAD -EOF -cat >> confdefs.h <<\EOF -#define HAVE_SHL_LOAD 1 -EOF -} - -else - echo "$ac_t""no" 1>&6 - -echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:13043: checking for dld_init in -ldld" >&5 -ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_DLOPEN +EOF +cat >> confdefs.h <<\EOF +#define HAVE_DLOPEN 1 +EOF +} + DLL_LIB=; with_shlib=yes +else + echo "$ac_t""no" 1>&6 +fi + + } +test -z "$with_shlib" && { +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "configure:11716: 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 +#line 11721 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load(); + +int main() { +shl_load() +; return 0; } +EOF +if { (eval echo configure:11732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13069,27 +11742,66 @@ 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 +#define HAVE_SHL_LOAD 1 +EOF +} + DLL_LIB=dld; with_shlib=yes +else + echo "$ac_t""no" 1>&6 +fi + + } +test -z "$with_shlib" && { +echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 +echo "configure:11761: checking for dld_init in -ldld" >&5 +ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` + +xe_check_libs=" -ldld " +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + 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 + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLD_INIT EOF cat >> confdefs.h <<\EOF #define HAVE_DLD_INIT 1 EOF } - -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - - fi - fi - if test -n "$have_dl"; then - + DLL_LIB=dld; with_shlib=yes +else + echo "$ac_t""no" 1>&6 +fi + + } +if test "$with_shlib" = "yes"; then + dll_ld= dll_ldflags= dll_cflags= @@ -13100,7 +11812,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:13104: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:11816: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -13128,9 +11840,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:13132: checking checking whether we are using GNU C" >&5 +echo "configure:11844: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:13156: checking how to produce PIC code" >&5 +echo "configure:11868: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -13164,7 +11876,7 @@ # PIC is the default for these OSes. ;; - aix3* | aix4* | os2*) + os2*) # We can build DLLs from non-PIC. ;; amigaos*) @@ -13173,9 +11885,6 @@ # like `-m68040'. dll_cflags='-m68020 -resident32 -malways-restore-a4' ;; - *cygwin* | *mingw* ) - # PIC is the default - ;; *) dll_cflags='-fPIC' ;; @@ -13183,7 +11892,7 @@ else # PORTME Check for PIC flags for the system compiler. case "$xehost_os" in - hpux9* | hpux1[0-9]*) + hpux9* | hpux10*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' dll_cflags='+Z' @@ -13248,18 +11957,18 @@ # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:13252: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:11961: 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:11972: \"$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 @@ -13290,7 +11999,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:13294: checking if C compiler can produce shared libraries" >&5 +echo "configure:12003: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -13341,14 +12050,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:12061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cc_produces_so=yes else @@ -13373,7 +12082,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:13377: checking for ld used by GCC" >&5 +echo "configure:12086: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -13398,7 +12107,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:13402: checking for GNU ld" >&5 +echo "configure:12111: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -13436,7 +12145,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:13440: checking if the linker is GNU ld" >&5 +echo "configure:12149: 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 @@ -13459,12 +12168,11 @@ 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:13468: checking whether the linker supports shared libraries" >&5 +echo "configure:12176: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -13630,7 +12338,7 @@ ;; solaris2* | solaris7*) - ld_dynamic_link_flags= + ld_dynamic_link_flags="${wl}-Bdynamic" ;; sco3.2v5* | unixware* | sysv5* | sysv4*) @@ -13660,8 +12368,6 @@ - fi - if test "$can_build_shared" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SHLIB @@ -13671,18 +12377,21 @@ EOF } - extra_objs="$extra_objs sysdll.o emodules.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"sysdll.o emodules.o\"" + extra_objs="$extra_objs sysdll.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"sysdll.o\"" + fi + extra_objs="$extra_objs emodules.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"emodules.o\"" fi INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" && if test "$extra_verbose" = "yes"; then echo " Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi - test -n "$libdl" && LIBS="-l${libdl} $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-l${libdl}\" to \$LIBS"; fi + test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13683: 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:12418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13732,23 +12441,18 @@ fi done - with_modules=yes else - if test "$with_modules" = "yes"; then - { echo "Error:" "Required module support cannot be provided." >&2; exit 1; } - else - echo "configure: warning: "Module support cannot be provided."" 1>&2 - fi - with_modules=no - fi -fi - -cat > conftest.$ac_ext <&2 + with_shlib=no + fi +fi + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:12456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -13889,25 +12593,13 @@ echo "" fi - -if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then - test "$extra_verbose" = "yes" && echo "creating src/.gdbinit" - echo "source $srcdir/src/.gdbinit" > "src/.gdbinit" -fi - -if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then - test "$extra_verbose" = "yes" && echo "creating src/.dbxrc" - echo ". $srcdir/src/.dbxrc" > "src/.dbxrc" -fi - -if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then - test "$extra_verbose" = "yes" && echo "creating TAGS" - echo " -$srcdir/TAGS,include" > "TAGS" +if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then + echo "creating src/gdbinit"; echo "" + echo "source $srcdir/src/gdbinit" > src/gdbinit fi if test "$__SUNPRO_C" = "yes"; then - test "$extra_verbose" = "yes" && echo "creating .sbinit" + echo "creating .sbinit"; echo "" ( echo "# For use with Sun WorkShop's Source browser." echo "# See sbquery(1) and sbinit(4) for more information" for dir in $MAKE_SUBDIR; do echo "import $dir"; done @@ -13931,9 +12623,6 @@ - - - PREFIX=$prefix while true; do case "$PREFIX" in @@ -13944,7 +12633,6 @@ - EXEC_PREFIX=$exec_prefix while true; do case "$EXEC_PREFIX" in @@ -14044,10 +12732,10 @@ -DOCDIR=$docdir +LOCKDIR=$lockdir while true; do - case "$DOCDIR" in - *\$* ) eval "DOCDIR=$DOCDIR" ;; + case "$LOCKDIR" in + *\$* ) eval "LOCKDIR=$LOCKDIR" ;; *) break ;; esac done @@ -14093,16 +12781,6 @@ : ${XEMACS_CC:=$CC} -if test "$with_prefix" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining PREFIX_USER_DEFINED -EOF -cat >> confdefs.h <<\EOF -#define PREFIX_USER_DEFINED 1 -EOF -} - -fi if test "$with_site_lisp" = "no"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -14131,10 +12809,10 @@ ac_configure_args="$T" { test "$extra_verbose" = "yes" && cat << EOF - Defining EMACS_CONFIGURATION = "$configuration" + Defining EMACS_CONFIGURATION = "$canonical" EOF cat >> confdefs.h <> confdefs.h <<\EOF -#define QUICK_BUILD 1 +test "$no_doc_file" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining NO_DOC_FILE +EOF +cat >> confdefs.h <<\EOF +#define NO_DOC_FILE 1 EOF } @@ -14320,14 +12998,6 @@ EOF } -test "$pdump" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining PDUMP -EOF -cat >> confdefs.h <<\EOF -#define PDUMP 1 -EOF -} - ( @@ -14339,127 +13009,62 @@ echo "$0 $quoted_arguments" ) > Installation -if test ! -z ${emacs_beta_version} ; then - if test -z "${emacs_is_beta}" ; then - xemacs_betaname=".${emacs_beta_version}" - else - xemacs_betaname="-b${emacs_beta_version}" - fi -else - xemacs_betaname="" -fi +xemacs_betaname="" +test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}" ( echo " XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'. -" -echo " -Compilation / Installation:" -echo " Source code location: $srcdir" -echo " Installation prefix: $prefix" + + 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 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 -echo " Operating system description file: \`$opsysfile'" -echo " Machine description file: \`$machfile'" -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)." + echo " Runtime library search path: $runpath" +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 + 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 " WARNING: -----------------------------------------------------------" - echo " WARNING: Compiling without XPM image support." + echo " --------------------------------------------------------------------" + echo " WARNING: Compiling without XPM 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 " WARNING: -----------------------------------------------------------" + echo " --------------------------------------------------------------------" fi if test "$with_png" = yes; then - echo " Compiling in support for PNG images." + echo " Compiling in support for PNG image handling." elif test "$window_system" != "none"; then - echo " WARNING: -----------------------------------------------------------" + echo " --------------------------------------------------------------------" echo " WARNING: Compiling without PNG image support." if test "$png_problem" != ""; then echo " Reason: $png_problem" @@ -14467,66 +13072,87 @@ 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 " WARNING: -----------------------------------------------------------" -fi -test "$with_jpeg" = yes && echo " Compiling in support for JPEG images." -test "$with_tiff" = yes && echo " Compiling in support for TIFF images." + 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." test "$with_xface" = yes && echo " Compiling in support for X-Face message headers." - -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." +case "$with_sound" in + nas ) echo " Compiling in network sound (NAS) support." ;; + native ) echo " Compiling in native sound support." ;; + both ) echo " Compiling in both network and native sound support." ;; +esac +test "$old_nas" = yes && echo " nas library lacks error trapping, will play synchronously." + +test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley DB." 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." -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." +test "$with_database_gnudbm" = yes && echo " Compiling in support for GNU DBM." + +test "$with_umich_ldap" = yes && echo " Compiling in support for LDAP (UMich libs)." +test "$with_ns_ldap" = yes && echo " Compiling in support for LDAP (Netscape SDK)." +test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo " Compiling in support for LDAP (Generic)." + +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." 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 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_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_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_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 +test "$with_session" != no && echo " Compiling in support for proper session-management." +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'." ;; +esac +case "$with_scrollbars" in + lucid ) echo " Using Lucid scrollbars." ;; + motif ) echo " Using Motif scrollbars." ;; + athena ) echo " Using Athena scrollbars." ;; + athena3d ) echo " Using Athena-3d 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." ;; + athena3d ) echo " Using Athena-3d dialog boxes." ;; +esac +test "$with_shlib" = "yes" && echo " Compiling in DLL 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 "$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 echo " WARNING: ---------------------------------------------------------" echo " WARNING: Compiling in support for runtime error checking." echo " WARNING: XEmacs will run noticeably more slowly as a result." @@ -14548,10 +13174,12 @@ for file in $internal_makefile_list; do test "$file" = src/Makefile.in && \ file="src/Makefile.in:src/Makefile.in.in:src/depend" - ac_output_files="$ac_output_files $file" && if test "$extra_verbose" = "yes"; then echo " Appending \"$file\" to \$ac_output_files"; fi + ac_output_files="${ac_output_files+$ac_output_files }$file" done ac_output_files="$ac_output_files src/paths.h lib-src/config.values" -test "$with_modules" = "yes" && ac_output_files="$ac_output_files lib-src/ellcc.h" && if test "$extra_verbose" = "yes"; then echo " Appending \"lib-src/ellcc.h\" to \$ac_output_files"; fi +if test "$with_shlib" = "yes"; then + ac_output_files="$ac_output_files lib-src/ellcc.h" +fi trap '' 1 2 15 @@ -14597,7 +13225,7 @@ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -14617,11 +13245,9 @@ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub -s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -14651,7 +13277,6 @@ s%@lib_gcc@%$lib_gcc%g s%@RANLIB@%$RANLIB%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@YACC@%$YACC%g s%@SET_MAKE@%$SET_MAKE%g @@ -14664,7 +13289,6 @@ s%@dnd_objs@%$dnd_objs%g s%@lwlib_objs@%$lwlib_objs%g s%@ALLOCA@%$ALLOCA%g -s%@have_esd_config@%$have_esd_config%g s%@dll_ld@%$dll_ld%g s%@dll_cflags@%$dll_cflags%g s%@dll_ldflags@%$dll_ldflags%g @@ -14679,14 +13303,10 @@ s%@version@%$version%g s%@configuration@%$configuration%g s%@canonical@%$canonical%g -s%@inststaticdir@%$inststaticdir%g -s%@instvardir@%$instvardir%g s%@srcdir@%$srcdir%g s%@pkgdir@%$pkgdir%g s%@statedir@%$statedir%g -s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g s%@PREFIX@%$PREFIX%g -s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g s%@EXEC_PREFIX@%$EXEC_PREFIX%g s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g s%@INFODIR@%$INFODIR%g @@ -14711,12 +13331,13 @@ s%@etcdir@%$etcdir%g s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g s%@ETCDIR@%$ETCDIR%g -s%@docdir@%$docdir%g -s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g -s%@DOCDIR@%$DOCDIR%g +s%@lockdir@%$lockdir%g +s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g +s%@LOCKDIR@%$LOCKDIR%g s%@archlibdir@%$archlibdir%g s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g s%@ARCHLIBDIR@%$ARCHLIBDIR%g +s%@docdir@%$docdir%g s%@bitmapdir@%$bitmapdir%g s%@extra_objs@%$extra_objs%g s%@machfile@%$machfile%g diff -r 12e008d41344 -r 697ef44129c6 configure.in --- a/configure.in Mon Aug 13 11:19:22 2007 +0200 +++ b/configure.in Mon Aug 13 11:20:41 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.13 or later. +### in the this directory. You must have autoconf version 2.12 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.13)dnl +AC_PREREQ(2.12)dnl dnl Redefine some standard autoconf macros dnl here is how XEmacs is different: dnl - no cache file @@ -307,7 +307,6 @@ 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 @@ -346,28 +345,27 @@ statedir='${prefix}/lib' libdir='${exec_prefix}/lib' mandir='${prefix}/man/man1' -inststaticdir='${PROGNAME}' -instvardir='${PROGNAME}-${version}' -infodir='${datadir}/${instvardir}/info' +infodir='${datadir}/${PROGNAME}-${version}/info' infopath='' install_pp='' -lispdir='${datadir}/${instvardir}/lisp' -moduledir='${datadir}/${instvardir}/${configuration}/modules' -sitelispdir='${datadir}/${inststaticdir}/site-lisp' -sitemoduledir='${datadir}/${inststaticdir}/site-modules' -pkgdir='${datadir}/${instvardir}/lisp' +lispdir='${datadir}/${PROGNAME}-${version}/lisp' +moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules' +sitelispdir='${datadir}/xemacs/site-lisp' +sitemoduledir='${datadir}/xemacs/site-modules' +pkgdir='${datadir}/${PROGNAME}-${version}/lisp' package_path='' -etcdir='${datadir}/${instvardir}/etc' -archlibdir='${datadir}/${instvardir}/${configuration}' -docdir='${archlibdir}' -with_prefix='yes' +etcdir='${datadir}/${PROGNAME}-${version}/etc' +lockdir='${statedir}/${PROGNAME}/lock' +archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}' with_site_lisp='no' with_site_modules='yes' with_menubars='' with_scrollbars='' -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='' @@ -385,9 +383,6 @@ with_tty="" use_union_type="no" with_dnet="" -pdump="no" -dnl dragndrop is still experimental. When it is stable, comment out the following line: -with_dragndrop="no" dnl ------------------ dnl Options Processing @@ -468,8 +463,7 @@ dnl Process (many) boolean options with_site_lisp | \ - with_prefix | \ - with_site_modules | \ + with_site_modules | \ with_x | \ with_x11 | \ with_msw | \ @@ -488,7 +482,7 @@ with_jpeg | \ with_png | \ with_tiff | \ - with_wmcommand | \ + with_session | \ with_xmu | \ with_purify | \ with_quantify | \ @@ -505,7 +499,6 @@ with_sparcworks | \ with_tooltalk | \ with_ldap | \ - with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ @@ -514,15 +507,15 @@ external_widget | \ verbose | \ extra_verbose | \ + const_is_losing | \ usage_tracking | \ use_union_type | \ - pdump | \ debug | \ use_assertions | \ memory_usage_stats | \ with_clash_detection | \ - with_modules | \ - quick_build ) + with_shlib | \ + no_doc_file ) dnl Make sure the value given was either "yes" or "no". case "$val" in y | ye | yes ) val=yes ;; @@ -581,20 +574,20 @@ "with_database" ) with_database_berkdb=no with_database_dbm=no - with_database_gdbm=no + with_database_gnudbm=no for x in `echo "$val" | sed -e 's/,/ /g'` ; do case "$x" in - no ) ;; - b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;; - d | db | dbm ) with_database_dbm=yes ;; - g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes ;; - * ) USAGE_ERROR(["The \`--$optname' option value + no ) ;; + b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;; + d | db | dbm ) with_database_dbm=yes ;; + g | gn | gnu | gnud | gnudb | gnudbm ) with_database_gnudbm=yes ;; + * ) USAGE_ERROR(["The \`--$optname' option value must be either \`no' or a comma-separated list of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."]) ;; esac done - if test "$with_database_dbm" = "yes" -a \ - "$with_database_gdbm" = "yes"; then + if test "$with_database_dbm" = "yes" -a \ + "$with_database_gnudbm" = "yes"; then USAGE_ERROR("Only one of \`dbm' and \`gnudbm' may be specified with the \`--$optname' option.") fi @@ -602,54 +595,16 @@ dnl Has the user requested sound support? "with_sound" ) - dnl values is a subset of all,native,nas,esd - dnl or their negatives: none,nonative,nonas,noesd - for x in `echo "$val" | sed -e 's/,/ /g'` ; do - case "$x" in - dnl all and none are only permitted as the first in the list. - n | no | non | none ) new_sdefault=no ;; - a | al | all | both ) new_sdefault=yes ;; - - native ) with_native_sound=yes ;; - nonative ) with_native_sound=no ;; - - nas ) with_nas_sound=yes ;; - nonas ) with_nas_sound=no ;; - - esd ) with_esd_sound=yes ;; - noesd ) with_esd_sound=no ;; - - * ) bogus_sound=yes ;; - esac - if test "$bogus_sound" -o \ - \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then - types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'." - USAGE_ERROR(["Valid types for the \`--$optname' option are: - $types. -The default is to autodetect all sound support."]) - elif test -n "$new_sdefault" ; then - with_native_sound=$new_sdefault - with_nas_sound=$new_sdefault - with_esd_sound=$new_sdefault - new_sdefault= # reset this - fi - sound_notfirst=true - done - ;; - - dnl Has the user specified a prefered Athena widget set? - dnl This bit expands any alias names out for us... - "with_athena" ) + dnl value can be native, nas or both. yes is allowed + dnl as a backwards compatible synonym for native case "$val" in - xa | xaw ) val=xaw ;; - 3 | 3d | xaw3d ) val=3d ;; - dnl No `n' for next, someone may try `no' - ne | nex | next | naxtaw) val=next ;; - dnl Have not tested the next two... - 9 | 95 | xaw95 ) val=95 ;; - xp | xpm | xawxpm ) val=xpm ;; + y | ye | yes ) val=native ;; + n | no | non | none ) val=no;; + na | nat | nati | nativ | native ) val=native ;; + ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas ;; + b | bo | bot | both ) val=both;; * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: - \`xaw', \`3d', \`next', \`95', or \`xpm'."]) ;; + \`native', \`nas', \`both', or \`none'."]) ;; esac eval "$opt=\"$val\"" ;; @@ -672,10 +627,9 @@ case "$val" in lockf ) val=lockf ;; flock ) val=flock ;; - file | dot ) val=file ;; - locking ) val=locking ;; + file ) val=file ;; * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: - \`lockf', \`flock', \`file', \`locking', or \`mmdf'."]) ;; + \`lockf', \`flock', or \`file'."]) ;; esac eval "$opt=\"$val\"" ;; @@ -707,20 +661,14 @@ malloc ) error_check_malloc=yes ;; nomalloc ) error_check_malloc=no ;; - 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', \`noglyphs' and \`nobyte-code'." + types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'." else - types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'." + types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'." fi USAGE_ERROR(["Valid types for the \`--$optname' option are: $types."]) @@ -730,8 +678,6 @@ error_check_bufpos=$new_default 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 @@ -745,7 +691,7 @@ dnl Has the user specified one of the path options? prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ + mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \ archlibdir | docdir | package_path ) dnl If the value was omitted, get it from the next argument. if test "$valomitted" = "yes"; then @@ -759,8 +705,6 @@ dnl You need to synchronize this with the way the dnl default values are built. case "$opt" in - dnl prefix is taken care of by --with-prefix - exec_prefix ) AC_DEFINE(EXEC_PREFIX_USER_DEFINED) ;; lispdir ) AC_DEFINE(LISPDIR_USER_DEFINED) ;; sitelispdir ) AC_DEFINE(SITELISPDIR_USER_DEFINED) ;; moduledir ) AC_DEFINE(MODULEDIR_USER_DEFINED) ;; @@ -773,7 +717,7 @@ AC_DEFINE(LISPDIR_USER_DEFINED) AC_DEFINE(MODULEDIR_USER_DEFINED) AC_DEFINE(ETCDIR_USER_DEFINED) ;; - docdir ) AC_DEFINE(DOCDIR_USER_DEFINED) ;; + statedir | lockdir ) AC_DEFINE(LOCKDIR_USER_DEFINED) ;; exec_prefix | libdir | archlibdir ) AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;; esac ;; @@ -787,25 +731,21 @@ dnl Has the user specified the toolkit(s) to use for GUI elements? "with_menubars" | \ "with_scrollbars" | \ - "with_dialogs" | \ - "with_widgets" ) + "with_dialogs" ) case "$val" in l | lu | luc | luci | lucid ) val=lucid ;; m | mo | mot | moti | motif ) val=motif ;; + athena3d | athena-3d ) val=athena3d ;; a | at | ath | athe | athen | athena ) val=athena ;; - n | no | non | none ) val=no ;; - y | ye | yes ) val=yes ;; + n | no | non | none ) val=no ;; * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: - \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;; + \`lucid', \`motif', \`athena', \`athena3d', or \`no'."]) ;; esac eval "$opt=\"$val\"" ;; dnl Obsolete legacy argument? Warn, but otherwise ignore. - "use_minimal_tagbits" | \ - "use_indexed_lrecord_implementation" | \ "run_in_place" | \ - "const_is_losing" | \ "with_gnu_make" ) AC_MSG_WARN([Obsolete option \`--$optname' ignored.]) ;; @@ -911,7 +851,7 @@ dnl have stuck the source on a read-only partition. Instead we dnl create it as an actual directory later on if it does not already dnl exist. -for dir in lisp etc man info tests; do +for dir in lisp etc man info; do if test ! -d "$dir" ; then echo Making symbolic link to "$srcdir/$dir" ${LN_S} "$srcdir/$dir" "$dir" @@ -969,25 +909,20 @@ dnl ---------------------------------------- . "$srcdir/version.sh" || exit 1; dnl Must do the following first to determine verbosity for AC_DEFINE -if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi +if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi : "${extra_verbose=$beta}" version="${emacs_major_version}.${emacs_minor_version}" AC_DEFINE_UNQUOTED(EMACS_MAJOR_VERSION, $emacs_major_version) AC_DEFINE_UNQUOTED(EMACS_MINOR_VERSION, $emacs_minor_version) -if test -n "$emacs_beta_version" ; then - if test "$beta" = "yes"; then - version="${version}-b${emacs_beta_version}" - AC_DEFINE_UNQUOTED(EMACS_BETA_VERSION, $emacs_beta_version) - else - version="${version}.${emacs_beta_version}" - AC_DEFINE_UNQUOTED(EMACS_PATCH_LEVEL, $emacs_beta_version) - fi +if test -n "$emacs_beta_version"; then + version="${version}-b${emacs_beta_version}" + AC_DEFINE_UNQUOTED(EMACS_BETA_VERSION, $emacs_beta_version) fi AC_DEFINE_UNQUOTED(XEMACS_CODENAME, "$xemacs_codename") AC_DEFINE_UNQUOTED(EMACS_VERSION, "$version") if test "$with_infodock" = "yes"; then - if test ! -f ../../ID-INSTALL; then + if test ! -f ../ID-INSTALL; then echo "Cannot build InfoDock without InfoDock sources" with_infodock=no fi @@ -1006,28 +941,23 @@ PROGNAME=xemacs fi -AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME") - dnl ---------------------------------- dnl Error checking and debugging flags dnl ---------------------------------- dnl Error checking default to "yes" in beta versions, to "no" in releases. dnl Same goes for --debug and --extra-verbosity. -if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi +if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi test "${error_check_extents=$beta}" = yes && AC_DEFINE(ERROR_CHECK_EXTENTS) test "${error_check_typecheck=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TYPECHECK) test "${error_check_bufpos=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BUFPOS) 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 if test "${debug:=$beta}" = "yes"; then use_assertions=yes memory_usage_stats=yes XE_ADD_OBJS(debug.o) - XE_ADD_OBJS(tests.o) AC_DEFINE(DEBUG_XEMACS) fi test "$use_assertions" = "yes" && AC_DEFINE(USE_ASSERTIONS) @@ -1079,9 +1009,7 @@ alpha*-*-* ) machine=alpha ;; vax-*-* ) machine=vax ;; mips-dec-* ) machine=pmax ;; - mips-sgi-irix6* ) machine=iris6d ;; mips-sgi-* ) machine=iris4d ;; - mips*-linux ) machine=mips ;; romp-ibm-* ) machine=ibmrt ;; rs6000-ibm-aix* ) machine=ibmrs6000 ;; powerpc-ibm-aix* ) machine=ibmrs6000 ;; @@ -1091,9 +1019,8 @@ m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; - arm* ) machine=arm ;; + arm-* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; - s390-* ) machine=s390 ;; esac dnl Straightforward OS determination @@ -1536,7 +1463,6 @@ else NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE" ; fi ;; - *-sysv5* ) opsys=sco7 ;; *-386bsd* ) opsys=386bsd ;; *-freebsd* ) opsys=freebsd ;; *-nextstep* ) opsys=nextstep ;; @@ -1602,7 +1528,7 @@ XE_ADD_OBJS(sunpro.o) fi -if test "$with_clash_detection" != "no"; then +if test "$with_clash_detection" = "yes"; then AC_DEFINE(CLASH_DETECTION) XE_ADD_OBJS(filelock.o) fi @@ -1649,14 +1575,7 @@ AC_PROG_CPP -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_AIX AC_MSG_CHECKING(for GNU libc) AC_TRY_COMPILE([#include ],[ @@ -1670,23 +1589,6 @@ 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! @@ -1767,11 +1669,8 @@ CPP_to_sh(LD_SWITCH_SHARED, ld_switch_shared, -c) -#define ORDINARY_LD "\$(CC) \$(CFLAGS)" -configure___ ordinary_ld=ORDINARY_LD - #ifdef ORDINARY_LINK -#define LD ORDINARY_LD +#define LD "\$(CC) \$(CFLAGS)" #else /* no ORDINARY LINK */ #ifdef COFF_ENCAPSULATE #define LD "\$(CC) -nostdlib" @@ -1807,10 +1706,8 @@ CPP_boolean_to_sh(ORDINARY_LINK, ordinary_link) CPP_boolean_to_sh(SYSTEM_MALLOC, system_malloc) CPP_boolean_to_sh(TERMINFO, have_terminfo) -dnl The MAIL_USE_xxx variables come from the s&m headers CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock) CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf) -CPP_boolean_to_sh(MAIL_USE_LOCKING, mail_use_locking) CPP_boolean_to_sh(HAVE_WIN32_PROCESSES, win32_processes) EOF @@ -1825,15 +1722,6 @@ rm $tempcname -if test "$pdump" = "yes"; then - ordinary_link="yes" - ld="${ordinary_ld}" - start_files= - libs_standard= - unexec= - lib_gcc= -fi - dnl For debugging... test "$extra_verbose" = "yes" && \ PRINT_VAR(libs_machine libs_system libs_termcap libs_standard @@ -1842,19 +1730,12 @@ ld lib_gcc ld_text_start_addr start_files ordinary_link have_terminfo mail_use_flock mail_use_lockf) && echo "" -dnl Pick up mingw32 include path -case "$opsys" in mingw*) mingw_include=`eval "gcc -print-file-name=libc.a"` ; - mingw_include=`eval "dirname $mingw_include"` ; - mingw_include="-I$mingw_include/../include/mingw32" ; - XE_APPEND($mingw_include, c_switch_system) ;; -esac - dnl Non-ordinary link usually requires -lc test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc" dnl Compiler-specific hacks -dnl DEC C `-std1' means ANSI C mode -test "$__DECC" = "yes" && XE_APPEND(-std1, c_switch_site) +dnl DEC C requires -std +test "$__DECC" = "yes" && XE_APPEND(-std, c_switch_site) dnl Calculalate value of CFLAGS: dnl Use either command line flag, environment var, or autodetection @@ -1862,7 +1743,7 @@ dnl Following values of CFLAGS are known to work well. dnl Should we take debugging options into consideration? if test "$GCC" = "yes"; then - CFLAGS="-g -O3 -Wall -Wno-switch -Wpointer-arith -Winline -Wmissing-prototypes -Wshadow" + CFLAGS="-g -O3 -Wall -Wno-switch" dnl I'm not convinced this is a good idea any more. -sb dnl test "$opsys $machine" = "linux intel386" && \ dnl CFLAGS="$CFLAGS -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2" @@ -1881,70 +1762,6 @@ fi fi -dnl Search for GCC specific build problems we know about -if test "$GCC" = "yes"; then -AC_MSG_CHECKING(for buggy gcc versions) -GCC_VERSION=`$CC --version` -case `uname -s`:`uname -m`:$GCC_VERSION in - dnl egcs 2.90.21 (egcs-1.00 release) - dnl egcs 2.90.29 (egcs-1.0.3 release) - *:sun4*:2.8.1|*:sun4*:egcs-2.90.*) - dnl Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures - dnl without also using `-fno-schedule-insns'. - case "$CFLAGS" in - *-O2*|*-O3*) - case "$CFLAGS" in - *-fno-schedule-insns*) ;; - *) - AC_MSG_RESULT(Yes) - AC_MSG_WARN(Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures) - AC_MSG_WARN(without also using -fno-schedule-insns.) - AC_MSG_ERROR(Aborting due to known problem) - ;; - esac - ;; - esac - ;; - dnl egcs-2.91.57 (egcs-1.1 release) - dnl egcs-2.91.66 (egcs-1.1.2 release) - Linux:alpha:egcs-2.91.*) - AC_MSG_RESULT(Yes) - AC_MSG_WARN(There have been reports of egcs-1.1 not compiling XEmacs correctly on) - AC_MSG_WARN(Alpha Linux. There have also been reports that egcs-1.0.3a is O.K.) - AC_MSG_ERROR(Aborting due to known problem) - ;; - *:i*86*:2.7.2*) - case "$GCC_VERSION" in - 2.7.2) - case "$CFLAGS" in - *-O2*|*-O3*) - case "$CFLAGS" in - *-fno-strength-reduce*) ;; - *) - AC_MSG_RESULT(Yes) - AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using) - AC_MSG_WARN(-fno-strength-reduce.) - AC_MSG_ERROR(Aborting due to known problem) - ;; - esac - ;; - esac - ;; - esac - case "$CFLAGS" in - *-fno-caller-saves*) ;; - *) - AC_MSG_RESULT(Yes) - AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using) - AC_MSG_WARN(-fno-caller-saves.) - AC_MSG_ERROR(Aborting due to known problem) - ;; - esac - ;; -esac -fi -AC_MSG_RESULT(No) - dnl Inform compiler that certain flags are meant for the linker dnl XE_PROTECT_LINKER_FLAGS(shell_var) define([XE_PROTECT_LINKER_FLAGS], [ @@ -1968,8 +1785,7 @@ dnl Add s&m-determined objects (including unexec) to link line test -n "$objects_machine" && XE_ADD_OBJS($objects_machine) test -n "$objects_system" && XE_ADD_OBJS($objects_system) -test -n "$unexec" && test ! "$pdump" = "yes" && XE_ADD_OBJS($unexec) -test "$pdump" = "yes" && XE_ADD_OBJS(dumper.o) +test -n "$unexec" && XE_ADD_OBJS($unexec) dnl Dynodump (Solaris 2.x, x<6) AC_MSG_CHECKING(for dynodump) @@ -2066,16 +1882,16 @@ COLON_TO_SPACE(site_prefixes) if test -n "$site_prefixes"; then for dir in $site_prefixes; do + inc_dir="${dir}/include" lib_dir="${dir}/lib" - inc_dir="${dir}/include" if test ! -d "$dir"; then XE_DIE("Invalid site prefix \`$dir': no such directory") + elif test ! -d "$inc_dir"; then + XE_DIE("Invalid site prefix \`$dir': no such directory \`$inc_dir'") elif test ! -d "$lib_dir"; then XE_DIE("Invalid site prefix \`$dir': no such directory \`$lib_dir'") else - if test -d "$inc_dir"; then - XE_APPEND("-I$inc_dir", c_switch_site) - fi + XE_APPEND("-I$inc_dir", c_switch_site) XE_APPEND("-L$lib_dir", ld_switch_site) fi done @@ -2089,7 +1905,7 @@ dnl Extra system-specific library directories - please add to list for dir in "/usr/ccs/lib"; do - test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system) + test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_site) done dnl --site-runtime-libraries (multiple dirs) @@ -2099,31 +1915,11 @@ export LD_RUN_PATH fi -dnl Linux systems have dynamic runtime library directories listed in -dnl /etc/ld.so.conf. Since those are used at run time, it seems pretty -dnl safe to use them at link time, and less controversial than forcing -dnl the run-time to use the link-time libraries. This also helps avoid -dnl mismatches between the link-time and run-time libraries. - -dnl #### Unfortunately, there are horrible libc4 and libc5 libraries -dnl listed in /etc/ld.so.conf on some systems, and including them on -dnl the link path leads to linking in utterly broken libc's. -dnl There are many clever ways of approaching this problem, -dnl but finding out that actually works... - -dnl if test -z "$LD_RUN_PATH" -a -r "/etc/ld.so.conf"; then -dnl for dir in `cat /etc/ld.so.conf`; do -dnl test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system) -dnl done -dnl add_runtime_path=no -dnl fi - dnl ------------------------------------- dnl Compute runtime library path dnl ------------------------------------- -if test -n "$add_runtime_path"; then :; -elif test "$dynamic" = "no"; then add_runtime_path=no +if test "$dynamic" = "no"; then add_runtime_path=no elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes else case "$opsys" in sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;; @@ -2241,6 +2037,7 @@ doug_lea_malloc=no fi after_morecore_hook_exists=yes +AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no) AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) AC_MSG_CHECKING(whether __after_morecore_hook exists) AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0], @@ -2250,26 +2047,29 @@ 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." + (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." +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 AC_DEFINE(DOUG_LEA_MALLOC) 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.)" AC_DEFINE(_NO_MALLOC_WARNING_) fi + use_minimal_tagbits=yes fi dnl #### mcheck is broken in all versions of Linux libc and glibc. @@ -2298,25 +2098,9 @@ AC_PROG_YACC dnl checks for header files -AC_CHECK_HEADERS(dnl - a.out.h dnl - cygwin/version.h dnl - fcntl.h dnl - inttypes.h dnl - libgen.h dnl - locale.h dnl - mach/mach.h dnl - sys/param.h dnl - sys/pstat.h dnl - sys/stropts.h dnl - sys/time.h dnl - sys/timeb.h dnl - sys/un.h dnl - kstat.h dnl - ulimit.h dnl - unistd.h dnl - utime.h dnl -) +AC_CHECK_HEADERS(mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h) +AC_CHECK_HEADERS(utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h) +AC_CHECK_HEADERS(kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h) AC_HEADER_SYS_WAIT AC_HEADER_STDC AC_HEADER_TIME @@ -2348,20 +2132,6 @@ AC_TYPE_UID_T AC_TYPE_MODE_T AC_TYPE_OFF_T -AC_CHECK_TYPE(ssize_t, int) - -dnl check for Unix98 socklen_t -AC_MSG_CHECKING(for socklen_t) -AC_TRY_COMPILE([#include -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 @@ -2421,32 +2191,13 @@ dnl Determine type of mail locking from configure args and s&m headers AC_CHECKING(type of mail spool file locking) -AC_CHECK_FUNCS(lockf flock) -dnl The mail_use_xxx variables are set according to the s&m headers. 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 +if test "$mail_locking" = "lockf"; then AC_DEFINE(REAL_MAIL_USE_LOCKF) +elif test "$mail_locking" = "flock"; then AC_DEFINE(REAL_MAIL_USE_FLOCK) +else mail_locking="dot-locking" 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" && \ - XE_DIE("lockf mail locking requested but not available.") -test "$mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \ - XE_DIE("flock mail locking requested but not available.") -test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \ - XE_DIE("locking mail locking requested but not available.") - case "$opsys" in decosf*) AC_CHECK_LIB(pthreads, cma_open) test "$ac_cv_lib_pthreads_cma_open" = "yes" && \ @@ -2463,15 +2214,13 @@ fi dnl Link with "-z ignore" on Solaris if supported -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 +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 fi dnl ---------------------- @@ -2615,19 +2364,10 @@ cd .. rm -fr conftestdir for word in $xmkmf_defines; do - 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 ;; + case "$word" in + -D*=* ) ;; + -D* ) word=`echo '' $word | sed -e 's:^ *-D::'` + AC_DEFINE_UNQUOTED($word) ;; esac done fi @@ -2662,8 +2402,6 @@ AC_MSG_RESULT(R${x11_release}) AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) - AC_CHECK_FUNCS(XConvertCase) - AC_CHECK_HEADERS(X11/Xlocale.h) dnl remove this - we should avoid checking for specific OS @@ -2715,7 +2453,7 @@ if test "$with_msw" = "yes"; then AC_DEFINE(HAVE_MS_WINDOWS) install_pp="$blddir/lib-src/installexe.sh" - XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool, libs_system) + XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomctl32, libs_system) test "$with_dragndrop" != no && XE_APPEND(msw, dragndrop_proto) if test "$window_system" != x11; then window_system=msw @@ -2727,7 +2465,6 @@ && XE_ADD_OBJS(toolbar-msw.o) test "$with_dialogs" != "no" && with_dialogs=msw \ && XE_ADD_OBJS(dialog-msw.o) - test "$with_widgets" != "no" && with_widgets=msw else test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-msw.o) test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-msw.o) @@ -2738,6 +2475,7 @@ 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 @@ -2781,7 +2519,7 @@ dnl if test "$with_tty" = "no" ; then dnl AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.]) dnl fi - for feature in tooltalk cde offix wmcommand xim xmu nas_sound + for feature in tooltalk cde offix session xim xmu do if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then AC_MSG_WARN([--with-$feature ignored: Not valid without X support]) @@ -2804,11 +2542,11 @@ test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" esac -dnl Enable or disable proper handling of WM_COMMAND -AC_CHECKING(for WM_COMMAND option); -dnl if test "$with_wmcommand" = "yes"; then -if test "$with_wmcommand" != "no"; then - AC_DEFINE(HAVE_WMCOMMAND) +dnl Enable or disable proper session-management +AC_CHECKING(for session-management option); +dnl if test "$with_session" = "yes"; then +if test "$with_session" != "no"; then + AC_DEFINE(HAVE_SESSION) fi dnl Autodetect Xauth @@ -2832,9 +2570,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_file="${dir}tt_c.h"; break) + AC_CHECK_HEADER(${dir}tt_c.h, tt_c_h_path="${dir}tt_c.h"; break) done - if test -z "$tt_c_h_file"; then + if test -z "$tt_c_h_path"; then if test "$with_tooltalk" = "yes"; then USAGE_ERROR("Unable to find required tooltalk header files.") fi @@ -2856,7 +2594,7 @@ test -z "$with_tooltalk" && with_tooltalk=yes if test "$with_tooltalk" = "yes"; then AC_DEFINE(TOOLTALK) - AC_DEFINE_UNQUOTED(TT_C_H_FILE, "$tt_c_h_file") + AC_DEFINE_UNQUOTED(TT_C_H_PATH, "$tt_c_h_path") XE_PREPEND($tt_libs, libs_x) XE_ADD_OBJS(tooltalk.o) fi @@ -2922,60 +2660,22 @@ test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) } if test "$with_ldap" != "no"; then - AC_CHECK_LIB(ldap, ldap_search, with_ldap_nolber=yes, with_ldap_nolber=no) - test "$with_ldap_nolber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_lber=yes, with_ldap_lber=no, -llber) } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krb=yes, with_ldap_krb=no, -llber -lkrb) } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krbdes=yes, with_ldap_krbdes=no, -llber -lkrb -ldes) } - test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes + test -z "$with_umich_ldap" && { AC_CHECK_LIB(ldap, ldap_open, with_umich_ldap=yes, with_umich_ldap=no, -llber) } + test "$with_umich_ldap" = "no" && { AC_CHECK_LIB(ldap10, ldap_set_option, with_ns_ldap=yes, with_ns_ldap=no) } + test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes fi if test "$with_ldap" = "yes"; then AC_DEFINE(HAVE_LDAP) XE_ADD_OBJS(eldap.o) - if test "$with_ldap_nolber" = "yes" ; then - XE_PREPEND(-lldap, LIBS) - else - if test "$with_ldap_krb" = "yes" ; then - XE_PREPEND(-lkrb, LIBS) - fi - if test "$with_ldap_krbdes" = "yes" ; then - XE_PREPEND(-ldes, LIBS) - XE_PREPEND(-lkrb, LIBS) - fi + if test "$with_umich_ldap" = "yes" ; then + AC_DEFINE(HAVE_UMICH_LDAP) XE_PREPEND(-llber, LIBS) XE_PREPEND(-lldap, LIBS) - fi - 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.") + elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then + AC_DEFINE(HAVE_NS_LDAP) + XE_PREPEND(-lldap10, LIBS) + elif test "$with_ldap" = "yes" ; then + XE_PREPEND(-lldap, LIBS) fi fi @@ -2991,8 +2691,7 @@ if test -z "$with_xpm"; then AC_MSG_CHECKING(for Xpm - no older than 3.4f) xe_check_libs=-lXpm - AC_TRY_RUN([#define XPM_NUMBERS -#include + AC_TRY_RUN([#include int main(int c, char **v) { return c == 1 ? 0 : XpmIncludeVersion != XpmLibraryVersion() ? 1 : @@ -3125,101 +2824,13 @@ AC_CHECKING(for X11 graphics libraries) - AC_CHECKING(for the Athena widgets) - - dnl What in heck did the user actually want? - case "$with_athena" in - dnl This is the default, old fashioned flat Athena. - "xaw" | "") athena_variant=Xaw athena_3d=no ;; - "3d") athena_variant=Xaw3d athena_3d=yes ;; - "next") athena_variant=neXtaw athena_3d=yes ;; - "95") athena_variant=Xaw95 athena_3d=yes ;; - "xpm") athena_variant=XawXpm athena_3d=yes ;; - *) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;; - esac - - dnl Search for the Athena library... - if test "$athena_3d" = "no"; then - AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb, - [ - dnl Must not be a 3d library... - AC_CHECK_LIB($athena_variant, threeDClassRec, - AC_MSG_WARN("Could not find a non-3d Athena widget library."), - athena_lib=$athena_variant) - ], - AC_MSG_WARN("Could not find an Athena widget library.")) - else - dnl The real configuration, need 3d library - AC_CHECK_LIB($athena_variant, threeDClassRec, athena_lib=$athena_variant, - dnl OK, couldn't find it with a proper name, try the standard Athena lib - dnl If that is 3d, presume the user asked for what they have installed. - AC_CHECK_LIB(Xaw, threeDClassRec, - [ - athena_lib=Xaw; - AC_MSG_WARN("Assuming that libXaw is actually $athena_variant."); - ], - AC_MSG_WARN("Could not find a 3d Athena widget library that looked like $athena_variant."))) - fi - - dnl Now we locate the Athena headers that we need. - if test "$athena_3d" = "no"; then - AC_CHECK_HEADER(X11/Xaw/ThreeD.h, - AC_MSG_WARN("Could not find a non-3d Athena header set."), - AC_CHECK_HEADER(X11/Xaw/XawInit.h, - athena_h_path=X11/Xaw, - AC_MSG_WARN("Could not find a non-3d Athena header set."))) - else - dnl The three-d Athena headers are so much more slippery. - dnl Curse this `Lets replace standard libraries' thing that they did. :/ - AC_CHECK_HEADER(X11/$athena_variant/XawInit.h, - AC_CHECK_HEADER(X11/$athena_variant/ThreeD.h, - athena_h_path=X11/$athena_variant,)) - - dnl Is the variant specific header directory directly under include? - if test -z "$athena_h_path"; then - AC_CHECK_HEADER($athena_variant/XawInit.h, - AC_CHECK_HEADER($athena_variant/ThreeD.h, - athena_h_path=$athena_variant,)) - fi - - dnl If we couldn't find the specific variant, try the generic Athena 3d headers - if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then - AC_CHECK_HEADER(X11/Xaw3d/XawInit.h, - AC_CHECK_HEADER(X11/Xaw3d/ThreeD.h, - [ - AC_MSG_WARN("Assuming that X11/Xaw3d headers are suitable for $athena_variant.") - athena_h_path=X11/Xaw3d - ],)) - fi - - dnl Also generic 3d headers directly under include dir - if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then - AC_CHECK_HEADER(Xaw3d/XawInit.h, - AC_CHECK_HEADER(Xaw3d/ThreeD.h, - [ - AC_MSG_WARN("Assuming that Xaw3d headers are suitable for $athena_variant.") - athena_h_path=Xaw3d - ],)) - fi - - dnl If nothing yet found, see if Xaw is a 3d header set... - dnl We AC_MSG_WARN if we fail because I am all out of ideas... - if test -z "$athena_h_path"; then - AC_CHECK_HEADER(X11/Xaw/ThreeD.h, - [ - AC_MSG_WARN("Assuming that X11/Xaw headers are suitable for $athena_variant.") - athena_h_path=X11/Xaw - ], - AC_MSG_WARN("Could not find a suitable 3d Athena header set.")) - fi - fi - - dnl Do we actually have a usable Athena widget set? Please? - if test -n "$athena_lib" -a -n "$athena_h_path"; then - have_xaw=yes - else - have_xaw=no - fi + dnl Autodetect -lXaw + AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no) + dnl if test "$have_xaw" = "yes"; then + dnl AC_CHECK_HEADER(X11/Xaw/Reports.h, [ + dnl XE_APPEND(pkg-src/tree-x, MAKE_SUBDIR) + dnl XE_APPEND(pkg-src/tree-x, INSTALL_ARCH_DEP_SUBDIR)]) + dnl fi dnl autodetect Motif - but only add to libs_x later (if necessary) AC_CHECK_HEADER(Xm/Xm.h, @@ -3244,62 +2855,26 @@ dnl Not all toolkits support all widgets dnl if Motif is available we use it for the dialog boxes. -case "$with_menubars" in "" | "yes" | "athena" ) +case "$with_menubars" in "" | "yes" | "athena" | "athena3d" ) with_menubars="lucid" ;; esac case "$with_dialogs" in "" | "yes" | "lucid" ) - if test "$have_motif" = "yes"; then with_dialogs="motif" - elif test "$have_xaw" = "yes"; then with_dialogs="athena" + if test "$have_motif" = "yes"; then with_dialogs="motif" + elif test "$have_xaw" = "yes"; then with_dialogs="athena" else with_dialogs=no fi ;; esac case "$with_scrollbars" in "" | "yes" ) with_scrollbars="lucid" ;; esac -case "$with_widgets" in "" | "yes" | "lucid") - if test "$have_motif" = "yes"; then with_widgets="motif" - elif test "$have_xaw" = "yes"; then with_widgets="athena" - else with_widgets=no - fi ;; -esac - -all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets" - -case "$all_widgets" in - *athena* ) - if test "$have_xaw" != "yes"; then - XE_DIE("Could not find a suitable Athena library to build with.") - fi - - dnl Add the Lucid widget Athena code - XE_APPEND(lwlib-Xaw.o, lwlib_objs) - - dnl Add the Athena widget library we located earlier - XE_PREPEND(-l$athena_lib, libs_x) - - 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) - fi - ;; + +all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars" + +case "$all_widgets" in *athena* ) + AC_DEFINE(LWLIB_USES_ATHENA) + AC_DEFINE(NEED_ATHENA) + XE_APPEND(lwlib-Xaw.o, lwlib_objs) + XE_PREPEND(-lXaw, libs_x) ;; esac case "$all_widgets" in *motif* ) @@ -3312,11 +2887,6 @@ test "$with_menubars" = "lucid" && XE_APPEND(xlwmenu.o, lwlib_objs) test "$with_menubars" = "motif" && XE_APPEND(xlwmenu.o, lwlib_objs) test "$with_scrollbars" = "lucid" && XE_APPEND(xlwscrollbar.o, lwlib_objs) -test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \ - XE_APPEND(xlwtabs.o xlwgcs.o, lwlib_objs) -case "$with_widgets" in athena* ) - XE_APPEND(xlwradio.o xlwcheckbox.o xlwgauge.o, lwlib_objs);; -esac case "$all_widgets" in *lucid* ) AC_DEFINE(NEED_LUCID) XE_APPEND(lwlib-Xlw.o, lwlib_objs) ;; @@ -3324,23 +2894,15 @@ AC_SUBST(lwlib_objs) -test "$with_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA) -test "$with_dialogs" = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA) - -if test "$athena_3d" = "yes"; then - test "$with_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D) - test "$with_dialogs" = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA3D) -fi - -case "$with_widgets" in athena* ) AC_DEFINE(LWLIB_WIDGETS_ATHENA);; esac -test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \ - AC_DEFINE(LWLIB_TABS_LUCID) +case "$with_scrollbars" in athena* ) AC_DEFINE(LWLIB_SCROLLBARS_ATHENA);; esac +case "$with_dialogs" in athena* ) AC_DEFINE(LWLIB_DIALOGS_ATHENA) ;; esac +test "$with_scrollbars" = "athena3d" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D) +test "$with_dialogs" = "athena3d" && AC_DEFINE(LWLIB_DIALOGS_ATHENA3D) test "$with_menubars" != "no" && AC_DEFINE(HAVE_MENUBARS) test "$with_scrollbars" != "no" && AC_DEFINE(HAVE_SCROLLBARS) test "$with_dialogs" != "no" && AC_DEFINE(HAVE_DIALOGS) test "$with_toolbars" != "no" && AC_DEFINE(HAVE_TOOLBARS) -test "$with_widgets" != "no" && AC_DEFINE(HAVE_WIDGETS) test "$with_menubars" = "lucid" && AC_DEFINE(LWLIB_MENUBARS_LUCID) test "$with_scrollbars" = "lucid" && AC_DEFINE(LWLIB_SCROLLBARS_LUCID) @@ -3348,19 +2910,24 @@ test "$with_menubars" = "motif" && AC_DEFINE(LWLIB_MENUBARS_MOTIF) test "$with_scrollbars" = "motif" && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF) test "$with_dialogs" = "motif" && AC_DEFINE(LWLIB_DIALOGS_MOTIF) -test "$with_widgets" = "motif" && AC_DEFINE(LWLIB_WIDGETS_MOTIF) - -test "$with_menubars" != "no" && XE_ADD_OBJS(menubar.o) -test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar.o) -test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog.o) -test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar.o) + +test "$with_menubars" != "no" && XE_ADD_OBJS(menubar.o) +test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar.o) +test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog.o) +test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar.o) if test "$with_x11" = "yes"; then - test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-x.o) - test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-x.o) - test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-x.o) - test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-x.o) - test "$all_widgets" != "no no no no no" && XE_ADD_OBJS(gui-x.o) + test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-x.o) + test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-x.o) + test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-x.o) + test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-x.o) + test "$all_widgets" != "no no no no" && XE_ADD_OBJS(gui-x.o) +else + if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then + echo "Attempt to Build NAS sound without X" + echo "Please remove NAS configuration or build with X" + exit 1 + fi fi dnl ---------------------- @@ -3502,10 +3069,25 @@ 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) - -dnl Use our own realpath always. -XE_ADD_OBJS(realpath.o) +AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf) + +dnl realpath is buggy on linux, decosf and aix4 + +dnl The realpath() in linux libc (4.6.27) sometimes fails with ELOOP. +dnl The realpath in ELF linux libc's is O.K. +dnl For example, call realpath on a file thirty-five or so directories deep +dnl and you get ELOOP even if no symlinks at all are involved. +dnl Reports as of 11/1997 indicate BSDi has problems too. +dnl The realpath() in UnixWare2.1.3 could not get any pathname fragment in error condition. +case "$opsys" in + linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) XE_ADD_OBJS(realpath.o) ;; + * ) + case "$canonical" in + *-*-sysv4.2uw2* ) XE_ADD_OBJS(realpath.o) ;; + * ) AC_CHECK_FUNCS(realpath) + test "$ac_cv_func_realpath" != "yes" && XE_ADD_OBJS(realpath.o) ;; + esac ;; +esac dnl Check whether the system provides getloadavg (Solaris 7 has it) AC_CHECK_FUNCS(getloadavg) @@ -3599,7 +3181,8 @@ ], [ struct timeval time; - gettimeofday (&time, 0); + struct timezone dummy; + gettimeofday (&time, &dummy); ], [AC_MSG_RESULT(two)], [AC_MSG_RESULT(one) @@ -3608,7 +3191,10 @@ AC_C_INLINE -test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && XE_ADD_OBJS(inline.o) +if test "$ac_cv_c_inline" != "no"; then + AC_DEFINE(HAVE_INLINE) + test "$GCC" = "yes" && XE_ADD_OBJS(inline.o) +fi dnl HP-UX has a working alloca in libPW. dnl case "${GCC}${opsys}" in hpux* ) @@ -3670,24 +3256,12 @@ esac AC_MSG_RESULT($have_mmap) test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP) +AC_FUNC_MMAP 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 -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 "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no +test "$rel_alloc" = "default" -a "$have_mmap" = "yes" && rel_alloc=yes test "$rel_alloc" = "yes" && AC_DEFINE(REL_ALLOC) dnl Check for terminal I/O variants @@ -3739,6 +3313,10 @@ dnl Autodetect native sound AC_CHECKING("for sound support") +case "$with_sound" in + native | both ) with_native_sound=yes;; + nas | no ) with_native_sound=no;; +esac test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes if test "$with_native_sound" != "no"; then @@ -3796,22 +3374,19 @@ for dir in "machine" "sys" "linux"; do AC_CHECK_HEADER(${dir}/soundcard.h, sound_found=yes - need_miscplay=yes XE_ADD_OBJS(linuxplay.o) - [AC_DEFINE_UNQUOTED(SOUNDCARD_H_FILE, "${dir}/soundcard.h")] + [AC_DEFINE_UNQUOTED(SOUNDCARD_H_PATH, "${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 + test "$sound_found" = "yes" && with_native_sound=yes +fi + +if test -z "$with_sound"; then + if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then + with_sound=native fi - - test "$sound_found" = "yes" && with_native_sound=yes fi if test "$with_native_sound" = "yes"; then @@ -3819,50 +3394,14 @@ test -n "$native_sound_lib" && XE_PREPEND($native_sound_lib, LIBS) fi -dnl NAS Sound support -if test "$with_nas_sound" != "no"; then - AC_CHECK_HEADER(audio/audiolib.h, [ - AC_CHECK_LIB(audio, AuOpenServer, have_nas_sound=yes)]) - if test "$have_nas_sound" = "yes"; then - with_nas_sound=yes - AC_DEFINE(HAVE_NAS_SOUND) - XE_ADD_OBJS(nas.o) - XE_PREPEND(-laudio, libs_x) - dnl If the nas library does not contain the error jump point, - dnl then we force safer behavior. - AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[old_nas=yes; AC_DEFINE(NAS_NO_ERROR_JUMP)]) - else - test "$with_nas_sound" = "yes" && \ - XE_DIE("Required NAS sound support cannot be provided.") - with_nas_sound=no - fi -fi - -dnl ESD Sound support -if test "$with_esd_sound" != "no"; then - AC_CHECK_PROG(have_esd_config, esd-config, yes, no) - if test "$have_esd_config" = "yes"; then - save_c_switch_site="$c_switch_site" save_LIBS="$LIBS" - XE_APPEND(`esd-config --cflags`, c_switch_site) - XE_PREPEND(`esd-config --libs`, LIBS) - AC_CHECK_FUNC(esd_play_stream, - have_esd_sound=yes, - c_switch_site="$save_c_switch_site" LIBS="$save_LIBS") - fi - - if test "$have_esd_sound" = "yes"; then - with_esd_sound=yes - need_miscplay=yes - XE_ADD_OBJS(esd.o) - AC_DEFINE(HAVE_ESD_SOUND) - else - test "$with_esd_sound" = "yes" && \ - XE_DIE("Required ESD sound support cannot be provided.") - with_esd_sound=no - fi -fi - -test "$need_miscplay" = "yes" && XE_ADD_OBJS(miscplay.o) +case "$with_sound" in both | nas ) + AC_DEFINE(HAVE_NAS_SOUND) + XE_ADD_OBJS(nas.o) + XE_PREPEND(-laudio, libs_x) + dnl If the nas library does not contain the error jump point, + dnl then we force safer behavior. + AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[AC_DEFINE(NAS_NO_ERROR_JUMP)]) +esac dnl --------------------- dnl TTY-dependent options @@ -3881,8 +3420,8 @@ fi if test "$with_ncurses" = "yes"; then AC_DEFINE(HAVE_NCURSES) - AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h) - AC_CHECK_HEADER(ncurses/term.h, term_h_file=ncurses/term.h) + AC_CHECK_HEADER(ncurses/curses.h, curses_h_path=ncurses/curses.h) + AC_CHECK_HEADER(ncurses/term.h, term_h_path=ncurses/term.h) XE_ADD_OBJS(terminfo.o) XE_PREPEND(-lncurses, LIBS) @@ -3892,7 +3431,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_file=ncurses/curses.h) + AC_CHECK_HEADER(ncurses/curses.h, curses_h_path=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" @@ -3924,8 +3463,8 @@ fi fi fi - AC_DEFINE_UNQUOTED(CURSES_H_FILE, "${curses_h_file-curses.h}") - AC_DEFINE_UNQUOTED(TERM_H_FILE, "${term_h_file-term.h}") + AC_DEFINE_UNQUOTED(CURSES_H_PATH, "${curses_h_path-curses.h}") + AC_DEFINE_UNQUOTED(TERM_H_PATH, "${term_h_path-term.h}") dnl Autodetect gpm test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) } @@ -3953,26 +3492,26 @@ dnl On FreeBSD, both DB and DBM are part of libc. dnl By default, we check for DBM support in libgdbm, then libc, then libdbm. -test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ +test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \ != "no no no" && AC_CHECKING(for database support) dnl Check for ndbm.h, required for either kind of DBM support. -if test "$with_database_gdbm $with_database_dbm" != "no no"; then +if test "$with_database_gnudbm $with_database_dbm" != "no no"; then AC_CHECK_HEADER(ndbm.h, [:], [ - test "$with_database_gdbm" = "yes" -o \ - "$with_database_dbm" = "yes" && \ + test "$with_database_gnudbm" = "yes" -o \ + "$with_database_dbm" = "yes" && \ XE_DIE("Required DBM support cannot be provided.") - with_database_gdbm=no with_database_dbm=no]) + with_database_gnudbm=no with_database_dbm=no]) fi dnl Check for DBM support in libgdbm. -if test "$with_database_gdbm" != "no"; then +if test "$with_database_gnudbm" != "no"; then AC_CHECK_LIB(gdbm, dbm_open, [ - with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm], [ - if test "$with_database_gdbm" = "yes"; then + with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm], [ + if test "$with_database_gnudbm" = "yes"; then XE_DIE("Required GNU DBM support cannot be provided.") fi - with_database_gdbm=no]) + with_database_gnudbm=no]) fi dnl Check for DBM support in libc and libdbm. @@ -3986,18 +3525,15 @@ dnl Tell make about the DBM support we detected. test -n "$libdbm" && XE_PREPEND("$libdbm", LIBS) -test "$with_database_gdbm" = "yes" -o \ - "$with_database_dbm" = "yes" && \ +test "$with_database_gnudbm" = "yes" -o \ + "$with_database_dbm" = "yes" && \ AC_DEFINE(HAVE_DBM) dnl Check for Berkeley DB. if test "$with_database_berkdb" != "no"; then AC_MSG_CHECKING(for Berkeley db.h) - for header in "db/db.h" "db.h"; do - AC_TRY_COMPILE([ -#include -#if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) -#ifdef HAVE_INTTYPES_H + for path in "db/db.h" "db.h"; do + AC_TRY_COMPILE([#ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ #include typedef uint8_t u_int8_t; @@ -4007,19 +3543,18 @@ typedef uint64_t u_int64_t; #endif #endif -#endif -#include <$header> -],[], db_h_file="$header"; break) +#include <$path> +],[], db_h_path="$path"; break) done - if test -z "$db_h_file" + if test -z "$db_h_path" then AC_MSG_RESULT(no); with_database_berkdb=no - else AC_MSG_RESULT($db_h_file) + else AC_MSG_RESULT($db_h_path) fi if test "$with_database_berkdb" != "no"; then AC_MSG_CHECKING(for Berkeley DB version) AC_EGREP_CPP(yes, -[#include <$db_h_file> +[#include <$db_h_path> #if DB_VERSION_MAJOR > 1 yes #endif @@ -4029,14 +3564,14 @@ fi if test "$with_database_berkdb" = "yes"; then - AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file") + AC_DEFINE_UNQUOTED(DB_H_PATH, "$db_h_path") AC_DEFINE(HAVE_BERKELEY_DB) test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS) else with_database_berkdb=no fi fi -if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ +if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \ != "no no no"; then AC_DEFINE(HAVE_DATABASE) XE_ADD_OBJS(database.o) @@ -4055,48 +3590,25 @@ fi dnl autodetect dll support -if test "$with_modules" != "no"; then - AC_CHECKING(for module support) - - dnl Check for MS-Windows - if test "$with_msw" = "yes"; then - have_dl=yes; - else - 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 - XE_SHLIB_STUFF - fi - +AC_CHECK_HEADERS(dlfcn.h, [have_dlfcn=yes + AC_DEFINE(HAVE_DLFCN_H)]) +test -z "$with_shlib" && test ! -z "$have_dlfcn" && { AC_CHECK_LIB(dl, dlopen, [ AC_DEFINE(HAVE_DLOPEN) DLL_LIB=dl; with_shlib=yes]) } +test -z "$with_shlib" && test ! -z "$have_dlfcn" && { AC_CHECK_LIB(c, _dlopen, [ AC_DEFINE(HAVE_DLOPEN) DLL_LIB=; with_shlib=yes]) } +test -z "$with_shlib" && test ! -z "$have_dlfcn" && { AC_CHECK_LIB(c, dlopen, [ AC_DEFINE(HAVE_DLOPEN) DLL_LIB=; with_shlib=yes]) } +test -z "$with_shlib" && { AC_CHECK_LIB(dld, shl_load, [ AC_DEFINE(HAVE_SHL_LOAD) DLL_LIB=dld; with_shlib=yes]) } +test -z "$with_shlib" && { AC_CHECK_LIB(dld, dld_init, [ AC_DEFINE(HAVE_DLD_INIT) DLL_LIB=dld; with_shlib=yes]) } +if test "$with_shlib" = "yes"; then + XE_SHLIB_STUFF if test "$can_build_shared" = "yes"; then AC_DEFINE(HAVE_SHLIB) - XE_ADD_OBJS(sysdll.o emodules.o) + XE_ADD_OBJS(sysdll.o) + XE_ADD_OBJS(emodules.o) XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR) - test -n "$libdl" && XE_PREPEND(-l${libdl}, LIBS) + test ! -z "$DLL_LIB" && XE_PREPEND(-l${DLL_LIB}, LIBS) AC_CHECK_FUNCS(dlerror _dlerror) - with_modules=yes else - if test "$with_modules" = "yes"; then - XE_DIE("Required module support cannot be provided.") - else - AC_MSG_WARN("Module support cannot be provided.") - fi - with_modules=no + AC_MSG_WARN(disabling shared library support) + with_shlib=no fi fi @@ -4184,32 +3696,15 @@ echo "" fi -dnl ---------------------------------------------- -dnl Create some auxiliary files for developers. -dnl ---------------------------------------------- - -dnl Create a .gdbinit useful for debugging XEmacs -if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then - test "$extra_verbose" = "yes" && echo "creating src/.gdbinit" - echo "source $srcdir/src/.gdbinit" > "src/.gdbinit" -fi - -dnl Create a .dbxrc useful for debugging XEmacs -if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then - test "$extra_verbose" = "yes" && echo "creating src/.dbxrc" - echo ". $srcdir/src/.dbxrc" > "src/.dbxrc" -fi - -dnl Create a useful TAGS file -if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then - test "$extra_verbose" = "yes" && echo "creating TAGS" - echo " -$srcdir/TAGS,include" > "TAGS" +dnl Create some auxiliary files +if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then + echo "creating src/gdbinit"; echo "" + echo "source $srcdir/src/gdbinit" > src/gdbinit fi dnl Create top level .sbinit for Sun compilers if test "$__SUNPRO_C" = "yes"; then - test "$extra_verbose" = "yes" && echo "creating .sbinit" + echo "creating .sbinit"; echo "" ( echo "# For use with Sun WorkShop's Source browser." echo "# See sbquery(1) and sbinit(4) for more information" for dir in $MAKE_SUBDIR; do echo "import $dir"; done @@ -4230,8 +3725,6 @@ AC_SUBST(version) AC_SUBST(configuration) AC_SUBST(canonical) -AC_SUBST(inststaticdir) -AC_SUBST(instvardir) AC_SUBST(srcdir) AC_SUBST(bindir) AC_SUBST(datadir) @@ -4241,7 +3734,6 @@ AC_SUBST(mandir) AC_SUBST(prefix) -AC_SUBST(PREFIX_USER_DEFINED) dnl Yo, Stephen Bourne! I want to marry you! PREFIX=$prefix while true; do @@ -4253,7 +3745,6 @@ AC_SUBST(PREFIX) AC_SUBST(exec_prefix) -AC_SUBST(EXEC_PREFIX_USER_DEFINED) EXEC_PREFIX=$exec_prefix while true; do case "$EXEC_PREFIX" in @@ -4351,16 +3842,16 @@ done AC_SUBST(ETCDIR) -AC_SUBST(docdir) -AC_SUBST(DOCDIR_USER_DEFINED) -DOCDIR=$docdir +AC_SUBST(lockdir) +AC_SUBST(LOCKDIR_USER_DEFINED) +LOCKDIR=$lockdir while true; do - case "$DOCDIR" in - *\$* ) eval "DOCDIR=$DOCDIR" ;; + case "$LOCKDIR" in + *\$* ) eval "LOCKDIR=$LOCKDIR" ;; *) break ;; esac done -AC_SUBST(DOCDIR) +AC_SUBST(LOCKDIR) AC_SUBST(archlibdir) AC_SUBST(ARCHLIBDIR_USER_DEFINED) @@ -4409,10 +3900,6 @@ : ${XEMACS_CC:=$CC} AC_SUBST(XEMACS_CC) -dnl The default is yes -if test "$with_prefix" = "yes"; then - AC_DEFINE(PREFIX_USER_DEFINED) -fi dnl The default is no if test "$with_site_lisp" = "no"; then @@ -4424,7 +3911,7 @@ fi XE_SPACE(ac_configure_args, $ac_configure_args) -AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$configuration") +AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$canonical") AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "$ac_configure_args") AC_DEFINE_UNQUOTED(config_machfile, "$machfile") AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile") @@ -4452,14 +3939,14 @@ test "$with_i18n3" = "yes" && AC_DEFINE(I18N3) test "$GCC" = "yes" && AC_DEFINE(USE_GCC) test "$external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET) -test "$quick_build" = "yes" && AC_DEFINE(QUICK_BUILD) +test "$no_doc_file" = "yes" && AC_DEFINE(NO_DOC_FILE) +dnl test "$const_is_losing" = "yes" && AC_DEFINE(CONST_IS_LOSING) test "$with_purify" = "yes" && AC_DEFINE(PURIFY) test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY) test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP) test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS) test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD) test "$use_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE) -test "$pdump" = "yes" && AC_DEFINE(PDUMP) dnl ------------------------------- dnl Report on what we decided to do @@ -4476,128 +3963,63 @@ echo "$0 $quoted_arguments" ) > Installation -if test ! -z ${emacs_beta_version} ; then - if test -z "${emacs_is_beta}" ; then - xemacs_betaname=".${emacs_beta_version}" - else - xemacs_betaname="-b${emacs_beta_version}" - fi -else - xemacs_betaname="" -fi +xemacs_betaname="" +test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}" dnl Start stdout redirection to '| tee -a Installation' ( echo " XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'. -" -echo " -Compilation / Installation:" -echo " Source code location: $srcdir" -echo " Installation prefix: $prefix" + + 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 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 -echo " Operating system description file: \`$opsysfile'" -echo " Machine description file: \`$machfile'" -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" + echo " Runtime library search path: $runpath" 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." +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 " -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 " WARNING: -----------------------------------------------------------" - echo " WARNING: Compiling without XPM image support." + echo " --------------------------------------------------------------------" + echo " WARNING: Compiling without XPM 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 " WARNING: -----------------------------------------------------------" + echo " --------------------------------------------------------------------" fi if test "$with_png" = yes; then - echo " Compiling in support for PNG images." + echo " Compiling in support for PNG image handling." elif test "$window_system" != "none"; then - echo " WARNING: -----------------------------------------------------------" + echo " --------------------------------------------------------------------" echo " WARNING: Compiling without PNG image support." if test "$png_problem" != ""; then echo " Reason: $png_problem" @@ -4605,66 +4027,87 @@ 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 " WARNING: -----------------------------------------------------------" + echo " --------------------------------------------------------------------" 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_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_xface" = yes && echo " Compiling in support for X-Face message headers." - -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." +case "$with_sound" in + nas ) echo " Compiling in network sound (NAS) support." ;; + native ) echo " Compiling in native sound support." ;; + both ) echo " Compiling in both network and native sound support." ;; +esac +test "$old_nas" = yes && echo " nas library lacks error trapping, will play synchronously." + +test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley DB." 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." -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." +test "$with_database_gnudbm" = yes && echo " Compiling in support for GNU DBM." + +test "$with_umich_ldap" = yes && echo " Compiling in support for LDAP (UMich libs)." +test "$with_ns_ldap" = yes && echo " Compiling in support for LDAP (Netscape SDK)." +test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo " Compiling in support for LDAP (Generic)." + +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." 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 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_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_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_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 +test "$with_session" != no && echo " Compiling in support for proper session-management." +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'." ;; +esac +case "$with_scrollbars" in + lucid ) echo " Using Lucid scrollbars." ;; + motif ) echo " Using Motif scrollbars." ;; + athena ) echo " Using Athena scrollbars." ;; + athena3d ) echo " Using Athena-3d 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." ;; + athena3d ) echo " Using Athena-3d dialog boxes." ;; +esac +test "$with_shlib" = "yes" && echo " Compiling in DLL 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 "$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 echo " WARNING: ---------------------------------------------------------" echo " WARNING: Compiling in support for runtime error checking." echo " WARNING: XEmacs will run noticeably more slowly as a result." @@ -4693,10 +4136,12 @@ for file in $internal_makefile_list; do test "$file" = src/Makefile.in && \ file="src/Makefile.in:src/Makefile.in.in:src/depend" - XE_APPEND($file, ac_output_files) + ac_output_files="${ac_output_files+$ac_output_files }$file" done ac_output_files="$ac_output_files src/paths.h lib-src/config.values" -test "$with_modules" = "yes" && XE_APPEND(lib-src/ellcc.h, ac_output_files) +if test "$with_shlib" = "yes"; then + ac_output_files="$ac_output_files lib-src/ellcc.h" +fi AC_OUTPUT($ac_output_files, [for dir in . $MAKE_SUBDIR; do diff -r 12e008d41344 -r 697ef44129c6 configure.usage --- a/configure.usage Mon Aug 13 11:19:22 2007 +0200 +++ b/configure.usage Mon Aug 13 11:20:41 2007 +0200 @@ -9,40 +9,34 @@ 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 Accepted but ignored. ---extra-verbose Display more information, useful for debugging. +--verbose Display the results of configure tests. +--extra-verbose Display even 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. @@ -53,108 +47,64 @@ Installation options: --prefix=DIR Install files below DIR. Defaults to `/usr/local'. ---with-prefix=no Don't compile the value of --prefix into the - executable. 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. ---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) +--without-toolbars Don't compile with any toolbar support. +--without-session Compile without realized leader window which will + keep the WM_COMMAND property. Required for proper + session-management. --with-menubars=TYPE Use TYPE menubars (lucid, motif, or no). The Lucid widgets emulate Motif (mostly) but are faster. *WARNING* The Motif menubar is currently broken. --with-scrollbars=TYPE Use TYPE scrollbars - (lucid, motif, athena, or no). ---with-dialogs=TYPE Use TYPE dialog boxes (motif, athena, or no). + (lucid, motif, athena, athena3d, or no). +--with-dialogs=TYPE Use TYPE dialog boxes (motif, athena, athena3d, or no). Lucid menubars and scrollbars are the default. Motif dialog boxes will be used if Motif can be found. ---with-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. ---with-xmu=no (*) For those unfortunates whose vendors don't ship Xmu. +--without-xmu (*) For those unfortunates whose vendors don't ship Xmu. --external-widget Compile with external widget support. - - -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. +--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. -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: +TTY options: ---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. +--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. Additional features: @@ -163,9 +113,24 @@ --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=native (*) Compile with native sound support. +--with-sound=nas Compile with network sound support. +--with-sound=both Compile with native and network 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-modules Compile in experimental support for dynamically - loaded libraries (Dynamic Shared Objects). +--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 `file'. --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, @@ -187,9 +152,6 @@ 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-leaves-you, - portable dumper. Internationalization options: @@ -208,7 +170,8 @@ used in conjunction with Mule support). --with-wnn (*) Compile with support for WNN (a multi-language input method used in conjunction with Mule support). ---with-wnn6 (*) Compile with support for the commercial package WNN6. +--with-wnn6 (*) Compile with support for the comercial package WNN + version 6 --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. @@ -251,33 +214,32 @@ --with-system-malloc Force use of the system malloc, rather than GNU malloc. --with-debug-malloc Use the debugging malloc package. --with-clash-detection Use lock files to detect multiple edits of the same - file. The default is to do clash detection. + 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'. You may also specify any of the `path' variables found in Makefile.in, -including --bindir, --libdir, --docdir, --lispdir, --sitelispdir, ---datadir, --infodir, --mandir and so on. Note that we recommend -against explicitly setting any of these variables. See the INSTALL -file for a complete list plus the reasons we advise not changing them. +including --bindir, --libdir, --lispdir, --sitelispdir, --datadir, +--infodir, --mandir and so on. Note that we recommend against +explicitly setting any of these variables. See the INSTALL file for a +complete list plus the reasons we advise not changing them. If successful, configure leaves its status in config.status. If unsuccessful after disturbing the status quo, it removes config.status. The configure script also recognizes some environment variables, each -of which is equivalent to a corresponding configure flag. Configure -flags take precedence over environment variables, if both are specified. +of which is equivalent to a corresponding configure flag. A specified +configure flag always overrides the environment variable. -environment corresponding -variable configure flag ------------ -------------- -CC --compiler -CPP --cpp -CFLAGS --cflags -CPPFLAGS --cppflags -LDFLAGS --ldflags -LIBS --libs -LD_RUN_PATH --site-runtime-libraries +envvar 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 12e008d41344 -r 697ef44129c6 etc/BETA --- a/etc/BETA Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/BETA Mon Aug 13 11:20:41 2007 +0200 @@ -325,7 +325,7 @@ To bytecompile both of these files the command is: xemacs-21.0 -vanilla -batch -f batch-byte-compile \ - lisp-utils/auto-autoloads.el lisp-utils/custom-load.el + lisp-utils/auto-autoloads.el lisp-utils/custom-laod.el ** Building XEmacs and XEmacs packages from scratch =================================================== diff -r 12e008d41344 -r 697ef44129c6 etc/DISTRIB --- a/etc/DISTRIB Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/DISTRIB Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,8 @@ -*- text -*- - XEmacs availability information. Last Modified: 18-Jul-99. + XEmacs availability information. Last Modified: 17-Apr-97. -XEmacs is available via anonymous FTP from ftp.xemacs.org (207.96.122.8) +XEmacs is available via anonymous FTP from ftp.xemacs.org (128.174.252.16) in the directory /pub/xemacs/. ftp.xemacs.org is the primary distribution point, but you may find diff -r 12e008d41344 -r 697ef44129c6 etc/Emacs.ad --- a/etc/Emacs.ad Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/Emacs.ad Mon Aug 13 11:20:41 2007 +0200 @@ -191,10 +191,6 @@ *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.) @@ -264,11 +260,6 @@ : Enter()\n\ : Leave()\n -! Native Widget translations -! ======================= -Emacs*Text*translations: #override\n\ - : widget-focus-in() select-start()\n - ! XIM input method style ! ======================= diff -r 12e008d41344 -r 697ef44129c6 etc/FTP --- a/etc/FTP Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/FTP Mon Aug 13 11:20:41 2007 +0200 @@ -1,103 +1,282 @@ + -*- text -*- - XEmacs availability information. Last Modified: 1999-11-08 + XEmacs availability information. Last Modified: 9-Jul-1998. XEmacs is available via anonymous FTP from ftp.xemacs.org (207.96.122.8) in the directory /pub/xemacs/. ftp.xemacs.org is the primary distribution point, but you may find copies of it at other sites as well. Some sites to try include: - -* North America - o Canada - + ftp://ftp.crc.ca/pub/packages/editors/xemacs/ - + ftp://sunsite.ualberta.ca/pub/Mirror/xemacs/ - o United States - + ftp://uiarchive.uiuc.edu/pub/packages/xemacs/ - + ftp://metalab.unc.edu/pub/packages/editors/xemacs/ - + ftp://ftp.sunsite.utk.edu/pub/xemacs/ - -* South America - - o Brazil - + ftp://ftp.unicamp.br/pub/xemacs/ - -* Europe - - o Austria - + ftp://gd.tuwien.ac.at/editors/xemacs/ - o Denmark - + ftp://sunsite.auc.dk/pub/emacs/xemacs/ - o England - + ftp://sunsite.doc.ic.ac.uk/packages/xemacs/ - o Finland - + ftp://ftp.funet.fi/pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/ - o France - + ftp://ftp.pasteur.fr/pub/computing/xemacs/ - + ftp://ftp.cenatls.cena.dgac.fr/Emacs/xemacs/ - o Germany - + ftp://ftp.tu-darmstadt.de/pub/editors/xemacs/ - o Hungary - + ftp://ftp.kfki.hu/pub/packages/xemacs/ - o Ireland - + ftp://ftp.eunet.ie/mirrors/ftp.xemacs.org/pub/xemacs/ - o Italy - + ftp://ftp.uniroma2.it/unix/misc/dist/XEMACS/ - o Norway - + ftp://sunsite.uio.no/pub/xemacs - o Poland - + ftp://ftp.icm.edu.pl/pub/unix/editors/xemacs/ - o Russia - + ftp://ftp.srcc.msu.su/mirror/ftp.xemacs.org/ - o Sweden - + ftp://ftp.sunet.se/pub/gnu/xemacs/ - o Switzerland - + ftp://sunsite.cnlab-switch.ch/mirror/xemacs/ - -* Asia - - o Japan - + ftp://ftp.netlab.is.tsukuba.ac.jp/pub/GNU/xemacs/ - + ftp://ftp.jaist.ac.jp/pub/GNU/xemacs/ - + ftp://ring.aist.go.jp/pub/text/xemacs/ - + ftp://ring.asahi-net.or.jp/pub/text/xemacs/ - + ftp://sunsite.sut.ac.jp/pub/archives/packages/xemacs/ - + ftp://ftp.dti.ad.jp/pub/unix/editor/xemacs/ - + ftp://mirror.nucba.ac.jp/mirror/xemacs/ - o Korea - + ftp://ftp.kreonet.re.kr/pub/tools/emacs/xemacs/ - o Taiwan - + ftp://coda.nctu.edu.tw/Editors/xemacs/ - -* Africa - - o South Africa - + ftp://ftp.sun.ac.za/xemacs/ - -* Middle East - - o Saudi Arabia - + ftp://ftp.isu.net.sa/pub/mirrors/ftp.xemacs.org/ - -* Australia - - o ftp://mirror.aarnet.edu.au/pub/xemacs + ftp://ftp.jaist.ac.jp/pub/GNU/xemacs/ + ftp://ring.aist.go.jp/pub/text/xemacs/ + ftp://ring.asahi-net.or.jp/pub/text/xemacs/ + ftp://ftp.uu.net/systems/gnu/xemacs/ + ftp://ftp.sunet.se/pub/gnu/xemacs/ + ftp://ftp.cenatls.cena.dgac.fr/pub/Emacs/xemacs/ + ftp://ftp.th-darmstadt.de/pub/editors/xemacs/ + ftp://sunsite.doc.ic.ac.uk/gnu/xemacs/ + ftp://ftp.lip6.fr/pub/emacs/xemacs/ + ftp://uiarchive.cso.uiuc.edu/pub/packages/xemacs/ + ftp://ftp.technion.ac.il/pub/unsupported/gnu/xemacs/ + ftp://ftp.linux.hr/pub/xemacs/ + ftp://sunsite.cnlab-switch.ch/mirror/xemacs/ + ftp://ftp.unicamp.br/pub/xemacs/ + ftp://ftp.usyd.edu.au/pub/Xemacs/ + ftp://ftp.lab.kdd.co.jp/xemacs/ + ftp://SunSITE.sut.ac.jp/pub/archives/xemacs/ + ftp://sunsite.icm.edu.pl/pub/unix/xemacs The most up-to-date list of distribution sites can always be found on -the XEmacs WWW page, http://www.xemacs.org/. Try to pick a site that -is networkologically close to you. If you know of other mirrors of -the XEmacs archives, please send us mail and we will list them here as -well. +the XEmacs WWW page, http://www.xemacs.org/. Try to pick a site +that is networkologically close to you. If you know of other mirrors +of the XEmacs archives, please send us mail and we will list them here +as well. There are mailing lists and newsgroups specifically for discussing and reporting bugs in XEmacs; see the file MAILINGLISTS in this directory. +The FTP and ordering information in the remainder of this file applies +to the versions of GNU Emacs distributed by the Free Software Foundation, +not to XEmacs. + ----------------------------------------------------------------------- +How to get GNU Software by Internet FTP or by UUCP. Last updated 11 June 95. + +* Please send improvements to this file to gnu@prep.ai.mit.edu. + +* No Warranties + +We distribute software in the hope that it will be useful, but without +any warranty. No author or distributor of this software accepts +responsibility to anyone for the consequences of using it or for +whether it serves any particular purpose or works at all, unless he +says so in writing. + +* Updates + +If you find this file in the Emacs distribution, there is a chance it +is out of date. If you plan to FTP files from a GNU FTP host, you +might as well start by FTPing the current version of this file, which +is `/pub/gnu/GNUinfo/FTP'. + +* How to FTP + +Use the ftp program on your system (ask locally if you can't find it) +to connect to the host you are ftping from. Unless indicated +otherwise, login in as user "anonymous", with password: "your e-mail +address" and set "binary" mode (to transfer all eight bits in each +byte). + +* FTPing GNU Software + +** How to FTP GNU Emacs + +If you are on the Internet (see also "** Alternative Internet FTP +Sources" below), you can at present copy the latest distribution +version of GNU Emacs from the file /pub/gnu/emacs-M.N.tar on host +prep.ai.mit.edu (or the file /pub/gnu/emacs-M.N.tar.gz which has been +run through gzip after tar). M and N stand for version numbers; look +at a listing of the directory through ftp to see what version is +available. These files are about 11 and 4 megabytes long, +respectively. After you unpack the distribution, be sure to look at +the files README and INSTALL. + +Because of difficulties in transferring large files, sometimes a split +version of the tar file is created. This would be in a directory +named /pub/gnu/emacs-M.N.tar-split or perhaps +/pub/gnu/emacs-M.N.tar.gz-split, containing files of 100000 characters +each. There is generally no trouble in ftping files of this size. +They can be combined with cat to make a tar file or compressed tar +file. If you can't find such files on prep.ai.mit.edu, have a look at +archive.cis.ohio-state.edu. + +ALWAYS USE BINARY/IMAGE MODE TO TRANSFER THESE FILES! +Text mode does not work for tar files or compressed files. - How to get GNU Software by Internet FTP or by UUCP: +Some ftp'ers have found it necessary for successful file transfer: + - to explicitly use prep.ai.mit.edu internet address: +18.159.0.42 (as of 18 June 95) + +Files of differences from previous widely distributed GNU Emacs +versions to the present version are also available on prep.ai.mit.edu +under names of the form emacs.diff-OO.OO-NN.NN in directory /pub/gnu. +These are made with diff -rc2. Sometimes there are versions +compressed with gzip of these difference files as well; their names +have .gz appended. + +The Emacs manual in source form is included in the distribution. The +dvi file produced by TeX is not included, but a copy may be available +for ftp under the name /pub/gnu/emacs.dvi. + +The Emacs Lisp Reference Manual is in a separate file: + /pub/gnu/elisp-manual-NN.tar.gz + +** VMS FTP sites with GNU Software +You can anonymously ftp a VMS version of GNU emacs from: + - ftp.stacken.kth.se:[.GNU-VMS] - GNU Emacs and some other VMS +ports (and some VMS binaries) of GNU software + - mango.rsmas.miami.edu has a VMS version of the GCC/G++ compiler. +Contact angel@flipper.miami.edu (angel li) for details. + - addvax.llnl.gov - GNU Emacs + - VMSD.OAC.UCI.EDU - GNU Emacs + - RIGEL.EFD.LTH.SE [130.235.48.3] - GNU Emacs + - ctrsci.cc.utah.edu - GNU Emacs - The 00readme.txt file gives details + - cc.utah.edu [128.110.8.24] - misc. GNU software - user +anonymous, pass guest. The 00README.txt file gives details. + +** Other GNU Software and How To FTP It + +Other GNU software is available on prep.ai.mit.edu under directory +/pub/gnu. diff files to convert between versions (like those used for +GNU Emacs), exist for some of these programs. Some programs have misc +support files as well. Have a look on prep to see which ones. +Compressed versions of the tar or diff files are often available +(indicated by a .gz suffix and made with the `gzip' program). Some of +this software is in beta test (probably still buggy), and is being +made available for use by hackers who like to test software. + +The file /pub/gnu/DESCRIPTIONS has a list of the packages distributed +on prep.ai.mit.edu with a brief description explaining what +each one can be used for. + +More information about these programs can typically be found in the +GNU Bulletin. To receive a copy, write to gnu@prep.ai.mit.edu. + +** Scheme and How to FTP It + +The latest distribution version of C Scheme is available via anonymous FTP +from altdorf.ai.mit.edu in /archive/scheme-X.XX/ (where X.XX is some version +number). + +Read the files INSTALL and README in the top level C Scheme directory. + +** TeX and How to Obtain It + +We don't distribute TeX now, but it is free software. -The XEmacs project is separate from and not managed by the GNU -project. The latest GNU project FTP and UUCP availability information -can be found at ftp://ftp.gnu.org/gnu/GNUinfo/FTP +TeX is a document formatter that is used, among other things, by the FSF +for all its documentation. You will need it if you want to make printed +manuals. + +TeX is freely redistributable. You can get it by ftp, tape, or CD/ROM. + +*** For FTP instructions, retrieve the file +ftp.cs.umb.edu:pub/tex/unixtex.ftp. (We don't include it here because it +changes relatively frequently. Sorry.) + +*** For TeX on a single tape (4mm DAT or QIC-24), ordering information is +available from unixtex@u.washington.edu. A distribution fee in the area +of US$210.00 covers administrative costs. Tapes will be available at +least through summer of 1994. + +*** The FSF hopes soon to distribute tapes of TeX itself, after the +University of Washington distribution service goes away. + +*** A minimal TeX collection (enough to process Texinfo files, anyway) +is included on the GNU source CD/ROM. See the file ORDERS in this +directory for more information. + +** Alternative Internet FTP Sources + +Please do NOT use a site outside your country, until you have checked +all sites inside your country, and then your continent. Trans-ocean +TCP/IP links are very expensive and usually very low speed. + +The administrators of louie.udel.edu maintains copies of GNU Emacs. +The files are available via anonymous ftp under directory ~ftp/gnu. + +Emacs and other GNU programs may be available via anonymous ftp from +these US sites: ftp.kpc.com:/pub/mirror/gnu (Silicon Valley, CA) +ftp.hawaii.edu:/mirrors/gnu, f.ms.uky.edu:/pub3/gnu, +ftp.digex.net:/pub/gnu (Internet address 164.109.10.23, nightly full +mirror, ran by mcguire@digex.net), wuarchive.wustl.edu:/systems/gnu, +col.hp.com:/mirrors/gnu, ftp.cs.columbia.edu:/archives/gnu/prep, +uiarchive.cso.uiuc.edu:/pub/gnu (Internet address 128.174.5.14, +nightly full mirror, ran by ftpadmin@uiuc.edu), +jaguar.utah.edu:/gnustuff, gatekeeper.dec.com:/pub/GNU, +labrea.stanford.edu, archive.cis.ohio-state.edu, and +ftp.uu.net:/archive/systems/gnu. +And these foreign sites: ftp.cs.ubc.ca:/mirror2/gnu (Western Canada, +daily full mirror, ran by ftp-admin@cs.ubc.ca), +ftp.inf.utfsm.cl:/pub/gnu (Chile 146.83.198.3 nightly full mirror, ran +by ftp@inf.utfsm.cl), ftp.unicamp.br:/pub/gnu (Brazil manual mirror, +ran by oliva@dcc.unicamp.br), archie.au:/gnu (Australia (archie.oz or +archie.oz.au for ACSnet)), ftp.technion.ac.il:/pub/unsupported/gnu +(Israel, daily full mirror, ran by ftp-admin), ftp.sun.ac.za:/pub/gnu +(South Africa), ftp.etsimo.uniovi.es:/pub/gnu (Spain), +ftp.mcc.ac.uk:/pub/gnu (130.88.203.12 daily full mirror, ran by +root@ftp.mcc.ac.uk), unix.hensa.ac.uk:/mirrors/uunet/systems/gnu, +ftp.warwick.ac.uk (137.205.192.14 daily full mirror, ran by +unixhelp@warwick.ac.uk), ftp.informatik.tu-muenchen.de, +ftp.informatik.rwth-aachen.de, or germany.eu.net (mirror ran by +archive-admin@germany.eu.net) (Germany), isy.liu.se (Sweden), +ftp.stacken.kth.se or ftp.luth.se:/pub/unix/gnu (Sweden), +ftp.sunet.se:/pub/gnu (Sweden 130.238.127.3 daily mirror, ran by +archive@ftp.sunet.se (also mirrors the Mailing List Archives) +ftp.nl.net (Netherlands), ftp.win.tue.nl:/pub/gnu (Netherlands +131.155.70.100 daily mirror, ran by ftp@win.tue.nl), +ftp.funet.fi:/pub/gnu (Finland 128.214.6.100, ran by gnu-adm), +ftp.denet.dk (Denmark), ugle.unit.no (Norway 129.241.1.97), +ftp.eunet.ch or nic.switch.ch:/mirror/gnu (Switzerland), +irisa.irisa.fr:/pub/gnu or ftp.univ-lyon1.fr:pub/gnu (ran by +ftpmaint@ftp.univ-lyon1.fr) (France), ftp.ieunet.ie:pub/gnu (Ireland +192.111.39.1 weekly mirror, ran by archive@ieunet.ie), archive.eu.net +(Europe 192.16.202.1), cair-archive.kaist.ac.kr:/pub/gnu (Korea +143.248.11.171, ran by ftpkeeper@cair-archive.kaist.ac.kr), +ftp.nectec.or.th:/pub/mirrors/gnu (Thailand 192.150.251.32 daily +mirror, ran by ftp@nwg.nectec.or.th), +utsun.s.u-tokyo.ac.jp:/ftpsync/prep or ftp.cs.titech.ac.jp (Japan, +nemacs, the japanese port of GNU Emacs, is under ~ftp/JAPAN). + +* Getting GNU software in Great Britain + +jpo@cs.nott.ac.uk is willing to distribute those GNU sources he has +available. The smaller items are available from the info-server (send +to info-server@cs.nott.ac.uk) the larger items by negotiation. Due to +communication costs this service is only available within the UK. + +BattenIG@computer-science.birmingham.ac.uk (aka +I.G.Batten@fulcrum.bt.co.uk) is also willing to distribute those GNU +sources he has. He can also write tapes in qic-21 and qic-24 formats. + +lmjm@doc.ic.ac.uk is willing to distribute those GNU sources he has +along with comp.sources.unix, comp.sources.x, X windows et al. The +archive, on src.doc.ic.ac.uk in directory /gnu, is available via ftp +over the Internet (on 146.169.3.7), ftam over IXI, HTTP, FSP, Gopher, +ftpmail, NFS, Lanmanger over IP, telnet, and uucp. Due to +communication costs this service is only available within the UK. +Mail to info-server@doc.ic.ac.uk for details. He can also write sun +cartridge or exabyte tapes. + +UK sites with just anonymous FTP access are in the above list. + +* Getting GNU software via UUCP + +OSU is distributing via UUCP: most GNU software, MIT C Scheme, +Compress, News, RN, NNTP, Patch, some Appletalk stuff, some of the +Internet Requests For Comment (RFC) et al.. See their periodic +postings on the Usenet newsgroup comp.sources.d for informational +updates. Current details from or +<...!osu-cis!staff>. + +Information on how to uucp some GNU programs is available via +electronic mail from: uunet!hutch!barber, hqda-ai!merlin, acornrc!bob, +hao!scicom!qetzal!upba!ugn!nepa!denny, ncar!noao!asuvax!hrc!dan, +bigtex!james (aka james@bigtex.cactus.org), oli-stl!root, +src@contrib.de (Germany), toku@dit.co.jp (Japan) and info@ftp.uu.net. + +* If You Like The Software + +If you like the software developed and distributed by the Free +Software Foundation, please express your satisfaction with a donation. +Your donations will help to support the Foundation and make our future +efforts successful, including a complete development and operating +system, called GNU (Gnu's Not Un*x), which will run Un*x user +programs. For more information on GNU and the Foundation, contact us +at the above address. + +Ordering a distribution tape from the Foundation is often a good +way to bring your company or university to make a donation. diff -r 12e008d41344 -r 697ef44129c6 etc/HELLO --- a/etc/HELLO Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/HELLO Mon Aug 13 11:20:41 2007 +0200 @@ -26,7 +26,7 @@ Slovak Dobr.BN} deNr Spanish (Espa.ANqol) N!Hola! Swedish (Svenska) Hej, Goddag -Thai ($(?@0R0I0R0d070B0(B) $(?J0G8J04H$0C8:0(B, $(?J0G8J04H$2P0(B +Thai ($(?@0R0I0R0d070B0(B) $(?J0G8J04H$0C8:0(B, $(?J0G8J04H$2P0(B Tigrigna ($(3"8#r!N"^(B) $(3!Q!,!<"8(B Turkish (T.AN|rkNge) Merhaba diff -r 12e008d41344 -r 697ef44129c6 etc/MAILINGLISTS --- a/etc/MAILINGLISTS Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/MAILINGLISTS Mon Aug 13 11:20:41 2007 +0200 @@ -1,112 +1,1206 @@ - XEmacs Electronic Mailing Lists. Last Modified: 1999-11-08 - -XEmacs has its own mailing lists and newsgroup which are distinct from -the FSF GNU Emacs mailing lists and newsgroups. The mailing lists are: + XEmacs Electronic Mailing Lists. Last Modified: 1997-01-13 -xemacs@xemacs.org comp.emacs.xemacs bi-directional gateway. - - xemacs is an open list for discussion and bug reporting for - XEmacs. This mailing list is bi-directionally gatewayed with the - USENET newsgroup comp.emacs.xemacs. - -xemacs-announce@xemacs.org XEmacs Announcements. - - xemacs-announce is a read-only, low volume list for announcements - concerning the XEmacs project and new releases of the XEmacs - software. - -xemacs-beta@xemacs.org XEmacs Beta Testers. - - xemacs-beta is an open list for bug reports and general - communication about beta versions of XEmacs. +XEmacs has its own mailing list and newsgroup which are distinct from +the FSF GNU Emacs mailing lists and newsgroups. The mailing list is: -xemacs-build-reports@xemacs.org XEmacs Build Report Submissions. - - xemacs-build-reports is an open list for submission of build-reports - on beta versions of XEmacs. For information on what the - build-reports should contain, please see the `etc/BETA' file which - is included in each beta distribution. - -xemacs-cvs@xemacs.org XEmacs CVS Commit Notices. + xemacs@xemacs.org For reporting all bugs in XEmacs, including bugs + in the compilation and installation procedures. + Also for all random questions and conversation + about XEmacs. - xemacs-cvs is a read-only list for notices and information on what - has been committed to the XEmacs CVS trees, by whom, and for - what. (For more information on the XEmacs CVS Archive: - http://cvs.xemacs.org/.) - -xemacs-mule@xemacs.org XEmacs International Extensions. - - xemacs-mule is an open mailing list for discussion of International - extensions to XEmacs including Mule, XIM, I18n issues, etc, and is - not confined to developmental issues. This list is not restricted - to English, postings in all languages are welcome. - -xemacs-nt@xemacs.org XEmacs on Windows NT/98/95. +This mailing list is bidirectionally gatewayed into the USENET newsgroup +comp.emacs.xemacs. - xemacs-nt is a developer's only mailing list and is intended for - people who wish to work actively on the porting of XEmacs to - Microsoft Windows NT and Microsoft Windows 98/95. - -xemacs-patches@xemacs.org XEmacs Patch Submissions. +To be added or removed from this mailing list, send mail to +xemacs-request@xemacs.org (If it is possible for you to read the +messages via the newsgroup, we would prefer that; the fewer people there +are on the mailing list, the less trouble it is to maintain.) - xemacs-patches is an open, moderated list for submission of patches - to the XEmacs distribution and its packages. Anyone may subscribe or - submit to xemacs-patches, but all submissions are reviewed by the - list moderator before they are distributed to the list. Discussion - is not appropriate on xemacs-patches. - -xemacs-users-ja@xemacs.org XEmacs (Japanese). - - xemacs-users-ja is an open list for discussion and bug reporting for - XEmacs. Japanese is the preferred language of discussion. It is not - gated to comp.emacs.xemacs or the xemacs list. For fastest - response, bugs not specifically related to Japanese or Mule features - should be reported on xemacs (in English). - -xemacs-beta-ja@xemacs.org XEmacs Beta (Japanese). +Please do NOT send messages about problems with XEmacs to the FSF GNU +Emacs newsgroups and mailing lists (listed below) unless you are sure +that the problem you are reporting is a problem with both versions of +GNU Emacs. People who aren't subscribed to the XEmacs mailing list most +likely are not interested in hearing about problems with it. - xemacs-beta-ja is an open list for bug reports and general - communication about beta versions of XEmacs, especially features - related to Mule and Japanese-handling. Japanese is the preferred - language of discussion. Bugs not specifically related to Japanese or - Mule features should be reported on xemacs-beta (in English). Please - consider sending bug reports on Mule to xemacs-mule, in English. +The XEmacs mailing list is archived at ftp://ftp.xemacs.org/pub/xemacs/mlists/. -The most up to date information on the mailing lists can always be -found at http://www.xemacs.org/. - -Subscriptions: +See the file etc/BETA for more information about mailing lists for use +by beta testers and XEmacs developers. -Subscription to all the lists is accomplished by sending an e-mail -message to LISTNAME-request@xemacs.org with `subscribe' (without the -quotes) as the BODY of the message. - -To unsubscribe, send an e-mail to LISTNAME-request@xemacs.org with -`unsubscribe' (without the quotes) as the BODY of the message. - -List Archives: +IMPORTANT IMPORTANT IMPORTANT: -A browsable and searchable archive of these lists is available at -http://www.xemacs.org/list-archives/. - -Problems: - -Any comments, questions, or complaints about the lists should be -brought to the attention of the XEmacs Mailing List Manager -. +Aside from the names of the mailing lists and newsgroups corresponding +to this version of Emacs, the guidelines enumerated below still apply. +Please read them before sending a message. ----------------------------------------------------------------------- + GNU Project Electronic Mailing Lists and gnUSENET Newsgroups + Last Updated 1 July 97 - GNU Project Electronic Mailing Lists and gnUSENET Newsgroups: + Please report improvements to: gnu@prep.ai.mit.edu + +* GNU mailing lists are also distributed as USENET news groups + +The mailing lists are gated both ways with the gnu.all newsgroups at +ohio-state.edu. The one-to-one correspondence is indicated below. If +you don't know if your site is on USENET, ask your system administrator. +If you are a USENET site and don't get the gnu.all newsgroups, please +ask your USENET administrator to get them. If he has your feeds ask +their feeds, you should win. And everyone else wins: newsgroups make +better use of the limited bandwidth of the computer networks and your +home machine than mailing list traffic; and staying off the mailing +lists make better use of the people who maintain the lists and the +machines that the GNU people working with rms use (i.e. we have more +time to produce code!!). Thanx. + +* Getting the mailing lists directly + +If several users at your site or local network want to read a list and +you aren't a USENET site, Project GNU would prefer that you would set up +one address that redistributes locally. This reduces overhead on our +people and machines, your gateway machine, and the network(s) used to +transport the mail from us to you. + +* How to subscribe to and report bugs in mailing lists + +Send messages ABOUT these lists, such as reports of mail problems, or +requests to be added or removed, to help-gnu-emacs-request (or +info-gnu-request, bug-gdb-request, etc.), NOT to info-gnu-emacs (or +info-gnu, etc.). These -request addresses go only to the +people who can do something about your requests or problems, and thus +avoids disturbing everyone else. + +Note that all GNU mailing lists are maintained by volunteers. They get +behind occasionally. Wait at least 3 or 4 days before asking again. +Thanks! + +Many of the GNU mailing lists are very large and are received by many +people. Please don't send them anything that is not seriously important +to all their readers. All GNU mailing lists are unmoderated, mail +reflectors, except info-gnu, info-gnu-emacs, info-gcc, info-g++, +info-gnu-fortran. + +All addresses below are in internet format. Consult the mail guru for +your computer to figure out address syntaxes from other networks. From +UUCP machines: + ..!ucbvax!prep.ai.mit.edu!ADDRESS + ..!uunet!prep.ai.mit.edu!ADDRESS + +If a message you mail to a list is returned from a MAILER-DAEMON (often +with the line: + ----- Transcript of session follows ----- + don't resend the message to the list. All this return means is that +your original message failed to reach a few addresses on the list. Such +messages are NEVER a reason to resend a piece of mail a 2nd time. This +just bothers all (less the few delivery failures (which will probably +just fail again!)) of the readers of the list with a message they have +already seen. It also wastes computer and network resources. + +It is appropriate to send these to the -request address for a list, and +ask them to check the problem out. + +* Send Specific Requests for Information to: gnu@prep.ai.mit.edu + +Specific requests for information about obtaining GNU software, or GNU +activities in Cambridge and elsewhere can be directed to: + gnu@prep.ai.mit.edu + +* General Information about all lists + +Please keep each message under 25,000 characters. Some mailers bounce +messages that are longer than this. If your message is long, it is +generally better to send a message offering to make the large file +available to only those people who want it (e.g. mailing it to people +who ask, or putting it up for FTP). In the case of gnu.emacs.sources, +somewhat larger postings (up to 10 parts of no more than 25,000 +characters each) are acceptable (assuming they are likely to be of +interest to a reasonable number of people); if it is larger than that +have it added to archive.cis.ohio-state.edu (the GNU Emacs Lisp ftp and +uucp archive on and announce) its location there. Good bug reports are +short. See section '* General Information about bug-* lists and ...' +for further details. + +Most of the time, when you reply to a message sent to a list, the reply +should not go to the list. But most mail reading programs supply, by +default, all the recipients of the original as recipients of the reply. +Make a point of deleting the list address from the header when it does +not belong. This prevents bothering all readers of a list, and reduces +network congestion. + +The GNU mailing lists and newsgroups, like the GNU project itself, exist +to promote the freedom to share software. So don't use these lists to +promote or recommend non-free software. (Using them to post ordering +information is the ultimate faux pas.) If there is no free program to +do a certain task, then somebody should write one! + +* General Information about info-* lists + +These lists and their newsgroups are meant for important announcements. +Since the GNU project uses software development as a means for social +change, the announcements may be technical or political. + +Most GNU projects info-* lists (and their corresponding gnu.*.announce +newsgroups) are moderated to keep their content significant and +relevant. If you have a bug to report, send it to the bug-* list. If +you need help on something else and the help-* list exists, ask it. + +See section '* General Information about all lists'. + +* General Information about help-* lists + +These lists (and their newsgroups) exist for anyone to ask questions +about the GNU software that the list deals with. The lists are read by +people who are willing to take the time to help other users. + +When you answer the questions that people ask on the help-* lists, keep +in mind that you shouldn't answer by promoting a proprietary program as +a solution. The only real solutions are the ones all the readers can +share. + +If a program crashes, or if you build it following the standard +procedure on a system on which it is supposed to work and it does not +work at all, or if an command does not behave as it is documented to +behave, this is a bug. Don't send bug reports to a help-* list; mail +them to the bug-* list instead. + +See section '* General Information about all lists'. + +* General Information about bug-* lists and reporting program bugs + +If you think something is a bug in a program, it might be one; or, it +might be a misunderstanding or even a feature. Before beginning to +report bugs, please read the section ``Reporting Emacs Bugs'' toward the +end of the GNU Emacs reference manual (or node Emacs/Bugs in Emacs's +built-in Info system) for a discussion of how and when to send in bug +reports. For GNU programs other than GNU Emacs, also consult their +documentation for their bug reporting procedures. Always include the +version number of the GNU program, as well as the operating system and +machine the program was ran on (if the program doesn't have a version +number, send the date of the latest entry in the file ChangeLog). For +GNU Emacs bugs, type "M-x emacs-version". A debugger backtrace of any +core dump, can also be useful. Be careful to separate out hypothesis +from fact! For bugs in GNU Emacs lisp, set variable debug-on-error to +t, and re-enter the command(s) that cause the error message; Emacs will +pop up a debug buffer if something is wrong; please include a copy of +the buffer in your bug report. Please also try to make your bug report +as short as possible; distill the problem to as few lines of code and/or +input as possible. GNU maintainers give priority to the shortest, high +quality bug reports. + +Please don't send in a patch without a test case to illustrate the +problem the patch is supposed to fix. Sometimes the patches aren't +correct or aren't the best way to do the job, and without a test case +there is no way to debug an alternate fix. + +The purpose of reporting a bug is to enable the bug to be fixed for the +sake of the whole community of users. You may or may not receive a +response; the maintainers will send one if that helps them find or +verify a fix. Most GNU maintainers are volunteers and all are +overworked; they don't have time to help individuals and still fix the +bugs and make the improvements that everyone wants. If you want help +for yourself in particular, you may have to hire someone. The GNU +project maintains a list of people providing such services. It is +distributed with GNU Emacs in file etc/SERVICE, and can be requested +from gnu@prep.ai.mit.edu. + +Anything addressed to the implementors and maintainers of a GNU program +via a bug-* list, should NOT be sent to the corresponding info-* or +help-* list. + +Please DON'T post your bug reports on the gnu.*.bug newsgroups! Mail +them to bug-*@prep instead! At first sight, it seems to make no +difference: anything sent to one will be propagated to the other; but: + - if you post on the newsgroup, the information about how to +reach you is lost in the message that goes on the mailing list. It +can be very important to know how to reach you, if there is anything +in the bug report that we don't understand; + - bug reports reach the GNU maintainers quickest when they are +sent to the bug-* mailing list submittal address; + - mail is much more reliable then netnews; and + - if the internet mailers can't get your bug report delivered, +they almost always send you an error message, so you can find another +way to get the bug report in. When netnews fails to get your message +delivered to the maintainers, you'll never know about it and the +maintainers will never see the bug report. + +And please DON'T post your GNU bug reports to comp.* or other gnu.* +newsgroups, they never make it to the GNU maintainers at all. Please +mail them to bug-*@prep instead! + +See section '* General Information about all lists'. + +* info-gnu-request@prep.ai.mit.edu to subscribe to info-gnu +** gnUSENET newsgroup: gnu.announce +** Send announcements to: info-gnu@prep.ai.mit.edu + +This list distributes progress reports on the GNU Project. It is also +used by the GNU Project to ask people for various kinds of help. It is +NOT for general discussion. + +The list is filtered to remove items meant for info-gnu-request, that +can be answered by the moderator without bothering the list, or should +have been sent to another list. + +See section '* General Information about info-* lists'. + +* gnu-misc-discuss-request@prep.ai.mit.edu to subscribe to gnu-misc-discuss +** gnUSENET newsgroup: gnu.misc.discuss +** Send contributions to: gnu-misc-discuss@prep.ai.mit.edu + +This list is for serious discussion of freed software, the GNU Project, +the GNU Manifesto, and their implications. It's THE place for +discussion that is not appropriate in the other GNU mailing lists and +gnUSENET newsgroups. + +Flaming is out of place. Tit-for-tat is not welcome. Repetition +should not occur. + +Good READING and writing are expected. Before posting, wait a while, +cool off, and think. + +Don't use this group for complaints and bug reports about GNU software! +The maintainers don't read this group; they won't see your complaint. +Use the appropriate bug-reporting mailing list instead, so that people +who can do something about the problem will see it. + +Don't trust pronouncements made on gnu-misc-discuss about what GNU is, +what FSF position is, what the GNU General Public License is, etc., +unless they are made by someone you know is well connected with GNU and +are sure the message is not forged. + +USENET and gnUSENET readers are expected to have read ALL the articles +in news.announce.newusers before posting. If news.announce.newusers is +empty at your site, wait (the articles are posted monthly), your posting +isn't that urgent! Readers on the Internet can anonymous FTP these +articles from host ftp.uu.net under directory ?? + +Someone from the Free Software Foundation will attempt to follow this +group as time and volume permits. + +Remember, "GNUs Not Unix" and "gnUSENET is Not USENET". We have +higher standards! + +Note that sending technical questions about specific GNU software to +gnu-misc-discuss is likely to be less useful than sending them to the +appropriate mailing list or gnUSENET newsgroup, since more technical +people read those. + +* bug-gnu-sql-request@prep.ai.mit.edu to subscribe to bug-gnu-sql +** gnUSENET newsgroup: NONE PLANNED +** GNU-SQL BUG reports to: bug-gnu-sql@prep.ai.mit.edu + +This list distributes, to the active maintainers of GNU's SQL (GNU's SQL +full scale database server), bug reports and fixes for, and suggestions +for improvements to GNU's SQL. User discussion of GNU's SQL also occurs +here. + +There are no other GNU mailing lists or gnUSENET newsgroups for GNU's SQL. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-guile-request@prep.ai.mit.edu to subscribe to bug-guile +** gnUSENET newsgroup: NONE PLANNED +** GUILE BUG reports to: bug-guile@prep.ai.mit.edu + +This list distributes, to the active maintainers of GUILE (GNU's +Ubiquitous Extension Language), bug reports and fixes for, and suggestions for +improvements to GUILE. User discussion of GUILE also occurs here. + +There are no other GNU mailing lists or gnUSENET newsgroups for GUILE . + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* guile-sources-request@prep.ai.mit.edu to subscribe to guile-sources +** gnUSENET newsgroup: NONE PLANNED +** Guile source code to: guile-sources@prep.ai.mit.edu + +This list will be for the posting, by their authors, of GUILE, Scheme, +and C sources and patches that improve Guile. Its contents will be +reviewed by the FSF for inclusion in future releases of GUILE. + +Please do NOT discuss or request source code here. Use bug-guile for +those purposes. This allows the automatic archiving of sources posted +to this list. -The XEmacs project is separate from and not managed by the GNU -project. The latest information about the GNU project mailing lists -can be found at ftp://ftp.gnu.org/gnu/GNUinfo/MAILINGLISTS +Please do NOT post such sources to any other GNU mailing list (e.g +bug-guile) or gnUSENET newsgroups. It's up to each poster to decide +whether to cross-post to any non-gnUSENET newsgroup. + +Please do NOT announce that you have posted source code to guile.sources +to any other GNU mailing list (e.g. bug-guile) or gnUSENET newsgroups. +People who want to keep up with sources will read this list. It's up to +each poster to decide whether to announce a guile.sources article in any +non-gnUSENET newsgroup (e.g. comp.emacs or comp.sources.d). + +If source or patches that were previously posted or a simple fix is +requested in bug-guile, please mail it to the requester. Do NOT +repost it. If you also want something that is requested, send mail to +the requester asking him to forward it to you. This kind of traffic is +best handled by e-mail, not by a broadcast medium that reaches millions +of sites. + +If the requested source is very long (>10k bytes) send mail offering to +send it. This prevents the requester from getting many redundant copies +and saves network bandwidth. + +* bug-gnustep-request@prep.ai.mit.edu to subscribe to bug-gnustep +** gnUSENET newsgroup: gnu.gnustep.bug +** Gnustep bug reports to: bug-gnustep@prep.ai.mit.edu +** FAQ-URL: none known +** FAQ-Archive-name: none known +** FAQ-Posting-frequency: none known + +This list distributes bug reports for, fixes for bugs in, and +suggestions for improvements in GNUstep to its active developers. + +Subscribers to bug-gnustep get all info-gnustep messages. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-gnustep-request@prep.ai.mit.edu to subscribe to help-gnustep +** gnUSENET newsgroup: gnu.gnustep.help +** Send contributions to: help-gnustep@prep.ai.mit.edu +** FAQ-URL: none known +** FAQ-Archive-name: none known +** FAQ-Posting-frequency: none known + +This list is the place for users and installers of the GNUstep to ask +for help. Please send bug reports to bug-gnustep@prep.ai.mit.edu +instead of posting them here. + +See section '* General Information about help-* lists'. + +* discuss-gnustep-request@prep.ai.mit.edu to subscribe to discuss-gnustep +** gnUSENET newsgroup: gnu.gnustep.discuss +** Send contributions to: discuss-gnustep@prep.ai.mit.edu +** FAQ-URL: none known +** FAQ-Archive-name: none known +** FAQ-Posting-frequency: none known + +This list is the place for GNUstep users and developers to discuss +GNUstep. Please send bug reports to bug-gnustep@prep.ai.mit.edu +instead of posting them here. + +See section '* General Information about discuss-* lists'. + +* info-gnustep-request@prep.ai.mit.edu to subscribe to info-gnustep +** gnUSENET newsgroup: gnu.gnustep.announce +** Send announcements to: info-gnustep@prep.ai.mit.edu +** FAQ-URL: none known +** FAQ-Archive-name: none known +** FAQ-Posting-frequency: none known + +This list distributes announcements and progress reports on GNUstep. +It is NOT for general discussion; please use discuss-gnustep for that. + +The list is filtered to remove items meant for info-gnustep-request, that +can be answered by the moderator without bothering the list, or should +have been sent to another list. + +Do not report GNUstep bugs to info-gnustep, help-gnustep, or +discuss-gnustep, mail them to bug-gnustep@prep.ai.mit.edu instead. + +See section '* General Information about info-* lists'. + +* bug-hurd-request@prep.ai.mit.edu to subscribe to bug-hurd +** gnUSENET newsgroup: gnu.hurd.bug +** Hurd bug reports to: bug-hurd@prep.ai.mit.edu + +This list distributes bug reports for, fixes for bugs in, and +suggestions for improvements in the GNU Hurd to its active developers. + +No info-gnu-hurd list is planned. Announcements about the GNU Hurd will +be made to the list info-gnu@prep.ai.mit.edu (see above). + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-hurd-request@prep.ai.mit.edu to subscribe to help-hurd +** gnUSENET newsgroup: gnu.hurd.help +** Send contributions to: help-hurd@prep.ai.mit.edu + +This list is the place for users and installers of the GNU Hurd to ask +for help. + +No info-gnu-hurd list is planned. Announcements about the GNU Hurd will +be made to the list info-gnu@prep.ai.mit.edu (see above). + +See section '* General Information about help-* lists'. + +* hurd-ann-request@prep.ai.mit.edu IS NOW DEFUNCT +** gnUSENET newsgroup: NEVER EXISTED +** DEAD address: hurd-ann@prep.ai.mit.edu + +This list is dead. Announcements about the GNU Hurd will be made to the +list info-gnu@prep.ai.mit.edu (see above). + +* bug-gnu-emacs-request@prep.ai.mit.edu to subscribe to bug-gnu-emacs +** gnUSENET newsgroup: gnu.emacs.bug +** Gnu Emacs bug reports to: bug-gnu-emacs@prep.ai.mit.edu + +This list distributes, to the active maintainers of GNU Emacs, bug +reports and fixes for, and suggestions for improvements in GNU Emacs. + +Send bugs in the GNU Emacs Lisp reference manual to: + lisp-manual-bugs@prep.ai.mit.edu + +lisp-manual-bugs is neither a mailing list nor a gnUSENET newsgroup. +It's just a bug-reporting address. + +Subscribers to bug-gnu-emacs get all info-gnu-emacs messages. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* gnu-emacs-sources-request@prep.ai.mit.edu to subscribe to gnu-emacs-sources +** gnUSENET newsgroup: gnu.emacs.sources +** Gnu Emacs source code to: gnu-emacs-sources@prep.ai.mit.edu + +This list/newsgroup will be for the posting, by their authors, of Emacs +Lisp and C sources and patches that improve GNU Emacs. Its contents +will be reviewed by the FSF for inclusion in future releases of GNU +Emacs. + +Please do NOT discuss or request source code here. Use +help-gnu-emacs/gnu.emacs.help for those purposes. This allows the +automatic archiving of sources posted to this list/newsgroup. + +Please do NOT post such sources to any other GNU mailing list (e.g +help-gnu-emacs) or gnUSENET newsgroups (e.g. gnu.emacs.help). It's up +to each poster to decide whether to cross-post to any non-gnUSENET +newsgroup (e.g. comp.emacs or vmsnet.sources). + +Please do NOT announce that you have posted source code to +gnu.emacs.sources to any other GNU mailing list (e.g. help-gnu-emacs) or +gnUSENET newsgroups (e.g. gnu.emacs.help). People who want to keep up +with sources will read this list/newsgroup. It's up to each poster to +decide whether to announce a gnu.emacs.sources article in any +non-gnUSENET newsgroup (e.g. comp.emacs or comp.sources.d). + +If source or patches that were previously posted or a simple fix is +requested in help-gnu-emacs, please mail it to the requester. Do NOT +repost it. If you also want something that is requested, send mail to +the requester asking him to forward it to you. This kind of traffic is +best handled by e-mail, not by a broadcast medium that reaches millions +of sites. + +If the requested source is very long (>10k bytes) send mail offering to +send it. This prevents the requester from getting many redundant copies +and saves network bandwidth. + +* help-gnu-emacs-request@prep.ai.mit.edu to subscribe to help-gnu-emacs +** gnUSENET newsgroup: gnu.emacs.help (and one-way into comp.emacs) +** Send contributions to: help-gnu-emacs@prep.ai.mit.edu + +This list is the place for users and installers of GNU Emacs to ask for +help. Please send bug reports to bug-gnu-emacs instead of posting them +here. + +Since help-gnu-emacs is a very large list, send it only those items that +are seriously important to many people. + +If source or patches that were previously posted or a simple fix is +requested in help-gnu-emacs, please mail it to the requester. Do NOT +repost it. If you also want something that is requested, send mail to +the requester asking him to forward it to you. This kind of traffic is +best handled by e-mail, not a broadcast medium that reaches millions of +sites. + +This list is also gated one way to USENET's newsgroup comp.emacs (once +known as net.emacs). This one-way gating is done for users whose sites +get comp.emacs, but not gnu.emacs.help. Users at non-USENET sites may +receive all articles from comp.emacs by making their request to: +unix-emacs-request@bbn.com + +If Emacs crashes, or if you build Emacs following the standard procedure +on a system which Emacs is supposed to work on (see etc/MACHINES) and it +does not work at all, or if an editing command does not behave as it is +documented to behave, this is a bug. Don't send bug reports to +help-gnu-emacs (gnu.emacs.help) or post them to comp.emacs; mail them to +bug-gnu-emacs@prep.ai.mit.edu instead. + +See section '* General Information about help-* lists'. + +* info-gnu-emacs-request@prep.ai.mit.edu to subscribe to info-gnu-emacs +** gnUSENET newsgroup: gnu.emacs.announce (and one-way into comp.emacs) +** Send announcements to: info-gnu-emacs@prep.ai.mit.edu + +This list distributes announcements and progress reports on GNU Emacs. +It is NOT for general discussion; please use help-gnu-emacs for that. + +The list is filtered to remove items meant for info-gnu-emacs-request, +that can be answered by the moderator without bothering the list, or +should have been sent to another list. + +info-gnu-emacs is also gated one way to USENET's newsgroup comp.emacs +(once known as net.emacs). This one-way gating is done for users whose +sites get comp.emacs, but not gnu.emacs.announce. Users at non-USENET +sites may receive all articles from comp.emacs by making their request +to: unix-emacs-request@bbn.com + +Do not report GNU Emacs bugs to info-gnu-emacs or comp.emacs, instead +mail them to bug-gnu-emacs@prep.ai.mit.edu. + +See section '* General Information about info-* lists'. + +* vms-gnu-emacs-request@prep.ai.mit.edu to subscribe +** gnUSENET newsgroup: gnu.emacs.vms +** Send contributions to: vms-gnu-emacs@prep.ai.mit.edu + +This list was a working group who did the initial port of GNU Emacs to +the VMS operating system. It still discusses problems and solutions to +the VMS port and the distribution of it. + +* bug-bash-request@prep.ai.mit.edu to subscribe to bug-bash +** gnUSENET newsgroup: gnu.bash.bug +** BASH bug reports to: bug-bash@prep.ai.mit.edu + +This list distributes, to the active maintainers of BASH (the Bourne +Again SHell), bug reports and fixes for, and suggestions for +improvements in BASH. User discussion of BASH also occurs here. + +Always report the version number of the operating system, hardware, and +bash (flag -version on startup or check the variable $BASH_VERSION in a +running bash). + +There are no other GNU mailing lists or gnUSENET newsgroups for BASH. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-gdb-request@prep.ai.mit.edu to subscribe to bug-gdb +** gnUSENET newsgroup: gnu.gdb.bug +** GDB bug reports to: bug-gdb@prep.ai.mit.edu + +This list distributes, to the active maintainers of GDB (Gnu's +DeBugger), bug reports and fixes for, and suggestions for improvements +in GDB. + +There are no other GNU mailing lists or gnUSENET newsgroups for GDB. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-octave-request@che.utexas.edu to subscribe to bug-octave +** gnUSENET newsgroup: NONE PLANNED +** Octave bug reports to: bug-octave@che.utexas.edu + +This list distributes, to the active maintainers of Octave (a system +for numerical computations), bug reports and fixes for, and +suggestions for improvements to Octave. + +The help-octave mailing list is for user discussion of Octave. + +See section '* General Information about bug-* lists and reporting +program bugs'. + + +* help-octave-request@che.utexas.edu to subscribe to help-octave +** gnUSENET newsgroup: NONE PLANNED +** Send contributions to: help-octave@che.utexas.edu + +This list is the place for users and installers of Octave to ask for +help. Please send bug reports to bug-octave instead of posting them +here. + +If Octave crashes, or if you build Octave following the standard +procedure on a system on which Octave is supposed to work on and it +does not work at all, or if a command does not behave as it is +documented to behave, this is a bug. Don't send bug reports to +help-octave; mail them to bug-octave@che.utexas.edu instead. + +See section '* General Information about help-* lists'. + +* bug-gcc-request@prep.ai.mit.edu to subscribe to bug-gcc +** gnUSENET newsgroup: gnu.gcc.bug +** GCC bug reports to: bug-gcc@prep.ai.mit.edu -Please do NOT send messages about problems with XEmacs to the FSF GNU -Emacs newsgroups and mailing lists unless you are sure that the -problem you are reporting is a problem with both versions of GNU -Emacs. People who aren't subscribed to the XEmacs mailing list most -likely are not interested in hearing about problems with it. +This list distributes bug reports for, fixes for bugs in, and +suggestions for improvements in the GNU C Compiler to its active +developers. + +Please don't send in a patch without a test case to illustrate the +problem the patch is supposed to fix. Sometimes the patches aren't +correct or aren't the best way to do the job, and without a test case +there is no way to debug an alternate fix. + +The most convenient form of test case is a piece of cpp output that can +be passed directly to cc1. Preferably written in C, not C++ or +Objective C. + +Subscribers to bug-gcc get all info-gcc messages. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-gcc-request@prep.ai.mit.edu to subscribe to help-gcc +** gnUSENET newsgroup: gnu.gcc.help +** Send contributions to: help-gcc@prep.ai.mit.edu + +This list is the place for users and installers of the GNU C Compiler to +ask for help. + +If gcc crashes, or if you build gcc following the standard procedure on +a system which gcc is supposed to work on (see config.sub) and it does +not work at all, or if an command line option does not behave as it is +documented to behave, this is a bug. Don't send bug reports to help-gcc +(gnu.gcc.help); mail them to bug-gcc@prep.ai.mit.edu instead. + +See section '* General Information about help-* lists'. + +* info-gcc-request@prep.ai.mit.edu to subscribe to info-gcc +** gnUSENET newsgroup: gnu.gcc.announce +** Send announcements to: info-gcc@prep.ai.mit.edu + +This list distributes announcements and progress reports on the GNU C +Compiler. It is NOT for general discussion; please use help-gcc for +that. + +The list is filtered to remove items meant for info-gcc-request, that +can be answered by the moderator without bothering the list, or should +have been sent to another list. + +See section '* General Information about info-* lists'. + +* bug-gnu960-request@ichips.intel.com to subscribe to bug-gnu960 +** gnUSENET newsgroup: NONE PLANNED +** Intel 960 Port bug reports to: bug-gnu960@ichips.intel.com + +This list distributes bug reports for, fixes for bugs in, and +suggestions for improvements in Intel's port of GNU software to the +Intel 960 microprocessor. + +You can also fax to: GNU/960 - 1-503-696-4930. + +There are no other GNU mailing lists or gnUSENET newsgroups for Intel's +port of GNU software to the Intel 960 microprocessor. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-glibc-request@prep.ai.mit.edu to subscribe to bug-glibc +** gnUSENET newsgroup: gnu.glibc.bug +** GNU C Library bug reports to: bug-glibc@prep.ai.mit.edu + +This list distributes, to the active maintainers of glibc (GNU's C +library), bug reports and fixes for, and suggestions for improvements in +glibc. User discussion of glibc also occurs here. + +Announcements of new releases of glibc are made on both info-gcc and +bug-glibc. + +There are no other GNU mailing lists or gnUSENET newsgroups for the GNU +C Library. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-g++-request@prep.ai.mit.edu to subscribe to bug-g++ +** gnUSENET newsgroup: gnu.g++.bug +** G++ bug reports to: bug-g++@prep.ai.mit.edu + +This list distributes bug reports for, fixes for bugs in, and +suggestions for improvements in the GNU C++ Compiler to its active +developers. + +G++ uses the GNU C-Compiler back end. Active developers may wish to +subscribe to bug-gcc@prep.ai.mit.edu as well. + +Subscribers to bug-g++ get all info-g++ messages. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-g++-request@prep.ai.mit.edu to subscribe to help-g++ +** gnUSENET newsgroup: gnu.g++.help (and one-way into comp.lang.c++) +** Send contributions to: help-g++@prep.ai.mit.edu + +This list is the place for users and installers of the GNU C++ Compiler +to ask for help. Please send bug reports to bug-g++@prep.ai.mit.edu +instead of posting them here. + +help-g++ is also gated one way to USENET's newsgroup comp.lang.c++. +This one-way gating is done for users whose sites get comp.lang.c++, but +not gnu.g++.help. + +See section '* General Information about help-* lists'. + +* info-g++-request@prep.ai.mit.edu to subscribe to info-g++ +** gnUSENET newsgroup: gnu.g++.announce (and one-way into comp.lang.c++) +** Send announcements to: info-g++@prep.ai.mit.edu + +This list distributes announcements and progress reports on the GNU C++ +Compiler. It is NOT for general discussion; please use help-g++ for +that. + +The list is filtered to remove items meant for info-g++-request, that +can be answered by the moderator without bothering the list, or should +have been sent to another list. + +It is also gated one way to USENET's newsgroup comp.lang.c++. This +one-way gating is done for users whose sites get comp.lang.c++, but not +gnu.g++.announce. + +Do not report g++ bugs to info-g++ or comp.lang.c++, mail them to +bug-g++@prep.ai.mit.edu instead. + +See section '* General Information about info-* lists'. + +* bug-lib-g++-request@prep.ai.mit.edu to subscribe to bug-lib-g++ +** gnUSENET newsgroup: gnu.g++.lib.bug +** lib-g++ bug reports to: bug-lib-g++@prep.ai.mit.edu + +This list distributes, to the active maintainers of libg++ (GNU's +library for C++), bug reports and fixes for, and suggestions for +improvements in lib-g++. User discussion of libg++ also occurs here. + +Announcements of new releases of libg++ are made on both info-g++ and +bug-lib-g++. + +There are no other GNU mailing lists or gnUSENET newsgroups for GNU's +G++ Library. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* info-gnu-fortran-request@prep.ai.mit.edu to subscribe to info-gnu-fortran +** gnUSENET newsgroup: NONE YET +** Send announcements to: info-gnu-fortran@prep.ai.mit.edu + +This list is for progress reports about the GNU Fortran compiler. In +the future it will also be used for release notices. + +The list is filtered to remove items meant for info-gnu-fortran-request, +that can be answered by the moderator without bothering the list, or +should have been sent to another list. + +People on the Internet can get a current status report by fingering the +address fortran@gnu.ai.mit.edu. + +See section '* General Information about info-* lists'. + +There are no other GNU mailing lists or gnUSENET newsgroups for GNU +Fortran (yet). + +* bug-oleo-request@prep.ai.mit.edu to subscribe to bug-oleo +** gnUSENET newsgroup: NONE PLANNED +** Oleo bug reports to: bug-oleo@prep.ai.mit.edu + +This list distributes, to the active maintainers of Oleo (the GNU +spreadsheet), bug reports and fixes for, and suggestions for +improvements to Oleo. User discussion of Oleo also occurs here. + +There are no other GNU mailing lists or gnUSENET newsgroups for Oleo . + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-gmp-request@prep.ai.mit.edu to subscribe to bug-gmp +** gnUSENET newsgroup: NONE PLANNED +** gmp bug reports to: bug-gmp@prep.ai.mit.edu + +This list distributes, to the active maintainers of gmp (the GNU +Multiple Precision Library), bug reports and fixes for, and suggestions +for improvements to gmp. User discussion of gmp also occurs here. + +There are no other GNU mailing lists or gnUSENET newsgroups for gmp . + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-pine-request@prep.ai.mit.edu to subscribe to bug-pine +** gnUSENET newsgroup: NONE PLANNED +** pine bug reports to: bug-pine@prep.ai.mit.edu + +This list distributes, to the active maintainers of pine (the GNU +version of the pine mail reader), bug reports and fixes for, and suggestions +for improvements to pine. User discussion of pine also occurs here. + +There are no other GNU mailing lists or gnUSENET newsgroups for pine . + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-cfengine-request@prep.ai.mit.edu to subscribe to bug-cfengine +** gnUSENET newsgroup: gnu.cfengine.bug +** cfengine bug reports to: bug-cfengine@prep.ai.mit.edu + +This list distributes, to the active maintainers of cfengine (configure +BSD and System-5-like operating systems attached to a TCP/IP network), +bug reports and fixes for, and suggestions for improvements to cfengine. +User discussion of cfengine also occurs here. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-cfengine-request@prep.ai.mit.edu to subscribe to help-cfengine +** gnUSENET newsgroup: gnu.cfengine.help +** Send contributions to: help-cfengine@prep.ai.mit.edu + +This list is the place for users and installers of cfengine to ask for +help. Please send bug reports to bug-cfengine instead of posting them +here. + +This list is also used for announcements about cfengine and related +programs, and small but important patches. Announcements of cfengine +releases are also made to info-gnu@prep.ai.mit.edu (see above) + +Since help-cfengine is a large list, send it only those items that +are seriously important to many people. + +If source or patches that were previously posted or a simple fix is +requested in help-cfengine, please mail it to the requester. Do NOT +repost it. If you also want something that is requested, send mail to +the requester asking him to forward it to you. This kind of traffic is +best handled by e-mail, not a broadcast medium that reaches millions of +sites. + +See section '* General Information about help-* lists'. +Also see section '* General Information about info-* lists'. + +* bug-gnu-smalltalk-request@prep.ai.mit.edu to subscribe to bug-gnu-smalltalk +** gnUSENET newsgroup: gnu.smalltalk.bug +** GNU Smalltalk bug reports to: bug-gnu-smalltalk@prep.ai.mit.edu + +GNU Smalltalk is the GNU project implementation of the Smalltalk language. + +This list distributes, to the active maintainers of GNU Smalltalk, bug +reports and fixes for, and suggestions for improvements to GNU +Smalltalk. User discussion of GNU Smalltalk also occurs here. + +For now, new releases of GNU Smalltalk will also be announced on this list. + +There are no other GNU mailing lists or gnUSENET newsgroups for GNU +Smalltalk. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* st-next-request@laplace.eng.sun.com to subscribe to st-next +** gnUSENET newsgroup: NONE PLANNED +** Send contributions to: st-next@laplace.eng.sun.com + +For people interested in working on GNU Smalltalk on the NeXT. + +* bug-groff-request@prep.ai.mit.edu to subscribe to bug-groff +** gnUSENET newsgroup: gnu.groff.bug +** GNU groff bug reports to: bug-groff@prep.ai.mit.edu + +groff is the GNU project implementation, in C++, of the traditional Unix +document formatting tools. + +This list distributes, to the active maintainers of groff, bug reports +and fixes for, and suggestions for improvements to groff (and it +component programs). User discussion of groff also occurs here. + +For now, new releases of groff will also be announced on this list. + +There are no other GNU mailing lists or gnUSENET newsgroups for groff. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-ghostscript-request@prep.ai.mit.edu to subscribe to bug-ghostscript +** gnUSENET newsgroup: gnu.ghostscript.bug +** Ghostscript bug reports to: bug-ghostscript@prep.ai.mit.edu + +Ghostscript is the GNU project implementation of a language and graphics +library with a remarkable similarity to PostScript. +This list distributes, to the active maintainers of Ghostscript, bug +reports and fixes for, and suggestions for improvements in Ghostscript. + +For now, new releases of Ghostscript will also be announced on this list. + +There are no other GNU mailing lists or gnUSENET newsgroups for +Ghostscript. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-gnu-utils-request@prep.ai.mit.edu to subscribe to bug-gnu-utils +** gnUSENET newsgroup: gnu.utils.bug +** GNU Utilities bug reports to: bug-gnu-utils@prep.ai.mit.edu + +This list distributes, to the active maintainers of these programs, bug +reports and fixes for, and suggestions for improvements in GNU programs +not covered by other bug-* mailing lists/gnu.*.bug newsgroups. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-gnu-utils-request@prep.ai.mit.edu to subscribe to help-gnu-utils +** gnUSENET newsgroup: gnu.utils.help +** Send contributions to: help-gnu-utils@prep.ai.mit.edu + +This list is the place for users and installers of GNU programs not +covered by other GNU mailing lists/gnu.* newsgroups to ask for help. + +Don't send bug reports to help-gnu-utils (gnu.utils.help); mail them to +bug-gnu-utils@prep.ai.mit.edu instead. + +See section '* General Information about help-* lists'. + +* info-gnu-utils-request@prep.ai.mit.edu IS NOW DEFUNCT +** a gnUSENET newsgroup bever existed +** DEAD address: info-gnu-utils@prep.ai.mit.edu + +This list is dead. Announcements about GNU Utilities will be made to the +list info-gnu@prep.ai.mit.edu (see above). + +* info-cvs-request@prep.ai.mit.edu to subscribe to info-cvs. +** USENET newsgroup: (none) +** CVS discussions/questions to: info-cvs@prep.ai.mit.edu + +This list is for discussion and dissemination of information about +CVS. Please check the FAQ before posting questions, however. + +* bug-cvs-request@prep.ai.mit.edu to subscribe to bug-cvs. +** USENET newsgroup: (none) +** CVS bug reports to: bug-cvs@prep.ai.mit.edu + +This list distributes bug reports, fixes, and suggestions for +improvements to the maintainers of CVS. + +* bug-fortran-mode-request@erl.mit.edu to subscribe to bug-fortran-mode +** USENET newsgroup: (none) +** Fortran mode bug reports to: bug-fortran-mode@erl.mit.edu + +This list collects bug reports, fixes for bugs, and suggestions for +improvements in GNU Emacs's Fortran mode (a major mode to support +editing Fortran source code). + +It is the place to report Fortran mode bugs by all users of Fortran +mode. + +Always report the version number Fortran mode reports on startup as well +as the version of Emacs. + +There is no info-fortran-mode list. There are no USENET gateways to +bug-fortran-mode at this time. + +* info-gnus-request@flab.fujitsu.co.jp to subscribe +** gnUSENET newsgroup: NONE YET +** Send contributions to: info-gnus@flab.fujitsu.co.jp + +The list is intended to exchange useful information about GNUS, such as +bug reports, useful hooks, and extensions of GNUS. GNUS is an NNTP-base +network news reader for GNU Emacs (which also works with a news spool). +English and Japanese are the official languages of the list. GNUS is +quite different than gnews. + +* info-gnus-english-request@prep.ai.mit.edu to subscribe +** gnUSENET newsgroup: gnu.emacs.gnus +** Send contributions to: info-gnus-english@prep.ai.mit.edu + +The list has the same charter as info-gnus. The difference is that +English is the only official language of the list. + +info-gnus-english/gnu.emacs.gnus is forward to info-gnus, but NOT +vice-versa. + +* info-gnews-request@ics.uci.edu to subscribe to info-gnews +** gnUSENET newsgroup: gnu.emacs.gnews +** Send contributions to: info-gnews@ics.uci.edu + +This newsgroup is intended to exchange useful information about gnews, +such as bug reports, useful hooks, and extensions of gnews. gnews is an +NNTP-base network news reader for GNU Emacs (which also works a news +spool). It is quite different than GNUS. + +* gnu-emacs-ada-request@grebyn.com to subscribe to gnu-emacs-ada +** gnUSENET newsgroup: NONE PLANNED +** Gnu Emacs Ada support bug reports to: gnu-emacs-ada@grebyn.com + +This list distributes bug reports for, fixes for bugs in, and +suggestions for improvements in GNU Emacs' editing support of the Ada +programming language. + +There are no other GNU mailing lists or gnUSENET newsgroups for GNU +Emacs' editing support of Ada. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* bug-vm-request@uunet.uu.net to subscribe to bug-vm +** gnUSENET newsgroup: gnu.emacs.vm.bug +** VM mail reader bug reports to: bug-vm@uunet.uu.net + +This list discusses bugs in View Mail mode for GNU Emacs, with an +emphasis on beta and prerelease versions. + +Always report the version number of VM you are using, as well as the +version of Emacs you're running. If you believe it is significant, +report the operating system used and the hardware. + +Subscribers to bug-vm get all info-vm messages. + +* info-vm-request@uunet.uu.net to subscribe to info-vm +** gnUSENET newsgroup: gnu.emacs.vm.info +** Send contributions to: info-vm@uunet.uu.net + +This list discusses the View Mail mode for GNU Emacs, an alternative to +rmail mode. + +* supercite-request@warsaw.nlm.nih.gov to subscribe to supercite +** gnUSENET newsgroup: NONE PLANNED +** Send articles to: supercite@warsaw.nlm.nih.gov +*** UUCP: ..!uunet!warsaw.nlm.nih.gov!supercite-request + +The supercite mailing list covers issues related to the advanced +mail/news citation package called Supercite for GNU Emacs. + +* auc-tex-request@iesd.auc.dk to subscribe +** USENET newsgroup: NONE YET +** Send contributions to: auc-tex@iesd.auc.dk + +The list is intended to exchange information about AUC TeX, such as +bug reports, request for help, and information on current +developments. AUC TeX is a much enhanced LaTeX mode for GNU Emacs. + +The list is unmoderated. + +* bug-gnu-chess-request@prep.ai.mit.edu to subscribe to bug-gnu-chess +** gnUSENET newsgroup: gnu.chess.bug +** GNU Chess bug reports to: bug-gnu-chess@prep.ai.mit.edu + +This list directly accesses the GNU Chess developer's group. If you +have a *BUG* to report about the program, which can also include a +feature enhancement request, please send it to this list. + +Subscribers to bug-gnu-chess get all info-gnu-chess messages. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +* help-gnu-chess-request@prep.ai.mit.edu IS NOW DEFUNCT +** gnUSENET newsgroup: NONE PLANNED +** DEAD address: help-gnu-chess@prep.ai.mit.edu + +This list is dead. Use info-gnu-chess@prep.ai.mit.edu/gnu.chess instead. + +* info-gnu-chess-request@prep.ai.mit.edu to subscribe to info-gnu-chess +** gnUSENET newsgroup: gnu.chess +** Send contributions to: info-gnu-chess@prep.ai.mit.edu +** FAQ-URL: http://www.research.digital.com/SRC/personal/Tim_Mann/chess.html +** FAQ-Archive-name: games/chess/gnu-faq +** FAQ-Posting-frequency: monthly + +This list is the place for users and installers of GNU Chess to ask for +help. This list is also used for games played by people or other +entities against the program, and other generalized non-bug, +non-enhancement data. Please send bug reports to bug-gnu-chess instead +of posting them here. + +This list is also used for announcements about GNU Chess and related +programs, and small but important patches. Announcements of GNU Chess +releases are also made to info-gnu@prep.ai.mit.edu (see above) + +Since info-gnu-chess is a large list, send it only those items that +are seriously important to many people. + +If source or patches that were previously posted or a simple fix is +requested in info-gnu-chess, please mail it to the requester. Do NOT +repost it. If you also want something that is requested, send mail to +the requester asking him to forward it to you. This kind of traffic is +best handled by e-mail, not a broadcast medium that reaches millions of +sites. + +See section '* General Information about help-* lists'. +Also see section '* General Information about info-* lists'. + +* bug-gnu-shogi-request@prep.ai.mit.edu to subscribe to bug-gnu-shogi +** gnUSENET newsgroup: NONE PLANNED +** GNU Shogi bug reports to: bug-gnu-shogi@prep.ai.mit.edu + +This list directly accesses the GNU Shogi developer's group. If you +have a *BUG* to report about the program, which can also include a +feature enhancement request, please send it to this list. + +Subscribers to bug-gnu-shogi get all info-gnu-shogi messages. + +See section '* General Information about bug-* lists and reporting +program bugs'. + +Shogi is a game something like chess. There are several different types +of pieces, a board that is 9 by 9 squares, and the modification that a +captured piece can be reintroduced on the board by the capturing player +(and used). Due to this last difference from Western chess, a Shogi +game never simplifies. + +* help-gnu-shogi-request@prep.ai.mit.edu IS NOW DEFUNCT +** gnUSENET newsgroup: NONE PLANNED +** DEAD address: help-gnu-shogi@prep.ai.mit.edu + +This list is dead. + +* info-gnu-shogi-request@prep.ai.mit.edu to subscribe to info-gnu-shogi +** gnUSENET newsgroup: NONE PLANNED +** Send contributions to: info-gnu-shogi@prep.ai.mit.edu + +This list is the place for users and installers of GNU Shogi to ask for +help. This list is also used for games played by people or other +entities against the program, and other generalized non-bug, +non-enhancement data. Please send bug reports to bug-gnu-shogi instead +of posting them here. + +This list is also used for announcements about GNU Shogi and related +programs, and small but important patches. Announcements of GNU Shogi +releases are also made to info-gnu@prep.ai.mit.edu (see above) + +Since info-gnu-shogi is a large list, send it only those items that +are seriously important to many people. + +If source or patches that were previously posted or a simple fix is +requested in info-gnu-shogi, please mail it to the requester. Do NOT +repost it. If you also want something that is requested, send mail to +the requester asking him to forward it to you. This kind of traffic is +best handled by e-mail, not a broadcast medium that reaches millions of +sites. + +See section '* General Information about help-* lists'. +Also see section '* General Information about info-* lists'. + +* gnu-manual-request@a.cs.uiuc.edu IS NOW DEFUNCT +** DEAD: Gnusenet newsgroup: gnu.emacs.lisp.manual +** DEAD address: gnu-manual@a.cs.uiuc.edu +*** DEAD UUCP address: ..!uunet!uiucdcs!gnu-manual-request + +This list and newsgroup is dead. It was a working group whose +volunteers wrote, proofread and commented on the developing GNU Emacs +Lisp programmers manual. + +Send bugs in the GNU Emacs Lisp reference manual to: + lisp-manual-bugs@prep.ai.mit.edu + +lisp-manual-bugs is neither a mailing list nor a gnUSENET newsgroup. +It's just a bug-reporting address. + +* no mailing list request +** gnUSENET newsgroup: gnu.gnusenet.config +** no mailing list + +This newsgroup has nothing to do with GNU software, especially its +configuration. It exists to distribute information about the +administration and configuration of gnUSENET: the gnu.all alternative +USENET hierarchy that carry the GNU mailing lists. + +Administrators of gnUSENET hosts receiving the gnu.all newsgroups are +welcome to ask questions here or via e-mail of gnu@prep.ai.mit.edu. + +* no mailing list request +** gnUSENET newsgroup: gnu.gnusenet.test +** no mailing list + +This newsgroup has nothing to do with GNU software, especially its +testing. It exists to allow test messages to be made in gnUSENET: the +gnu.all alternative USENET hierarchy that carry the GNU mailing lists. + +Local variables: +mode: outline +fill-column: 72 +End: diff -r 12e008d41344 -r 697ef44129c6 etc/NEWS --- a/etc/NEWS Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/NEWS Mon Aug 13 11:20:41 2007 +0200 @@ -33,42 +33,19 @@ * Changes in XEmacs 21.2 ======================== -** The delete key now deletes forward by default. +** `delete-key-deletes-forward' now defaults to t. -This is regulated by the variable `delete-key-deletes-forward', which -now defaults to t. `delete-key-deletes-forward' takes effect only on -the systems that offer both a backspace and a delete key. If set to -nil, the key labeled "Delete" will always delete backward. If set to -non-nil, the "Delete" key will delete forward, except on keyboards -where a "Backspace" key is not provided (e.g. old DEC keyboards.) +`delete-key-deletes-forward' is the variable that regulates the +behaviour of the delete key on the systems that offer both a backspace +and a delete key. If set to nil, the key labeled "Delete" will delete +backward. If set to non-nil, the "Delete" key will delete forward, +except on keyboards where a "Backspace" key is not provided. -Unless our implementation has bugs, the only reason why you would want +Unless our implementation has bugs, the only reason why you would want to set `delete-key-deletes-forward' to nil is if you want to use the 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 @@ -76,70 +53,12 @@ searching). This mechanism has now been slightly improved for interactive searches: if the search string (or regexp) contains uppercase characters, the searching is forced to be case-sensitive, -`case-fold-search'. +`case-fold-search'. The new behavior affects all functions performing interactive searches, like `zap-to-char', `list-matching-lines', `tags-search' etc. The incremental search facility has always behaved that way. -** Incremental search will now highlight all visible matches, making -it easier to anticipate where consecutive C-s or C-r will place the -point. If you want to disable the feature, set -`isearch-highlight-all-matches' to nil. - -** 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 customizing `gutter-buffers-tab-visible-p', or by -placing this in your .emacs: - - (set-gutter-element-visible-p default-gutter-visible-p 'buffers-tab nil) - -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. - -** 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, -you can now edit the default value by pressing the down arrow, -accessing the logical "future" value. Not all minibuffer prompts have -yet been converted to support this feature. - -** The rectangle functions have been almost completely rewritten in -order to avoid inserting undesirable spaces, notably at the end of -lines. Two typical examples of the old behavior were -`string-rectangle', which filled all lines up to the right side of the -rectangle, and `clear-rectangle', which filled even empty lines up to -the left side. All functions have been rewritten to avoid inserting -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. - -** Customize now supports adding comments about your face and variable -settings using a new menu entry. Comments for variables can also be -assigned by calling `customize-set-(value|variable)' with a prefix -argument. - -** XEmacs now locates the early package hierarchies at -~/.xemacs/mule-packages/ and ~/.xemacs/xemacs-packages/. Previously, -the early packages were located in ~/.xemacs/. - ** You can now create "indirect buffers", like in GNU Emacs. An indirect buffer shares its text with another buffer ("base buffer"), but has its own major mode, local variables, extents, and narrowing. @@ -166,162 +85,10 @@ `~hniksic/'. To make this operation faster, a cache of user names is maintained internally. -The new primitives available for this purpose are functions named -`user-name-completion' and `user-name-all-completions'. - -** XEmacs can now play sound using Enlightenment Sound Daemon (ESD). -It will try NAS first, then ESD, then playing native sound directly. - -** X-Face support is now available under MS-Windows. -If an X-Face libary built under MS-Windows is available then XEmacs -will use this at build time. - -** The font-menu is now available under MS-Windows. - -** MS-Windows support for selection is now much more robust. - -Generally selection should now do what you would expect under -MS-Windows: the middle mouse button will paste your current selection -or the clipboard; conversions from different types of selection to the -clipboard can be made; the kill-ring and friends will be updated as -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 - -** Mail spool locking now works correctly. -XEmacs has always come with a little auxiliary program, movemail, -which moves mail out of the system's spool area into user storage. To -coordinate between XEmacs, the mail delivery agent, and other mail -user agents, movemail needs to properly lock the spool file before -moving it. Movemail now correctly respects the --mail-locking option -to configure. Moreover, movemail's locking behavior can be specified -at run-time, via a new command-line option -m to movemail, or through -the environment variable EMACSLOCKMETHOD. - -When installing XEmacs, make sure you configure it according to your -environment's mail spool locking conventions. When you're using a -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 ~/.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 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 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 behaviour set `progress-display-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. - -*** In DOS, etags looks for file.cgz if it cannot find file.c. - -*** New option --ignore-case-regex is an alternative to --regex. It is now -possible to bind a regexp to a language, by prepending the regexp with -{lang}, where lang is one of the languages that `etags --help' prints -out. This feature is useful especially for regex files, where each -line contains a regular expression. The manual contains details. - -*** In C and derived languages, etags creates tags for function -declarations when given the --declarations option. - -*** In C++, tags are created for "operator". The tags have the form -"operator+", without spaces between the keyword and the operator. - -*** New language Ada: tags are functions, procedures, packages, tasks, and -types. - -*** In Fortran, procedure is no more tagged. - -*** In Java, tags are created for "interface". - -*** In Lisp, "(defstruct (foo", "(defun (operator" and similar constructs -are now tagged. - -*** In Perl, the --globals option tags global variables. my and local -variables are tagged. - -*** New language Python: def and class at the beginning of a line are tags. - -*** .ss files are Scheme files, .pdb is Postscript with C syntax, .psw is -for PSWrap. - * Lisp and internal changes in XEmacs 21.2 ========================================== -** A new portable dumper is available for beta testing. - -Olivier Galibert has written a portable dumper for XEmacs, based on -initial work by Kyle Jones. Normally, XEmacs C sources link into an -executable called `temacs', which loads the Lisp code and "unexecs" -into a proper `xemacs' executable. The unexec() process is hard to -implement correctly and makes XEmacs very hard to port to new -operating systems, or even to new releases of old systems. - -A portable dumper is a different approach to dumping: instead of -dumping full-fledged executable, it only dumps out the initialized -data structures (both Lisp and C) into an external file. A normally -running XEmacs only needs to mmap() that file and relocate a bit to -get to the initialized data. In that scheme, there is no difference -between `temacs' and `xemacs'. - -This is all very experimental, though. Configure with `--pdump' to -try testing it. - ** Much effort has been invested to make XEmacs Lisp faster: *** Many basic lisp operations are now faster. @@ -358,30 +125,6 @@ Speeding up your favorite slow operation is an excellent project to improve XEmacs. Don't forget to profile! -** Native widgets can be displayed in buffers. - -The glyph system has been extended to allow the display of glyphs that -are implemented as native window-system widgets. Thus you can embed -buttons, scrollbars, combo boxes, edit fields and progress gauges in a -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 -file glyphs-test.el in the XEmacs src distribution for examples of -usage. - -The buffers-tab functionality and progress gauge have been implemented -using this feature. - -** `user-init-file' and `user-init-directory' are now absolute -file/directory names. Previously, both variables used to be relative -to (concat "~" init-file-user). This turned out to be too complicated -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. - ** XEmacs finally has an automated test suite! Although this is not yet very sophisticated, it is already responsible for several important bug fixes in XEmacs. To try it out, simply use @@ -413,48 +156,14 @@ An extra bonus is that checking for circularities is not just friendlier, but actually faster than checking for C-g. -** Functions for decoding base64 encoding are now available; see -`base64-encode-region', `base64-encode-string', `base64-decode-region' -and `base64-decode-string'. - -** The functions `read-string', `read-expression', `eval-minibuffer', -`read-variable', `read-command', `read-function', `read-number', -`read-shell-command', `read-from-minibuffer', and `completing-read' -now take an additional argument which specifies the default value. If -this argument is non-nil, it should be a string; that string is used -in two ways: - - It is returned if the user enters empty input. - It is available through the history command M-n. - -** LDAP changes. - -*** The LDAP interface now consists of two layers, a low-level layer -that closely matches the LDAP C API, and a more convenient -higher-level set of functions. +** The new form `ignore-file-errors', similar to `ignore-errors' may +be used as a short-hand for condition-case when you wish to ignore +file-related error. For example: -*** The low-level functions that used to be named *-internal are now -named more simply: `ldap-open', `ldap-close', `ldap-search-basic', -`ldap-add', and `ldap-modify'. They should be used directly for very -specific purposes (such as multiple operations on a connection) only. + (ignore-file-errors (delete-file "foo")) -*** 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.) This layer provides atomic operations for searches, -modification, addition and deletion of multiple entries at once: -`ldap-search-entries', `ldap-add-entries', `ldap-delete-entries', and -`ldap-modify-entries'. - -*** To maintain compatibility with previous code, the now obsolete -function `ldap-search' is now merely a wrapper that calls either -`ldap-search-basic' or `ldap-search-entries'. Please don't use the -`ldap-search' function in your new programs -- a direct call to one of -the two replacements is more efficient and unambiguous. - -** The arguments to `locate-file' are now more Lisp-like. As before, -the usage is: +** The arguments to `locate-file' are now much more "lispy". As +before, the usage is: (locate-file FILENAME PATH-LIST &optional SUFFIXES MODE) @@ -462,33 +171,22 @@ colon-separated string. MODE is now a symbol or a list of symbols (symbols `exists', `executable', `writable', and `readable' are supported) instead of an integer code. See the documentation for -details. Of course, the old form is still accepted for backward -compatibility. +details. -Several bugs in locate-file have been fixed, most notably its failure -to call expand-file-name on elements of PATH-LIST. Because of that -elements of load-path of the form "~/..." used to not work. -locate-file is now guaranteed to expand files during its course of -operation. +Of course, the old form is still accepted for backward compatibility. + +** The `keywordp' function now returns non-nil only on symbols +interned in the global obarray. For example: -** `translate-region' has been improved in several ways. Its TABLE -argument used to be a 256-character string. In addition to this, it -can now also be a vector or a char-table, which makes the function -useful for Mule, which it wasn't. If TABLE a vector or a generic -char-table, you can map characters to strings instead of to other -characters. For instance: + (keywordp (intern ":foo" [0])) + => nil + (keywordp (intern ":foo")) ; The same as (keywordp :foo) + => t - (let ((table (make-char-table 'generic))) - (put-char-table ?a "the letter a" table) - (put-char-table ?b "" table) - (put-char-table ?c ?\n table) - (translate-region (point-min) (point-max) table)) - -** The new form `ignore-file-errors', similar to `ignore-errors' may -be used as a short-hand for condition-case when you wish to ignore -file-related error. For example: - - (ignore-file-errors (delete-file "foo")) +This behaviour is compatible with other code which treats symbols +beginning with colon as keywords only if they are interned in the +global obarray. `keyword' used to wrongly return t in both cases +above. ** The first argument to `intern-soft' may now also be a symbol, like with `unintern'. If given a symbol, `intern-soft' will look for that @@ -501,33 +199,9 @@ (intern-soft (make-symbol "foo")) => nil -** The `keywordp' function now returns non-nil only on symbols -interned in the global obarray. For example: - - (keywordp (intern ":foo" [0])) - => nil - (keywordp (intern ":foo")) ; The same as (keywordp :foo) - => t - -This behaviour 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. +** Functions for decoding base64 encoding are now available; see +`base64-encode-region', `base64-encode-string', `base64-decode-region' +and `base64-decode-string'. * Changes in XEmacs 21.0 @@ -1011,7 +685,7 @@ Look under "Startup Paths" in the Info documentation for more information. -*** site-lisp is no longer part of the load-path by default. +*** site-lisp is now longer part of the load-path by default. Its use is deprecated, but you can specify --with-site-lisp=yes at the configure command line to get it back. diff -r 12e008d41344 -r 697ef44129c6 etc/OONEWS --- a/etc/OONEWS Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/OONEWS Mon Aug 13 11:20:41 2007 +0200 @@ -2403,7 +2403,7 @@ *** utils/bench.el Commentary: -Adapted from Shane Holder's bench.el by steve@xemacs.org. +Adapted from Shane Holder's bench.el by steve@altair.xemacs.org. To run Extract the shar file in /tmp, or modify bench-lisp-file to @@ -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-plist' +yet implemented). They are joined by a new function `object-props' 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 12e008d41344 -r 697ef44129c6 etc/README.HYPERBOLE --- a/etc/README.HYPERBOLE Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/README.HYPERBOLE Mon Aug 13 11:20:41 2007 +0200 @@ -2,5 +2,5 @@ The latest working version of this package with major enhancements is available together with professional support exclusively from their -developer, BeOpen Inc. See http://www.beopen.com for product +developer, Altrasoft Inc. See http://www.altrasoft.com for product and service details. diff -r 12e008d41344 -r 697ef44129c6 etc/README.OO-BROWSER --- a/etc/README.OO-BROWSER Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/README.OO-BROWSER Mon Aug 13 11:20:41 2007 +0200 @@ -2,5 +2,5 @@ The latest working version of this package with major enhancements is available together with professional support exclusively from their -developer, BeOpen Inc. See http://www.beopen.com for product +developer, Altrasoft Inc. See http://www.altrasoft.com for product and service details. diff -r 12e008d41344 -r 697ef44129c6 etc/SERVICE --- a/etc/SERVICE Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/SERVICE Mon Aug 13 11:20:41 2007 +0200 @@ -40,13 +40,13 @@ ** Please keep the entries in this file alphabetical **  -BeOpen +Altrasoft 4880 Stevens Creek Blvd., Suite 205 San Jose, CA 95129-1034 +1 408 243 3300 -http://www.beopen.com +http://www.altrasoft.com -BeOpen provides corporate-quality support, development and user +Altrasoft provides corporate-quality support, development and user documentation for GNU Emacs, XEmacs and InfoDock. (InfoDock is a turnkey information management and software development toolset built atop emacs, written by one of our associates.) Emacs distributions for a variety of diff -r 12e008d41344 -r 697ef44129c6 etc/TUTORIAL.de --- a/etc/TUTORIAL.de Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/TUTORIAL.de Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 1997-2000, Adrian Aichner . +Copyright (c) 1997, Adrian Aichner . Copyright (c) 1985, 1996 Free Software Foundation, Inc. See end for conditions. @@ -39,7 +39,7 @@ META-Taste gedrückt und tippe v oder tippe v wenn Deine Tastatur keine META-, EDIT- oder ALT-Taste besitzt). ->> Versuche ein paarmal M-v und C-v zu tippen. +>> Versuche ein paar Mal M-v und C-v zu tippen. * ZUSAMMENFASSUNG @@ -1131,13 +1131,13 @@ Ben Wing hat das Tutorial für X Windows erweitert. Martin Buchholz und Hrvoje Niksic haben weitere Korrekturen für XEmacs beigetragen. Ins Deutsche übertragen wurde es von Adrian Aichner -. +. Diese Version des Tutorials ist, wie GNU Emacs selbst, urheberrechtlich geschützt und erlaubt die Verteilung von Kopien unter bestimmten Voraussetzungen: -Copyright (c) 1997-2000, Adrian Aichner . +Copyright (c) 1997, Adrian Aichner . Copyright (c) 1985, 1996 Free Software Foundation diff -r 12e008d41344 -r 697ef44129c6 etc/TUTORIAL.fr --- a/etc/TUTORIAL.fr Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/TUTORIAL.fr Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,9 @@ -Copyright (c) 1997-2000, Didier Verna . +Copyright (c) 1997, 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,3 +1082,4 @@ COPYING et à distribuer Emacs à vos amis. Aidez-nous à tuer l'obstructionnisme logiciel en utilisant, écrivant et partageant du logiciel libre! + diff -r 12e008d41344 -r 697ef44129c6 etc/TUTORIAL.ja --- a/etc/TUTORIAL.ja Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/TUTORIAL.ja Mon Aug 13 11:20:41 2007 +0200 @@ -1,1052 +1,741 @@ -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 + ============================== + $BF|K\8l(B GNUEMACS(Mule) $BF~LgJT(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$+$i;O$^$k9T$O!"$=$N;~2?$r$9$Y$-$+$r;X<($7$F$$$^$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$G$9!#(B + Mule $B$N%3%^%s%I$rF~NO$9$k$H$-$K$O!"0lHLE*$K%3%s%H%m!<%k!&%-! $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 +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$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%(%9%1!<%W!&%-!<$r2!$7$F$+$iN%$7!"$=$l$+$i(B<$BJ8;z(B>$B%-!<$r2!$7$^(B + $B$9!#(B -$BA0$N2hLL$H$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 -$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=EMW$G$9!'(B Emacs$B$r=*N;$5$;$?$$;~$O!"(BC-x C-c $B$r%?%$%W$7$^$9!#(BEmacs$B$r(Bcsh + $B$+$i5/F0$7$F$$$k>l9g!"%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!v$3$3$^$G$NMWLs(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$-!"%+!<%=%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 + C-v $BA0$K0l2hLLJ,?J$`(B + ESC v $B8e$m$K0l2hLLJ,La$k(B + C-l $B2hLL$r=q$-D>$9!#$3$N$H$-!"85%+!<%=%k$N$"$C$?9T$,(B + $B2hLL$NCf1{$K$/$k$h$&$K$9$k(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 + >> $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!v4pK\E*$J%+!<%=%k$N@)8f(B -======================== +$B4pK\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$&!#(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 -$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!"> 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 + + $B$3$l$i$O!"$=$l$>$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 + + + $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 + + >> C-n $B$r;H$C$F!"%+!<%=%k$r2hLL$N2> 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 + + 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 + + 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$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-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 ->> 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 + $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%F%-%9%HCf$G%+!<%=%k$NB8:_$9$k0LCV$r!V%]%$%s%H!W$H8F$S$^$9!#8@$$$+$($l(B +$B$P!"%+!<%=%k$O!"%F%-%9%H$N$I$3$K%]%$%s%H$,$"$k$+$r2hLL>e$G<($7$F$$$k$N$G$9!#(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 + $B0J2<$KC1=c$J0\F0A`:n$K$D$$$FMWLs$7$^$9!#$3$N$J$+$K$O!"C18l$d9TC10L$G$N(B +$B0\F0%3%^%s%I$b4^$^$l$F$$$^$9!#(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 + ESC f $B0lC18l@h$K?J$`(B + ESC b $B0lC18l8e$KLa$k(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 + ESC < $B%U%!%$%k$N:G=i$K0\F0(B + ESC > $B%U%!%$%k$N:G8e$K0\F0(B ->> C-n $B$r;H$C$F!"%+!<%=%k$r2hLL$N2> $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 -$B0lJ8;zC10L$N0\F0$G$O$^$I$m$C$3$7$$$J$i!"C18lC10L$G0\F0$9$k$3$H$b$G$-$^(B -$B$9!#(BM-f ( f) $B$G0lC18l@h$X!"(BM-b ( b) $B$G0lC18lA0$X0\F0$7$^$9!#(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 -$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 + $BNc$($P!"(BC-u 8 C-f $B$H$9$k$H!"#8J8;zJ,@h$K0\F0$7$^$9!#(B ->> M-f $B$d(B M-b $B$r2?2s$+;n$7$F$_$^$7$g$&!#(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 -$BC18l$NCfDx$K$$$k;~$O!"(BM-f $B$O$=$NC18l$N=*$o$j$^$G?J$_$^$9!#$b$76uGrJ8;z(B -$B$K$$$k;~$K$O(B M-f $B$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 + + >> C-u 3 C-v $B$HF~NO$7$F$_$J$5$$!#(B ->> 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 + $B85$KLa$k$K$O!"(BC-u 3 ESC v $B$r;H$($P$h$$$N$G$9!#(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 +$BCf;_%3%^%s%I(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-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%-!> 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 + >> 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>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 +$B%(%i!<(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 + $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-f $B0lJ8;zl9g$,$"$jF@$^$9!#$=$NMM$J>l9g$K$O!"%(%i!<%a%C%;!<%8$,I=<($5$l$^$9$+$i!"(B +$B2?$+%+!<%=%k0\F0%-!<$r2!$7$F!"$=$N$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!"$N%&%#%s%I%&$r>C$7$F!"%+!<%=%k$N$"$k%&%#%s%I%&$r!"2hLLA4BN(B +$B$K9-$2$^$9!#(B ->> $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%+!<%=%k$r$3$N9T$K;}$C$F$-$F!"(BC-u 0 C-l $B$H%?%$%W$7$^$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 + >> 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 -$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 + >> 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 ->> 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 +$BA^F~$H:o=|(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%F%-%9%H$r%?%$%W$7$?$1$l$P!"C1$K$=$l$r%?%$%W$9$k$@$1$G9=$$$^$;$s!#L\$K(B +$B8+$($kJ8;z!J(B'A','7','*','$B$"(B'$B$J$I!K$O(BEmacs$B$K$h$C$F%F%-%9%H$G$"$k$H$_$J$5$l!"(B +$B$=$N$^$^A^F~$5$l$^$9!#9T$N=*$o$j$O2~9TJ8;z$GI=$5$l!"$3$l$rF~NO$9$k$K$O(B + $B$r%?%$%W$7$^$9!#(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 + $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 -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> $BJ8;z$r$$$/$D$+%?%$%W$7!"$=$l$+$i$=$l$i$r(B $B$r;H$C$F:o=|$7(B + $B$J$5$$!#(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 -$BNc$($P(B C-u 8 C-f $B$H%?%$%W$9$k$H#8J8;zJ,@h$K0\F0$7$^$9!#(B + $B$3$l$O!"J8>O$G@bL@$9$k$h$j> $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 + >> $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 -$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 + >> $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 -$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$r2!$7$F!"$b$&0lEY9T6g@Z$j$rA^F~$7$J$5$$!#(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 + 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%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 + $BFs$D$N9T$N4V$K6uGr9T$r:n$j$?$$>l9g$K$O!"FsHVL\$N9T$N@hF,$K9T$-!"(BC-o $B$r(B +$BF~NO$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 + >> $BE,Ev$J9T$N@hF,$K9T$-!"$=$3$G(B C-o $B$rF~NO$7$F$_$J$5$$!#(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%+!<%=%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 + + C-k $B%+!<%=%k0LCV$+$i9TKv$^$G$r:o=|(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$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: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 + + >> 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 + + $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 + + 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%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> $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 -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 +$BC$7(B(UNDO) +============== -$B4V0c$C$F(B $B$r%?%$%W$7$F$7$^$C$?;~$b!"(BC-g $B$G$=$l$rC$;$^$9!#(B - - -$B!v;HMQIT2D(B (disabled) $B%3%^%s%I(B -================================== - -$B$$$/$D$+$N%3%^%s%I$O=i?4$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$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> $B$3$N9T$r(BC-k$B$G>C$7$F2<$5$$!#$=$7$F!"(BC-x u$B$GLa$7$F2<$5$$!#(B -$B$b$7K\Ev$K> `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 + C-_$B$d(BC-x u$B$K(BUNDO$B$N2s?t$r!"M?$($k$3$H$,=PMh$^$9!#(B -$B!v%&%#%s%I%&(B -============ +$B%U%!%$%k(B +======== -XEmacs $B$O4v$D$b$N%&%#%s%I%&$K!"$=$l$>$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 + $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 -$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 + $B$$$^8+$F$$$k%U%!%$%k$KBP$7$F!"$"$J$?$NJT=8$r9T$C$?$b$N$r=q$-9~$_$^$9!#(B +$B$$$^8+$F$$$k%U%!%$%k$H$O!"4JC1$K$$$($PJT=8$7$F$$$k%U%!%$%k<+BN$N$3$H$G$9!#(B - C-x 1 $B%&%#%s%I%&$r#1$D$K$9$k!J$D$^$jB>$N%&%#%s%I%&$rA4It>C$9!K(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%&%#%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 + $B%;!<%V$r9T$C$?8e$G$5$(JQ99$7$?$b$N$,4V0c$C$F$$$?;~$N$?$a$K(BEmacs$B$OL>A0(B +$B$rJQ$($F%*%j%8%J%k$N%U%!%$%k$r;D$7$^$9!#(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 +$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 ->> $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 + $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 ->> C-x 1 $B$H%?%$%W$7$F!"?7$7$$%&%#%s%I%&$,>C$($k$N$r8+$F2<$5$$!#(B + +($BNc(B) [--]J:--**-Mule: MULE.tut (Fundamental) ---55%-------------- -$B!vA^F~$H:o=|(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$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 + + 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 + + >> 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%F%-%9%H$rF~NO$7$?$1$l$P!"C1$K$=$l$r%?%$%W$7$F2<$5$$!#(BXEmacs $B$O!"L\$K(B -$B8+$($kJ8;z!J(BA, 7, * $BEy!K$r%F%-%9%H$G$"$k$H$_$J$9$N$G!"$=$l$i$O$=$N$^$^(B -$BA^F~$5$l$^$9!#(B$B!J2~9T%-!A0$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 + + >> 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 -$BD>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?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 + + $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$h$j0lHLE*$K$O!"(B $B$O8=:_%+!<%=%k$N$"$k0LCV$ND>A0$NJ8;z$r:o=|$7(B +$B%P%C%U%!(B +======== + + $B$b$7!"#2HVL\$N%U%!%$%k$r(B C-x C-f $B$G> $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 - -$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 + C-x C-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$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 + >> 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$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 - - 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%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$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 + $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 -$B0lEY$K#2J8;z0J>e>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 - ->> $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 + >> $B%P%C%U%!%j%9%H$r>C$9$?$a(B C-x 1 $B$H%?%$%W$7$J$5$$!#(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 - -C-y $B$O!"$"$J$?$,L5$/$7$?$b$N$rC5n$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 + $B$b$7!"$"$k%U%!%$%k$N%F%-%9%H$KJQ99$r9T$J$C$F$+$i!"B>$N%U%!%$%k$r> 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-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 + $B#2HVL\$N%U%!%$%k$KBP1~$9$k%P%C%U%!$r:n$C$?$j!"%(%G%#%C%H$7$?$j$7$F$b!"(B +$B#1HVL\$N%U%!%$%k$KBP1~$9$k%P%C%U%!$K$O2?$b1F6A$rM?$($^$;$s!#$3$l$O$H$F$b;H(B +$B$$0W$/!"$^$?!"#1HVL\$N%U%!%$%k$KBP1~$9$k%P%C%U%!$rC5n$7$?%F%-%9(B -$B%H!K$KLa$j$^$9!#(B + C-x C-s $B$G%P%C%U%!$r%;!<%V$9$k$?$a$K(B C-x C-f $B$G%P%C%U%!$r@Z$jBX$($k$N(B +$B$OLq2p$G$9!#$=$3$G> $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-x s $B8=:_$"$k%P%C%U%!$r%;!<%V$9$k!#(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 + C-x s $B$OFbMF$rJQ$($?%P%C%U%!A4$F$r%U%!%$%k$K%;!<%V$7$^$9!#$3$N;~!"$R$H(B +$B$D$R$H$D$N(B($B%;!<%V$5$l$k$Y$-(B)$B%P%C%U%!$KBP$7$F!"%;!<%V$9$k$+!"$7$J$$$+$r(By$B$+(Bn +$B$GLd$o$l$^$9!#$3$NI=<($O2hLL$N2<$N9T$KI=<($5$l$^$9!#Nc$($P!"$3$N$h$&$K$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-_ $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!#CO$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 - -$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 - -$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%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%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!#$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%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-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 - -$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%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!"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 - -$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 - ->> C-x C-s $B$H%?%$%W$7$F$3$NF~Lg%,%$%I$N%3%T!<$r%;!<%V$7$F2<$5$$!#(B - $B2hLL:G2O$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!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 ->> "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$"$k%U%!%$%k$NFbMF$K$J$s$i$+$NJQ99$r2C$(!"$=$l$+$iB>$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$G$l$K$D$$$F!"$=$l(B -$B$r%;!<%V$9$k$+$I$&$+$rJ9$$$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 ----------------- +$B%3%^%s%I$N3HD%(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!v%^%&%9$r;H$&(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 - -$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 - -X $B$N%/%j%C%W%\!<%I$+$i%F%-%9%H$r$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 - -$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 - ->> $B1&%^%&%9%\%?%s$r2!$7$F$/$@$5$$!#(B - -$B%a%K%e!<$rI=<($5$;B3$1$k$?$a$K$O%\%?%s$r2!$7B3$1$kI,MW$,$"$j$^$9!#(B - - -$B!v%3%^%s%I$N3HD%(B -================ - -XEmacs $B$K$O!"%3%s%H%m!<%kJ8;z$d%a%?J8;z$K3dEv$i$l$k$h$j$b$:$C$H$:$C$H(B -$BB?$/$N%3%^%s%I$,$"$j$^$9!#$3$l$i$r07$&$?$a$K!"3HD%!J(BeXtend$B!K%3%^%s%I$r(B + $B%(%G%#%?$K$O!"%3%s%H%m!<%k!&%-!<$d%a%?!&%-!<$GF~NO$G$-$k$b$N$h$j$b$:$C(B +$B$HB?$/$N%3%^%s%I$,$"$j$^$9!#$3$l$i$r07$&$?$a$K!"3HD%!J(BeXtend$B!K%3%^%s%I$r(B $B;H$$$^$9!#$=$l$K$O!"0J2<$N#2$D$NA0$K$h$k3HD%!#B3$1$F%3%^%s%I$NL>A0$rF~NO$7$^$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!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 - -$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 - -$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 + $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 -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 - -C-x $B%3%^%s%I$O$?$/$5$s$"$j$^$9!#$3$l$^$G$K!"0J2<$r3X$S$^$7$?!#(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 - 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 - -$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 - -"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 +$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 ->> $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 + C-x $B%3%^%s%I$O!"$?$/$5$s$"$j$^$9!#$9$G$K3X$s$@$b$N$O0J2<$N$b$N$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$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 + $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 + >> 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 -$B!v<+F0%;!<%V(B + $B8=$l$?!V%&%#%s%I%&!W$r>C$9$K$O!"(BC-x 1 $B$H%?%$%W$7$^$9!#(B + +$B%b!<%I%i%$%s(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 + $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 -$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 + [--]J:--**-Mule: MULE.tut (Fundamental) ---NN%-------------- -$B!v%(%3!<%(%j%"(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$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 + $B$3$N9T$K$h$C$FB?$/$NM-MQ$J>pJs$,F@$i$l$^$9!#(B -$B!v%b!<%I%i%$%s(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 -$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 + 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 -ISO7-----XEmacs: TUTORIAL.ja (Fundamental)--L670--58%---------------- + $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$3$N9T$O(B XEmacs $B$N>uBV5Z$SJT=8Cf$NJ8>O$K$D$$$FM-1W$J>pJs$rM?$($F$/$l$^(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%U%!%$%kL>$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$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 + + $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 -$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 + $B:8C<$N(B '[--]' $B$O8=:_$N%-!\$7$$@bL@$O(B +$B!V$?$^$4!W$N%^%K%e%"%k$rD4$Y$F2<$5$$!#(B -XEmacs $B$K$OB?$/$NO$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 + $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 -$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 + $B:G=i$N0lJ8;z$,%3!<%IBN7O$N%K!<%b%K%C%/!"o$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 + $B> C-x C-k t$B$r(B2$BEY9T$$$J$5$$!#(B ->> M-x text-mode $B$H%?%$%W$7$F$_$F2<$5$$!#(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?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$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 -$B%a%8%c!<%b!<%I$O$3$N$h$&$K:3:Y$J0c$$$r@8$_$^$9!#Bg35$N%3%^%s%I$O$I$N%a(B -$B%8%c!<%b!<%I$G$bF1$8F/$-$r$7$^$9$,!"/$7$@$1$3$H$J$k$N$G$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=:_$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 +$B8!:w(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 + $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 + + + >> 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$b$EY(B C-s $B$r%?%$%W$9$k$H!"> $B$r#42sF~NO$7$F!"%+!<%=%k$NF0$-$r8+$J$5$$!#(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 + >> ESC$B$r2!$7$F!"=*N;$7$^$9!#(B + + $BC5$7$?$$J8;zNs$r%?%$%WCf$G$b!"%?%$%W$7$?J8;zItJ,$@$1$G!"8!:w$r;O$a$^$9!#(B +$Bo$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 + $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 -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 + $B8!:w> 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 + C-s $B$O!"8=:_$N%+!<%=%k0LCV0J9_$K=P$F$/$k8!:wJ8;zNs$rC5$7$^$9!#$b$7!"A0(B +$B$NJ}$rC5$7$?$+$C$?$i!"(BC-r $B$r%?%$%W$9$k$3$H$G!"5UJ}8~8!:w$,$G$-$^$9!#(BC-s $B$H(B +C-r $B$O!"8!:w$NJ}8~$,H?BP$J$@$1$G!"A4$FF1$8F/$-$r$7$^$9!#(B + +$B%j%+!<%7%V(B $B%(%G%#%F%#%s%0(B $B%l%Y%k(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 + $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 + +$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 ->> $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$G$k$?$a$K$O!"(BM-x top-level +$B$H%?%$%W$7$^$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 -$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 + $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%+!<%=%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%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!v8!:w(B + +$B%X%k%W(B ====== -$BJ8>OCf$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 + 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$ruBV$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;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 -$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 -$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 - + $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 -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 + $B$b$C$H>\$7$/CN$j$?$+$C$?$i!"(Bc $B$NBe$o$j$K(B k $B$r;XDj$7$^$9!#(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 + >> C-h k C-p $B$H%?%$%W$7$F$_$J$5$$!#(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 + 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 ->> 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 + $BB>$K$bLr$KN)$D%*%W%7%g%s$,$"$j$^$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 $B%U%!%s%/%7%g%sL>$rF~NO$9$k$H!"%U%!%s%/%7%g%s$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 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 -$B%a%?%-!<$,L5$$>l9g!"(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 $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$G> 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 - + >> 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 -$B!v:F5"JT=8%l%Y%k(B (RECURSIVE EDITING LEVELS) +$B$*$o$j$K(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 +$BK:$l$:$K!'(B $B=*N;$9$k$K$O!"(BC-x C-c $B$H$7$^$9!#(B ->> 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$3$NF~LgJT$O!"$^$C$?$/$N=i?4C$9$N$K;H$o$l$F$$$k$+$i$G$9!#(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!"pJs$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 +$Bl9g$O(B C-h ? $B$H%?%$%W$7$^$7$g$&!#(B -$B$I$s$JC$9$3$H$,$G$-$^$9!#(B + 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!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 + Update - February 1986 by Dana Hoggatt. -$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 + Update - December 1986 by Kim Leburg. -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 + Update/Translate - July 1987 by SANETO Takanori -C-h $B$K$OB>$K$bLr$KN)$D%*%W%7%g%s$,$"$j$^$9!#(B - - C-h f $B%U%!%s%/%7%g%s$N@bL@!#%U%!%s%/%7%g%sL>$rF~NO$7$^$9!#(B - ->> 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 +$BFCJL$JA0$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 - -"newline"$B$H$$$&J8;zNs$rL>A0$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: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 -$B!v$*$o$j$K(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$$(B -$B$^$9!#(B +$B8mLu!"13!"$=$NB>!"$NJ8@U$O!"0J2<$N>" ¨ÐÁÕ¤ÓÊÑè§ÇèÒ µèÍ仨ÐãËé·ÓÍÐäà +,TKARB`K05X1(B: ,T`M!JRC)0:Q1:`0:Wi1M'05i1909Ui1(B 0,T6Y1!`0"U1B90"Vi19b4B0BV14K0EQ1!07Uh10Gh1R(B ",TEM'`0Eh19`EB04U1!0Gh1R`0CU1B90CYi1(B" + ,T:CC07Q1407Uh1`0CTh1A05i1904i1GB(B ">>" ,T(P0AU1$S0JQh1'0Gh1R(B 0,T5h1Md;(Pc0Ki17SMPdC(B - â´Â·ÑèÇä» ¡Òûé͹¤ÓÊÑè§ãËé¡Ñº Mule ·Óä´éâ´Âãªé »ØèÁ¤Í¹â·ÃÅ (»ØèÁ·Õ躹˹éÒÊÑÁ¼ÑÊ à¢Õ¹äÇé -ÇèÒ CTRL ËÃ×Í CTL) ËÃ×Í »ØèÁ META (â´Â»¡µÔ ËÁÒ¶֧»ØèÁ ESC) ã¹·Õè¹Õé àÃÒ¨ÐãªéÊÑ­ÅѡɳìµèÍä» -¹Õé á·¹¡ÒÃà¢Õ¹àµçÁ æ ÇèÒ CONTROL ËÃ×Í META + ,Tb4B07Qh1Gd;(B ,T!RC0;i1M9$S0JQh1'c0Ki10!Q1:(B Mule ,T7Sd04i1b4Bc0*i1(B 0,T;Xh1A$M9b7CE(B (0,T;Xh1A07Uh1:9K09i1R0JQ1A0 ËÁÒ¶֧ ãËé¡´»ØèÁ¤Í¹â·ÃŤéÒ§äÇé áÅéÇ¡´»ØèÁ <µÑÇÍÑ¡ÉÃ> µÑÇÍÂèÒ§àªè¹ C-f - ËÁÒ¶֧ ãËé¡´»ØèÁ¤Í¹â·ÃŤéÒ§äÇé áÅéÇ¡´»ØèÁ f +C-<0,T5Q1G0MQ1!IC(B> ,TKARB06V1'(B ,Tc0Ki1!40;Xh1A$M9b7CE0$i1R'd0Gi1(B ,Ta0Ei1G!40;Xh1A(B <0,T5Q1G0MQ1!IC(B> 0,T5Q1GM0Bh1R'`0*h19(B C-f + ,TKARB06V1'(B ,Tc0Ki1!40;Xh1A$M9b7CE0$i1R'd0Gi1(B ,Ta0Ei1G!40;Xh1A(B f <> - >> µÍ¹¹Õé¢ÍãËéÅͧ¡´ C-v (View Next Screen ´Ù˹éÒµèÍä») ´Ù à¾×èÍàÅ×è͹ä»Íèҹ˹éÒ - µèÍä» - µèͨҡ¹Õéà»ç¹µé¹ä» ·Ø¡¤ÃÑ駷ÕèÍèҹ˹éÒ˹Öè§ æ ¨º¢ÍãËé·Ó㹷ӹͧà´ÕÂǡѹ à¾×èÍàÅ×èÍ¹ä» - ´Ù˹éÒµèÍä» + >> ,T5M909Ui1"Mc0Ki1EM'!4(B C-v (View Next Screen 0,T4Y1K09i1R05h1Md;(B) 0,T4Y1(B ,T`0>Wh1M`0EWh1M9d;0Mh1R9K09i1R(B + 0,T5h1Md;(B + 0,T5h1M(R!09Ui1`0;g1905i19d;(B 0,T7X1!$0CQi1'07Uh10Mh1R9K09i1RK09Vh1'(B ,Tf(B ,T(:"Mc0Ki17Sc97S9M'`04U1BG0!Q19(B ,T`0>Wh1M`0EWh1M9d;(B + 0,T4Y1K09i1R05h1Md;(B -ESC <µÑÇÍÑ¡ÉÃ> ËÁÒ¶֧ ãËé¡´»ØèÁ ESC áÅéÇ»ÅèÍ ËÅѧ¨Ò¡¹Ñ鹨֧¡´»ØèÁ <µÑÇÍÑ¡ÉÃ> µÒÁ +ESC <0,T5Q1G0MQ1!IC(B> ,TKARB06V1'(B ,Tc0Ki1!40;Xh1A(B ESC ,Ta0Ei1G;0Eh1MB(B ,TK0EQ1'(R!09Qi190(V1'!40;Xh1A(B <0,T5Q1G0MQ1!IC(B> ,T5RA(B -ËÁÒÂà˵Ø: <µÑÇÍÑ¡ÉÃ> äÁèÇèÒà»ç¹µÑÇãË­èËÃ×͵ÑÇàÅç¡ ¨ÐãËé¤ÇÒÁËÁÒÂàËÁ×͹¡Ñ¹àÁ×èͶ١ãªéã¹ - ¤ÓÊÑè§ ¶éÒËÒ¡ÁÕ»ØèÁ META ãËé¡´ ¡ç¨ÐÊÒÁÒöãªé¡Òá´ M-<µÑÇÍÑ¡ÉÃ> á·¹ - ¡Òà ESC <µÑÇÍÑ¡ÉÃ> ä´é (¤×ÍãËé¡´»ØèÁ META ¤éÒ§äÇé áÅéǨ֧¡´ <µÑÇÍÑ¡ÉÃ>) +,TKARB`K05X1(B: <0,T5Q1G0MQ1!IC(B> ,Td0Ah10Gh1R`0;g1905Q1GcK0-h1K0CW1M05Q1G`0Eg1!(B ,T(Pc0Ki1$GRAKARB`K0AW1M90!Q19`0AWh1M06Y1!c0*i1c9(B + ,T$S0JQh1'(B 0,T6i1RKR!0AU10;Xh1A(B META ,Tc0Ki1!4(B 0,T!g1(PJRARC6c0*i1!RC!4(B M-<0,T5Q1G0MQ1!IC(B> ,Ta79(B + ,T!RC(B ESC <0,T5Q1G0MQ1!IC(B> ,Td04i1(B (0,T$W1Mc0Ki1!40;Xh1A(B META 0,T$i1R'd0Gi1(B ,Ta0Ei1G0(V1'!4(B <0,T5Q1G0MQ1!IC(B>) -¢éÍÊӤѭ: àÇÅÒ¨ÐàÅÔ¡ãªé Emacs ãËé¡´ C-x C-c ËÃ×Í㹡óշÕèÊÑè§ Emacs ¨Ò¡ csh - ¡çÊÒÁÒöãªé suspend (ËÂØ´ªÑèǤÃÒÇ) ä´é ¡Òà suspend Emacs ·Óä´éâ´Â - ¡´ C-z +0,T"i1MJS0$Q1-(B: ,T`GER(P`0ET1!c0*i1(B Emacs ,Tc0Ki1!4(B C-x C-c ,TK0CW1Mc9!C03U107Uh10JQh1'(B Emacs ,T(R!(B csh + 0,T!g1JRARC6c0*i1(B suspend (,TK0BX140*Qh1G$CRG(B) ,Td04i1(B ,T!RC(B suspend Emacs ,T7Sd04i1b4B(B + ,T!4(B C-z - µèͨҡ¹Õé ¢ÍãËé»é͹¤ÓÊÑè§ C-v ·Ø¡ æ ¤ÃÑ駷ÕèÍèÒ¹¨ºË¹Öè§Ë¹éÒ + 0,T5h1M(R!09Ui1(B ,T"Mc0Ki10;i1M9$S0JQh1'(B C-v 0,T7X1!(B ,Tf(B ,T$0CQi1'07Uh10Mh1R9(:K09Vh1'K09i1R(B - ÀÒÂã¹Ë¹éÒ·ÕèáÅéǡѺ˹éÒ¶Ñ´ä» ¨ÐÁÕà¹×éÍËÒ«éӡѹÍÂÙèºÒ§ºÃ÷Ѵ ·Õèà»ç¹àªè¹¹Õé ¡çà¾×èÍãËéÊÒÁÒöÃÙé -ä´éÇèÒ à¹×éÍËÒ·ÕèáÊ´§ÍÂÙè¹Ñé¹ µèÍà¹×èͧ¡Ñ¹ÍÂÙè + ,T@RBc9K09i1R07Uh1a0Ei1G0!Q1:K09i1R06Q14d;(B ,T(P0AU1`09Wi1MKR0+i1S0!Q19M0BYh1:R':CC07Q14(B 0,T7Uh1`0;g19`0*h1909Ui1(B 0,T!g1`0>Wh1Mc0Ki1JRARC60CYi1(B +,Td04i10Gh1R(B ,T`09Wi1MKR07Uh1aJ4'M0BYh109Qi19(B 0,T5h1M`09Wh1M'0!Q19M0BYh1(B - ¡è͹Í×è¹ ¨Óà»ç¹¨ÐµéͧÃÙéÇÔ¸Õ¡ÒÃâ¡ÂéÒµÓá˹è§ä»ÁÒ ÀÒÂã¹á¿éÁ¢éÍÁÙÅàÊÕ¡è͹ µÒÁ·ÕèºÍ¡ä» -áÅéÇ ¡ç¤×Í C-v ãªéÊÓËÃѺàÅ×è͹仢éҧ˹éÒ ¶éÒ¨ÐàÅ×è͹¡ÅѺ·Õèà¡èÒ ¡çãËé¡´ ESC v + 0,T!h1M90MWh19(B ,T(S`0;g19(P05i1M'0CYi10GT108U1!RCbB!0Bi1RB5SaK09h1'd;AR(B ,T@RBc9a0?i1A0"i1M0AY1E`0JU1B0!h1M9(B ,T5RA07Uh1:M!d;(B +,Ta0Ei1G(B 0,T!g10$W1M(B C-v ,Tc0*i1JSK0CQ1:`0EWh1M9d;0"i1R'K09i1R(B 0,T6i1R(P`0EWh1M9!0EQ1:07Uh1`0!h1R(B 0,T!g1c0Ki1!4(B ESC v - >> Åͧãªé ESC v áÅÐ C-v à¾×èÍàÅ×è͹ä»ÁÒ´Ù ÊÑ¡ÊͧÊÒÁ¤ÃÑé§ + >> ,TEM'c0*i1(B ESC v ,TaEP(B C-v ,T`0>Wh1M`0EWh1M9d;AR04Y1(B 0,TJQ1!JM'JRA$0CQi1'(B -ÊÃØ» +,TJ0CX1;(B === - ¤ÓÊÑè§ ÊÓËÃѺàÅ×è͹ä»ÁÒ·ÕÅÐ˹éÒÀÒÂã¹á¿éÁ¢éÍÁÙÅ ¤×Í + ,T$S0JQh1'(B ,TJSK0CQ1:`0EWh1M9d;AR07U1EPK09i1R@RBc9a0?i1A0"i1M0AY1E(B 0,T$W1M(B - C-v àÅ×è͹仢éҧ˹éÒ Ë¹Öè§Ë¹éÒ¨Í - ESC v àÅ×è͹仢éÒ§ËÅѧ ˹Öè§Ë¹éÒ¨Í - C-l à¢Õ¹˹éÒ¨ÍãËÁè áÅÐã¹¢³Ðà´ÕÂǡѹ ¡çãËéàÅ×è͹µÓá˹觢ͧà¤ÍÃìà«ÍÃì (cursor) - ä»ÍÂÙèµÃ§¡ÅÒ§¨Í + C-v ,T`0EWh1M9d;0"i1R'K09i1R(B ,TK09Vh1'K09i1R(M(B + ESC v ,T`0EWh1M9d;0"i1R'K0EQ1'(B ,TK09Vh1'K09i1R(M(B + C-l ,T`0"U1B9K09i1R(McK0Ah1(B ,TaEPc9"3P`04U1BG0!Q19(B 0,T!g1c0Ki1`0EWh1M95SaK09h1'"M'`$M0Cl1`+M0Cl1(B (cursor) + ,Td;M0BYh15C'!ER'(M(B - >> ¢ÍãËéÊѧࡵ´ÙÇèÒ ã¹¢³Ð¹Õéà¤ÍÃìà«ÍÃìÍÂÙè·Õèä˹ ¾ÃéÍÁ·Ñ駨ӢéͤÇÒÁ·ÕèÍÂÙèÃͺ¢éÒ§¢Í§ - à¤ÍÃìà«ÍÃì´éÇ áÅéÇÅͧ¡´ C-l ´Ù µÃǨÊͺ´ÙÇèÒ à¤ÍÃìà«ÍÃìàÅ×è͹ä»ÍÂÙè·Õèä˹ - ¢éͤÇÒÁ·ÕèÍÂÙèÃͺ¢éÒ§à»ÅÕè¹ä»ÍÂèÒ§äà + >> ,T"Mc0Ki10JQ1'`!504Y10Gh1R(B ,Tc9"3P09Ui1`$M0Cl1`+M0Cl1M0BYh107Uh1dK9(B ,T>0Ci1MA07Qi1'(S0"i1M$GRA07Uh1M0BYh1CM:0"i1R'"M'(B + ,T`$M0Cl1`+M0Cl104i1GB(B ,Ta0Ei1GEM'!4(B C-l 0,T4Y1(B ,T5CG(JM:04Y10Gh1R(B ,T`$M0Cl1`+M0Cl1`0EWh1M9d;M0BYh107Uh1dK9(B + 0,T"i1M$GRA07Uh1M0BYh1CM:0"i1R'`;0EUh1B9d;M0Bh1R'dC(B -ÇÔ¸Õâ¡ÂéÒÂà¤ÍÃìà«ÍÃì¢Ñé¹¾×é¹°Ò¹ +0,TGT108U1bB!0Bi1RB`$M0Cl1`+M0Cl10"Qi190>Wi190R9(B ======================= - µÍ¹¹Õé àÃÒ¡çÃÙéÇÔ¸Õâ¡ÂéÒÂä»ÁÒẺ·ÕÅÐ˹éÒáÅéÇ µèÍä» ¡çÁÒàÃÕ¹ÃÙéÇÔ¸Õâ¡ÂéÒÂä»·ÕèµÓá˹è§ã´ -µÓá˹è§Ë¹Öè§ÀÒÂã¹Ë¹éÒà´ÕÂǡѹ «Öè§ÊÒÁÒö·Óä´éËÅÒÂÇÔ¸Õ ÇÔ¸Õ˹Ö觡ç¤×ÍãËéãªé¤ÓÊÑè§ ä»ºÃ÷Ѵ¡è͹˹éÒ -(previous) 仺Ã÷ѴµèÍä» (next) ä»´éҹ˹éÒ (forward) ä»´éÒ¹ËÅѧ (backward) ¤ÓÊÑè§ -àËÅèÒ¹Õé ¶Ù¡µÑé§äÇé·Õè C-p C-n C-f áÅÐ C-b µÒÁÅӴѺ «Ö觨зÓãËéâ¡ÂéÒÂä»ÁÒä´é â´Âà·Õº¡Ñº -µÓá˹觻Ѩ¨ØºÑ¹ ÊÃØ»à¢Õ¹à»ç¹á¼¹ÀÒ¾ä´é´Ñ§¹Õé + ,T5M909Ui1(B ,T`CR0!g10CYi10GT108U1bB!0Bi1RBd;ARa::07U1EPK09i1Ra0Ei1G(B 0,T5h1Md;(B 0,T!g1AR`0CU1B90CYi10GT108U1bB!0Bi1RBd;07Uh15SaK09h1'c4(B +,T5SaK09h1'K09Vh1'@RBc9K09i1R`04U1BG0!Q19(B 0,T+Vh1'JRARC67Sd04i1KERB0GT108U1(B 0,TGT108U1K09Vh1'0!g10$W1Mc0Ki1c0*i1$S0JQh1'(B ,Td;:CC07Q140!h1M9K09i1R(B +(previous) ,Td;:CC07Q1405h1Md;(B (next) ,Td;04i1R9K09i1R(B (forward) ,Td;04i1R9K0EQ1'(B (backward) ,T$S0JQh1'(B +,T`K0Eh1R09Ui1(B 0,T6Y1!05Qi1'd0Gi107Uh1(B C-p C-n C-f ,TaEP(B C-b ,T5RAES04Q1:(B 0,T+Vh1'(P7Sc0Ki1bB!0Bi1RBd;ARd04i1(B ,Tb4B`07U1B:0!Q1:(B +,T5SaK09h1'0;Q1(0(X10:Q19(B ,TJ0CX1;`0"U1B9`0;g19a<9@R>d04i104Q1'09Ui1(B - ºÃ÷Ѵ·ÕèáÅéÇ C-p + ,T:CC07Q1407Uh1a0Ei1G(B C-p : : - µÑÇÍÑ¡ÉôéÒ¹ËÅѧ C-b .... µÓá˹è§à¤ÍÃìà«ÍÃì»Ñ¨¨ØºÑ¹ .... µÑÇÍÑ¡Éôéҹ˹éÒ C-f + 0,T5Q1G0MQ1!IC04i1R9K0EQ1'(B C-b .... ,T5SaK09h1'`$M0Cl1`+M0Cl10;Q1(0(X10:Q19(B .... 0,T5Q1G0MQ1!IC04i1R9K09i1R(B C-f : : - ºÃ÷ѴµèÍä» C-n + ,T:CC07Q1405h1Md;(B C-n - ¤ÓÊÑè§àËÅèÒ¹Õé àÍÒÁÒ¨Ò¡µÑÇÍÑ¡ÉõÑÇáá¢Í§ ¤ÓÇèÒ Previous Next Backward Forward -«Ö觨ЪèÇÂãËé¨Óä´éäÁèÂÒ¡ ¤ÓÊÑè§àËÅèÒ¹Õéà»ç¹¤ÓÊÑè§ÊÓËÃѺ¡ÒÃâ¡ÂéÒ¢Ñé¹¾×é¹°Ò¹ «Ö觵éͧãªéÍÂÙèàÊÁÍ + ,T$S0JQh1'`K0Eh1R09Ui1(B ,T`MRAR(R!05Q1G0MQ1!IC05Q1GaC!"M'(B ,T$S0Gh1R(B Previous Next Backward Forward +0,T+Vh1'(P0*h1GBc0Ki1(Sd04i1d0Ah1BR!(B ,T$S0JQh1'`K0Eh1R09Ui1`0;g19$S0JQh1'JSK0CQ1:!RCbB!0Bi1RB0"Qi190>Wi190R9(B 0,T+Vh1'05i1M'c0*i1M0BYh1`JAM(B - >> Åͧ¡´ C-n ´ÙËÅÒÂ æ ¤ÃÑé§ à¾×èÍàÅ×è͹à¤ÍÃìà«ÍÃìÁÒÂѧºÃ÷Ѵ¹Õé (ºÃ÷Ѵ·Õè¡ÓÅѧÍèÒ¹ - ÍÂÙè¹Õé) + >> ,TEM'!4(B C-n 0,T4Y1KERB(B ,Tf(B ,T$0CQi1'(B ,T`0>Wh1M`0EWh1M9`$M0Cl1`+M0Cl1AR0BQ1':CC07Q1409Ui1(B (,T:CC07Q1407Uh1!S0EQ1'0Mh1R9(B + ,TM0BYh109Ui1(B) - >> Åͧ¡´ C-f ´ÙËÅÒÂ æ ¤ÃÑé§ à¾×èÍàÅ×è͹à¤ÍÃìà«ÍÃìä»ÂѧµÃ§¡ÅÒ§¢Í§ºÃ÷Ѵ áÅéÇÅͧ - ¡´ C-p àÅ×è͹¢Öé¹¢éÒ§º¹´Ù Êѧࡵ´Ù´éÇÂÇèÒ µÓá˹觢ͧà¤ÍÃìà«ÍÃìà»ÅÕè¹ä»ÍÂèÒ§äà + >> ,TEM'!4(B C-f 0,T4Y1KERB(B ,Tf(B ,T$0CQi1'(B ,T`0>Wh1M`0EWh1M9`$M0Cl1`+M0Cl1d;0BQ1'5C'!ER'"M':CC07Q14(B ,Ta0Ei1GEM'(B + ,T!4(B C-p ,T`0EWh1M90"Vi190"i1R':904Y1(B 0,TJQ1'`!504Y104i1GB0Gh1R(B ,T5SaK09h1'"M'`$M0Cl1`+M0Cl1`;0EUh1B9d;M0Bh1R'dC(B - >> Åͧ¡´ C-b ¢³Ð·ÕèÍÂÙè·ÕèµÓá˹è§Ë¹éÒÊØ´¢Í§ºÃ÷Ѵ´Ù Êѧࡵ´Ù´éÇÂÇèÒ à¤ÍÃìà«ÍÃìà¤Å×è͹ - ä»ÍÂèÒ§äà ¨Ò¡¹Ñé¹ãËé¡´ C-b ÍÕ¡ÊͧÊÒÁ¤ÃÑé§ áÅéÇ¡´ C-f à¾×èÍàÅ×è͹ä»Âѧ·éÒÂÊØ´ - ¢Í§ºÃ÷Ѵ´Ù à¤ÍÃìà«ÍÃì¨Ðà»ç¹ÍÂèÒ§äà ¶éÒ¡´¨¹àÅ·éÒºÃÃ·Ñ´ä» + >> ,TEM'!4(B C-b ,T"3P07Uh1M0BYh107Uh15SaK09h1'K09i1R0JX14"M':CC07Q1404Y1(B 0,TJQ1'`!504Y104i1GB0Gh1R(B ,T`$M0Cl1`+M0Cl1`$0EWh1M9(B + ,Td;M0Bh1R'dC(B ,T(R!09Qi19c0Ki1!4(B C-b 0,TMU1!JM'JRA$0CQi1'(B ,Ta0Ei1G!4(B C-f ,T`0>Wh1M`0EWh1M9d;0BQ1'07i1RB0JX14(B + ,T"M':CC07Q1404Y1(B ,T`$M0Cl1`+M0Cl1(P`0;g19M0Bh1R'dC(B 0,T6i1R!4(9`EB07i1RB:CC07Q14d;(B - àÇÅÒ·ÕèàÅ×è͹à¤ÍÃìà«ÍÃì ¨¹àźÃ÷ѴááÊØ´ËÃ×ͺÃ÷Ѵ·éÒÂÊØ´¢Í§Ë¹éÒä» à¤ÍÃìà«ÍÃì¨Ð -àÅ×è͹ä»ÂѧºÃ÷ѴµèÍä»ã¹·ÔÈ·Ò§¹Ñé¹ æ áÅлÃѺãËéà¤ÍÃìà«ÍÃì¡ÅѺÁÒÍÂÙ躹˹éÒ¨ÍàÊÁÍ + ,T`GER07Uh1`0EWh1M9`$M0Cl1`+M0Cl1(B ,T(9`EB:CC07Q14aC!0JX14K0CW1M:CC07Q1407i1RB0JX14"M'K09i1Rd;(B ,T`$M0Cl1`+M0Cl1(P(B +,T`0EWh1M9d;0BQ1':CC07Q1405h1Md;c907T1H7R'09Qi19(B ,Tf(B ,TaEP;0CQ1:c0Ki1`$M0Cl1`+M0Cl1!0EQ1:ARM0BYh1:9K09i1R(M`JAM(B - >> Åͧ¡´ C-n à¾×èÍàÅ×è͹à¤ÍÃìà«ÍÃìãËéàźÃ÷ѴÅèÒ§ÊØ´¢Í§Ë¹éҨʹ٠áÅéÇÊѧࡵ´ÙÇèÒ - à¡Ô´ÍÐäâÖé¹ áÅеÓá˹觢ͧà¤ÍÃìà«ÍÃìà»ÅÕè¹ä»ÍÂèÒ§äà + >> ,TEM'!4(B C-n ,T`0>Wh1M`0EWh1M9`$M0Cl1`+M0Cl1c0Ki1`EB:CC07Q140Eh1R'0JX14"M'K09i1R(M04Y1(B ,Ta0Ei1G0JQ1'`!504Y10Gh1R(B + ,T`0!T14MPdC0"Vi19(B ,TaEP5SaK09h1'"M'`$M0Cl1`+M0Cl1`;0EUh1B9d;M0Bh1R'dC(B - ¶éÒÃÙéÊÖ¡ÇèÒ¡ÒâÂѺ价ÕÅеÑÇÍÑ¡ÉùÑé¹Í×´ÍÒ´Â×´ÂÒ´ ¡çÊÒÁÒöãªé¡ÒÃàÅ×è͹à¤ÍÃìà«ÍÃìä»·ÕÅÐ¤Ó -ä´é ¡´ ESC f à¾×èÍãËéàÅ×è͹仢éҧ˹éÒ˹Öè§¤Ó áÅÐ ESC b à¾×èÍãËéàÅ×è͹仢éÒ§ËÅѧ˹Öè§¤Ó + 0,T6i1R0CYi10JV1!0Gh1R!RC"0BQ1:d;07U1EP05Q1G0MQ1!IC09Qi190MW14MR40BW14BR4(B 0,T!g1JRARC6c0*i1!RC`0EWh1M9`$M0Cl1`+M0Cl1d;07U1EP$S(B +,Td04i1(B ,T!4(B ESC f ,T`0>Wh1Mc0Ki1`0EWh1M9d;0"i1R'K09i1RK09Vh1'$S(B ,TaEP(B ESC b ,T`0>Wh1Mc0Ki1`0EWh1M9d;0"i1R'K0EQ1'K09Vh1'$S(B -ËÁÒÂà˵Ø: ÊÓËÃѺÀÒÉÒä·Â ÂѧäÁèÊÒÁÒöáºè§á¡µÓá˹觢ͧ¤Óä´é¶Ù¡µéͧ ¨Ö§äÁè - ÊÒÁÒöãªéÊͧ¤ÓÊÑ觹Õéä´é +,TKARB`K05X1(B: ,TJSK0CQ1:@RIRd7B(B 0,TBQ1'd0Ah1JRARC6a0:h1'aB!5SaK09h1'"M'$Sd04i106Y1!05i1M'(B 0,T(V1'd0Ah1(B + ,TJRARC6c0*i1JM'$S0JQh1'09Ui1d04i1(B - >> Åͧ¡´ ESC f áÅÐ ESC b Åͧ´ÙËÅÒÂ æ ¤ÃÑé§ áÅÐÅͧãªéÃèÇÁ¡Ñº C-f ¡Ñº C-b ´Ù - ´éÇ + >> ,TEM'!4(B ESC f ,TaEP(B ESC b ,TEM'04Y1KERB(B ,Tf(B ,T$0CQi1'(B ,TaEPEM'c0*i10Ch1GA0!Q1:(B C-f 0,T!Q1:(B C-b 0,T4Y1(B + 0,T4i1GB(B - ¨ÐÊѧࡵàËç¹ä´éÇèÒ ESC f áÅÐ ESC b ÁÕÃٻẺ¤ÅéÒ¤ÅÖ§¡Ñº C-f áÅÐ C-b â´ÂÊèǹãË­è -ESC <µÑÇÍÑ¡ÉÃ> ¨Ðãªéà¡ÕèÂǡѺ¡ÒèѴ¡ÒâéͤÇÒÁ Êèǹ C-<µÑÇÍÑ¡ÉÃ> ¨Ðãªé¡ÑºÊÔ觷Õèà»ç¹¾×é¹°Ò¹ÁÒ¡ -¡ÇèÒ (àªè¹ µÑÇÍÑ¡Éà ËÃ×Í ºÃ÷Ѵ) + ,T(P0JQ1'`!5`0Kg19d04i10Gh1R(B ESC f ,TaEP(B ESC b 0,TAU10CY1;a::$0Ei1RB$0EV1'0!Q1:(B C-f ,TaEP(B C-b ,Tb4B0Jh1G9cK0-h1(B +ESC <0,T5Q1G0MQ1!IC(B> ,T(Pc0*i1`0!Uh1BG0!Q1:!RC0(Q14!RC0"i1M$GRA(B 0,TJh1G9(B C-<0,T5Q1G0MQ1!IC(B> ,T(Pc0*i10!Q1:0JTh1'07Uh1`0;g190>Wi190R9AR!(B +,T!0Gh1R(B (,T`0*h19(B 0,T5Q1G0MQ1!IC(B ,TK0CW1M(B ,T:CC07Q14(B) - C-a ¡Ñº C-e à»ç¹¤ÓÊÑ觹èÒ¨ÐÃÙéäÇé à¾ÃÒФè͹¢éÒ§Êдǡ´Õ·Õà´ÕÂÇ C-a ãªéÊÓËÃѺàÅ×è͹ -à¤ÍÃìà«ÍÃìä»·ÕèµÓá˹è§Ë¹éÒÊØ´¢Í§ºÃ÷Ѵ C-e ÊÓËÃѺàÅ×è͹价ÕèµÓá˹觷éÒÂÊØ´¢Í§ºÃ÷Ѵ + C-a 0,T!Q1:(B C-e ,T`0;g19$S0JQh1'09h1R(P0CYi1d0Gi1(B ,T`>CRP0$h1M90"i1R'JP4G!04U107U1`04U1BG(B C-a ,Tc0*i1JSK0CQ1:`0EWh1M9(B +,T`$M0Cl1`+M0Cl1d;07Uh15SaK09h1'K09i1R0JX14"M':CC07Q14(B C-e ,TJSK0CQ1:`0EWh1M9d;07Uh15SaK09h1'07i1RB0JX14"M':CC07Q14(B - >> Åͧ¡´ C-a ´ÙÊͧ¤ÃÑé§ ËÅѧ¨Ò¡¹Ñé¹ãËé¡´ C-e ´ÙÊͧ¤ÃÑé§ áÅéÇÅͧÊѧࡵ´ÙÇèÒ ¡Òà - ¡´¤ÓÊÑ觹ÕéÁÒ¡¡ÇèÒÊͧ¤ÃÑé§ ¨ÐäÁèªèÇÂãËéàÅ×è͹à¤ÍÃìà«ÍÃìä»ä˹ä´éÁÒ¡¡ÇèÒ¹Ñé¹ÍÕ¡ + >> ,TEM'!4(B C-a 0,T4Y1JM'$0CQi1'(B ,TK0EQ1'(R!09Qi19c0Ki1!4(B C-e 0,T4Y1JM'$0CQi1'(B ,Ta0Ei1GEM'0JQ1'`!504Y10Gh1R(B ,T!RC(B + ,T!4$S0JQh1'09Ui1AR!!0Gh1RJM'$0CQi1'(B ,T(Pd0Ah10*h1GBc0Ki1`0EWh1M9`$M0Cl1`+M0Cl1d;dK9d04i1AR!!0Gh1R09Qi190MU1!(B - ÂѧÁÕÍÕ¡Êͧ¤ÓÊÑè§ ÊÓËÃѺ¡ÒÃàÅ×è͹à¤ÍÃìà«ÍÃìẺ§èÒÂ æ ¤×Í ¤ÓÊÑè§ ESC < ÊÓËÃѺ¡ÒÃàÅ×è͹ -à¤ÍÃìà«ÍÃìä»·ÕèµÓá˹è§ááÊØ´¢Í§á¿éÁ¢éÍÁÙÅ áÅФÓÊÑè§ ESC > ÊÓËÃѺ¡ÒÃàÅ×è͹仵Óá˹觷éÒÂÊØ´ + 0,TBQ1'0AU10MU1!JM'$S0JQh1'(B ,TJSK0CQ1:!RC`0EWh1M9`$M0Cl1`+M0Cl1a::0'h1RB(B ,Tf(B 0,T$W1M(B ,T$S0JQh1'(B ESC < ,TJSK0CQ1:!RC`0EWh1M9(B +,T`$M0Cl1`+M0Cl1d;07Uh15SaK09h1'aC!0JX14"M'a0?i1A0"i1M0AY1E(B ,TaEP$S0JQh1'(B ESC > ,TJSK0CQ1:!RC`0EWh1M9d;5SaK09h1'07i1RB0JX14(B - àÃÒàÃÕ¡µÓá˹觢ͧ¢éͤÇÒÁ ·ÕèÁÕà¤ÍÃìà«ÍÃìÍÂÙèÇèÒ "¨Ø´ (point)" ËÃ×;ٴÍÕ¡ÍÂèҧ˹Öè§ä´é -ÇèÒ à¤ÍÃìà«ÍÃì à»ç¹ÊÔ觷ÕèºÍ¡ãËéàÃÒÃÙéÇèÒ ¨Ø´ ÍÂÙèµÃ§ä˹¢Í§Ë¹éÒ¨Í + ,T`CR`0CU1B!5SaK09h1'"M'0"i1M$GRA(B 0,T7Uh10AU1`$M0Cl1`+M0Cl1M0BYh10Gh1R(B "0,T(X14(B (point)" ,TK0CW1M0>Y140MU1!M0Bh1R'K09Vh1'd04i1(B +0,TGh1R(B ,T`$M0Cl1`+M0Cl1(B ,T`0;g190JTh1'07Uh1:M!c0Ki1`CR0CYi10Gh1R(B 0,T(X14(B ,TM0BYh15C'dK9"M'K09i1R(M(B - ÊÃØ»¤ÓÊÑè§ÊÓËÃѺ¡ÒÃà¤Å×è͹ä»ÁÒ «Öè§ÃÇÁ¡ÒÃà¤Å×è͹·Õèã¹Ë¹èÇ¢ͧ¤Ó ˹èÇ¢ͧºÃ÷ѴäÇé´éÇ -ä´é´Ñ§¹Õé + ,TJ0CX1;$S0JQh1'JSK0CQ1:!RC`$0EWh1M9d;AR(B 0,T+Vh1'CGA!RC`$0EWh1M907Uh1c9K09h1GB"M'$S(B ,TK09h1GB"M':CC07Q14d0Gi104i1GB(B +,Td04i104Q1'09Ui1(B - C-f 仢éҧ˹éÒ˹Ö觵ÑÇÍÑ¡Éà - C-b ¡ÅѺ¢éÒ§ËÅѧ˹Ö觵ÑÇÍÑ¡Éà + C-f ,Td;0"i1R'K09i1RK09Vh1'05Q1G0MQ1!IC(B + C-b ,T!0EQ1:0"i1R'K0EQ1'K09Vh1'05Q1G0MQ1!IC(B - ESC f 仢éҧ˹éÒ˹Öè§¤Ó - ESC b ¡ÅѺ¢éÒ§ËÅѧ˹Öè§¤Ó + ESC f ,Td;0"i1R'K09i1RK09Vh1'$S(B + ESC b ,T!0EQ1:0"i1R'K0EQ1'K09Vh1'$S(B - C-n àÅ×è͹仺Ã÷ѴµèÍä» - C-p àÅ×è͹仺Ã÷Ѵ·ÕèáÅéÇ + C-n ,T`0EWh1M9d;:CC07Q1405h1Md;(B + C-p ,T`0EWh1M9d;:CC07Q1407Uh1a0Ei1G(B - ESC ] àÅ×è͹仵Óá˹觷éÒÂÊØ´¢Í§ÂèÍ˹éÒ (paragraph) - ESC [ àÅ×è͹仵Óá˹è§ááÊØ´¢Í§ÂèÍ˹éÒ + ESC ] ,T`0EWh1M9d;5SaK09h1'07i1RB0JX14"M'0Bh1MK09i1R(B (paragraph) + ESC [ ,T`0EWh1M9d;5SaK09h1'aC!0JX14"M'0Bh1MK09i1R(B - C-a àÅ×è͹仵Óá˹è§ááÊØ´¢Í§ºÃ÷Ѵ - C-e àÅ×è͹仵Óá˹觷éÒÂÊØ´¢Í§ºÃ÷Ѵ + C-a ,T`0EWh1M9d;5SaK09h1'aC!0JX14"M':CC07Q14(B + C-e ,T`0EWh1M9d;5SaK09h1'07i1RB0JX14"M':CC07Q14(B - ESC < àÅ×è͹仵Óá˹è§ááÊØ´¢Í§á¿éÁ¢éÍÁÙÅ - ESC > àÅ×è͹仵Óá˹觷éÒÂÊØ´¢Í§á¿éÁ¢éÍÁÙÅ + ESC < ,T`0EWh1M9d;5SaK09h1'aC!0JX14"M'a0?i1A0"i1M0AY1E(B + ESC > ,T`0EWh1M9d;5SaK09h1'07i1RB0JX14"M'a0?i1A0"i1M0AY1E(B - >> Åͧãªé¤ÓÊÑè§áµèÅФÓÊÑ觴٠¤ÓÊÑè§àËÅèÒ¹Õéà»ç¹¤ÓÊÑ觷Õèãªé¡Ñ¹ºèÍÂÊØ´ ¤ÓÊÑè§Êͧ¤ÓÊÑè§ËÅѧ - ¨ÐàÅ×è͹à¤ÍÃìà«ÍÃì ä»Âѧ·Õè·Õè¤è͹¢éÒ§ä¡Å ãËéÅͧãªé¤ÓÊÑè§ C-v áÅÐ ESC v à¾×èÍ - àÅ×è͹à¤ÍÃìà«ÍÃì¡ÅѺÁÒ·ÕèµÃ§¹Õé + >> ,TEM'c0*i1$S0JQh1'a05h1EP$S0JQh1'04Y1(B ,T$S0JQh1'`K0Eh1R09Ui1`0;g19$S0JQh1'07Uh1c0*i10!Q190:h1MB0JX14(B ,T$S0JQh1'JM'$S0JQh1'K0EQ1'(B + ,T(P`0EWh1M9`$M0Cl1`+M0Cl1(B ,Td;0BQ1'07Uh107Uh10$h1M90"i1R'd!E(B ,Tc0Ki1EM'c0*i1$S0JQh1'(B C-v ,TaEP(B ESC v ,T`0>Wh1M(B + ,T`0EWh1M9`$M0Cl1`+M0Cl1!0EQ1:AR07Uh15C'09Ui1(B - ÊÓËÃѺ¤ÓÊÑè§Í×è¹ æ ¢Í§ Emacs ¡çàªè¹¡Ñ¹ ¤ÓÊÑè§àËÅèÒ¹Õé¨ÐÊÒÁÒöà¾ÔèÁµÑÇàÅ×Í¡ (argument) -à¾×èÍ¡Ó˹´ ¨Ó¹Ç¹¤ÃÑé§ ã¹¡Òû¯ÔºÑµÔ§Ò¹ä´é ¡ÒáÓ˹´¨Ó¹Ç¹¤ÃÑé§ ·Óä´éâ´Â¡´ C-u áÅéǵÒÁ -´éǨӹǹ¤ÃÑ駷Õèµéͧ¡Òáè͹ áÅéǨ֧¤èÍ¡´¤ÓÊÑ觵ÒÁ + ,TJSK0CQ1:$S0JQh1'0MWh19(B ,Tf(B ,T"M'(B Emacs 0,T!g1`0*h190!Q19(B ,T$S0JQh1'`K0Eh1R09Ui1(PJRARC6`0>Th1A05Q1G`0EW1M!(B (argument) +,T`0>Wh1M!SK94(B ,T(S9G9$0CQi1'(B ,Tc9!RC;0/T10:Q105T1'R9d04i1(B ,T!RC!SK94(S9G9$0CQi1'(B ,T7Sd04i1b4B!4(B C-u ,Ta0Ei1G5RA(B +0,T4i1GB(S9G9$0CQi1'07Uh105i1M'!RC0!h1M9(B ,Ta0Ei1G0(V1'0$h1MB!4$S0JQh1'5RA(B - µÑÇÍÂèÒ§àªè¹ ¤ÓÊÑè§ C-u 8 C-f ËÁÒ¶֧ ãËéàÅ×è͹仢éҧ˹éÒ 8 µÑÇÍÑ¡Éà + 0,T5Q1GM0Bh1R'`0*h19(B ,T$S0JQh1'(B C-u 8 C-f ,TKARB06V1'(B ,Tc0Ki1`0EWh1M9d;0"i1R'K09i1R(B 8 0,T5Q1G0MQ1!IC(B - >> ãËéÅͧ¡Ó˹´¨Ó¹Ç¹¤ÃÑ駷ÕèàËÁÒÐÊÁÊÓËÃѺ¤ÓÊÑè§ C-n ËÃ×Í C-p à¾×èÍàÅ×è͹à¤ÍÃìà«ÍÃì - ãËéÁÒÍÂÙèã¡ÅéºÃ÷Ѵ¹ÕéãËéÁÒ¡·ÕèÊØ´à·èÒ·Õè¨Ð·Óä´é 㹡ÒÃàÅ×è͹à¤ÍÃìà«ÍÃì¤ÃÑé§à´ÕÂÇ + >> ,Tc0Ki1EM'!SK94(S9G9$0CQi1'07Uh1`KARPJAJSK0CQ1:$S0JQh1'(B C-n ,TK0CW1M(B C-p ,T`0>Wh1M`0EWh1M9`$M0Cl1`+M0Cl1(B + ,Tc0Ki1ARM0BYh1c!0Ei1:CC07Q1409Ui1c0Ki1AR!07Uh10JX14`07h1R07Uh1(P7Sd04i1(B ,Tc9!RC`0EWh1M9`$M0Cl1`+M0Cl1$0CQi1'`04U1BG(B - ÊÓËÃѺ C-v áÅÐ ESC v ¨Ðä´é¼ÅᵡµèÒ§ä»ÊÑ¡àÅ硹éÍ 㹡óչÕé ¨Ðà»ç¹¡ÒÃàÅ×è͹˹éÒ¨Í -¢Öé¹Å§ µÒÁ¨Ó¹Ç¹ºÃ÷Ѵ᷹ + ,TJSK0CQ1:(B C-v ,TaEP(B ESC v ,T(Pd04i1> Åͧ¡´ C-u 3 C-v ´Ù + >> ,TEM'!4(B C-u 3 C-v 0,T4Y1(B - àÅ×è͹¡ÅѺ·Õèà¡èÒä´éâ´Â C-u 3 ESC v + ,T`0EWh1M9!0EQ1:07Uh1`0!h1Rd04i1b4B(B C-u 3 ESC v -¤ÓÊÑè§Â¡àÅÔ¡ +,T$S0JQh1'B!`0ET1!(B ========= - ¤ÓÊÑè§ C-g ãªéÊÓËÃѺÊÑè§Â¡àÅÔ¡¤ÓÊÑ觵èÒ§ æ ·Õèµéͧ¡ÒáÒûé͹¢éÍÁÙÅà¾ÔèÁàµÔÁ µÑÇÍÂèÒ§àªè¹ -ÃÐËÇèÒ§·ÕèãÊèµÑÇàÅ×Í¡ (argument) ÍÂÙè ËÃ×ÍÃÐËÇèÒ§¤ÓÊÑ觷Õèµéͧ¡Òá´»ØèÁÁÒ¡¡ÇèÒ 2 »ØèÁ¢Öé¹ä» ¶éÒ -ËÒ¡µéͧ¡ÒáàÅÔ¡ ¡çãËé¡´ C-g + ,T$S0JQh1'(B C-g ,Tc0*i1JSK0CQ1:0JQh1'B!`0ET1!$S0JQh1'05h1R'(B ,Tf(B 0,T7Uh105i1M'!RC!RC0;i1M90"i1M0AY1E`0>Th1A`05T1A(B 0,T5Q1GM0Bh1R'`0*h19(B +,TCPK0Gh1R'07Uh1c0Jh105Q1G`0EW1M!(B (argument) ,TM0BYh1(B ,TK0CW1MCPK0Gh1R'$S0JQh1'07Uh105i1M'!RC!40;Xh1AAR!!0Gh1R(B 2 0,T;Xh1A0"Vi19d;(B 0,T6i1R(B +,TKR!05i1M'!RCB!`0ET1!(B 0,T!g1c0Ki1!4(B C-g - >> Åͧ¡Ó˹´¨Ó¹Ç¹¤ÃÑé§ãËéà»ç¹ 100 â´Â¡Òá´ C-u 100 áÅéÇ¡´ C-g ´Ù ËÅѧ¨Ò¡¹Ñé¹ - ãËéÅͧ¡´ C-f ´Ù áÅéÇÊѧࡵ´ÙÇèÒà¤ÍÃìà«ÍÃìàÅ×è͹仡ÕèµÑÇÍÑ¡Éà ËÃ×͵͹·Õè¾ÅҴ仡´ - ESC â´ÂäÁèµÑé§ã¨ ¡çÊÒÁÒö¡´ C-g ¡àÅÔ¡ä´é + >> ,TEM'!SK94(S9G9$0CQi1'c0Ki1`0;g19(B 100 ,Tb4B!RC!4(B C-u 100 ,Ta0Ei1G!4(B C-g 0,T4Y1(B ,TK0EQ1'(R!09Qi19(B + ,Tc0Ki1EM'!4(B C-f 0,T4Y1(B ,Ta0Ei1G0JQ1'`!504Y10Gh1R`$M0Cl1`+M0Cl1`0EWh1M9d;0!Uh105Q1G0MQ1!IC(B ,TK0CW1M5M907Uh1>ER4d;!4(B + ESC ,Tb4Bd0Ah105Qi1'c((B 0,T!g1JRARC6!4(B C-g ,TB!`0ET1!d04i1(B -¢éͼԴ¾ÅÒ´ (Error) +0,T"i1M0ER4(B (Error) ================ - 㹺ҧ¤ÃÑé§ ÍÒ¨¨ÐÁÕ¡ÒÃÊÑ觻¯ÔºÑµÔ§Ò¹ºÒ§ÍÂèÒ§ ·Õè Emacs ÂÍÁÃѺäÁèä´éà¡Ô´¢Öé¹ µÑÇÍÂèÒ§àªè¹ -¡Òá´¤ÓÊÑ觤͹â·Ãźҧ¤ÓÊÑè§ ·ÕèäÁèä´é¡Ó˹´äÇéã¹ Emacs ¡ç¨Ð·ÓãËé Emacs Êè§àÊÕ§àµ×͹ -áÅÐáÊ´§¼Å·ÕèºÃ÷ѴÅèÒ§ÊØ´¢Í§¨Í ºÍ¡ÇèÒ¼Ô´¾ÅÒ´ÍÂèÒ§äà + ,Tc9:R'$0CQi1'(B ,TMR((P0AU1!RC0JQh1';0/T10:Q105T1'R9:R'M0Bh1R'(B 0,T7Uh1(B Emacs ,TBMA0CQ1:d0Ah1d04i1`0!T140"Vi19(B 0,T5Q1GM0Bh1R'`0*h19(B +,T!RC!4$S0JQh1'$M9b7CE:R'$S0JQh1'(B 0,T7Uh1d0Ah1d04i1!SK94d0Gi1c9(B Emacs 0,T!g1(P7Sc0Ki1(B Emacs 0,TJh1'`0JU1B'`05W1M9(B +,TaEPaJ4'ER4M0Bh1R'dC(B - ¤ÓÊÑ觺ҧ¤ÓÊÑ觷Õèà¢Õ¹äÇéã¹àÍ¡ÊÒéºÑº¹Õé ÍÒ¨ãªéäÁèä´é¡Ñº Emacs ºÒ§ÃØè¹ (version) «Ö觨Р-·ÓãËéÁÕ¡ÒÃáÊ´§¼Å¢éͼԴ¾ÅÒ´ (error) ¢Öé¹ ã¹¡Ã³Õ¹Õé ¢ÍãËé¡´»ØèÁÍÐäáçä´é à¾×èÍàÅ×è͹ä»ÂѧÊèǹ -µèÍä» + ,T$S0JQh1':R'$S0JQh1'07Uh1`0"U1B9d0Gi1c9`M!JRC)0:Q1:09Ui1(B ,TMR(c0*i1d0Ah1d04i10!Q1:(B Emacs ,T:R'0CXh19(B (version) 0,T+Vh1'(P(B +,T7Sc0Ki10AU1!RCaJ4'ER4(B (error) 0,T"Vi19(B ,Tc9!C03U109Ui1(B ,T"Mc0Ki1!40;Xh1AMPdC0!g1d04i1(B ,T`0>Wh1M`0EWh1M9d;0BQ1'0Jh1G9(B +0,T5h1Md;(B -ÇÔ¹â´Çì (Window) +0,TGT19b40Gl1(B (Window) ============== - Emacs ÊÒÁÒöà»Ô´ÇÔ¹â´Çìä´é¾ÃéÍÁ¡Ñ¹ËÅÒÂÇÔ¹â´Çì áÅÐãªéÇÔ¹â´ÇìàËÅèÒ¹Ñé¹áÊ´§¼Å¢éͤÇÒÁ -µèÒ§ æ µÒÁµéͧ¡ÒÃä´é ¡è͹Í×è¹ ¡ç¤ÇèзӤÇÒÁÃÙé¨Ñ¡¡Ñº¤ÓÊÑè§ ·ÕèãªéÊÓËÃѺ¡ÒÃźÇÔ¹â´ÇìÊèǹà¡Ô¹ -ã¹àÇÅÒ·ÕèáÊ´§¼ÅÅѾ¸ì¢Í§¤ÓÊÑ觺ҧ¤ÓÊÑè§ ËÃ×Í Help ÍÍ¡àÊÕ¡è͹ + Emacs ,TJRARC6`0;T140GT19b40Gl1d04i1>0Ci1MA0!Q19KERB0GT19b40Gl1(B ,TaEPc0*i10GT19b40Gl1`K0Eh1R09Qi19aJ4'08l1"M'$S0JQh1':R'$S0JQh1'(B ,TK0CW1M(B Help ,TMM!`0JU1B0!h1M9(B - C-x 1 ·ÓãËéà»ç¹ÇÔ¹â´Çìà´ÕÂÇ + C-x 1 ,T7Sc0Ki1`0;g190GT19b40Gl1`04U1BG(B - ¤ÓÊÑè§ C-x 1 ãªéÊÓËÃѺźÇÔ¹â´ÇìÍ×è¹ áÅéÇ¢ÂÒÂÇÔ¹â´Çì·ÕèÁÕà¤ÍÃìà«ÍÃìÍÂÙè ãËéàµçÁ¨Íà»ç¹ -ÇÔ¹â´Çìà´ÕÂÇ + ,T$S0JQh1'(B C-x 1 ,Tc0*i1JSK0CQ1:E:0GT19b40Gl10MWh19(B ,Ta0Ei1G"BRB0GT19b40Gl107Uh10AU1`$M0Cl1`+M0Cl1M0BYh1(B ,Tc0Ki1`05g1A(M`0;g19(B +0,TGT19b40Gl1`04U1BG(B - >> ãËéàÅ×è͹à¤ÍÃìà«ÍÃìÁÒ·ÕèºÃ÷Ѵ¹Õé áÅéÇ¡´ C-u 0 C-l + >> ,Tc0Ki1`0EWh1M9`$M0Cl1`+M0Cl1AR07Uh1:CC07Q1409Ui1(B ,Ta0Ei1G!4(B C-u 0 C-l - >> Åͧ¡´ C-h k C-f ´Ù áÅéÇÊѧࡵ´ÙÇèÒÇÔ¹â´Çì¹Õéà»ÅÕè¹ä»ÍÂèÒ§äà àÁ×èÍÁÕÇÔ¹â´ÇìãËÁè«Öè§ - ͸ԺÒÂÇÔ¸Õãªé¤ÓÊÑè§ C-f »ÃÒ¡¯¢Öé¹ + >> ,TEM'!4(B C-h k C-f 0,T4Y1(B ,Ta0Ei1G0JQ1'`!504Y10Gh1R0GT19b40Gl109Ui1`;0EUh1B9d;M0Bh1R'dC(B ,T`0AWh1M0AU10GT19b40Gl1cK0Ah10+Vh1'(B + ,TM08T1:RB0GT108U1c0*i1$S0JQh1'(B C-f ,T;CR!/0"Vi19(B - >> Åͧ¡´ C-x 1 à¾×èÍźÇÔ¹â´Çì·Õèâ¼Åè¢Öé¹ÁÒãËÁè ÍÍ¡ + >> ,TEM'!4(B C-x 1 ,T`0>Wh1ME:0GT19b40Gl107Uh1b<0Eh10"Vi19ARcK0Ah1(B ,TMM!(B -¡ÒÃá·Ã¡ (insert) áÅÐ ¡ÒÃź (delete) +,T!RCa7C!(B (insert) ,TaEP(B ,T!RCE:(B (delete) =================================== - º¹ Emacs àÃÒ¨ÐÊÒÁÒö¾ÔÁ¾ìµÑÇÍÑ¡ÉÃà¢éÒä»ä´éàÅ àÁ×è͵éͧ¡ÒþÔÁ¾ì¢éͤÇÒÁ Emacs ¨Ð -¶×ÍÇèÒµÑÇ˹ѧÊ×Í·ÕèÁͧàËç¹ä´é·Ø¡µÑÇ (àªè¹ 'A' '7' '*' '¡' áÅÐÍ×è¹ æ) à»ç¹¢éͤÇÒÁ·Õèµéͧ¡ÒèР-á·Ã¡ (insert) à¢éÒ仵ç æ àÁ×èͨШººÃ÷Ѵ ãËé¡´ à¾×èÍàµÔÁÍÑ¡ÉâÖ鹺Ã÷ѴãËÁè -(linefeed character) á·Ã¡à¢éÒä» + ,T:9(B Emacs ,T`CR(PJRARC60>T1A0>l105Q1G0MQ1!IC`0"i1Rd;d04i1`EB(B ,T`0AWh1M05i1M'!RC0>T1A0>l10"i1M$GRA(B Emacs ,T(P(B +0,T6W1M0Gh1R05Q1GK09Q1'0JW1M07Uh1AM'`0Kg19d04i107X1!05Q1G(B (,T`0*h19(B 'A' '7' '*' ',T!(B' ,TaEP0MWh19(B ,Tf(B) ,T`0;g190"i1M$GRA07Uh105i1M'!RC(P(B +,Ta7C!(B (insert) ,T`0"i1Rd;5C'(B ,Tf(B ,T`0AWh1M(P(::CC07Q14(B ,Tc0Ki1!4(B ,T`0>Wh1M`05T1A0MQ1!IC0"Vi19:CC07Q14cK0Ah1(B +(linefeed character) ,Ta7C!`0"i1Rd;(B - ãËé¡´ àÁ×è͵éͧ¡ÒèÐźµÑÇÍÑ¡É÷Õèà¾Ô觾ÔÁ¾ìà¢éÒä» ËÁÒ¶֧»ØèÁà¢Õ¹ -º¹¼ÔÇ˹éÒäÇéÇèÒ "Delete" ËÃ×ͺҧ·ÕÍÒ¨¨Ðà¢Õ¹äÇé "Rubout" ¡çä´é â´Â·ÑèÇä» -ãªéÊÓËÃѺźµÑÇÍÑ¡É÷ÕèÍÂÙè¡è͹˹éÒµÓá˹è§à¤ÍÃìà«ÍÃì»Ñ¨¨ØºÑ¹ + ,Tc0Ki1!4(B ,T`0AWh1M05i1M'!RC(PE:05Q1G0MQ1!IC07Uh1`0>Th1'0>T1A0>l1`0"i1Rd;(B ,TKARB06V1'0;Xh1A`0"U1B9(B +,T:90 +,Tc0*i1JSK0CQ1:E:05Q1G0MQ1!IC07Uh1M0BYh10!h1M9K09i1R5SaK09h1'`$M0Cl1`+M0Cl10;Q1(0(X10:Q19(B - >> Åͧ¾ÔÁ¾ìµÑÇÍÑ¡ÉÃà¢éÒä»ËÅÒÂ æ µÑÇ áÅéÇãªé źµÑÇÍÑ¡ÉÃàËÅèÒ¹Ñé¹·Ôé§ + >> ,TEM'0>T1A0>l105Q1G0MQ1!IC`0"i1Rd;KERB(B ,Tf(B 0,T5Q1G(B ,Ta0Ei1Gc0*i1(B ,TE:05Q1G0MQ1!IC`K0Eh1R09Qi1907Ti1'(B - >> Åͧ¾ÔÁ¾ì¢éͤÇÒÁŧä»ãËéà¡Ô¹¢Íº¢ÇÒ (right margin) àÇÅÒ·Õè¾ÔÁ¾ì¢éͤÇÒÁà¢éÒä» - ÂÒÇà¡Ô¹¤ÇÒÁ¡ÇéÒ§¢Í§Ë¹Ö觺Ã÷Ѵ ºÃ÷Ѵ¹Ñ鹡ç¨Ð "¶Ù¡µèÍ" ãËéÂÒÇà¡Ô¹Ë¹Öè§Ë¹éÒ¨Í - â´ÂãÊèà¤Ã×èͧËÁÒ '\' äÇé·Õè¢Íº¢ÇÒÊØ´ à¾×èͺ͡ãËéÃÙéÇèÒºÃ÷Ѵ¹ÕéÂѧÁÕµèÍ Emacs ¨Ð - àÅ×è͹ (scroll) ˹éÒ¨Íà¾×èÍãËéàËç¹µÓá˹觷Õè¡ÓÅѧá¡éä¢ÍÂÙèä´éÍÂèÒ§ªÑ´à¨¹ ¶éÒËÒ¡ - ¢Íº¢ÇÒËÃ×͢ͺ«éÒ¢ͧÁÕà¤Ã×èͧËÁÒ '\' ÍÂÙè ¡çà»ç¹¡Òú͡ãËéÃÙéÇèÒ ºÃ÷Ѵ¹Ñé¹ÂѧÁÕµèÍ - ä»ã¹·ÔÈ·Ò§¹Ñé¹ æ + >> ,TEM'0>T1A0>l10"i1M$GRAE'd;c0Ki1`0!T19"M:"GR(B (right margin) ,T`GER07Uh10>T1A0>l10"i1M$GRA`0"i1Rd;(B + ,TBRG`0!T19$GRA!0Gi1R'"M'K09Vh1':CC07Q14(B ,T:CC07Q1409Qi190!g1(P(B "0,T6Y1!05h1M(B" ,Tc0Ki1BRG`0!T19K09Vh1'K09i1R(M(B + ,Tb4Bc0Jh1`$0CWh1M'KARB(B '\' ,Td0Gi107Uh1"M:"GR0JX14(B ,T`0>Wh1M:M!c0Ki10CYi10Gh1R:CC07Q1409Ui10BQ1'0AU105h1M(B Emacs ,T(P(B + ,T`0EWh1M9(B (scroll) ,TK09i1R(M`0>Wh1Mc0Ki1`0Kg195SaK09h1'07Uh1!S0EQ1'a0!i1d"M0BYh1d04i1M0Bh1R'0*Q14`(9(B 0,T6i1RKR!(B + ,T"M:"GRK0CW1M"M:0+i1RB"M'0AU1`$0CWh1M'KARB(B '\' ,TM0BYh1(B 0,T!g1`0;g19!RC:M!c0Ki10CYi10Gh1R(B ,T:CC07Q1409Qi190BQ1'0AU105h1M(B + ,Td;c907T1H7R'09Qi19(B ,Tf(B - Åͧ»¯ÔºÑµÔ´ÙàÅ ¤§¨ÐªèÇÂãËéà¢éÒ㨧èÒ¡ÇèÒ¡ÒÃ͸ԺÒ´éǵÑÇ˹ѧÊ×Í + ,TEM';0/T10:Q105T104Y1`EB(B ,T$'(P0*h1GBc0Ki1`0"i1Rc(0'h1RB!0Gh1R!RCM08T1:RB04i1GB05Q1GK09Q1'0JW1M(B - >> ãËé¢ÂѺà¤ÍÃìà«ÍÃìä»äÇ麹ºÃ÷Ѵ«Ö觶١µèÍãËéÂÒÇà¡Ô¹Ë¹Öè§Ë¹éÒ¨Í ·Õèà¾Ô觻é͹à¢éÒä»àÁ×èÍ - ÊÑ¡¤ÃÙè¹Õé áÅéÇãªé C-d ź¢éͤÇÒÁÍÍ¡ºÒ§Êèǹ ¨¹¤ÇÒÁÂÒǢͧ¢éͤÇÒÁÍÂÙèÀÒÂã¹Ë¹Öè§ - ºÃ÷Ѵ Êѧࡵ´ÙÇèÒà¤Ã×èͧËÁÒ '\' ¨ÐËÒÂä» + >> ,Tc0Ki1"0BQ1:`$M0Cl1`+M0Cl1d;d0Gi1:9:CC07Q140+Vh1'06Y1!05h1Mc0Ki1BRG`0!T19K09Vh1'K09i1R(M(B 0,T7Uh1`0>Th1'0;i1M9`0"i1Rd;`0AWh1M(B + 0,TJQ1!$0CYh109Ui1(B ,Ta0Ei1Gc0*i1(B C-d ,TE:0"i1M$GRAMM!:R'0Jh1G9(B ,T(9$GRABRG"M'0"i1M$GRAM0BYh1@RBc9K09Vh1'(B + ,T:CC07Q14(B 0,TJQ1'`!504Y10Gh1R`$0CWh1M'KARB(B '\' ,T(PKRBd;(B - >> ãËéàÅ×è͹à¤ÍÃìà«ÍÃìä»äÇé·ÕèµÓá˹è§ááÊØ´¢Í§ºÃ÷Ѵ áÅéÇ¡´ ´Ù ¡ÒÃ·Ó - Ẻ¹Õé ¨Ð·ÓãËéÊÑ­Åѡɳì¤Ñè¹ÃÐËÇèÒ§ºÃ÷Ѵ¶Ù¡ÅºÍÍ¡ä» ºÃ÷Ѵ¹Ñ鹡ç¨Ð¶Ù¡àÍÒ仵è͡Ѻ - ºÃ÷Ѵ¡è͹˹éÒ¹Ñé¹ ÃÇÁ¡Ñ¹à»ç¹ºÃ÷ѴÂÒǺÃ÷Ѵà´ÕÂÇ áÅÐÍÒ¨¨ÐÁÕÊÑ­ÅѡɳìµèͺÃ÷Ѵ - »ÃÒ¡¯¢Öé¹ + >> ,Tc0Ki1`0EWh1M9`$M0Cl1`+M0Cl1d;d0Gi107Uh15SaK09h1'aC!0JX14"M':CC07Q14(B ,Ta0Ei1G!4(B 0,T4Y1(B ,T!RC7S(B + ,Ta::09Ui1(B ,T(P7Sc0Ki10JQ1-0EQ1!I03l10$Qh19CPK0Gh1R':CC07Q1406Y1!E:MM!d;(B ,T:CC07Q1409Qi190!g1(P06Y1!`MRd;05h1M0!Q1:(B + ,T:CC07Q140!h1M9K09i1R09Qi19(B ,TCGA0!Q19`0;g19:CC07Q14BRG:CC07Q14`04U1BG(B ,TaEPMR((P0AU10JQ1-0EQ1!I03l105h1M:CC07Q14(B + ,T;CR!/0"Vi19(B - >> ãËé¡´ à¾×èÍà¾ÔèÁ µÑÇÍÑ¡ÉâÖ鹺Ã÷ѴãËÁè ¡ÅѺä»ÍÂèÒ§à´ÔÁ + >> ,Tc0Ki1!4(B ,T`0>Wh1M`0>Th1A(B 0,T5Q1G0MQ1!IC0"Vi19:CC07Q14cK0Ah1(B ,T!0EQ1:d;M0Bh1R'`04T1A(B - ¤ÓÊÑè§ÊèǹãË­è¢Í§ Emacs ¨ÐÊÒÁÒö¡Ó˹´¨Ó¹Ç¹¤ÃÑ駷Õèµéͧ¡ÒÃãË黯ԺѵÔä´é ÃÇÁ·Ñ駡Òà -á·Ã¡ (insert) µÑÇÍÑ¡ÉôéÇ + ,T$S0JQh1'0Jh1G9cK0-h1"M'(B Emacs ,T(PJRARC6!SK94(S9G9$0CQi1'07Uh105i1M'!RCc0Ki1;0/T10:Q105T1d04i1(B ,TCGA07Qi1'!RC(B +,Ta7C!(B (insert) 0,T5Q1G0MQ1!IC04i1GB(B - >> Åͧ»é͹¤ÓÊÑè§ C-u 8 * ´Ù Êѧࡵ´ÙÇèÒà¡Ô´ÍÐäâÖé¹ + >> ,TEM'0;i1M9$S0JQh1'(B C-u 8 * 0,T4Y1(B 0,TJQ1'`!504Y10Gh1R`0!T14MPdC0"Vi19(B - ¶éÒµéͧ¡ÒèÐà¾ÔèÁºÃ÷ѴÇèÒ§ æ (blank line) ÃÐËÇèÒ§ÊͧºÃ÷Ѵ ãËéàÅ×è͹价ÕèµÓáË¹è§ -ááÊØ´¢Í§ºÃ÷Ѵ·ÕèÊͧ áÅéÇ¡´ C-o + 0,T6i1R05i1M'!RC(P`0>Th1A:CC07Q140Gh1R'(B ,Tf(B (blank line) ,TCPK0Gh1R'JM':CC07Q14(B ,Tc0Ki1`0EWh1M9d;07Uh15SaK09h1'(B +,TaC!0JX14"M':CC07Q1407Uh1JM'(B ,Ta0Ei1G!4(B C-o - >> ãËéàÅ×è͹价ÕèµÓá˹è§ááÊØ´¢Í§ºÃ÷Ѵ㴡çä´é áÅéÇÅͧ¡´ C-o ´Ù + >> ,Tc0Ki1`0EWh1M9d;07Uh15SaK09h1'aC!0JX14"M':CC07Q14c40!g1d04i1(B ,Ta0Ei1GEM'!4(B C-o 0,T4Y1(B - ¶Ö§µÃ§¹Õé àÃÒ¡çä´éàÃÕ¹ÇÔ¸Õ¾×é¹°Ò¹ÊÓËÃѺ¡Òûé͹¢éͤÇÒÁ áÅСÒÃá¡é·Õè¼Ô´áÅéÇ ¹Í¡¨Ò¡¨Ð -źä´é·ÕÅеÑÇÍÑ¡ÉÃáÅéÇ ÂѧÁÕ¤ÓÊÑ觫Öè§ÊÒÁÒöãªéźä´éã¹à»ç¹¤Ó æ ËÃ×Íà»ç¹ºÃ÷Ѵ æ ÍÕ¡´éÇ ÊÃØ» -¤ÓÊÑè§ÊÓËÃѺ¡ÒÃźä´é´Ñ§¹Õé + 0,T6V1'5C'09Ui1(B ,T`CR0!g1d04i1`0CU1B90GT108U10>Wi190R9JSK0CQ1:!RC0;i1M90"i1M$GRA(B ,TaEP!RCa0!i107Uh10 źµÑÇÍÑ¡É÷ÕèÍÂÙè˹éÒà¤ÍÃìà«ÍÃì - C-d źµÑÇÍÑ¡É÷ÕèÍÂÙè·Õèà¤ÍÃìà«ÍÃì + ,TE:05Q1G0MQ1!IC07Uh1M0BYh1K09i1R`$M0Cl1`+M0Cl1(B + C-d ,TE:05Q1G0MQ1!IC07Uh1M0BYh107Uh1`$M0Cl1`+M0Cl1(B - ESC ź¤Ó·ÕèÍÂÙè˹éÒà¤ÍÃìà«ÍÃì - ESC d ź¤ÓµÑé§áµèµÓá˹觷Õèà¤ÍÃìà«ÍÃìÍÂÙè + ESC ,TE:$S07Uh1M0BYh1K09i1R`$M0Cl1`+M0Cl1(B + ESC d ,TE:$S05Qi1'a05h15SaK09h1'07Uh1`$M0Cl1`+M0Cl1M0BYh1(B - C-k źºÃ÷ѴµÑé§áµèµÓá˹觷Õèà¤ÍÃìà«ÍÃìÍÂÙè + C-k ,TE::CC07Q1405Qi1'a05h15SaK09h1'07Uh1`$M0Cl1`+M0Cl1M0BYh1(B - 㹺ҧ¤ÃÑé§ àÃÒÍÒ¨µéͧ¡ÒèÐàÍÒÊèǹ·Õèź仡ÅѺ¤×¹ÁÒ â»Ãá¡ÃÁ Emacs ¨Ð¨ÓÊèǹ·Õèź -ÍÍ¡äÇé àÇÅÒ·Õèź¢éͤÇÒÁã¹Ë¹èÇ·ÕèÁÒ¡¡ÇèÒ˹Ö觵ÑÇÍÑ¡Éà ãËéãªé¤ÓÊÑè§ C-y àÇÅÒ·Õèµéͧ¡ÒèÐàÍÒ -¢éͤÇÒÁ¡ÅѺ¤×¹ ÊÔ觷Õè¤ÇÃÃÐÇѧ¡ç¤×Í C-y äÁèãªèãªéä´éà¾Õ§á¤èµÓá˹觷Õèź¢éͤÇÒÁÍÍ¡à·èÒ¹Ñé¹ áµè¨Ð -ãªé¡ÑºµÓá˹è§ã´¡çä´é C-y à»ç¹¤ÓÊÑè§ÊÓËÃѺá·Ã¡¢éͤÇÒÁ·Õèà¡çºäÇé ŧ㹵Óá˹觷ÕèÁÕà¤ÍÃìà«ÍÃìÍÂÙè -àÃÒÊÒÁÒöãªé¤ÇÒÁÊÒÁÒö¹Õé㹡ÒÃà¤Å×è͹ÂéÒ¢éͤÇÒÁä´é + ,Tc9:R'$0CQi1'(B ,T`CRMR(05i1M'!RC(P`MR0Jh1G907Uh1E:d;!0EQ1:0$W19AR(B ,Tb;Ca!CA(B Emacs ,T(P(S0Jh1G907Uh1E:(B +,TMM!d0Gi1(B ,T`GER07Uh1E:0"i1M$GRAc9K09h1GB07Uh1AR!!0Gh1RK09Vh1'05Q1G0MQ1!IC(B ,Tc0Ki1c0*i1$S0JQh1'(B C-y ,T`GER07Uh105i1M'!RC(P`MR(B +0,T"i1M$GRA!0EQ1:0$W19(B 0,TJTh1'07Uh1$GCCP0GQ1'0!g10$W1M(B C-y ,Td0Ah1c0*h1c0*i1d04i1`0>U1B'a0$h15SaK09h1'07Uh1E:0"i1M$GRAMM!`07h1R09Qi19(B ,Ta05h1(P(B +,Tc0*i10!Q1:5SaK09h1'c40!g1d04i1(B C-y ,T`0;g19$S0JQh1'JSK0CQ1:a7C!0"i1M$GRA07Uh1`0!g1:d0Gi1(B ,TE'c95SaK09h1'07Uh10AU1`$M0Cl1`+M0Cl1M0BYh1(B +,T`CRJRARC6c0*i1$GRAJRARC609Ui1c9!RC`$0EWh1M90Bi1RB0"i1M$GRAd04i1(B - ¤ÓÊÑè§ÊÓËÃѺ¡ÒÃźÁÕÍÂÙèÊͧẺ¤×Í ¤ÓÊÑè§ "Delete" ¡Ñº ¤ÓÊÑè§ "Kill" ¤ÓÊÑè§ "Kill" -¨Ðà¡çºÊèǹźÍÍ¡äÇé áµè¤ÓÊÑè§ "Delete" ¨ÐäÁèà¡çº áµè¶éÒËÒ¡ãªé¤ÓÊÑ觹ÕéËÅÒÂ æ ¤ÃÑé§ ¡ç¨Ðà¡çº -Êèǹ·ÕèźÍÍ¡äÇéãËé + ,T$S0JQh1'JSK0CQ1:!RCE:0AU1M0BYh1JM'a::0$W1M(B ,T$S0JQh1'(B "Delete" 0,T!Q1:(B ,T$S0JQh1'(B "Kill" ,T$S0JQh1'(B "Kill" +,T(P`0!g1:0Jh1G9E:MM!d0Gi1(B ,Ta05h1$S0JQh1'(B "Delete" ,T(Pd0Ah1`0!g1:(B ,Ta05h106i1RKR!c0*i1$S0JQh1'09Ui1KERB(B ,Tf(B ,T$0CQi1'(B 0,T!g1(P`0!g1:(B +0,TJh1G907Uh1E:MM!d0Gi1c0Ki1(B - >> ãËé¡´ C-n ÊÑ¡ÊͧÊÒÁ¤ÃÑé§ à¾×èÍàÅ×è͹ä»Âѧ·Õè·ÕèàËÁÒÐÊÁº¹Ë¹éÒ¨Í áÅéÇÅͧ¡´ C-k à¾×èÍ - źºÃ÷Ѵ¹Ñé¹ÍÍ¡´Ù + >> ,Tc0Ki1!4(B C-n 0,TJQ1!JM'JRA$0CQi1'(B ,T`0>Wh1M`0EWh1M9d;0BQ1'07Uh107Uh1`KARPJA:9K09i1R(M(B ,Ta0Ei1GEM'!4(B C-k ,T`0>Wh1M(B + ,TE::CC07Q1409Qi19MM!04Y1(B - àÁ×èÍ¡´ C-k ¤ÃÑé§áá ¢éͤÇÒÁ㹺Ã÷Ѵ¹Ñ鹨ж١źÍÍ¡ áÅÐàÁ×èÍ¡´ÍÕ¡ C-k ÍÕ¡¤ÃÑé§ ºÃ÷Ѵ -¹Ñé¹àͧ·Ñ駺Ã÷Ѵ¡ç¨Ð¶Ù¡ÅºÍÍ¡ä»´éÇ áµè¶éÒ¡Ó˹´¨Ó¹Ç¹¤ÃÑé§ãËé¡Ñº¤ÓÊÑè§ C-k ¡ç¨ÐËÁÒ¶֧ ãËéź -ºÃ÷ѴÍÍ¡ (·Ñé§à¹×éÍËÒáÅеÑǺÃ÷Ѵ) à»ç¹¨Ó¹Ç¹ºÃ÷Ѵ à·èҡѺ¨Ó¹Ç¹¤ÃÑ駷Õè¡Ó˹´ + ,T`0AWh1M!4(B C-k ,T$0CQi1'aC!(B 0,T"i1M$GRAc9:CC07Q1409Qi19(P06Y1!E:MM!(B ,TaEP`0AWh1M!40MU1!(B C-k 0,TMU1!$0CQi1'(B ,T:CC07Q14(B +0,T9Qi19`M'07Qi1':CC07Q140!g1(P06Y1!E:MM!d;04i1GB(B ,Ta05h106i1R!SK94(S9G9$0CQi1'c0Ki10!Q1:$S0JQh1'(B C-k 0,T!g1(PKARB06V1'(B ,Tc0Ki1E:(B +,T:CC07Q14MM!(B (0,T7Qi1'`09Wi1MKRaEP05Q1G:CC07Q14(B) ,T`0;g19(S9G9:CC07Q14(B ,T`07h1R0!Q1:(S9G9$0CQi1'07Uh1!SK94(B - ºÃ÷Ѵ·Õèà¾Ôè§ÅºÍÍ¡ä» ¨Ð¶Ù¡à¡çºäÇé áÅÐÊÒÁÒö¹Ó¡ÅѺ¤×¹ÁÒä´é â´Âãªé¤ÓÊÑè§ C-y + ,T:CC07Q1407Uh1`0>Th1'E:MM!d;(B ,T(P06Y1!`0!g1:d0Gi1(B ,TaEPJRARC69S!0EQ1:0$W19ARd04i1(B ,Tb4Bc0*i1$S0JQh1'(B C-y - >> Åͧ¡´ C-y ´Ù + >> ,TEM'!4(B C-y 0,T4Y1(B - ¢éͤÇÒÁ·Õè¶Ù¡ÅºÍÍ¡ â´Â¡Òá´ C-k ËÅÒÂ æ ¤ÃÑé§ ¨Ð¶Ù¡à¡çºÃǺÃÇÁäÇé áÅÐÊÒÁÒö¹Ó -¡ÅѺÁÒ·Ñé§ËÁ´ä´é㹤ÃÑé§à´ÕÂÇ â´Â¡Òá´ C-y + 0,T"i1M$GRA07Uh106Y1!E:MM!(B ,Tb4B!RC!4(B C-k ,TKERB(B ,Tf(B ,T$0CQi1'(B ,T(P06Y1!`0!g1:CG:CGAd0Gi1(B ,TaEPJRARC69S(B +,T!0EQ1:AR07Qi1'KA4d04i1c9$0CQi1'`04U1BG(B ,Tb4B!RC!4(B C-y - >> Åͧ¡´ C-k ´ÙËÅÒÂ æ ¤ÃÑé§ + >> ,TEM'!4(B C-k 0,T4Y1KERB(B ,Tf(B ,T$0CQi1'(B - >> ¤ÓÊÑè§ÊÓËÃѺàÃÕ¡¢éͤÇÒÁ¡ÅѺÁÒ ¤×Í C-y ¡è͹Í×è¹ãËéàÅ×è͹à¤ÍÃìà«ÍÃìŧ仢éÒ§ÅèÒ§ - ÊÑ¡ÊͧÊÒÁºÃ÷Ѵ áÅéÇÅͧ¡´ C-y ´Ù ¡ç¨ÐÊÒÁÒö¤Ñ´ÅÍ¡ (copy) ¢éͤÇÒÁä´é + >> ,T$S0JQh1'JSK0CQ1:`0CU1B!0"i1M$GRA!0EQ1:AR(B 0,T$W1M(B C-y 0,T!h1M90MWh19c0Ki1`0EWh1M9`$M0Cl1`+M0Cl1E'd;0"i1R'0Eh1R'(B + 0,TJQ1!JM'JRA:CC07Q14(B ,Ta0Ei1GEM'!4(B C-y 0,T4Y1(B 0,T!g1(PJRARC60$Q14EM!(B (copy) 0,T"i1M$GRAd04i1(B - ¶éҵ͹¹Õéà¡çº¢éͤÇÒÁÍÐäúҧÍÂèÒ§äÇé áÅéÇź¢éͤÇÒÁÍ×è¹à¾ÔèÁà¢éÒä»ÍÕ¡ ¨Ðà¡Ô´ÍÐäâÖé¹ -¼ÅÅѾ¸ì¤×Í C-y ¨ÐàÃÕ¡¤×¹ä´éá¤èà¾Õ§¢éͤÇÒÁ·ÕèźÍÍ¡¤ÃÑé§ÅèÒÊØ´à·èÒ¹Ñé¹ + 0,T6i1R5M909Ui1`0!g1:0"i1M$GRAMPdC:R'M0Bh1R'd0Gi1(B ,Ta0Ei1GE:0"i1M$GRA0MWh19`0>Th1A`0"i1Rd;0MU1!(B ,T(P`0!T14MPdC0"Vi19(B +,T08l10$W1M(B C-y ,T(P`0CU1B!0$W19d04i1a0$h1`0>U1B'0"i1M$GRA07Uh1E:MM!$0CQi1'0Eh1R0JX14`07h1R09Qi19(B - >> ÅͧźºÃ÷Ѵ´Ù˹Ö觺Ã÷Ѵ áÅéÇàÅ×è͹à¤ÍÃìà«ÍÃìä»·ÕèÍ×è¹ áÅéÇźºÃ÷ѴÍÍ¡´ÙÍա˹Öè§ - ºÃ÷Ѵ Åͧ¡´ C-y ´Ù áÅéÇÊѧࡵ´ÙÇèÒ¨Ðä´éá¤èà¾Õ§ºÃ÷Ѵ·ÕèÊͧ¤×¹à·èÒ¹Ñé¹ + >> ,TEM'E::CC07Q1404Y1K09Vh1':CC07Q14(B ,Ta0Ei1G`0EWh1M9`$M0Cl1`+M0Cl1d;07Uh10MWh19(B ,Ta0Ei1GE::CC07Q14MM!04Y10MU1!K09Vh1'(B + ,T:CC07Q14(B ,TEM'!4(B C-y 0,T4Y1(B ,Ta0Ei1G0JQ1'`!504Y10Gh1R(Pd04i1a0$h1`0>U1B':CC07Q1407Uh1JM'0$W19`07h1R09Qi19(B -¡ÒÃÍѹ´Ù (UNDO) +,T!RC0MQ1904Y1(B (UNDO) ============= - àÇÅÒ·Õèá¡é䢢éͤÇÒÁºÒ§ÍÂèÒ§ áÅéǵéͧ¡ÒèÐà»ÅÕ蹡ÅѺãËéà»ç¹ÍÂèÒ§à´ÔÁ ¡çÊÒÁÒö·Óä´é·Ø¡ -àÁ×èÍ´éǤÓÊÑè§ C-x u â´Â»¡µÔ ¨ÐãªéÊÓËÃѺ¡àÅÔ¡¤ÓÊÑè§ ·Õè»é͹à¢éÒä»â´ÂäÁèµÑé§ã¨ ÊÒÁÒöãªé -¤ÓÊÑ觹Õé¡Õè¤ÃÑ駡çä´éµÒÁµéͧ¡Òà + ,T`GER07Uh1a0!i1d"0"i1M$GRA:R'M0Bh1R'(B ,Ta0Ei1G05i1M'!RC(P`;0EUh1B9!0EQ1:c0Ki1`0;g19M0Bh1R'`04T1A(B 0,T!g1JRARC67Sd04i107X1!(B +,T`0AWh1M04i1GB$S0JQh1'(B C-x u ,Tb4B;!05T1(B ,T(Pc0*i1JSK0CQ1:B!`0ET1!$S0JQh1'(B 0,T7Uh10;i1M9`0"i1Rd;b4Bd0Ah105Qi1'c((B ,TJRARC6c0*i1(B +,T$S0JQh1'09Ui10!Uh1$0CQi1'0!g1d04i15RA05i1M'!RC(B - >> ÅͧźºÃ÷Ѵ¹ÕéÍÍ¡´Ù ´éǤÓÊÑè§ C-k áÅéÇàÃÕ¡¡ÅѺ¤×¹ÁÒ´éÇ C-x u + >> ,TEM'E::CC07Q1409Ui1MM!04Y1(B 0,T4i1GB$S0JQh1'(B C-k ,Ta0Ei1G`0CU1B!!0EQ1:0$W19AR04i1GB(B C-x u - ¤ÓÊÑè§ C-_ ¡çà»ç¹¤ÓÊÑè§Íѹ´ÙÍÕ¡Íѹ˹Öè§ ¤ÇÒÁÊÒÁÒöàËÁ×͹¡Ñº¤ÓÊÑè§ C-x u + ,T$S0JQh1'(B C-_ 0,T!g1`0;g19$S0JQh1'0MQ1904Y10MU1!0MQ19K09Vh1'(B ,T$GRAJRARC6`K0AW1M90!Q1:$S0JQh1'(B C-x u - ÊÒÁÒö¡Ó˹´¨Ó¹Ç¹¤ÃÑé§ãËé¤ÓÊÑè§ C-_ áÅÐ C-x u ä´é + ,TJRARC6!SK94(S9G9$0CQi1'c0Ki1$S0JQh1'(B C-_ ,TaEP(B C-x u ,Td04i1(B -á¿éÁ¢éÍÁÙÅ (File) +,Ta0?i1A0"i1M0AY1E(B (File) ============== - àÃÒ¨Óà»ç¹µéͧà¡çºÃÑ¡ÉÒ (save) ¢éͤÇÒÁ·Õèá¡éä¢äÇéã¹á¿éÁ¢éÍÁÙÅ ¶éÒµéͧ¡ÒèÐãËéÊÔ觷Õè -á¡éä¢à»ÅÕè¹ä»ÍÂèÒ§¶ÒÇà äÁèàªè¹¹Ñé¹ ÊÔ觷Õèá¡éä¢ä»¡ç¨ÐËÒÂä» ·Ñ¹·Õ·ÕèàÅÔ¡¡ÒÃãªé Emacs + ,T`CR(S`0;g1905i1M'`0!g1:0CQ1!IR(B (save) 0,T"i1M$GRA07Uh1a0!i1d"d0Gi1c9a0?i1A0"i1M0AY1E(B 0,T6i1R05i1M'!RC(Pc0Ki10JTh1'07Uh1(B +,Ta0!i1d"`;0EUh1B9d;M0Bh1R'6RGC(B ,Td0Ah1`0*h1909Qi19(B 0,TJTh1'07Uh1a0!i1d"d;0!g1(PKRBd;(B 0,T7Q1907U107Uh1`0ET1!!RCc0*i1(B Emacs - á¿éÁ¢éÍÁÙÅ·ÕèÁͧàËç¹ÍÂÙè ¤×ÍÊÔ觷ÕèºÑ¹·Ö¡ÊÔ觷Õè¡ÓÅѧá¡éä¢ÍÂÙè ËÃ×;ٴ§èÒÂ æ ¡ç¤×Íá¿éÁ¢éÍÁÙÅ·ÕèÁͧàËç¹ -ÍÂÙè¤×͵ÑÇá¿éÁ¢éÍÁÙÅ·Õè¡ÓÅѧá¡éä¢ÍÂÙè + ,Ta0?i1A0"i1M0AY1E07Uh1AM'`0Kg19M0BYh1(B 0,T$W1M0JTh1'07Uh10:Q1907V1!0JTh1'07Uh1!S0EQ1'a0!i1d"M0BYh1(B ,TK0CW1M0>Y140'h1RB(B ,Tf(B 0,T!g10$W1Ma0?i1A0"i1M0AY1E07Uh1AM'`0Kg19(B +,TM0BYh10$W1M05Q1Ga0?i1A0"i1M0AY1E07Uh1!S0EQ1'a0!i1d"M0BYh1(B - áµè¨¹¡ÇèÒá¿éÁ¢éÍÁÙŨж١à¡çºÃÑ¡ÉÒ (save) Å§ä» á¿éÁ¢éÍÁÙÅ·Õè¶Ù¡á¡éä¢ÍÂÙè ¨ÐäÁè¶Ù¡à¢Õ¹·Ñº -ŧä»ÍÂèÒ§à´ç´¢Ò´ Íѹ¹Õéà¾×èÍà»ç¹¡Òûéͧ¡Ñ¹¡ÒÃà¢Õ¹·Ñºá¿éÁ¢éÍÁÙÅ·Õèá¡éä¢ä»áºº¤ÃÖè§ æ ¡ÅÒ§ æ -â´ÂäÁèä´éµÑé§ã¨ + ,Ta05h1(9!0Gh1Ra0?i1A0"i1M0AY1E(P06Y1!`0!g1:0CQ1!IR(B (save) ,TE'd;(B ,Ta0?i1A0"i1M0AY1E07Uh106Y1!a0!i1d"M0BYh1(B ,T(Pd0Ah106Y1!`0"U1B907Q1:(B +,TE'd;M0Bh1R'`04g14"R4(B 0,TMQ1909Ui1`0>Wh1M`0;g19!RC0;i1M'0!Q19!RC`0"U1B907Q1:a0?i1A0"i1M0AY1E07Uh1a0!i1d"d;a::$0CVh1'(B ,Tf(B ,T!ER'(B ,Tf(B +,Tb4Bd0Ah1d04i105Qi1'c((B - ¹Í¡¨Ò¡¹Õé à¾×èÍà»ç¹¡Òûéͧ¡Ñ¹¡ÒÃà¡çºÃÑ¡ÉÒ (save) ÊÔ觷Õèá¡é䢼Դä»â´ÂäÁèµÑé§ã¨ Emacs -¨Ðà»ÅÕ蹪×èÍá¿éÁ¢éÍÁÙŵ鹩ºÑºà¡çºäÇéãËé ¡è͹¡ÒÃà¡çºÃÑ¡ÉÒ + ,T9M!(R!09Ui1(B ,T`0>Wh1M`0;g19!RC0;i1M'0!Q19!RC`0!g1:0CQ1!IR(B (save) 0,TJTh1'07Uh1a0!i1d"0Th1A`05T1A`0!Uh1BG0!Q1::CC07Q14bKA4(B (mode line) ,Tc95M9K0EQ1'(B - ¤ÓÊÑè§ãËéËÒá¿éÁ¢éÍÁÙÅ áÅФÓÊÑè§ãËéà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅ ÁÕÅѡɳÐᵡµèÒ§¨Ò¡¤ÓÊÑ觷Õè¼èÒ¹ æ ÁÒ -µÃ§·Õè »ÃСͺ仴éÇ 2 µÑÇÍÑ¡Éà ¤×͵éͧ¡´¤ÓÊÑ觺ҧÍÂèÒ§ µÒÁËÅѧ¤ÓÊÑè§ C-x «Öè§ËÁÒ¶֧¤ÓÊÑè§ -à¡ÕèÂǡѺá¿éÁ¢éÍÁÙÅ + ,T$S0JQh1'c0Ki1KRa0?i1A0"i1M0AY1E(B ,TaEP$S0JQh1'c0Ki1`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E(B 0,TAU10EQ1!I3Pa5!05h1R'(R!$S0JQh1'07Uh10 + ,Ta0Ei1G(B Emacs ,T(P6RA0*Wh1M"M'a0?i1A0"i1M0AY1E(B ,Tb4B;CR!/0"Vi1907Uh10Jh1G90Eh1R'"M'(M(B ,T`CR`0CU1B!0Jh1G907Uh1c0Ki10;i1M9(B +0,T*Wh1Ma0?i1A0"i1M0AY1E09Qi190Gh1R(B 0,TAT109T10:Q1?`?M0Cl1(B (mini buffer) 0,TAT109T10:Q1?`?M0Cl1(P06Y1!c0*i1'R9c90EQ1!I3P09Ui1(B 0,TAT109T10:Q1?`?M0Cl1(B +,T(PKA4K09i1R07Uh1aEPKRBd;(B ,TK0EQ1'(R!07Uh10;i1M90*Wh1Ma0?i1A0"i1M0AY1E(B ,Ta0Ei1G!40;Xh1A(B - >> Åͧ¡´ C-x C-f áÅéǵÒÁ´éÇ C-g ´Ù à»ç¹¡ÒÃÊÑè§Â¡àÅÔ¡à¹×éÍËÒã¹ÁԹԺѿà¿ÍÃì ËÃ×Í - ¡àÅÔ¡¤ÓÊÑè§ C-x C-f ´Ñ§¹Ñé¹ Emacs ¨ÐäÁè¤é¹ËÒá¿éÁ¢éÍÁÙÅã´ æ + >> ,TEM'!4(B C-x C-f ,Ta0Ei1G5RA04i1GB(B C-g 0,T4Y1(B ,T`0;g19!RC0JQh1'B!`0ET1!`09Wi1MKRc90AT109T10:Q1?`?M0Cl1(B ,TK0CW1M(B + ,TB!`0ET1!$S0JQh1'(B C-x C-f 0,T4Q1'09Qi19(B Emacs ,T(Pd0Ah10$i19KRa0?i1A0"i1M0AY1Ec4(B ,Tf(B - ¤ÃÒǹÕé ÁÒÅͧà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅ´Ù àÇÅÒ·Õèµéͧ¡ÒÃà¡çºÃÑ¡ÉÒÊÔ觷Õèá¡éä¢ÁÒ¨¹¶Ö§µÍ¹¹Õé ¡çãËéãªé -¤ÓÊÑ觴ѧ¹Õé + ,T$CRG09Ui1(B ,TAREM'`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E04Y1(B ,T`GER07Uh105i1M'!RC`0!g1:0CQ1!IR0JTh1'07Uh1a0!i1d"AR(906V1'5M909Ui1(B 0,T!g1c0Ki1c0*i1(B +,T$S0JQh1'04Q1'09Ui1(B - C-x C-s à¡çºÃÑ¡ÉÒ (save) á¿éÁ¢éÍÁÙÅ + C-x C-s ,T`0!g1:0CQ1!IR(B (save) ,Ta0?i1A0"i1M0AY1E(B - áÅéÇà¹×éÍËÒ·ÕèÍÂÙèã¹ Emacs ¡ç¨Ð¶Ù¡à¢Õ¹ŧ价Õèá¿éÁ¢éÍÁÙÅ àÇÅÒà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅ á¿éÁ¢éÍÁÙÅ -µé¹©ºÑº¨ÐäÁèÊÙ­ËÒÂä» áµè¨Ð¶Ù¡à¡çºäÇé㹪×èÍãËÁè «Öè§ä´éÁÒ¨Ò¡ª×èÍà¡èÒ·ÕèµèÍ·éÒ´éÇ '~' + ,Ta0Ei1G`09Wi1MKR07Uh1M0BYh1c9(B Emacs 0,T!g1(P06Y1!`0"U1B9E'd;07Uh1a0?i1A0"i1M0AY1E(B ,T`GER`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E(B ,Ta0?i1A0"i1M0AY1E(B +0,T5i19)0:Q1:(Pd0Ah10JY1-KRBd;(B ,Ta05h1(P06Y1!`0!g1:d0Gi1c90*Wh1McK0Ah1(B 0,T+Vh1'd04i1AR(R!0*Wh1M`0!h1R07Uh105h1M07i1RB04i1GB(B '~' - ËÅѧ¨Ò¡·Õèà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅàÊÃç¨áÅéÇ Emacs ¡ç¨ÐáÊ´§ª×èÍá¿éÁ¢éÍÁÙÅ·Õèà¡çºãËé´Ù + ,TK0EQ1'(R!07Uh1`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E`J0Cg1(a0Ei1G(B Emacs 0,T!g1(PaJ4'0*Wh1Ma0?i1A0"i1M0AY1E07Uh1`0!g1:c0Ki104Y1(B - >> Åͧ¡´ C-x C-x à¾×èÍà¡çºÃÑ¡ÉÒÊÓà¹Ò¢Í§ Tutorial ¹Õé´Ù ¡ç¨ÐàËç¹ÇèÒ ·ÕèÊèǹÅèÒ§ - ¢Í§¨Í ÁÕ¢éͤÇÒÁÇèÒ "Wrote ...../TUTORIAL.th" »ÃÒ¡¯¢Öé¹ + >> ,TEM'!4(B C-x C-x ,T`0>Wh1M`0!g1:0CQ1!IRJS`9R"M'(B Tutorial 0,T9Ui104Y1(B 0,T!g1(P`0Kg190Gh1R(B 0,T7Uh10Jh1G90Eh1R'(B + ,T"M'(M(B 0,TAU10"i1M$GRA0Gh1R(B "Wrote ...../TUTORIAL.th" ,T;CR!/0"Vi19(B - àÇÅÒ·Õè¨ÐÊÃéÒ§á¿éÁ¢éÍÁÙÅãËÁè ¡çãËé·ÓÃÒǡѺÇèҨФé¹ËÒ (find-file) á¿éÁ¢éÍÁÙÅà¡èÒ«Öè§ÁÕ -ÍÂÙè¡è͹˹éÒ¹ÕéáÅéÇ áÅéǾÔÁ¾ì¢éͤÇÒÁŧä»ã¹á¿éÁ¢éÍÁÙÅ·ÕèËÒà¨Í + ,T`GER07Uh1(PJ0Ci1R'a0?i1A0"i1M0AY1EcK0Ah1(B 0,T!g1c0Ki17SCRG0!Q1:0Gh1R(P0$i19KR(B (find-file) ,Ta0?i1A0"i1M0AY1E`0!h1R0+Vh1'0AU1(B +,TM0BYh10!h1M9K09i1R09Ui1a0Ei1G(B ,Ta0Ei1G0>T1A0>l10"i1M$GRAE'd;c9a0?i1A0"i1M0AY1E07Uh1KR`(M(B - áÅÐàÇÅÒ·ÕèÊÑè§à¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅà·èÒ¹Ñé¹ ¤×͵͹·Õè Emacs ¨Ðà¡çºà¹×éÍËÒ·Õèá¡éä¢ÁÒ·Ñé§ËÁ´ ŧ -ã¹á¿éÁ¢éÍÁÙÅà»ç¹¤ÃÑé§áá + ,TaEP`GER07Uh10JQh1'`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E`07h1R09Qi19(B 0,T$W1M5M907Uh1(B Emacs ,T(P`0!g1:`09Wi1MKR07Uh1a0!i1d"AR07Qi1'KA4(B ,TE'(B +,Tc9a0?i1A0"i1M0AY1E`0;g19$0CQi1'aC!(B -ºÑ¿à¿ÍÃì (Buffer) +0,T:Q1?`?M0Cl1(B (Buffer) =============== - ¶éÒËÒ¡ÊÑè§ãËéËÒá¿éÁ¢éÍÁÙÅÍѹ·ÕèÊͧ ´éǤÓÊÑè§ C-x C-f à¹×éÍËҢͧá¿éÁ¢éÍÁÙÅáá ¡ç¨ÐÂѧ¤§ -¶Ù¡à¡çºÃÑ¡ÉÒÍÂÙèã¹ Emacs ÊÔ觷Õèà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅ·ÕèÍèÒ¹à¢éÒÁÒ «Öè§ÍÂÙèÀÒÂã¹ Emacs àÃÕ¡ÇèÒ -ºÑ¿à¿ÍÃì (Buffer) àÇÅÒ·ÕèÍèÒ¹á¿éÁ¢éÍÁÙÅãËÁèà¢éÒÁÒ Emacs ¡ç¨ÐÊÃéÒ§ºÑ¿à¿ÍÃìãËÁè ¢Öé¹ÁÒÀÒÂã¹ + 0,T6i1RKR!0JQh1'c0Ki1KRa0?i1A0"i1M0AY1E0MQ1907Uh1JM'(B 0,T4i1GB$S0JQh1'(B C-x C-f ,T`09Wi1MKR"M'a0?i1A0"i1M0AY1EaC!(B 0,T!g1(P0BQ1'$'(B +0,T6Y1!`0!g1:0CQ1!IRM0BYh1c9(B Emacs 0,TJTh1'07Uh1`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E07Uh10Mh1R9`0"i1RAR(B 0,T+Vh1'M0BYh1@RBc9(B Emacs ,T`0CU1B!0Gh1R(B +0,T:Q1?`?M0Cl1(B (Buffer) ,T`GER07Uh10Mh1R9a0?i1A0"i1M0AY1EcK0Ah1`0"i1RAR(B Emacs 0,T!g1(PJ0Ci1R'0:Q1?`?M0Cl1cK0Ah1(B 0,T"Vi19AR@RBc9(B - ¶éÒµéͧ¡ÒèдÙÃÒ¡ÒâͧºÑ¿à¿ÍÃì ·Õè¶Ù¡à¡çºÃÑ¡ÉÒÍÂÙèÀÒÂã¹ Emacs ¡çãËé¡´¤ÓÊÑè§ + 0,T6i1R05i1M'!RC(P04Y1CRB!RC"M'0:Q1?`?M0Cl1(B 0,T7Uh106Y1!`0!g1:0CQ1!IRM0BYh1@RBc9(B Emacs 0,T!g1c0Ki1!4$S0JQh1'(B C-x C-b - >> Åͧ¡´ C-x C-b ´Ù Êѧࡵ´ÙÇèÒáµèÅкѿà¿ÍÃìÁÕª×èÍÇèÒÍÐäà áÅж١µÑ駪×èÍäÇéÇèÒ - ÍÂèÒ§äà 㹠Emacs + >> ,TEM'!4(B C-x C-b 0,T4Y1(B 0,TJQ1'`!504Y10Gh1Ra05h1EP0:Q1?`?M0Cl10AU10*Wh1M0Gh1RMPdC(B ,TaEP06Y1!05Qi1'0*Wh1Md0Gi10Gh1R(B + ,TM0Bh1R'dC(B ,Tc9(B Emacs - ÁÕºÒ§ºÑ¿à¿ÍÃì ·ÕèäÁèÁÕ¤Ùè¡Ñºá¿éÁ¢éÍÁÙŨÃÔ§ æ µÑÇÍÂèÒ§àªè¹ äÁèÁÕá¿éÁ¢éÍÁÙÅ·ÕèÁÕª×èÍÇèÒ "*Buffer -List*" ÍÂÙè¨ÃÔ§ æ áµèà»ç¹ºÑ¿à¿ÍÃì·ÕèÊÃéÒ§¢Öé¹ÁÒà¾×èÍáÊ´§ÃÒ¡Òúѿà¿ÍÃì â´Â¤ÓÊÑè§ C-x C-b + 0,TAU1:R'0:Q1?`?M0Cl1(B 0,T7Uh1d0Ah10AU10$Yh10!Q1:a0?i1A0"i1M0AY1E(0CT1'(B ,Tf(B 0,T5Q1GM0Bh1R'`0*h19(B ,Td0Ah10AU1a0?i1A0"i1M0AY1E07Uh10AU10*Wh1M0Gh1R(B "*Buffer +List*" ,TM0BYh1(0CT1'(B ,Tf(B ,Ta05h1`0;g190:Q1?`?M0Cl107Uh1J0Ci1R'0"Vi19AR`0>Wh1MaJ4'CRB!RC0:Q1?`?M0Cl1(B ,Tb4B$S0JQh1'(B C-x C-b - ¢éͤÇÒÁ·Ø¡¢éͤÇÒÁ·Õè»ÃÒ¡¯ÍÂÙèã¹ÇÔ¹â´Çì¢Í§ Emacs ¹Ñé¹ ¨ÐÍÂÙè㹺ѿà¿ÍÃì㴺ѿà¿ÍÃì˹Öè§àÊÁÍ + 0,T"i1M$GRA07X1!0"i1M$GRA07Uh1;CR!/M0BYh1c90GT19b40Gl1"M'(B Emacs 0,T9Qi19(B ,T(PM0BYh1c90:Q1?`?M0Cl1c40:Q1?`?M0Cl1K09Vh1'`JAM(B - >> Åͧ¡´ C-x 1 à¾×èÍźÃÒ¡Òúѿà¿ÍÃìÍÍ¡´Ù + >> ,TEM'!4(B C-x 1 ,T`0>Wh1ME:CRB!RC0:Q1?`?M0Cl1MM!04Y1(B - ¡ÒÃàÃÕ¡á¿éÁ¢éÍÁÙÅÍ×è¹¢Öé¹ÁÒá¡éä¢ µÍ¹·Õè¡ÓÅѧá¡éä¢á¿éÁ¢éÍÁÙÅ˹Öè§ÍÂÙè¹Ñé¹ ¨ÐäÁè·ÓãËéá¿éÁ¢éÍÁÙÅ -áá¶Ù¡à¡çºÃÑ¡ÉÒ ÊÔ觷Õèá¡éä¢ä»ã¹á¿éÁ¢éÍÁÙÅáá¨Ð¶Ù¡ºÑ¹·Ö¡äÇé㹺ѿà¿ÍÃì¢Í§á¿éÁ¢éÍÁÙŹÑé¹ à·èÒ¹Ñé¹ + ,T!RC`0CU1B!a0?i1A0"i1M0AY1E0MWh190"Vi19ARa0!i1d"(B ,T5M907Uh1!S0EQ1'a0!i1d"a0?i1A0"i1M0AY1EK09Vh1'M0BYh109Qi19(B ,T(Pd0Ah17Sc0Ki1a0?i1A0"i1M0AY1E(B +,TaC!06Y1!`0!g1:0CQ1!IR(B 0,TJTh1'07Uh1a0!i1d"d;c9a0?i1A0"i1M0AY1EaC!(P06Y1!0:Q1907V1!d0Gi1c90:Q1?`?M0Cl1"M'a0?i1A0"i1M0AY1E09Qi19(B ,T`07h1R09Qi19(B - ¡ÒÃÊÃéÒ§ºÑ¿à¿ÍÃìãËÁè¢Öé¹ ÊÓËÃѺá¡éä¢á¿éÁ¢éÍÁÙÅÍѹ·ÕèÊͧ áÅéÇá¡éÍÐäúҧÍÂèҧ㹺ѿà¿ÍÃì¹Ñé¹ -¨ÐäÁèÁÕ¼Åã´ æ µèͺѿà¿ÍÃì¢Í§á¿éÁ¢éÍÁÙÅÍѹ·Õè˹Ö觷Ñé§ÊÔé¹ ¨Ø´¹Õé·ÓãËéÊÒÁÒöà¡çºá¿éÁ¢éÍÁÙÅááäÇéà¾×èÍ -á¡éä¢ã¹µÍ¹ËÅѧ + ,T!RCJ0Ci1R'0:Q1?`?M0Cl1cK0Ah10"Vi19(B ,TJSK0CQ1:a0!i1d"a0?i1A0"i1M0AY1E0MQ1907Uh1JM'(B ,Ta0Ei1Ga0!i1MPdC:R'M0Bh1R'c90:Q1?`?M0Cl109Qi19(B +,T(Pd0Ah10AU1Wh1M(B +,Ta0!i1d"c95M9K0EQ1'(B - áµèàÇÅÒ·Õèµéͧ¡ÒèÐà¡çºÃÑ¡ÉÒ (save) ºÑ¿à¿ÍÃìŧä»ã¹á¿éÁ¢éÍÁÙÅ ´éǤÓÊÑè§ C-x C-s ¹Ñé¹ -¨ÐµéͧÊÇÔ·«ìä»ÂѧºÑ¿à¿ÍÃì·Õèµéͧ¡ÒèÐà¡çº ´éǤÓÊÑè§ C-x C-f «Ö觤è͹¢éÒ§ÂØè§ÂÒ¡ àÃÒÁÕ¤ÓÊÑ觫Öè§ -ãªéÊÓËÃѺ¡ÒùÕéâ´Â੾ÒÐ ¤×Í + ,Ta05h1`GER07Uh105i1M'!RC(P`0!g1:0CQ1!IR(B (save) 0,T:Q1?`?M0Cl1E'd;c9a0?i1A0"i1M0AY1E(B 0,T4i1GB$S0JQh1'(B C-x C-s 0,T9Qi19(B +,T(P05i1M'J0GT170+l1d;0BQ1'0:Q1?`?M0Cl107Uh105i1M'!RC(P`0!g1:(B 0,T4i1GB$S0JQh1'(B C-x C-f 0,T+Vh1'0$h1M90"i1R'0BXh1'BR!(B ,T`CR0AU1$S0JQh1'0+Vh1'(B +,Tc0*i1JSK0CQ1:!RC09Ui1b4B`)>RP(B 0,T$W1M(B - C-x s à¡çºÃÑ¡ÉÒ (save) ·Ø¡ºÑ¿à¿ÍÃì·ÕèÁÕÍÂÙè + C-x s ,T`0!g1:0CQ1!IR(B (save) 0,T7X1!0:Q1?`?M0Cl107Uh10AU1M0BYh1(B - C-x s ¨Ðà¡çºÃÑ¡ÉÒ·Ø¡ºÑ¿à¿ÍÃì·Õè¶Ù¡á¡éä¢à¹×éÍËÒä» Å§ã¹á¿éÁ¢éÍÁÙÅ â´Â¨Ð¶ÒÁ¡è͹ÇèÒ¨ÐãËé -à¡çººÑ¿à¿ÍÃì¹ÕéäËÁ y ËÃ×Í n ¡ÑººÑ¿à¿ÍÃìáµèÅкѿà¿ÍÃì ¤Ó¶ÒÁ¨Ð»ÃÒ¡¯ã¹ÊèǹÅèÒ§¢Í§Ë¹éÒ¨Í ´Ñ§ -µÑÇÍÂèÒ§¹Õé + C-x s ,T(P`0!g1:0CQ1!IR07X1!0:Q1?`?M0Cl107Uh106Y1!a0!i1d"`09Wi1MKRd;(B ,TE'c9a0?i1A0"i1M0AY1E(B ,Tb4B(P6RA0!h1M90Gh1R(Pc0Ki1(B +,T`0!g1:0:Q1?`?M0Cl109Ui1dKA(B y ,TK0CW1M(B n 0,T!Q1:0:Q1?`?M0Cl1a05h1EP0:Q1?`?M0Cl1(B ,T$S6RA(P;CR!/c90Jh1G90Eh1R'"M'K09i1R(M(B 0,T4Q1'(B +0,T5Q1GM0Bh1R'09Ui1(B Save file /usr/private/yours/TUTORIAL.th? (y or n) -¡ÒâÂÒ¤ÓÊÑè§ (extension) +,T!RC"BRB$S0JQh1'(B (extension) ======================= - ã¹â»Ãá¡ÃÁ Editor ¹Õé Áըӹǹ¤ÓÊÑè§ÁÒ¡¡ÇèÒ ¨Ó¹Ç¹¤ÓÊÑ觫Öè§ÊÒÁÒö¡´ä´éâ´Â»ØèÁ¤Í¹â·ÃÅ -ËÃ×Í»ØèÁ META ä´éËÁ´ ¤ÓÊÑ觢ÂÒ (eXtend) ÁÕäÇéà¾×èÍãËéÊÒÁÒöãªé¤ÓÊÑè§àËÅèÒ¹Õéä´éËÁ´ ÁÕÍÂÙè 2 -Ẻ ´Ñ§¹Õé + ,Tc9b;Ca!CA(B Editor 0,T9Ui1(B 0,TAU1(S9G9$S0JQh1'AR!!0Gh1R(B ,T(S9G9$S0JQh1'0+Vh1'JRARC6!4d04i1b4B0;Xh1A$M9b7CE(B +,TK0CW1M0;Xh1A(B META ,Td04i1KA4(B ,T$S0JQh1'"BRB(B (eXtend) 0,TAU1d0Gi1`0>Wh1Mc0Ki1JRARC6c0*i1$S0JQh1'`K0Eh1R09Ui1d04i1KA4(B 0,TAU1M0BYh1(B 2 +,Ta::(B 0,T4Q1'09Ui1(B - C-x ¢ÂÒÂà¾ÔèÁ´éǵÑÇÍÑ¡Éà ÊÓËÃѺ¡´µÑÇÍÑ¡ÉõÒÁà¢éÒä» 1 µÑÇ - ESC x ¢ÂÒÂà¾ÔèÁ´éǪ×èͤÓÊÑè§ ÊÓËÃѺ¡´ª×èͤÓÊÑ觵ÒÁà¢éÒä»·Ñé§ËÁ´ + C-x ,T"BRB`0>Th1A04i1GB05Q1G0MQ1!IC(B ,TJSK0CQ1:!405Q1G0MQ1!IC5RA`0"i1Rd;(B 1 0,T5Q1G(B + ESC x ,T"BRB`0>Th1A04i1GB0*Wh1M$S0JQh1'(B ,TJSK0CQ1:!40*Wh1M$S0JQh1'5RA`0"i1Rd;07Qi1'KA4(B - ¤ÓÊÑ觻ÃÐàÀ·¹Õé ¡çà»ç¹¤ÓÊÑ觷ÕèÁÕ»ÃÐ⪹ì áµèÊèǹãË­è¨Ð¶Ù¡àÃÕ¡ãªé ¹éͤÃÑ駡ÇèÒ¤ÓÊÑ觷ÑèÇä» -µÑÇÍÂèÒ§àªè¹ ¤ÓÊÑè§ËÒá¿éÁ¢éÍÁÙÅ (find) C-x C-f ¤ÓÊÑè§à¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅ (save) C-x C-s -¤ÓÊÑè§ C-x C-c (àÅÔ¡ Editor) µèÒ§¡çà»ç¹Ë¹Öè§ã¹¤ÓÊÑè§àËÅèÒ¹Õé + ,T$S0JQh1';CP`@709Ui1(B 0,T!g1`0;g19$S0JQh1'07Uh10AU1;CPbB*09l1(B ,Ta05h10Jh1G9cK0-h1(P06Y1!`0CU1B!c0*i1(B 0,T9i1MB$0CQi1'!0Gh1R$S0JQh1'07Qh1Gd;(B +0,T5Q1GM0Bh1R'`0*h19(B ,T$S0JQh1'KRa0?i1A0"i1M0AY1E(B (find) C-x C-f ,T$S0JQh1'`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E(B (save) C-x C-s +,T$S0JQh1'(B C-x C-c (,T`0ET1!(B Editor) 0,T5h1R'0!g1`0;g19K09Vh1'c9$S0JQh1'`K0Eh1R09Ui1(B - ¤ÓÊÑè§ C-z à»ç¹¤ÓÊÑ觷Õèãªéã¹ã¹¡ÒÃÍÍ¡¨Ò¡ Emacs ¤è͹¢éÒ§ºèÍ ¤ÓÊÑ觹Õé¨ÐäÁè¡àÅÔ¡ -Emacs àÅ·Õà´ÕÂÇ áµè¨ÐËÂØ´ Emacs äÇéªÑèǤÃÒÇ à¾×èÍãËéÊÒÁÒö¡ÅѺä»ãªé csh ä´éÍÕ¡ ¡Òá´ -C-z ¨Ö§à»ç¹¡ÒÃËÂØ´ Emacs äÇéªÑèǤÃÒÇà·èÒ¹Ñé¹ ¨ÐäÁè·Ó¤ÇÒÁàÊÕÂËÒÂãËé¡Ñºà¹×éÍËÒ·Õèá¡éä¢ä» + ,T$S0JQh1'(B C-z ,T`0;g19$S0JQh1'07Uh1c0*i1c9c9!RCMM!(R!(B Emacs 0,T$h1M90"i1R'0:h1MB(B ,T$S0JQh1'09Ui1(Pd0Ah1B!`0ET1!(B +Emacs ,T`EB07U1`04U1BG(B ,Ta05h1(PK0BX14(B Emacs ,Td0Gi10*Qh1G$CRG(B ,T`0>Wh1Mc0Ki1JRARC6!0EQ1:d;c0*i1(B csh ,Td04i10MU1!(B ,T!RC!4(B +C-z 0,T(V1'`0;g19!RCK0BX14(B Emacs ,Td0Gi10*Qh1G$CRG`07h1R09Qi19(B ,T(Pd0Ah17S$GRA`0JU1BKRBc0Ki10!Q1:`09Wi1MKR07Uh1a0!i1d"d;(B -ËÁÒÂà˵Ø: áµè·ÇèÒ ã¹¡Ã³Õ·Õèãªéº¹ X-window ËÃ×Íãªé sh ÍÂÙè ¡ç¨ÐäÁèÁÕ¤ÇÒÁÊÒÁÒö¹Õé +,TKARB`K05X1(B: ,Ta05h170Gh1R(B ,Tc9!C03U107Uh1c0*i1:9(B X-window ,TK0CW1Mc0*i1(B sh ,TM0BYh1(B 0,T!g1(Pd0Ah10AU1$GRAJRARC609Ui1(B - ¤ÓÊÑ觻ÃÐàÀ· C-x ÁÕÁÒ¡ÁÒÂËÅÒ¤ÓÊÑè§ ¤ÓÊÑ觷Õè͸ԺÒÂä»áÅéÇÁմѧ¹Õé + ,T$S0JQh1';CP`@7(B C-x 0,TAU1AR!ARBKERB$S0JQh1'(B ,T$S0JQh1'07Uh1M08T1:RBd;a0Ei1G0AU104Q1'09Ui1(B - C-x C-f ËÒá¿éÁ¢éÍÁÙÅ (find) ÊÓËÃѺá¡éä¢ - C-x C-s à¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅ (save) - C-x C-b áÊ´§ÃÒ¡Òúѿà¿ÍÃì (buffer list) - C-x C-c àÅÔ¡¡ÒÃãªé Editor áÅÐà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙÅâ´ÂÍѵâ¹ÁÑµÔ áµè¶éÒËÒ¡ÁÕá¿éÁ - ¢éÍÁÙźҧÍѹ¶Ù¡á¡éä¢ ¡çãËé¶ÒÁÇèÒ¨Ðà¡çºÃÑ¡ÉÒá¿éÁ¢éÍÁÙŹÑé¹äËÁ â´Â·ÑèÇä» - ¡ÒÃÍÍ¡¨Ò¡ Emacs ·Óä´éâ´Â¤ÓÊÑè§ C-x C-s C-x C-c ¤×ÍãËéà¡çºÃÑ¡ÉÒ - ¡è͹áÅéǨ֧àÅÔ¡ + C-x C-f ,TKRa0?i1A0"i1M0AY1E(B (find) ,TJSK0CQ1:a0!i1d"(B + C-x C-s ,T`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E(B (save) + C-x C-b ,TaJ4'CRB!RC0:Q1?`?M0Cl1(B (buffer list) + C-x C-c ,T`0ET1!!RCc0*i1(B Editor ,TaEP`0!g1:0CQ1!IRa0?i1A0"i1M0AY1Eb4B0MQ15b90AQ105T1(B ,Ta05h106i1RKR!0AU1a0?i1A(B + 0,T"i1M0AY1E:R'0MQ1906Y1!a0!i1d"(B 0,T!g1c0Ki16RA0Gh1R(P`0!g1:0CQ1!IRa0?i1A0"i1M0AY1E09Qi19dKA(B ,Tb4B07Qh1Gd;(B + ,T!RCMM!(R!(B Emacs ,T7Sd04i1b4B$S0JQh1'(B C-x C-s C-x C-c 0,T$W1Mc0Ki1`0!g1:0CQ1!IR(B + 0,T!h1M9a0Ei1G0(V1'`0ET1!(B - ¤ÓÊÑ觢ÂÒÂà¾ÔèÁẺª×è͹Ñé¹ ãªéÊÓËÃѺ¤ÓÊÑ觷ÕèäÁè¤èÍÂä´éãªé ËÃ×ͤÓÊÑ觷Õèãªé੾ÒСѺâËÁ´¾ÔàÈɺҧ -âËÁ´ µÑÇÍÂèÒ§àªè¹ ¤ÓÊÑè§ "command-apropos" «Ö觨жÒÁ ¤ÕÂìàÇÔÃì´ (keyword) áÅéÇáÊ´§¼Å -¤ÓÊÑ觷ء¤ÓÊÑ觷ÕèÁÕª×èÍà¡ÕèÂÇ¢éͧ¡Ñº¡Ñº¤ÕÂìàÇÔÃì´¹Ñé¹ àÇÅÒ¨ÐÊÑ觤ÓÊÑ觹Õé ¡çãËé¡´ ESC x áÅéǨÐÁÕµÑÇÍÑ¡Éà -"M-x" »ÃÒ¡¯¢Öé¹·ÕèÊèǹÅèÒ§¢Í§¨Í ¨Ò¡¹Ñ鹡çãËéãÊèª×èͤÓÊÑ觷Õèµéͧ¡Òà (㹡óչÕé¤×Í -"command-apropos") àÁ×èÍ»é͹¢éÍÁÙÅ件֧ "command-a" áÅéÇ¡´ SPACE BAR Êèǹ·ÕèàËÅ×ͧ͢ -ª×èͤÓÊÑ觡ç¨Ð¶Ù¡àµÔÁàµçÁ (completion) ãËéàͧâ´ÂÍѵâ¹ÁÑµÔ ËÅѧ¨Ò¡¹Ñé¹ ¨Ð¶Ù¡¶ÒÁ¤ÕÂìàÇÔÃì´ ¡çãËé -¡´ÊÒÂÍÑ¡¢ÃÐ (string) ·Õèµéͧ¡ÒÃÃÙéÅ§ä» µéͧäÁèãÊè¤ÕÂìàÇÔÃì´ÍÐäÃàÅ ¡ç¨Ðä´é¤ÓÊÑ觷Ñé§ËÁ´·ÕèÁÕÍÂÙè + ,T$S0JQh1'"BRB`0>Th1Aa::0*Wh1M09Qi19(B ,Tc0*i1JSK0CQ1:$S0JQh1'07Uh1d0Ah10$h1MBd04i1c0*i1(B ,TK0CW1M$S0JQh1'07Uh1c0*i1`)>RP0!Q1:bKA40>T1`HI:R'(B +,TbKA4(B 0,T5Q1GM0Bh1R'`0*h19(B ,T$S0JQh1'(B "command-apropos" 0,T+Vh1'(P6RA(B 0,T$U10Bl1`0GT10Cl14(B (keyword) ,Ta0Ei1GaJ4'> Åͧ¡´ ESC x µÒÁ´éÇ "command-apropos" ËÃ×Í - "command-a" ËÅѧ¨Ò¡¹Ñ鹡硴 "kanji" ´Ù + >> ,TEM'!4(B ESC x ,T5RA04i1GB(B "command-apropos" ,TK0CW1M(B + "command-a" ,TK0EQ1'(R!09Qi190!g1!4(B "kanji" 0,T4Y1(B - ãËé¡´ C-x 1 àÇÅÒµéͧ¡ÒèÐź "ÇÔ¹â´Çì" ·Õèâ¼Åè¢Öé¹ÁÒãËÁè + ,Tc0Ki1!4(B C-x 1 ,T`GER05i1M'!RC(PE:(B "0,TGT19b40Gl1(B" 0,T7Uh1b<0Eh10"Vi19ARcK0Ah1(B -ºÃ÷ѴâËÁ´ (Mode Line) +,T:CC07Q14bKA4(B (Mode Line) ===================== - àÇÅÒ·Õè¾ÔÁ¾ì¤ÓÊÑè§à¢éÒ仪éÒ æ Emacs ¨ÐáÊ´§ÊÔ觷Õè¾ÔÁ¾ìŧ仵çºÃ÷ѴÅèÒ§ÊØ´¢Í§¨Í«Öè§àÃÕ¡ -ÇèÒ echo area ºÃ÷Ѵ«Öè§ÍÂÙè¶Ñ´¢Öé¹ÁÒ˹Ö觺Ã÷Ѵ àÃÕ¡ÇèÒºÃ÷ѴâËÁ´ (mode line) ºÃ÷Ѵ -âËÁ´ÁÕÅѡɳдѧ¹Õé + ,T`GER07Uh10>T1A0>l1$S0JQh1'`0"i1Rd;0*i1R(B ,Tf(B Emacs ,T(PaJ4'0JTh1'07Uh10>T1A0>l1E'd;5C':CC07Q140Eh1R'0JX14"M'(M0+Vh1'`0CU1B!(B +0,TGh1R(B echo area ,T:CC07Q140+Vh1'M0BYh106Q140"Vi19ARK09Vh1':CC07Q14(B ,T`0CU1B!0Gh1R:CC07Q14bKA4(B (mode line) ,T:CC07Q14(B +,TbKA40AU10EQ1!I3P04Q1'09Ui1(B [--]J:--**-Mule: TUTORIAL.th (Fundamental) ---NN%-------------- -ËÁÒÂà˵Ø: µÃ§Êèǹ NN ¢Í§ NN% ¨ÐÁÕµÑÇàÅ¢ãÊèÍÂÙè ºÃ÷ѴâËÁ´·ÕèáÊ´§ÍÂÙèÍÒ¨¨ÐᵡµèÒ§ - 仨ҡµÑÇÍÂèÒ§ºéÒ§ áµè¡çäÁèà»ç¹äà µÑÇÍÂèÒ§àªè¹ ÍÒ¨¨ÐÁÕàÇÅÒËÃ×Í uptime - áÊ´§¼ÅÍÂÙè Íѹ¹Õéà»ç¹¤ÇÒÁÊÒÁÒö¢Í§â»Ãá¡ÃÁ display-time +,TKARB`K05X1(B: ,T5C'0Jh1G9(B NN ,T"M'(B NN% ,T(P0AU105Q1G`E"c0Jh1M0BYh1(B ,T:CC07Q14bKA407Uh1aJ4'M0BYh1MR((Pa5!05h1R'(B + ,Td;(R!05Q1GM0Bh1R'0:i1R'(B ,Ta05h10!g1d0Ah1`0;g19dC(B 0,T5Q1GM0Bh1R'`0*h19(B ,TMR((P0AU1`GERK0CW1M(B uptime + ,TaJ4'D05T1!CCA07Uh1a5!05h1R'0!Q19b4B0JTi19`0*T1'(B ,T`0AWh1MM0BYh1c9bKA4K0EQ1!07Uh105h1R'0!Q19(B 0,T5Q1GM0Bh1R'(B +,T`0*h19(B ,T`GERb;Ca!CA@RIR(B ,T(P0AU1$S0JQh1'JSK0CQ1:J0Ci1R'(B ,TKARB`K05X1(B (comment) ,TM0BYh1(B ,T`09Wh1M'(R!0GT108U1c0Jh1(B +,TKARB`K05X1"M'@RIRa05h1EP@RIRa5!05h1R'0!Q19(B ,T$S0JQh1'09Ui10!g1(Pa5!05h1R'0!Q19d;c9a05h1EPbKA4K0EQ1!(B ,T`0>Wh1Mc0Ki1(B +,TJRARC6c0Jh1KARB`K05X1c9a05h1EP@RIRd04i1M0Bh1R'06Y1!05i1M'(B - ¤ÓÊÑè§ÊÓËÃѺ¡ÒÃà»ÅÕè¹âËÁ´ãËéà»ç¹âËÁ´ËÅÑ¡Í×è¹ ¤×ͤÓÊÑ觢ÂÒ (extend) «Ö觪×èͤÓÊÑè§à»ç¹ª×èÍ -âËÁ´ µÑÇÍÂèÒ§àªè¹ ¤ÓÊÑè§ M-x fundamental-mode ¤×ͤÓÊÑè§ÊÓËÃѺà»ÅÕè¹âËÁ´à»ç¹âËÁ´ + ,T$S0JQh1'JSK0CQ1:!RC`;0EUh1B9bKA4c0Ki1`0;g19bKA4K0EQ1!0MWh19(B 0,T$W1M$S0JQh1'"BRB(B (extend) 0,T+Vh1'0*Wh1M$S0JQh1'`0;g190*Wh1M(B +,TbKA4(B 0,T5Q1GM0Bh1R'`0*h19(B ,T$S0JQh1'(B M-x fundamental-mode 0,T$W1M$S0JQh1'JSK0CQ1:`;0EUh1B9bKA4`0;g19bKA4(B Fundamental - àÇÅÒ·Õè¨Ðá¡éä¢á¿éÁ¢éÍÁÙÅÀÒÉÒÍѧ¡ÄÉ ¡çãËéãªé Text mode + ,T`GER07Uh1(Pa0!i1d"a0?i1A0"i1M0AY1E@RIR0MQ1'!DI(B 0,T!g1c0Ki1c0*i1(B Text mode - >> Åͧ»é͹¤ÓÊÑè§ M-x text-mode + >> ,TEM'0;i1M9$S0JQh1'(B M-x text-mode - ¶éÒµéͧ¡ÒÃËÒ¢éÍÁÙÅà¾ÔèÁà¡ÕèÂǡѺâËÁ´ËÅÑ¡·ÕèãªéÍÂÙè㹻Ѩ¨ØºÑ¹ ¡çãËé»é͹¤ÓÊÑè§ C-h m + 0,T6i1R05i1M'!RCKR0"i1M0AY1E`0>Th1A`0!Uh1BG0!Q1:bKA4K0EQ1!07Uh1c0*i1M0BYh1c90;Q1(0(X10:Q19(B 0,T!g1c0Ki10;i1M9$S0JQh1'(B C-h m - >> ãËé¡´ C-h m à¾×èÍÈÖ¡ÉÒ¢éÍᵡµèÒ§ÃÐËÇèÒ§ Text mode ¡Ñº Fundamental mode + >> ,Tc0Ki1!4(B C-h m ,T`0>Wh1M0HV1!IR0"i1Ma5!05h1R'CPK0Gh1R'(B Text mode 0,T!Q1:(B Fundamental mode - >> ãËé¡´ C-x 1 à¾×èÍźàÍ¡ÊÒÃÍÍ¡¨Ò¡¨Í + >> ,Tc0Ki1!4(B C-x 1 ,T`0>Wh1ME:`M!JRCMM!(R!(M(B - µÃ§Êèǹ«éÒ¢ͧºÃ÷ѴâËÁ´ ¨ÐÁÕÊÑ­Åѡɳì '[--]' à¾×èÍáÊ´§âËÁ´ÊÓËÃѺ¡Òûé͹¢éÍÁÙÅ -(input mode) ÍÂÙè ÊÑ­Åѡɳì [--] ËÁÒ¶֧ÊÒÁÒö»é͹¢éÍÁÙÅä´é´éǵÑÇÍÑ¡ÉÃÀÒÉÒÍѧ¡ÄÉ -(English alphabets) ¡ÃسÒÍèÒ¹¤ÙèÁ×ͧ͢ "Tamago" ÊÓËÃѺÃÒÂÅÐàÍÕ´¢Í§ÇÔ¸Õãªé + ,T5C'0Jh1G90+i1RB"M':CC07Q14bKA4(B ,T(P0AU10JQ1-0EQ1!I03l1(B '[--]' ,T`0>Wh1MaJ4'bKA4JSK0CQ1:!RC0;i1M90"i1M0AY1E(B +(input mode) ,TM0BYh1(B 0,TJQ1-0EQ1!I03l1(B [--] ,TKARB06V1'JRARC60;i1M90"i1M0AY1Ed04i104i1GB05Q1G0MQ1!IC@RIR0MQ1'!DI(B +(English alphabets) ,T!0CX13R0Mh1R90$Yh10AW1M"M'(B "Tamago" ,TJSK0CQ1:CRBEP`0MU1B4"M'0GT108U1c0*i1(B - áÅеç´éÒ¹¢ÇҢͧÊÑ­Åѡɳì¹Ñé¹ ¨ÐÁÕà¤Ã×èͧËÁÒÂáÊ´§Ê¶Ò¹Ð¢Í§ flag ¢Í§ÃкºÃËÑÊ -(coding-system) ÍÂÙè Mule ÊÒÁÒö¡Ó˹´ÃкºÃËÑÊá¡੾ÒÐÊÓËÃѺ ¡ÒÃà¡çºÍèÒ¹á¿éÁ¢éÍÁÙÅ -¡Òûé͹¢éÍÁÙŨҡ¤ÕÂìºÍÃì´ ¡ÒÃáÊ´§¼ÅÍÍ¡·Ò§¨Í ä´éÍÔÊÃШҡ¡Ñ¹ áµèâ´Â»¡µÔ¨ÐáÊ´§à©¾ÒÐ -ÊÑ­ÅѡɳìªèÇÂ¨Ó (mnemonic) ¢Í§ÃкºÃËÑÊÊÓËÃѺ¡ÒÃà¡çºÍèÒ¹á¿éÁ¢éÍÁÙÅ à·èÒ¹Ñé¹ + ,TaEP5C'04i1R9"GR"M'0JQ1-0EQ1!I03l109Qi19(B ,T(P0AU1`$0CWh1M'KARBaJ4'J6R9P"M'(B flag ,T"M'CP::C0KQ1J(B +(coding-system) ,TM0BYh1(B Mule ,TJRARC6!SK94CP::C0KQ1JaB!`)>RPJSK0CQ1:(B ,T!RC`0!g1:0Mh1R9a0?i1A0"i1M0AY1E(B +,T!RC0;i1M90"i1M0AY1E(R!0$U10Bl1:M0Cl14(B ,T!RCaJ4'RP(B +0,TJQ1-0EQ1!I03l10*h1GB(S(B (mnemonic) ,T"M'CP::C0KQ1JJSK0CQ1:!RC`0!g1:0Mh1R9a0?i1A0"i1M0AY1E(B ,T`07h1R09Qi19(B - >> µÃǨ´ÙÇèÒÁÕÊÑ­ÅÑ¡É³ì ¤ÅéÒ¤ÅÖ§¡Ñº "J:" "S:" "E:" áÊ´§ÍÂÙè·ÕèºÃ÷ѴâËÁ´ËÃ×ÍäÁè + >> ,T5CG(04Y10Gh1R0AU10JQ1-0EQ1!I03l1(B ,T$0Ei1RB$0EV1'0!Q1:(B "J:" "S:" "E:" ,TaJ4'M0BYh107Uh1:CC07Q14bKA4K0CW1Md0Ah1(B - µÑÇÍÑ¡ÉõÑÇáá¤×Í ÊÑ­ÅѡɳìªèÇÂ¨Ó (mnemonic) ¢Í§ÃкºÃËÑÊ·ÕèãªéÍÂÙè µÑÇ ':' áÊ´§ãËéÃÙé -ÇèÒÁÕµÑÇÍÑ¡ÉâͧÀÒÉÒÍ×è¹ ¹Í¡¨Ò¡ÀÒÉÒÍѧ¡ÄÉáÊ´§ÍÂÙè (àªè¹ ÀÒÉÒ¨Õ¹ ÀÒÉÒ­Õè»Øè¹ à»ç¹µé¹) µÑÇ J -ËÁÒ¶֧ ÃËÑÊ·Õèãªé¡Ñº JUNET ¤×Í ÃËÑÊ JIS µÑÇ S ËÁÒ¶֧ Shift-JIS áÅÐ µÑÇ E ËÁÒ¶֧ -ÃËÑÊ EUC ÀÒÉÒ­Õè»Øè¹ ¨ÐÊÅѺà»ÅÕè¹ (toggle) ¡ÒÃáÊ´§¼ÅÀÒÉÒ¹Ò¹ÒªÒµÔä´éâ´Â C-x C-k t + 0,T5Q1G0MQ1!IC05Q1GaC!0$W1M(B 0,TJQ1-0EQ1!I03l10*h1GB(S(B (mnemonic) ,T"M'CP::C0KQ1J07Uh1c0*i1M0BYh1(B 0,T5Q1G(B ':' ,TaJ4'c0Ki10CYi1(B +0,TGh1R0AU105Q1G0MQ1!IC"M'@RIR0MWh19(B ,T9M!(R!@RIR0MQ1'!DIaJ4'M0BYh1(B (,T`0*h19(B ,T@RIR0(U19(B ,T@RIR0-Uh10;Xh19(B ,T`0;g1905i19(B) 0,T5Q1G(B J +,TKARB06V1'(B ,TC0KQ1J07Uh1c0*i10!Q1:(B JUNET 0,T$W1M(B ,TC0KQ1J(B JIS 0,T5Q1G(B S ,TKARB06V1'(B Shift-JIS ,TaEP(B 0,T5Q1G(B E ,TKARB06V1'(B +,TC0KQ1J(B EUC ,T@RIR0-Uh10;Xh19(B ,T(PJ0EQ1:`;0EUh1B9(B (toggle) ,T!RCaJ4'> Åͧ»é͹¤ÓÊÑè§ C-x C-k t ´ÙÊͧ¤ÃÑé§ + >> ,TEM'0;i1M9$S0JQh1'(B C-x C-k t 0,T4Y1JM'$0CQi1'(B - ¶éÒà·ÍÃìÁÔ¹ÑÅ·ÕèãªéÍÂÙèÁÕ»ØèÁ META áÅÐâËÁ´·ÕèãªéÍÂÙèà»ç¹ÃËÑÊ JIS àÃÒ¡ç¨ÐÊÒÁÒöãªé»ØèÁ META -á·¹¡Òá´»ØèÁ ESCAPE ä´é ÇÔ¸Õãªé¨ÐàËÁ×͹¡Ñº¡ÒÃãªé»ØèÁ¤Í¹â·ÃÅ ¤×ÍãËé¡´»ØèÁ META ¤éÒ§äÇéáÅéǨ֧ -¡´µÑÇÍÑ¡ÉõÒÁ M-<µÑÇÍÑ¡ÉÃ> ¨Ð·Ó˹éÒ·ÕèàËÁ×͹¡Ñº ESC <µÑÇÍÑ¡ÉÃ> ¹Ñ蹤×Í ·Ø¡ÍÂèÒ§·Õè͸ԺÒÂÁÒ -¨¹¶Ö§¨Ø´¹Õé ¨ÐÂѧ¤§ÁÕ¼ÅàËÁ×͹à´ÔÁ ËÅѧ¨Ò¡à»ÅÕè¹ ESC <µÑÇÍÑ¡ÉÃ> ãËéà»ç¹ M-<µÑÇÍÑ¡ÉÃ> áµè¢éÍ -¤ÇÃÃÐÇѧ¡ç¤×Í »ØèÁ META ¨ÐäÁèÊÒÁÒöãªéä´é¡ÑºÃËÑÊ Shift-JIS áÅÐ EUC + 0,T6i1R`7M0Cl10AT109Q1E07Uh1c0*i1M0BYh10AU10;Xh1A(B META ,TaEPbKA407Uh1c0*i1M0BYh1`0;g19C0KQ1J(B JIS ,T`CR0!g1(PJRARC6c0*i10;Xh1A(B META +,Ta79!RC!40;Xh1A(B ESCAPE ,Td04i1(B 0,TGT108U1c0*i1(P`K0AW1M90!Q1:!RCc0*i10;Xh1A$M9b7CE(B 0,T$W1Mc0Ki1!40;Xh1A(B META 0,T$i1R'd0Gi1a0Ei1G0(V1'(B +,T!405Q1G0MQ1!IC5RA(B M-<0,T5Q1G0MQ1!IC(B> ,T(P7SK09i1R07Uh1`K0AW1M90!Q1:(B ESC <0,T5Q1G0MQ1!IC(B> 0,T9Qh190$W1M(B 0,T7X1!M0Bh1R'07Uh1M08T1:RBAR(B +,T(906V1'0(X1409Ui1(B ,T(P0BQ1'$'0AU1 ,Tc0Ki1`0;g19(B M-<0,T5Q1G0MQ1!IC(B> ,Ta05h10"i1M(B +,T$GCCP0GQ1'0!g10$W1M(B 0,T;Xh1A(B META ,T(Pd0Ah1JRARC6c0*i1d04i10!Q1:C0KQ1J(B Shift-JIS ,TaEP(B EUC - ¡ÒÃà»ÅÕè¹ÃкºÃËÑʨÐÁÕ¼Åá¤èà¾Õ§¡ÑºáµèÅкѿà¿ÍÃìà·èÒ¹Ñé¹ ÊÒÁÒö´Ù¤ÓÊÑè§à¡ÕèÂǡѺÃкºÃËÑÊ -ä´éâ´Â¤ÓÊÑè§ C-h a coding-system + ,T!RC`;0EUh1B9CP::C0KQ1J(P0AU1U1B'0!Q1:a05h1EP0:Q1?`?M0Cl1`07h1R09Qi19(B ,TJRARC604Y1$S0JQh1'`0!Uh1BG0!Q1:CP::C0KQ1J(B +,Td04i1b4B$S0JQh1'(B C-h a coding-system - >> ãËé»é͹¤ÓÊÑè§ C-h a coding-system áÅéÇÍèÒ¹ÃÒÂÅÐàÍÕ´¢Í§¤ÓÊÑè§ - set-display-coding-system set-file-coding-system áÅÐ - set-process-coding-system ¨Ò¡àÍ¡ÊÒ÷Õè»ÃÒ¡¯¢Öé¹ + >> ,Tc0Ki10;i1M9$S0JQh1'(B C-h a coding-system ,Ta0Ei1G0Mh1R9CRBEP`0MU1B4"M'$S0JQh1'(B + set-display-coding-system set-file-coding-system ,TaEP(B + set-process-coding-system ,T(R!`M!JRC07Uh1;CR!/0"Vi19(B -¡Òäé¹ËÒ (search) +,T!RC0$i19KR(B (search) ================ - Emacs ÊÒÁÒö¤é¹ËÒÊÒÂÍÑ¡¢ÃÐ (string) ÀÒÂã¹á¿éÁ¢éÍÁÙÅä»·Ò§¢éҧ˹éÒËÃ×Í¢éÒ§ËÅѧä´é -¶éÒµéͧ¡Òäé¹ËÒä»·Ò§¢éҧ˹éҢͧµÓá˹è§à¤ÍÃìà«ÍÃì (cursor) ¡çãËé¡´ C-s ¶éÒµéͧ¡Òäé¹ËÒ -ä»·Ò§¢éÒ§ËÅѧ¢Í§µÓá˹è§à¤ÍÃìà«ÍÃì ¡çãËé¡´ C-r ËÅѧ¨Ò¡¹Ñ鹨ÐÁÕ¢éͤÇÒÁÇèÒ "I-search:" -»ÃÒ¡¯¢Ö鹵ç echo area ¡àÅÔ¡¡Òäé¹ËÒä´é´éÇ¡Òá´ ESC + Emacs ,TJRARC60$i19KRJRB0MQ1!"CP(B (string) ,T@RBc9a0?i1A0"i1M0AY1Ed;7R'0"i1R'K09i1RK0CW1M0"i1R'K0EQ1'd04i1(B +0,T6i1R05i1M'!RC0$i19KRd;7R'0"i1R'K09i1R"M'5SaK09h1'`$M0Cl1`+M0Cl1(B (cursor) 0,T!g1c0Ki1!4(B C-s 0,T6i1R05i1M'!RC0$i19KR(B +,Td;7R'0"i1R'K0EQ1'"M'5SaK09h1'`$M0Cl1`+M0Cl1(B 0,T!g1c0Ki1!4(B C-r ,TK0EQ1'(R!09Qi19(P0AU10"i1M$GRA0Gh1R(B "I-search:" +,T;CR!/0"Vi195C'(B echo area ,TB!`0ET1!!RC0$i19KRd04i104i1GB!RC!4(B ESC - >> ¡´ C-s à¾×èÍàÃÔèÁ¡Òäé¹ËÒ áÅéÇ¡´µÑÇÍÑ¡Éâͧ¤ÓÇèÒ "cursor" ŧ价ÕÅеÑÇÍÂèÒ§ - ªéÒ áÅéÇÊѧࡵ´ÙÇèÒà¤ÍÃìà«ÍÃì¢ÂѺä»ÍÂèÒ§äà + >> ,T!4(B C-s ,T`0>Wh1M`0CTh1A!RC0$i19KR(B ,Ta0Ei1G!405Q1G0MQ1!IC"M'$S0Gh1R(B "cursor" ,TE'd;07U1EP05Q1GM0Bh1R'(B + 0,T*i1R(B ,Ta0Ei1G0JQ1'`!504Y10Gh1R`$M0Cl1`+M0Cl1"0BQ1:d;M0Bh1R'dC(B - >> Åͧ¡´ C-s ´ÙÍա˹Ö觤ÃÑé§à¾×èͤé¹ËÒ¤ÓÇèÒ "cursor" µÑǵèÍä» + >> ,TEM'!4(B C-s 0,T4Y10MU1!K09Vh1'$0CQi1'`0>Wh1M0$i19KR$S0Gh1R(B "cursor" 0,T5Q1G05h1Md;(B - >> ¡´ ´Ù 4 ¤ÃÑé§ áÅéÇÊѧࡵ´ÙÇèÒ¡ÒÃà¤Å×è͹·Õè¢Í§à¤ÍÃìà«ÍÃì + >> ,T!4(B 0,T4Y1(B 4 ,T$0CQi1'(B ,Ta0Ei1G0JQ1'`!504Y10Gh1R!RC`$0EWh1M907Uh1"M'`$M0Cl1`+M0Cl1(B - >> ¡´ ESC à¾×èÍ¡àÅÔ¡¡Òäé¹ËÒ + >> ,T!4(B ESC ,T`0>Wh1MB!`0ET1!!RC0$i19KR(B - ¡Òäé¹ËÒ¨ÐàÃÔèÁ¢Ö鹷ѹ·Õ ã¹ÃÐËÇèÒ§·Õè¾ÔÁ¾ìÊÒÂÍÑ¡¢ÃзÕèµéͧ¡ÒèФé¹ËÒ à¢éÒä»à¾Õ§ºÒ§Êèǹ -¶éÒµéͧ¡ÒèФé¹ËÒµÑǵèÍä» ¡çãËé¡´ C-s Íա˹Ö觤ÃÑé§ ¶éÒËÒ¡¤é¹ËÒÊÒÂÍÑ¡¢ÃзÕè»é͹à¢éÒä»äÁ辺 ¡ç -¨ÐÁÕ¢éͤÇÒÁ»ÃÒ¡¯¢Öé¹ ãËé¡´ C-g à¾×èÍ¡àÅÔ¡ + ,T!RC0$i19KR(P`0CTh1A0"Vi1907Q1907U1(B ,Tc9CPK0Gh1R'07Uh10>T1A0>l1JRB0MQ1!"CP07Uh105i1M'!RC(P0$i19KR(B ,T`0"i1Rd;`0>U1B':R'0Jh1G9(B +0,T6i1R05i1M'!RC(P0$i19KR05Q1G05h1Md;(B 0,T!g1c0Ki1!4(B C-s 0,TMU1!K09Vh1'$0CQi1'(B 0,T6i1RKR!0$i19KRJRB0MQ1!"CP07Uh10;i1M9`0"i1Rd;d0Ah1>:(B 0,T!g1(B +,T(P0AU10"i1M$GRA;CR!/0"Vi19(B ,Tc0Ki1!4(B C-g ,T`0>Wh1MB!`0ET1!(B - ÃÐËÇèÒ§·Õè¤é¹ËÒÍÂÙè ¶éÒ¡´ µÑÇÍÑ¡ÉõÑÇÊØ´·éÒÂã¹ÊÒÂÍÑ¡¢ÃСç¨Ð¶Ù¡Åºä» áÅéÇ -à¤ÍÃìà«ÍÃì¡ç¨Ð¡ÅѺ仵Óá˹觡è͹˹éÒ µÑÇÍÂèÒ§àªè¹ ¶éÒ¡´ "cu" ¡ç¨Ð¤é¹ËÒ件֧µÓá˹觷ÕèÁÕ¤ÓÇèÒ -"cu" áµè¶éÒ¡´ 㹨ѧËÇйÕé µÑÇ 'u' ã¹ search line ¡ç¨ÐËÒÂä» áÅéÇà¤ÍÃìà«ÍÃì -¨Ð¢ÂѺ¡ÅѺ价ÕèµÓá˹觷ÕèÁÕµÑÇ 'c' ÍÂÙè + ,TCPK0Gh1R'07Uh10$i19KRM0BYh1(B 0,T6i1R!4(B 0,T5Q1G0MQ1!IC05Q1G0JX1407i1RBc9JRB0MQ1!"CP0!g1(P06Y1!E:d;(B ,Ta0Ei1G(B +,T`$M0Cl1`+M0Cl10!g1(P!0EQ1:d;5SaK09h1'0!h1M9K09i1R(B 0,T5Q1GM0Bh1R'`0*h19(B 0,T6i1R!4(B "cu" 0,T!g1(P0$i19KRd;06V1'5SaK09h1'07Uh10AU1$S0Gh1R(B +"cu" ,Ta05h106i1R!4(B ,Tc90(Q1'KGP09Ui1(B 0,T5Q1G(B 'u' ,Tc9(B search line 0,T!g1(PKRBd;(B ,Ta0Ei1G`$M0Cl1`+M0Cl1(B +,T(P"0BQ1:!0EQ1:d;07Uh15SaK09h1'07Uh10AU105Q1G(B 'c' ,TM0BYh1(B - ¶éÒ¡´µÑÇÍÑ¡Éä͹â·ÃÅ (control character) µÑÇÍ×è¹ ¹Í¡à˹×ͨҡ C-s ËÃ×Í C-r -¡Òäé¹ËÒ¡ç¨ÐÊÔé¹Êشŧ + 0,T6i1R!405Q1G0MQ1!IC$M9b7CE(B (control character) 0,T5Q1G0MWh19(B ,T9M!`K09W1M(R!(B C-s ,TK0CW1M(B C-r +,T!RC0$i19KR0!g1(P0JTi190JX14E'(B - ¤ÓÊÑè§ C-s ¨Ð¤é¹ËÒÊÒÂÍÑ¡¢ÃзÕèµéͧ¡Òà 价ҧ¢éҧ˹éҢͧµÓá˹è§à¤ÍÃìà«ÍÃì ¶éÒµéͧ¡Òà -¤é¹ËÒä»·Ò§·ÔÈËÅѧ ¡çãËé¡´ C-r ¹Ñ蹤×Í ÊÒÁÒöãªé C-s áÅÐ C-r ÊÅѺ¡Ñ¹à¾×èͤé¹ËÒä»ä´éã¹·Ñé§ -Êͧ·ÔÈ·Ò§ C-s áÅÐ C-r ·Ó˹éÒ·ÕèàËÁ×͹¡Ñ¹·Ø¡»ÃСÒà ¨ÐµèÒ§¡Ñ¹¡çµÃ§·ÔÈ·Ò§¡Òäé¹ËÒà·èÒ¹Ñé¹ + ,T$S0JQh1'(B C-s ,T(P0$i19KRJRB0MQ1!"CP07Uh105i1M'!RC(B ,Td;7R'0"i1R'K09i1R"M'5SaK09h1'`$M0Cl1`+M0Cl1(B 0,T6i1R05i1M'!RC(B +0,T$i19KRd;7R'07T1HK0EQ1'(B 0,T!g1c0Ki1!4(B C-r 0,T9Qh190$W1M(B ,TJRARC6c0*i1(B C-s ,TaEP(B C-r ,TJ0EQ1:0!Q19`0>Wh1M0$i19KRd;d04i1c907Qi1'(B +,TJM'07T1H7R'(B C-s ,TaEP(B C-r ,T7SK09i1R07Uh1`K0AW1M90!Q1907X1!;CP!RC(B ,T(P05h1R'0!Q190!g15C'07T1H7R'!RC0$i19KR`07h1R09Qi19(B Recursive Editing Level - ºÒ§·Õ àÃÒÍÒ¨¨ÐËÅØ´à¢éÒä»ÍÂÙèã¹Ê¶Ò¹Ð·ÕèàÃÕ¡ÇèÒ Recursive Editing Level ä´éâ´Â -äÁèµÑé§ã¨ ã¹âËÁ´¹Õé à¤Ã×èͧËÁÒÂǧàÅçº '()' ·ÕèáÊ´§ª×èÍâËÁ´ËÅÑ¡ (major mode) ÍÂÙè¨ÐÁÕǧàÅçº -'[]' ÅéÍÁ à¾ÔèÁ¢Öé¹Íա˹Ö觪Ñé¹ µÑÇÍÂèÒ§àªè¹ ¶éÒà´ÔÁà»ç¹ (Fundamental) ÍÂÙè ¡ç¨Ðà»ÅÕè¹à»ç¹ -[(Fundamental)] á·¹ + ,T:R'07U1(B ,T`CRMR((PK0EX14`0"i1Rd;M0BYh1c9J6R9P07Uh1`0CU1B!0Gh1R(B Recursive Editing Level ,Td04i1b4B(B +,Td0Ah105Qi1'c((B ,Tc9bKA409Ui1(B ,T`$0CWh1M'KARBG'`0Eg1:(B '()' 0,T7Uh1aJ4'0*Wh1MbKA4K0EQ1!(B (major mode) ,TM0BYh1(P0AU1G'`0Eg1:(B +'[]' 0,TEi1MA(B ,T`0>Th1A0"Vi190MU1!K09Vh1'0*Qi19(B 0,T5Q1GM0Bh1R'`0*h19(B 0,T6i1R`04T1A`0;g19(B (Fundamental) ,TM0BYh1(B 0,T!g1(P`;0EUh1B9`0;g19(B +[(Fundamental)] ,Ta79(B -ËÁÒÂà˵Ø: àÃÒ¨ÐäÁè͸ԺÒÂà¡ÕèÂǡѺ Recursive Editing Level ã¹·Õè¹Õé +,TKARB`K05X1(B: ,T`CR(Pd0Ah1M08T1:RB`0!Uh1BG0!Q1:(B Recursive Editing Level ,Tc907Uh109Ui1(B - ãËé¡´ M-x top-level à¾×èÍ·Õè¨ÐÍÍ¡¨Ò¡ Recursive Editing Level + ,Tc0Ki1!4(B M-x top-level ,T`0>Wh1M07Uh1(PMM!(R!(B Recursive Editing Level - >> Åͧ¡´´Ù µÃ§ÊèǹÅèÒ§¢Í§¨Í¨ÐÁÕ¢éͤÇÒÁÇèÒ "Back to top level" »ÃÒ¡¯¢Öé¹ + >> ,TEM'!404Y1(B ,T5C'0Jh1G90Eh1R'"M'(M(P0AU10"i1M$GRA0Gh1R(B "Back to top level" ,T;CR!/0"Vi19(B - à¹×èͧ¨Ò¡ àÃÒÍÂÙèã¹ÃдѺº¹ÊØ´ (top level) ÍÂÙèáÅéÇ ¤ÓÊÑ觹Õé¨Ö§äÁèÁÕ¼Åã´ æ + ,T`09Wh1M'(R!(B ,T`CRM0BYh1c9CP04Q1::90JX14(B (top level) ,TM0BYh1a0Ei1G(B ,T$S0JQh1'09Ui10(V1'd0Ah10AU1Wh1M07Uh1(PMM!(R!(B Recursive Editing Level ,Td04i1(B Help ==== - Emacs ÁÕ¤ÇÒÁÊÒÁÒö·ÕèÁÕ»ÃÐ⪹ì ÁÒ¡ÁÒÂËÅÒÂÍÂèÒ§ «Öè§äÁèÊÒÁÒö͸ԺÒÂä´éËÁ´ã¹·Õè¹Õé -áµèàÃÒ¨ÐÊÒÁÒöàÃÕ¡ãªé à¾×èÍ·Õè¨ÐàÃÕ¹ÃÙé¤ÇÒÁÊÒÁÒöàËÅèÒ¹Õé ä´éâ´Â¡Òá´ C-h «Ö觨Р-ªèÇÂãËéàÃÒä´éÃѺÃÙé¢éÍÁÙÅà¾ÔèÁàµÔÁËÅÒÂÍÂèÒ§ + Emacs 0,TAU1$GRAJRARC607Uh10AU1;CPbB*09l1(B ,TAR!ARBKERBM0Bh1R'(B 0,T+Vh1'd0Ah1JRARC6M08T1:RBd04i1KA4c907Uh109Ui1(B +,Ta05h1`CR(PJRARC6`0CU1B!c0*i1(B ,T`0>Wh1M07Uh1(P`0CU1B90CYi1$GRAJRARC6`K0Eh1R09Ui1(B ,Td04i1b4B!RC!4(B C-h 0,T+Vh1'(P(B +0,T*h1GBc0Ki1`CRd04i10CQ1:0CYi10"i1M0AY1E`0>Th1A`05T1AKERBM0Bh1R'(B - ÇÔ¸Õãªé¤×ÍãËé¡´ C-h áÅéǵÒÁ´éǵÑÇàÅ×Í¡ (option) Íա˹Ö觵ÑÇÍÑ¡Éà ¶éÒäÁèÃÙéÇèҨеéͧãªé -µÑÇàÅ×Í¡ÍÐäà ¡çãËé¡´ C-h ? áÅéǨÐÁÕ¤Ó͸ԺÒÂà¡ÕèÂǡѺµÑÇàÅ×Í¡»ÃÒ¡¯¢Öé¹ ä´éËÒ¡à»ÅÕè¹㨨Р-äÁèàÃÕ¡ HELP ËÅѧ¨Ò¡¡´ C-h ¡çãËé¡´ C-g à¾×èÍ¡àÅÔ¡ä´é + 0,TGT108U1c0*i10$W1Mc0Ki1!4(B C-h ,Ta0Ei1G5RA04i1GB05Q1G`0EW1M!(B (option) 0,TMU1!K09Vh1'05Q1G0MQ1!IC(B 0,T6i1Rd0Ah10CYi10Gh1R(P05i1M'c0*i1(B +0,T5Q1G`0EW1M!MPdC(B 0,T!g1c0Ki1!4(B C-h ? ,Ta0Ei1G(P0AU1$SM08T1:RB`0!Uh1BG0!Q1:05Q1G`0EW1M!;CR!/0"Vi19(B ,Td04i1KR!`;0EUh1B9c((P(B +,Td0Ah1`0CU1B!(B HELP ,TK0EQ1'(R!!4(B C-h 0,T!g1c0Ki1!4(B C-g ,T`0>Wh1MB!`0ET1!d04i1(B - ¤ÓÊÑè§ HELP ¾×é¹°Ò¹·ÕèÊØ´Íѹ˹Ö觡ç¤×Í C-h c áÅéǵÒÁ´éÇ¡Òá´¤ÓÊÑ觺ҧ¤ÓÊÑè§ «Ö觨ÐãËé¤Ó -͸ԺÒÂÊÑé¹ æ à¡ÕèÂǡѺ¤ÓÊÑ觹Ñé¹ + ,T$S0JQh1'(B HELP 0,T>Wi190R907Uh10JX140MQ19K09Vh1'0!g10$W1M(B C-h c ,Ta0Ei1G5RA04i1GB!RC!4$S0JQh1':R'$S0JQh1'(B 0,T+Vh1'(Pc0Ki1$S(B +,TM08T1:RB0JQi19(B ,Tf(B ,T`0!Uh1BG0!Q1:$S0JQh1'09Qi19(B - >> Åͧ¡´ C-h c C-p ´Ù «Ö觨ÐãËé¢éͤÇÒÁÇèÒ + >> ,TEM'!4(B C-h c C-p 0,T4Y1(B 0,T+Vh1'(Pc0Ki10"i1M$GRA0Gh1R(B "C-p runs the command previous-line" - ¤ÓÊÑ觹Õé¨ÐªèÇÂÃ×éÍ¿×鹤ÇÒÁ¨Ó à¡ÕèÂǡѺ¤ÓÊÑ觷Õèà¤Â¼èÒ¹µÒáÅéÇ áµè¨ÓäÁèä´é ä´éà»ç¹ÍÂèÒ§´Õ ¤ÓÊÑè§ -·ÕèÁÕÁÒ¡¡ÇèÒ˹Ö觵ÑÇÍÑ¡Éà àªè¹ C-x C-s ¡çÊÒÁÒö¡´µÒÁËÅѧ C-h c ä´é + ,T$S0JQh1'09Ui1(P0*h1GB0CWi1M0?Wi19$GRA(S(B ,T`0!Uh1BG0!Q1:$S0JQh1'07Uh1`$B0> Åͧ¡´ C-h k C-p ´Ù + >> ,TEM'!4(B C-h k C-p 0,T4Y1(B - ¡ç¨ÐÁÕÇÔ¹â´Çìà¾ÔèÁã¹ Emacs Íա˹Öè§Íѹ à¾×èÍáÊ´§ÃÒÂÅÐàÍÕ´¢Í§¤ÓÊÑ觹Ñé¹ àÁ×èÍÍèÒ¹¨ºáÅéÇ -¡çãËé¡´ C-x 1 à¾ÔèÁźÇÔ¹â´ÇìÍÍ¡ + 0,T!g1(P0AU10GT19b40Gl1`0>Th1Ac9(B Emacs 0,TMU1!K09Vh1'0MQ19(B ,T`0>Wh1MaJ4'CRBEP`0MU1B4"M'$S0JQh1'09Qi19(B ,T`0AWh1M0Mh1R9(:a0Ei1G(B +0,T!g1c0Ki1!4(B C-x 1 ,T`0>Th1AE:0GT19b40Gl1MM!(B - µÑÇàÅ×Í¡Í×è¹·ÕèÁÕ»ÃÐ⪹ì Áմѧ¹Õé + 0,T5Q1G`0EW1M!0MWh1907Uh10AU1;CPbB*09l1(B 0,TAU104Q1'09Ui1(B - C-h f ãËéãÊèª×èͧ͢¤ÓÊÑè§ à¾×èÍáÊ´§ÃÒÂÅÐàÍÕ´à¡ÕèÂǡѺ¤ÓÊÑ觹Ñé¹ + C-h f ,Tc0Ki1c0Jh10*Wh1M"M'$S0JQh1'(B ,T`0>Wh1MaJ4'CRBEP`0MU1B4`0!Uh1BG0!Q1:$S0JQh1'09Qi19(B - >> ãËé¡´ C-h f previous-line áÅéǵÒÁ´éÇ à¾×èÍáÊ´§ÃÒÂÅÐàÍÕ´à¡ÕèÂÇ - ¡Ñº¤ÓÊÑ觫Öè§àÃÕ¡ãªéä´é¨Ò¡¡Òá´ C-p + >> ,Tc0Ki1!4(B C-h f previous-line ,Ta0Ei1G5RA04i1GB(B ,T`0>Wh1MaJ4'CRBEP`0MU1B4`0!Uh1BG(B + 0,T!Q1:$S0JQh1'0+Vh1'`0CU1B!c0*i1d04i1(R!!RC!4(B C-p - C-h a áÅéǵÒÁ´éǤÕÂìàÇÔÃì´ (keyword) à¾×èÍáÊ´§¤ÓÊÑ觷ء¤ÓÊÑè§ ·ÕèÁÕ¤ÕÂìàÇÔÃì´ ÃÇÁÍÂÙè - ¤ÓÊÑè§àËÅèÒ¹ÕéÊÒÁÒöàÃÕ¡ãªéä´éâ´Â¡Òá´ ESC x + C-h a ,Ta0Ei1G5RA04i1GB0$U10Bl1`0GT10Cl14(B (keyword) ,T`0>Wh1MaJ4'$S0JQh1'07X1!$S0JQh1'(B 0,T7Uh10AU10$U10Bl1`0GT10Cl14(B ,TCGAM0BYh1(B + ,T$S0JQh1'`K0Eh1R09Ui1JRARC6`0CU1B!c0*i1d04i1b4B!RC!4(B ESC x - >> Åͧ¡´ C-h a file áÅéǵÒÁ´éÇ à¾×èÍáÊ´§ª×èͤÓÊÑ觷ء¤ÓÊÑ觷ÕèÁÕ¤ÓÇèÒ - "file" ÃÇÁÍÂÙè «Ö觨ÐÁÕ find-file áÅÐ write-file ·ÕèàÃÕ¡ãªéä´éâ´Â¡Òá´ - C-x C-f áÅÐ C-x C-w ÃÇÁÍÂÙè´éÇ + >> ,TEM'!4(B C-h a file ,Ta0Ei1G5RA04i1GB(B ,T`0>Wh1MaJ4'0*Wh1M$S0JQh1'07X1!$S0JQh1'07Uh10AU1$S0Gh1R(B + "file" ,TCGAM0BYh1(B 0,T+Vh1'(P0AU1(B find-file ,TaEP(B write-file 0,T7Uh1`0CU1B!c0*i1d04i1b4B!RC!4(B + C-x C-f ,TaEP(B C-x C-w ,TCGAM0BYh104i1GB(B -·éÒÂÊØ´¹Õé +0,T7i1RB0JX1409Ui1(B ====== -ÍÂèÒÅ×Á: ¤ÓÊÑè§ÊÓËÃѺ¡ÒÃàÅÔ¡ Emacs ¤×Í C-x C-c +,TM0Bh1R0EW1A(B: ,T$S0JQh1'JSK0CQ1:!RC`0ET1!(B Emacs 0,T$W1M(B C-x C-c - àÍ¡ÊÒéºÑºàº×éͧµé¹¹Õé µÑé§ã¨à¢Õ¹¢Öé¹ÊÓËÃѺ¼Ùé·ÕèàÃÔèÁËÑ´ãËÁè â´Â੾ÒÐ ¶éÒËÒ¡Áըشä˹·ÕèäÁè -à¢éÒ㨠¡çÍÂèÒÁÑÇáµèâ·ÉµÑÇàͧ áµè¢ÍãËé⹤ÇÒÁ¼Ô´ÁÒÂѧ¼Ùéà¢Õ¹᷹ + ,T`M!JRC)0:Q1:`0:Wi1M'05i1909Ui1(B 0,T5Qi1'c(`0"U1B90"Vi19JSK0CQ1:0RP(B 0,T6i1RKR!0AU10(X14dK907Uh1d0Ah1(B +,T`0"i1Rc((B 0,T!g1M0Bh1R0AQ1Ga05h1b7I05Q1G`M'(B ,Ta05h1"Mc0Ki1bB9$GRA0RP(B +,TM0Bh1R'0BTh1'0!Q1:(B EMACS ,T`09Wh1M'(R!`0;g19b;Ca!CA07Uh10AU1$GRAJRARC6KER!KERBAR!(B 0,TMQ1907Uh1(0CT1'a0Ei1G(B EMACS +,T7Sd04i107X1!0JTh1'07X1!M0Bh1R'(B -¢Í¢Íº¤Ø³ +,T"M"M:0$X13(B ======= - àÍ¡ÊÒéºÑº¹Õé ´Ñ´á»Å§ÁÒ¨Ò¡ "MicroEMACS (kemacs) ÀÒÉÒ­Õè»Øè¹ àº×éͧµé¹" «Öè§ä´éÁÒ¨Ò¡ -JUNET à¾×èÍãËéãªéà»ç¹ Tutorial ÊÓËÃѺ GNUEmacs (Nemacs) + ,T`M!JRC)0:Q1:09Ui1(B 0,T4Q14a;E'AR(R!(B "MicroEMACS (kemacs) ,T@RIR0-Uh10;Xh19(B ,T`0:Wi1M'05i19(B" 0,T+Vh1'd04i1AR(R!(B +JUNET ,T`0>Wh1Mc0Ki1c0*i1`0;g19(B Tutorial ,TJSK0CQ1:(B GNUEmacs (Nemacs) - àÍ¡ÊÒùÕé ´Ñ´á»Å§ÁÒ¨Ò¡ "JOVE Tutorial" (19 Á¡ÃÒ¤Á 86) ¢Í§ Jonathan Payne - «Ö觴Ѵá»Å§ÁÒ¨Ò¡àÍ¡ÊÒâͧ Steve Zimmerman áËè§ CCA-UNIX «Ö觴Ѵá»Å§ (ÍÕ¡·Õ) ÁÒ - ¨Ò¡àÍ¡ÊÒà "Teach-Emacs" ©ºÑºàº×éͧµé¹ (31 µØÅÒ¤Á 85) ¢Í§ MIT + ,T`M!JRC09Ui1(B 0,T4Q14a;E'AR(R!(B "JOVE Tutorial" (19 ,TA!CR$A(B 86) ,T"M'(B Jonathan Payne + 0,T+Vh1'04Q14a;E'AR(R!`M!JRC"M'(B Steve Zimmerman ,Ta0Kh1'(B CCA-UNIX 0,T+Vh1'04Q14a;E'(B (0,TMU1!07U1(B) ,TAR(B + ,T(R!`M!JRC(B "Teach-Emacs" ,T)0:Q1:`0:Wi1M'05i19(B (31 0,T5X1ER$A(B 85) ,T"M'(B MIT Update - February 1986 by Dana Hoggatt. @@ -671,20 +671,20 @@ Update/Translate - July 1987 by SANETO Takanori -¢Í¢Íº¤Ø³à»ç¹¾ÔàÈÉ +,T"M"M:0$X13`0;g190>T1`HI(B ============== - ¤Ø³ SANETO Takanori («Òà¹âµÐ ·Ò¡Òâ¹ÃÔ) ¼Ùéá»ÅÀÒÉÒ­Õè»Ø蹩ºÑºááÊØ´ àÍ¡ÊÒéºÑº¹Õé -à¢Õ¹´éÇ GMW + Wnn + Nemacs ¢ÍáÊ´§¤ÇÒÁ¢Íº¤Ø³ á´è¼Ùé·ÕèÊÃéÒ§â»Ãá¡ÃÁÊØ´ÇÔàÈÉàËÅèÒ¹Õé¢Öé¹ -áÅТ͢ͺ¤Ø³ ¤Ø³ Fujiwara Shoko ·ÕèãËé¤ÇÒÁªèÇÂàËÅ×Í㹡ÒÃá»Å ¡Òûé͹¢éÍÁÙÅ áÅÐÍÂèÒ§Í×è¹ÍÕ¡ -ËÅÒ æ ÍÂèÒ§ + 0,T$X13(B SANETO Takanori (,T+R`9b5P(B ,T7R!Rb90CT1(B) 0,TER4(B 0,T"i1M0AY1E`07g1((B ,TaEP0MWh19(B ,Tf(B ,Td0Gi1a05h1`0>U1B'0 +# From Steve Baur # Run temacs as XEmacs function runtemacs { diff -r 12e008d41344 -r 697ef44129c6 etc/custom/example-themes/europe-theme.el --- a/etc/custom/example-themes/europe-theme.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -;;;autoload -(deftheme europe - "Settings for European users." - :set-variable-settings - "This variable has a value appropriate for European users." - :set-variable-settings - "This has been forceed to the value appropriate for European users.") - -(custom-theme-set-variables 'europe - '(sentence-end-double-space nil) - '(ps-paper-type (quote a4))) - -(provide-theme 'europe) diff -r 12e008d41344 -r 697ef44129c6 etc/custom/example-themes/ex-custom-file --- a/etc/custom/example-themes/ex-custom-file Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -;; Sample User custom-file. All forms below are autogenerated. - - - - - - - - - -(custom-load-themes - 'example ) -(custom-reset-variables - '(sentence-end-double-space standard)) -(custom-set-variables - '(package-get-remove-copy t) - '(package-get-dir "/scratch/incoming") - '(sgml-public-map (quote ("%S" "/scratch/xemacs/xemacs-20/xemacs-packages/etc/psgml/%o/%c/%d" "/usr/lib/sgml/%o/%c/%d"))) - '(paren-mode (quote paren) nil (paren))) -(custom-set-faces - '(default ((t (:background "oldlace"))) t)) diff -r 12e008d41344 -r 697ef44129c6 etc/custom/example-themes/example-theme.el --- a/etc/custom/example-themes/example-theme.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -;;;autoload -(deftheme example - "A sample theme for customize theme support." - :variable-set-string "This variable has been made an example.") - -(custom-theme-load-themes 'example - 'europe) - -(custom-theme-set-variables 'example - '(iswitchb-prompt-newbuffer nil)) - -(provide-theme 'example) - - - \ No newline at end of file diff -r 12e008d41344 -r 697ef44129c6 etc/editclient.sh --- a/etc/editclient.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/editclient.sh Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,6 @@ #!/bin/sh -if gnuclient -batch -eval t >/dev/null 2>&1; then +if gnuclient -batch -eval t >/dev/null 2>&1 +then exec gnuclient ${1+"$@"} else xemacs -unmapped -f gnuserv-start & diff -r 12e008d41344 -r 697ef44129c6 etc/etags.1 --- a/etc/etags.1 Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/etags.1 Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ .\" Copyright (c) 1992 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH etags 1 "02nov1999" "GNU Tools" "GNU Tools" +.TH etags 1 "19apr1994" "GNU Tools" "GNU Tools" .de BP .sp .ti -.2i @@ -12,33 +12,24 @@ .SH SYNOPSIS .hy 0 .na -.B etags [\|\-aCDGImRVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] -.if n .br -.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] +.B etags [\|\-aCDRSVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] .br -[\|\-\-append\|] [\|\-\-c++\|] [\|\-\-no\-defines\|] -[\|\-\-no\-globals\|] [\|\-\-include=\fIfile\fP\|] -[\|\-\-ignore\-indentation\|] [\|\-\-language=\fIlanguage\fP\|] -[\|\-\-members\|] [\|\-\-output=\fItagfile\fP\|] -[\|\-\-regex=\fIregexp\fP\|] [\|\-\-no\-regex\|] -[\|\-\-ignore\-case\-regex=\fIregexp\fP\|] -[\|\-\-help\|] [\|\-\-version\|] -\fIfile\fP .\|.\|. +[\|\-\-c++\|] [\|\-\-no\-defines\|] [\|\-\-ignore\-indentation\|] +[\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] +[\|\-\-no\-regexp\|] [\|\-\-help\|] [\|\-\-version\|] +[\|\-\-include=\fIfile\fP\|] [\|\-\-output=\fItagfile\fP\|] +[\|\-\-append\|] \fIfile\fP .\|.\|. -.B ctags [\|\-aCdgImRVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] -.if n .br -.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] +.B ctags [\|\-aCdRSVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] .br -[\|\-\-append\|] [\|\-\-backward\-search\|] [\|\-\-c++\|] -[\|\-\-cxref\|] [\|\-\-defines\|] [\|\-\-forward\-search\|] -[\|\-\-globals\|] [\|\-\-ignore\-indentation\|] -[\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|] -[\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|] -[\|\-\-ignore\-case\-regex=\fIregexp\fP\|] -[\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] -[\|\-\-update\|] [\|\-\-no\-warn\|] +[\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] +[\|\-\-c++\|] [\|\-\-defines\|] [\|\-\-ignore\-indentation\|] +[\|\-\-no\-warn\|] [\|\-\-cxref\|] [\|\-\-backward\-search\|] +[\|\-\-forward\-search\|] [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] +[\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] [\|\-\-help\|] [\|\-\-version\|] -\fIfile\fP .\|.\|. +.br +[\|\-\-output=\fItagfile\fP\|] [\|\-\-append\|] [\|\-\-update\|] \fIfile\fP .\|.\|. .ad b .hy 1 .SH DESCRIPTION @@ -49,8 +40,8 @@ format understood by .BR vi ( 1 )\c \&. Both forms of the program understand -the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, Ada, Perl, -LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Python, Prolog and +the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, +LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Prolog and most assembler\-like syntaxes. Both forms read the files specified on the command line, and write a tag table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for @@ -86,39 +77,18 @@ code. Files with `\|.C\|', `\|.H\|', `\|.cxx\|', `\|.hxx\|', or `\|.cc\|' extensions are always assumed to be C++ code. .TP -.B \-\-declarations -In C and derived languages, create tags for function declarations, -and create tags for extern variables unless \-\-no\-globals is used. -.TP .B \-d, \-\-defines -Create tag entries for C preprocessor constant definitions +Create tag entries for C preprocessor constant definitions and enum constants, too. This is the -default behavior for \fBetags\fP. +default behavior for \fBetags\fP, so this option is only accepted +by \fBctags\fP. .TP .B \-D, \-\-no\-defines Do not create tag entries for C preprocessor constant definitions and enum constants. This may make the tags file much smaller if many header files are tagged. -This is the default behavior for \fBctags\fP. -.TP -.B \-g, \-\-globals -Create tag entries for global variables in C, C++, Objective C, Java, -and Perl. -This is the default behavior for \fBetags\fP. -.TP -.B \-G, \-\-no\-globals -Do not tag global variables. Typically this reduces the file size by -one fourth. This is the default behavior for \fBctags\fP. -.TP -\fB\-i\fP \fIfile\fP, \fB\-\-include=\fIfile\fP -Include a note in the tag file indicating that, when searching for a -tag, one should also consult the tags file \fIfile\fP after checking the -current file. This options is only accepted by \fBetags\fP. -.TP -.B \-I, \-\-ignore\-indentation -Don't rely on indentation as much as we normally do. Currently, this -means not to assume that a closing brace in the first column is the -final brace of a function or structure definition in C and C++. +This is the default behavior for \fBctags\fP, so this option is only +accepted by \fBetags\fP. .TP \fB\-l\fP \fIlanguage\fP, \fB\-\-language=\fIlanguage\fP Parse the following files according to the given language. More than @@ -129,30 +99,27 @@ language may be used to disable language parsing altogether; only regexp matching is done in this case (see the \fB\-\-regex\fP option). .TP -.B \-m, \-\-members -Create tag entries for variables that are members of structure-like -constructs in C++, Objective C, Java. +\fB\-\-no_globals\fP +Do not tag global variables in C, C++, Objective C, Java. Typically +this reduces the file size by one fourth. .TP -.B \-M, \-\-no\-members -Do not tag member variables. This is the default behavior. -.TP -.B \-\-packages\-only -Only tag packages in Ada files. +\fB\-\-members\fP +Tag variables that are members of strucure-like constructs in C++, +Objective C, Java. .TP \fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP Explicit name of file for tag table; overrides default `\|TAGS\|' or `\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.) .TP \fB\-r\fP \fIregexp\fP, \fB\-\-regex=\fIregexp\fP -\fB\-\-ignore\-case\-regex=\fIregexp\fP\ -Make tags based on regexp matching for each line of the files following -this option, in addition to the tags made with the standard parsing based -on language. When using \-\-regex, case is significant, while it is not -with \-\-ignore\-case\-regex. May be freely intermixed with filenames and -the \fB\-R\fP option. The regexps are cumulative, i.e. each option will -add to the previous ones. The regexps are of the form: +Make tags based on regexp matching for each line of the files +following this option, in addition to the tags made with the standard +parsing based on language. May be freely intermixed with filenames +and the \fB\-R\fP option. The regexps are cumulative, i.e. each +option will add to the previous ones. The regexps are of the form: .br - \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP + + \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP .br where \fItagregexp\fP is used to match the lines that must be tagged. @@ -160,8 +127,8 @@ such that more characters than needed are unavoidably matched by \fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to narrow down the tag scope. \fBctags\fP ignores regexps without a -\fInameregexp\fP. The syntax of regexps is the same as in emacs, -augmented with intervals of the form \\{m,n\\}, as in ed or grep. +\fInameregexp\fP. The syntax of regexps is the same as in emacs, +augmented with intervals of the form \\{m,n\\}, as id ed or grep. .br Here are some examples. All the regexps are quoted to protect them from shell interpretation. @@ -185,25 +152,16 @@ .br \fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP -.br -A regexp can be preceded by {lang}, thus restriciting it to match lines of -files of the specified language. Use \fBetags --help\bP to obtain a list -of the recognised languages. This feature is particularly useful inside -\fBregex files\fB. A regex file contains one regex per line. Empty lines, -and those lines beginning with space or tab are ignored. Lines beginning -with @ are references to regex files whose name follows the @ sign. Other -lines are considered regular expressions like those following \-\-regex. -.br -For example, the command -.br -etags \-\-regex=@regex.file *.c -.br -reads the regexes contained in the file regex.file. .TP .B \-R, \-\-no\-regex Don't do any more regexp matching on the following files. May be freely intermixed with filenames and the \fB\-\-regex\fP option. .TP +.B \-S, \-\-ignore\-indentation +Don't rely on indentation as much as we normally do. Currently, this +means not to assume that a closing brace in the first column is the +final brace of a function or structure definition in C and C++. +.TP .B \-t, \-\-typedefs Record typedefs in C code as tags. Since this is the default behaviour of \fBetags\fP, only \fBctags\fP accepts this option. @@ -234,7 +192,7 @@ Instead of generating a tag file, write a cross reference (in \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. .TP -.B \-h, \-H, \-\-help +.B \-H, \-\-help Print usage information. .TP .B \-V, \-\-version @@ -251,7 +209,7 @@ .BR vi ( 1 ). .SH COPYING -Copyright (c) 1999 Free Software Foundation, Inc. +Copyright (c) 1992 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice diff -r 12e008d41344 -r 697ef44129c6 etc/gnuserv.1 --- a/etc/gnuserv.1 Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/gnuserv.1 Mon Aug 13 11:20:41 2007 +0200 @@ -291,4 +291,4 @@ etc/emacsclient.c, etc/server.c and lisp/server.el from the GNU Emacs 18.52 distribution. Various modifications from Bob Weiner (weiner@mot.com), Darrell Kindred (dkindred@cmu.edu), Arup Mukherjee (arup@cmu.edu), Ben -Wing (ben@xemacs.org) and Hrvoje Niksic (hniksic@xemacs.org). +Wing (ben@xemacs.org) and Hrvoje Niksic (hniksic@srce.hr). diff -r 12e008d41344 -r 697ef44129c6 etc/package-index.LATEST.pgp --- a/etc/package-index.LATEST.pgp Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/package-index.LATEST.pgp Mon Aug 13 11:20:41 2007 +0200 @@ -1,68 +1,21 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - ;; Package Index file -- Do not edit manually. ;;;@@@ (package-get-update-base-entry (quote -(lookup - (standards-version 1.1 - version "1.03" - author-version "1.0" - date "1999-05-05" - build-date "1999-07-30" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "mule" - dump nil - description "Dictionary support" - filename "lookup-1.03-pkg.tar.gz" - md5sum "d99759b042f8bf401d487e4ea140450d" - size 212861 - provides (lookup) - requires (cookie lookup) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(os-utils - (standards-version 1.1 - version "1.18" - author-version "21.1" - date "1999-07-20" - build-date "1999-07-30" - maintainer "XEmacs Development Team " - distribution xemacs - priority medium - category "os" - dump nil - description "Miscellaneous O/S utilities." - filename "os-utils-1.18-pkg.tar.gz" - md5sum "bafbe5e2628fc678daad46b07ba7fef6" - size 179680 - provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat tar-mode telnet terminal uncompress) - requires (xemacs-base) - type single -)) -)) -;;;@@@ -(package-get-update-base-entry (quote (ediff - (standards-version 1.1 - version "1.22" + (standards-version 1.0 + version "1.19" author-version "2.72" - date "1999-05-27" - build-date "1999-07-30" + date "1999-04-06" + build-date "1999-05-13" maintainer "Michael Kifer " - distribution xemacs + distribution stable priority medium category "prog" dump nil description "Interface over GNU patch." - filename "ediff-1.22-pkg.tar.gz" - md5sum "a9ece02fc03ac74ee4501845dec88710" - size 282084 + filename "ediff-1.19-pkg.tar.gz" + md5sum "d6e0edc88c5d09279df71ce9aff41b25" + size 281804 provides (ediff) requires (pcl-cvs elib dired xemacs-base) type regular @@ -115,20 +68,20 @@ ;;;@@@ (package-get-update-base-entry (quote (skk - (standards-version 1.1 - version "1.14" + (standards-version 1.0 + version "1.12" author-version "10.38" - date "1999-05-18" - build-date "1999-07-30" - maintainer "SL Baur " + date "1998-10-01" + build-date "1999-02-02" + maintainer "SL Baur " distribution mule priority medium category "mule" - dump nil + dump t description "Japanese Language Input Method." - filename "skk-1.14-pkg.tar.gz" - md5sum "b8c89832f314570cb251147ced107c49" - size 1514095 + filename "skk-1.12-pkg.tar.gz" + md5sum "f690c518a0da65c4dc9fe2a867026c26" + size 1514106 provides (skk skk-tut) requires (viper mule-base elib xemacs-base) type regular @@ -137,20 +90,20 @@ ;;;@@@ (package-get-update-base-entry (quote (egg-its - (standards-version 1.1 - version "1.19" - author-version "21.1" - date "1999-07-26" - build-date "1999-07-30" + (standards-version 1.0 + version "1.16" + author-version "21.0b65" + date "1999-03-05" + build-date "1999-03-11" maintainer "XEmacs Development Team " distribution mule priority high category "mule" - dump nil + dump t description "Wnn (4.2 and 6) support. SJ3 support." - filename "egg-its-1.19-pkg.tar.gz" - md5sum "121037363bae6925fd4933f861cbdabb" - size 261537 + filename "egg-its-1.16-pkg.tar.gz" + md5sum "5a3b23dbe609feeabfc108ae142715c3" + size 257562 provides (egg-cnpinyin egg-cnzhuyin egg-cwnn-leim egg-jisx0201 egg-jsymbol egg-kwnn-leim egg-leim egg-sj3-client egg-sj3-leim egg-sj3 egg-wnn egg) requires (leim mule-base fsf-compat xemacs-base) type regular @@ -159,20 +112,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edict - (standards-version 1.1 - version "1.08" + (standards-version 1.0 + version "1.07" author-version "0.9.8" date "1998-07-23" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "Stephen J. Turnbull " distribution mule priority high category "mule" dump nil description "Lisp Interface to EDICT, Kanji Dictionary" - filename "edict-1.08-pkg.tar.gz" - md5sum "f339e93a2cb02d9224e4bf9f313b0b62" - size 71621 + filename "edict-1.07-pkg.tar.gz" + md5sum "493ef0ec6f2760e5c94423c23c9d124e" + size 71661 provides (dui-registry dui edict-edit edict-english edict-japanese edict-morphology edict-test edict ts-mode) requires (mule-base xemacs-base) type regular @@ -181,20 +134,20 @@ ;;;@@@ (package-get-update-base-entry (quote (leim - (standards-version 1.1 - version "1.13" - author-version "21.1" - date "1999-06-29" - build-date "1999-07-30" + (standards-version 1.0 + version "1.12" + author-version "21.0b62" + date "1998-07-23" + build-date "1999-02-02" maintainer "XEmacs Development Team " distribution mule priority medium category "mule" dump nil description "Quail. All non-English and non-Japanese language support." - filename "leim-1.13-pkg.tar.gz" - md5sum "9cd059afefa3aff94fd1802c8db6c39a" - size 1702922 + filename "leim-1.12-pkg.tar.gz" + md5sum "07cc5be34a0d9d312b883b430349a882" + size 1671757 provides () requires (mule-base fsf-compat xemacs-base) type regular @@ -203,20 +156,20 @@ ;;;@@@ (package-get-update-base-entry (quote (locale - (standards-version 1.1 - version "1.14" - author-version "21.1" + (standards-version 1.0 + version "1.13" + author-version "21.0" date "1999-05-11" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " distribution mule priority high category "mule" dump nil description "Localized menubars and localized splash screens." - filename "locale-1.14-pkg.tar.gz" - md5sum "5a5c7e878596a1009e97a8c4f491826c" - size 35744 + filename "locale-1.13-pkg.tar.gz" + md5sum "4735b4005dfce55cf3581885add18836" + size 33964 provides () requires (mule-base) type regular @@ -225,42 +178,42 @@ ;;;@@@ (package-get-update-base-entry (quote (mule-base - (standards-version 1.1 - version "1.32" - author-version "21.1" - date "1999-06-30" - build-date "1999-07-30" - maintainer "SL Baur " + (standards-version 1.0 + version "1.29" + author-version "21.0" + date "1999-05-13" + build-date "1999-05-13" + maintainer "SL Baur " distribution mule priority high category "mule" - dump nil + dump t description "Basic Mule support, required for building with Mule." - filename "mule-base-1.32-pkg.tar.gz" - md5sum "40950af24540e6cfc6875a9ddc7bab5d" - size 453902 + filename "mule-base-1.29-pkg.tar.gz" + md5sum "9b713b6f95c4016dc29d7b584c78f7d1" + size 420205 provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help) - requires (fsf-compat xemacs-base apel) + requires (fsf-compat xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (strokes - (standards-version 1.1 - version "1.05" - author-version "21.1" + (standards-version 1.0 + version "1.04" + author-version "21.0b62" date "1998-01-25" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "oa" dump nil description "Mouse enhancement utility." - filename "strokes-1.05-pkg.tar.gz" - md5sum "42b991c28dc393a78f9da792f15e53d3" - size 43480 + filename "strokes-1.04-pkg.tar.gz" + md5sum "9a83020e888d140da2360dcac83c7c86" + size 43481 provides (strokes) requires (text-modes edit-utils mail-lib xemacs-base) type regular @@ -269,20 +222,20 @@ ;;;@@@ (package-get-update-base-entry (quote (time - (standards-version 1.1 - version "1.08" + (standards-version 1.0 + version "1.07" author-version "1.17" date "1998-04-24" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "oa" dump nil description "Display time & date on the modeline." - filename "time-1.08-pkg.tar.gz" - md5sum "c67d7143de5694ec4a7e17023ceab902" - size 19994 + filename "time-1.07-pkg.tar.gz" + md5sum "4cc97d84357412fb7d737a88b6f05cbe" + size 20006 provides (time) requires (xemacs-base) type regular @@ -291,20 +244,20 @@ ;;;@@@ (package-get-update-base-entry (quote (text-modes - (standards-version 1.1 - version "1.21" - author-version "21.1" - date "1999-07-06" - build-date "1999-07-30" + (standards-version 1.0 + version "1.19" + author-version "21.0" + date "1999-04-22" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high category "oa" dump nil description "Miscellaneous support for editing text files." - filename "text-modes-1.21-pkg.tar.gz" - md5sum "d9d9505dfbe52854b3337eddfce093d1" - size 207873 + filename "text-modes-1.19-pkg.tar.gz" + md5sum "9031e37912506b87a9a4fc4aa8107c13" + size 207865 provides (autoinsert crontab-edit filladapt fold-isearch folding image-mode iso-acc iso-ascii iso-cvt iso-insert iso-swed swedish tabify whitespace-mode winmgr-mode xpm-mode xrdb-mode) requires (ispell fsf-compat xemacs-base) type regular @@ -313,20 +266,20 @@ ;;;@@@ (package-get-update-base-entry (quote (slider - (standards-version 1.1 - version "1.10" + (standards-version 1.0 + version "1.09" author-version "0.3x1" date "1998-08-13" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution experimental priority low category "oa" dump nil description "User interface tool." - filename "slider-1.10-pkg.tar.gz" - md5sum "a67e165592a2921ff0978a69befa0d6d" - size 12000 + filename "slider-1.09-pkg.tar.gz" + md5sum "b211a950179fee88712fc5c38e395069" + size 12004 provides (slider color-selector) requires () type regular @@ -335,20 +288,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sgml - (standards-version 1.1 - version "1.05" - author-version "21.1" + (standards-version 1.0 + version "1.04" + author-version "21.0b62" date "1998-01-25" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "oa" dump nil description "SGML/Linuxdoc-SGML editing." - filename "sgml-1.05-pkg.tar.gz" - md5sum "ead5d1671dfebf394be76166c786b0c2" - size 26937 + filename "sgml-1.04-pkg.tar.gz" + md5sum "2b762a0fbdda616916624dc2fa53e647" + size 26938 provides (sgml linuxdoc-sgml) requires (xemacs-base) type regular @@ -357,20 +310,20 @@ ;;;@@@ (package-get-update-base-entry (quote (psgml - (standards-version 1.1 - version "1.14" + (standards-version 1.0 + version "1.12" author-version "1.01" - date "1999-06-13" - build-date "1999-07-30" + date "1999-03-05" + build-date "1999-03-05" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "oa" dump nil description "Validated HTML/SGML editing." - filename "psgml-1.14-pkg.tar.gz" - md5sum "44102484c3e5588bab21005cec1a46e1" - size 425227 + filename "psgml-1.12-pkg.tar.gz" + md5sum "7303b3a604659b64f24b0847b3a686d5" + size 425458 provides (psgml sgml) requires (edit-utils) type regular @@ -379,20 +332,20 @@ ;;;@@@ (package-get-update-base-entry (quote (pc - (standards-version 1.1 - version "1.16" - author-version "21.1" + (standards-version 1.0 + version "1.15" + author-version "21.0" date "1999-04-13" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "oa" dump nil description "PC style interface emulation." - filename "pc-1.16-pkg.tar.gz" - md5sum "d721157770274b9fee0b16933764c636" - size 16324 + filename "pc-1.15-pkg.tar.gz" + md5sum "99ad6b816d02360a4a9ccb5425974818" + size 16315 provides (delbs fusion pc-select pending-del s-region) requires (xemacs-base) type regular @@ -401,20 +354,20 @@ ;;;@@@ (package-get-update-base-entry (quote (ispell - (standards-version 1.1 - version "1.16" + (standards-version 1.0 + version "1.15" author-version "3.2" - date "1999-07-22" - build-date "1999-07-30" + date "1999-05-13" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "oa" dump nil description "Spell-checking with GNU ispell." - filename "ispell-1.16-pkg.tar.gz" - md5sum "a3140984afc8a9d5aa0d0116625b2d07" - size 68157 + filename "ispell-1.15-pkg.tar.gz" + md5sum "23632bd9fc2f7e4c0303865c35c5f4a5" + size 68118 provides (ispell) requires () type regular @@ -423,20 +376,20 @@ ;;;@@@ (package-get-update-base-entry (quote (frame-icon - (standards-version 1.1 - version "1.07" - author-version "21.1" + (standards-version 1.0 + version "1.06" + author-version "21.0b62" date "1998-07-14" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "oa" dump nil description "Set up mode-specific icons for each frame under XEmacs" - filename "frame-icon-1.07-pkg.tar.gz" - md5sum "320909b8d8caa9754c08963878acbb8b" - size 33434 + filename "frame-icon-1.06-pkg.tar.gz" + md5sum "bc4f6e838a4fa12d7f3b8b1996b3a9ac" + size 33483 provides (forms forms-mode) requires () type regular @@ -445,20 +398,20 @@ ;;;@@@ (package-get-update-base-entry (quote (forms - (standards-version 1.1 - version "1.11" + (standards-version 1.0 + version "1.10" author-version "2.37" date "1999-05-11" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "oa" dump nil description "Forms editing support (obsolete, use Widget instead)." - filename "forms-1.11-pkg.tar.gz" - md5sum "36604485f4a1031d28968fe2c8534a6d" - size 48263 + filename "forms-1.10-pkg.tar.gz" + md5sum "a8ad3a114859c0981a1f884072bf4b1b" + size 48264 provides (forms forms-mode) requires () type regular @@ -467,20 +420,20 @@ ;;;@@@ (package-get-update-base-entry (quote (calendar - (standards-version 1.1 - version "1.12" - author-version "21.1" - date "1999-06-24" - build-date "1999-07-30" + (standards-version 1.0 + version "1.10" + author-version "21.0b63" + date "1999-02-08" + build-date "1999-03-01" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "oa" dump nil description "Calendar and diary support." - filename "calendar-1.12-pkg.tar.gz" - md5sum "d6ad2b3a3477d04ca3b669a67eecc8bc" - size 250669 + filename "calendar-1.10-pkg.tar.gz" + md5sum "09e93d157d2853a35e735a6a04f54055" + size 248580 provides (appt cal-dst cal-french cal-mayan cal-x cal-xemacs calendar diary-ins diary-lib holidays lunar solar) requires (xemacs-base) type regular @@ -489,20 +442,20 @@ ;;;@@@ (package-get-update-base-entry (quote (calc - (standards-version 1.1 - version "1.11" + (standards-version 1.0 + version "1.10" author-version "2.02fX3" date "1998-07-25" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "oa" dump nil description "Emacs calculator" - filename "calc-1.11-pkg.tar.gz" - md5sum "7a0cce9d75b5c70f02db67f18eb6a97d" - size 1616700 + filename "calc-1.10-pkg.tar.gz" + md5sum "148c82bf6f213d6e2fb234e1f21e4699" + size 1616821 provides (calc) requires () type regular @@ -511,20 +464,20 @@ ;;;@@@ (package-get-update-base-entry (quote (speedbar - (standards-version 1.1 - version "1.13" + (standards-version 1.0 + version "1.12" author-version "0.6.2x" - date "1999-07-15" - build-date "1999-07-30" + date "1999-03-05" + build-date "1999-03-12" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "oa" dump nil description "Provides a seperate frame with convenient references." - filename "speedbar-1.13-pkg.tar.gz" - md5sum "0a2352aa6866888fc8ecdc7ec8d86516" - size 64955 + filename "speedbar-1.12-pkg.tar.gz" + md5sum "3b578d06426921193ac2b8337a669bfa" + size 64892 provides (speedbar) requires (xemacs-base) type regular @@ -533,20 +486,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edit-utils - (standards-version 1.1 - version "1.41" - author-version "21.1" - date "1999-07-07" - build-date "1999-07-30" + (standards-version 1.0 + version "1.39" + author-version "21.0" + date "1999-05-11" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high category "oa" dump nil description "Miscellaneous editor extensions, you probably need this." - filename "edit-utils-1.41-pkg.tar.gz" - md5sum "a3d5116811348bde6d56976ce94a991a" - size 579673 + filename "edit-utils-1.39-pkg.tar.gz" + md5sum "f129277008f56e86ec8630a299df7408" + size 577970 provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db) requires (xemacs-base) type single @@ -555,20 +508,20 @@ ;;;@@@ (package-get-update-base-entry (quote (view-process - (standards-version 1.1 - version "1.07" + (standards-version 1.0 + version "1.06" author-version "2.4" date "1998-01-24" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "os" dump nil description "A Unix process browsing tool." - filename "view-process-1.07-pkg.tar.gz" - md5sum "47a82bb6569dd9d9bed03a57c9391538" - size 59953 + filename "view-process-1.06-pkg.tar.gz" + md5sum "61c4c7175f23cb4cfd314e10303b238c" + size 59958 provides (view-process-mode) requires (xemacs-base) type regular @@ -599,20 +552,20 @@ ;;;@@@ (package-get-update-base-entry (quote (ilisp - (standards-version 1.1 - version "1.08" + (standards-version 1.0 + version "1.07" author-version "5.8" date "1998-01-24" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "os" dump nil description "Front-end for Inferior Lisp." - filename "ilisp-1.08-pkg.tar.gz" - md5sum "12041533cb292d9d58a55278c8882c70" - size 262171 + filename "ilisp-1.07-pkg.tar.gz" + md5sum "38cb2d94926e310a6e71ec1be854d636" + size 262173 provides (ilisp completer) requires (xemacs-base) type regular @@ -621,20 +574,20 @@ ;;;@@@ (package-get-update-base-entry (quote (igrep - (standards-version 1.1 - version "1.06" + (standards-version 1.0 + version "1.05" author-version "2.83" date "1998-08-11" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "os" dump nil description "Enhanced front-end for Grep." - filename "igrep-1.06-pkg.tar.gz" - md5sum "9a61dc2c81e909993e14254f30df3ee7" - size 14927 + filename "igrep-1.05-pkg.tar.gz" + md5sum "e70d4973a2af4dbd6222f5943bfa1a50" + size 14935 provides (igrep) requires (dired xemacs-base) type regular @@ -643,20 +596,20 @@ ;;;@@@ (package-get-update-base-entry (quote (eterm - (standards-version 1.1 - version "1.09" - author-version "21.1" - date "1999-07-07" - build-date "1999-07-30" + (standards-version 1.0 + version "1.08" + author-version "21.0b62" + date "1998-06-28" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "os" dump nil description "Terminal emulation." - filename "eterm-1.09-pkg.tar.gz" - md5sum "9cdab77e28dc87a79db4c503c961b37a" - size 109066 + filename "eterm-1.08-pkg.tar.gz" + md5sum "77e56529b5de6a0a0dd46c5d1634eebf" + size 108905 provides (eterm) requires (xemacs-base) type regular @@ -665,20 +618,20 @@ ;;;@@@ (package-get-update-base-entry (quote (viper - (standards-version 1.1 - version "1.17" + (standards-version 1.0 + version "1.14" author-version "3.061" - date "1999-05-27" - build-date "1999-07-30" + date "1999-03-03" + build-date "1999-03-05" maintainer "Michael Kifer " - distribution xemacs + distribution stable priority low category "wp" dump nil description "VI emulation support." - filename "viper-1.17-pkg.tar.gz" - md5sum "89285f1297d73552d43602cf1288aefd" - size 317943 + filename "viper-1.14-pkg.tar.gz" + md5sum "0e118822906e195dc352f28c8efc01e0" + size 317899 provides (viper) requires (xemacs-base) type regular @@ -687,20 +640,20 @@ ;;;@@@ (package-get-update-base-entry (quote (tpu - (standards-version 1.1 - version "1.09" + (standards-version 1.0 + version "1.08" author-version "4.2X" date "1998-07-23" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "Kevin Oberman " - distribution xemacs + distribution normal priority medium category "wp" dump nil description "DEC EDIT/TPU support." - filename "tpu-1.09-pkg.tar.gz" - md5sum "9a467bd306599d97f0f5be0266850d79" - size 58814 + filename "tpu-1.08-pkg.tar.gz" + md5sum "2306ac55a0a1ed23da02a85c91f881bb" + size 58804 provides (tpu) requires () type regular @@ -709,20 +662,20 @@ ;;;@@@ (package-get-update-base-entry (quote (textools - (standards-version 1.1 - version "1.09" - author-version "21.1" + (standards-version 1.0 + version "1.08" + author-version "21.0b62" date "1998-04-29" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stabl priority medium category "wp" dump nil description "Miscellaneous TeX support." - filename "textools-1.09-pkg.tar.gz" - md5sum "d0e16392dfdcd9ec8eab4ebc8da9948e" - size 79187 + filename "textools-1.08-pkg.tar.gz" + md5sum "22dd0e16433a96547fde5757c6793388" + size 79176 provides (bib-mode bibtex refer-to-bibtex) requires (xemacs-base) type single @@ -731,20 +684,20 @@ ;;;@@@ (package-get-update-base-entry (quote (texinfo - (standards-version 1.1 - version "1.15" - author-version "21.1" + (standards-version 1.0 + version "1.14" + author-version "21.0b62" date "1998-07-20" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high category "wp" dump nil description "XEmacs TeXinfo support." - filename "texinfo-1.15-pkg.tar.gz" - md5sum "3c0ba97404953b4383d06f0a88a3a6cd" - size 127873 + filename "texinfo-1.14-pkg.tar.gz" + md5sum "b1b6a7f4c1ff10be38d3e27d1213f1c8" + size 127830 provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd) requires (xemacs-base) type regular @@ -753,20 +706,20 @@ ;;;@@@ (package-get-update-base-entry (quote (reftex - (standards-version 1.1 - version "1.14" + (standards-version 1.0 + version "1.13" author-version "3.43" date "1999-04-06" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "Carsten Dominik " - distribution xemacs + distribution stable priority medium category "wp" dump nil description "Emacs support for LaTeX cross-references, citations.." - filename "reftex-1.14-pkg.tar.gz" - md5sum "e56e631f54e895ed95377be6e882bed5" - size 215968 + filename "reftex-1.13-pkg.tar.gz" + md5sum "5e9196a6fdda2587bec1aff19d6322ec" + size 216008 provides (reftex) requires (fsf-compat xemacs-base) type regular @@ -775,20 +728,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edt - (standards-version 1.1 - version "1.08" - author-version "21.1" + (standards-version 1.0 + version "1.07" + author-version "21.0b62" date "1998-04-07" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "wp" dump nil description "DEC EDIT/EDT emulation." - filename "edt-1.08-pkg.tar.gz" - md5sum "bade43d3b5c90a4b9c969a1f85ef606e" - size 46128 + filename "edt-1.07-pkg.tar.gz" + md5sum "6c48ceb9686c50058be3938288940bc5" + size 46131 provides (edt) requires (xemacs-base) type regular @@ -797,20 +750,20 @@ ;;;@@@ (package-get-update-base-entry (quote (crisp - (standards-version 1.1 - version "1.10" + (standards-version 1.0 + version "1.09" author-version "1.34" date "1998-08-18" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "wp" dump nil description "Crisp/Brief emulation." - filename "crisp-1.10-pkg.tar.gz" - md5sum "82fcef8e2a2c6e0d40c68f6142c6a780" - size 10065 + filename "crisp-1.09-pkg.tar.gz" + md5sum "faa9b6f2868a7e5b212d1094039cf526" + size 10067 provides (crisp scroll-lock) requires () type regular @@ -819,20 +772,20 @@ ;;;@@@ (package-get-update-base-entry (quote (auctex - (standards-version 1.1 - version "1.17" + (standards-version 1.0 + version "1.16" author-version "9.7p" date "1998-09-30" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "wp" dump nil description "Basic TeX/LaTeX support." - filename "auctex-1.17-pkg.tar.gz" - md5sum "be1dc85bba341dba02ec13ce06bf9609" - size 365053 + filename "auctex-1.16-pkg.tar.gz" + md5sum "56e3454a1162c25db93fc84bdab61d0f" + size 365136 provides (auc-old bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-site tex) requires (xemacs-base) type regular @@ -841,20 +794,20 @@ ;;;@@@ (package-get-update-base-entry (quote (vhdl - (standards-version 1.1 - version "1.08" + (standards-version 1.0 + version "1.07" author-version "2.74" date "1998-01-24" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "prog" dump nil description "Support for VHDL." - filename "vhdl-1.08-pkg.tar.gz" - md5sum "8d3422f8b6ba5584dbf89d3ef6759594" - size 65948 + filename "vhdl-1.07-pkg.tar.gz" + md5sum "0eae8d15cff7d7b6dd7e1d00029c0e3a" + size 65961 provides (vhdl-mode) requires () type regular @@ -863,20 +816,20 @@ ;;;@@@ (package-get-update-base-entry (quote (vc - (standards-version 1.1 - version "1.19" - author-version "21.1" - date "1999-06-07" - build-date "1999-07-30" + (standards-version 1.0 + version "1.17" + author-version "21.0b63" + date "1999-02-25" + build-date "1999-03-01" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "prog" dump nil description "Version Control for Free systems." - filename "vc-1.19-pkg.tar.gz" - md5sum "2794428c1167de3f1db8e9928041b065" - size 84689 + filename "vc-1.17-pkg.tar.gz" + md5sum "4e80458c0e6d4cf2805ed6a46135e1c6" + size 84499 provides (vc) requires (dired xemacs-base) type regular @@ -885,20 +838,20 @@ ;;;@@@ (package-get-update-base-entry (quote (vc-cc - (standards-version 1.1 - version "1.12" - author-version "21.1" + (standards-version 1.0 + version "1.11" + author-version "21.0b62" date "1998-12-09" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "prog" dump nil description "Version Control for ClearCase (UnFree) systems." - filename "vc-cc-1.12-pkg.tar.gz" - md5sum "db978159bf5d1d194782b79961d003d1" - size 96520 + filename "vc-cc-1.11-pkg.tar.gz" + md5sum "561ab60400e3fa6bfef8ad8567a3702d" + size 96544 provides (vc) requires (dired xemacs-base) type regular @@ -907,20 +860,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sh-script - (standards-version 1.1 - version "1.10" + (standards-version 1.0 + version "1.08" author-version "2.0e" - date "1999-05-31" - build-date "1999-07-30" + date "1998-05-12" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "prog" dump nil description "Support for editing shell scripts." - filename "sh-script-1.10-pkg.tar.gz" - md5sum "003e39a5e97acce6f9b751a1fec5e398" - size 33987 + filename "sh-script-1.08-pkg.tar.gz" + md5sum "f2f584ab19761b1db14160d9d3cbc6f3" + size 33900 provides (sh-script executable) requires (xemacs-base) type regular @@ -929,20 +882,20 @@ ;;;@@@ (package-get-update-base-entry (quote (scheme - (standards-version 1.1 - version "1.09" - author-version "21.1" - date "1999-06-15" - build-date "1999-07-30" + (standards-version 1.0 + version "1.07" + author-version "21.0b62" + date "1998-09-08" + build-date "1999-02-02" maintainer "Karl M. Hegbloom " - distribution xemacs + distribution contrib priority low category "prog" dump nil description "Front-end support for Inferior Scheme." - filename "scheme-1.09-pkg.tar.gz" - md5sum "a4542795594e46af3b803d44ed3d7c8d" - size 36505 + filename "scheme-1.07-pkg.tar.gz" + md5sum "998d46aee749b32493cae61cac3888d2" + size 36292 provides (scheme xscheme cmuscheme cmuscheme48) requires (xemacs-base) type regular @@ -951,20 +904,20 @@ ;;;@@@ (package-get-update-base-entry (quote (prog-modes - (standards-version 1.1 - version "1.21" - author-version "21.1" - date "1999-07-15" - build-date "1999-07-30" + (standards-version 1.0 + version "1.19" + author-version "21.0" + date "1999-05-12" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "prog" dump nil description "Support for various programming languages." - filename "prog-modes-1.21-pkg.tar.gz" - md5sum "e83aff3ead4ab018d07b9b22e9ba301d" - size 601321 + filename "prog-modes-1.19-pkg.tar.gz" + md5sum "11da842b17ee65837bc56c13d76f49af" + size 596965 provides (autoconf-mode cperl-mode eiffel3 f90 fortran ksh-mode m4-mode makefile perl-mode postscript python-mode rexx-mode simula-mode tcl teco verilog-mod) requires (mail-lib xemacs-devel xemacs-base) type regular @@ -973,20 +926,20 @@ ;;;@@@ (package-get-update-base-entry (quote (emerge - (standards-version 1.1 - version "1.06" - author-version "21.1" + (standards-version 1.0 + version "1.05" + author-version "21.0b62" date "1998-04-07" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "prog" dump nil description "Another interface over GNU patch." - filename "emerge-1.06-pkg.tar.gz" - md5sum "1f4c3003975e8c540742c37cd398dd4b" - size 61012 + filename "emerge-1.05-pkg.tar.gz" + md5sum "1f4d70d7f4e73290837b2dbd2189be99" + size 61009 provides (emerge) requires () type regular @@ -995,20 +948,20 @@ ;;;@@@ (package-get-update-base-entry (quote (debug - (standards-version 1.1 - version "1.10" - author-version "21.1" + (standards-version 1.0 + version "1.09" + author-version "21.0" date "1999-05-12" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "prog" dump nil description "GUD, gdb, dbx debugging support." - filename "debug-1.10-pkg.tar.gz" - md5sum "81fab3bf4b08036d122f1e6abb7ffc74" - size 103093 + filename "debug-1.09-pkg.tar.gz" + md5sum "24442a34f07cdd97ed52aa2c88c3de0b" + size 103161 provides (dbx gdb-highlight gdb gdbsrc gud history) requires (xemacs-base) type regular @@ -1017,20 +970,20 @@ ;;;@@@ (package-get-update-base-entry (quote (c-support - (standards-version 1.1 - version "1.13" - author-version "21.1" + (standards-version 1.0 + version "1.12" + author-version "21.0b64" date "1999-03-02" - build-date "1999-07-30" + build-date "1999-03-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "prog" dump nil description "Basic single-file add-ons for editing C code." - filename "c-support-1.13-pkg.tar.gz" - md5sum "d4568a0fd8c0ea31917ad37e190e443b" - size 69931 + filename "c-support-1.12-pkg.tar.gz" + md5sum "a793cd83bb595d34771332a46d2abfd4" + size 69913 provides (c-comment-edit cmacexp ctypes hideif hideshow) requires (cc-mode xemacs-base) type regular @@ -1039,20 +992,20 @@ ;;;@@@ (package-get-update-base-entry (quote (ada - (standards-version 1.1 - version "1.07" + (standards-version 1.0 + version "1.06" author-version "2.27" date "1998-01-24" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "prog" dump nil description "Ada language support." - filename "ada-1.07-pkg.tar.gz" - md5sum "f12fe7c6ac8ed3bcfeb761ffd9e60661" - size 54369 + filename "ada-1.06-pkg.tar.gz" + md5sum "0f3d2dc2ff33d40092b324a7a5a363d6" + size 54364 provides (ada-mode ada-stmt) requires () type regular @@ -1061,20 +1014,20 @@ ;;;@@@ (package-get-update-base-entry (quote (pcl-cvs - (standards-version 1.1 - version "1.40" + (standards-version 1.0 + version "1.38" author-version "R-2_0-Beta_2" - date "1999-06-16" - build-date "1999-07-30" + date "1998-11-17" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "prog" dump nil description "CVS frontend." - filename "pcl-cvs-1.40-pkg.tar.gz" - md5sum "2ad22b28bb14a7bade0b2fad0723d35f" - size 163639 + filename "pcl-cvs-1.38-pkg.tar.gz" + md5sum "a5ff4e61dffe3985c20385eb741d4783" + size 163524 provides (pcl-cvs generic-sc) requires (xemacs-base elib dired) type regular @@ -1083,20 +1036,20 @@ ;;;@@@ (package-get-update-base-entry (quote (cc-mode - (standards-version 1.1 - version "1.16" + (standards-version 1.0 + version "1.15" author-version "5.25" date "1998-12-30" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "Barry Warsaw " - distribution xemacs + distribution stable priority medium category "prog" dump nil description "C, C++ and Java language support." - filename "cc-mode-1.16-pkg.tar.gz" - md5sum "9f8c53d9abca09982e739344c733c7c3" - size 212664 + filename "cc-mode-1.15-pkg.tar.gz" + md5sum "ca73b190e79f96ab928eecd12af94222" + size 212611 provides (cc-mode) requires (xemacs-base) type regular @@ -1105,20 +1058,20 @@ ;;;@@@ (package-get-update-base-entry (quote (misc-games - (standards-version 1.1 - version "1.12" - author-version "21.1" + (standards-version 1.0 + version "1.11" + author-version "21.0b65" date "1999-03-05" - build-date "1999-07-30" + build-date "1999-03-11" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "games" dump nil description "Other amusements and diversions." - filename "misc-games-1.12-pkg.tar.gz" - md5sum "74c3421bdfdfe77989741389f0e1330a" - size 166163 + filename "misc-games-1.11-pkg.tar.gz" + md5sum "80149e00e5698d0a48945c918bd2d0ba" + size 166197 provides (decipher gomoku hanoi life morse rot13) requires (xemacs-base) type single @@ -1127,20 +1080,20 @@ ;;;@@@ (package-get-update-base-entry (quote (mine - (standards-version 1.1 - version "1.11" + (standards-version 1.0 + version "1.10" author-version "1.9" date "1998-05-09" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "games" dump nil description "Minehunt Game." - filename "mine-1.11-pkg.tar.gz" - md5sum "fad5f9d385ac22c2cf446db18e57300e" - size 66703 + filename "mine-1.10-pkg.tar.gz" + md5sum "a2d4f93830fe86e4d4e2f081ec0517fb" + size 66679 provides (xmine) requires (xemacs-base) type regular @@ -1149,20 +1102,20 @@ ;;;@@@ (package-get-update-base-entry (quote (games - (standards-version 1.1 - version "1.10" + (standards-version 1.0 + version "1.09" author-version "1.04" date "1998-06-04" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "Glynn Clements " - distribution xemacs + distribution stable priority low category "games" dump nil description "Tetris, Sokoban, and Snake." - filename "games-1.10-pkg.tar.gz" - md5sum "e43de212a7ceb56cbaad7e40eb775dd2" - size 32184 + filename "games-1.09-pkg.tar.gz" + md5sum "76a327a228745576538711180a9e444e" + size 32146 provides (gamegrid snake tetris sokoban) requires (xemacs-base) type regular @@ -1171,20 +1124,20 @@ ;;;@@@ (package-get-update-base-entry (quote (cookie - (standards-version 1.1 - version "1.11" - author-version "21.1" + (standards-version 1.0 + version "1.10" + author-version "21.0b62" date "1998-04-07" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "games" dump nil description "Spook and Yow (Zippy quotes)." - filename "cookie-1.11-pkg.tar.gz" - md5sum "291ea47a1e71de661de365aea0addb60" - size 34221 + filename "cookie-1.10-pkg.tar.gz" + md5sum "1c5599fa30e346af452c126d872121be" + size 34198 provides (cookie1 yow) requires (xemacs-base) type regular @@ -1193,20 +1146,20 @@ ;;;@@@ (package-get-update-base-entry (quote (bbdb - (standards-version 1.1 - version "1.08" - author-version "2.00.06" - date "1999-01-24" - build-date "1999-07-30" + (standards-version 1.0 + version "1.07" + author-version "2.00.02" + date "1998-10-08" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "comm" dump nil description "The Big Brother Data Base" - filename "bbdb-1.08-pkg.tar.gz" - md5sum "c95ed737fab5b59e88d9acc33703697b" - size 282061 + filename "bbdb-1.07-pkg.tar.gz" + md5sum "e28c4aed70df000812d34cb3795c2f72" + size 282200 provides (bbdb) requires (bbdb edit-utils gnus mh-e rmail supercite vm tm apel mail-lib xemacs-base) type regular @@ -1215,20 +1168,20 @@ ;;;@@@ (package-get-update-base-entry (quote (zenirc - (standards-version 1.1 - version "1.06" + (standards-version 1.0 + version "1.05" author-version "2.112" date "1998-08-15" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "comm" dump nil description "ZENIRC IRC Client." - filename "zenirc-1.06-pkg.tar.gz" - md5sum "7b701d195193ad6b0bf8e2067e17e372" - size 276012 + filename "zenirc-1.05-pkg.tar.gz" + md5sum "df432e4987ddd0dd65e0124d7d910967" + size 276054 provides (zenirc) requires (zenirc) type regular @@ -1237,20 +1190,20 @@ ;;;@@@ (package-get-update-base-entry (quote (mew - (standards-version 1.1 - version "1.08" + (standards-version 1.0 + version "1.07" author-version "1.93b38x1" date "1998-12-09" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "comm" dump nil description "Messaging in an Emacs World." - filename "mew-1.08-pkg.tar.gz" - md5sum "47ff3e8966c6a198cbae3a413139f4b7" - size 518502 + filename "mew-1.07-pkg.tar.gz" + md5sum "04ed302d5a3735169835e52dadc9e84d" + size 518432 provides (mew) requires (mew) type regular @@ -1259,20 +1212,20 @@ ;;;@@@ (package-get-update-base-entry (quote (tm - (standards-version 1.1 - version "1.20" - author-version "21.1" + (standards-version 1.0 + version "1.18" + author-version "21.0" date "1999-02-06" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "comm" dump nil description "Emacs MIME support." - filename "tm-1.20-pkg.tar.gz" - md5sum "d602235f7efdcdd37e7758101e3c162d" - size 329547 + filename "tm-1.18-pkg.tar.gz" + md5sum "3d7641bd11adb085686384ffee80bf04" + size 330163 provides (tm tm-edit tm-view mime-setup) requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base) type regular @@ -1281,20 +1234,20 @@ ;;;@@@ (package-get-update-base-entry (quote (gnus - (standards-version 1.1 - version "1.42" + (standards-version 1.0 + version "1.40" author-version "5.6.45x1" date "1999-03-12" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "comm" dump nil description "The Gnus Newsreader and Mailreader." - filename "gnus-1.42-pkg.tar.gz" - md5sum "f076c9ae4ca6ab468454d8036a178501" - size 1872714 + filename "gnus-1.40-pkg.tar.gz" + md5sum "df916949c14fc6a1dcd5b3f3158a5497" + size 1873480 provides (gnus message) requires (gnus tm apel w3 mh-e mailcrypt rmail mail-lib xemacs-base) type regular @@ -1303,20 +1256,20 @@ ;;;@@@ (package-get-update-base-entry (quote (rmail - (standards-version 1.1 - version "1.10" - author-version "21.1" + (standards-version 1.0 + version "1.08" + author-version "21.0b62" date "1998-06-28" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "comm" dump nil description "An obsolete Emacs mailer." - filename "rmail-1.10-pkg.tar.gz" - md5sum "4a8b8e1d7b68957ab357d8f86f232fac" - size 96442 + filename "rmail-1.08-pkg.tar.gz" + md5sum "90f98f9043e0c6f2180ffec9c6904eca" + size 96450 provides (rmail rmailsum) requires (tm apel mail-lib xemacs-base) type regular @@ -1325,42 +1278,42 @@ ;;;@@@ (package-get-update-base-entry (quote (mailcrypt - (standards-version 1.1 - version "2.01" - author-version "3.5.3" - date "1999-03-12" - build-date "1999-07-30" + (standards-version 1.0 + version "1.07" + author-version "3.4" + date "1998-01-24" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "comm" dump nil description "Support for messaging encryption with PGP." - filename "mailcrypt-2.01-pkg.tar.gz" - md5sum "1225a54298f26e6a06749dfb0665b658" - size 134061 + filename "mailcrypt-1.07-pkg.tar.gz" + md5sum "350dccab50ef0800b95d44ef62cca359" + size 86362 provides (mailcrypt) - requires (mail-lib fsf-compat xemacs-base) + requires (gnus vm mail-lib xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (supercite - (standards-version 1.1 - version "1.13" + (standards-version 1.0 + version "1.12" author-version "3.55x3" date "1999-04-06" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "comm" dump nil description "An Emacs citation tool for News & Mail messages." - filename "supercite-1.13-pkg.tar.gz" - md5sum "7f599f29f111dca3e62c3baeec2b2d91" - size 99547 + filename "supercite-1.12-pkg.tar.gz" + md5sum "7188738f17ec05c1561fe054fdf120dd" + size 99564 provides (supercite) requires (mail-lib xemacs-base) type regular @@ -1369,20 +1322,20 @@ ;;;@@@ (package-get-update-base-entry (quote (mh-e - (standards-version 1.1 - version "1.10" - author-version "21.1" + (standards-version 1.0 + version "1.09" + author-version "21.0b62" date "1998-07-12" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "comm" dump nil description "Front end support for MH." - filename "mh-e-1.10-pkg.tar.gz" - md5sum "e04e85a9ff62282a18a06872c840e22f" - size 176436 + filename "mh-e-1.09-pkg.tar.gz" + md5sum "89e6f44e8dca03f6be10068391831262" + size 176469 provides (mh-e) requires (mail-lib xemacs-base) type regular @@ -1391,20 +1344,20 @@ ;;;@@@ (package-get-update-base-entry (quote (gnats - (standards-version 1.1 - version "1.09" + (standards-version 1.0 + version "1.08" author-version "3.101" date "1998-08-01" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high category "comm" dump nil description "XEmacs bug reports." - filename "gnats-1.09-pkg.tar.gz" - md5sum "0893c6cad7179a2be79744bdfc0c6932" - size 189250 + filename "gnats-1.08-pkg.tar.gz" + md5sum "8c1e3100399aac86c63683b1836d4a61" + size 189265 provides (gnats gnats-admin send-pr) requires (mail-lib xemacs-base) type regular @@ -1413,20 +1366,20 @@ ;;;@@@ (package-get-update-base-entry (quote (footnote - (standards-version 1.1 - version "1.11" + (standards-version 1.0 + version "1.10" author-version "0.18x" date "1999-03-11" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "SL Baur " - distribution xemacs + distribution stable priority low category "comm" dump nil description "Footnoting in mail message editing modes." - filename "footnote-1.11-pkg.tar.gz" - md5sum "7aa931c602913134e5e716de752439db" - size 18364 + filename "footnote-1.10-pkg.tar.gz" + md5sum "124d7e58ba9905db7488ee142470249f" + size 18356 provides (footnote) requires (mail-lib xemacs-base) type regular @@ -1435,21 +1388,21 @@ ;;;@@@ (package-get-update-base-entry (quote (eudc - (standards-version 1.1 - version "1.29" - author-version "1.29" - date "1999-07-21" - build-date "1999-07-30" - maintainer "Oscar Figueiredo " - distribution xemacs + (standards-version 1.0 + version "1.28" + author-version "1.28" + date "1999-02-13" + build-date "1999-03-01" + maintainer "Oscar Figueiredo " + distribution stable priority low category "comm" dump nil description "Emacs Unified Directory Client (LDAP, PH)." - filename "eudc-1.29-pkg.tar.gz" - md5sum "23f490bd6771d873c1869fa1ac56a3a8" - size 71390 - provides (eudc eudc-ldap eudc-ph eudc-bbdb) + filename "eudc-1.28-pkg.tar.gz" + md5sum "e88e7ed791d16105824812edcd743bc6" + size 62476 + provides (eudc eudc-ldap eudc-ph) requires (fsf-compat xemacs-base bbdb) type regular )) @@ -1457,20 +1410,20 @@ ;;;@@@ (package-get-update-base-entry (quote (net-utils - (standards-version 1.1 - version "1.12" - author-version "21.1" + (standards-version 1.0 + version "1.11" + author-version "21.0b62" date "1998-07-01" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "comm" dump nil description "Miscellaneous Networking Utilities." - filename "net-utils-1.12-pkg.tar.gz" - md5sum "49b7e1d0f2f97519eca07d3562f6a00d" - size 107202 + filename "net-utils-1.11-pkg.tar.gz" + md5sum "f9d52e6e6b4f53ccf5cdd3521403e276" + size 107193 provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www) requires (w3 efs mail-lib xemacs-base) type single @@ -1479,20 +1432,20 @@ ;;;@@@ (package-get-update-base-entry (quote (w3 - (standards-version 1.1 - version "1.14" + (standards-version 1.0 + version "1.13" author-version "4.0pre39x1" date "1999-03-02" - build-date "1999-07-30" + build-date "1999-03-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution experimental priority high category "comm" dump nil description "A Web browser." - filename "w3-1.14-pkg.tar.gz" - md5sum "693692928758ea53e9fa76527893a483" - size 680740 + filename "w3-1.13-pkg.tar.gz" + md5sum "8e9f70ef2c4b43090cfbf86974517c66" + size 682040 provides (w3 url) requires (w3 mail-lib xemacs-base) type regular @@ -1501,20 +1454,20 @@ ;;;@@@ (package-get-update-base-entry (quote (vm - (standards-version 1.1 - version "1.21" - author-version "6.72" + (standards-version 1.0 + version "1.20" + author-version "6.71" date "1999-05-13" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "comm" dump nil description "An Emacs mailer." - filename "vm-1.21-pkg.tar.gz" - md5sum "1110173b0759dbed61e9b1690d32d984" - size 619207 + filename "vm-1.20-pkg.tar.gz" + md5sum "120d25d3541fc7ef4bb34659a4aba89c" + size 614987 provides (vm) requires (mail-lib xemacs-base) type regular @@ -1523,20 +1476,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sounds-wav - (standards-version 1.1 - version "1.08" - author-version "21.1" + (standards-version 1.0 + version "1.07" + author-version "21.0b64" date "1999-02-02" - build-date "1999-07-30" + build-date "1999-03-05" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high category "libs" dump nil description "XEmacs Microsoft sound files." - filename "sounds-wav-1.08-pkg.tar.gz" - md5sum "8d34b4f2a6cb90f3d86c94d018cc3912" - size 149046 + filename "sounds-wav-1.07-pkg.tar.gz" + md5sum "60a70b85e8711fb1c9a1c7d0f4bf8ee0" + size 149045 provides () requires () type regular @@ -1545,20 +1498,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sounds-au - (standards-version 1.1 - version "1.08" - author-version "21.1" + (standards-version 1.0 + version "1.07" + author-version "21.0b64" date "1999-02-02" - build-date "1999-07-30" + build-date "1999-03-05" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high category "libs" dump nil description "XEmacs Sun sound files." - filename "sounds-au-1.08-pkg.tar.gz" - md5sum "8344fa28ad13a14e67accf72168ac91a" - size 126196 + filename "sounds-au-1.07-pkg.tar.gz" + md5sum "4b5acd296b50102e50565650d9d7ec0b" + size 126184 provides () requires () type regular @@ -1567,20 +1520,20 @@ ;;;@@@ (package-get-update-base-entry (quote (xemacs-devel - (standards-version 1.1 - version "1.23" - author-version "21.1" - date "1999-05-28" - build-date "1999-07-30" + (standards-version 1.0 + version "1.21" + author-version "21.0b62" + date "1998-10-20" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "libs" dump nil description "Emacs Lisp developer support." - filename "xemacs-devel-1.23-pkg.tar.gz" - md5sum "f0f629aed67569b793347ca9713fc836" - size 83642 + filename "xemacs-devel-1.21-pkg.tar.gz" + md5sum "aa472f2d412382c2fdd3150105ca7d1c" + size 83543 provides (docref eldoc elp find-func hide-copyleft ielm regexp-opt trace) requires (xemacs-base) type single @@ -1589,20 +1542,20 @@ ;;;@@@ (package-get-update-base-entry (quote (tooltalk - (standards-version 1.1 - version "1.10" - author-version "21.1" + (standards-version 1.0 + version "1.09" + author-version "21.0b62" date "1998-07-25" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low category "libs" dump nil description "Support for building with Tooltalk." - filename "tooltalk-1.10-pkg.tar.gz" - md5sum "6e73fe7a0ef9d9511e885999b806f914" - size 9279 + filename "tooltalk-1.09-pkg.tar.gz" + md5sum "368d6407bf82711bee9a01fa6908b576" + size 9271 provides () requires () type regular @@ -1611,20 +1564,20 @@ ;;;@@@ (package-get-update-base-entry (quote (elib - (standards-version 1.1 - version "1.05" + (standards-version 1.0 + version "1.04" author-version "1.0" date "1998-10-01" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution mule priority high category "libs" dump nil description "Portable Emacs Lisp utilities library." - filename "elib-1.05-pkg.tar.gz" - md5sum "b9f0d18ae78f70a65a341c515aae2095" - size 72809 + filename "elib-1.04-pkg.tar.gz" + md5sum "d17596beb9b03292e322f8460c36eb81" + size 72834 provides (avltree bintree cookie dll elib-node queue-f queue-m read stack-f stack-m string) requires () type single @@ -1633,20 +1586,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edebug - (standards-version 1.1 - version "1.08" - author-version "21.1" + (standards-version 1.0 + version "1.07" + author-version "21.0b62" date "1998-03-12" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low category "libs" dump nil description "An Emacs Lisp debugger." - filename "edebug-1.08-pkg.tar.gz" - md5sum "366450f91a308c84471f7cdb98fd907c" - size 112428 + filename "edebug-1.07-pkg.tar.gz" + md5sum "62d3e581feac2c3a73917ad0d81151b0" + size 112408 provides (edebug cl-read cust-print eval-reg cl-specs) requires (xemacs-base) type regular @@ -1655,20 +1608,20 @@ ;;;@@@ (package-get-update-base-entry (quote (Sun - (standards-version 1.1 - version "1.11" - author-version "21.1" + (standards-version 1.0 + version "1.10" + author-version "21.0b62" date "1998-07-25" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution sun priority low category "libs" dump nil description "Support for Sparcworks." - filename "Sun-1.11-pkg.tar.gz" - md5sum "8920cd925c5bff8b9d4a353d08c1f7ff" - size 63685 + filename "Sun-1.10-pkg.tar.gz" + md5sum "54cce5cbb182d99de5562a586714e50c" + size 63693 provides (sccs eos-browser eos-common eos-debugger eos-debugger eos-editor eos-init eos-load eos-menubar eos-toolbar sunpro) requires (cc-mode xemacs-base) type regular @@ -1677,20 +1630,20 @@ ;;;@@@ (package-get-update-base-entry (quote (apel - (standards-version 1.1 - version "1.15" - author-version "9.20" - date "1999-07-26" - build-date "1999-07-30" + (standards-version 1.0 + version "1.11" + author-version "9.18" + date "1999-05-08" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution mule priority high category "libs" dump nil description "A Portable Emacs Library. Used by XEmacs MIME support." - filename "apel-1.15-pkg.tar.gz" - md5sum "503832a7c28fe700afc35dbaf7fdeb01" - size 79178 + filename "apel-1.11-pkg.tar.gz" + md5sum "4c53047e1f0964b24626c29ee40a04c5" + size 73997 provides (atype emu-20 emu-e19 emu-x20 emu-xemacs emu file-detect filename install mule-caesar path-util richtext std11-parse std11 tinyrich) requires (fsf-compat xemacs-base) type regular @@ -1699,20 +1652,20 @@ ;;;@@@ (package-get-update-base-entry (quote (efs - (standards-version 1.1 - version "1.15" + (standards-version 1.0 + version "1.14" author-version "1.18" date "1999-01-03" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "Mike Sperber " - distribution xemacs + distribution stable priority medium category "libs" dump nil description "Treat files on remote systems the same as local files." - filename "efs-1.15-pkg.tar.gz" - md5sum "4c88a1915bace153310c681f24deb14d" - size 369713 + filename "efs-1.14-pkg.tar.gz" + md5sum "2b4128fec0dcb31834f404ef962f10ab" + size 369742 provides (efs) requires (xemacs-base vm dired) type regular @@ -1721,20 +1674,20 @@ ;;;@@@ (package-get-update-base-entry (quote (dired - (standards-version 1.1 - version "1.06" + (standards-version 1.0 + version "1.05" author-version "7.9" date "1998-12-09" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "Mike Sperber " - distribution xemacs + distribution stable priority medium category "libs" dump nil description "Manage file systems." - filename "dired-1.06-pkg.tar.gz" - md5sum "9c857aa147bf53d972ad6ac30ce34bd4" - size 187691 + filename "dired-1.05-pkg.tar.gz" + md5sum "392440b1472a2415b0b9b6779df93619" + size 187654 provides (diff dired) requires (xemacs-base) type regular @@ -1743,20 +1696,20 @@ ;;;@@@ (package-get-update-base-entry (quote (mail-lib - (standards-version 1.1 - version "1.24" - author-version "21.1" + (standards-version 1.0 + version "1.23" + author-version "21.0" date "1999-04-13" - build-date "1999-07-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium category "libs" dump nil description "Fundamental lisp files for providing email support." - filename "mail-lib-1.24-pkg.tar.gz" - md5sum "9428816ccc49d99be80dcbfc34d7917f" - size 131977 + filename "mail-lib-1.23-pkg.tar.gz" + md5sum "4293acbed286a63581f55b7a16e4a489" + size 131968 provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail) requires (xemacs-base) type regular @@ -1765,20 +1718,20 @@ ;;;@@@ (package-get-update-base-entry (quote (fsf-compat - (standards-version 1.1 - version "1.06" - author-version "21.1" + (standards-version 1.0 + version "1.05" + author-version "21.0b62" date "1998-09-12" - build-date "1999-07-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution mule priority high category "libs" dump nil description "FSF Emacs compatibility files." - filename "fsf-compat-1.06-pkg.tar.gz" - md5sum "b167c9b6e4b6ff464d34143782d6c633" - size 17356 + filename "fsf-compat-1.05-pkg.tar.gz" + md5sum "64cb1984a71974f3f40c0be1a971f441" + size 17347 provides (overlay thingatpt timer x-popup-menu) requires () type single @@ -1787,20 +1740,20 @@ ;;;@@@ (package-get-update-base-entry (quote (xemacs-base - (standards-version 1.1 - version "1.32" - author-version "21.1" - date "1999-07-22" - build-date "1999-07-30" + (standards-version 1.0 + version "1.30" + author-version "21.0" + date "1998-11-30" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution mule priority high category "libs" dump nil description "Fundamental XEmacs support, you almost certainly need this." - filename "xemacs-base-1.32-pkg.tar.gz" - md5sum "ae699a67f9922ad330fc1e5d45d3ff87" - size 430787 + filename "xemacs-base-1.30-pkg.tar.gz" + md5sum "d9e95850fe8e13a04166d59d62fb38ab" + size 430640 provides (add-log advice annotations assoc case-table chistory comint-xemacs comint compile debug ebuff-menu echistory edmacro ehelp electric enriched env facemenu ffap helper imenu iso-syntax macros novice outline overlay passwd pp regi ring shell skeleton sort thing time-stamp timezone xbm-button xpm-button) requires () type regular @@ -1808,11 +1761,3 @@ )) ;;;@@@ ;; Package Index file ends here ------BEGIN PGP SIGNATURE----- -Version: GnuPG v0.9.8 (SunOS) -Comment: For info see http://www.gnupg.org - -iEYEARECAAYFAjehBIcACgkQEng2Tdz4C2tvvQCbBYGskNM16GwRfw/DjTS4byZN -6CIAnRGmsWGM/07NNA6mEyejc3SDD7/3 -=NjSE ------END PGP SIGNATURE----- diff -r 12e008d41344 -r 697ef44129c6 etc/sample.Xdefaults --- a/etc/sample.Xdefaults Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/sample.Xdefaults Mon Aug 13 11:20:41 2007 +0200 @@ -75,13 +75,6 @@ ! While this one is for Athena dialog boxes. Emacs*dialog*Command*Background: WhiteSmoke -! Athena dialog boxes are sometimes built with the Xaw3d -! variant of the Athena toolkit. -! XEmacs being nice to 8bit displays, it defaults to: -Emacs*dialog*Command*beNiceToColormap: true -! If you are shocked by the ugliness of the 3d rendition, -! you may want to set (even on 8bit displays) the above to false. - ! Xlw Scrollbar colors Emacs*XlwScrollBar.Foreground: Gray30 Emacs*XlwScrollBar.Background: Gray75 diff -r 12e008d41344 -r 697ef44129c6 etc/xemacs.1 --- a/etc/xemacs.1 Mon Aug 13 11:19:22 2007 +0200 +++ b/etc/xemacs.1 Mon Aug 13 11:20:41 2007 +0200 @@ -742,10 +742,10 @@ Steve Baur , Martin Buchholz , Richard Mlynarik , -Hrvoje Niksic , +Hrvoje Niksic , Chuck Thompson , -Ben Wing , -Jamie Zawinski , +Ben Wing , +Jamie Zawinski , and many others. It was based on an early version of .I GNU Emacs Version diff -r 12e008d41344 -r 697ef44129c6 info/dir --- a/info/dir Mon Aug 13 11:19:22 2007 +0200 +++ b/info/dir Mon Aug 13 11:20:41 2007 +0200 @@ -44,7 +44,6 @@ * New-Users-Guide:: XEmacs New User's Guide for XEmacs 21.2. * XEmacs-FAQ:: XEmacs Frequently Asked Questions for 21.2. * Internals:: Guide to the internals of XEmacs. -* Emodules:: XEmacs dynamic loadable module support. Local Packages: diff -r 12e008d41344 -r 697ef44129c6 lib-src/ChangeLog --- a/lib-src/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,376 +1,3 @@ -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. - -2000-02-06 Martin Buchholz - - * getopt.h: - * fakemail.c: - * gnuslib.c: - * sorted-doc.c: - * yow.c: - * cvtmail.c: - * movemail.c: - * gnuclient.c: - ANSIfy. Use coding standards for function definitions. - Make C++-compilable. Modified from patch by Zack Weinberg. - -2000-01-26 Kirill 'Big K' Katsnelson - - * hexl.c: Removed MSDOS code; set binary I/O flags for NT. - -2000-01-18 Martin Buchholz - - * XEmacs 21.2.27 is released. - -2000-01-18 Martin Buchholz - - * ootags.c: Ansify. - * etags.c: - * getopt.c: - * cvtmail.c: - Remove declarations of ANSI errno, getenv(), malloc(). - -2000-01-13 Martin Buchholz - - * movemail.c (main): - * make-docfile.c (write_c_args): - Simple compiler warning fixes. - -2000-01-09 Martin Buchholz - - * *.[ch]: Change <../src/config.h> to - * ellcc.c: Always use <...> to #include files not in `.' - * Makefile.in.in: Use safer -I paths. - Use $(top_srcdir) instead of $(srcdir)/../src - Add warning comment. - -2000-01-08 Martin Buchholz - - * movemail.c: Warning removal. - -2000-01-06 Norbert Koch - - * movemail.c: Typo fix. - -2000-01-03 Michael Sperber [Mr. Preprocessor] - - * movemail.c: Overhaul of the locking code. - -2000-01-03 Martin Buchholz - - * etags.c (etags_strrchr): Ansify. - (etags_strchr): Ansify. - (get_compressor_from_suffix): Remove warning, make code cleaner. - -1999-12-31 Martin Buchholz - - * XEmacs 21.2.26 is released. - -1999-12-24 Martin Buchholz - - * XEmacs 21.2.25 is released. - -1999-12-21 Martin Buchholz - - * fakemail.c (cuserid): ((expr)) ==> (expr) - - * fakemail.c (xmalloc): ANSIfy. - -1999-12-14 Martin Buchholz - - * config.values.sh: Only update config.values.in if changed. - No external dependencies except perl. - No temporary files. - -1999-12-14 Martin Buchholz - - * XEmacs 21.2.24 is released. - -1999-12-13 Martin Buchholz - - * etags.c: Fix warning: `_GNU_SOURCE' redefined. - -1999-12-07 Martin Buchholz - - * XEmacs 21.2.23 is released. - -1999-11-29 Andreas Jaeger - - * Makefile.in.in (INSTALLABLE_SCRIPTS): Removed pstogif. - pstogif: Moved to package tm. - -1999-11-29 XEmacs Build Bot - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz - - * XEmacs 21.2.21 is released. - -1999-11-20 Martin Buchholz - - * process-gnu-depends.sh: Deleted. Obsolete. - * process-depends.sh: Deleted. Obsolete. - -1999-11-20 Jan Vroonhof - - * Makefile.in.in (instvardir): Added. From - Jeff Miller - -1999-11-19 Martin Buchholz - - * etags.c: Upgrade to pot etags version 13.33. - Make `etags --version' print out `XEmacs', not `GNU Emacs' - -1999-11-17 Martin Buchholz - - * etags.c (canonicalize_filename): Typo fix - -1999-11-05 Martin Buchholz - - * etags.c: - * ../etc/etags.1: - * ../etc/NEWS: - Upgrade to etags version 13.32. - etags.c has warnings removed, in addition. - -1999-11-15 Martin Buchholz - - * gnuserv.c (ipc_spawn_watchdog): Use pid_t instead of int. - -1999-11-10 XEmacs Build Bot - - * XEmacs 21.2.20 is released - -1999-11-04 Martin Buchholz - - * gnuserv.c (handle_response): Warning suppression - -1999-09-27 Martin Buchholz - - * ellcc.c: - ANSIfy. - Remove MSDOS cruft. - Remove WINDOWS cruft. - Remove VMS cruft. - (main): The wrong number of bytes were being read during argument - processing. - Delete ANSI imitations like ellcc_strchr(). - Call functions with the right number of arguments. - Fix a typo. - Make functions static. - Remove compiler warnings. - -1999-09-22 Martin Buchholz - - * cvtmail.c (main): ANSIfy - * digest-doc.c (main): ANSIfy - * hexl.c (main): ANSIfy - - * make-path.c: Remove declaration for errno. - * mmencode.c (nextcharin): ANSIfy - * movemail.c (pop_retr): ANSIfy - -1999-07-30 Gleb Arshinov - - * pop.c (pop_quit): use CLOSESOCKET() instead of close() - - * run.c (build_cmdline): Fix NT native build unreferenced variable - warning - (WinMain): Fix release mode build unreferenced variable warning - -1999-07-30 XEmacs Build Bot - - * XEmacs 21.2.19 is released - -1999-07-22 SL Baur - - * Makefile.in.in (datadir): Add. - From Jeff Miller - -1999-07-13 XEmacs Build Bot - - * XEmacs 21.2.18 is released - -1999-06-22 XEmacs Build Bot - - * XEmacs 21.2.17 is released - -1999-06-11 XEmacs Build Bot - - * XEmacs 21.2.16 is released - -1999-06-04 XEmacs Build Bot - - * XEmacs 21.2.15 is released - -1999-06-03 SL Baur - - * Makefile.in.in: Move .PHONY up to force execution of `all'. - 1999-05-14 XEmacs Build Bot * XEmacs 21.2.14 is released @@ -391,14 +18,14 @@ * Makefile.in.in (cppflags): Add -I$(top_srcdir)/src. 1999-04-29 Andy Piper - - * make-docfile.c: build fixes for mingw32. + + * make-docfile.c: build fixes for mingw32. * movemail.c: ditto. * run.c: ditto. * yow.c: ditto. * profile.c: ditto. (gettimeofday): new function copied from nt.c. - + * fakemail.c (make_file_preface): make buildable under windows. * Makefile.in.in: fix some build targets for when we are building @@ -497,7 +124,7 @@ * pop.c: mess with includes so that it builds under native NT. From Fabrice Popineau - + 1998-12-16 Andy Piper * XEmacs 21.2.6 is released @@ -683,7 +310,7 @@ 1998-04-19 Jan Vroonhof * gnuclient.c (main): Read eval from from stdin if just "-batch" - is given. + is given. * gnudoit: Support this. * gnuserv.1: Document this behavior. @@ -755,13 +382,13 @@ 1998-01-13 Martin Buchholz - * lib-src/add-little-package.sh: - * lib-src/add-big-package.sh: + * lib-src/add-little-package.sh: + * lib-src/add-big-package.sh: Use proper paranoid quoting for sh variables. -batch implies -q. Thu Jan 08 09:42:36 1998 - + * gnuserv.h: only set UNIX_DOMAIN_SOCKETS if HAVE_SYS_UN_H is set. @@ -905,7 +532,7 @@ missing a variable called "configuration. This messed up archilibdir. * Added highlighting to text suggesting to do "make gzip-el" in top - level Makefile.in. Added code to do make maybe-blessmail after a + level Makefile.in. Added code to do make maybe-blessmail after a make install is done. 1997-08-07 Jan Vroonhof @@ -973,7 +600,7 @@ * Makefile.in.in (INSTALLABLE_SCRIPTS): Readd Gnuattach. From Hrvoje Niksic - + 1997-06-13 Steven L Baur * update-elc.sh (mule_p): Ignore lisp/language when building diff -r 12e008d41344 -r 697ef44129c6 lib-src/Makefile.in.in --- a/lib-src/Makefile.in.in Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/Makefile.in.in Mon Aug 13 11:20:41 2007 +0200 @@ -53,8 +53,6 @@ bindir=@bindir@ libdir=@libdir@ srcdir=@srcdir@ -datadir=@datadir@ -instvardir=@instvardir@ top_srcdir=@top_srcdir@ archlibdir=@archlibdir@ configuration=@configuration@ @@ -75,25 +73,33 @@ ## Things that a user might actually run, ## which should be installed in bindir. -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT INSTALLABLES_BASE = etags ctags b2m ootags #else INSTALLABLES_BASE = etags ctags b2m gnuclient ootags #endif -INSTALLABLE_SCRIPTS = rcs-checkin gnudoit gnuattach +INSTALLABLE_SCRIPTS = rcs-checkin pstogif gnudoit gnuattach #ifdef HAVE_SHLIB +#ifdef HAVE_MS_WINDOWS +INSTALLABLES = $(INSTALLABLES_BASE) runxemacs rungnuclient ellcc +#else INSTALLABLES = $(INSTALLABLES_BASE) ellcc +#endif #else -INSTALLABLES = $(INSTALLABLES_BASE) +#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 WIN32_NATIVE +#ifdef WINDOWSNT UTILITIES= make-path wakeup profile make-docfile digest-doc \ - sorted-doc movemail cvtmail yow i hexl \ - mmencode minitar + sorted-doc movemail cvtmail yow hexl \ + mmencode #else UTILITIES= make-path wakeup profile make-docfile digest-doc \ sorted-doc movemail cvtmail fakemail yow hexl \ @@ -154,13 +160,7 @@ ## We need to #define emacs to get the right versions of some files. -## To understand the order of -I flags, consider what happens if you run -## ./configure in the source tree, and then run -## $(srcdir).2.26/configure in some other build tree. -## Where will the generated files like config.h be included from? -## This is also why you _must_ use <...> instead of "..." -## when #include'ing generated files. -cppflags = -Demacs -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS) +cppflags = -Demacs -I$(top_srcdir)/src -I../src $(CPPFLAGS) cflags = $(CFLAGS) $(cppflags) $(c_switch_general) ldflags = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general) @@ -171,8 +171,6 @@ .c.o: ${CC} -c $(cflags) $< -.PHONY : all maybe-blessmail install uninstall - all: ${UTILITIES} ${INSTALLABLES} srcdir-symlink.stamp ## Make symlinks for shell scripts if using --srcdir @@ -231,6 +229,7 @@ ## We do not need to install "wakeup" explicitly, because it will be ## copied when this whole directory is copied. +.PHONY : all maybe-blessmail install uninstall install: ${archlibdir} @echo; echo "Installing utilities for users to run." for file in ${INSTALLABLES} ; do \ @@ -277,29 +276,50 @@ ${CC} -c $(cflags) ${srcdir}/getopt.c getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h ${CC} -c $(cflags) ${srcdir}/getopt1.c -alloca.o: ${top_srcdir}/src/alloca.c +alloca.o: ${srcdir}/../src/alloca.c ${CC} -c $(cflags) ${srcdir}/../src/alloca.c -regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h +regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h $(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \ - -DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c + -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c -etags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/etags.c \ +etags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \ + -DVERSION='"${version}"' ${srcdir}/etags.c \ $(GETOPTOBJS) regex.o $(ldflags) -etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h +etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h etags: ${etags_deps} $(CC) ${etags_args} -o $@ -ellcc_args = $(cflags) ${srcdir}/ellcc.c $(ldflags) +ellcc_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \ + ${srcdir}/ellcc.c $(ldflags) ellcc_deps = ${srcdir}/ellcc.c ellcc.h ../src/config.h ellcc: ${ellcc_deps} $(CC) ${ellcc_args} -o $@ -ootags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/ootags.c \ +run_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \ + -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 = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \ + -DVERSION='"${version}"' ${srcdir}/ootags.c \ $(GETOPTOBJS) regex.o $(ldflags) -ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h +ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h ootags: ${ootags_deps} $(CC) ${ootags_args} -o $@ @@ -341,12 +361,6 @@ 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 $@ @@ -356,9 +370,6 @@ 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 12e008d41344 -r 697ef44129c6 lib-src/add-big-package.sh --- a/lib-src/add-big-package.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/add-big-package.sh Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,8 @@ # add-big-package.sh --- Add multiple file package to Package Lisp Hierarchy # Copyright (C) 1997 Free Software Foundation, Inc. -# Author: SL Baur -# Maintainer: SL Baur +# Author: SL Baur +# Maintainer: SL Baur # Keywords: packages internal # This file is part of XEmacs. diff -r 12e008d41344 -r 697ef44129c6 lib-src/b2m.c --- a/lib-src/b2m.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/b2m.c Mon Aug 13 11:20:41 2007 +0200 @@ -19,7 +19,7 @@ by Francesco Potorti` . */ #ifdef HAVE_CONFIG_H -#include +#include <../src/config.h> /* On some systems, Emacs defines static as nothing for the sake of unexec. We don't want that here since we don't use unexec. */ #undef static @@ -30,7 +30,7 @@ #include #include #include -#ifdef WIN32_NATIVE +#ifdef MSDOS #include #endif @@ -88,12 +88,17 @@ char *labels = NULL, *p, *today; struct linebuffer data; -#ifdef WIN32_NATIVE +#ifdef MSDOS _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 12e008d41344 -r 697ef44129c6 lib-src/config.values.in --- a/lib-src/config.values.in Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/config.values.in Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ ;;; Do not edit this file! ;;; This file was automatically generated, by the config.values.sh script, -;;; from configure, which was itself automatically generated from configure.in. +;;; from configure, which was itself automatically generated from configure.in ;;; ;;; See lisp/util/config.el for details on how this file is used. ;;; @@ -24,13 +24,9 @@ CPPFLAGS "@CPPFLAGS@" CXXFLAGS "@CXXFLAGS@" DEFS "@DEFS@" -DOCDIR "@DOCDIR@" -DOCDIR_USER_DEFINED "@DOCDIR_USER_DEFINED@" ETCDIR "@ETCDIR@" ETCDIR_USER_DEFINED "@ETCDIR_USER_DEFINED@" EXEC_PREFIX "@EXEC_PREFIX@" -EXEC_PREFIX_USER_DEFINED "@EXEC_PREFIX_USER_DEFINED@" -FFLAGS "@FFLAGS@" INFODIR "@INFODIR@" INFODIR_USER_DEFINED "@INFODIR_USER_DEFINED@" INFOPATH "@INFOPATH@" @@ -39,24 +35,23 @@ INSTALL_ARCH_DEP_SUBDIR "@INSTALL_ARCH_DEP_SUBDIR@" INSTALL_DATA "@INSTALL_DATA@" INSTALL_PROGRAM "@INSTALL_PROGRAM@" -INSTALL_SCRIPT "@INSTALL_SCRIPT@" LDFLAGS "@LDFLAGS@" LIBS "@LIBS@" 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@" PACKAGE_PATH "@PACKAGE_PATH@" PACKAGE_PATH_USER_DEFINED "@PACKAGE_PATH_USER_DEFINED@" PREFIX "@PREFIX@" -PREFIX_USER_DEFINED "@PREFIX_USER_DEFINED@" PROGNAME "@PROGNAME@" RANLIB "@RANLIB@" RECURSIVE_MAKE "@RECURSIVE_MAKE@" SET_MAKE "@SET_MAKE@" -SHELL "@SHELL@" SITELISPDIR "@SITELISPDIR@" SITELISPDIR_USER_DEFINED "@SITELISPDIR_USER_DEFINED@" SITEMODULEDIR "@SITEMODULEDIR@" @@ -91,13 +86,10 @@ etcdir "@etcdir@" exec_prefix "@exec_prefix@" extra_objs "@extra_objs@" -have_esd_config "@have_esd_config@" includedir "@includedir@" infodir "@infodir@" infopath "@infopath@" install_pp "@install_pp@" -inststaticdir "@inststaticdir@" -instvardir "@instvardir@" internal_makefile_list "@internal_makefile_list@" ld "@ld@" ld_dynamic_link_flags "@ld_dynamic_link_flags@" @@ -114,6 +106,7 @@ libs_xauth "@libs_xauth@" lispdir "@lispdir@" localstatedir "@localstatedir@" +lockdir "@lockdir@" lwlib_objs "@lwlib_objs@" machfile "@machfile@" mandir "@mandir@" diff -r 12e008d41344 -r 697ef44129c6 lib-src/config.values.sh --- a/lib-src/config.values.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/config.values.sh Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,4 @@ -: #-*- Perl -*- -eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge - if 0; - +#! /bin/sh # config.values.sh --- create config.values.in from ../configure # Author: Martin Buchholz @@ -38,29 +35,19 @@ ## by an XEmacs Maintainer (consider yourself so blessed, if you are ## actually reading this commentary). ## - -if (! -r "./configure") { - chdir ".." or die "Can't chdir: $!"; - if (! -r "./configure") { - die "Can't find configure!"; - } -} +if test ! -r ./configure; then + cd .. + if test ! -r ./configure; then + echo "Can't find configure!"; + exit 1; + fi +fi -sub FileContents { - local $/ = undef; # Slurp mode - open (FILE, "< $_[0]") or die "$_[0]: $!"; - my $contents = ; - close FILE or die "$_[0]: $!"; - return $contents; -} - -my $configure_contents = FileContents "./configure"; -my $cvi_contents = FileContents "lib-src/config.values.in"; - -my $new_cvi_contents = -";;; Do not edit this file! +exec < ./configure > "lib-src/config.values.in" +cat <<\EOF +;;; Do not edit this file! ;;; This file was automatically generated, by the config.values.sh script, -;;; from configure, which was itself automatically generated from configure.in. +;;; from configure, which was itself automatically generated from configure.in ;;; ;;; See lisp/util/config.el for details on how this file is used. ;;; @@ -75,27 +62,15 @@ ;;; Variables defined in configure by AC_SUBST follow: ;;; (These are used in Makefiles) -"; +EOF +sed -n '/^s%@\([A-Za-z_][A-Za-z_]*\)@%\$\1%g$/ { + s/^s%@\([A-Za-z_][A-Za-z_]*\)@%\$\1%g$/\1 "@\1@"/ + p +}' | \ +sort -u +cat <<\EOF -my %done; -for my $var (sort { $a cmp $b } - $configure_contents =~ - /^s\%\@([A-Za-z0-9_]+)\@\%\$[A-Za-z0-9_]+\%g/mg) { - $new_cvi_contents .= "$var \"\@$var\@\"\n" unless exists $done{$var}; - $done{$var} = 1; -} - -$new_cvi_contents .= " ;;; Variables defined in configure by AC_DEFINE and AC_DEFINE_UNQUOTED follow: ;;; (These are used in C code) -"; - -if ($cvi_contents ne $new_cvi_contents) { - unlink "lib-src/config.values.in"; - open (CVI, "> lib-src/config.values.in") - or die "lib-src/config.values.in: $!"; - print CVI $new_cvi_contents; - close CVI - or die "lib-src/config.values.in: $!"; -} +EOF diff -r 12e008d41344 -r 697ef44129c6 lib-src/cvtmail.c --- a/lib-src/cvtmail.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/cvtmail.c Mon Aug 13 11:20:41 2007 +0200 @@ -35,20 +35,27 @@ */ -#include +#include <../src/config.h> #include #include -#include -static void *xmalloc (size_t); -static void *xrealloc (void *, size_t); +#if __STDC__ || defined(STDC_HEADERS) +# include +#else +char *malloc (); +char *getenv (); +#endif +static void *xmalloc (unsigned int); +static void *xrealloc (char *ptr, unsigned int); 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[]) +main (argc, argv) + int argc; + char *argv[]; { char *hd; char *md; @@ -63,7 +70,7 @@ char name[14]; int c; - hd = getenv ("HOME"); + hd = (char *) getenv ("HOME"); md = (char *) xmalloc (strlen (hd) + 10); strcpy (md, hd); @@ -111,7 +118,8 @@ } static void -skip_to_lf (FILE *stream) +skip_to_lf (stream) + FILE *stream; { register int c; while ((c = getc(stream)) != '\n') @@ -119,18 +127,21 @@ } static void * -xmalloc (size_t size) +xmalloc (size) + unsigned size; { - void *result = malloc (size); + char *result = (char *) malloc (size); if (!result) fatal ("virtual memory exhausted", 0); return result; } static void * -xrealloc (void *ptr, size_t size) +xrealloc (ptr, size) + char *ptr; + unsigned size; { - void *result = realloc (ptr, size); + char *result = (char *) realloc (ptr, size); if (!result) fatal ("virtual memory exhausted", 0); return result; @@ -139,14 +150,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 12e008d41344 -r 697ef44129c6 lib-src/digest-doc.c --- a/lib-src/digest-doc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/digest-doc.c Mon Aug 13 11:20:41 2007 +0200 @@ -6,12 +6,12 @@ but in texinfo format and sorted by function/variable name. */ #ifdef emacs -#include +#include <../src/config.h> #endif #include int -main (int argc, char *argv[]) +main () { register int ch; register int notfirst = 0; diff -r 12e008d41344 -r 697ef44129c6 lib-src/ellcc.c --- a/lib-src/ellcc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/ellcc.c Mon Aug 13 11:20:41 2007 +0200 @@ -24,8 +24,8 @@ /* Here's the scoop. We would really like this to be a shell script, but -the various Windows platforms don't have reliable scripting that suits -our needs. We don't want to rely on perl or some other such language +the various Windows platforms dont have reliable scripting that suits +our needs. We dont want to reply on perl or some other such language so we have to roll our own executable to act as a front-end for the compiler. @@ -58,31 +58,87 @@ See the samples for more details. */ -#include #include #include + +#ifdef MSDOS +# include +# include +# include +# ifndef HAVE_CONFIG_H +# define DOS_NT +# include +# endif +#endif /* MSDOS */ + +#ifdef WINDOWSNT +# include +# include +# include +# include +# define MAXPATHLEN _MAX_PATH +# ifdef HAVE_CONFIG_H +# undef HAVE_NTGUI +# else +# define DOS_NT +# define HAVE_GETCWD +# endif /* not HAVE_CONFIG_H */ +#endif /* WINDOWSNT */ + +#ifdef HAVE_CONFIG_H +# include + /* On some systems, Emacs defines static as nothing for the sake + of unexec. We don't want that here since we don't use unexec. */ +# undef static +#endif /* HAVE_CONFIG_H */ + +#if !defined (WINDOWSNT) && defined (STDC_HEADERS) +#include #include -#include -#include -#include +#endif #ifdef HAVE_UNISTD_H # include +#else +# ifdef HAVE_GETCWD + extern char *getcwd (); +# endif #endif /* HAVE_UNISTD_H */ +#include +#include +#include +#ifndef errno + extern int errno; +#endif +#include +#include + #define EMODULES_GATHER_VERSION +#include "emodules.h" +#include "ellcc.h" -#include -#include /* Generated files must be included using <...> */ +#if !defined (S_ISREG) && defined (S_IFREG) +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif + +/* Exit codes for success and failure. */ +#ifdef VMS +# define GOOD 1 +# define BAD 0 +#else +# define GOOD 0 +# define BAD 1 +#endif #define DEBUG #ifndef HAVE_SHLIB int -main (int argc, char *argv[]) +main() { fprintf (stderr, "Dynamic modules not supported on this platform\n"); - return EXIT_FAILURE; + return (BAD); } #else @@ -107,12 +163,11 @@ # define xnew(n,Type) ((Type *) xmalloc ((n) * sizeof (Type))) # define xrnew(op,n,Type) ((Type *) xrealloc ((op), (n) * sizeof (Type))) #endif -static void *xmalloc (size_t); -static void fatal (char *, 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); +long *xmalloc (), *xrealloc (); +void fatal (), pfatal (); +char *ellcc_strchr (), *ellcc_strrchr (); +void add_to_argv (); +void do_compile_mode(), do_link_mode(), do_init_mode(); #define SSTR(S) ((S)?(S):"") @@ -141,7 +196,9 @@ STR = DFLT int -main (int argc, char *argv[]) +main (argc, argv) + int argc; + char *argv[]; { char *tmp; int i, done_mode = 0; @@ -149,12 +206,12 @@ prog_argc = argc; prog_argv = argv; -#if defined(WIN32_NATIVE) - tmp = strrchr (argv[0], '\\'); +#if defined(MSDOS) || defined(WINDOWSNT) + tmp = ellcc_strrchr (argv[0], '\\'); if (tmp != (char *)0) tmp++; #elif !defined (VMS) - tmp = strrchr (argv[0], '/'); + tmp = ellcc_strrchr (argv[0], '/'); if (tmp != (char *)0) tmp++; #else @@ -191,7 +248,7 @@ char *modeopt = argv[i] + 7; if (done_mode && strcmp (modeopt, "verbose")) - fatal ("more than one mode specified", (char *) 0); + fatal ("more than one mode specified"); if (strcmp (modeopt, "link") == 0) { done_mode++; @@ -230,13 +287,13 @@ printf ("%s\n", ELLCC_CONFIG); return 0; } - else if (strncmp (argv[i], "--mod-name=", 11) == 0) + else if (strncmp (argv[i], "--mod-name=", 10) == 0) mod_name = argv[i] + 11; - else if (strncmp (argv[i], "--mod-title=", 12) == 0) + else if (strncmp (argv[i], "--mod-title=", 11) == 0) mod_title = argv[i] + 12; - else if (strncmp (argv[i], "--mod-version=", 14) == 0) + else if (strncmp (argv[i], "--mod-version=", 13) == 0) mod_version = argv[i] + 14; - else if (strncmp (argv[i], "--mod-output=", 13) == 0) + else if (strncmp (argv[i], "--mod-output=", 12) == 0) mod_output = argv[i] + 13; else { @@ -282,7 +339,7 @@ #endif if (exec_argc < 2) - fatal ("too few arguments", (char *) 0); + fatal ("too few arguments"); /* * Get the over-rides from the environment @@ -321,23 +378,83 @@ } /* Like malloc but get fatal error if memory is exhausted. */ -static void * -xmalloc (size_t size) +long * +xmalloc (size) + unsigned int size; { - void *result = malloc (size); + long *result = (long *) malloc (size); if (result == NULL) - fatal ("virtual memory exhausted", (char *)0); + fatal ("virtual memory exhausted", (char *)NULL); + return result; +} + +long * +xrealloc (ptr, size) + char *ptr; + unsigned int size; +{ + long *result = (long *) realloc (ptr, size); + if (result == NULL) + fatal ("virtual memory exhausted", (char *)NULL); return result; } /* Print error message and exit. */ -static void -fatal (char *s1, char *s2) +void +fatal (s1, s2) + char *s1, *s2; { fprintf (stderr, "%s: ", progname); fprintf (stderr, s1, s2); fprintf (stderr, "\n"); - exit (EXIT_FAILURE); + exit (BAD); +} + +void +pfatal (s1) + char *s1; +{ + perror (s1); + exit (BAD); +} + +/* + * Return the ptr in sp at which the character c last + * appears; NULL if not found + * + * Identical to System V strrchr, included for portability. + */ +char * +ellcc_strrchr (sp, c) + register char *sp, c; +{ + register char *r; + + r = NULL; + do + { + if (*sp == c) + r = sp; + } while (*sp++); + return r; +} + +/* + * Return the ptr in sp at which the character c first + * appears; NULL if not found + * + * Identical to System V strchr, included for portability. + */ +char * +ellcc_strchr (sp, c) + register char *sp, c; +{ + do + { + if (*sp == c) + return sp; + } while (*sp++); + return NULL; } /* @@ -345,13 +462,14 @@ * to the compiler or linker. We need to split individual words into * arguments, taking quoting into account. This can get ugly. */ -static void -add_to_argv (const char *str) +void +add_to_argv (str) + 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) @@ -359,7 +477,7 @@ switch (sm) { case 0: /* Start of case - string leading whitespace */ - if (isspace ((unsigned char) *str)) + if (isspace (*str)) str++; else { @@ -369,7 +487,7 @@ break; case 1: /* Non-whitespace character. Mark the start */ - if (isspace ((unsigned char) *str)) + if (isspace (*str)) { /* Reached the end of the argument. Add it. */ int l = str-s; @@ -378,7 +496,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 +541,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; } } @@ -439,8 +557,8 @@ * is build up the argument vector and exec() it. We must just make sure * that we get all of the required arguments in place. */ -static void -do_compile_mode (void) +void +do_compile_mode() { int i; char ts[4096]; /* Plenty big enough */ @@ -469,8 +587,8 @@ * all of the provided arguments, then the final post arguments. Once * all of this has been done, the argument vector is ready to run. */ -static void -do_link_mode (void) +void +do_link_mode() { int i,x; char *t, ts[4096]; /* Plenty big enough */ @@ -530,8 +648,8 @@ * the header information first, as make-doc will append to the file by * special dispensation. */ -static void -do_init_mode (void) +void +do_init_mode() { int i; char ts[4096]; /* Plenty big enough */ diff -r 12e008d41344 -r 697ef44129c6 lib-src/etags.c --- a/lib-src/etags.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/etags.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ /* Tags file maker to go with GNU Emacs - Copyright (C) 1984, 87, 88, 89, 93, 94, 95, 98, 99 + Copyright (C) 1984, 87, 88, 89, 93, 94, 95, 98 Free Software Foundation, Inc. and Ken Arnold This file is not considered part of GNU Emacs. @@ -28,10 +28,10 @@ * Francesco Potorti` reorganised C and C++ based on work by Joe Wells. * Regexp tags by Tom Tromey. * - * Francesco Potorti` (pot@gnu.org) is the current maintainer. + * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer. */ -char pot_etags_version[] = "@(#) pot revision number is 13.44"; +char pot_etags_version[] = "@(#) pot revision number is 13.7"; #define TRUE 1 #define FALSE 0 @@ -40,11 +40,29 @@ # define DEBUG FALSE #endif -#if defined(__STDC__) && (__STDC__ || defined(__SUNPRO_C)) -# define P_(proto) proto -#else -# define P_(proto) () -#endif +#ifdef MSDOS +# include +# include +# include +# ifndef HAVE_CONFIG_H +# define DOS_NT +# include +# endif +#endif /* MSDOS */ + +#ifdef WINDOWSNT +# include +# include +# include +# include +# define MAXPATHLEN _MAX_PATH +# ifdef HAVE_CONFIG_H +# undef HAVE_NTGUI +# else +# define DOS_NT +# define HAVE_GETCWD +# endif /* not HAVE_CONFIG_H */ +#endif /* WINDOWSNT */ #ifdef HAVE_CONFIG_H # include @@ -55,34 +73,16 @@ # define LONG_OPTIONS /* accept long options */ #endif /* HAVE_CONFIG_H */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ +#if !defined (WINDOWSNT) && defined (STDC_HEADERS) +#include +#include #endif -#ifdef WIN32_NATIVE -# include -# include -# include -# include -# include -# define MAXPATHLEN _MAX_PATH -# ifndef HAVE_GETCWD -# define HAVE_GETCWD -# endif /* undef HAVE_GETCWD */ -#else /* !WIN32_NATIVE */ -# ifdef STDC_HEADERS -# include -# include -# else - extern char *getenv (); -# endif -#endif /* !WIN32_NATIVE */ - #ifdef HAVE_UNISTD_H # include #else -# if defined (HAVE_GETCWD) && !defined (WIN32_NATIVE) - extern char *getcwd (char *buf, size_t size); +# ifdef HAVE_GETCWD + extern char *getcwd (); # endif #endif /* HAVE_UNISTD_H */ @@ -171,11 +171,12 @@ typedef int bool; -typedef void Lang_function P_((FILE *)); +typedef void Lang_function (); typedef struct { char *suffix; + int sufflen; char *command; /* Takes one arg and decompresses to stdout */ } compressor; @@ -187,109 +188,67 @@ char **interpreters; } language; -typedef struct node_st -{ /* sorting structure */ - char *name; /* function or type name */ - char *file; /* file name */ - bool is_func; /* use pattern or line no */ - bool been_warned; /* set if noticed dup */ - int lno; /* line number tag is on */ - long cno; /* character number line starts on */ - char *pat; /* search pattern */ - struct node_st *left, *right; /* left and right sons */ -} node; - -/* - * A `linebuffer' is a structure which holds a line of text. - * `readline_internal' reads a line from a stream into a linebuffer - * and works regardless of the length of the line. - * SIZE is the size of BUFFER, LEN is the length of the string in - * BUFFER after readline reads it. - */ -typedef struct -{ - long size; - int len; - char *buffer; -} linebuffer; +extern char *getenv (); /* Many compilers barf on this: - Lang_function Ada_funcs; + Lang_function Asm_labels; so let's write it this way */ -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 *)); - +void Asm_labels (); +void C_entries (); +void default_C_entries (); +void plain_C_entries (); +void Cjava_entries (); +void Cobol_paragraphs (); +void Cplusplus_entries (); +void Cstar_entries (); +void Erlang_functions (); +void Fortran_functions (); +void Yacc_entries (); +void Lisp_functions (); +void Pascal_functions (); +void Perl_functions (); +void Postscript_functions (); +void Prolog_functions (); +void Python_functions (); +void Scheme_functions (); +void TeX_functions (); +void just_read_file (); + +compressor *get_compressor_from_suffix (); +language *get_language_from_name (); +language *get_language_from_interpreter (); +language *get_language_from_suffix (); +int total_size_of_entries (); +long readline (), readline_internal (); #ifdef ETAGS_REGEXPS -static void analyse_regex P_((char *, bool)); -static void add_regex P_((char *, bool, language *)); -static void free_patterns P_((void)); +void analyse_regex (); +void add_regex (); +void free_patterns (); #endif /* ETAGS_REGEXPS */ -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)); +void error (); +void suggest_asking_for_help (); +void fatal (), pfatal (); +void add_node (); + +void init (); +void initbuffer (); +void find_entries (); +void free_tree (); +void pfnote (), new_pfnote (); +void process_file (); +void put_entries (); +void takeprec (); + +char *concat (); +char *skip_spaces (), *skip_non_spaces (); +char *savenstr (), *savestr (); +char *etags_strchr (), *etags_strrchr (); +char *etags_getcwd (); +char *relative_filename (), *absolute_filename (), *absolute_dirname (); +bool filename_is_absolute (); +void canonicalize_filename (); +void grow_linebuffer (); +long *xmalloc (), *xrealloc (); char searchar = '/'; /* use /.../ searches */ @@ -308,8 +267,34 @@ long linecharno; /* charno of start of current line */ char *dbp; /* pointer to start of current tag */ +typedef struct node_st +{ /* sorting structure */ + char *name; /* function or type name */ + char *file; /* file name */ + bool is_func; /* use pattern or line no */ + bool been_warned; /* set if noticed dup */ + int lno; /* line number tag is on */ + long cno; /* character number line starts on */ + char *pat; /* search pattern */ + struct node_st *left, *right; /* left and right sons */ +} node; + node *head; /* the head of the binary tree of tags */ +/* + * A `linebuffer' is a structure which holds a line of text. + * `readline_internal' reads a line from a stream into a linebuffer + * and works regardless of the length of the line. + * SIZE is the size of BUFFER, LEN is the length of the string in + * BUFFER after readline reads it. + */ +typedef struct +{ + long size; + int len; + char *buffer; +} linebuffer; + linebuffer lb; /* the current line */ linebuffer token_name; /* used by C_entries as a temporary area */ struct @@ -322,7 +307,7 @@ bool _wht[CHARS], _nin[CHARS], _itk[CHARS], _btk[CHARS], _etk[CHARS]; char /* white chars */ - *white = " \f\t\n\r\v", + *white = " \f\t\n\r", /* not in a name */ *nonam = " \f\t\n\r(=,[;", /* token ending chars */ @@ -334,14 +319,13 @@ bool append_to_tagfile; /* -a: append to tags */ /* The following four default to TRUE for etags, but to FALSE for ctags. */ -bool typedefs; /* -t: create tags for C and Ada typedefs */ +bool typedefs; /* -t: create tags for C typedefs */ bool typedefs_and_cplusplus; /* -T: create tags for C typedefs, level */ /* 0 struct/enum/union decls, and C++ */ /* member functions. */ bool constantypedefs; /* -d: create tags for C #define, enum */ /* constants and variables. */ /* -D: opposite of -d. Default under ctags. */ -bool declarations; /* --declarations: tag them and extern in C&Co*/ bool globals; /* create tags for global variables */ bool members; /* create tags for C member variables */ bool update; /* -u: update tags */ @@ -350,41 +334,37 @@ bool cxref_style; /* -x: create cxref style output */ bool cplusplus; /* .[hc] means C++, not C */ bool noindentypedefs; /* -I: ignore indentation in C */ -bool packages_only; /* --packages-only: in Ada, only tag packages*/ #ifdef LONG_OPTIONS struct option longopts[] = { - { "packages-only", no_argument, &packages_only, TRUE }, - { "append", no_argument, NULL, 'a' }, - { "backward-search", no_argument, NULL, 'B' }, - { "c++", no_argument, NULL, 'C' }, - { "cxref", no_argument, NULL, 'x' }, - { "defines", no_argument, NULL, 'd' }, - { "declarations", no_argument, &declarations, TRUE }, - { "no-defines", no_argument, NULL, 'D' }, - { "globals", no_argument, &globals, TRUE }, - { "no-globals", no_argument, &globals, FALSE }, - { "help", no_argument, NULL, 'h' }, - { "help", no_argument, NULL, 'H' }, - { "ignore-indentation", no_argument, NULL, 'I' }, - { "include", required_argument, NULL, 'i' }, - { "language", required_argument, NULL, 'l' }, - { "members", no_argument, &members, TRUE }, - { "no-members", no_argument, &members, FALSE }, - { "no-warn", no_argument, NULL, 'w' }, - { "output", required_argument, NULL, 'o' }, -#ifdef ETAGS_REGEXPS - { "regex", required_argument, NULL, 'r' }, - { "no-regex", no_argument, NULL, 'R' }, - { "ignore-case-regex", required_argument, NULL, 'c' }, -#endif /* ETAGS_REGEXPS */ - { "typedefs", no_argument, NULL, 't' }, - { "typedefs-and-c++", no_argument, NULL, 'T' }, - { "update", no_argument, NULL, 'u' }, - { "version", no_argument, NULL, 'V' }, - { "vgrind", no_argument, NULL, 'v' }, - { NULL } + { "append", no_argument, NULL, 'a' }, + { "backward-search", no_argument, NULL, 'B' }, + { "c++", no_argument, NULL, 'C' }, + { "cxref", no_argument, NULL, 'x' }, + { "defines", no_argument, NULL, 'd' }, + { "no-defines", no_argument, NULL, 'D' }, + { "globals", no_argument, &globals, TRUE }, + { "no-globals", no_argument, &globals, FALSE }, + { "help", no_argument, NULL, 'h' }, + { "help", no_argument, NULL, 'H' }, + { "ignore-indentation", no_argument, NULL, 'I' }, + { "include", required_argument, NULL, 'i' }, + { "language", required_argument, NULL, 'l' }, + { "members", no_argument, &members, TRUE }, + { "no-members", no_argument, &members, FALSE }, + { "no-warn", no_argument, NULL, 'w' }, + { "output", required_argument, NULL, 'o' }, +#ifdef ETAGS_REGEXPS + { "regex", required_argument, NULL, 'r' }, + { "no-regex", no_argument, NULL, 'R' }, +#endif /* ETAGS_REGEXPS */ + { "typedefs", no_argument, NULL, 't' }, + { "typedefs-and-c++", no_argument, NULL, 'T' }, + { "update", no_argument, NULL, 'u' }, + { "version", no_argument, NULL, 'V' }, + { "vgrind", no_argument, NULL, 'v' }, + { 0 } }; #endif /* LONG_OPTIONS */ @@ -402,22 +382,17 @@ bool error_signaled; } pattern; -/* List of all regexps. */ +/* Array of all regexps. */ pattern *p_head = NULL; - -/* How many characters in the character set. (From regex.c.) */ -#define CHAR_SET_SIZE 256 -/* Translation table for case-insensitive matching. */ -char lc_trans[CHAR_SET_SIZE]; #endif /* ETAGS_REGEXPS */ compressor compressors[] = { - { "z", "gzip -d -c"}, - { "Z", "gzip -d -c"}, - { "gz", "gzip -d -c"}, - { "GZ", "gzip -d -c"}, - { "bz2", "bzip2 -d -c" }, + { "z", 1, "gzip -d -c"}, + { "Z", 1, "gzip -d -c"}, + { "gz", 2, "gzip -d -c"}, + { "GZ", 2, "gzip -d -c"}, + { "bz2", 3, "bzip2 -d -c" }, { NULL } }; @@ -428,10 +403,6 @@ /* Non-NULL if language fixed. */ language *forced_lang = NULL; -/* Ada code */ -char *Ada_suffixes [] = - { "ads", "adb", "ada", NULL }; - /* Assembly code */ char *Asm_suffixes [] = { "a", /* Unix assembler */ "asm", /* Microcontroller assembly */ @@ -488,7 +459,7 @@ NULL }; char *Postscript_suffixes [] = - { "ps", "psw", NULL }; /* .psw is for PSWrap */ + { "ps", NULL }; char *Prolog_suffixes [] = { "prolog", NULL }; @@ -515,7 +486,6 @@ language lang_names [] = { - { "ada", Ada_funcs, Ada_suffixes, NULL }, { "asm", Asm_labels, Asm_suffixes, NULL }, { "c", default_C_entries, default_C_suffixes, NULL }, { "c++", Cplusplus_entries, Cplusplus_suffixes, NULL }, @@ -539,7 +509,7 @@ { NULL, NULL } /* end of list */ }; -static void +void print_language_names () { language *lang; @@ -564,23 +534,20 @@ Compressed files are supported using gzip and bzip2."); } -#ifndef EMACS_NAME -# define EMACS_NAME "GNU Emacs" +#ifndef VERSION +# define VERSION "20" #endif -#ifndef VERSION -# define VERSION "21" -#endif -static void +void print_version () { - printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); - puts ("Copyright (C) 1999 Free Software Foundation, Inc. and Ken Arnold"); + printf ("%s (GNU Emacs %s)\n", (CTAGS) ? "ctags" : "etags", VERSION); + puts ("Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold"); puts ("This program is distributed under the same terms as Emacs"); exit (GOOD); } -static void +void print_help () { printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ @@ -601,9 +568,6 @@ puts ("-a, --append\n\ Append tag entries to existing tags file."); - puts ("--packages-only\n\ - For Ada files, only generate tags for packages ."); - if (CTAGS) puts ("-B, --backward-search\n\ Write the search commands for the tag entries using '?', the\n\ @@ -612,14 +576,6 @@ puts ("-C, --c++\n\ Treat files whose name suffix defaults to C language as C++ files."); - puts ("--declarations\n\ - In C and derived languages, create tags for function declarations,"); - if (CTAGS) - puts ("\tand create tags for extern variables if --globals is used."); - else - puts - ("\tand create tags for extern variables unless --no-globals is used."); - if (CTAGS) puts ("-d, --defines\n\ Create tag entries for C #define constants and enum constants, too."); @@ -651,15 +607,12 @@ #ifdef ETAGS_REGEXPS puts ("-r /REGEXP/, --regex=/REGEXP/ or --regex=@regexfile\n\ - Make a tag for each line matching pattern REGEXP in the following\n\ - files. {LANGUAGE}/REGEXP/ uses REGEXP for LANGUAGE files only.\n\ - regexfile is a file containing one REGEXP per line.\n\ - REGEXP is anchored (as if preceded by ^).\n\ - The form /REGEXP/NAME/ creates a named tag.\n\ - For example Tcl named tags can be created with:\n\ + Make a tag for each line matching pattern REGEXP in the\n\ + following files. regexfile is a file containing one REGEXP\n\ + per line. REGEXP is anchored (as if preceded by ^).\n\ + The form /REGEXP/NAME/ creates a named tag. For example Tcl\n\ + named tags can be created with:\n\ --regex=/proc[ \\t]+\\([^ \\t]+\\)/\\1/."); - puts ("-c /REGEXP/, --ignore-case-regex=/REGEXP/ or --ignore-case-regex=@regexfile\n\ - Like -r, --regex but ignore case when matching expressions."); puts ("-R, --no-regex\n\ Don't create tags from regexps for the following files."); #endif /* ETAGS_REGEXPS */ @@ -674,7 +627,7 @@ if (CTAGS) { puts ("-t, --typedefs\n\ - Generate tag entries for C and Ada typedefs."); + Generate tag entries for C typedefs."); puts ("-T, --typedefs-and-c++\n\ Generate tag entries for C typedefs, C struct/enum/union tags,\n\ and C++ member functions."); @@ -707,7 +660,7 @@ print_language_names (); puts (""); - puts ("Report bugs to bug-gnu-emacs@gnu.org"); + puts ("Report bugs to bug-gnu-emacs@prep.ai.mit.edu"); exit (GOOD); } @@ -717,8 +670,7 @@ { at_language, at_regexp, - at_filename, - at_icregexp + at_filename }; /* This structure helps us allow mixing of --lang and file names. */ @@ -761,7 +713,7 @@ #include #include #define OUTSIZE MAX_FILE_SPEC_LEN -static short +short fn_exp (out, in) vspec *out; char *in; @@ -806,7 +758,7 @@ v1.01 nmm 19-Aug-85 gfnames - return in successive calls the name of each file specified by the provided arg expanding wildcards. */ -static char * +char * gfnames (arg, p_error) char *arg; bool *p_error; @@ -870,9 +822,9 @@ bool got_err; #endif -#ifdef WIN32_NATIVE +#ifdef DOS_NT _fmode = O_BINARY; /* all of files are treated as binary files */ -#endif /* WIN32_NATIVE */ +#endif /* DOS_NT */ progname = argv[0]; nincluded_files = 0; @@ -887,15 +839,12 @@ #ifdef ETAGS_REGEXPS /* Set syntax for regular expression routines. */ re_set_syntax (RE_SYNTAX_EMACS | RE_INTERVALS); - /* Translation table for case-insensitive search. */ - for (i = 0; i < CHAR_SET_SIZE; i++) - lc_trans[i] = lowcase (i); #endif /* ETAGS_REGEXPS */ /* * If etags, always find typedefs and structure tags. Why not? * Also default is to find macro constants, enum constants and - * global variables. + * global variables. */ if (!CTAGS) { @@ -910,7 +859,7 @@ char *optstring; #ifdef ETAGS_REGEXPS - optstring = "-aCdDf:Il:o:r:c:RStTi:BuvxwVhH"; + optstring = "-aCdDf:Il:o:r:RStTi:BuvxwVhH"; #else optstring = "-aCdDf:Il:o:StTi:BuvxwVhH"; #endif /* ETAGS_REGEXPS */ @@ -947,7 +896,7 @@ case 'o': if (tagfile) { - error ("-o option may only be given once.", (char *)NULL); + error ("-%c option may only be given once.", opt); suggest_asking_for_help (); } tagfile = optarg; @@ -978,11 +927,6 @@ argbuffer[current_arg].what = NULL; ++current_arg; break; - case 'c': - argbuffer[current_arg].arg_type = at_icregexp; - argbuffer[current_arg].what = optarg; - ++current_arg; - break; #endif /* ETAGS_REGEXPS */ case 'V': print_version (); @@ -1025,7 +969,7 @@ if (nincluded_files == 0 && file_count == 0) { - error ("no input files specified.", (char *)NULL); + error ("no input files specified.", 0); suggest_asking_for_help (); } @@ -1056,12 +1000,12 @@ if (streq (tagfile, "-")) { tagf = stdout; -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* Switch redirected `stdout' to binary mode (setting `_fmode' doesn't take effect until after `stdout' is already open). */ if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); -#endif /* WIN32_NATIVE */ +#endif /* DOS_NT */ } else tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -1081,10 +1025,7 @@ break; #ifdef ETAGS_REGEXPS case at_regexp: - analyse_regex (argbuffer[i].what, FALSE); - break; - case at_icregexp: - analyse_regex (argbuffer[i].what, TRUE); + analyse_regex (argbuffer[i].what); break; #endif case at_filename: @@ -1176,42 +1117,23 @@ /* - * Return a compressor given the file name. If EXTPTR is non-zero, - * return a pointer into FILE where the compressor-specific - * extension begins. If no compressor is found, NULL is returned - * and EXTPTR is not significant. + * Return a compressor given the file name. * Idea by Vladimir Alexiev */ -static compressor * -get_compressor_from_suffix (file, extptr) +compressor * +get_compressor_from_suffix (file) char *file; - char **extptr; { compressor *compr; - char *slash, *suffix; - - /* This relies on FN to be after canonicalize_filename, - so we don't need to consider backslashes on WIN32_NATIVE. */ - slash = etags_strrchr (file, '/'); + char *suffix; + suffix = etags_strrchr (file, '.'); - if (suffix == NULL || suffix < slash) + if (suffix == NULL) return NULL; - if (extptr != NULL) - *extptr = suffix; 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. - */ - 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'); + for (compr = compressors; compr->suffix != NULL; compr++) + if (streq (compr->suffix, suffix)) + return compr; return NULL; } @@ -1220,7 +1142,7 @@ /* * Return a language given the name. */ -static language * +language * get_language_from_name (name) char *name; { @@ -1243,7 +1165,7 @@ /* * Return a language given the interpreter name. */ -static language * +language * get_language_from_interpreter (interpreter) char *interpreter; { @@ -1266,7 +1188,7 @@ /* * Return a language given the file name. */ -static language * +language * get_language_from_suffix (file) char *file; { @@ -1290,7 +1212,7 @@ /* * This routine is called on each file argument. */ -static void +void process_file (file) char *file; { @@ -1298,8 +1220,7 @@ FILE *inf; compressor *compr; char *compressed_name, *uncompressed_name; - char *ext, *real_name; - + char *real_name; canonicalize_filename (file); if (streq (file, tagfile) && !streq (tagfile, "-")) @@ -1307,7 +1228,7 @@ error ("skipping inclusion of %s in self.", file); return; } - if ((compr = get_compressor_from_suffix (file, &ext)) == NULL) + if ((compr = get_compressor_from_suffix (file)) == NULL) { compressed_name = NULL; real_name = uncompressed_name = savestr (file); @@ -1315,29 +1236,8 @@ else { real_name = compressed_name = savestr (file); - uncompressed_name = savenstr (file, ext - file); + uncompressed_name = savenstr (file, strlen(file) - compr->sufflen - 1); } - - /* If the canonicalised uncompressed name has already be dealt with, - skip it silently, else add it to the list. */ - { - typedef struct processed_file - { - char *filename; - struct processed_file *next; - } processed_file; - static processed_file *pf_head = NULL; - register processed_file *fnp; - - for (fnp = pf_head; fnp != NULL; fnp = fnp->next) - if (streq (uncompressed_name, fnp->filename)) - goto exit; - fnp = pf_head; - pf_head = xnew (1, struct processed_file); - pf_head->filename = savestr (uncompressed_name); - pf_head->next = fnp; - } - if (stat (real_name, &stat_buf) != 0) { /* Reset real_name and try with a different name. */ @@ -1353,11 +1253,7 @@ { compressed_name = concat (file, ".", compr->suffix); if (stat (compressed_name, &stat_buf) != 0) - { - /* XEmacs: delete MSDOS code */ - free (compressed_name); - compressed_name = NULL; - } + free (compressed_name); else { real_name = compressed_name; @@ -1383,7 +1279,7 @@ inf = popen (cmd, "r"); free (cmd); } - else + else inf = fopen (real_name, "r"); if (inf == NULL) { @@ -1434,7 +1330,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. */ -static void +void init () { register char *sp; @@ -1444,12 +1340,13 @@ iswhite(i) = notinname(i) = begtoken(i) = intoken(i) = endtoken(i) = FALSE; for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE; for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE; + for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE; + for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE; + for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE; + iswhite('\0') = iswhite('\n'); notinname('\0') = notinname('\n'); - 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; endtoken('\0') = endtoken('\n'); } @@ -1459,7 +1356,7 @@ */ node *last_node = NULL; -static void +void find_entries (file, inf) char *file; FILE *inf; @@ -1546,7 +1443,7 @@ } /* Record a tag. */ -static void +void pfnote (name, is_func, linestart, linelen, lno, cno) char *name; /* tag name, or NULL if unnamed */ bool is_func; /* tag is a function */ @@ -1616,7 +1513,7 @@ * `nonam'. */ #define traditional_tag_style TRUE -static void +void new_pfnote (name, namelen, is_func, linestart, linelen, lno, cno) char *name; /* tag name, or NULL if unnamed */ int namelen; /* tag length */ @@ -1646,7 +1543,7 @@ named = FALSE; /* use unnamed tag */ } } - + if (named) name = savenstr (name, namelen); else @@ -1658,7 +1555,7 @@ * free_tree () * recurse on left children, iterate on right children. */ -static void +void free_tree (np) register node *np; { @@ -1683,7 +1580,7 @@ * add_node is the only function allowed to add nodes, so it can * maintain state. */ -static void +void add_node (np, cur_node_p) node *np, **cur_node_p; { @@ -1741,7 +1638,7 @@ } } -static void +void put_entries (np) register node *np; { @@ -1808,7 +1705,7 @@ } /* Length of a number's decimal representation. */ -static int +int number_len (num) long num; { @@ -1825,7 +1722,7 @@ * is irrelevant with the new tags.el, but is still supplied for * backward compatibility. */ -static int +int total_size_of_entries (np) register node *np; { @@ -1860,23 +1757,14 @@ st_C_ignore, st_C_javastruct, st_C_operator, - st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef, st_C_typespec + st_C_struct, 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 %[ struct C_stab_entry { char *name; int c_ext; enum sym_type type; } %% -if, 0, st_C_ignore -for, 0, st_C_ignore -while, 0, st_C_ignore -switch, 0, st_C_ignore -return, 0, st_C_ignore @interface, 0, st_C_objprot @protocol, 0, st_C_objprot @implementation,0, st_C_objimpl @@ -1892,7 +1780,6 @@ domain, C_STAR, st_C_struct union, 0, st_C_struct struct, 0, st_C_struct -extern, 0, st_C_extern enum, 0, st_C_enum typedef, 0, st_C_typedef define, 0, st_C_define @@ -1908,6 +1795,7 @@ unsigned, 0, st_C_typespec auto, 0, st_C_typespec void, 0, st_C_typespec +extern, 0, st_C_typespec static, 0, st_C_typespec const, 0, st_C_typespec volatile, 0, st_C_typespec @@ -1926,152 +1814,113 @@ %] and replace lines between %< and %> with its output. */ /*%<*/ -/* C code produced by gperf version 2.7.1 (19981006 egcs) */ +/* C code produced by gperf version 2.5 (GNU C++ version) */ /* Command-line: gperf -c -k 1,3 -o -p -r -t */ struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; -#define TOTAL_KEYWORDS 46 -#define MIN_WORD_LENGTH 2 +#define TOTAL_KEYWORDS 41 +#define MIN_WORD_LENGTH 3 #define MAX_WORD_LENGTH 15 -#define MIN_HASH_VALUE 13 -#define MAX_HASH_VALUE 123 -/* maximum key range = 111, duplicates = 0 */ - -#ifdef __GNUC__ -__inline -#endif +#define MIN_HASH_VALUE 20 +#define MAX_HASH_VALUE 136 +/* maximum key range = 117, duplicates = 0 */ + static unsigned int hash (str, len) - register const char *str; - register unsigned int len; + register char *str; + register int unsigned len; { static unsigned char asso_values[] = { - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 3, 124, 124, 124, 43, 6, - 11, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 11, 124, 124, 58, 7, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 57, 7, 42, - 4, 14, 52, 0, 124, 53, 124, 124, 29, 11, - 6, 35, 32, 124, 29, 34, 59, 58, 51, 24, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124 + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 58, 137, 137, 137, 38, 37, + 45, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 62, 137, 137, 14, 16, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 26, 16, 51, + 18, 61, 5, 19, 137, 23, 137, 137, 32, 63, + 54, 10, 26, 137, 24, 42, 30, 18, 46, 137, + 137, 137, 137, 137, 137, 137, 137, 137, }; - register int hval = len; - - switch (hval) - { - default: - case 3: - hval += asso_values[(unsigned char)str[2]]; - case 2: - case 1: - hval += asso_values[(unsigned char)str[0]]; - break; - } - return hval; + return len + asso_values[str[2]] + asso_values[str[0]]; } -#ifdef __GNUC__ -__inline -#endif -static struct C_stab_entry * +struct C_stab_entry * in_word_set (str, len) - register const char *str; + register char *str; register unsigned int len; { static struct C_stab_entry wordlist[] = { - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, - {"@end", 0, st_C_objend}, - {""}, {""}, {""}, {""}, - {"ENTRY", 0, st_C_gnumacro}, - {"@interface", 0, st_C_objprot}, - {""}, - {"domain", C_STAR, st_C_struct}, - {""}, - {"PSEUDO", 0, st_C_gnumacro}, - {""}, {""}, - {"namespace", C_PLPL, st_C_struct}, - {""}, {""}, - {"@implementation",0, st_C_objimpl}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {"long", 0, st_C_typespec}, - {"signed", 0, st_C_typespec}, - {"@protocol", 0, st_C_objprot}, - {""}, {""}, {""}, {""}, - {"bool", C_PLPL, st_C_typespec}, - {""}, {""}, {""}, {""}, {""}, {""}, - {"const", 0, st_C_typespec}, - {"explicit", C_PLPL, st_C_typespec}, - {"if", 0, st_C_ignore}, - {""}, - {"operator", C_PLPL, st_C_operator}, - {""}, - {"DEFUN", 0, st_C_gnumacro}, - {""}, {""}, - {"define", 0, st_C_define}, - {""}, {""}, {""}, {""}, {""}, - {"double", 0, st_C_typespec}, - {"struct", 0, st_C_struct}, - {""}, {""}, {""}, {""}, - {"short", 0, st_C_typespec}, - {""}, - {"enum", 0, st_C_enum}, - {"mutable", C_PLPL, st_C_typespec}, - {""}, - {"extern", 0, st_C_extern}, - {"extends", C_JAVA, st_C_javastruct}, - {"package", C_JAVA, st_C_ignore}, - {"while", 0, st_C_ignore}, - {""}, - {"for", 0, st_C_ignore}, - {""}, {""}, {""}, - {"volatile", 0, st_C_typespec}, - {""}, {""}, - {"import", C_JAVA, st_C_ignore}, - {"float", 0, st_C_typespec}, - {"switch", 0, st_C_ignore}, - {"return", 0, st_C_ignore}, - {"implements", C_JAVA, st_C_javastruct}, - {""}, - {"static", 0, st_C_typespec}, - {"typedef", 0, st_C_typedef}, - {"typename", C_PLPL, st_C_typespec}, - {"unsigned", 0, st_C_typespec}, - {""}, {""}, - {"char", 0, st_C_typespec}, - {"class", C_PLPL, st_C_struct}, - {""}, {""}, {""}, - {"void", 0, st_C_typespec}, - {""}, {""}, - {"friend", C_PLPL, st_C_ignore}, - {""}, {""}, {""}, - {"int", 0, st_C_typespec}, - {"union", 0, st_C_struct}, - {""}, {""}, {""}, - {"auto", 0, st_C_typespec}, - {"interface", C_JAVA, st_C_struct}, - {""}, - {"SYSCALL", 0, st_C_gnumacro} + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"",}, {"",}, + {"float", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"define", 0, st_C_define}, + {"bool", C_PLPL, st_C_typespec}, + {"",}, {"",}, {"",}, + {"friend", C_PLPL, st_C_ignore}, + {"SYSCALL", 0, st_C_gnumacro}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"double", 0, st_C_typespec}, + {"",}, {"",}, {"",}, + {"union", 0, st_C_struct}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"import", C_JAVA, st_C_ignore}, + {"int", 0, st_C_typespec}, + {"short", 0, st_C_typespec}, + {"ENTRY", 0, st_C_gnumacro}, + {"implements", C_JAVA, st_C_javastruct}, + {"auto", 0, st_C_typespec}, + {"",}, + {"interface", C_JAVA, st_C_struct}, + {"typedef", 0, st_C_typedef}, + {"typename", C_PLPL, st_C_typespec}, + {"",}, {"",}, + {"signed", 0, st_C_typespec}, + {"unsigned", 0, st_C_typespec}, + {"",}, {"",}, {"",}, + {"struct", 0, st_C_struct}, + {"void", 0, st_C_typespec}, + {"static", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, + {"operator", C_PLPL, st_C_operator}, + {"",}, + {"char", 0, st_C_typespec}, + {"class", C_PLPL, st_C_struct}, + {"enum", 0, st_C_enum}, + {"package", C_JAVA, st_C_ignore}, + {"",}, + {"volatile", 0, st_C_typespec}, + {"domain", C_STAR, st_C_struct}, + {"DEFUN", 0, st_C_gnumacro}, + {"",}, + {"long", 0, st_C_typespec}, + {"@protocol", 0, st_C_objprot}, + {"",}, {"",}, {"",}, + {"explicit", C_PLPL, st_C_typespec}, + {"",}, + {"extern", 0, st_C_typespec}, + {"extends", C_JAVA, st_C_javastruct}, + {"",}, + {"mutable", C_PLPL, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, + {"PSEUDO", 0, st_C_gnumacro}, + {"",}, {"",}, {"",}, {"",}, + {"const", 0, st_C_typespec}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"@end", 0, st_C_objend}, + {"",}, {"",}, {"",}, {"",}, {"",}, + {"@interface", 0, st_C_objprot}, + {"",}, {"",}, {"",}, + {"namespace", C_PLPL, st_C_struct}, + {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, + {"@implementation", 0, st_C_objimpl}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) @@ -2080,9 +1929,9 @@ if (key <= MAX_HASH_VALUE && key >= 0) { - register const char *s = wordlist[key].name; - - if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) + register char *s = wordlist[key].name; + + if (*s == *str && !strncmp (str + 1, s + 1, len - 1)) return &wordlist[key]; } } @@ -2090,7 +1939,7 @@ } /*%>*/ -static enum sym_type +enum sym_type C_symtype (str, len, c_ext) char *str; int len; @@ -2119,7 +1968,6 @@ vignore /* var-like: ignore until ';' */ } fvdef; -bool fvextern; /* func or var: extern keyword seen; */ /* * typedefs are recognized using a simple finite automaton. @@ -2128,8 +1976,7 @@ enum { tnone, /* nothing seen */ - tkeyseen, /* typedef keyword seen */ - ttypeseen, /* defined type seen */ + ttypedseen, /* typedef keyword seen */ tinbody, /* inside typedef body */ tend, /* just before typedef tag */ tignore /* junk after typedef tag */ @@ -2228,9 +2075,6 @@ */ 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 @@ -2249,11 +2093,11 @@ * next_token_is_func IN OUT */ -static bool +bool consider_token (str, len, c, c_ext, cblev, parlev, is_func_or_var) register char *str; /* IN: token pointer */ register int len; /* IN: token length */ - register int c; /* IN: first char after the token */ + register char 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 */ @@ -2305,20 +2149,20 @@ if (toktype == st_C_typedef) { if (typedefs) - typdef = tkeyseen; - fvextern = FALSE; + typdef = ttypedseen; fvdef = fvnone; return FALSE; } break; - case tkeyseen: + case ttypedseen: switch (toktype) { case st_none: case st_C_typespec: + typdef = tend; + break; case st_C_struct: case st_C_enum: - typdef = ttypeseen; break; } /* Do not return here, so the structdef stuff has a chance. */ @@ -2352,7 +2196,7 @@ return FALSE; case st_C_struct: case st_C_enum: - if (typdef == tkeyseen + if (typdef == ttypedseen || (typedefs_and_cplusplus && cblev == 0 && structdef == snone)) { structdef = skeyseen; @@ -2373,14 +2217,16 @@ return TRUE; } + /* Avoid entering fvdef stuff if typdef is going on. */ if (typdef != tnone) - definedef = dnone; + { + definedef = dnone; + return FALSE; + } /* Detect GNU macros. - Writers of emacs code are recommended to put the - first two args of a DEFUN on the same line. - + DEFUN note for writers of emacs C code: The DEFUN macro, used in emacs C source code, has a first arg that is a string (the lisp function name), and a second arg that is a C function name. Since etags skips strings, the second arg @@ -2390,7 +2236,8 @@ removing the initial 'F' character and substituting '-' for '_'. Anyway, this assumes that the conventions of naming lisp functions will never change. Currently, this method is not - implemented. */ + implemented, so writers of emacs code are recommended to put the + first two args of a DEFUN on the same line. */ if (definedef == dnone && toktype == st_C_gnumacro) { next_token_is_func = TRUE; @@ -2479,15 +2326,11 @@ /* A function, variable or enum constant? */ switch (toktype) { - case st_C_extern: - fvextern = TRUE; - /* FALLTHRU */ case st_C_typespec: - if (fvdef != finlist && fvdef != fignore && fvdef != vignore) - fvdef = fvnone; /* should be useless */ + if (fvdef != finlist && fvdef != fignore && fvdef != vignore) + fvdef = fvnone; /* should be useless */ return FALSE; case st_C_ignore: - fvextern = FALSE; fvdef = vignore; return FALSE; case st_C_operator: @@ -2495,12 +2338,6 @@ *is_func_or_var = TRUE; return TRUE; case st_none: - if ((c_ext & C_PLPL) && strneq (str+len-10, "::operator", 10)) - { - fvdef = foperator; - *is_func_or_var = TRUE; - return TRUE; - } if (constantypedefs && structdef == sinbody && structtype == st_C_enum) return TRUE; if (fvdef == fvnone) @@ -2509,7 +2346,6 @@ *is_func_or_var = TRUE; return TRUE; } - break; } return FALSE; @@ -2519,7 +2355,7 @@ * C_entries () * This routine finds functions, variables, typedefs, * #define's, enum constants and struct/union/enum definitions in - * C syntax and adds them to the list. + * #C syntax and adds them to the list. */ #define current_lb_is_new (newndx == curndx) #define switch_line_buffers() (curndx = 1 - curndx) @@ -2554,7 +2390,7 @@ } while (0) -static void +void make_C_tag (isfun) bool isfun; { @@ -2583,7 +2419,7 @@ } -static void +void C_entries (c_ext, inf) int c_ext; /* extension of C */ FILE *inf; /* input file */ @@ -2598,7 +2434,7 @@ int cblev; /* current curly brace level */ int parlev; /* current parenthesis level */ bool incomm, inquote, inchar, quotednl, midtoken; - bool purec, cplpl, cjava; + bool cplpl, cjava; token savetok; /* token saved during preprocessor handling */ @@ -2609,14 +2445,13 @@ lp = curlb.buffer; *lp = 0; - fvdef = fvnone; fvextern = FALSE; typdef = tnone; - structdef = snone; definedef = dnone; objdef = onone; + fvdef = fvnone; typdef = tnone; structdef = snone; + definedef = dnone; objdef = onone; next_token_is_func = yacc_rules = FALSE; midtoken = inquote = inchar = incomm = quotednl = FALSE; tok.valid = savetok.valid = FALSE; cblev = 0; parlev = 0; - purec = !(c_ext & ~YACC); /* no extensions (apart from possibly yacc) */ cplpl = (c_ext & C_PLPL) == C_PLPL; cjava = (c_ext & C_JAVA) == C_JAVA; if (cjava) @@ -2695,18 +2530,12 @@ case '"': inquote = TRUE; if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) - { - fvextern = FALSE; - fvdef = fvnone; - } + fvdef = fvnone; continue; case '\'': inchar = TRUE; if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) - { - fvextern = FALSE; - fvdef = fvnone; - } + fvdef = fvnone; continue; case '/': if (*lp == '*') @@ -2727,7 +2556,7 @@ { /* entering or exiting rules section in yacc file */ lp++; - definedef = dnone; fvdef = fvnone; fvextern = FALSE; + definedef = dnone; fvdef = fvnone; typdef = tnone; structdef = snone; next_token_is_func = FALSE; midtoken = inquote = inchar = incomm = quotednl = FALSE; @@ -2769,7 +2598,7 @@ if ((definedef != dnone || (cblev == 0 && structdef != scolonseen) || (cblev == 1 && cplpl && structdef == sinbody) - || (structdef == sinbody && purec)) + || (structdef == sinbody && structtype == st_C_enum)) && typdef != tignore && definedef != dignorerest && fvdef != finlist) @@ -2778,46 +2607,42 @@ { if (endtoken (c)) { - bool funorvar = FALSE; - - if (c == ':' && cplpl && *lp == ':' && begtoken (lp[1])) + if (c == ':' && cplpl && *lp == ':' && begtoken(*(lp + 1))) { /* * This handles :: in the middle, but not at the - * beginning of an identifier. Also, space-separated - * :: is not recognised. + * beginning of an identifier. */ lp += 2; - toklen += 2; - c = lp[-1]; - goto intok; + toklen += 3; } else { + bool funorvar = FALSE; + if (yacc_rules || consider_token (newlb.buffer + tokoff, toklen, c, c_ext, cblev, parlev, &funorvar)) { - if (fvdef == foperator) - { - char *oldlp = lp; - lp = skip_spaces (lp-1); - if (*lp != '\0') - lp += 1; - while (*lp != '\0' - && !iswhite (*lp) && *lp != '(') - lp += 1; - c = *lp++; - toklen += lp - oldlp; - } tok.named = FALSE; - if (!purec - && funorvar + if (structdef == sinbody && definedef == dnone - && structdef == sinbody) + && funorvar) /* function or var defined in C++ class body */ { - int len = strlen (structtag) + qlen + toklen; + int len; + if (fvdef == foperator) + { + char *oldlp = lp; + lp = skip_spaces (lp-1); + while (*lp != '\0' + && !isspace (*lp) && *lp != '(') + lp += 1; + c = *lp++; + toklen += lp - oldlp; + } + + len = strlen (structtag) + qlen + toklen; grow_linebuffer (&token_name, len + 1); strcpy (token_name.buffer, structtag); strcat (token_name.buffer, qualifier); @@ -2852,15 +2677,11 @@ newlb.buffer + tokoff, toklen); token_name.buffer[toklen] = '\0'; token_name.len = toklen; - /* Name macros and members. */ + /* Name macros. */ tok.named = (structdef == stagseen - || typdef == ttypeseen || typdef == tend || (funorvar - && definedef == dignorerest) - || (funorvar - && definedef == dnone - && structdef == sinbody)); + && definedef == dignorerest)); } tok.lineno = lineno; tok.linelen = tokoff + toklen + 1; @@ -2885,7 +2706,6 @@ } } /* if (endtoken (c)) */ else if (intoken (c)) - intok: { toklen++; continue; @@ -2961,7 +2781,6 @@ } break; case fstartlist: - fvextern = FALSE; fvdef = fvnone; break; } @@ -2983,19 +2802,10 @@ case fignore: break; case fvnameseen: - if ((members && cblev == 1) - || (globals && cblev == 0 && (!fvextern || declarations))) + if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ - fvextern = FALSE; - fvdef = fvnone; - tok.valid = FALSE; - break; - case flistseen: - if (declarations && (cblev == 0 || cblev == 1)) - make_C_tag (TRUE); /* a function declaration */ /* FALLTHRU */ default: - fvextern = FALSE; fvdef = fvnone; /* The following instruction invalidates the token. Probably the token should be invalidated in all @@ -3024,8 +2834,7 @@ case vignore: break; case fvnameseen: - if ((members && cblev == 1) - || (globals && cblev == 0 && (!fvextern || declarations))) + if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ break; default: @@ -3051,8 +2860,7 @@ case vignore: break; case fvnameseen: - if ((members && cblev == 1) - || (globals && cblev == 0 && (!fvextern || declarations))) + if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ /* FALLTHRU */ default: @@ -3068,19 +2876,23 @@ objdef = oparenseen; switch (fvdef) { - case fvnameseen: - if (typdef == ttypeseen - && tok.valid - && *lp != '*' - && structdef != sinbody) + case fvnone: + switch (typdef) { - /* This handles constructs like: - typedef void OperatorFun (int fun); */ - make_C_tag (FALSE); - typdef = tignore; - } - /* FALLTHRU */ - case foperator: + case ttypedseen: + case tend: + if (tok.valid && *lp != '*') + { + /* This handles constructs like: + typedef void OperatorFun (int fun); */ + make_C_tag (FALSE); + typdef = tignore; + } + break; + } /* switch (typdef) */ + break; + case foperator: /* operator() is not handled */ + case fvnameseen: fvdef = fstartlist; break; case flistseen: @@ -3106,7 +2918,7 @@ fvdef = flistseen; break; } - if (cblev == 0 && (typdef == tend)) + if (cblev == 0 && typdef == tend) { typdef = tignore; make_C_tag (FALSE); /* a typedef */ @@ -3118,7 +2930,7 @@ case '{': if (definedef != dnone) break; - if (typdef == ttypeseen) + if (typdef == ttypedseen) typdef = tinbody; switch (structdef) { @@ -3203,8 +3015,7 @@ case vignore: break; case fvnameseen: - if ((members && cblev == 1) - || (globals && cblev == 0 && (!fvextern || declarations))) + if ((globals && cblev == 0) || (members && cblev == 1)) make_C_tag (FALSE); /* a variable */ /* FALLTHRU */ default: @@ -3256,7 +3067,7 @@ * Process either a C++ file or a C file depending on the setting * of a global flag. */ -static void +void default_C_entries (inf) FILE *inf; { @@ -3264,7 +3075,7 @@ } /* Always do plain ANSI C. */ -static void +void plain_C_entries (inf) FILE *inf; { @@ -3272,7 +3083,7 @@ } /* Always do C++. */ -static void +void Cplusplus_entries (inf) FILE *inf; { @@ -3280,7 +3091,7 @@ } /* Always do Java. */ -static void +void Cjava_entries (inf) FILE *inf; { @@ -3288,7 +3099,7 @@ } /* Always do C*. */ -static void +void Cstar_entries (inf) FILE *inf; { @@ -3296,14 +3107,14 @@ } /* Always do Yacc. */ -static void +void Yacc_entries (inf) FILE *inf; { C_entries (YACC, inf); } -/* A useful macro. */ +/* A useful macro. */ #define LOOP_ON_INPUT_LINES(file_pointer, line_buffer, char_pointer) \ for (lineno = charno = 0; /* loop initialization */ \ !feof (file_pointer) /* loop test */ \ @@ -3319,7 +3130,7 @@ * Read a file, but do no processing. This is used to do regexp * matching on files that have no language defined. */ -static void +void just_read_file (inf) FILE *inf; { @@ -3331,19 +3142,15 @@ /* Fortran parsing */ -static bool tail P_((char *)); -static void takeprec P_((void)); -static void getit P_((FILE *)); - -static bool +bool tail (cp) char *cp; { register int len = 0; - while (*cp != '\0' && lowcase (*cp) == lowcase (dbp[len])) + while (*cp && lowcase(*cp) == lowcase(dbp[len])) cp++, len++; - if (*cp == '\0' && !intoken (dbp[len])) + if (*cp == '\0' && !intoken(dbp[len])) { dbp += len; return TRUE; @@ -3351,7 +3158,7 @@ return FALSE; } -static void +void takeprec () { dbp = skip_spaces (dbp); @@ -3364,17 +3171,17 @@ dbp += 3; return; } - if (!isdigit ((unsigned char) *dbp)) + if (!isdigit (*dbp)) { --dbp; /* force failure */ return; } do dbp++; - while (isdigit ((unsigned char) *dbp)); + while (isdigit (*dbp)); } -static void +void getit (inf) FILE *inf; { @@ -3392,16 +3199,18 @@ dbp += 6; dbp = skip_spaces (dbp); } - if (!isalpha ((unsigned char) *dbp) && *dbp != '_' && *dbp != '$') + if (!isalpha (*dbp) + && *dbp != '_' + && *dbp != '$') return; - for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++) + for (cp = dbp + 1; *cp && intoken (*cp); cp++) continue; pfnote (savenstr (dbp, cp-dbp), TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } -static void +void Fortran_functions (inf) FILE *inf; { @@ -3459,6 +3268,10 @@ if (tail ("entry")) getit (inf); continue; + case 'p': + if (tail ("program") || tail ("procedure")) + getit (inf); + continue; case 'b': if (tail ("blockdata") || tail ("block data")) { @@ -3475,179 +3288,11 @@ } /* - * 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 -adagetit (inf, name_qualifier) - FILE *inf; - char *name_qualifier; -{ - register char *cp; - char *name; - char c; - - while (!feof (inf)) - { - dbp = skip_spaces (dbp); - if (*dbp == '\0' - || (dbp[0] == '-' && dbp[1] == '-')) - { - lineno++; - linecharno = charno; - charno += readline (&lb, inf); - dbp = lb.buffer; - } - switch (*dbp) - { - case 'b': - case 'B': - if (tail ("body")) - { - /* Skipping body of procedure body or package body or .... - resetting qualifier to body instead of spec. */ - name_qualifier = "/b"; - continue; - } - break; - case 't': - case 'T': - /* Skipping type of task type or protected type ... */ - if (tail ("type")) - continue; - break; - } - if (*dbp == '"') - { - dbp += 1; - for (cp = dbp; *cp != '\0' && *cp != '"'; cp++) - continue; - } - else - { - dbp = skip_spaces (dbp); - for (cp = dbp; - (*cp != '\0' - && (isalpha ((unsigned char) *cp) || isdigit ((unsigned char) *cp) || *cp == '_' || *cp == '.')); - cp++) - continue; - if (cp == dbp) - return; - } - c = *cp; - *cp = '\0'; - name = concat (dbp, name_qualifier, ""); - *cp = c; - pfnote (name, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - if (c == '"') - dbp = cp + 1; - return; - } -} - -static void -Ada_funcs (inf) - FILE *inf; -{ - bool inquote = FALSE; - - LOOP_ON_INPUT_LINES (inf, lb, dbp) - { - while (*dbp != '\0') - { - /* Skip a string i.e. "abcd". */ - if (inquote || (*dbp == '"')) - { - dbp = etags_strchr ((inquote) ? dbp : dbp+1, '"'); - if (dbp != NULL) - { - inquote = FALSE; - dbp += 1; - continue; /* advance char */ - } - else - { - inquote = TRUE; - break; /* advance line */ - } - } - - /* Skip comments. */ - if (dbp[0] == '-' && dbp[1] == '-') - break; /* advance line */ - - /* Skip character enclosed in single quote i.e. 'a' - and skip single quote starting an attribute i.e. 'Image. */ - if (*dbp == '\'') - { - dbp++ ; - if (*dbp != '\0') - dbp++; - continue; - } - - /* Search for beginning of a token. */ - if (!begtoken (*dbp)) - { - dbp++; - continue; /* advance char */ - } - - /* We are at the beginning of a token. */ - switch (*dbp) - { - case 'f': - case 'F': - if (!packages_only && tail ("function")) - adagetit (inf, "/f"); - else - break; /* from switch */ - continue; /* advance char */ - case 'p': - case 'P': - if (!packages_only && tail ("procedure")) - adagetit (inf, "/p"); - else if (tail ("package")) - adagetit (inf, "/s"); - else if (tail ("protected")) /* protected type */ - adagetit (inf, "/t"); - else - break; /* from switch */ - continue; /* advance char */ - case 't': - case 'T': - if (!packages_only && tail ("task")) - adagetit (inf, "/k"); - else if (typedefs && !packages_only && tail ("type")) - { - adagetit (inf, "/t"); - while (*dbp != '\0') - dbp += 1; - } - else - break; /* from switch */ - continue; /* advance char */ - } - - /* Look for the end of the token. */ - while (!endtoken (*dbp)) - dbp++; - - } /* advance char */ - } /* advance line */ -} - -/* * Bob Weiner, Motorola Inc., 4/3/94 * Unix and microcontroller assembly tag handling * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' */ -static void +void Asm_labels (inf) FILE *inf; { @@ -3657,16 +3302,16 @@ { /* If first char is alphabetic or one of [_.$], test for colon following identifier. */ - if (isalpha ((unsigned char) *cp) || *cp == '_' || *cp == '.' || *cp == '$') + if (isalpha (*cp) || *cp == '_' || *cp == '.' || *cp == '$') { /* Read past label. */ cp++; - while (isalnum ((unsigned char) *cp) || *cp == '_' || *cp == '.' || *cp == '$') + while (isalnum (*cp) || *cp == '_' || *cp == '.' || *cp == '$') cp++; - if (*cp == ':' || iswhite (*cp)) + if (*cp == ':' || isspace (*cp)) { /* Found end of label, so copy it and add it to the table. */ - pfnote (savenstr(lb.buffer, cp-lb.buffer), TRUE, + pfnote ((CTAGS) ? savenstr(lb.buffer, cp-lb.buffer) : NULL, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } @@ -3679,7 +3324,7 @@ * Perl sub names: look for /^sub[ \t\n]+[^ \t\n{]+/ * Perl variable names: /^(my|local).../ */ -static void +void Perl_functions (inf) FILE *inf; { @@ -3689,18 +3334,18 @@ { if (*cp++ == 's' && *cp++ == 'u' - && *cp++ == 'b' && iswhite (*cp++)) + && *cp++ == 'b' && isspace (*cp++)) { cp = skip_spaces (cp); if (*cp != '\0') { char *sp = cp; while (*cp != '\0' - && !iswhite (*cp) && *cp != '{' && *cp != '(') + && !isspace (*cp) && *cp != '{' && *cp != '(') cp++; pfnote (savenstr (sp, cp-sp), TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - } + } } else if (globals /* only if tagging global vars is enabled */ && ((cp = lb.buffer, @@ -3712,7 +3357,7 @@ && *cp++ == 'c' && *cp++ == 'a' && *cp++ == 'l')) - && (*cp == '(' || iswhite (*cp))) + && (*cp == '(' || isspace (*cp))) { /* After "my" or "local", but before any following paren or space. */ char *varname = NULL; @@ -3721,7 +3366,7 @@ if (*cp == '$' || *cp == '@' || *cp == '%') { char* varstart = ++cp; - while (isalnum ((unsigned char) *cp) || *cp == '_') + while (isalnum (*cp) || *cp == '_') cp++; varname = savenstr (varstart, cp-varstart); } @@ -3732,7 +3377,7 @@ while (*cp != '\0' && *cp != ';' && *cp != '=' && *cp != ')') cp++; } - + /* Perhaps I should back cp up one character, so the TAGS table doesn't mention (and so depend upon) the following char. */ pfnote ((CTAGS) ? savenstr (lb.buffer, cp-lb.buffer) : varname, @@ -3745,7 +3390,7 @@ * Python support by Eric S. Raymond * Look for /^def[ \t\n]+[^ \t\n(:]+/ or /^class[ \t\n]+[^ \t\n(:]+/ */ -static void +void Python_functions (inf) FILE *inf; { @@ -3755,10 +3400,10 @@ { if (*cp++ == 'd' && *cp++ == 'e' - && *cp++ == 'f' && iswhite (*cp++)) + && *cp++ == 'f' && isspace (*cp++)) { cp = skip_spaces (cp); - while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':') + while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') cp++; pfnote (NULL, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); @@ -3769,10 +3414,10 @@ && *cp++ == 'l' && *cp++ == 'a' && *cp++ == 's' - && *cp++ == 's' && iswhite (*cp++)) + && *cp++ == 's' && isspace (*cp++)) { cp = skip_spaces (cp); - while (*cp != '\0' && !iswhite (*cp) && *cp != '(' && *cp != ':') + while (*cp != '\0' && !isspace (*cp) && *cp != '(' && *cp != ':') cp++; pfnote (NULL, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); @@ -3785,7 +3430,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. */ -static void +void Cobol_paragraphs (inf) FILE *inf; { @@ -3798,10 +3443,10 @@ bp += 8; /* If eoln, compiler option or comment ignore whole line. */ - if (bp[-1] != ' ' || !isalnum ((unsigned char) bp[0])) + if (bp[-1] != ' ' || !isalnum (bp[0])) continue; - for (ep = bp; isalnum ((unsigned char) *ep) || *ep == '-'; ep++) + for (ep = bp; isalnum (*ep) || *ep == '-'; ep++) continue; if (*ep++ == '.') pfnote (savenstr (bp, ep-bp), TRUE, @@ -3818,7 +3463,7 @@ * "forward" immediately following the procedure statement; if found, * the tag is skipped. */ -static void +void Pascal_functions (inf) FILE *inf; { @@ -3853,8 +3498,8 @@ inparms = FALSE; /* found '(' after "proc" */ verify_tag = FALSE; /* check if "extern" is ahead */ - - while (!feof (inf)) /* long main loop to get next char */ + + while (!feof (inf)) /* long main loop to get next char */ { c = *dbp++; if (c == '\0') /* if end of line */ @@ -3995,12 +3640,7 @@ * 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 +int L_isdef (strp) register char *strp; { @@ -4009,7 +3649,7 @@ && (strp[3] == 'f' || strp[3] == 'F')); } -static int +int L_isquote (strp) register char *strp; { @@ -4018,10 +3658,10 @@ && (*++strp == 'o' || *strp == 'O') && (*++strp == 't' || *strp == 'T') && (*++strp == 'e' || *strp == 'E') - && iswhite (*++strp)); + && isspace (*++strp)); } -static void +void L_getit () { register char *cp; @@ -4038,7 +3678,7 @@ } for (cp = dbp /*+1*/; - *cp != '\0' && *cp != '(' && !iswhite(*cp) && *cp != ')'; + *cp != '\0' && *cp != '(' && *cp != ' ' && *cp != ')'; cp++) continue; if (cp == dbp) @@ -4048,7 +3688,7 @@ lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } -static void +void Lisp_functions (inf) FILE *inf; { @@ -4067,7 +3707,7 @@ /* Check for (foo::defmumble name-defined ... */ do dbp++; - while (*dbp != '\0' && !iswhite (*dbp) + while (*dbp != '\0' && !isspace (*dbp) && *dbp != ':' && *dbp != '(' && *dbp != ')'); if (*dbp == ':') { @@ -4091,10 +3731,8 @@ * Postscript tag functions * Just look for lines where the first character is '/' * Richard Mlynarik - * Also look at "defineps" for PSWrap - * suggested by Masatake YAMATO */ -static void +void Postscript_functions (inf) FILE *inf; { @@ -4108,15 +3746,9 @@ *ep != '\0' && *ep != ' ' && *ep != '{'; ep++) continue; - pfnote (savenstr (bp, ep-bp), TRUE, + pfnote ((CTAGS) ? savenstr (bp, ep-bp) : NULL, TRUE, lb.buffer, ep - lb.buffer + 1, lineno, linecharno); } - else if (strneq (bp, "defineps", 8)) - { - bp = skip_non_spaces (bp); - bp = skip_spaces (bp); - get_tag (bp); - } } } @@ -4129,38 +3761,54 @@ * look for (set! xyzzy */ -static void +void get_scheme (); + +void Scheme_functions (inf) FILE *inf; { - register char *bp; - - LOOP_ON_INPUT_LINES (inf, lb, bp) + LOOP_ON_INPUT_LINES (inf, lb, dbp) { - if (bp[0] == '(' - && (bp[1] == 'D' || bp[1] == 'd') - && (bp[2] == 'E' || bp[2] == 'e') - && (bp[3] == 'F' || bp[3] == 'f')) + if (dbp[0] == '(' + && (dbp[1] == 'D' || dbp[1] == 'd') + && (dbp[2] == 'E' || dbp[2] == 'e') + && (dbp[3] == 'F' || dbp[3] == 'f')) { - bp = skip_non_spaces (bp); + dbp = skip_non_spaces (dbp); /* Skip over open parens and white space */ - while (iswhite (*bp) || *bp == '(') - bp++; - get_tag (bp); + while (isspace (*dbp) || *dbp == '(') + dbp++; + get_scheme (); } - if (bp[0] == '(' - && (bp[1] == 'S' || bp[1] == 's') - && (bp[2] == 'E' || bp[2] == 'e') - && (bp[3] == 'T' || bp[3] == 't') - && (bp[4] == '!' || bp[4] == '!') - && (iswhite (bp[5]))) + if (dbp[0] == '(' + && (dbp[1] == 'S' || dbp[1] == 's') + && (dbp[2] == 'E' || dbp[2] == 'e') + && (dbp[3] == 'T' || dbp[3] == 't') + && (dbp[4] == '!' || dbp[4] == '!') + && (isspace (dbp[5]))) { - bp = skip_non_spaces (bp); - bp = skip_spaces (bp); - get_tag (bp); + dbp = skip_non_spaces (dbp); + dbp = skip_spaces (dbp); + get_scheme (); } } } + +void +get_scheme () +{ + register char *cp; + + if (*dbp == '\0') + return; + /* Go till you get to white space or a syntactic break */ + for (cp = dbp + 1; + *cp != '\0' && *cp != '(' && *cp != ')' && !isspace (*cp); + cp++) + continue; + pfnote (savenstr (dbp, cp-dbp), TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); +} /* Find tags in TeX and LaTeX input files. */ @@ -4182,9 +3830,9 @@ :chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem\ :part:appendix:entry:index"; -static void TEX_mode P_((FILE *)); -static struct TEX_tabent *TEX_decode_env P_((char *, char *)); -static int TEX_Token P_((char *)); +void TEX_mode (); +struct TEX_tabent *TEX_decode_env (); +int TEX_Token (); char TEX_esc = '\\'; char TEX_opgrp = '{'; @@ -4193,7 +3841,7 @@ /* * TeX/LaTeX scanning loop. */ -static void +void TeX_functions (inf) FILE *inf; { @@ -4240,7 +3888,7 @@ /* Figure out whether TeX's escapechar is '\\' or '!' and set grouping chars accordingly. */ -static void +void TEX_mode (inf) FILE *inf; { @@ -4275,7 +3923,7 @@ /* Read environment and prepend it to the default string. Build token table. */ -static struct TEX_tabent * +struct TEX_tabent * TEX_decode_env (evarname, defenv) char *evarname; char *defenv; @@ -4332,7 +3980,7 @@ Otherwise return -1. Keep the capital `T' in `token' for dumb truncating compilers (this distinguishes it from `TEX_toktab' */ -static int +int TEX_Token (cp) char *cp; { @@ -4348,13 +3996,13 @@ * Prolog support (rewritten) by Anders Lindgren, Mar. 96 * * Assumes that the predicate starts at column 0. - * Only the first clause of a predicate is added. + * Only the first clause of a predicate is added. */ -static int prolog_pred P_((char *, char *)); -static void prolog_skip_comment P_((linebuffer *, FILE *)); -static int prolog_atom P_((char *, int)); - -static void +int prolog_pred (); +void prolog_skip_comment (); +int prolog_atom (); + +void Prolog_functions (inf) FILE *inf; { @@ -4370,7 +4018,7 @@ { if (cp[0] == '\0') /* Empty line */ continue; - else if (iswhite (cp[0])) /* Not a predicate */ + else if (isspace (cp[0])) /* Not a predicate */ continue; else if (cp[0] == '/' && cp[1] == '*') /* comment. */ prolog_skip_comment (&lb, inf); @@ -4390,7 +4038,7 @@ } -static void +void prolog_skip_comment (plb, inf) linebuffer *plb; FILE *inf; @@ -4418,7 +4066,7 @@ * Return the size of the name of the predicate, or 0 if no header * was found. */ -static int +int prolog_pred (s, last) char *s; char *last; /* Name of last clause. */ @@ -4443,7 +4091,8 @@ || len != (int)strlen (last) || !strneq (s, last, len)) { - pfnote (savenstr (s, len), TRUE, s, pos, lineno, linecharno); + pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, + s, pos, lineno, linecharno); return len; } } @@ -4459,7 +4108,7 @@ * - A quoted arbitrary string. Single quotes can escape themselves. * Backslash quotes everything. */ -static int +int prolog_atom (s, pos) char *s; int pos; @@ -4468,11 +4117,11 @@ origpos = pos; - if (islower((unsigned char) s[pos]) || (s[pos] == '_')) + if (islower(s[pos]) || (s[pos] == '_')) { /* The atom is unquoted. */ pos++; - while (isalnum((unsigned char) s[pos]) || (s[pos] == '_')) + while (isalnum(s[pos]) || (s[pos] == '_')) { pos++; } @@ -4482,7 +4131,7 @@ { pos++; - while (1) + while (1) { if (s[pos] == '\'') { @@ -4509,18 +4158,18 @@ return -1; } -/* +/* * Support for Erlang -- Anders Lindgren, Feb 1996. * * Generates tags for functions, defines, and records. * * Assumes that Erlang functions start at column 0. */ -static int erlang_func P_((char *, char *)); -static void erlang_attribute P_((char *)); -static int erlang_atom P_((char *, int)); - -static void +int erlang_func (); +void erlang_attribute (); +int erlang_atom (); + +void Erlang_functions (inf) FILE *inf; { @@ -4536,7 +4185,7 @@ { if (cp[0] == '\0') /* Empty line */ continue; - else if (iswhite (cp[0])) /* Not function nor attribute */ + else if (isspace (cp[0])) /* Not function nor attribute */ continue; else if (cp[0] == '%') /* comment */ continue; @@ -4549,7 +4198,7 @@ } else if ((len = erlang_func (cp, last)) > 0) { - /* + /* * Function. Store the function name so that we only * generates a tag for the first clause. */ @@ -4575,7 +4224,7 @@ * Return the size of the name of the function, or 0 if no function * was found. */ -static int +int erlang_func (s, last) char *s; char *last; /* Name of last clause. */ @@ -4596,7 +4245,8 @@ || len != (int)strlen (last) || !strneq (s, last, len))) { - pfnote (savenstr (s, len), TRUE, s, pos, lineno, linecharno); + pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, + s, pos, lineno, linecharno); return len; } @@ -4605,7 +4255,7 @@ /* - * Handle attributes. Currently, tags are generated for defines + * Handle attributes. Currently, tags are generated for defines * and records. * * They are on the form: @@ -4613,7 +4263,7 @@ * -define(Foo(M, N), M+N). * -record(graph, {vtab = notable, cyclic = true}). */ -static void +void erlang_attribute (s) char *s; { @@ -4623,12 +4273,12 @@ if (strneq (s, "-define", 7) || strneq (s, "-record", 7)) { pos = skip_spaces (s + 7) - s; - if (s[pos++] == '(') + if (s[pos++] == '(') { pos = skip_spaces (s + pos) - s; len = erlang_atom (s, pos); if (len != 0) - pfnote (savenstr (& s[pos], len), TRUE, + pfnote ((CTAGS) ? savenstr (& s[pos], len) : NULL, TRUE, s, pos + len, lineno, linecharno); } } @@ -4640,7 +4290,7 @@ * Consume an Erlang atom (or variable). * Return the number of bytes consumed, or -1 if there was an error. */ -static int +int erlang_atom (s, pos) char *s; int pos; @@ -4649,11 +4299,11 @@ origpos = pos; - if (isalpha ((unsigned char) s[pos]) || s[pos] == '_') + if (isalpha (s[pos]) || s[pos] == '_') { /* The atom is unquoted. */ pos++; - while (isalnum ((unsigned char) s[pos]) || s[pos] == '_') + while (isalnum (s[pos]) || s[pos] == '_') pos++; return pos - origpos; } @@ -4661,7 +4311,7 @@ { pos++; - while (1) + while (1) { if (s[pos] == '\'') { @@ -4688,18 +4338,13 @@ #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 an unquoted separator. Also turns "\t" into a Tab character. Returns pointer to terminating separator. Works in place. Null terminates name string. */ -static char * +char * scan_separators (name) char *name; { @@ -4738,10 +4383,9 @@ /* Look at the argument of --regex or --no-regex and do the right thing. Same for each line of a regexp file. */ -static void -analyse_regex (regex_arg, ignore_case) +void +analyse_regex (regex_arg) char *regex_arg; - bool ignore_case; { if (regex_arg == NULL) free_patterns (); /* --no-regex: remove existing regexps */ @@ -4772,7 +4416,7 @@ } initbuffer (®exbuf); while (readline_internal (®exbuf, regexfp) > 0) - analyse_regex (regexbuf.buffer, ignore_case); + analyse_regex (regexbuf.buffer); free (regexbuf.buffer); fclose (regexfp); } @@ -4795,23 +4439,22 @@ lang = get_language_from_name (lang_name); if (lang == NULL) return; - add_regex (cp + 1, ignore_case, lang); + add_regex (cp + 1, lang); } break; /* Regexp to be used for any language. */ default: - add_regex (regex_arg, ignore_case, NULL); + add_regex (regex_arg, NULL); break; } } /* Turn a name, which is an ed-style (but Emacs syntax) regular expression, into a real regular expression by compiling it. */ -static void -add_regex (regexp_pattern, ignore_case, lang) +void +add_regex (regexp_pattern, lang) char *regexp_pattern; - bool ignore_case; language *lang; { char *name; @@ -4834,8 +4477,7 @@ (void) scan_separators (name); patbuf = xnew (1, struct re_pattern_buffer); - /* Translation table to fold case if appropriate. */ - patbuf->translate = (ignore_case) ? lc_trans : NULL; + patbuf->translate = NULL; patbuf->fastmap = NULL; patbuf->buffer = NULL; patbuf->allocated = 0; @@ -4861,7 +4503,7 @@ * Do the substitutions indicated by the regular expression and * arguments. */ -static char * +char * substitute (in, out, regs) char *in, *out; struct re_registers *regs; @@ -4878,7 +4520,7 @@ for (t = etags_strchr (out, '\\'); t != NULL; t = etags_strchr (t + 2, '\\')) - if (isdigit ((unsigned char) t[1])) + if (isdigit (t[1])) { dig = t[1] - '0'; diglen = regs->end[dig] - regs->start[dig]; @@ -4891,7 +4533,7 @@ result = xnew (size + 1, char); for (t = result; *out != '\0'; out++) - if (*out == '\\' && isdigit ((unsigned char) *++out)) + if (*out == '\\' && isdigit (*++out)) { /* Using "dig2" satisfies my debugger. Bleah. */ dig = *out - '0'; @@ -4910,7 +4552,7 @@ } /* Deallocate all patterns. */ -static void +void free_patterns () { pattern *pp; @@ -4925,26 +4567,9 @@ return; } -static void -get_tag (bp) - register char *bp; -{ - register char *cp; - - if (*bp == '\0') - return; - /* Go till you get to white space or a syntactic break */ - for (cp = bp + 1; - *cp != '\0' && *cp != '(' && *cp != ')' && !iswhite (*cp); - cp++) - continue; - pfnote (savenstr (bp, cp-bp), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); -} - #endif /* ETAGS_REGEXPS */ /* Initialize a linebuffer for use */ -static void +void initbuffer (lbp) linebuffer *lbp; { @@ -4962,7 +4587,7 @@ * platforms (for text files, it translates CR-NL to NL as it reads in the * file). */ -static long +long readline_internal (lbp, stream) linebuffer *lbp; register FILE *stream; @@ -4997,7 +4622,7 @@ if (p > buffer && p[-1] == '\r') { p -= 1; -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* Assume CRLF->LF translation will be performed by Emacs when loading this file, so CRs won't appear in the buffer. It would be cleaner to compensate within Emacs; @@ -5026,7 +4651,7 @@ * Like readline_internal, above, but in addition try to match the * input line against relevant regular expressions. */ -static long +long readline (lbp, stream) linebuffer *lbp; FILE *stream; @@ -5079,7 +4704,7 @@ } } #endif /* ETAGS_REGEXPS */ - + return result; } @@ -5087,7 +4712,7 @@ * Return a pointer to a space of size strlen(cp)+1 allocated * with xnew where the string CP has been copied. */ -static char * +char * savestr (cp) char *cp; { @@ -5098,7 +4723,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. */ -static char * +char * savenstr (cp, len) char *cp; int len; @@ -5115,14 +4740,13 @@ * Return the ptr in sp at which the character c last * appears; NULL if not found * - * Identical to POSIX strrchr, included for portability. + * Identical to System V strrchr, included for portability. */ -static char * +char * etags_strrchr (sp, c) - register const char *sp; - register int c; + register char *sp, c; { - register const char *r; + register char *r; r = NULL; do @@ -5130,7 +4754,7 @@ if (*sp == c) r = sp; } while (*sp++); - return (char *)r; + return r; } @@ -5138,43 +4762,42 @@ * Return the ptr in sp at which the character c first * appears; NULL if not found * - * Identical to POSIX strchr, included for portability. + * Identical to System V strchr, included for portability. */ -static char * +char * etags_strchr (sp, c) - register const char *sp; - register int c; + register char *sp, c; { do { if (*sp == c) - return (char *)sp; + return sp; } while (*sp++); return NULL; } /* Skip spaces, return new pointer. */ -static char * +char * skip_spaces (cp) char *cp; { - while (iswhite (*cp)) + while (isspace (*cp)) /* isspace('\0')==FALSE */ cp++; return cp; } /* Skip non spaces, return new pointer. */ -static char * +char * skip_non_spaces (cp) char *cp; { - while (*cp != '\0' && !iswhite (*cp)) + while (!iswhite (*cp)) /* iswhite('\0')==TRUE */ cp++; return cp; } /* Print error message and exit. */ -static void +void fatal (s1, s2) char *s1, *s2; { @@ -5182,7 +4805,7 @@ exit (BAD); } -static void +void pfatal (s1) char *s1; { @@ -5190,7 +4813,7 @@ exit (BAD); } -static void +void suggest_asking_for_help () { fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", @@ -5205,9 +4828,9 @@ } /* Print error message. `s1' is printf control string, `s2' is arg for it. */ -static void +void error (s1, s2) - const char *s1, *s2; + char *s1, *s2; { fprintf (stderr, "%s: ", progname); fprintf (stderr, s1, s2); @@ -5216,7 +4839,7 @@ /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ -static char * +char * concat (s1, s2, s3) char *s1, *s2, *s3; { @@ -5233,7 +4856,7 @@ /* Does the same work as the system V getcwd, but does not need to guess the buffer size in advance. */ -static char * +char * etags_getcwd () { #ifdef HAVE_GETCWD @@ -5253,6 +4876,19 @@ 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; @@ -5263,12 +4899,13 @@ 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). */ -static char * +char * relative_filename (file, dir) char *file, *dir; { @@ -5282,10 +4919,6 @@ while (*fp++ == *dp++) continue; fp--, dp--; /* back to the first differing char */ -#ifdef WIN32_NATIVE - if (fp == afn && afn[0] != '/') /* cannot build a relative name */ - return afn; -#endif do /* look at the equal chars until '/' */ fp--, dp--; while (*fp != '/'); @@ -5308,7 +4941,7 @@ /* Return a newly allocated string containing the absolute file name of FILE given DIR (which should end with a slash). */ -static char * +char * absolute_filename (file, dir) char *file, *dir; { @@ -5316,7 +4949,7 @@ if (filename_is_absolute (file)) res = savestr (file); -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* We don't support non-absolute file names with a drive letter, like `d:NAME' (it's too much hassle). */ else if (file[1] == ':') @@ -5340,8 +4973,8 @@ while (cp >= res && !filename_is_absolute (cp)); if (cp < res) cp = slashp; /* the absolute name begins with "/.." */ -#ifdef WIN32_NATIVE - /* Under Windows we get `d:/NAME' as absolute +#ifdef DOS_NT + /* Under MSDOS and NT we get `d:/NAME' as absolute file name, so the luser could say `d:/../NAME'. We silently treat this as `d:/NAME'. */ else if (cp[0] != '/') @@ -5360,7 +4993,7 @@ slashp = etags_strchr (slashp + 1, '/'); } - + if (res[0] == '\0') return savestr ("/"); else @@ -5370,7 +5003,7 @@ /* Return a newly allocated string containing the absolute file name of dir where FILE resides given DIR (which should end with a slash). */ -static char * +char * absolute_dirname (file, dir) char *file, *dir; { @@ -5391,27 +5024,23 @@ /* Whether the argument string is an absolute file name. The argument string must have been canonicalized with canonicalize_filename. */ -static bool +bool filename_is_absolute (fn) char *fn; { return (fn[0] == '/' -#ifdef WIN32_NATIVE +#ifdef DOS_NT || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') #endif ); } /* Translate backslashes into slashes. Works in place. */ -static void +void canonicalize_filename (fn) register char *fn; { -#ifdef WIN32_NATIVE - /* Canonicalize drive letter case. */ - if (islower (fn[0]) && fn[1] == ':') - fn[0] = toupper (fn[0]); - /* Convert backslashes to slashes. */ +#ifdef DOS_NT for (; *fn != '\0'; fn++) if (*fn == '\\') *fn = '/'; @@ -5422,7 +5051,7 @@ } /* Increase the size of a linebuffer. */ -static void +void grow_linebuffer (lbp, toksize) linebuffer *lbp; int toksize; @@ -5433,7 +5062,7 @@ } /* Like malloc but get fatal error if memory is exhausted. */ -static long * +long * xmalloc (size) unsigned int size; { @@ -5443,7 +5072,7 @@ return result; } -static long * +long * xrealloc (ptr, size) char *ptr; unsigned int size; diff -r 12e008d41344 -r 697ef44129c6 lib-src/fakemail.c --- a/lib-src/fakemail.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/fakemail.c Mon Aug 13 11:20:41 2007 +0200 @@ -21,7 +21,7 @@ /* Synched up with: FSF 19.28. */ #define NO_SHORTNAMES -#include +#include <../src/config.h> #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) /* This program is not used in BSD, so just avoid loader complaints. */ @@ -46,6 +46,14 @@ 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. */ @@ -108,7 +116,7 @@ struct linebuffer { - size_t size; + long size; char *buffer; }; @@ -136,7 +144,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; @@ -154,7 +162,7 @@ extern unsigned short geteuid (); static struct passwd *my_entry; #define cuserid(s) \ -(my_entry = getpwuid ((int) geteuid ()), \ +(my_entry = getpwuid (((int) geteuid ())), \ my_entry->pw_name) #endif @@ -163,7 +171,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); @@ -174,7 +182,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); @@ -182,20 +190,20 @@ /* Like malloc but get fatal error if memory is exhausted. */ -static void * +static char * xmalloc (size_t size) { - void *result = malloc (size); - if (result == NULL) + char *result = malloc (((unsigned) size)); + if (result == ((char *) NULL)) fatal ("virtual memory exhausted", (char *) 0); return result; } -static void * -xrealloc (void *ptr, size_t size) +static char * +xrealloc (char *ptr, size_t size) { - void *result = realloc (ptr, size); - if (result == NULL) + char *result = realloc (ptr, ((unsigned) size)); + if (result == ((char *) NULL)) fatal ("virtual memory exhausted", (char *) 0); return result; } @@ -206,7 +214,7 @@ init_linebuffer (struct linebuffer *linebuffer) { linebuffer->size = INITIAL_LINE_SIZE; - linebuffer->buffer = (char *) xmalloc (INITIAL_LINE_SIZE); + linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE)); } /* Read a line of text from `stream' into `linebuffer'. @@ -226,7 +234,8 @@ if (p == end) { linebuffer->size *= 2; - buffer = (char *) xrealloc (buffer, linebuffer->size); + buffer = ((char *) xrealloc ((char *) buffer, + (size_t) (linebuffer->size))); p = buffer + (p - linebuffer->buffer); end = buffer + linebuffer->size; linebuffer->buffer = buffer; @@ -270,7 +279,7 @@ has_keyword (char *field) { char *ignored; - return (get_keyword (field, &ignored) != (char *) NULL); + return (get_keyword (field, &ignored) != ((char *) NULL)); } static char * @@ -314,7 +323,7 @@ /* the_date has an unwanted newline at the end */ date_length = strlen (the_date) - 1; the_date[date_length] = '\0'; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT temp = "(null)"; #else temp = cuserid ((char *) NULL); @@ -391,7 +400,7 @@ if (the_stream != ((FILE *) NULL)) { add_a_stream (the_stream, my_fclose); - if (the_user == (char *) NULL) + if (the_user == ((char *) NULL)) file_preface = make_file_preface (); write_line_list (file_preface, the_stream); return true; @@ -411,20 +420,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) @@ -629,6 +638,10 @@ register int size; FILE *the_pipe; +#if !(__STDC__ || defined(STDC_HEADERS)) + extern char *getenv (); +#endif + mail_program_name = getenv ("FAKEMAILER"); if (!(mail_program_name && *mail_program_name)) mail_program_name = (char *) MAIL_PROGRAM_NAME; @@ -636,8 +649,8 @@ my_name = MY_NAME; the_streams = ((stream_list) NULL); - the_date = (char *) NULL; - the_user = (char *) NULL; + the_date = ((char *) NULL); + the_user = ((char *) NULL); the_header = read_header (); command_line = alloc_string ((size_t) (name_length + @@ -647,7 +660,7 @@ the_pipe = popen (command_line, "w"); if (the_pipe == ((FILE *) NULL)) - fatal ("cannot open pipe to real mailer", (char *) NULL); + fatal ("cannot open pipe to real mailer", (char *) 0); add_a_stream (the_pipe, pclose); @@ -665,4 +678,5 @@ return close_the_streams (); } +#endif /* not MSDOS */ #endif /* not BSD 4.2 (or newer) */ diff -r 12e008d41344 -r 697ef44129c6 lib-src/getopt.c --- a/lib-src/getopt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/getopt.c Mon Aug 13 11:20:41 2007 +0200 @@ -31,7 +31,7 @@ #endif #ifdef HAVE_CONFIG_H -#include +#include <../src/config.h> #endif #include @@ -73,7 +73,7 @@ #endif #endif -#if defined (WIN32_NATIVE) && !defined (CYGWIN) +#if defined (WIN32) && !defined (__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #undef getpid @@ -202,6 +202,11 @@ #define my_index strchr #else +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + static char * my_index (const char *str, int chr) { diff -r 12e008d41344 -r 697ef44129c6 lib-src/getopt.h --- a/lib-src/getopt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/getopt.h Mon Aug 13 11:20:41 2007 +0200 @@ -98,14 +98,15 @@ #define required_argument 1 #define optional_argument 2 -#if defined (__GNU_LIBRARY__) || defined (__cplusplus) || defined (CYGWIN) +#if defined (__STDC__) && __STDC__ +#ifdef __GNU_LIBRARY__ /* 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. */ extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ || C++ */ +#else /* not __GNU_LIBRARY__ */ extern int getopt (); -#endif /* __GNU_LIBRARY__ || C++ */ +#endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, @@ -117,6 +118,13 @@ const char *shortopts, const struct option *longopts, int *longind, int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* __STDC__ */ #ifdef __cplusplus } diff -r 12e008d41344 -r 697ef44129c6 lib-src/getopt1.c --- a/lib-src/getopt1.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/getopt1.c Mon Aug 13 11:20:41 2007 +0200 @@ -20,7 +20,7 @@ USA. */ #ifdef HAVE_CONFIG_H -#include +#include <../src/config.h> #endif #include "getopt.h" diff -r 12e008d41344 -r 697ef44129c6 lib-src/gnuclient.c --- a/lib-src/gnuclient.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/gnuclient.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,17 +27,6 @@ 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 . @@ -59,6 +48,7 @@ #include #include #include +#define DONT_ENCAPSULATE #include #ifdef HAVE_STRING_H @@ -131,7 +121,7 @@ } void -initialize_signals (void) +initialize_signals () { /* Set up signal handler to pass relevant signals to emacs process. We used to send SIGSEGV, SIGBUS, SIGPIPE, SIGILL and others to @@ -200,7 +190,7 @@ /* Absolute (unix-style) pathname. Do nothing */ strcat (fullpath, filename); } -#ifdef CYGWIN +#ifdef __CYGWIN32__ else if (filename[0] && filename[0] == '\\' && filename[1] && filename[1] == '\\') { @@ -241,13 +231,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 == '\"') @@ -301,14 +291,14 @@ over = 1; \ } while (0) -/* A strdup imitation. */ +/* A strdup immitation. */ static char * -my_strdup (const char *s) +my_strdup (CONST char *s) { - char *new_s = (char *) malloc (strlen (s) + 1); - if (new_s) - strcpy (new_s, s); - return new_s; + char *new = malloc (strlen (s) + 1); + if (new) + strcpy (new, s); + return new; } int @@ -670,7 +660,7 @@ } filename_expand (fullpath, argv[i]); #ifdef INTERNET_DOMAIN_SOCKETS - path = (char *) malloc (strlen (remotepath) + strlen (fullpath) + 1); + path = malloc (strlen (remotepath) + strlen (fullpath) + 1); sprintf (path, "%s%s", remotepath, fullpath); #else path = my_strdup (fullpath); diff -r 12e008d41344 -r 697ef44129c6 lib-src/gnuserv.c --- a/lib-src/gnuserv.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/gnuserv.c Mon Aug 13 11:20:41 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. */ @@ -73,7 +73,7 @@ #ifdef SYSV_IPC int ipc_qid = 0; /* ipc message queue id */ -pid_t ipc_wpid = 0; /* watchdog task pid */ +int ipc_wpid = 0; /* watchdog task pid */ /* @@ -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. */ @@ -111,7 +111,7 @@ { if ((ipc_wpid = fork ()) == 0) { /* child process */ - pid_t ppid = getppid (); /* parent's process id */ + int ppid = getppid (); /* parent's process id */ setpgrp(); /* gnu kills process group on exit */ @@ -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 */ @@ -323,11 +323,11 @@ char buf[GSERV_BUFSZ+1]; int offset=0; int s; - int len = 0; + int len; 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,18 +694,18 @@ handle_internet_request (int ls) { int s; - socklen_t addrlen = sizeof (struct sockaddr_in); + size_t addrlen = sizeof(struct sockaddr_in); struct sockaddr_in peer; /* for peer socket address */ - memset (&peer, '\0', sizeof (peer)); + memset((char *)&peer,0,sizeof(struct sockaddr_in)); - if ((s = accept(ls,(struct sockaddr *)&peer, &addrlen)) == -1) + if ((s = accept(ls,(struct sockaddr *)&peer, (void *) &addrlen)) == -1) { perror(progname); 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 */ - socklen_t bindlen; + int 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,19 +814,19 @@ handle_unix_request (int ls) { int s; - socklen_t len = sizeof (struct sockaddr_un); + size_t len = sizeof(struct sockaddr_un); struct sockaddr_un server; /* for unix socket address */ server.sun_family = AF_UNIX; - if ((s = accept(ls,(struct sockaddr *)&server, &len)) < 0) + if ((s = accept(ls,(struct sockaddr *)&server, (void *)&len)) < 0) { perror(progname); fprintf(stderr,"%s: unable to accept\n",progname); } /* if */ echo_request(s); - + } /* handle_unix_request */ #endif /* UNIX_DOMAIN_SOCKETS */ @@ -883,8 +883,8 @@ 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); diff -r 12e008d41344 -r 697ef44129c6 lib-src/gnuserv.h --- a/lib-src/gnuserv.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/gnuserv.h Mon Aug 13 11:20:41 2007 +0200 @@ -36,13 +36,18 @@ #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 +#include <../src/config.h> +#undef read +#undef write +#undef open +#undef close #undef signal /* Define the communication method between server and clients: @@ -169,7 +174,7 @@ */ #ifndef DONT_USE_LITOUT #if !defined(HAVE_TERMIO) && !defined(HAVE_TERMIOS) && !defined(VMS) -#if !defined(BSD4_1) +#if !defined(MSDOS) && !defined(BSD4_1) #define USE_LITOUT #endif #endif @@ -211,7 +216,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 12e008d41344 -r 697ef44129c6 lib-src/gnuslib.c --- a/lib-src/gnuslib.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/gnuslib.c Mon Aug 13 11:20:41 2007 +0200 @@ -76,8 +76,10 @@ char *progname = NULL; -int -make_connection (char *hostarg, int portarg, int *s) +int make_connection(hostarg, portarg, s) + char *hostarg; + int portarg; + int *s; { #ifdef INTERNET_DOMAIN_SOCKETS char *ptr; @@ -128,8 +130,7 @@ connect_to_ipc_server -- establish connection with server process via SYSV IPC Returns msqid for server if successful. */ -static int -connect_to_ipc_server (void) +static int connect_to_ipc_server (void) { int s; /* connected msqid */ key_t key; /* message key */ @@ -159,8 +160,10 @@ disconnect_from_ipc_server -- inform the server that sending has finished, and wait for its reply. */ -void -disconnect_from_ipc_server (int s, struct msgbuf *msgp, int echo) +void disconnect_from_ipc_server(s,msgp,echo) + int s; + struct msgbuf *msgp; + int echo; { int len; /* length of received message */ @@ -193,8 +196,9 @@ /* send_string -- send string to socket. */ -void -send_string (int s, const char *msg) +void send_string(s,msg) + int s; + CONST char *msg; { #if 0 if (send(s,msg,strlen(msg),0) < 0) { @@ -223,8 +227,7 @@ /* read_line -- read a \n terminated line from a socket */ -int -read_line (int s, char *dest) +int read_line(int s, char *dest) { int length; int offset=0; @@ -249,8 +252,7 @@ domain socket. Returns socket descriptor for server if successful. */ -static int -connect_to_unix_server (void) +static int connect_to_unix_server (void) { int s; /* connected socket descriptor */ struct sockaddr_un server; /* for unix connections */ @@ -284,8 +286,8 @@ internet_addr -- return the internet addr of the hostname or internet address passed. Return -1 on error. */ -int -internet_addr (char *host) +int internet_addr(host) + char *host; { struct hostent *hp; /* pointer to host info for remote host */ IN_ADDR numeric_addr; /* host address */ @@ -312,8 +314,7 @@ an internet domain socket. Returns socket descriptor for server if successful. */ -static int -connect_to_internet_server (char *serverhost, u_short port) +static int connect_to_internet_server (char *serverhost, u_short port) { int s; /* connected socket descriptor */ struct servent *sp; /* pointer to service information */ @@ -394,8 +395,9 @@ disconnect_from_server -- inform the server that sending has finished, and wait for its reply. */ -void -disconnect_from_server (int s, int echo) +void disconnect_from_server(s,echo) + int s; + int echo; { #if 0 char buffer[REPLYSIZ+1]; diff -r 12e008d41344 -r 697ef44129c6 lib-src/gzip-el.sh --- a/lib-src/gzip-el.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/gzip-el.sh Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,8 @@ ### gzip-el.sh --- compress superfluous installed source lisp # Author: Jeff Miller -# Author: Hrvoje Niksic -# Maintainer: Steve Baur +# Author: Hrvoje Niksic +# Maintainer: Steve Baur # Created: 13 Feb 1997 # Version: 1.0 # Keywords: internal diff -r 12e008d41344 -r 697ef44129c6 lib-src/hexl.c --- a/lib-src/hexl.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/hexl.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,19 +1,16 @@ /* Synched up with: FSF 19.28. */ -#include +#include <../src/config.h> #include #include -#ifdef WIN32_NATIVE -#include +#ifdef MSDOS #include #endif #if __STDC__ || defined(STDC_HEADERS) #include -#ifdef HAVE_UNISTD_H #include -#endif #include #endif @@ -32,7 +29,9 @@ void usage (void); int -main (int argc, char *argv[]) +main(argc, argv) + int argc; + char *argv[]; { register long address; char string[18]; @@ -144,8 +143,9 @@ { char buf[18]; -#ifdef WIN32_NATIVE - _setmode (_fileno (stdout), O_BINARY); +#ifdef MSDOS + (stdout)->_flag &= ~_IOTEXT; /* print binary */ + _setmode (fileno (stdout), O_BINARY); #endif for (;;) { @@ -187,8 +187,9 @@ } else { -#ifdef WIN32_NATIVE - _setmode (_fileno (fp), O_BINARY); +#ifdef MSDOS + (fp)->_flag &= ~_IOTEXT; /* read binary */ + _setmode (fileno (fp), O_BINARY); #endif address = 0; string[0] = ' '; @@ -244,7 +245,7 @@ } void -usage (void) +usage () { (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); exit (1); diff -r 12e008d41344 -r 697ef44129c6 lib-src/i.c --- a/lib-src/i.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/* 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 12e008d41344 -r 697ef44129c6 lib-src/make-docfile.c --- a/lib-src/make-docfile.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/make-docfile.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,44 +40,46 @@ */ #define NO_SHORTNAMES /* Tell config not to load remap.h */ -#include +#include <../src/config.h> #include #include #if __STDC__ || defined(STDC_HEADERS) #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #endif -#ifdef CYGWIN +#if defined(MSDOS) || defined(__CYGWIN32__) #include -#endif -#ifdef WIN32_NATIVE +#endif /* MSDOS */ +#ifdef WINDOWSNT #include #include #include #include -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ -#ifndef WIN32_NATIVE #include -#endif /* not WIN32_NATIVE */ -#if defined(WIN32_NATIVE) || defined(CYGWIN) +#if defined(DOS_NT) || defined(__CYGWIN32__) #define READ_TEXT "rt" #define READ_BINARY "rb" #define WRITE_BINARY "wb" #define APPEND_BINARY "ab" -#else /* not WIN32_NATIVE */ +#else /* not DOS_NT */ #define READ_TEXT "r" #define READ_BINARY "r" #define WRITE_BINARY "w" #define APPEND_BINARY "a" -#endif /* not WIN32_NATIVE */ +#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 /* Stdio stream for output to the DOC file. */ static FILE *outfile; @@ -89,14 +91,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') || \ @@ -113,7 +115,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); @@ -123,7 +125,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); @@ -189,10 +191,19 @@ outfile = stdout; /* Don't put CRs in the DOC file. */ -#ifdef WIN32_NATIVE +#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 _fmode = O_BINARY; _setmode (fileno (stdout), O_BINARY); -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* If first two args are -o FILE, output to FILE. */ i = 1; @@ -263,7 +274,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")) @@ -292,59 +303,48 @@ 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 prevc = 0, c = 0; + register int c; char *p = buf; int start = -1; - MDGET; + c = getc (infile); while (c != EOF) { while ((c_docstring || c != '"') && c != EOF) { - if (c == '*') + if (start) { - int cc = getc (infile); - if (cc == '/') + if (c == '*') { - if (prevc != '\n') - { - if (printflag > 0) - { - if (ellcc) - fprintf (outfile, "\\n\\"); - putc ('\n', outfile); - } - else if (printflag < 0) - *p++ = '\n'; - } - break; + int cc = getc (infile); + if (cc == '/') + break; + else + ungetc (cc, infile); } - else - ungetc (cc, infile); - } - if (start == 1) - { - if (printflag > 0) + if (start != -1) { - if (ellcc) - fprintf (outfile, "\\n\\"); - putc ('\n', outfile); + if (printflag > 0) + { + if (ellcc) + fprintf (outfile, "\\n\\"); + putc ('\n', outfile); + } + else if (printflag < 0) + *p++ = '\n'; } - else if (printflag < 0) - *p++ = '\n'; } if (c == '\\') { - MDGET; + c = getc (infile); if (c == '\n') { - MDGET; + c = getc (infile); start = 1; continue; } @@ -358,36 +358,32 @@ 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; } - MDGET; + c = getc (infile); } /* look for continuation of string */ if (Current_file_type == c_file) { - do - { - MDGET; - } - while (isspace (c)); + while (isspace (c = getc (infile))) + ; if (c != '"') break; } else { - MDGET; + c = getc (infile); if (c != '"') break; /* If we had a "", concatenate the two strings. */ } - MDGET; + c = getc (infile); } if (printflag < 0) @@ -400,7 +396,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; @@ -433,10 +429,10 @@ static char lo[] = "Lisp_Object"; if ((C_IDENTIFIER_CHAR_P (c) != in_ident) && !in_ident && (strncmp (p, lo, sizeof (lo) - 1) == 0) && - isspace((unsigned char) (* (p + sizeof (lo) - 1)))) + isspace(*(p + sizeof (lo) - 1))) { p += (sizeof (lo) - 1); - while (isspace ((unsigned char) (*p))) + while (isspace (*p)) p++; c = *p; } @@ -500,7 +496,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; @@ -791,7 +787,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; @@ -919,7 +915,7 @@ /* Skip until the first newline; remember the two previous chars. */ while (c != '\n' && c >= 0) { - /* #### Kludge -- Ignore any ESC x x ISO2022 sequences */ + /* ### Kludge -- Ignore any ESC x x ISO2022 sequences */ if (c == 27) { getc (infile); diff -r 12e008d41344 -r 697ef44129c6 lib-src/make-dump-id.c --- a/lib-src/make-dump-id.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* 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 12e008d41344 -r 697ef44129c6 lib-src/make-msgfile.lex --- a/lib-src/make-msgfile.lex Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/make-msgfile.lex Mon Aug 13 11:20:41 2007 +0200 @@ -223,7 +223,7 @@ "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 analogous + constant on this line should go into the message catalog. This is analagous to the magic ";###autoload" comments, and to the magic comments used in the EPSF structuring conventions. diff -r 12e008d41344 -r 697ef44129c6 lib-src/make-path.c --- a/lib-src/make-path.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/make-path.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,7 +27,7 @@ that option. */ #ifdef emacs -#include +#include <../src/config.h> #endif #include @@ -35,6 +35,8 @@ #include #include +extern int errno; + char *prog_name; static int touchy_mkdir (char *path) diff -r 12e008d41344 -r 697ef44129c6 lib-src/mmencode.c --- a/lib-src/mmencode.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/mmencode.c Mon Aug 13 11:20:41 2007 +0200 @@ -18,7 +18,6 @@ #include #include #include -#include static void output64chunk(int c1, int c2, int c3, int pads, FILE *outfile); @@ -53,7 +52,9 @@ static int InNewline=0; static int -nextcharin (FILE *infile, int PortableNewlines) +nextcharin(infile, PortableNewlines) +FILE *infile; +int PortableNewlines; { int c; @@ -385,7 +386,7 @@ putc(c1<<4 | c2, outfile); } } else { -#ifdef WIN32_NATIVE +#ifdef MSDOS if (*s == '\n') putc('\r', outfile); /* insert CR for binary-mode write */ #endif @@ -442,8 +443,7 @@ OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. */ -#ifdef WIN32_NATIVE -#include +#ifdef MSDOS #include #endif @@ -488,7 +488,7 @@ exit(-1); } } else { -#ifdef WIN32_NATIVE +#ifdef MSDOS if (encode) fp = fopen(argv[i], "rb"); else @@ -498,16 +498,16 @@ } /* else */ #else fp = fopen(argv[i], "r"); -#endif /* WIN32_NATIVE */ +#endif /* MSDOS */ if (!fp) { perror(argv[i]); exit(-1); } } } -#ifdef WIN32_NATIVE +#ifdef MSDOS if (fp == stdin) setmode(fileno(fp), O_BINARY); -#endif /* WIN32_NATIVE */ +#endif /* MSDOS */ if (which == BASE64) { if (encode) { to64(fp, fpo, portablenewlines); diff -r 12e008d41344 -r 697ef44129c6 lib-src/movemail.c --- a/lib-src/movemail.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/movemail.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,41 +1,35 @@ /* movemail foo bar -- move file foo to file bar, - locking file foo. + locking file foo the way /bin/mail respects. Copyright (C) 1986, 1992, 1993, 1994, 1996 Free Software Foundation, Inc. -This file is part of XEmacs. +This file is part of GNU Emacs. -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to +along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. - - Please mail bugs and suggestions to the XEmacs maintainer. -*/ +Boston, MA 02111-1307, USA. */ -/* Important notice: - * - * You *must* coordinate the locking method used by movemail with that - * used by your mail delivery agent, as well as that of the other mail - * user agents on your system. movemail allows you to do this at run - * time via the -m flag. Moreover, it uses a default determined by - * the MAIL_LOCK_DOT, MAIL_LOCK_LOCKF, MAIL_LOCK_FLOCK, - * MAIL_LOCK_LOCKING, and MAIL_LOCK_MMDF preprocessor settings. - */ +/* Important notice: defining MAIL_USE_FLOCK or MAIL_USE_LOCKF *will + cause loss of mail* if you do it on a system that does not normally + use flock as its way of interlocking access to inbox files. The + setting of MAIL_USE_FLOCK and MAIL_USE_LOCKF *must agree* with the + system's own conventions. It is not a choice that is up to you. -/* - * Mike Sperber reorganized - * everything that has to with locking in December 1999. - */ + So, if your system uses lock files rather than flock, then the only way + you can get proper operation is to enable movemail to write lockfiles there. + This means you must either give that directory access modes + that permit everyone to write lockfiles in it, or you must make movemail + a setuid or setgid program. */ /* * Modified January, 1986 by Michael R. Gretzinger (Project Athena) @@ -62,14 +56,14 @@ #define NO_SHORTNAMES /* Tell config not to load remap.h */ #define DONT_ENCAPSULATE -#include +#include <../src/config.h> #include #include #include #include #include "../src/sysfile.h" #include "../src/syswait.h" -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #include "../src/systime.h" #endif #include @@ -87,6 +81,10 @@ char * strerror (int errnum); #endif /* HAVE_STRERROR */ +#ifdef MSDOS +#undef access +#endif /* MSDOS */ + #ifndef DIRECTORY_SEP #define DIRECTORY_SEP '/' #endif @@ -94,7 +92,7 @@ #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) #endif -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #undef access #undef unlink #define fork() 0 @@ -106,9 +104,9 @@ properly - make sure it does before you enable this! */ #define DISABLE_DIRECT_ACCESS #include -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ -#if defined (HAVE_UNISTD_H) +#if defined (HAVE_UNISTD_H) || defined (USG) #include #endif /* unistd.h */ #ifndef F_OK @@ -118,15 +116,23 @@ #define R_OK 4 #endif /* No F_OK */ -#if defined (HAVE_FCNTL_H) +#if defined (HAVE_FCNTL_H) || defined (USG) #include #endif /* fcntl.h */ -#ifdef HAVE_LOCKING +#if defined (XENIX) || defined (WINDOWSNT) #include #endif -#ifdef HAVE_MMDF +#ifdef MAIL_USE_LOCKF +#define MAIL_USE_SYSTEM_LOCK +#endif + +#ifdef MAIL_USE_FLOCK +#define MAIL_USE_SYSTEM_LOCK +#endif + +#ifdef MAIL_USE_MMDF extern int lk_open (), lk_close (); #endif @@ -138,15 +144,13 @@ static void fatal (char *, char*); static void error (char *, char *, char *); -static void usage(int); static void pfatal_with_name (char *); static void pfatal_and_delete (char *); static char *concat (char *, char *, char *); static long *xmalloc (unsigned int); #ifdef MAIL_USE_POP static int popmail (char *, char *, char *); -static int pop_retr (popserver server, int msgno, - int (*action)(char *, FILE *), FILE *arg); +static int pop_retr (popserver server, int msgno, int (*action)(), void *arg); static int mbx_write (char *, FILE *); static int mbx_delimit_begin (FILE *); static int mbx_delimit_end (FILE *); @@ -155,6 +159,9 @@ struct re_pattern_buffer* regexp); #endif +/* Nonzero means this is name of a lock file to delete on fatal error. */ +char *delete_lockname; + int verbose=0; #ifdef MAIL_USE_POP int reverse=0; @@ -176,37 +183,10 @@ { "regex", required_argument, NULL, 'r' }, { "match-lines", required_argument, NULL, 'l' }, #endif - { "lock-method", required_argument, NULL, 'm' }, - { "help", no_argument, NULL, 'h' }, { "verbose", no_argument, NULL, 'v' }, { 0 } }; -#define DOTLOCKING 0 -#define FLOCKING 1 -#define LOCKFING 2 -#define MMDF 3 -#define LOCKING 4 - -#if defined(MAIL_LOCK_FLOCK) && defined(HAVE_FLOCK) -#define DEFAULT_LOCKING FLOCKING -#elif defined(MAIL_LOCK_LOCKF) && defined(HAVE_LOCKF) -#define DEFAULT_LOCKING LOCKFING -#elif defined(MAIL_LOCK_MMDF) && defined(HAVE_MMDF) -#define DEFAULT_LOCKING MMDF -#elif defined(MAIL_LOCK_LOCKING) && defined(HAVE_LOCKING) -#define DEFAULT_LOCKING LOCKING -#else -#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); - int main (int argc, char *argv[]) { @@ -217,23 +197,23 @@ int status; #endif - int lock_method = DEFAULT_LOCKING; - - char *maybe_lock_env; +#ifndef MAIL_USE_SYSTEM_LOCK + struct stat st; + long now; + int tem; + char *lockname, *p; + char *tempname; + int desc; +#endif /* not MAIL_USE_SYSTEM_LOCK */ - maybe_lock_env = getenv("EMACSLOCKMETHOD"); - if (maybe_lock_env) - { - printf("maybe-lock_env: %s\n", maybe_lock_env); - lock_method = parse_lock_method(maybe_lock_env); - } + delete_lockname = 0; - for (;;) + while (1) { #ifdef MAIL_USE_POP - char* optstring = "i:o:m:p:l:r:xvhk"; + char* optstring = "i:o:p:l:r:xvk"; #else - char* optstring = "i:o:m:vh"; + char* optstring = "i:o:v"; #endif int opt = getopt_long (argc, argv, optstring, longopts, 0); @@ -274,16 +254,7 @@ regexp_pattern = compile_regex (optarg); break; #endif - - case 'm': - lock_method = parse_lock_method(optarg); - break; - case 'h': - usage(lock_method); - exit(0); - case 'v': - verbose = 1; - break; + case 'v': verbose = 1; break; } } @@ -300,19 +271,17 @@ if (!inname || !outname) { - usage(lock_method); + fprintf (stderr, "Usage: movemail [-rvxk] [-l lines ] [-i] inbox [-o] destfile [[-p] POP-password]\n"); exit(1); } -#ifdef HAVE_MMDF - if (lock_method == MMDF) - mmdf_init (argv[0]); +#ifdef MAIL_USE_MMDF + mmdf_init (argv[0]); #endif if (*outname == 0) fatal ("Destination file name is empty", 0); - VERBOSE(("checking access to output file\n")); /* Check access to output file. */ if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) pfatal_with_name (outname); @@ -339,7 +308,7 @@ exit (retcode); } -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT setuid (getuid ()); #endif #endif /* MAIL_USE_POP */ @@ -350,239 +319,34 @@ if (access (inname, R_OK | W_OK) != 0) pfatal_with_name (inname); - - if (fork () == 0) - { - setuid (getuid ()); - - VERBOSE(("opening input file\n")); - - switch (lock_method) - { - case DOTLOCKING: - indesc = open (inname, O_RDONLY); - break; -#ifdef HAVE_LOCKF - case LOCKFING: - indesc = open (inname, O_RDWR); - break; -#endif -#ifdef HAVE_FLOCK - case FLOCKING: - indesc = open (inname, O_RDWR); - break; -#endif -#ifdef HAVE_LOCKING - case LOCKING: - indesc = open (inname, O_RDWR); - break; -#endif -#ifdef HAVE_MMDF - case MMDF: - indesc = lk_open (inname, O_RDONLY, 0, 0, 10); - break; -#endif - default: abort(); - } - - if (indesc < 0) - pfatal_with_name (inname); - -#ifdef HAVE_UMASK - /* In case movemail is setuid to root, make sure the user can - read the output file. */ - umask (umask (0) & 0333); -#endif - - outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); - if (outdesc < 0) - pfatal_with_name (outname); - - VERBOSE(("locking input file\n")); +#ifndef MAIL_USE_MMDF +#ifndef MAIL_USE_SYSTEM_LOCK + /* Use a lock file named after our first argument with .lock appended: + If it exists, the mail file is locked. */ + /* Note: this locking mechanism is *required* by the mailer + (on systems which use it) to prevent loss of mail. - switch (lock_method) - { -#ifdef HAVE_LOCKF - case LOCKFING: - if (lockf (indesc, F_LOCK, 0) < 0) - pfatal_with_name (inname); - break; -#endif -#ifdef HAVE_FLOCK - case FLOCKING: - if (flock (indesc, LOCK_EX) < 0) - pfatal_with_name (inname); - break; -#endif -#ifdef HAVE_LOCKING - case LOCKING: - if (locking (indesc, LK_RLCK, -1L) < 0) - pfatal_with_name (inname); - break; -#endif - case DOTLOCKING: - lock_dot(inname); - break; - } - - VERBOSE(("copying input file to output file\n")); - - { - char buf[1024]; - - while (1) - { - nread = read (indesc, buf, sizeof buf); - if (nread != write (outdesc, buf, nread)) - { - int saved_errno = errno; - unlink (outname); - errno = saved_errno; - pfatal_with_name (outname); - } - if (nread < sizeof buf) - break; - } - } - -#ifdef HAVE_FSYNC - if (fsync (outdesc) < 0) - pfatal_and_delete (outname); -#endif - - /* Check to make sure no errors before we zap the inbox. */ - if (close (outdesc) != 0) - pfatal_and_delete (outname); - - VERBOSE(("deleting or truncating input file\n")); + On systems that use a lock file, extracting the mail without locking + WILL occasionally cause loss of mail due to timing errors! - switch (lock_method) - { - case LOCKFING: - case FLOCKING: - case LOCKING: -#ifdef HAVE_FTRUNCATE - ftruncate (indesc, 0L); -#else - close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666)); -#endif - close (indesc); - break; -#ifdef HAVE_MMDF - case MMDF: - lk_close (indesc, 0, 0, 0); - break; -#endif - case DOTLOCKING: - creat (inname, 0600); - break; - } - - exit (0); - } + So, if creation of the lock file fails + due to access permission on the mail spool directory, + you simply MUST change the permission + and/or make movemail a setgid program + so it can create lock files properly. - wait (&status); - if (!WIFEXITED (status)) - exit (1); - else if (WEXITSTATUS (status) != 0) - exit (WEXITSTATUS (status)); - - if (lock_method == DOTLOCKING) - unlock_dot(inname); - -#endif /* not DISABLE_DIRECT_ACCESS */ - - return 0; -} - -static void -usage(int lock_method) -{ - printf ("Usage: movemail [-rvxkh] [-l lines ] [-m method ] [-i] inbox [-o] destfile [[-p] POP-password]\n"); - printf("where method is one of: dot"); -#ifdef HAVE_LOCKF - printf(", lockf"); -#endif -#ifdef HAVE_FLOCK - printf(", flock"); -#endif -#ifdef HAVE_MMDF - printf(", mmdf"); -#endif -#ifdef HAVE_LOCKING - printf(", locking"); -#endif - printf("\nDefault is: %s\n", unparse_lock_method(lock_method)); - -} + You might also wish to verify that your system is one + which uses lock files for this purpose. Some systems use other methods. -static char * -unparse_lock_method(int lock_method) -{ - switch (lock_method) - { - case DOTLOCKING: return "dot"; - case FLOCKING: return "flock"; - case LOCKFING: return "lockf"; - case LOCKING: return "locking"; - case MMDF: return "mmdf"; - default: abort();return 0; - } -} + If your system uses the `flock' system call for mail locking, + define MAIL_USE_SYSTEM_LOCK in config.h or the s-*.h file + and recompile movemail. If the s- file for your system + should define MAIL_USE_SYSTEM_LOCK but does not, send a bug report + to bug-gnu-emacs@prep.ai.mit.edu so we can fix it. */ -static int -parse_lock_method(char *method_name) -{ - if (!strcmp("dot", method_name) || !strcmp("file", method_name)) - return DOTLOCKING; -#ifdef HAVE_LOCKF - else if (!strcmp("lockf", method_name)) - return LOCKFING; -#endif -#ifdef HAVE_FLOCK - else if (!strcmp("flock", method_name)) - return FLOCKING; -#endif -#ifdef HAVE_MMDF - else if (!strcmp("mmdf", method_name)) - return MMDF; -#endif -#ifdef HAVE_LOCKING - else if (!strcmp("locking", method_name)) - return LOCKING; -#endif - else - fatal("invalid lock method: %s", method_name); - return 0; /* unreached */ -} - -static char * -dot_filename(char *filename) -{ - return concat (filename, ".lock", ""); -} - -static char *dotlock_filename = NULL; - -#ifndef DISABLE_DIRECT_ACCESS -static void -lock_dot(char *filename) -{ - struct stat st; - long now; - int tem; - char *lockname, *p; - char *tempname; - int desc; - - dotlock_filename = (char *) xmalloc(strlen(filename) + 1); - - /* Use a lock file named after our first argument with .lock appended: - If it exists, the mail file is locked. */ - - lockname = dot_filename(filename); - tempname = (char *) xmalloc (strlen (filename) + strlen ("EXXXXXX") + 1); - strcpy (tempname, filename); + lockname = concat (inname, ".lock", ""); + tempname = (char *) xmalloc (strlen (inname) + strlen ("EXXXXXX") + 1); + strcpy (tempname, inname); p = tempname + strlen (tempname); while (p != tempname && !IS_DIRECTORY_SEP (p[-1])) p--; @@ -591,7 +355,7 @@ mktemp (tempname); unlink (tempname); - for (;;) + while (1) { /* Create the lock file, but not under the lock file name. */ /* Give up if cannot do that. */ @@ -622,29 +386,132 @@ unlink (lockname); } } - strcpy(dotlock_filename, filename); -} -#endif /* not DISABLE_DIRECT_ACCESS */ + + delete_lockname = lockname; +#endif /* not MAIL_USE_SYSTEM_LOCK */ +#endif /* not MAIL_USE_MMDF */ + + if (fork () == 0) + { + setuid (getuid ()); + +#ifndef MAIL_USE_MMDF +#ifdef MAIL_USE_SYSTEM_LOCK + indesc = open (inname, O_RDWR); +#else /* if not MAIL_USE_SYSTEM_LOCK */ + indesc = open (inname, O_RDONLY); +#endif /* not MAIL_USE_SYSTEM_LOCK */ +#else /* MAIL_USE_MMDF */ + indesc = lk_open (inname, O_RDONLY, 0, 0, 10); +#endif /* MAIL_USE_MMDF */ + + if (indesc < 0) + pfatal_with_name (inname); + +#if defined (BSD) || defined (XENIX) + /* In case movemail is setuid to root, make sure the user can + read the output file. */ + /* This is desirable for all systems + but I don't want to assume all have the umask system call */ + umask (umask (0) & 0333); +#endif /* BSD or Xenix */ + outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); + if (outdesc < 0) + pfatal_with_name (outname); +#ifdef MAIL_USE_SYSTEM_LOCK +#ifdef MAIL_USE_LOCKF + if (lockf (indesc, F_LOCK, 0) < 0) pfatal_with_name (inname); +#else /* not MAIL_USE_LOCKF */ +#ifdef XENIX + if (locking (indesc, LK_RLCK, 0L) < 0) pfatal_with_name (inname); +#else +#ifdef WINDOWSNT + if (locking (indesc, LK_RLCK, -1L) < 0) pfatal_with_name (inname); +#else + if (flock (indesc, LOCK_EX) < 0) pfatal_with_name (inname); +#endif +#endif +#endif /* not MAIL_USE_LOCKF */ +#endif /* MAIL_USE_SYSTEM_LOCK */ + + { + char buf[1024]; -static void -unlock_dot(char *filename) -{ - unlink(dot_filename(filename)); + while (1) + { + nread = read (indesc, buf, sizeof buf); + if (nread != write (outdesc, buf, nread)) + { + int saved_errno = errno; + unlink (outname); + errno = saved_errno; + pfatal_with_name (outname); + } + if (nread < sizeof buf) + break; + } + } + +#ifdef BSD + if (fsync (outdesc) < 0) + pfatal_and_delete (outname); +#endif + + /* Check to make sure no errors before we zap the inbox. */ + if (close (outdesc) != 0) + pfatal_and_delete (outname); + +#ifdef MAIL_USE_SYSTEM_LOCK +#if defined (STRIDE) || defined (XENIX) || defined (WINDOWSNT) + /* Stride, xenix have file locking, but no ftruncate. This mess will do. */ + close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666)); +#else + ftruncate (indesc, 0L); +#endif /* STRIDE or XENIX */ +#endif /* MAIL_USE_SYSTEM_LOCK */ + +#ifdef MAIL_USE_MMDF + lk_close (indesc, 0, 0, 0); +#else + close (indesc); +#endif + +#ifndef MAIL_USE_SYSTEM_LOCK + /* Delete the input file; if we can't, at least get rid of its + contents. */ +#ifdef MAIL_UNLINK_SPOOL + /* This is generally bad to do, because it destroys the permissions + that were set on the file. Better to just empty the file. */ + if (unlink (inname) < 0 && errno != ENOENT) +#endif /* MAIL_UNLINK_SPOOL */ + creat (inname, 0600); +#endif /* not MAIL_USE_SYSTEM_LOCK */ + + exit (0); + } + + wait (&status); + if (!WIFEXITED (status)) + exit (1); + else if (WEXITSTATUS (status) != 0) + exit (WEXITSTATUS (status)); + +#if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK) + unlink (lockname); +#endif /* not MAIL_USE_MMDF and not MAIL_USE_SYSTEM_LOCK */ + +#endif /* ! DISABLE_DIRECT_ACCESS */ + + return 0; } - -static void -maybe_unlock_dot(void) -{ - if (dotlock_filename) - unlock_dot(dotlock_filename); -} - + /* Print error message and exit. */ static void fatal (char *s1, char *s2) { - maybe_unlock_dot(); + if (delete_lockname) + unlink (delete_lockname); error (s1, s2, NULL); exit (1); } @@ -700,12 +567,12 @@ fatal ("virtual memory exhausted", 0); return result; } - + /* This is the guts of the interface to the Post Office Protocol. */ #ifdef MAIL_USE_POP -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #include #include #include @@ -714,7 +581,7 @@ #include #endif #include -#include "../src/syspwd.h" +#include #define POP_ERROR (-1) #define POP_RETRIEVED (0) @@ -737,7 +604,7 @@ FILE *mbf; popserver server; - VERBOSE(("opening server\n")); + VERBOSE(("opening server\r")); server = pop_open (0, user, password, POP_NO_GETPASS); if (! server) { @@ -745,7 +612,7 @@ return (1); } - VERBOSE(("stat'ing messages\n")); + VERBOSE(("stat'ing messages\r")); if (pop_stat (server, &nmsgs, &nbytes)) { error (pop_error, NULL, NULL); @@ -770,8 +637,8 @@ error ("Error in open: %s, %s", strerror (errno), outfile); return (1); } -#if !defined(CYGWIN) && !defined(WIN32_NATIVE) - fchown (mbfi, getuid (), (gid_t) -1); +#if !defined(__CYGWIN32__) && !defined(WINDOWSNT) + fchown (mbfi, getuid (), -1); #endif if ((mbf = fdopen (mbfi, "wb")) == NULL) @@ -786,13 +653,13 @@ for (idx = 0; idx < nmsgs; idx++) { i = reverse ? nmsgs - idx : idx + 1; - VERBOSE(("checking message %d \n", i)); + VERBOSE(("checking message %d \r", i)); if (!regexp_pattern || pop_search_top (server, i, match_lines, regexp_pattern) == POP_RETRIEVED) { - VERBOSE(("retrieving message %d \n", i)); + VERBOSE(("retrieving message %d \r", i)); mbx_delimit_begin (mbf); if (pop_retr (server, i, mbx_write, mbf) != POP_RETRIEVED) { @@ -821,7 +688,7 @@ * directories have lost mail when over quota because these checks were * not made in previous versions of movemail. */ -#ifdef HAVE_FSYNC +#ifdef BSD if (fsync (mbfi) < 0) { error ("Error in fsync: %s", strerror (errno), NULL); @@ -841,7 +708,7 @@ { if (retrieved_list[i] == 1) { - VERBOSE(("deleting message %d \n", i)); + VERBOSE(("deleting message %d \r", i)); if (pop_delete (server, i)) { error (pop_error, NULL, NULL); @@ -863,7 +730,7 @@ } static int -pop_retr (popserver server, int msgno, int (*action)(char *, FILE *), FILE *arg) +pop_retr (popserver server, int msgno, int (*action)(), void *arg) { char *line; int ret; @@ -1009,7 +876,7 @@ #endif /* MAIL_USE_POP */ - + #ifndef HAVE_STRERROR char * strerror (int errnum) diff -r 12e008d41344 -r 697ef44129c6 lib-src/ootags.c --- a/lib-src/ootags.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/ootags.c Mon Aug 13 11:20:41 2007 +0200 @@ -64,18 +64,31 @@ # define DEBUG FALSE #endif -#ifdef WIN32_NATIVE +#ifdef MSDOS +# include +# include +# include +# ifndef HAVE_CONFIG_H +# define DOS_NT +# include +# endif +#endif /* MSDOS */ + +#ifdef WINDOWSNT # include # include # include # include # define MAXPATHLEN _MAX_PATH -# ifndef HAVE_CONFIG_H +# ifdef HAVE_CONFIG_H +# undef HAVE_NTGUI +# else +# define DOS_NT # define HAVE_GETCWD # endif /* not HAVE_CONFIG_H */ -#endif /* WIN32_NATIVE */ - -#if !defined (WIN32_NATIVE) && defined (STDC_HEADERS) +#endif /* WINDOWSNT */ + +#if !defined (WINDOWSNT) && defined (STDC_HEADERS) #include #include #endif @@ -91,6 +104,9 @@ #include #include #include +#ifndef errno + extern int errno; +#endif #include #include @@ -160,9 +176,9 @@ #ifdef OO_BROWSER #define set_construct(construct) \ if (!oo_browser_construct) oo_browser_construct = construct -void oo_browser_clear_all_globals(void); -void oo_browser_clear_some_globals(void); -void oo_browser_check_and_clear_structtype(void); +void oo_browser_clear_all_globals(); +void oo_browser_clear_some_globals(); +void oo_browser_check_and_clear_structtype(); #endif /* @@ -184,7 +200,7 @@ typedef int bool; -typedef void Lang_function (FILE *); +typedef void Lang_function (); typedef struct { @@ -844,7 +860,9 @@ int -main (int argc, char *argv[]) +main (argc, argv) + int argc; + char *argv[]; { int i; unsigned int nincluded_files; @@ -857,9 +875,9 @@ bool got_err; #endif -#ifdef WIN32_NATIVE +#ifdef DOS_NT _fmode = O_BINARY; /* all of files are treated as binary files */ -#endif /* WIN32_NATIVE */ +#endif /* DOS_NT */ progname = argv[0]; nincluded_files = 0; @@ -1051,12 +1069,12 @@ if (streq (tagfile, "-")) { tagf = stdout; -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* Switch redirected `stdout' to binary mode (setting `_fmode' doesn't take effect until after `stdout' is already open). */ if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); -#endif /* WIN32_NATIVE */ +#endif /* DOS_NT */ } else tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -1636,7 +1654,8 @@ #endif void -put_entries (node *np) +put_entries (np) + register node *np; { register char *sp; @@ -1870,7 +1889,9 @@ /* maximum key range = 117, duplicates = 0 */ static unsigned int -hash (char *str, unsigned int len) +hash (str, len) + register char *str; + register int unsigned len; { static unsigned char asso_values[] = { @@ -1888,13 +1909,13 @@ 10, 62, 59, 130, 28, 27, 50, 19, 3, 130, 130, 130, 130, 130, 130, 130, 130, 130, }; - return len + - asso_values[(unsigned char) str[2]] + - asso_values[(unsigned char) str[0]]; + return len + asso_values[str[2]] + asso_values[str[0]]; } -static struct C_stab_entry * -in_word_set (char *str, unsigned int len) +struct C_stab_entry * +in_word_set (str, len) + register char *str; + register unsigned int len; { static struct C_stab_entry wordlist[] = { @@ -2056,7 +2077,7 @@ #ifdef OO_BROWSER void -oo_browser_check_and_clear_structtype(void) +oo_browser_check_and_clear_structtype() { /* Allow for multiple enum_label tags. */ if (structtype != st_C_enum) @@ -2135,7 +2156,7 @@ #ifdef OO_BROWSER void -oo_browser_clear_all_globals(void) +oo_browser_clear_all_globals() { /* Initialize globals so there is no carry over between files. */ oo_browser_construct = C_NULL; @@ -2146,7 +2167,7 @@ } void -oo_browser_clear_some_globals(void) +oo_browser_clear_some_globals() { oo_browser_construct = C_NULL; structtype = st_none; @@ -3617,7 +3638,8 @@ * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' */ void -Asm_labels (FILE *inf) +Asm_labels (inf) + FILE *inf; { register char *cp; @@ -4947,7 +4969,7 @@ if (p > buffer && p[-1] == '\r') { p -= 1; -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* Assume CRLF->LF translation will be performed by Emacs when loading this file, so CRs won't appear in the buffer. It would be cleaner to compensate within Emacs; @@ -5203,6 +5225,19 @@ 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; @@ -5213,6 +5248,7 @@ pclose (pipe); return path.buffer; +#endif /* not MSDOS */ #endif /* not HAVE_GETCWD */ } @@ -5262,7 +5298,7 @@ if (filename_is_absolute (file)) res = savestr (file); -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* We don't support non-absolute file names with a drive letter, like `d:NAME' (it's too much hassle). */ else if (file[1] == ':') @@ -5286,8 +5322,8 @@ while (cp >= res && !filename_is_absolute (cp)); if (cp < res) cp = slashp; /* the absolute name begins with "/.." */ -#ifdef WIN32_NATIVE - /* Under Windows we get `d:/NAME' as absolute +#ifdef DOS_NT + /* Under MSDOS and NT we get `d:/NAME' as absolute file name, so the luser could say `d:/../NAME'. We silently treat this as `d:/NAME'. */ else if (cp[0] != '/') @@ -5342,7 +5378,7 @@ char *fn; { return (fn[0] == '/' -#ifdef WIN32_NATIVE +#ifdef DOS_NT || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') #endif ); @@ -5353,7 +5389,7 @@ canonicalize_filename (fn) register char *fn; { -#ifdef WIN32_NATIVE +#ifdef DOS_NT for (; *fn != '\0'; fn++) if (*fn == '\\') *fn = '/'; diff -r 12e008d41344 -r 697ef44129c6 lib-src/pop.c --- a/lib-src/pop.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/pop.c Mon Aug 13 11:20:41 2007 +0200 @@ -21,16 +21,23 @@ #ifdef HAVE_CONFIG_H #define NO_SHORTNAMES /* Tell config not to load remap.h */ -#define DONT_ENCAPSULATE -#include +#include <../src/config.h> #else #define MAIL_USE_POP #endif #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 WIN32_NATIVE +#ifdef WINDOWSNT #include #undef SOCKET_ERROR #define RECV(s,buf,len,flags) recv(s,buf,len,flags) @@ -60,22 +67,16 @@ extern struct servent *hes_getservbyname (/* char *, char * */); #endif -#include "../src/syspwd.h" -#ifndef WIN32_NATIVE +#include #include -#endif #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include -#ifndef WIN32_NATIVE #include -#endif #include "../src/syswait.h" -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #include "../src/systime.h" #endif #include @@ -102,7 +103,7 @@ #endif /* ! KRB5 */ #endif /* KERBEROS */ -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #if !defined(HAVE_H_ERRNO) || !defined(HAVE_CONFIG_H) extern int h_errno; #endif @@ -122,7 +123,7 @@ #define ERROR_MAX 80 /* a pretty arbitrary size */ #define POP_PORT 110 #define KPOP_PORT 1109 -#if defined(WIN32_NATIVE) || defined(CYGWIN) +#if defined(WINDOWSNT) || defined(__CYGWIN32__) #define POP_SERVICE "pop3" /* we don't want the POP2 port! */ #else #define POP_SERVICE "pop" @@ -183,7 +184,7 @@ username = getenv ("USER"); if (! (username && *username)) { -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT username = getlogin (); if (! (username && *username)) { @@ -252,7 +253,7 @@ if ((! password) && (! DONT_NEED_PASSWORD)) { -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT if (! (flags & POP_NO_GETPASS)) { password = getpass ("Enter POP password:"); @@ -921,7 +922,7 @@ ret = -1; } - CLOSESOCKET (server->file); + close (server->file); } if (server->buffer) @@ -931,7 +932,7 @@ return (ret); } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT static int have_winsock = 0; #endif @@ -976,7 +977,7 @@ int try_count = 0; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT { WSADATA winsockData; if (WSAStartup (0x101, &winsockData) == 0) @@ -1481,7 +1482,7 @@ } } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT if (have_winsock) WSACleanup (); #endif diff -r 12e008d41344 -r 697ef44129c6 lib-src/process-depends.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/process-depends.sh Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,68 @@ +## Process the output of makedepend. +## Copyright (c) 1994 Amdahl Corporation. +## Written by Ben Wing, December 1994. + +## This file is used as part of 'make depend', to produce the +## dependency list for src/Makefile.in.in. + +## Unfortunately, makedepend (at least the one that comes as part +## of Open Windows under Solaris) is stupid and doesn't follow the +## documented behavior. So we have to force the definitions of +## certain options through -D flags (even though it's supposed to +## pick this up), and post-process the output to get rid of stuff +## we don't want. + +## The sed stage gets rid of include files in other directories, +## except for lwlib.h (makedepend puts system include files in, +## which is pretty stupid). We also get rid of some standard +## include files that are in every or pretty much every file +## and where changes in those files don't usually merit +## recompilation of everything. Finally, we eliminate entirely +## the dependencies for some files (such as unex*.c) that get +## screwed up by makedepend. We just put those in by hand at +## the top of the dependency list. + +## For Mule, we need to do some additional processing: conversion +## to MULESRCDIR (at least so that the include files don't get +## wiped out by the next stage) and removing the mule/ prefix +## from the object file names. + +## The awk stage puts one dependency per line. Then we pass +## the result through sort and uniq (makedepend is supposed +## to not put in duplicate dependencies, but it does so +## occasionally). + +## After running 'make depend', verify that the output (in +## depend.out) is reasonable and then replace the stuff in +## Makefile.in.in marked "generated by 'make depend'". + +sed -e ' +1d +s/ \/[^ ]*\/lwlib\// $(LWLIBSRCDIR)\//g +s/\.\.\/etc\//${srcdir}\/${etcdir}/g +s/^mule\///g +s/ mule\// $(MULESRCDIR)\/mule\//g +s/ \/[^ ]*\.h//g +s/ \/[^ ]*gray//g +s/ [a-z][^ ]*\/[^ ]*\.h//g +s/ lisp\.h//g +s/ lisp-union\.h//g +s/ lisp-disunion\.h//g +s/ lrecord\.h//g +s/ emacsfns\.h//g +s/ symeval\.h//g +s/ symsinit\.h//g +s/ syssignal\.h//g +s/ intl\.h//g +s/ tt_c\.h//g +s/ descrip\.h//g +/^unex/d +/^sgiplay/d +/^Extern/d +/^extw/d +/^[^ ]*\.o:$/d +' | awk ' +{ for (i = 2; i <= NF; i++) + printf ("%s %s\n", $1, $i) +} +' | sort | uniq diff -r 12e008d41344 -r 697ef44129c6 lib-src/process-gnu-depends.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/process-gnu-depends.sh Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,49 @@ +#!/bin/sh + +perl -e ' +while (<>) +{ + chop; + $foo .= $_; + if (!/\\$/) + { + @foo = split (/[ \\:\n]+/, $foo); + $filename = $foo[0]; + if (($filename =~ /^unex/) || + ($filename =~ /^sgiplay/) || + ($filename =~ /^Extern/) || + ($filename =~ /^extw/)) + { + $foo = ""; + next; + } + @foo = grep (!/\.c$/, @foo); + @foo = grep ((s/\/.*lwlib\//\$(LWLIBSRCDIR)\//, 1), @foo); + @foo = grep (!/lisp\.h/, @foo); + @foo = grep (!/lisp\.h/, @foo); + @foo = grep (!/lisp-union\.h/, @foo); + @foo = grep (!/lisp-disunion\.h/, @foo); + @foo = grep (!/lrecord\.h/, @foo); + @foo = grep (!/emacsfns\.h/, @foo); + @foo = grep (!/symeval\.h/, @foo); + @foo = grep (!/symsinit\.h/, @foo); + @foo = grep (!/syssignal\.h/, @foo); + @foo = grep (!/intl\.h/, @foo); + @foo = grep (!/tt_c\.h/, @foo); + @foo = grep (!/descrip\.h/, @foo); + shift @foo; + if (!$#foo) + { + next; + } + foreach $i (0 .. $#foo) + { + $foo[$i] = $filename . ": " . $foo[$i]; + } + print $filename . ": config.h\n"; + print join ("\n", @foo); + print "\n"; + $foo = ""; + } +} +' | sort | uniq \ No newline at end of file diff -r 12e008d41344 -r 697ef44129c6 lib-src/profile.c --- a/lib-src/profile.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/profile.c Mon Aug 13 11:20:41 2007 +0200 @@ -32,7 +32,7 @@ ** abstraction : a stopwatch ** operations: reset_watch, get_time */ -#include +#include <../src/config.h> #include #include #include "../src/systime.h" @@ -41,7 +41,7 @@ static int watch_not_started = 1; /* flag */ static char time_string[30]; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #include /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ void diff -r 12e008d41344 -r 697ef44129c6 lib-src/pstogif --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/pstogif Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,189 @@ +: # -*-Perl-*- +eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge + if 0; +# +# pstogif.pl v1.0, July 1994, by Nikos Drakos +# Computer Based Learning Unit, University of Leeds. +# +# Accompanies LaTeX2HTML Version 96.1 +# +# Script to convert an arbitrary PostScript image to a cropped GIF image +# suitable for incorporation into HTML documents as inlined images to be +# viewed with WWW browsers. +# +# This is based on the pstoepsi script +# by Doug Crabill dgc@cs.purdue.edu +# +# Please note the following: +# - The source PostScript file must end +# in a .ps extention. This is a GhostScript requirement, not mine... +# - The -density argument has no effect unless the +# color depth (set with the -depth argument) is equal to 1. +# - Valid arguments for -depth are 1,8, or 24. +# +# This software is provided as is without any guarantee. +# +# Nikos Drakos (ND), nikos@cbl.leeds.ac.uk +# Computer Based Learning Unit, University of Leeds. +# +# 15 Jan 96 HS Call ppmquant only if needed. Fixed bug relative to +# V 95.3 . +# +# 15 Dec 95 HS (Herbert Swan Added support for +# the flip=option. This allows images to be oriented differently +# in the paper versus the electronic media +# +# 1 Nov 95 jmn - modified for use with gs ppm driver - from jhrg's patches +# note that ppmtops.ps and ppmtops3.ps are no longer needed +# +# 20 JUL 94 ND Converted to Perl and made several changes eg it now accepts +# parameters from environment variables or from command line or will use +# default ones. +# +# 1 APR 94 ND Changed the suffixes of multi-page files from xbm to gif (oops!) +# +# + +##################################################################### +$| =1; +&read_args; + +### You may need to specify some pathnames here if you want to +### run the script without LaTeX2HTML + +# Ghostscript +$GS= $ENV{'GS'} || 'gs'; + +# Comes with LaTeX2HTML (For ghostscript versions greater than 3.0 +# you need the newer pstoppm.ps) +#$PSTOPPM= $ENV{'PSTOPPM'} || +# 'pstoppm.ps'; + +# Available in the PBMPLUS library +$PNMCROP=$ENV{'PNMCROP'} || 'pnmcrop' ; + +# Also in PBMPLUS +$PNMFLIP=$ENV{'PNMFLIP'} || 'pnmflip' ; + +# Also in PBMPPLUS +$PPMTOGIF=$ENV{'PPMTOGIF'} || 'ppmtogif' ; + +# Also in PBMPPLUS +$REDUCE_COLOR=$ENV{'PPMQUANT'} || 'ppmquant 256' ; + +$OUTFILE = $ENV{'OUTFILE'} || $out; + +# Valid choices for $COLOR_DEPTH are 1, 8 or 24. +$DEPTH = $ENV{'DEPTH'} || $depth || 24; + +#Default density is 72 +$DENSITY = $ENV{'DENSITY'} || $density || 72; + +# Valid choices are any numbers greater than zero +# Useful choices are numbers between 0.1 - 5 +# Large numbers may generate very large intermediate files +# and will take longer to process +$SCALE = $ENV{'SCALE'} || $scale; # No default value + +$PAPERSIZE = $ENV{'PAPERSIZE'} || $papersize; # No default value; + +$DEBUG = $ENV{'DEBUG'} || $DEBUG || 0; + +###################################################################### + +&main; + +sub read_args { + local($_); + local($color); + while ($ARGV[0] =~ /^-/) { + $_ = shift @ARGV; + if (/^-h(elp)?$/) { + &usage; exit} + elsif (/^-out$/) { + $out = shift @ARGV; + } + elsif (/^-(.*)$/) { + eval "\$$1 = shift \@ARGV"; # Create and set a flag $ + } + } +} + +sub main { + local($base, $outfile, $i, $j); + $base = &test_args; + $outfile = $OUTFILE || "$base.gif"; + open(STDERR, ">/dev/null") unless $DEBUG; + &convert($base); + if (-f "$base.ppm") { + &crop_scale_etc("$base.ppm", $outfile); + } + else { + foreach $i (<$base.[1-9]*ppm>) { + $j = $i; + $j =~ s/\.(.*)ppm/$1.gif/; + &crop_scale_etc($i, $j)} + } + &cleanup($base); +} + +sub crop_scale_etc { + local($in, $out) = @_; + local($tmp) = $in . ".tmp"; + open(STDERR, ">/dev/null") unless $DEBUG; + + if ($flip) { + rename($tmp, $in) unless system("$PNMFLIP -$flip $in > $tmp"); + } + system("$PNMCROP $in > $tmp"); + + if (system("$PPMTOGIF $tmp > $out")) { + print "Running ppmquant for $out\n"; + system("$REDUCE_COLOR < $tmp|$PPMTOGIF - > $out"); + } + unlink $tmp; + print "Writing $out\n"; +} + +sub test_args { + local($file) = $ARGV[0]; + if (! ($file =~ s/\.ps$//)) { + print "The name of the input file must end in '.ps'\n"; + exit} + elsif (! ( -f "$file.ps")) { + print "Cannot find file $file.ps\n."; + exit} + elsif (! ($DEPTH =~ /^(1|8|24)$/)) { + print "The color depth must be 1 or 8 or 24. You specified $DEPTH\n"; + exit + } + if (defined $SCALE) { + if ($SCALE > 0) { + $DENSITY = int($SCALE * $DENSITY)} + else { + print "Error: The scale must be greater than 0.\n" . + "You specified $SCALE\n"; + exit} + } + $file; +} + +sub convert { + local($base) = @_; + local($paperopt) = "-sPAPERSIZE=$PAPERSIZE" if $PAPERSIZE; + local($ppmtype) = join('', "ppm",$DEPTH,"run"); + local($density) = "-r$DENSITY" if ($DENSITY != 72); + open (GS, "|$GS -q -dNOPAUSE -dNO_PAUSE -sDEVICE=ppmraw $density -sOutputFile=$base.ppm $paperopt $base.ps"); + close GS; +} + +sub cleanup { + local($base) = @_; + unlink <$base[0-9.]*ppm>; +} + +sub usage { + print "Usage: pstogif [-h(elp)] [-out ] [-depth ] [-flip ] [-density ] .ps\n\n"; +} + + diff -r 12e008d41344 -r 697ef44129c6 lib-src/run.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/run.c Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,709 @@ +/* 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,j; + char exec[MAX_PATH + FILENAME_MAX + 100]; + char cmdline2[MAX_ARGS * MAX_PATH]; + + 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]; + char tmp[MAX_PATH + FILENAME_MAX + 100]; + 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 12e008d41344 -r 697ef44129c6 lib-src/run.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/run.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,100 @@ +// #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 12e008d41344 -r 697ef44129c6 lib-src/run.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib-src/run.rc Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,30 @@ +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 12e008d41344 -r 697ef44129c6 lib-src/sorted-doc.c --- a/lib-src/sorted-doc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/sorted-doc.c Mon Aug 13 11:20:41 2007 +0200 @@ -7,22 +7,33 @@ /* Synched up with: FSF 19.28. */ -#include +#include <../src/config.h> #include #include -#include /* for qsort() and malloc() */ -#include -static void *xmalloc (size_t); +#if __STDC__ || defined(STDC_HEADERS) +# include /* for qsort() and malloc() */ +# include +static void *xmalloc (int); +# ifndef CONST +# define CONST const +# endif +#else +extern char *malloc (); +static void *xmalloc (); +# ifndef CONST +# define CONST +# endif +#endif #define NUL '\0' #define MARKER '\037' #define DEBUG 0 -typedef struct LINE LINE; +typedef struct line LINE; -struct LINE +struct line { LINE *next; /* ptr to next or NULL */ char *line; /* text of the line */ @@ -61,9 +72,9 @@ /* Like malloc but get fatal error if memory is exhausted. */ static void * -xmalloc (size_t size) +xmalloc (int size) { - void *result = malloc (size); + char *result = malloc ((unsigned)size); if (result == NULL) fatal ("%s", "virtual memory exhausted"); return result; @@ -72,9 +83,9 @@ static char * strsav (char *str) { - char *buf = (char *) xmalloc (strlen (str) + 1); - strcpy (buf, str); - return buf; + char *buf = xmalloc (strlen (str) + 1); + (void) strcpy (buf, str); + return (buf); } /* Comparison function for qsort to call. */ @@ -93,7 +104,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" }; @@ -198,7 +209,12 @@ /* sort the array by name; within each name, by type */ qsort ((char*)array, cnt, sizeof (DOCSTR*), - (int (*)(const void *, const void *)) cmpdoc); + /* 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); /* write the output header */ diff -r 12e008d41344 -r 697ef44129c6 lib-src/update-autoloads.sh --- a/lib-src/update-autoloads.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/update-autoloads.sh Mon Aug 13 11:20:41 2007 +0200 @@ -58,7 +58,6 @@ echo "Rebuilding autoloads in $CANON_PWD" echo " with $REAL..." -#### echon really sucks! if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then echon() { diff -r 12e008d41344 -r 697ef44129c6 lib-src/update-elc.sh --- a/lib-src/update-elc.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/update-elc.sh Mon Aug 13 11:20:41 2007 +0200 @@ -48,7 +48,6 @@ echo " (using $EMACS)" # fuckin' sysv, man... -# Nuke this function... if [ "`uname -r | sed 's/[^0-9]*\([0-9]*\).*/\1/'`" -gt 4 ]; then echon() { diff -r 12e008d41344 -r 697ef44129c6 lib-src/wakeup.c --- a/lib-src/wakeup.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/wakeup.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,25 +1,23 @@ /* Program to produce output at regular intervals. */ -#include +#include <../src/config.h> #if __STDC__ || defined(STDC_HEADERS) #include -#ifdef HAVE_UNISTD_H #include #endif -#endif #include #include -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #define WIN32_LEAN_AND_MEAN #include #undef sleep #define sleep(t) Sleep ((t) * 1000) #define getppid() (0) #undef HAVE_SYS_TIME_H -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ #ifdef TIME_WITH_SYS_TIME #include diff -r 12e008d41344 -r 697ef44129c6 lib-src/yow.c --- a/lib-src/yow.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lib-src/yow.c Mon Aug 13 11:20:41 2007 +0200 @@ -10,7 +10,7 @@ /* Synched up with: FSF 19.28. */ #define DONT_ENCAPSULATE -#include +#include <../src/config.h> #include #include @@ -33,7 +33,7 @@ void yow (FILE *fp); void setup_yow (FILE *fp); -#ifdef WIN32_NATIVE +#ifdef MSDOS #define rootrelativepath(rel) \ ({\ static char res[BUFSIZE], *p;\ @@ -91,7 +91,8 @@ /* Sets len and header_len */ void -setup_yow (FILE *fp) +setup_yow(fp) + FILE *fp; { int c; @@ -119,7 +120,8 @@ /* go to a random place in the file and print the quotation there */ void -yow (FILE *fp) +yow (fp) + FILE *fp; { long offset; int c, i = 0; diff -r 12e008d41344 -r 697ef44129c6 lisp/.cvsignore --- a/lisp/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/.cvsignore Mon Aug 13 11:20:41 2007 +0200 @@ -1,2 +1,1 @@ -ChangeLog.font-menu finder-inf.el diff -r 12e008d41344 -r 697ef44129c6 lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,3669 +1,3 @@ -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 unneccessary 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. - -2000-02-07 Martin Buchholz - - * cl-extra.el (getf): Just call `get', never `get*'. - Make arglist match docstring. - Fix bug: (getf nil t t) ==> Lisp nesting exceeds `max-lisp-eval-depth' - * cl-macs.el (get* compiler macro): Simply replace `get*' by `get'. - * byte-optimize.el: remove references to `get*'. - -2000-02-06 Martin Buchholz - - * mule/european.el: Add syntax information for Latin3 and Latin4. - -2000-02-02 Martin Buchholz - - * byte-optimize.el: Byte-optimize (length "foo") - -2000-02-03 Daiki Ueno - - * window.el (shrink-window-if-larger-than-buffer): Rewrite full - width check using `window-leftmost-p' and `window-rightmost-p'. - -2000-02-02 Per Abrahamsen - - * wid-edit.el (widget-match-inline): An atom never matches a - list. - -2000-01-29 Kirill 'Big K' Katsnelson - - * modeline.el: Consolidated 'x and 'mswindows specification under - 'win tag. - -2000-01-29 Andy Piper - - * gutter-items.el: (format-buffers-tab-line): Try and be - intelligent about buffer naming when we have duplicates. - -2000-01-29 Andy Piper - - * gutter-items.el (gutter-visible-p): Make sure the gutter gets - updated when it becomes visible. - -2000-01-26 Kirill 'Big K' Katsnelson - - * bytecomp.el (byte-compile-insert-header): Properly set coding - system under MULE and file-coding. - -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): - Never undefine coding system aliases. Emergency fix for gnus. - -2000-01-26 Hrvoje Niksic - - * files.el (abbreviate-file-name): Use directory-sep-char instead - of hard-coded "/". - -2000-01-27 Hrvoje Niksic - - * startup.el (user-init-file-base-list): New variable, replacing - user-init-file-base. - (find-user-init-file): New function. - (command-line-early): Use it. - (load-user-init-file): Ditto. - -2000-01-26 Kirill 'Big K' Katsnelson - - * gutter-items.el (update-tab-in-gutter): Use proper locale when - calling valid-image-instantiator-format-p - -2000-01-26 Hrvoje Niksic - - * isearch-mode.el (isearch-mode): The variable is - isearch-unhidden-extents, not isearch-opened-extents. - -2000-01-26 Hrvoje Niksic - - * minibuf.el (next-history-element): Modify error message if a - default value is available. - -2000-01-26 Martin Buchholz - - * bytecomp.el (byte-compile-file): Don't unconditionally write - .elc files in binary - might contain non-Latin1. - -2000-01-24 Kirill 'Big K' Katsnelson - - * 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): - * 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: - * bytecomp.el (byte-compile-file): Removed reference to - buffer-file-type, and commented usage of binary-process-output - NTEmacs variables. - -2000-01-24 Yoshiki Hayashi - - * help.el (function-arglist): Add case for macro. - -2000-01-22 Kirill 'Big K' Katsnelson - - * cus-edit.el (custom-display): Removed "MS-DOS" and added Windows - printers. - (custom-display): Added a menu for printer/display tags. - - * frame.el (frame-type): - * device.el (device-type): Added 'msprinter to the doc string, and - removed 'pc -- it is not going to be implemented ever. - (call-device-method): Fixed docstring typo. - Defined specifier tags 'printer and 'display. - -2000-01-22 Kyle Jones - - * lisp/itimer.el (itimer-run-expired-timers): (consp - last-command-event-time) instead of (consp - 'last-command-event-time). - -2000-01-21 Kirill 'Big K' Katsnelson - - * msw-glyphs.el: Removed obsolete commentary. - -2000-01-21 Hrvoje Niksic - - * minibuf.el (read-file-name): Use abbreviate-file-name to produce - better default value. - -2000-01-21 Hrvoje Niksic - - * minibuf.el (read-expression): Add a DEFAULT-VALUE argument. - (read-string): Ditto. - (eval-minibuffer): Ditto. - (read-command): Ditto. - (read-function): Ditto. - (read-variable): Ditto. - (read-number): Ditto. - (read-shell-command): Ditto. - (read-number): Record history. - -2000-01-20 Yoshiki Hayashi - - * etags.el (find-tag-tag): Use DEFAULT of completing-read. - -2000-01-20 Yoshiki Hayashi - - * faces.el (startup-initialize-custom-faces): New function. - Reset all faces created during auto-autoloads loading time - by defface. - * startup.el (command-line): Call it. - -2000-01-19 Yoshiki Hayashi - - * about.el (about-hackers): Add myself to contributors list. - -2000-01-12 Kirill 'Big K' Katsnelson - - * menubar-items.el (maybe-add-init-button): Removed an argument in - a call to load-user-init-file, as the function managed to lose its - formal parameter a few betas ago. - -2000-01-18 Martin Buchholz - - * XEmacs 21.2.27 is released. - -2000-01-18 Martin Buchholz - - * process.el (shell-command-to-string): Use the FSF docstring. - Make shell-command-to-string the standard function, and - exec-to-string the (deprecated) alias. - - * startup.el: typo fix. - -2000-01-16 Martin Buchholz - - * mule/mule-misc.el (char-octet): Move back into mule-charset.c. - -2000-01-14 Yoshiki Hayashi - - * menubar-items.el (sort-buffers-menu-alphabetically): Put invisible - buffers after visible buffers. - (sort-buffers-menu-by-mode-then-alphabetically): Ditto. - -2000-01-17 Yoshiki Hayashi - - * info.el (Info-extract-menu-node-name): Stop at a dot - followed by whitespace or right parenthesis. - -2000-01-15 Hrvoje Niksic - - * info.el (Info-directory-list): Warn against using Customize with - Info-directory-list. - -2000-01-15 Adrian Aichner - - * minibuf.el (read-file-name): doc fix. - - * autoload.el (update-file-autoloads): doc fix. - - * about.el (about-hackers): Change my E-mail address. - -2000-01-13 Martin Buchholz - - * info.el (Info-visit-file): Just use the `f' interactive spec to - read a filename in the standard way. - -2000-01-13 Andy Piper - - * gutter-items.el (gutter-buffers-tab-orientation): new variable. - (gutter-buffers-tab-extent): new variable. - (update-tab-in-gutter): call add-tab-to-gutter again if the - orientation has changed. - (add-tab-to-gutter): cope with different orientations. - -2000-01-11 Didier Verna - - * info.el (Info-following-node-name): backward-skip dots as well - as spaces (dots at the end of a node name aren't part of it). - (Info-extract-menu-node-name): don't skip dots. There could be - some in the node name. - (Info-index): allow dots to be part of a node name. - -2000-01-12 Andreas Jaeger - - * files.el (auto-mode-alist): Added idlwave-mode. - Patch by Carsten Dominik . - -1999-12-22 Yoshiki Hayashi - - * info.el (Info-search): Show default value. - -1999-12-20 Yoshiki Hayashi - - * info.el (Info-read-node-completion-table): New variable. - (Info-read-node-name-1): New function. - (Info-read-node-name): Use it. - (Info-follow-reference): Use DEFAULT argument of completing-read. - (Info-menu): Ditto. - -1999-12-27 Yoshiki Hayashi - - * hyper-apropos.el (hyper-describe-key-briefly): Save - window configuration. - (hyper-describe-face): Use DEFAULT of completing-read. - (hyper-apropos-read-variable-symbol): Ditto. - (hyper-apropos-read-function-symbol): Ditto. - -1999-12-27 Yoshiki Hayashi - - * mule/mule-cmds.el (set-default-coding-system): Set - comint-exec-hook to use coding-system-for-read and - coding-system-for-write so that C-x RET c works. - -1999-12-27 Yoshiki Hayashi - - * minibuf.el (minibuffer-confirm-incomplete): Customize. - (previous-matching-history-element): Increment - minibuffer-max-depth by 1. - (next-matching-history-element): Ditto. - -2000-01-11 Andy Piper - - * gutter-items.el (buffers-tab): Create a new face for the buffers - tab. - (buffers-tab-face): use it. - -2000-01-10 Didier Verna - - * modeline.el (modeline-scrolling-method): change modeline X - cursor appearance according to the value. - -2000-01-07 Andreas Jaeger - - * about.el (about-hackers): Moved my entry to contributor list. - (xemacs-hackers): Added myself. - (about-maintainer-info): Added description of myself. - - -2000-01-07 Didier Verna - - * modeline.el (modeline-scrolling-method): new variable. - (mouse-drag-modeline): add reference to it in the docstring. - (mouse-drag-modeline): handle it. - -2000-01-08 Andy Piper - - * gutter-items.el (update-tab-in-gutter): remove resize-subwindow - calls. - (remove-buffer-from-gutter-tab): ditto. - -2000-01-06 Per Abrahamsen - - * cus-edit.el (custom-hook-convert-widget): Fix comment. - (custom-face-edit): Fix grammatical error in help message. - -2000-01-03 Michael Sperber [Mr. Preprocessor] - - * movemail.el: Added. - - * dumped-lisp.el (preloaded-file-list): Added movemail.el. - -2000-01-03 Didier Verna - - * modeline.el (mouse-drag-modeline): remove the code related to - the modeline horizontal scrolling facility. - -1999-12-31 Martin Buchholz - - * XEmacs 21.2.26 is released. - -1999-12-28 Andy Piper - - * wid-edit.el (widget-push-button-value-create): The gui cache - does not agree with native widgets which can only be displayed - once per window. The reasons for caching are diminished now that - we don't hog resources when creating buttons. - (widget-push-button-cache) deleted. - -1999-12-24 Martin Buchholz - - * XEmacs 21.2.25 is released. - -1999-12-24 Yoshiki Hayashi - - * hyper-apropos.el (hyper-apropos): Toggle - hyper-apropos-programming-apropos correctly. - Set REGEXP when user accepts default value. - -1999-12-22 Yoshiki Hayashi - - * minibuf.el (read-from-minibuffer): Bind minibuffer-default. - (read-file-name-2): Use DEFAULT argument of read-from-minibuffer. - -1999-12-22 Yoshiki Hayashi - - * mule/mule-category.el (undefined-category-designator): - Return char instead of character. Search for undefined one. - (describe-category): Use with-displaying-help-buffer. - -1999-12-21 Martin Buchholz - - * byte-optimize.el (byte-optimize-plus): - Optimize (+ 1) to 1 instead of (1+ nil). - - * files.el (basic-save-buffer): Rewrite for clarity. Use (char-before). - - * byte-optimize.el (byte-compile-butlast): Remove. Use butlast instead. - - * byte-optimize.el (byte-optimize-char-before): New function. - Remove performance penalty for using (char-before) instead of (char-after). - -1999-12-20 Yoshiki Hayashi - - * mule/mule-category.el (char-category-list): Return character - instead of integer. - -1999-12-17 Yoshiki Hayashi - - * minibuf.el (read-buffer): Check default is buffer object. - -1999-11-25 Andy Piper - - * cus-edit.el (custom-buffer-create-buttons): Use native widgets - for buttons. - -1999-12-16 Andreas Jaeger - - * package-get.el (package-get-maybe-save-index): Fixed typo. - Patch by Jeff Miller . - -1999-12-13 Charles G Waldman - - * gnuserv.el (gnuserv-process-filter): don't call - gnuserv-write-to-client when gnuserv-current-client is nil - -1999-12-14 Martin Buchholz - - * XEmacs 21.2.24 is released. - -1999-12-12 Gunnar Evermann - - * about.el (about-hackers): Update my email address. - -1999-12-07 Martin Buchholz - - * XEmacs 21.2.23 is released. - -1999-11-06 Jason R Mastaler - - * package-get.el (package-get-download-sites): Removed several - defunct download sites, added many new ones, and corrected a few - incorrect directory-on-site entries. Added physical locations to - site-description. - -1999-11-30 Gunnar Evermann - - * finder.el (finder-commentary): add DOC string and fix - interactive spec - -1999-12-04 Hrvoje Niksic - - * help.el (describe-function): Don't forget to intern the string - completing-read returns. - (describe-variable): Ditto. - -1999-11-16 Adrian Aichner - - * hyper-apropos.el (hyper-apropos-this-symbol): Handle - `hyper-apropos-help-mode' here to find symbol to customize - irregardless of cursor position and simplify - `hyper-apropos-set-variable', `hyper-apropos-find-function', and - `hyper-apropos-popup-menu'. - -1999-11-21 Yoshiki Hayashi - - * apropos.el (apropos-mode-map): Add return to call - apropos-follow. - (apropos-print): Call apropos-mode to have better - command reference. Put keymap text-poperty to - symbole name. - -1999-11-22 Alastair Burt - - * help.el: (describe-bindings-1): Added handling of keymaps for - the extents at point. - -1999-12-02 Mark Thomas - - * gutter-items.el (buffers-tab-items): Wrap the function in a - save-match-data - -1999-12-04 Hrvoje Niksic - - * help.el (describe-function): Use the DEFAULT argument to - completing-read. - (describe-variable): Ditto. - -1999-11-26 Yoshiki Hayashi - - * minibuf.el (read-from-minibuffer): Add optional argument - DEFAULT to have better mini-buffer history support. - (completing-read): Pass default to read-from-minibuffer. - (read-buffer): Pass default to completing-read. - -1999-12-04 Hrvoje Niksic - - * font-lock.el (font-lock-doc-string-face): Document the - `font-lock-lisp-like' property. - -1999-11-29 Hrvoje Niksic - - * lisp-mode.el: Specify `font-lock-lisp-like'. - - * font-lock.el (font-lock-lisp-like): New function. - (font-lock-fontify-syntactically-region): Use it. - -1999-11-29 XEmacs Build Bot - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz - - * XEmacs 21.2.21 is released. - -1999-11-18 Yoshiki Hayashi - - * minibuf.el (read-coding-system): Accept symbol and - coding-system object as a default-coding-system. - -1999-11-16 Yoshiki Hayashi - - * minibuf.el (read-coding-system): Accept symbol as - a default-coding-system. - -1999-10-06 Yoshiki Hayashi - - * apropos.el (apropos-documentation): Use insert instead - of princ. - -1999-11-07 William M. Perry - - * gpm.el: New gpm-minor-mode to turn GPM mouse support on & off - for the linux console. - - * mouse.el (mouse-consolidated-yank): Allow the mouse-yanking - stuff to work when you are not on a window system, since the GPM - mouse support now allows pasting from outside of XEmacs. - -1999-11-10 XEmacs Build Bot - - * XEmacs 21.2.20 is released - -1999-11-06 Hrvoje Niksic - - * setup-paths.el (paths-default-info-directories): Add - /usr/share/info and /usr/local/share/info. - -1999-10-30 Hrvoje Niksic - - * about.el: Updated Vladimir Ivanovic's info. - -11999-08-28 Jan Vroonhof - - * auto-show.el (auto-show-truncationp): Remove. - - * auto-show.el (auto-show-should-take-action-p): Use window-truncated-p - -999-09-23 Gunnar Evermann - - * indent.el (indent-line-to): fix bug: spaces were not replaced - with tab if column is multiple of tab-width - From dhn@qedinc.com - -1999-10-24 Jan Vroonhof - - * mule/mule-cmds.el (read-input-method-name): Accept symbols - correctly. Patch from Mikio Nakajima - - * package-get.el (package-get-package-provider): Be verbose when - interactive. Patch from Robert Pluim - -1999-08-23 Mike McEwan - - * info.el (Info-suffix-list): Add ".info.bz2" to the recognised - info file suffixes. - -1999-08-19 Stephen Tse - - * process.el (open-network-stream): Add a new optional parameter - PROTOCOL to support udp; fix a minor typo and add an explanation - in docstring for udp programming. - - * code-process.el (open-network-stream): Add a new optional - parameter PROTOCOL to support udp; fix a minor typo and add an - explanation in docstring for udp programming. - -1999-10-18 Andy Piper - - * gui.el (make-gui-button): be more precise about how we call - callbacks. - - * wid-edit.el (widget-push-button-value-create): Use the new form - of native gui-button. - -1999-10-14 Yoshiki Hayashi - - * info.el (Info-page-prev): Don't do (sit-for 0). - -1999-10-13 Andy Piper - - * gutter-items.el (progress-abort-glyph): new glyph for showing - abort status. - (append-progress): dispatch-event rather than sit-for. - (abort-progress): new function. Show the abort glyph with an - appropriate message. - (raw-append-progress): dispatch-event rather than sit-for. - (display-progress): cope with aborts. - - * gui.el (make-gui-button): Use native widgets for buttons - unconditionally. - (insert-gui-button): ditto. - (gui-button-p): ditto. - - * xbm-button.el: remove from core. - - * xpm-button.el: remove from core. - -1999-10-07 Olivier Galibert - - * faces.el (init-device-faces): Don't initialize the random faces - on the stream device. - -1999-10-06 Andy Piper - - * files.el (recover-file): Don't use ls under windows for revert buffer. - -1999-09-25 Adrian Aichner - - * package-get.el (package-get-download-menu): Make menu really - toggle download sites. - (package-get-download-sites): Add autoload cookie. - -1999-09-29 Michael Sperber [Mr. Preprocessor] - - * setup-paths.el (paths-find-module-directory): Ditto. - -1999-09-29 Werner Fink - - * setup-paths.el (paths-find-exec-directory): Add missing nil - parameter for environment. - -1999-09-27 Martin Buchholz - - * modeline.el (modeline-format): - Only purecopy the strings. Else - (nsublis '(("%p" . "%P")) (default-value 'modeline-format) :test 'equal) - barfs. - -1999-08-28 Mike Woolley - - * winnt.el: Removed nt-shell-mode-hook, which was preventing the - user setting comint-completion-addsuffix and - comint-process-echoes. - -1999-09-22 Andy Piper - - * gutter-items.el (update-tab-in-gutter): use - last-nonminibuf-window instead of selected-window. - -1999-09-18 Andy Piper - - * gnuserv.el (gnuserv-edit-files): select frame we are going to - display on. - - * subr.el (record-buffer-hook): new variable so that the hook gets - some documentation. - -1999-09-16 Andy Piper - - * gutter-items.el (update-tab-in-gutter): only update when the - gutter is visible. - (remove-buffer-from-gutter-tab): ditto. - -1999-09-17 Hrvoje Niksic - - * simple.el (do-auto-fill): Commented out part of Kinsoku - processing. - -1999-09-14 Hrvoje Niksic - - * isearch-mode.el (isearch-highlightify-region): Give the - highlighting extents a high priority. - (isearch-make-extent): Give the main highlighting extent an even - higher priority. - -1999-09-13 Michael Sperber [Mr. Preprocessor] - - * packages.el (packages-compute-package-locations): Fix typo from - -u rationalization. - -1999-09-11 Michael Sperber [Mr. Preprocessor] - - * setup-paths.el (paths-find-doc-directory): Respect value of - `configure-doc-directory.' - - * find-paths.el (paths-find-architecture-directory): Give - precendence `default' argument (which typically comes from - configure). - -1999-09-05 Michael Sperber [Mr. Preprocessor] - - * startup.el (command-line-early): Added options -user-init-file - and -user-init-directory. - - * files.el (user-init-file): Default to NIL so we can recognize - when it's set. - -1999-08-30 Michael Sperber [Mr. Preprocessor] - - * obsolete.el (init-file-user): - * startup.el: - * packages.el (packages-compute-package-locations): - * package-get.el (package-get-user-index-filename): - * menubar-items.el (maybe-add-init-button): - * info.el (Info-annotations-path): - * dump-paths.el: - Change `user-init-directory' to be an absolute path. - Use `user-init-directory' where appropriate. - Zap `init-file-user' and its uses. - -1999-09-09 Hrvoje Niksic - - * subr.el (copy-symbol): New function. - -1999-09-08 Hrvoje Niksic - - * isearch-mode.el (isearch-done): Be sure to restore invisible - extents in the proper buffer. - (isearch-pre-command-hook): Set this-command to the correct value - in case the buffer has changed and old overriding-local-map was - used. - (isearch-restore-extent): Use remprop instead of setting the - property to nil. - -1999-09-08 Hrvoje Niksic - - * cmdloop.el (execute-extended-command): Update zmacs region - before the delay. - (execute-extended-command): Make the message gettext-friendly. - -1999-09-07 Andy Piper - - * gutter-items.el (progress-gauge-glyph): renamed from - progress-glyph. - (progress-text-glyph): new variable. - (progress-layout-glyph): use layouts and text glyphs. - (progress-area-buffer): removed. - (progress-text-and-extent): new variable. - (progress-displayed-p): dynamically create gutter area buffer. - (clear-progress): ditto. - (raw-append-progress): ditto. - (append-progress): use new glyph names. - (raw-append-progress): only create the extent when needed. set - properties more optimally. - (progress): remove args. - -1999-09-07 Hrvoje Niksic - - * isearch-mode.el (isearch-range-invisible): Use mapc instead of - mapcar where the return value is unused. - (isearch-restore-invisible-extents): Ditto. - (isearch-highlight-all-cleanup): Ditto. - (isearch-delete-extents-in-range): Traverse the extents only once. - (isearch-highlight-all-update): Don't start over if the search - string has changed and more input is pending. - -1999-09-07 Hrvoje Niksic - - * packages.el (packages-find-package-data-path): Ditto. - - * cl.el: Use mapcar at top-level -- mapc is no longer a subr. - - * subr.el (mapc-internal): Don't make obsolete. - - * cl-extra.el (mapc): Resurrect. - -1999-09-03 Hrvoje Niksic - - * obsolete.el (isearch-yank-x-clipboard): Define it as an obsolete - alias. - - * isearch-mode.el (isearch-top-state): Restore isearch-word. - (isearch-yank-clipboard): Renamed from isearch-yank-x-clipboard. - (isearch-yank-clipboard): Use get-clipboard instead of - x-get-clipboard. - (isearch-yank-selection): Fix docstring. - -1999-09-02 Martin Buchholz - - * cl-extra.el: Obsolete hash-table-type in favor of hash-table-weakness. - -1999-09-02 Hrvoje Niksic - - * cl-macs.el (extent-start-position): Fix setf method. - (extent-end-position): Ditto. - -1999-09-02 Hrvoje Niksic - - * isearch-mode.el: End merge with FSF 20.4. - - * isearch-mode.el (search-invisible): New variable. - (isearch-hide-immediately): Ditto. - (isearch-unhidden-extents): Ditto. - (isearch-range-invisible): New function. - (isearch-unhide-extent): Ditto. - (isearch-restore-invisible-extents): Ditto. - (isearch-restore-extent): Ditto. - - * isearch-mode.el (isearch-ring-advance-edit): Use FSF - implementation. - (isearch-ring-retreat-edit): Ditto. - (isearch-forward): New argument NO-RECURSIVE-EDIT. - (isearch-forward-regexp): New arguments NOT-REGEXP and - NO-RECURSIVE-EDIT. - (isearch-backward): New argument NO-RECURSIVE-EDIT. - (isearch-backward-regexp): New arguments NOT-REGEXP and - NO-RECURSIVE-EDIT. - (isearch-mode): Return isearch-success. - (isearch-update): Use unread-command-events instead of - unread-command-event. - (isearch-abort): If an invalid regexp is encountered, keep popping - states. - (isearch-*-char): Use FSF implementation. - (isearch-whitespace-chars): Use the more robust FSF's - implementation. - (isearch-within-brackets): New variable. - (isearch-mode): Initialize it. - (isearch-edit-string): Bind it. - (isearch-search-and-update): Set it. - (isearch-push-state): Push it. - (isearch-top-state): Pop it. - (isearch-search): Set it. - (isearch-printing-char): When called by isearch-whitespace-chars, - handle M-SPC gracefully. - (isearch-message-prefix): New argument ELLIPSIS. - (isearch-message-suffix): Ditto. - (isearch-message): Use the ELLIPSIS argument when calling - isearch-message-prefix and isearch-message-suffix. - (isearch-message-prefix): Distinguish between "wrapped" and - "overwrapped" search, FWIW. - -1999-09-01 Hrvoje Niksic - - * isearch-mode.el (isearch-edit-string): Use the head of the - search ring instead of search-last-string and search-last-regexp. - (search-highlight): Renamed from isearch-highlight. - (isearch-exit): Use the new name. - (isearch-highlight): Ditto. - (isearch-dehighlight): Ditto. - (isearch-update-ring): New function. - (isearch-done): Call it. - (isearch-done): New argument EDIT. - (isearch-repeat): If search string is empty, look up at the car of - the search ring; ignore the yank pointer. - (isearch-abort): Call isearch-done with NOPUSH. - (isearch-cancel): New function. - (isearch-mode-map): Bind it to ESC ESC ESC. - - * isearch-mode.el: Begin merge with FSF 20.4. - -1999-09-01 Andy Piper - - * x-select.el (x-get-clipboard): obsolete. - (x-yank-clipboard-selection): obsolete - - * select.el (disown-selection): need to be careful to disown the - clipboard if we set it via selection. - (get-clipboard): move from x-select.el - (yank-clipboard-selection): ditto. - -1999-09-01 Hrvoje Niksic - - * isearch-mode.el (isearch-exit): Bind isearch-highlight and - isearch-highlight-all-matches to nil. - (isearch-fixed-case): New variable. - (isearch-mode): Initialize it. - (isearch-edit-string): Save it. - (isearch-toggle-case-fold): Set it. - (isearch-fix-case): Make sure isearch-toggle-case-fold works -- - need to check isearch-fixed-case. - (isearch-toggle-case-fold): Update highlighting of all matches - before the pause. - (isearch-edit-string): - -1999-09-01 Hrvoje Niksic - - * isearch-mode.el (isearch-edit-string): Call isearch-message - before reading the event so that the prompt is displayed properly. - (isearch-message): Use isearch-nonincremental when calling - isearch-message-prefix. - (minibuffer-local-isearch-map): Bind up and down to do the same as - M-p and M-n respectively. - (isearch-done): New arg NOPUSH. - (isearch-edit-string): Use it. - (isearch-edit-string): Don't bind isearch-string. - (isearch-ring-adjust): Edit string, *then* push state. - -1999-08-31 Hrvoje Niksic - - * faces.el (isearch-secondary): Make isearch-secondary look - different than default. - -1999-08-30 Hrvoje Niksic - - * isearch-mode.el (isearch-yank): Use progn instead of the inner - save-excursion. - (isearch-dehighlight): Remove TOTALLY. Simplify. - (isearch-update): Call isearch-dehighlight without arguments. - (isearch-done): Ditto. - - * isearch-mode.el (isearch-fix-case): If the search string has no - upper-case letters, allow the folding to be reenabled. - Previously, once disabled, the folding would remain that way until - the end of isearch. - (isearch-top-state): Call isearch-fix-case. - - * isearch-mode.el (isearch-yank): Use progn instead of the inner - save-excursion. - (isearch-dehighlight): Remove TOTALLY. Simplify. - -1999-08-31 Jan Vroonhof - - * xpm-button.el: - xbm-button.el: Need to exist in core because gui.el depends on - them. - -1999-08-31 Andy Piper - - * gutter-items.el (buffers-tab-face): new customizable variable. - (buffers-tab-default-buffer-line-length): new specifier for - maximum viewable characters. - (progress-stack): new variable for implementing widget-based - progress messages. - (progress-area-buffer): ditto. - (progress-glyph-height): ditto. - (progress-stop-callback): ditto. - (progress-quit-function): new function. - (progress-glyph): new variable. - (progress-layout-glyph): ditto. - (progress-displayed-p): new function, see message-displayed-p for - details. - (clear-progress): ditto. - (remove-progress): ditto. - (append-progress): ditto. - (raw-append-progress): ditto. - (display-progress): ditto. - (current-progress): ditto. - (current-progress-label): ditto. - (progress): ditto. - (lprogress): ditto. - - -1999-08-29 Hrvoje Niksic - - * obsolete.el (isearch-yank-x-selection): Define obsolete alias. - - * isearch-mode.el (isearch-yank-x-selection): Renamed to - `isearch-yank-selection'. - (isearch-mode-map): Use it. - (isearch-yank-selection): Use `get-selection' instead of - `get-x-selection'. - -1999-08-29 Hrvoje Niksic - - * faces.el (isearch-secondary): Create face here. - - * isearch-mode.el: Rewrote the "lazy highlighting" code not to use - timers. - -1999-08-27 Hrvoje Niksic - - * subr.el (buffer-string): More robust backward compatibility - check, courtesy William Perry. - -1999-08-26 Hrvoje Niksic - - * replace.el (perform-replace): Stop the search after the search - limit has been reached. - -1999-08-23 Andy Piper - - * gutter-items.el (update-tab-in-gutter): call add-tab-to-gutter - here if we don't have one. - -1999-08-15 Oscar Figueiredo - - * ldap.el (ldap-coding-system): Default to nil until we get - efficient UTF8 support - (ldap-decode-string): Guard against `decode-coding-string' not - being defined - (ldap-encode-string): Guard against `encode-coding-string' not - being defined - -1999-08-23 Didier Verna - - * rect.el: Cosmetics suggested by Dave Love . - Some doc strings improvements, and add a star to the `interactive' - calls. - -1999-08-18 Stef Epardaud - - * font-lock.el (java-font-lock-keywords-3): introduced new - keywords and regexpes for javadoc syntax 1.2. - -1999-08-17 Andy Piper - - * gutter-items.el (buffers-tab-format-buffer-line-function): use - format-buffers-tab-line. - (buffers-tab-max-buffer-line-length): new variable. - (format-buffers-tab-line): new function. truncate names if over - buffers-tab-max-buffer-line-length. - -1999-08-13 Charles G Waldman - - * cus-start.el: Customize the variable `bell-inhibit-time'. - -1999-08-16 Andy Piper - - * gutter-items.el (remove-buffer-from-gutter-tab): take a - brute-force approach to deleting the last buffer. - (buffers-tab-grouping-regexp): new customizable variable. - (select-buffers-tab-buffers-by-mode): use it. - -1999-08-13 Andy Piper - - * gutter-items.el (remove-buffer-from-gutter-tab): fix *scratch* - deletion problem. - -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 - - * gutter-items.el (select-buffers-tab-buffers-by-mode): use - `regexp-quote' to protect the major mode name for use as a regular - expression (c++ needs this for instance). - -1999-08-08 Andy Piper - - * gutter-items.el (select-buffers-tab-buffers-by-mode): beef up to - cope with similar mode names. - - * gutter-items.el (buffers-tab-selection-function): new selection - function. - (select-buffers-tab-buffers-by-mode): new function. - (buffers-tab-items): use it if set to only display buffers in the - tab in the current buffer's group.. - (update-tab-in-gutter): use new api. - (remove-buffer-from-gutter-tab): ditto. - - * gutter-items.el (buffers-tab-max-size): set custom selection - default to 6. - (buffers-tab-switch-to-buffer): just switch window if the window is visible. - (add-tab-to-gutter): set face as default. - -1999-07-07 Jan Vroonhof - - * faces.el (frob-face-property): Merge the fall-back specifier - with the target, not replace it. - -1999-08-05 Andy Piper - - * gutter-items.el (update-tab-in-gutter): add frame argument for - buffer-items. - (update-tab-in-gutter): use it. - - * gutter-items.el (record-buffer-hook): set. - - * buffer.el (switch-to-buffer): back out switch-to-buffer-hook - change. - (switch-to-buffer-hook) deleted. - -1999-08-04 Andy Piper - - * gutter-items.el (update-tab-in-gutter): make sure this will work - as an argument to create-frame-hook. - -1999-07-30 Hrvoje Niksic - - * isearch-mode.el: Modified Bob and Darryl's code to use itimers - instead of timer emulation. - -1999-07-30 Darryl Okahata - - * isearch-mode.el: Merged Bob Glickstein's GNU - Emacs isearch enhancements. - -1999-07-28 Andy Piper - - * gutter-items.el (add-tab-to-gutter): put in specifier specs for - all devices that support tab controls. - (remove-buffer-from-gutter-tab): new function. to be used as a - value for kill-buffer-hook. - -1999-07-21 Sean MacLennan - - * auto-show.el (auto-show-truncationp): changed to match - `window_translation_on' - -1999-07-30 XEmacs Build Bot - - * XEmacs 21.2.19 is released - -1999-07-28 SL Baur - - * code-files.el (insert-file-contents): Fix docstring. - revert previous change. - -1999-07-26 Yoshiki Hayashi - - * fill.el (fill-region-as-paragraph): Change re-break-point to - contain word-across-newline plus one character so that filling - Japanese and Chinese works as desired. - * simple.el (do-auto-fill): Ditto. - -1999-07-26 SL Baur - - * mule/japanese.el ("Japanese"): Do not specify a default input - method. - Suggested by MORIOKA Tomohiko - -1999-07-23 Jan Vroonhof - - * custom.el ((not (fboundp 'defun*))): Insert autoload crap to be - able to use cl-macs macro in early lisp. - -1999-07-23 Jan Vroonhof - - * custom.el: - * cus-face.el: - * cus-edit.el: - Massive custom Theme API changes. - -1999-07-22 MORIOKA Tomohiko - - * code-files.el (insert-file-contents): Regard - coding-system-magic-cookie if `coding-system-for-read' is nil. - -1999-07-22 MORIOKA Tomohiko - - * mule/thai-xtis.el: Add coding: local variable, to avoid - bootstrapping problem with C locale. - -1999-07-22 Andy Piper - - * dumped-lisp.el (preloaded-file-list): guard against putting - gutter-items in a less than functional XEmacs. - * gutter-items.el: put call to `add-tab-to-gutter' back in. - -1999-07-18 Bob Weiner - - * fill.el (fill-context-prefix): Fixed bug that prevented the - setting of an adaptive fill prefix when the `dont-skip-first' was - t. - -1999-07-22 SL Baur - - * gutter-items.el: remove unguarded call to `add-tab-to-gutter'. - -1999-06-25 Karl M. Hegbloom - - * files.el (interpreter-mode-alist): add `make', `guile', and - `emacs' entries. (#!/usr/bin/make -f ought to send a file into - makefile-mode, guile is a scheme, and someday XEmacs will be - modular enough to use as an efficient scripting tool.) - -1999-07-06 MORIOKA Tomohiko - - * mule/mule-cmds.el (reset-language-environment): Regard - coding-category `utf-8' and `ucs-4' if they are available. - -1999-07-06 MORIOKA Tomohiko - - * mule/mule-cmds.el (set-default-coding-systems): Fix DOC-string. - (prefer-coding-system): Fix DOC-string. - - * mule/mule-cmds.el (coding-system-change-eol-conversion): Fix - DOC-string too. - - * mule/mule-cmds.el (mule-keymap): Change keymap name from MULE to - Mule. - (coding-system-change-eol-conversion): Fix DOC-string. - -1999-06-30 MORIOKA Tomohiko - - * mule/mule-cmds.el (mule-keymap): Use `describe-coding-system' - instead of `list-coding-system'. - -1999-06-29 MORIOKA Tomohiko - - * menubar-items.el (default-menubar): `select-input-method' was - renamed to `set-input-method'. - - * mule/mule-cmds.el (set-language-info-alist): Fix setting for - "Set Language Environment" menu. - - * mule/mule-cmds.el (set-language-info-alist): Fix setting for - "Describe Language Support" menu. - -1999-06-29 MORIOKA Tomohiko - - * mule/chinese.el ("Chinese-GB"): Rename - `chinese-gb-environment-setup-function' to - `setup-chinese-gb-environment-internal'. - -1999-06-29 MORIOKA Tomohiko - - * mule/korean.el: Use `define-coding-system-alias' instead of - `copy-coding-system'. - -1999-06-29 MORIOKA Tomohiko - - * mule/mule-cmds.el (set-language-environment-coding-systems): - Treat duplicated coding-categories. - -1999-06-29 MORIOKA Tomohiko - - * mule/japanese.el: Use `define-coding-system-alias' instead of - `copy-coding-system'. - -1999-06-29 MORIOKA Tomohiko - - * mule/vietnamese.el: Specify `iso-8-1' as a category of - coding-system `viscii'. - -1999-06-29 MORIOKA Tomohiko - - * mule/cyrillic.el: - - Specify `iso-8-1' as a category of coding-system `koi8-r'. - (cyrillic-alternativnyj-decode-table): New variable. - (cyrillic-alternativnyj-encode-table): New variable. - - Specify `iso-8-1' as a category of coding-system - `alternativnyj'. - - Abolish general Cyrillic environment. - -1999-06-29 MORIOKA Tomohiko - - * mule/chinese.el: - - Use `define-coding-system-alias' instead of `copy-coding-system'. - - Register `chinese-gb-environment-setup-function' as a - `setup-function' of "Chinese-GB" environment. - -1999-06-29 MORIOKA Tomohiko - - * mule/mule-cmds.el (set-language-info-alist): Allow dummy - optional argument `parents'. - - * mule/thai-xtis.el: Specify `tis-620' as `tutorial-coding-system' - property for Thai-XTIS. - - * mule/mule-help.el (help-with-tutorial): Use property - `tutorial-coding-system' of language-info as a coding-system to - read tutorial file. - -1999-06-29 MORIOKA Tomohiko - - * mule/thai-xtis.el: Don't setup `setup-function' and - `exit-function'. - - * mule/mule-cmds.el (set-language-environment-coding-systems): Use - `set-coding-category-system' to set up coding-system for - coding-category. - - * mule/mule-cmds.el (prefer-coding-system): Use - `set-coding-category-system' to set up coding-system for - coding-category. - -1999-06-29 MORIOKA Tomohiko - - * mule/thai-xtis.el: Specify TUTORIAL.th as the tutorial file for - Thai-XTIS environment. - - * mule/mule-cmds.el (prefer-coding-system): Use - `find-coding-system' instead of `coding-system-p'. - -1999-06-28 MORIOKA Tomohiko - - * mule/mule-cmds.el (set-language-environment-coding-systems): - Modify eol-type for XEmacs. - - * mule/thai-xtis.el: Delete unused local variable `category'. - - * mule/mule-cmds.el (coding-system-change-eol-conversion): New - function. - (prefer-coding-system): Don't call - `update-coding-systems-internal'; use function - `coding-category-list' instead of variable `coding-category-list'; - use `set-coding-priority-list' instead of `set-coding-priority'; - modify `eol-type' for XEmacs. - - * mule/mule-misc.el (string-width): Use `charset-width' instead of - `charset-columns'. - (char-width): Likewise. - -1999-06-28 MORIOKA Tomohiko - - * mule/thai-xtis.el: Specify `iso-8-1' as coding-category of - `tis-620'. - - * mule/mule-cmds.el (set-language-environment-coding-systems): Use - `set-coding-priority-list' instead of `set-coding-priority'; don't - call `update-coding-systems-internal'. - - * mule/mule-misc.el (coding-system-get): New function. - (coding-system-put): New function. - (coding-system-category): New function. - -1999-06-28 MORIOKA Tomohiko - - * dumped-lisp.el (preloaded-file-list): Load "thai-xtis-chars" - when Mule is running; load "mule/thai-xtis" instead of "thai-xtis" - to avoid conflict with leim/quail/thai-xtis. - - * mule/thai-xtis.el: Split definition of the charset `thai-xtis' - to thai-xtis-chars.el. - - * mule/thai-xtis-chars.el: New file (split from - mule/thai-xtis.el). - -1999-06-28 MORIOKA Tomohiko - - * mule/thai-xtis.el: - - Change category for the charset `thai-xtis' to `?x' from `?T'. - - Add syntax entries. - - Put `preferred-coding-system' of the charset `thai-xtis' to - `tis-620'. - -1999-06-28 TAKAHASHI Naoto - - * mule/thai-xtis.el: ccl-decode-thai-xtis and subroutines - rewritten to use write-multibyte-character. - -1999-06-28 MORIOKA Tomohiko - - mule/mule-cmds.el (view-hello-file): Use `iso-2022-7bit' instead - of `iso-2022-7'. - (prefer-coding-system): Synced up with Emacs 20.3.11 but not - ported yet. - (read-input-method-name): Treat optional argument `default'. - -1999-06-28 MORIOKA Tomohiko - - * mule/mule-cmds.el (set-language-info): Don't set up menus at - all. - (set-language-info-alist): Set up menus here. - -1999-06-28 MORIOKA Tomohiko - - * minibuf.el (completing-read): Add new optional argument - `default'. - (read-coding-system): Add new optional argument - `default-coding-system'. - -1999-06-03 Ken'ichi Handa - - * mule/vietnamese.el (ccl-encode-vscii): Typo fixed - (viet-viscii-...->viet-vscii...). - -1999-05-13 Ken'ichi Handa - - * mule/mule-cmds.el: Change MULE to Mule in docstrings - and menus. - -1999-04-12 Richard M. Stallman - - * mule/mule-cmds.el (input-method-function): Add permanent-local - property. - -1999-03-30 Dave Love - - * mule/mule-cmds.el (current-language-environment): Doc fix. - -1999-02-06 Richard Stallman - - * mule/european.el (setup-slovenian-environment): New function. - ("Slovenian"): New language environment. - -1999-01-27 Dave Love - - * mule/mule-cmds.el (current-language-environment): Provide :link, - :type (choices) and appropriate :get. - -1999-01-14 Kenichi Handa - - * mule/mule-cmds.el (describe-language-environment): Don't alter - input-method-alist. - -1999-01-06 Eli Zaretskii - - * mule/mule-cmds.el (prefer-coding-system): Call - set-coding-priority, so that the internal array of priorities is - also updated. - -1998-12-30 Eli Zaretskii - - * mule/mule-cmds.el (prefer-coding-system): If the argument - requires specific EOL conversion type, make the default coding - systems use that. - -1998-12-17 Eli Zaretskii - - * mule/mule-cmds.el (set-language-environment): Pass the default - eol-type to set-language-environment-coding-systems. - (set-default-coding-systems): Copy the eol-type property for the - new default values of {buffer-file,process}-coding-system from the - old defaults. - (set-language-environment-coding-systems): Accept an optional - argument EOL-TYPE, and set the eol-type property of the default - coding systems accordingly. - -1998-10-26 Kenichi Handa - - * mule/chinese.el (pre-write-encode-hz): Cancel previous change, - use generate-new-buffer instead of get-buffer-create. - -1998-10-21 Kenichi Handa - - * mule/chinese.el (pre-write-encode-hz): Use with-temp-buffer. - -1998-10-16 Markus Rost - - * mule/mule-cmds.el (default-input-method): Fix custom type. - -1998-10-12 Richard Stallman - - * mule/mule-cmds.el (setup-specified-language-environment): - Add apropos-inhibit property. - (describe-specified-language-support): Likewise. - -1998-09-06 Bill Richter - - * mule/mule-cmds.el: Doc fixes. - -1998-09-02 Kenichi Handa - - * mule/mule-cmds.el (register-input-method): Doc-string - modified. - -1998-09-01 Dave Love - - * mule/mule-cmds.el (current-language-environment): Fix - setter function. - -1998-08-31 Paul Eggert - - * mule/chinese.el, mule/cyrillic.el, mule/ethiopic.el, - mule/european.el, mule/hebrew.el, mule/japanese.el, - mule/korean.el, mule/vietnamese.el: Add coding: local variable, to - avoid bootstrapping problem if you need to recompile all the Lisp - files using interpreted code. - -1998-08-26 Kenichi Handa - - * mule/european.el ("Latin-1"): Modify `documentation' key value. - ("Latin-2"): Likewise. - -1998-08-18 Per Starback - - * mule/european.el (setup-latin2-environment): Fix typo. - -1998-08-18 Kenichi Handa - - * mule/european.el: Give proper value of `input-method' key to all - lang. env. - - * mule/mule-cmds.el (activate-input-method): Handle the case that - the arg INPUT-METHOD is nil correctly. - (read-multilingual-string): Activate the specified input method - before calling read-string. Afterward, activate the original - input method. - -1998-08-15 Kenichi HANDA - - * mule/mule-cmds.el (language-info-alist): Doc-string modified. - (set-language-info-alist): Fix typo in doc-string. - - * mule/hebrew.el ("Hebrew"): Delete describe-function key. - -1998-08-09 Kenichi HANDA - - * mule/mule-cmds.el (language-info-alist): Doc-string modified. - (reset-language-environment): New function for the job that - setup-english-environment used to do. - (set-language-environment): Do more setups according to the info - in language-info-alist. - (read-language-name): Handle the case that the arg KEY is nil. - (describe-language-environment): Handle input-method property. - - * mule/: All files under this directory, which related with - specific languages (such as mule/european.el, mule/greek.el, - mule/hebrew.el, mule/misc-lang.el), modified as below. - (setup-XXX-environment): Just call set-language-environment. If - they used to do some other jobs than what done by - set-language-environment, those jobs are done in - setup-XXX-environment-internal now. - ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change - the value to setup-XXX-environment-internal. Add properties - input-method and features. - - * mule/english.el (setup-english-environment): Just call - reset-language-environment. - - * mule/european.el (setup-8-bit-environment): Function deleted. - -1998-08-08 Richard Stallman - - * mule/mule-cmds.el (input-method-exit-on-first-char) - (input-method-use-echo-area): Doc fixes. - -1998-08-06 Kenichi Handa - - * mule/mule-cmds.el (input-method-exit-on-first-char): New - variable. - (input-method-use-echo-area): New variable. - -1998-08-01 Kenichi HANDA - - * mule/mule-cmds.el (language-info-alist): Doc-string modified. - -1998-07-30 Ken'ichi Handa - - * mule/mule-cmds.el (activate-input-method): Update mode line. - (inactivate-input-method): Likewise. - -1998-07-19 Kenichi Handa - - * mule/mule-cmds.el (read-multilingual-string): Don't activate an - input method in the current buffer, but just bind - current-input-method. - -1998-07-08 Kenichi Handa - - * mule/hebrew.el ("Hebrew"): Add coding-priority. - - * mule/misc-lang.el ("IPA"): Add coding-priority and - coding-system. - -1998-06-26 Ken'ichi Handa - - * mule/greek.el: Add coding-priority. - -1998-05-23 Richard Stallman - - * mule/mule-cmds.el (register-input-method): Rename arg ENV to - LANG-ENV. - -1998-05-20 Richard Stallman - - * mule/mule-cmds.el (register-input-method): Fix previous change. - (setup-specified-language-environment): Doc fix. - -1998-05-19 Richard Stallman - - * mule/mule-cmds.el: Several doc fixes. - (get-language-info, set-language-info): Rename argument. - (set-language-info-alist): Likewise. - (register-input-method): Rename argument. - (activate-input-method): If INPUT-METHOD is nil, deactivate. - -1998-05-04 Kenichi Handa - - * mule/mule-cmds.el (toggle-input-method): Use a more appropriate - default value while reading an input method. - -1998-05-01 Kenichi Handa - - * mule/mule-cmds.el (universal-coding-system-argument): - Use buffer-file-coding-system as default. - -1998-04-14 Andreas Schwab - - * mule/korean.el ("Korean"): Doc fix. - -1998-04-11 Kenichi Handa - - * mule/mule-cmds.el (describe-language-environment): Print the - languge environment at the head. - -1998-04-06 Kenichi Handa - - * mule/japanese.el: Set exit-function to exit-japanese-environment - for Japanese environment. - -1998-03-20 Richard Stallman - - * mule/mule-cmds.el (set-language-environment): Doc fix. - (current-language-environment): Use defcustom. - (default-input-method): Specify :type. - -1998-03-02 Kenichi Handa - - * mule/mule-cmds.el (set-default-coding-systems): Doc-string - modified. - (prefer-coding-system): Doc-string modified. - -1998-01-21 Kenichi Handa - - * mule/mule-cmds.el (set-language-info): Doc-string - describes `coding-priority' KEY. - (set-language-environment-coding-systems): New function. - (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-environment-coding-systems): New function. - - * mule/chinese.el: Remove setting up of - describe-chinese-environment-map and - setup-chinese-environment-map. Exclude them in args of calls to - set-language-info-alist. Register coding-priority key in - language-info-alist. - - * mule/cyrillic.el: Remove setting up of - describe-cyrillic-environment-map and - setup-cyrillic-environment-map. Exclude them in args of calls to - set-language-info-alist. Register coding-priority key in - language-info-alist. - - * mule/english.el: Register coding-priority key in - language-info-alist. - - * mule/ethiopic.el: Register coding-priority key in - language-info-alist. - - * mule/european.el: Remove setting up of - describe-european-environment-map and - setup-european-environment-map. Exclude them in args of calls to - set-language-info-alist. Register coding-priority key in - language-info-alist. Add "German" language env. - (setup-8-bit-environment): Delete CODING-SYSTEM arg. - (setup-german-environment): New function. - - * mule/greek.el (setup-greek-environment): For Greek lang. env., - change default input method to "greek-postfix". - - * mule/japanese.el, mule/korean.el, mule/vietnamese.el: Register - coding-priority key in - -1997-12-19 Stephen Eglen - - * mule/mule-cmds.el (set-language-info): Doc fix. - (input-method-inactivate-hook): Doc fix. - -1997-11-20 Karl Heuer - - * mule/mule-cmds.el (set-input-method): Renamed from - select-input-method. - -1997-11-07 Kenichi Handa - - * mule/mule-cmds.el (set-language-environment): Run - exit-language-environment-hook before calling `exit-function' - which is specified for the language environment. - -1997-10-23 Kenichi Handa - - * mule/mule-cmds.el (set-default-coding-systems): Doc-string - modified. - (prefer-coding-system): Likewise. - (describe-language-environment): Print aliases of each coding - system. - (set-language-environment-hook): New variable. - (exit-language-environment-hook): New variable. - (set-language-environment): Call these hooks. Before setting a - new language environment, exit from the - current-language-environment if necessary. - (input-method-verbose-flag): The value can be nil, t, - complex-only, or default. - (input-method-highlight-flag): Doc-string augmented. - (activate-input-method): Check if we can run the registered - function to activate an input method. - - * mule/korean.el: Set exit-function for language environment - "Korean" to exit-korean-environment. - (setup-korean-environment): Moved to korea-util.el. - -1997-10-21 Kenichi Handa - - * mule/mule-cmds.el (read-multilingual-string): Use - current-input-method prior to default-input-method. Don't bind - current-input-method by `let', instead, activate the specified - input method in the current buffer temporarily. - -1997-10-19 John F. Whitehead - - * mule/mule-cmds.el (describe-language-environment): Fix prompt. - -1997-10-21 Kenichi Handa - - * mule/chinese.el (post-read-decode-hz): Return the result of - decode-hz-region. - (pre-write-encode-hz): Do not change the value of - last-coding-system. - -1998-09-06 Bill Richter - - * mule/mule-ccl.el: Doc fixes. - -1998-04-20 Kenichi Handa - - * mule/mule-ccl.el (declare-ccl-program): New optional arg VECTOR. - (check-ccl-program): New macro. - -1998-01-21 Kenichi Handa - - * mule/mule-ccl.el: Comment about CCL syntax modified. - (ccl-command-table): Add read-multibyte-character and - write-multibyte-character. - (ccl-code-table): Add ex-cmd. - (ccl-extended-code-table): New variable. - (ccl-embed-extended-command): New function. - (ccl-compile-read-multibyte-character, - ccl-compile-write-multibyte-character) New functions. - (ccl-dump-ex-cmd, ccl-dump-read-multibyte-character, - ccl-dump-write-multibyte-character): New functions. - -1999-07-22 SL Baur - - * config.el (config-value-file): config.values is installed into - doc-directory. - From Karl M. Hegbloom - -1999-07-19 Didier Verna - - * rect.el: all functions rewritten, except when noted. Below is a - list of interface changes. - (apply-on-rectangle): new function. Obsoletes - `operate-on-rectangle'. All functions that used to call this - function now call the new one. - (kill-rectangle): added optional prefix arg to fill lines. - (delete-rectangle): ditto. - (delete-extract-rectangle): ditto. - (open-rectangle): ditto. - (clear-rectangle): ditto. - (delete-rectangle-line): added third arg FILL. - (delete-extract-rectangle-line): ditto. - (open-rectangle-line): ditto. - (clear-rectangle-line): ditto. - -1999-07-18 Andy Piper - - * menubar-items.el (default-menubar): add gutter options. - - * gutter-items.el: new file. - (gutter): new group for custom. - (gutter-visible-p): new variable. - (default-gutter-position): ditto. - (buffers-tab): new group for the buffers tab. - (gutter-buffers-tab): widget to put in the gutter. - (buffers-tab-max-size): max number of tabs. - (buffers-tab-switch-to-buffer-function): function to call when a - tab is pressed. - (buffers-tab-omit-function): filter buffers with this function. - (buffers-tab-format-buffer-line-function): format buffer names for - inclusion in tabs. - (buffers-tab-switch-to-buffer): like switch-to-buffer but without - the record. - (build-buffers-tab-internal): build a list of tab items. - (buffers-tab-items): ditto. - (add-tab-to-gutter): put a tab in the gutter area. - (update-tab-in-gutter): reset the buffers in the tab. - - * dumped-lisp.el (preloaded-file-list): dump gutter-items. - - * buffer.el (switch-to-buffer): run switch-to-buffer-hooks. - (switch-to-buffer-hooks): new hook. - - * toolbar.el (default-toolbar-position): fix typo. - -1999-07-16 Andy Piper - - * gui.el (make-dialog-frame): turn off gutters for dialogs. - -1999-07-15 Didier Verna - - * cus-edit.el (custom-prompt-variable): optional third arg makes - prompt for a comment string. - (customize-set-value): optional prefix makes this function handle - variable comments. - (customize-set-variable): ditto. - (customize-save-variable): ditto. - (customize-customized): handle custom comments. - (customize-save-customized): ditto. - (custom-variable-state-set): ditto. - (custom-face-state-set): ditto. - (customize-saved): ditto. - (custom-variable-set): ditto. - (custom-face-set): ditto. - (custom-variable-save): ditto. - (custom-face-save): ditto. - (custom-variable-reset-saved): ditto. - (custom-face-reset-saved): ditto. - (custom-variable-reset-standard): ditto. - (custom-face-reset-standard): ditto. - (custom-comment-face): new face. - (custom-comment-tag-face): ditto. - (custom-comment): new widget. - (custom-comment-create): new function. - (custom-comment-delete): ditto. - (custom-comment-value-set): ditto. - (custom-comment-show): ditto. - (custom-comment-invisible-p): ditto. - (custom-variable-value-create): create a comment field widget. - (custom-face-value-create): ditto. - (custom-variable-menu): new entry for adding a custom comment. - (custom-face-menu): ditto. - (custom-save-variables): possibly save custom comments. - (custom-save-faces): ditto. - - * cus-face.el (custom-set-faces): the arguments can now have a - custom comment as fourth argument. - - * custom.el (custom-set-variables): the arguments can now have a - custom comment as fifth element. - -1999-07-13 XEmacs Build Bot - - * XEmacs 21.2.18 is released - -1999-07-13 SL Baur - - * lib-complete.el (read-library-name): Revert previous change. - (read-library): Ditto. - -1999-06-24 Karl M. Hegbloom - - * packages.el (packages-package-list): Capitalize docstring. - - * packages.el (packages-find-package-library-path): Use #'nconc - rather than #'append to reduce consing -- #'mapcar uses Flist, - which returns a freshly consed list. #'append would create yet - another fresh list, using Fmake_list in concat. - - * packages.el (package-provide): Use setq with remassq like it - says in its docstring. - -1999-07-06 SL Baur - - * lib-complete.el (progn-with-message): Fix typo. - -1999-07-06 SL Baur - - * mule/mule-misc.el (char-octet): Make function match docstring. - From Katsumi Yamaoka - -1999-06-15 Karl M. Hegbloom - - * wid-edit.el (widget-documentation): corrected spelling error. - -1999-06-23 Jonathan Marten - - * x-win-sun.el (x-win-init-sun): Don't rebind Find and Sh-find - keys if already bound - -1999-07-06 SL Baur - - * lib-complete.el (progn-with-message): Revert previous changes. - -1999-06-24 Bob Weiner - - * lib-complete.el (find-library): - (find-library-other-window): - (find-library-other-frame): Completely rewrote - so that these functions actually work when called non-interactively. - Also made them handle LIBRARY arguments which end with .el or .elc. - -1999-06-24 Bob Weiner - - * simple.el (indent-new-comment-line): Locally bound - `block-comment-start' to `comstart' or else when this is called - from do-auto-fill, e.g. in Lisp mode, it will insert any non-nil - `block-comment-start' value, ignoring any existing spacing after a - comment prefix in the previous line and producing ugly comments. - -1999-06-23 Bob Weiner - - * list-mode.el (mouse-choose-completion): - (choose-completion): - (completion-switch-to-minibuffer): Added. - ([Tab]): [Tab] previously switched to the minibuffer - but since [space] does that and since most applications in the - world use [Tab] to select the next item in a list, do that in the - *Completions* buffer too. This will cause the least confusion - among the largest population of users. -- Bob Weiner, BeOpen.com, - 06/23/1999. - -1999-06-22 Bob Weiner - - * help.el (help-buffer-name): Added support for a null value - of `help-buffer-prefix-string' since some buffers require no - prefix. - -1999-06-20 Bob Weiner - - * list-mode.el (completion-list-mode-quit): Added and bound to {q} - in the completion-list-mode-map to bury the completions buffer - even when the minibuffer is no longer active. - -1999-06-20 Bob Weiner - - * list-mode.el (list-mode): It is visually disconcerting to have - the text cursor disappear within list buffers, especially when - moving from window to window, so leave it visible. - -1999-07-01 SL Baur - - * menubar-items.el (default-menubar): Conditionalize the bug - report menu item (which may not be possible in this XEmacs). - Reported by: Ken'ichi Handa - -1999-06-30 SL Baur - - * subr.el (with-current-buffer): DOC string fix. - Suggested by Bob Weiner - -1999-06-25 Charles G Waldman - - * cus-face.el (custom-face-italic): insert missing args - -1999-06-24 Michael Sperber [Mr. Preprocessor] - - * packages.el (package-locations): Changed default early package - hierarchies to ~/.xemacs/mule-packages and - ~/.xemacs/xemacs-packages. - -1999-06-23 SL Baur - - * mule/mule-category.el (Top Level): ASCII is also latin-1. - -1999-06-15 Michael Sperber [Mr. Preprocessor] - - * packages.el (package-locations): Changed default early package - hierarchy to ~/.xemacs/packages. - (package-locations): Removed `packages' as a possible name for a - late package hierarchy. - -1999-06-20 MORIOKA Tomohiko - - * mule/mule-category.el (word-combining-categories): Set up new - variable. - (word-separating-categories): Likewise. - -1999-06-22 XEmacs Build Bot - - * XEmacs 21.2.17 is released - -1999-06-17 Robert Pluim - - * font-menu.el (font-menu-set-font): allow for nil specification - of font size. - -1999-06-16 MORIOKA Tomohiko - - * mule/thai-xtis.el: Specify `columns' of the charset `thai-xtis' - is 1. - -1999-06-12 MORIOKA Tomohiko - - * mule/cyrillic.el (cyrillic-koi8-r-decode-table): Use NBSP of ISO - 8859-5 instead of ISO 8859-1. - -1999-06-15 SL Baur - - * mule/vietnamese.el (viet-vscii-encode-table): Use split-char. - (viet-viscii-encode-table): Ditto. - - * mule/mule-misc.el: Delete split-char & split-char-or-char-int. - Make obsolete definition of char-octet. - -1999-06-14 SL Baur - - * subr.el: Move no-Mule make-char ... - * help-nomule.el (make-char): To here. - (string-width): Make Mule compatibility alias. - -1999-06-15 Andy Piper - - * select.el (get-selection-no-error): really make there be no-error. - (get-selection): revert to original. - -1999-06-11 Andy Piper - - * select.el (selection-sets-clipboard): renamed. - (own-selection): use it. - -1999-06-11 XEmacs Build Bot - - * XEmacs 21.2.16 is released - -1999-06-09 MORIOKA Tomohiko - - * mule/cyrillic.el (cyrillic-koi8-r-decode-table): Set 32 for - missing characters to avoid crash. - -1999-06-09 Jan Vroonhof - - * coding.el (set-terminal-coding-system): Only set the console - coding system on the selected console if it is a tty. - -1999-06-10 Jan Vroonhof - - * cus-face.el: - * cus-edit.el: - * faces.el: - (custom): - (face-spec-set): - * faces.el (frob-face-property): - * font-menu.el (font-menu-set-font): - Actually apply changes from 1999-03-17 - -1999-06-10 Andy Piper - - * select.el (get-selection): abstract out non error-signalling - part. - (get-selection-no-error): get-selection without signalling an - error. - (selection-is-clipboard-p): new variable. controls whether the - selection sets the clipboard. - (own-selection): use it. - - * mouse.el (insert-selection): fallback to clipboard after trying - primary selection and cutbuffer. - -1999-06-05 Andy Piper - - * x-select.el (xselect-kill-buffer-hook-1): use generalised - selection functions. - -1999-06-04 MORIOKA Tomohiko - - * code-files.el (buffer-file-coding-system): Use `raw-text' as - default value. - (load): Use `raw-text' instead of `no-conversion'. - (insert-file-contents): Likewise. - - * bytecomp.el (byte-compile-insert-header): Use `raw-text' instead - of `no-conversion'. - -1999-06-03 MORIOKA Tomohiko - - * coding.el: Don't copy `no-conversion' to `raw-text'. - -1999-06-07 Hrvoje Niksic - - * subr.el (make-char): Define it if Mule is not around. - -1999-06-07 SL Baur - - * mule/mule-help.el: Add trailing newline. Use mule keyword. - - * x-select.el (x-disown-selection-internal): Restore symbol as an - obsolete alias. - (xselect-kill-buffer-hook-1): Use disown-selection-internal. - -1999-06-04 XEmacs Build Bot - - * XEmacs 21.2.15 is released - -1999-06-02 Oscar Figueiredo - - * subr.el (split-string): Avoid infinite looping - -1999-05-30 Oscar Figueiredo - - * ldap.el (ldap-ignore-attribute-codings): New variable - (ldap-default-attribute-decoder): New variable - (ldap-coding-system): New variable - (ldap-attribute-syntax-encoders): New variable - (ldap-attribute-syntax-decoders): New variable - (ldap-attribute-syntaxes-alist): New variable - (ldap-encode-boolean): New function - (ldap-decode-boolean): New function - (ldap-encode-country-string): New function - (ldap-decode-string): New function - (ldap-decode-address): New function - (ldap-encode-address): New function - (ldap-decode-attribute): New function - (ldap-search): Use some of these - -1999-05-25 Jan Vroonhof - - * version.el (emacs-version): Make the patch level/beta come - before the XEmacs qualifier so that it gets into (funcall - emacs-version) and thus in the bug reports. - (emacs-version>=): Support patch levels. - -1999-06-03 SL Baur - - * version.el: implement x.y.z version number - From Jan Vroonhof - -1999-05-27 Yoshiki Hayashi - - * mule/mule-cmds.el (read-input-method-name): set input-method properly. - -1999-05-22 Vin Shelton - - * startup.el: Document -private and break out non-standard X options. - -1999-05-26 SL Baur - - * mule/mule-charset.el (charset-after): New function. - (charset-direction): Synch with Mule, update docstring. - (get-charset-property): New function. - (put-charset-property): New function. - (charset-plist): New function. - - * mule/mule-charset.el (compose-region): - (decompose-region): remove; these functions (which don't work - since we don't do composite characters) have been moved to - mule-util.el. - (toplevel): follow coding standards - -1999-05-26 SL Baur - - * dumped-lisp.el (preloaded-file-list): mule-files.el does not - exist any more. - - * code-files.el: Fix commentary to follow coding standards. Move - the single line left in mule-files.el to here. - - * mule/mule-files.el: delete. - -1999-05-24 SL Baur - - * info.el (Info-scroll-prev): Use event functions instead of the - old emacs 19 interface. - -1999-06-02 Andy Piper - - * x-font-menu.el (x-font-menu-load-font): - font-menu-registry-encoding -> x-font-menu-registry-encoding type. - -1999-05-31 Andy Piper - - * font-menu.el (font-menu-ignore-scaled-fonts): move to font-menu - group. - (font-menu-this-frame-only-p): ditto. - (font-menu-max-items): reinstate, from Jan Vroonhof - - (font-menu-submenu-name-format): ditto. - (font-menu-split-long-menu): ditto, for use by the family - constructor. - (font-menu-family-constructor): use it. - -1999-05-30 Andy Piper - - * msw-faces.el (mswindows-font-regexp): new font matching regexp - for use by the font menu. - - * msw-font-menu.el: new file implementing mswindows specific - font-menu behaviour. - (mswindows-font-menu-registry-encoding): new function mirroring x version. - (mswindows-font-menu-junk-families): ditto. - (hack-font-truename): ditto. - (mswindows-font-regexp-ascii): ditto. - (mswindows-reset-device-font-menus): ditto. - (mswindows-font-menu-font-data): ditto. - (mswindows-font-menu-load-font): ditto. - - * x-font-menu.el (x-reset-device-font-menus): made device specific. - (x-font-menu-font-data): ditto. - (x-font-menu-load-font): ditto. - - * font-menu.el: new file implementing generic font menu behaviour. - (font-menu-ignore-scaled-fonts): copied from x-font-menu.el and - made device independent. - (font-menu-this-frame-only-p): ditto. - (font-menu-preferred-resolution): ditto. - (font-menu-size-scaling): new variable used to determine whether - sizes are in points or tenths of a point. - (vassoc): moved from x-font-menu.el. - (device-fonts-cache): ditto. - (device-fonts-cache): ditto. - (flush-device-fonts-cache): ditto. - (reset-device-font-menus): copied from x-font-menu.el and made - device independent. Most functionality deferred to - device-dependent versions. - (font-menu-family-constructor): copied from x-font-menu.el and - made device independent. - (font-menu-size-constructor): ditto. - (font-menu-weight-constructor): ditto. - (font-menu-set-font): ditto. - (font-menu-change-face): ditto. - (font-menu-load-font): new device method. - (font-menu-font-data): ditto. - - * x-font-menu.el: The above functions deleted. - -1999-05-26 Andy Piper - - * update-elc.el: - * make-docfile.el: - * loadup.el: rehash expand-file-name usage to not use default-directory. - -1999-05-21 Andy Piper - - * x-select.el (x-select-convert-to-text): - (x-selected-text-type): - (x-get-selection): - (xselect-convert-to-string): - (xselect-convert-to-compound-text): - (xselect-convert-to-length): - (xselect-convert-to-targets): - (xselect-convert-to-delete): - (xselect-convert-to-filename): - (xselect-convert-to-charpos): - (xselect-convert-to-lineno): - (xselect-convert-to-colno): - (xselect-convert-to-sourceloc): - (xselect-convert-to-os): - (xselect-convert-to-host): - (xselect-convert-to-user): - (xselect-convert-to-class): - (xselect-convert-to-name): - (xselect-convert-to-integer): - (xselect-convert-to-atom): - (xselect-convert-to-identity): functions renamed from x-* and - moved to select.el. - (x-get-secondary-selection): use rename get-selection. - (x-get-clipboard): ditto. - (x-own-selection): moved to select.el. - (x-valid-simple-selection-p): ditto. - (x-dehilight-selection): ditto. - (x-own-clipboard): ditto. - (x-disown-selection): ditto. - - * x-mouse.el (x-yank-function): moved to mouse.el. - (x-insert-selection): ditto. - (x-set-point-and-move-selection): use renamed function. - - * select.el (selected-text-type): moved and renamed from - x-select.el. - (selection-owner-p): moved to C. - (selection-exists-p): ditto. - (get-cutbuffer): new device method. - (get-selection): generalised and moved from x-select.el. - (own-selection): moved x-own-selection functionality into here. - (dehilight-selection): renamed and moved from x-select.el. - (own-clipboard): functionality moved from x-select.el using new - generic C builtins. - (disown-clipboard): ditto. - (select-convert-to-text): - (select-convert-to-string): - (select-convert-to-compound-text): - (select-convert-to-length): - (select-convert-to-targets): - (select-convert-to-delete): - (select-convert-to-filename): - (select-convert-to-charpos): - (select-convert-to-lineno): - (select-convert-to-colno): - (select-convert-to-sourceloc): - (select-convert-to-os): - (select-convert-to-host): - (select-convert-to-user): - (select-convert-to-class): - (select-convert-to-name): - (select-convert-to-integer): - (select-convert-to-atom): - (select-convert-to-identity): new functions renamed from x-* and - moved from x-select.el. - - * mouse.el (mouse-consolidated-yank): subsume x-yank-function - into here and use as the default window-system mouse yank. - (insert-selection): generalised and moved from x-mouse.el. - (own-clipboard): moved to C. - - * msw-select.el (mswindows-selection-owned-p): deleted. - (mswindows-own-selection): generalised and moved to select.el. - (mswindows-disown-selection): generalised and moved to C. - (mswindows-selection-owner-p): ditto. - 1999-05-14 XEmacs Build Bot * XEmacs 21.2.14 is released @@ -3749,7 +83,7 @@ Installation.el needs to be loaded before `dump-paths', otherwise the dumping process won't find it. -1999-03-13 Adrian Aichner +1999-03-13 Adrian Aichner * dumped-lisp.el (preloaded-file-list): Load Installation.el after subr so that we can use `replace-in-string' in Installation.el to @@ -3877,7 +211,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. @@ -3901,12 +235,12 @@ 1999-02-19 Jan Vroonhof - * x-faces.el (x-init-global-faces): Add default tag to specifiers, + * x-faces.el (x-init-global-faces): Add default tag to specifiers, so they can be overridden by x-init-face-from-resources. Additionally specify the font name also with an x tag. 1999-03-08 Andy Piper - + * package-get.el (package-get-base): autoload. * menubar-items.el (default-menubar): add update menu item. Fix @@ -3915,7 +249,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). @@ -3937,7 +271,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. @@ -3947,7 +281,7 @@ * x-faces.el (x-init-face-from-resources): Only set fonts in the 'x locale. -1999-03-04 Adrian Aichner +1999-03-04 Adrian Aichner * package-ui.el (pui-install-selected-packages): Don't throw on `package-admin-delete-binary-package' returning nil since it's @@ -3957,12 +291,12 @@ 1999-03-03 Martin Buchholz - * menubar-items.el (default-menubar): + * menubar-items.el (default-menubar): Implement the ``Mule->Set coding system of process'' menu item. 1999-02-18 Martin Buchholz - * files.el (auto-mode-alist): Use c-mode for *.i pre-processed cpp + * files.el (auto-mode-alist): Use c-mode for *.i pre-processed cpp files - Change some `if's to `when's @@ -4022,7 +356,7 @@ * dumped-lisp.el (preloaded-file-list): Core mule files moved out of mule-base into lisp/mule. -1999-02-10 Adrian Aichner +1999-02-10 Adrian Aichner * process.el (exec-to-string): Use `shell-command-switch' in place of hard-wired "-c" (for WindowsNT). @@ -4039,7 +373,7 @@ 1999-02-15 Martin Buchholz - * paths.el: + * paths.el: - improved automounter tmp directory support. - support 4 (!) empirically discovered automounter conventions @@ -4060,7 +394,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. @@ -4068,7 +402,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. @@ -4078,13 +412,13 @@ * about.el (about-url-alist): Update my entry. (xemacs-hackers): Ditto. -1999-01-14 Adrian Aichner +1999-01-14 Adrian Aichner * buffer.el (switch-to-buffer): Fixing documentation. * 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 @@ -4126,7 +460,7 @@ 1998-12-30 Martin Buchholz - * font.el (font-default-object-for-device): + * font.el (font-default-object-for-device): Oops! This `or' can't be replaced by `unless'. Fixed inability to run w3, among other things. @@ -4139,7 +473,7 @@ 1998-12-23 Hrvoje Niksic - * mouse.el (default-mouse-motion-handler): Disable help echo while + * mouse.el (default-mouse-motion-handler): Disable help echo while in the minibuffer. 1998-12-28 Martin Buchholz @@ -4167,7 +501,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. @@ -4195,7 +529,7 @@ 1998-11-30 Hrvoje Niksic - * cus-dep.el (Custom-make-dependencies): Be smarter about trapping + * cus-dep.el (Custom-make-dependencies): Be smarter about trapping errors. 1998-12-04 Hrvoje Niksic @@ -4244,7 +578,7 @@ bytecompile time. 1998-11-30 Martin Buchholz - + * x-win-xfree86.el: * x-win-sun.el (x-win-init-sun): * x-win-sun.el: @@ -4455,7 +789,7 @@ 1998-11-26 Jan Vroonhof - * faces.el (get-custom-frame-properties): Revert Hrvoje Niksic change + * faces.el (get-custom-frame-properties): Revert Hrvoje Niksic change of Dec 4, 1997. 1998-11-25 Hrvoje Niksic @@ -4467,7 +801,7 @@ * subr.el (buffer-substring-no-properties): Comment out. -1998-11-07 Adrian Aichner +1998-11-07 Adrian Aichner * msw-faces.el (mswindows-find-smaller-font): Turning font names into font instances first, like `x-frob-font-size' does. @@ -4489,20 +823,20 @@ (package-get-remove-copy): Default to 't' we no longer need this kludge as we do not currently use depenencies. - + (package-get-was-current): New variable. (package-get-require-base): New 'force-current' argument. (package-get-update-base): idem (package-get-package-provider): idem (package-get-locate-index-file): New 'no-remote' argument. (package-get-locate-file): idem. - + (package-get-maybe-save-index): New function. (package-get-update-base): Use it. 1998-10-28 Greg Klanderman - * package-get.el (package-get-remote): default to nil; by default, + * package-get.el (package-get-remote): default to nil; by default, don't go out to the net via EFS. They must select a download site. (package-get-download-sites): new variable. (package-get-download-menu): new function. @@ -4517,22 +851,22 @@ * package-get.el (package-get): bugfix code checking installed version for case where package is not currently installed. (package-get-require-signed-base-updates): new variable. - (package-get-update-base-from-buffer): remove REMOTE-SOURCE arg, it was + (package-get-update-base-from-buffer): remove REMOTE-SOURCE arg, it was deemed not a goot thing. Use the variable package-get-allow-unsigned-base-updates instead. 1998-10-16 Greg Klanderman - * package-get.el (package-get): Don't install an older version than + * package-get.el (package-get): Don't install an older version than we already have unless explicitly told to. Issue a warning. * package-ui.el (pui-add-required-packages): when adding dependencies, don't add packages that are up to date. - (pui-package-symbol-char): Don't consider a package out of date + (pui-package-symbol-char): Don't consider a package out of date if you have a newer version installed than the latest version in package-get-base. - * package-get.el (package-get-base-filename): document that it may + * package-get.el (package-get-base-filename): document that it may be a path relative to package-get-remote; new default value. (package-get-locate-file): new function. (package-get-update-base): use it to expand package-get-base-filename. @@ -4555,7 +889,7 @@ * cus-face.el (custom-set-face-update-spec): Add autoload cookie 1998-10-20 Malcolm Box - + * etags.el (find-tag-default): Run find-tag-hook using run-hooks rather than funcall @@ -4576,7 +910,7 @@ 1998-10-14 Jan Vroonhof * auto-save.el: expand-file 'auto-save-*-dir' at runtime not at - dump time. + dump time. 1998-10-15 Greg Klanderman @@ -4615,7 +949,7 @@ 1998-10-12 Jan Vroonhof - * menubar-items.el (default-menubar): pui-list-package has nothing + * menubar-items.el (default-menubar): pui-list-package has nothing to with Customize. Move all the package stuff to a new Item in Options. * package-ui.el (pui-menu): Add menu and Popup menu. @@ -4650,7 +984,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. @@ -4711,9 +1045,9 @@ * package-admin.el (package-admin-delete-binary-package): General cleanup. Remove unnessary use of progn and - save-excursion. + save-excursion. (package-admin-delete-binary-package): Do NOT mess with file - modes. That is evil. + modes. That is evil. (package-admin-delete-binary-package): Wrap all deleting in condition-case. The data in MANIFEST is untrustworthy. (package-admin-delete-binary-package): Let the OS worry about non @@ -4747,8 +1081,8 @@ 1998-09-29 Colin Rafferty - * sound.el (default-sound-directory-list): Initialize with all the - "sounds" directories in `data-directory-list'. It used to just be + * sound.el (default-sound-directory-list): Initialize with all the + "sounds" directories in `data-directory-list'. It used to just be the first one. * packages.el (locate-data-directory-list): Created. This gives @@ -4759,7 +1093,7 @@ * minibuf.el (read-from-minibuffer): No longer bind help-form but make a binding in the local keymap until help-char handling is - improved. + improved. * help.el (help-keymap-with-help-key): Provide keymap with help binding. @@ -4780,7 +1114,7 @@ 1998-09-21 Martin Buchholz - * bytecomp.el (byte-compile-buffer-substring): + * bytecomp.el (byte-compile-buffer-substring): Fix for: (byte-compile (defun f () (buffer-substring))) ==> ** buffer-substring called with 3 args, but requires 0-3 - new code not only works, but is more readable, too. @@ -4858,7 +1192,7 @@ 1998-08-27 Jan Vroonhof * x-font-menu.el (font-menu-set-font): Add "pt" units to size - argument. + argument. 1998-09-03 Darryl Okahata @@ -4866,14 +1200,14 @@ keyword `:completion-string', which allows the programmer to change the "Possible completions are:" prompt. - * menubar-items.el: Added new pulldown menu-pick to start up the + * menubar-items.el: Added new pulldown menu-pick to start up the visual package browser/installer: Options->Customize->List Packages * package-admin.el: Added hooks for installing under both Unix and MS Windows. Does additional error checking. No longer - calls "add-big-package.sh" to install packages under Unix; now + calls "add-big-package.sh" to install packages under Unix; now calls gunzip & tar directly. * package-get.el: Added ability to install packages from files @@ -4886,7 +1220,7 @@ Changed all occurences of `concat' to use `expand-file-name'. * package-ui.el: New file which implements the main visual - package browser/installer, which is started via a menu pick or + package browser/installer, which is started via a menu pick or M-x pui-list packages. 1998-09-03 Hrvoje Niksic @@ -4932,8 +1266,8 @@ 1998-08-19 Michael Sperber [Mr. Preprocessor] - * loadup.el: - * make-docfile.el: + * loadup.el: + * make-docfile.el: * update-elc.el: Don't set `source-directory' (now defunct as a global variable) no more. @@ -4948,12 +1282,12 @@ * 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): (face-dim-p): updated the doc strings now that the dim property isn't - tty-specific. + tty-specific. (face-equal): the dim property is now a common one. * cus-face.el (custom-face-attributes): New face attribute: `dim' @@ -4996,8 +1330,8 @@ 1998-08-01 Kai Haberzettl - * startup.el(startup-splash-frame-body): - Update Copyright notice in splash screen + * startup.el(startup-splash-frame-body): + Update Copyright notice in splash screen 1998-07-20 Greg Klanderman @@ -5050,7 +1384,7 @@ 1998-07-16 Colin Rafferty * menubar-items.el (default-menubar): Removed references to - `data-directory', and use `locate-data-file' instead, and made + `data-directory', and use `locate-data-file' instead, and made then greyed out if they don't exist. 1998-07-14 Oscar Figueiredo @@ -5131,7 +1465,7 @@ * Symbols that have been obsolete for at least 3 years removed. - * cl-macs.el (cl-parse-loop-clause): Delete obsolete references to + * cl-macs.el (cl-parse-loop-clause): Delete obsolete references to screen- functions. (toplevel): remove setf methods for screen functions. * cl-macs.el (extent-data): defsetf removed. @@ -5276,7 +1610,7 @@ * faces.el (xpm-color-symbols): remove hardcoded defaults these are handled by the gui-element face fallbacks now. - + * x-faces.el: default gui-element face to "background" as well as the default face. @@ -5290,7 +1624,7 @@ corresponding to `page-delim' goes first and the hack in `forward-paragraph' will work. With bug analysis from Bob Weiner - + 1998-06-29 Kyle Jones * subr.el (remove-hook): When checking the hook value @@ -5307,7 +1641,7 @@ * ldap.el (ldap-host-parameters-alist): New name of `ldap-host-parameters-plist' -1998-06-26 Adrian Aichner +1998-06-26 Adrian Aichner * package-get.el: Using (require 'package-get-base), now that it provides itself. Consequently removed all instances of (load @@ -5315,7 +1649,7 @@ 1998-06-29 Kyle Jones - * subr.el (remove-hook): Don't treat the hook value as a + * subr.el (remove-hook): Don't treat the hook value as a list unless it is both consp and not functionp. 1998-06-29 SL Baur @@ -5385,7 +1719,7 @@ 1998-06-15 Jonathan Harris - * minibuf.el: make read-color-completion-table call + * minibuf.el: make read-color-completion-table call (mswindows-color-list for mswindows devices. 1998-06-18 Sam Mikes @@ -5394,7 +1728,7 @@ (font-lock-match-c++-style-declaration-item-and-skip-to-next): Let declaration items contain non-word symbol characters. -1998-06-15 Adrian Aichner +1998-06-15 Adrian Aichner * package-get.el (package-get-package-provider): Added autoload cookie. Loading "package-get-base.el" in ALL functions that use @@ -5441,7 +1775,7 @@ (Info-save-auto-generated-dir): New variable (Info-maybe-update-dir): Use `Info-auto-generate-directory' (Info-build-dir-anew): Second parameter removed. Use - `Info-save-auto-generated-dir' + `Info-save-auto-generated-dir' (Info-rebuild-dir): Ditto 1998-06-02 Christoph Wedler @@ -5546,10 +1880,10 @@ `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. + toggle buttons for boolean attributes. Re-ordered the items a bit. 1998-06-01 SL Baur @@ -5698,7 +2032,7 @@ * x-select.el: selection cleanup. (x-cut-copy-clear-internal) moved to (cut-copy-clear-internal) in select.el. Ditto for (x-delete-primary-selection) (x-kill-primary-selection) - (x-copy-primary-selection). + (x-copy-primary-selection). (own-clipboard): new function. * msw-select.el: use the new kill/delete/copy/cut-copy-clear @@ -5806,7 +2140,7 @@ comint-process-echoes setting to t. 1998-05-17 Michael Sperber [Mr. Preprocessor] - + * packages.el (packages-no-package-hierarchy-regexp): Introduced and used following the interface change of `paths-find-recursive-path'. @@ -5820,7 +2154,7 @@ 1998-05-16 Hrvoje Niksic - * simple.el (delete-forward-p): Make it a defun; do X garbage only + * simple.el (delete-forward-p): Make it a defun; do X garbage only on X devices, rather than on all non-TTY devices. 1998-05-16 Kirill M. Katsnelson @@ -5829,7 +2163,7 @@ * dumped-lisp.el (preloaded-file-list): Added msw-mouse.el -1998-05-17 Adrian Aichner +1998-05-17 Adrian Aichner * itimer.el (activate-itimer): Fixed usage of integers as argument to `concat'. @@ -5900,11 +2234,11 @@ 1998-05-15 Kirill M. Katsnelson - * device.el (device-pixel-width): - (device-pixel-height): - (device-mm-width): - (device-mm-height): - (device-bitplanes): + * device.el (device-pixel-width): + (device-pixel-height): + (device-mm-width): + (device-mm-height): + (device-bitplanes): (device-color-cells): Swapped parameters to device-system-metric according to the interface change. @@ -5929,7 +2263,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. @@ -6115,8 +2449,8 @@ 1998-05-10 Kirill M. Katsnelson * device.el: (device-pixel-width): Reflected name/parameters - change to device-system-metric. - (device-pixel-height): Ditto. + change to device-system-metric. + (device-pixel-height): Ditto. (device-mm-width): Ditto. (device-mm-height): Ditto. (device-bitplanes): Ditto. @@ -6188,11 +2522,11 @@ 1998-04-18 Kirill M. Katsnelson - * device.el (device-pixel-height): - (device-pixel-width): - (device-mm-width): - (device-mm-height): - (device-bitplanes): + * device.el (device-pixel-height): + (device-pixel-width): + (device-mm-width): + (device-mm-height): + (device-bitplanes): (device-color-cells): Moved these 6 functions from device.c; they all use single (device-system-metrics) call. @@ -6201,7 +2535,7 @@ * dumped-lisp.el (preloaded-file-list): x-menubar.el and x-toolbar.el were renamed. - * menubar-items.el: + * menubar-items.el: * toolbar-items.el: Renamed from x-menubar/x-toolbar. Suggested by Hrvoje Niksic @@ -6247,12 +2581,12 @@ 1998-05-03 Hrvoje Niksic - * help.el (function-arglist): If no arguments are documented for a + * help.el (function-arglist): If no arguments are documented for a subr, print nothing rather than incorrect output. 1998-05-05 SL Baur - * cmdloop.el (command-error): Update bail-out error message to use + * cmdloop.el (command-error): Update bail-out error message to use `emacs-program-name'. * lib-complete.el: Remove reader macro cruft. @@ -6375,7 +2709,7 @@ 1998-04-30 Hrvoje Niksic - * modeline.el (defining-kbd-macro): Restore modeline indication of + * modeline.el (defining-kbd-macro): Restore modeline indication of kbd-macro being recorded. (add-minor-mode): Simplify docstring. (modeline-minor-mode-menu): Remove stuff. @@ -6383,7 +2717,7 @@ 1998-04-29 Andy Piper * code-process.el (call-process): dynamically decide process - coding type. + coding type. 1998-04-29 Jim Radford @@ -6429,7 +2763,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. @@ -6481,7 +2815,7 @@ 1998-04-25 Oscar Figueiredo * info.el (Info-parse-dir-entries): Fixed regexp - (Info-build-dir-anew): Remove full suffix and capitalize info file + (Info-build-dir-anew): Remove full suffix and capitalize info file name for files with no @direntry (Info-batch-rebuild-dir): New function (Info-suffixed-file): Check for regular files instead of simple @@ -6503,7 +2837,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. @@ -6547,7 +2881,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. @@ -6564,7 +2898,7 @@ * frame.el (get-frame-for-buffer-default-instance-limit): defcustom it for options menu handling. - * font-lock.el (font-lock-mode): defcustom and autoload the variable + * font-lock.el (font-lock-mode): defcustom and autolaod the variable font-lock-mode for options menu handling. * cus-start.el: added Custom properties to overwrite-mode for @@ -6595,11 +2929,11 @@ 1998-04-19 Oscar Figueiredo * info.el (Info-maybe-update-dir): Bug fix in `conservative' behaviour - (Info-build-dir-anew): Add a final newline. - (Info-build-dir-anew): Do not issue warning when rebuilding policy + (Info-build-dir-anew): Add a final newline. + (Info-build-dir-anew): Do not issue warning when rebuilding policy is `always' (Info-rebuild-dir): Ditto - + * dumped-lisp.el (preloaded-file-list): Added ldap.el 1998-04-21 SL Baur @@ -6613,7 +2947,7 @@ 1998-04-19 SL Baur - * packages.el (package-locations): infodock-packages must override + * packages.el (package-locations): infodock-packages must override mule-packages and packages. 1998-04-19 Jonathan Harris @@ -6642,7 +2976,7 @@ * packages.el, setup-paths.el: Set various path searching depths to 1. - * packages.el (packages-hierarchy-depth): + * packages.el (packages-hierarchy-depth): (packages-load-path-depth): Introduced and used. * setup-paths.el (paths-load-path-depth): Introduced and used. @@ -6652,12 +2986,12 @@ 1998-04-15 Michael Sperber [Mr. Preprocessor] - * setup-paths.el (paths-construct-info-path): Removed + * setup-paths.el (paths-construct-info-path): Removed dependency on behavior of (file-name-as-directory ""). 1998-04-09 Oscar Figueiredo - * ldap.el (ldap-search): Adapt to the new low-level API using ldap + * ldap.el (ldap-search): Adapt to the new low-level API using ldap lisp objects 1998-04-14 Michael Sperber [Mr. Preprocessor] @@ -6669,7 +3003,7 @@ * wid-edit.el: We cannot just set the help-echo or balloon-help properties for an extent based on the :help-echo widget property, since help-echo and balloon-help cause an EXTENT to - get passed in, where :help-echo functions are expecting a WIDGET + get passed in, where :help-echo functions are expecting a WIDGET 1998-04-15 Kirill M. Katsnelson @@ -6686,7 +3020,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] @@ -6785,7 +3119,7 @@ * dump-paths.el, startup.el: Removed package-path as a global variable. - * package-admin.el (package-admin-add-single-file-package): + * package-admin.el (package-admin-add-single-file-package): (package-admin-add-binary-package): Changed package-path to late-packages. @@ -6803,7 +3137,7 @@ * x-toolbar.el: Added toolbar-vector-xxxxxx defvars. Modified initial-toolbar-spec to use new toolbar-vector-xxxxxx defvars. This - eases the use of toolbar-add/kill-item functions. + eases the use of toolbar-add/kill-item functions. 1998-04-07 Kirill M. Katsnelson @@ -6817,11 +3151,11 @@ (Info-rebuild-dir): Appropriately parse multi-line description strings, and multi-section dir files. Issue warning when dir is rebuilt as temporary - (Info-build-dir-anew): Issue warning when dir is built as + (Info-build-dir-anew): Issue warning when dir is built as temporary 1998-04-04 Kirill M. Katsnelson - + * list-mode.el (list-mode-map): Bind highlight motion commands to standard keys left, right, C-b and C-f. @@ -6841,7 +3175,7 @@ * isearch-mode.el (isearch-just-started): New variable. (isearch-mode): Set it. - (isearch-repeat): Advance one character forward only if the search + (isearch-repeat): Advance one character forward only if the search was successful, and was not just started. (isearch-repeat): Clear isearch-just-started. @@ -6878,7 +3212,7 @@ 1998-03-30 Kyle Jones - * loaddefs.el: Don't set debug-ignored-errors; leave + * loaddefs.el: Don't set debug-ignored-errors; leave its default value set to nil. 1998-03-29 Damon Lipparelli @@ -6888,7 +3222,7 @@ 1998-03-29 Oscar Figueiredo * info.el (Info-rebuild-outdated-dir): New custom var - (Info-insert-node): Create/update dir file when needed, ie when it + (Info-insert-node): Create/update dir file when needed, ie when it does not exist or is older than some info files in directory 1998-04-01 Michael Sperber [Mr. Preprocessor] @@ -7083,7 +3417,7 @@ 1998-03-18 SL Baur * frame.el (frame-initialize): Use `delete-console' instead of - `delete-device' to delete the stream console to match the usage in + `delete-device' to delete the stream console to match the usage in Fkill_emacs. 1998-03-16 SL Baur @@ -7123,11 +3457,11 @@ 1998-03-03 Kirill M. Katsnelson * msw-glyphs.el: New file. Defines TTY-style glyphs for - mswindows. Must be reworked along with glyphs.el, or + mswindows. Must be reworked along with glyphs.el, or merged into it, after there is images support. * dumped-lisp.el (preloaded-file-list): Dump msw-glyphs.el when - 'mswindows. + 'mswindows. 1998-03-13 SL Baur @@ -7137,7 +3471,7 @@ 1998-03-11 Pete Ware - * files.el (set-auto-mode): If a mode is not fboundp, check to see + * files.el (set-auto-mode): If a mode is not fboundp, check to see if there is an existing package that handles it and warn the user about that mode. @@ -7158,7 +3492,7 @@ 1998-03-10 Glynn Clements - * files.el (backup-enable-predicate): fix breakage introduced + * files.el (backup-enable-predicate): fix breakage introduced by TMPDIR patch. 1998-03-09 Kyle Jones @@ -7329,14 +3663,14 @@ 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 decided in `mouse-drag-modeline'. (mouse-drag-modeline): A button release event is considered a mouse click is both X (modeline scroll) and Y (modeline drag) pos - stay unchanged. + stay unchanged. 1998-02-25 SL Baur @@ -7387,20 +3721,20 @@ if it exists, becasuse 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 + showing the temp buffer. killing the buffer fucks with the window configuration, hosing temp-buffer-show-function. -1998-02-23 Didier Verna - - * modeline.el (mouse-drag-modeline): +1998-02-23 Didier Verna + + * modeline.el (mouse-drag-modeline): - Always scroll the modeline that was originally clicked on. - - Use x pixels instead of x characters (which doesn't work anyway) + - Use x pixels instead of x characters (which doesn't work anyway) as horizontal reference for modeline dragging. This allows us to keep on dragging the modeline even if the motion event occurs in - another window. - -1998-02-23 Didier Verna + another window. + +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 @@ -7427,10 +3761,10 @@ 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 + function to handle correctly the case of a toolbar one side of the window: scrolling will not necessarily happen. 1998-02-17 Kyle Jones @@ -7449,20 +3783,20 @@ * autoload.el (generate-file-autoloads-1): Don't force an extra line out when copying on-the-same line autoloads. - * x-menubar.el (default-menubar): Add Sokoban to the menubar if it + * x-menubar.el (default-menubar): Add Sokoban to the menubar if it is installed. 1998-02-14 Martin Buchholz - * x11/x-win-xfree86.el (x-win-init-xfree86): - * x11/x-win-sun.el (x-win-init-sun): - * x11/x-init.el (x-initialize-compose): + * x11/x-win-xfree86.el (x-win-init-xfree86): + * x11/x-win-sun.el (x-win-init-sun): + * x11/x-init.el (x-initialize-compose): * prim/simple.el: - (backward-or-forward-kill-sexp): - (backward-or-forward-kill-sentence): - (backward-or-forward-kill-word): - (backward-or-forward-delete-char): - * prim/isearch-mode.el (isearch-help-or-delete-char): + (backward-or-forward-kill-sexp): + (backward-or-forward-kill-sentence): + (backward-or-forward-kill-word): + (backward-or-forward-delete-char): + * prim/isearch-mode.el (isearch-help-or-delete-char): Use x-keysym-on-keyboard-sans-modifiers-p instead of x-keysym-on-keyboard-p to detect backspace. Use symbols instead of strings (now deprecated) with x-keysym-*-p. @@ -7561,7 +3895,7 @@ 1997-06-15 Richard Stallman * text-mode.el (text-mode): Let all-white lines separate paragraphs. - + 1997-06-11 Richard Stallman * text-mode.el (paragraph-indent-text-mode): @@ -7574,7 +3908,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" @@ -7654,7 +3988,7 @@ * about.el: Add xemacs.org email manager. - * package-get-base.el (package-get-base): Updated with most recent + * package-get-base.el (package-get-base): Updated with most recent package updates. 1998-01-14 Jens-Ulrik Holger Petersen @@ -7671,7 +4005,7 @@ (describe-key): Use `princ' "%s" to print object. (describe-function-1): Use `princ' "%s" to print object. Commented out alias lines removed. - (help-pretty-print-limit): New variable to control pretty-printing + (help-pretty-print-limit): New variable to control pretty-printing of variable values. (help-maybe-pretty-print-value): Steve wins! Renamed back from `help-pretty-print-value' again. Only print-print when OBJECT is @@ -7690,9 +4024,9 @@ 1998-01-13 Martin Buchholz - * lisp/packages.el: - * lisp/package-admin.el: - * lisp/build-report.el: + * lisp/packages.el: + * lisp/package-admin.el: + * lisp/build-report.el: Fix typos. 1998-01-14 Christoph Wedler @@ -7757,7 +4091,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. @@ -7781,7 +4115,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' @@ -7848,7 +4182,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). @@ -7875,10 +4209,10 @@ * package-get.el: Changes to work with real data. From Pete Ware - * packages.el (packages-reload-autoloads): Guard load for the time + * packages.el (packages-reload-autoloads): Guard load for the time being. - * update-elc.el ("packages.el"): Force loading packages.el instead + * update-elc.el ("packages.el"): Force loading packages.el instead of possibly out-of-date packges.elc. * make-docfile.el ("packages.el"): Ditto. @@ -7934,7 +4268,7 @@ 1997-12-29 Colin Rafferty - * packages.el (packages-find-packages-1): Made it signal a warning + * packages.el (packages-find-packages-1): Made it signal a warning for an error in an auto-autoload.el file. 1997-12-30 SL Baur @@ -8075,10 +4409,10 @@ 1997-12-18 SL Baur - * startup.el (set-default-load-path): Make sure lisp and site-lisp + * startup.el (set-default-load-path): Make sure lisp and site-lisp get trailing slashes when added to the load-path. - * x-init.el (init-x-win): Locate where XEmacs X localization files + * x-init.el (init-x-win): Locate where XEmacs X localization files are. 1997-12-18 Kyle Jones @@ -8098,7 +4432,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. @@ -8173,11 +4507,11 @@ * startup.el (set-default-load-path): Only search package-path when not running temacs. - * dumped-lisp.el (preloaded-file-list): Remove Egg/Its dumped lisp + * dumped-lisp.el (preloaded-file-list): Remove Egg/Its dumped lisp files. * loadup.el: Correct commentary. Reformatting. - (really-early-error-handler): Use absolute path to the + (really-early-error-handler): Use absolute path to the first dumped-lisp.el file. (really-early-error-handler): Print full path name of each dumped lisp file (inherited from InfoDock). @@ -8217,7 +4551,7 @@ 1997-12-15 Hrvoje Niksic - * modeline.el (mouse-drag-modeline): Give the modeline a "pressed" + * modeline.el (mouse-drag-modeline): Give the modeline a "pressed" look. 1997-12-16 Oscar Figueiredo @@ -8233,7 +4567,7 @@ 1997-12-17 Hrvoje Niksic - * etags.el (get-tag-table-buffer): Use explicit lists as arguments + * etags.el (get-tag-table-buffer): Use explicit lists as arguments to `ecase'. 1997-12-14 SL Baur diff -r 12e008d41344 -r 697ef44129c6 lisp/ChangeLog.1 --- a/lisp/ChangeLog.1 Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/ChangeLog.1 Mon Aug 13 11:20:41 2007 +0200 @@ -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 @@ -1005,7 +1005,7 @@ 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,5 +8050,7 @@ 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 12e008d41344 -r 697ef44129c6 lisp/abbrev.el --- a/lisp/abbrev.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/abbrev.el Mon Aug 13 11:20:41 2007 +0200 @@ -419,17 +419,6 @@ (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; @@ -461,7 +450,13 @@ (defun add-abbrev (table type arg) ;; XEmacs change: - (let ((exp (abbrev-string-to-be-defined arg)) + (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)))))) name) (setq name (read-string (format (if exp "%s abbrev for \"%s\": " @@ -474,14 +469,6 @@ 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 12e008d41344 -r 697ef44129c6 lisp/about.el --- a/lisp/about.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/about.el Mon Aug 13 11:20:41 2007 +0200 @@ -4,7 +4,7 @@ ;; Keywords: extensions ;; Version: 2.4 -;; Maintainer: Hrvoje Niksic +;; Maintainer: Hrvoje Niksic ;; This file is part of XEmacs. @@ -25,8 +25,8 @@ ;;; Synched up with: Not in FSF. -;; Original code: Jamie Zawinski -;; Text: Ben Wing , Jamie Zawinski +;; Original code: Jamie Zawinski +;; Text: Ben Wing , Jamie Zawinski ;; Hard: Amiga 1000, Progressive Peripherals Frame Grabber. ;; Soft: FG 2.0, DigiPaint 3.0, pbmplus (dec 91), xv 3.0. ;; Modified for 19.11 by Eduardo Pelegri-Llopart @@ -35,7 +35,7 @@ ;; 19.13 and 19.14 updating done by Chuck Thompson. ;; 19.15 and 20.0 updating done by Steve Baur and Martin Buchholz. -;; Completely rewritten for 20.3 by Hrvoje Niksic . +;; Completely rewritten for 20.3 by Hrvoje Niksic . ;; The original had no version numbers; I numbered the rewrite as 2.0. ;; Many things in this file are to gag. Ideally, we should just use @@ -56,22 +56,21 @@ ;; `about-maintainer-info' (and maybe `about-hackers'. (defvar xemacs-hackers '((ajc "Andrew Cosgriff" "ajc@bing.wattle.id.au") - (aj "Andreas Jaeger" "aj@suse.de") (baw "Barry Warsaw" "bwarsaw@python.org") - (bw "Bob Weiner" "weiner@beopen.com") + (bw "Bob Weiner" "weiner@altrasoft.com") (chr "Christian Nybø" "chr@mediascience.no") (cthomp "Chuck Thompson" "cthomp@xemacs.org") (dmoore "David Moore" "dmoore@ucsd.edu") (dkindred "Darrell Kindred" "dkindred@cmu.edu") (dv "Didier Verna" "verna@inf.enst.fr") - (hniksic "Hrvoje Niksic" "hniksic@xemacs.org") + (hniksic "Hrvoje Niksic" "hniksic@srce.hr") (jareth "Jareth Hein" "jareth@camelot.co.jp") (jason "Jason Mastaler" "jason@xemacs.org") (jens "Jens Lautenbacher" "jens@lemcbed.lem.uni-karlsruhe.de") (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@xemacs.org") + (jwz "Jamie Zawinski" "jwz@netscape.com") + (kazz "IENAGA Kazuyuki" "ienaga@jsys.co.jp") (kyle "Kyle Jones" "kyle_jones@wonderworks.com") (larsi "Lars Magne Ingebrigtsen" "larsi@gnus.org") (marcpa "Marc Paquette" "marcpa@CAM.ORG") @@ -90,7 +89,7 @@ (stig "Jonathan Stigelman" "stig@hackvan.com") (stigb "Stig Bjorlykke" "stigb@tihlde.hist.no") (thiessel "Marcus Thiessel" "marcus@xemacs.org") - (vladimir "Vladimir Ivanovic" "vladimir@acm.com") + (vladimir "Vladimir Ivanovic" "vladimir@mri.com") (wing "Ben Wing" "ben@xemacs.org") (wmperry "William Perry" "wmperry@aventail.com")) "Alist of XEmacs hackers.") @@ -99,29 +98,29 @@ ;; It is preferred to a simple string, because it makes maintenance ;; easier. Please add new URLs to this list. (defvar about-url-alist - '((ajc . "http://www-personal.monash.edu.au/~ajc/") - (beopen . "http://www.beopen.com/") - (ben . "http://www.666.com/ben/") + '((ajc . "http://www-personal.monash.edu.au/~ajc/") + (altrasoft . "http://www.altrasoft.com/") + (ben . "http://www.666.com/ben/") (ben-xemacs . "http://www.666.com/xemacs/") - (baw . "http://www.python.org/~bwarsaw/") - (cc-mode . "http://www.python.org/ftp/emacs/") - (chr . "http://www.xemacs.org/faq/") - (dkindred . "http://www.cs.cmu.edu/People/dkindred/me.html") - (dmoore . "http://oj.egbt.org/dmoore/") - (jason . "http://www.mastaler.com/") - (juhp . "http://www.kurims.kyoto-u.ac.jp/~petersen/") - (jwz . "http://www.jwz.org/") - (kazz . "http://www.imasy.or.jp/~kazz/") - (kyle . "http://www.wonderworks.com/kyle/") - (larsi . "http://www.ifi.uio.no/~larsi/") - (marcpa . "http://www.positron911.com/products/power.htm") - (ograf . "http://www.fga.de/~ograf/") - (pez . "http://www.dwwc.com/") - (piper . "http://www.xemacs.freeserve.co.uk/") - (vin . "http://www.upa.org/") - (stigb . "http://www.tihlde.hist.no/~stigb/") - (wget . "ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/") - (xemacs . "http://www.xemacs.org/")) + (baw . "http://www.python.org/~bwarsaw/") + (cc-mode . "http://www.python.org/ftp/emacs/") + (chr . "http://www.xemacs.org/faq/") + (dkindred . "http://www.cs.cmu.edu/People/dkindred/me.html") + (dmoore . "http://oj.egbt.org/dmoore/") + (jason . "http://www.mastaler.com/") + (juhp . "http://www.kurims.kyoto-u.ac.jp/~petersen/") + (jwz . "http://people.netscape.com/jwz/") + (kazz . "http://www.imasy.or.jp/~kazz/") + (kyle . "http://www.wonderworks.com/kyle/") + (larsi . "http://www.ifi.uio.no/~larsi/") + (marcpa . "http://www.positron911.com/products/power.htm") + (ograf . "http://www.fga.de/~ograf/") + (pez . "http://www.dwwc.com/") + (piper . "http://www.xemacs.freeserve.co.uk/") + (vin . "http://www.upa.org/") + (stigb . "http://www.tihlde.hist.no/~stigb/") + (wget . "ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/") + (xemacs . "http://www.xemacs.org/")) "Some of the more important URLs.") (defvar about-left-margin 3) @@ -660,8 +659,8 @@ (widget-insert "Cars are evil. Ride a bike.\n")) (vladimir (widget-insert "\ -Former technical lead for XEmacs at Sun. He is now with a startup -marketing embedded Java databases.\n")) +Former technical lead for XEmacs at Sun. He is now with Microtec +Research Inc., working on embedded systems development tools.\n")) (stig (widget-insert "\ Stig is sort of a tool fetishist. He has a hate/love relationship @@ -718,12 +717,12 @@ (widget-insert "\ Author of the Hyperbole everyday information management hypertext system and the OO-Browser multi-language code browser. He also -designed the BeOpen InfoDock integrated development environment +designed the Altrasoft InfoDock integrated development environment for software engineers. It runs atop XEmacs and is available from -his firm, BeOpen, which offers distributions, custom development, +his firm, Altrasoft, which offers distributions, custom development, support, and training packages for corporate users of XEmacs, GNU Emacs and InfoDock. See ") - (about-url-link 'beopen "Visit BeOpen WWW page") + (about-url-link 'altrasoft "Visit Altrasoft WWW page") (widget-insert ". His interests include user interfaces, information management, @@ -988,14 +987,6 @@ violation of HTML DTD's. After graduation, spring 1999, he'll be looking for a job involving lisp programming, French and Russian.") (widget-insert ".\n")) - (aj - (widget-insert "\ -In the XEmacs team I'm responsible for the packages which means mainly -applying patches and packaging the packages. - -I'm a software developer working for the SuSE Labs of the Linux -distributor SuSE. My main task is to improve the GNU C library.") - (widget-insert ".\n")) )) ;; Setup the buffer for a maintainer. @@ -1051,8 +1042,8 @@ some of the contributors. We have no doubt forgotten someone; we apologize! You can see some of our faces under the links.\n\n") (about-show-linked-info 'vladimir "\ -Former technical lead for XEmacs at Sun. He is now with a startup -marketing embedded Java databases.\n") +Former technical lead for XEmacs at Sun Microsystems. He is now with +Microtec Research Inc., working on embedded systems development tools.\n") (about-show-linked-info 'stig "\ Peripatetic uninominal Emacs hacker. Stig sometimes operates out of a big white van set up for nomadic living and hacking. Implemented the @@ -1072,9 +1063,9 @@ (about-show-linked-info 'bw "\ Author of the Hyperbole everyday information management hypertext system and the OO-Browser multi-language code browser. He also -designed the BeOpen InfoDock integrated development environment +designed the Altrasoft InfoDock integrated development environment for software engineers. It runs atop XEmacs and is available from -his firm, BeOpen, which offers custom development and support packages +his firm, Altrasoft, which offers custom development and support packages for corporate users of XEmacs, GNU Emacs and InfoDock. His interests include user interfaces, information management, CASE tools, communications and enterprise integration.\n") @@ -1206,9 +1197,6 @@ Beta tester and last hacker of calendar.\n") (about-show-linked-info 'chr "\ Maintainer of the XEmacs FAQ and proud author of `zap-up-to-char'.\n") - (about-show-linked-info 'aj "\ -`Package Patch Tender', beta tester and GNU libc developer.\n") - (flet ((print-short (name addr &optional shortinfo) (concat (about-with-face name 'italic) (about-tabs name) @@ -1275,7 +1263,7 @@ (print-short "Per Abrahamsen" "abraham@dina.kvl.dk") (print-short "Gary Adams" "gra@zeppo.East.Sun.COM") (print-short "Gennady Agranov" "agranov@csa.CS.Technion.Ac.IL") - (print-short "Adrian Aichner" "adrian@xemacs.org") + (print-short "Adrian Aichner" "aichner@ecf.teradyne.com") (print-short "Mark Allender" "allender@vnet.IBM.COM") (print-short "Stephen R. Anderson" "sra@bloch.ling.yale.edu") (print-short "Butch Anton" "butch@zaphod.uchicago.edu") @@ -1325,7 +1313,7 @@ (print-short "Jonathan Edwards" "edwards@intranet.com") (print-short "Eric Eide" "eeide@asylum.cs.utah.edu") (print-short "EKR" "ekr@terisa.com") - (print-short "Gunnar Evermann" "ge204@eng.cam.ac.uk") + (print-short "Gunnar Evermann" "Gunnar.Evermann@nats.informatik.uni-hamburg.de") (print-short "Oscar Figueiredo" "Oscar.Figueiredo@di.epfl.ch") (print-short "David Fletcher" "frodo@tsunami.com") (print-short "Paul Flinders" "ptf@delcam.co.uk") @@ -1358,7 +1346,6 @@ (print-short "ChangGil Han" "cghan@phys401.phys.pusan.ac.kr") (print-short "Derek Harding" "dharding@lssec.bt.co.uk") (print-short "Michael Harnois" "mharnois@sbt.net") - (print-short "Yoshiki Hayashi" "yoshiki@xemacs.org") (print-short "John Haxby" "J.Haxby@isode.com") (print-short "Karl M. Hegbloom" "karlheg@inetarena.com") (print-short "Benedikt Heinen" "beh@icemark.thenet.ch") @@ -1373,6 +1360,7 @@ (print-short "Tudor Hulubei" "tudor@cs.unh.edu") (print-short "Tatsuya Ichikawa" "ichikawa@hv.epson.co.jp") (print-short "Andrew Innes" "andrewi@harlequin.co.uk") + (print-short "Andreas Jaeger" "aj@arthur.rhein-neckar.de") (print-short "Markku Jarvinen" "Markku.Jarvinen@simpukka.funet.fi") (print-short "Robin Jeffries" "robin.jeffries@sun.com") (print-short "Philip Johnson" "johnson@uhics.ics.Hawaii.Edu") diff -r 12e008d41344 -r 697ef44129c6 lisp/alist.el --- a/lisp/alist.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/alist.el Mon Aug 13 11:20:41 2007 +0200 @@ -22,18 +22,7 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. - -;;;###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)))))) - +;;; Code: ;;;###autoload (defun put-alist (item value alist) diff -r 12e008d41344 -r 697ef44129c6 lisp/apropos.el --- a/lisp/apropos.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/apropos.el Mon Aug 13 11:20:41 2007 +0200 @@ -4,7 +4,7 @@ ;; Author: Joe Wells ;; Rewritten: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389 -;; Maintainer: SL Baur +;; Maintainer: SL Baur ;; Keywords: help ;; This file is part of XEmacs. @@ -107,7 +107,6 @@ (defvar apropos-mode-map (let ((map (make-sparse-keymap))) (define-key map [(control m)] 'apropos-follow) - (define-key map [return] 'apropos-follow) (define-key map [(button2up)] 'apropos-mouse-follow) (define-key map [(button2)] 'undefined) map) @@ -377,8 +376,8 @@ ;; 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 doc) - (insert ?\^_) + (let (type symbol (sepa 2) sepb beg end) + (princ ?\^_) (backward-char) (insert-file-contents (concat doc-directory internal-doc-file-name)) (forward-char) @@ -509,9 +508,6 @@ (let ((p apropos-accumulator) (old-buffer (current-buffer)) symbol item point1 point2) - ;; Mostly useless but to provide better keymap - ;; explanation. help-mode-map will be used instead. - (use-local-map apropos-mode-map) ;; XEmacs change from (if window-system (if (device-on-window-system-p) (progn @@ -579,8 +575,6 @@ apropos-item)) (if apropos-symbol-face (put-text-property point1 point2 'face apropos-symbol-face)) - ;; Add text-property on symbol, too. - (put-text-property point1 point2 'keymap apropos-mode-map) (apropos-print-doc 'describe-function 1 (if (commandp symbol) "Command" diff -r 12e008d41344 -r 697ef44129c6 lisp/auto-autoloads.el --- a/lisp/auto-autoloads.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/auto-autoloads.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ ;;; DO NOT MODIFY THIS FILE -(if (featurep 'lisp-autoloads) (error "Already loaded")) +(if (featurep 'Standard-autoloads) (error "Already loaded")) ;;;### (autoloads nil "abbrev" "lisp/abbrev.el") @@ -12,11 +12,7 @@ ;;;*** -;;;### (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) +;;;### (autoloads (set-modified-alist modify-alist remove-alist set-alist del-alist put-alist) "alist" "lisp/alist.el") (autoload 'put-alist "alist" "\ Modify ALIST to set VALUE to ITEM. @@ -75,7 +71,7 @@ ;;;*** -;;;### (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") +;;;### (autoloads (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. @@ -87,7 +83,7 @@ (autoload 'update-file-autoloads "autoload" "\ Update the autoloads for FILE in `generated-autoload-file' \(which FILE might bind in its local variables). -This function refuses to update autoloads files." t nil) +This functions 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) @@ -95,9 +91,7 @@ (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. -Note that, if this function is called from `batch-update-directory', -`generated-autoload-file' was rebound in that function." t nil) +Obsolete autoload entries for files that no longer exist are deleted." t nil) (autoload 'batch-update-autoloads "autoload" "\ Update the autoloads for the files or directories on the command line. @@ -109,14 +103,9 @@ on the command line." nil nil) (autoload 'batch-update-directory "autoload" "\ -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) +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) ;;;*** @@ -128,23 +117,7 @@ ;;;*** -;;;### (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") +;;;### (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") (autoload 'byte-force-recompile "bytecomp" "\ Recompile every `.el' file in DIRECTORY that already has a `.elc' file. @@ -221,11 +194,6 @@ 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) @@ -236,10 +204,18 @@ ;;;*** -;;;### (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") +;;;### (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") (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, @@ -587,7 +563,7 @@ ;;;*** -;;;### (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") +;;;### (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") (autoload 'customize-set-value "cus-edit" "\ Set VARIABLE to VALUE. VALUE is a Lisp object. @@ -596,9 +572,7 @@ it were the arg to `interactive' (which see) to interactively read the value. If VARIABLE has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If given a prefix (or a COMMENT argument), also prompt for a comment." t nil) +`:prompt-value' property of that widget will be used for reading the value." t nil) (autoload 'customize-set-variable "cus-edit" "\ Set the default for VARIABLE to VALUE. VALUE is a Lisp object. @@ -613,9 +587,7 @@ it were the arg to `interactive' (which see) to interactively read the value. If VARIABLE has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If given a prefix (or a COMMENT argument), also prompt for a comment." t nil) +`:prompt-value' property of that widget will be used for reading the value. " t nil) (autoload 'customize-save-variable "cus-edit" "\ Set the default for VARIABLE to VALUE, and save it for future sessions. @@ -629,9 +601,7 @@ it were the arg to `interactive' (which see) to interactively read the value. If VARIABLE has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If given a prefix (or a COMMENT argument), also prompt for a comment." t nil) +`:prompt-value' property of that widget will be used for reading the value. " t nil) (autoload 'customize "cus-edit" "\ Select a customization buffer which you can use to set user options. @@ -708,6 +678,8 @@ (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) @@ -724,12 +696,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") +;;;### (autoloads (custom-set-faces custom-set-face-update-spec custom-declare-face) "cus-face" "lisp/cus-face.el") (autoload 'custom-declare-face "cus-face" "\ Like `defface', but FACE is evaluated as a normal argument." nil nil) @@ -740,51 +709,15 @@ (autoload 'custom-set-faces "cus-face" "\ Initialize faces according to user preferences. -This asociates the setting with the USER theme. The arguments should be a list where each entry has the form: - (FACE SPEC [NOW [COMMENT]]) + (FACE SPEC [NOW]) SPEC will be stored as the saved value for FACE. If NOW is present and non-nil, FACE will also be created according to SPEC. -COMMENT is a string comment about FACE. See `defface' for the format of SPEC." nil nil) -(autoload 'custom-theme-set-faces "cus-face" "\ -Initialize faces according to settings specified by args. -Records the settings as belonging to THEME. - -See `custom-set-faces' for a description of the arguments ARGS." nil nil) - -(autoload 'custom-theme-face-value "cus-face" "\ -Return spec of FACE in THEME if the THEME modifies the -FACE. Nil otherwise." nil nil) - -(autoload 'custom-theme-reset-faces "cus-face" nil nil nil) - -(autoload 'custom-reset-faces "cus-face" "\ -Reset the value of the face to values previously defined. -Assosiate 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") @@ -840,18 +773,13 @@ ;;;*** -;;;### (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") +;;;### (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") (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 @@ -876,7 +804,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, in another window. +*Find tag whose name contains TAGNAME. 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 @@ -978,123 +906,95 @@ (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 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 ...) +A list of the keywords to highlight. +Each element should be of the 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'. + MATCHER + (MATCHER . MATCH) + (MATCHER . FACENAME) + (MATCHER . HIGHLIGHT) + (MATCHER HIGHLIGHT ...) + (eval . FORM) - (\"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. +where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. - (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.) +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. For highlighting single items, typically only MATCH-HIGHLIGHT is required. -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. +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. 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) @@ -1157,30 +1057,6 @@ ;;;*** -;;;### (autoloads (font-menu-weight-constructor font-menu-size-constructor font-menu-family-constructor reset-device-font-menus) "font-menu" "lisp/font-menu.el") - -(defcustom font-menu-ignore-scaled-fonts nil "*If non-nil, then the font menu will try to show only bitmap fonts." :type 'boolean :group 'font-menu) - -(defcustom font-menu-this-frame-only-p nil "*If non-nil, then changing the default font from the font menu will only\naffect one frame instead of all frames." :type 'boolean :group 'font-menu) - -(fset 'install-font-menus 'reset-device-font-menus) - -(autoload 'reset-device-font-menus "font-menu" "\ -Generates the `Font', `Size', and `Weight' submenus for the Options menu. -This is run the first time that a font-menu is needed for each device. -If you don't like the lazy invocation of this function, you can add it to -`create-device-hook' and that will make the font menus respond more quickly -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) - -(autoload 'font-menu-family-constructor "font-menu" nil nil nil) - -(autoload 'font-menu-size-constructor "font-menu" nil nil nil) - -(autoload 'font-menu-weight-constructor "font-menu" nil nil nil) - -;;;*** - ;;;### (autoloads (x-font-build-cache font-default-size-for-device font-default-encoding-for-device font-default-registry-for-device font-default-family-for-device font-default-object-for-device font-default-font-for-device font-create-object) "font" "lisp/font.el") (autoload 'font-create-object "font" nil nil nil) @@ -1279,15 +1155,9 @@ 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. - -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))") +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.") (autoload 'info "info" "\ Enter Info, the documentation browser. @@ -1358,20 +1228,6 @@ ;;;*** -;;;### (autoloads (mswindows-reset-device-font-menus) "msw-font-menu" "lisp/msw-font-menu.el") - -(autoload 'mswindows-reset-device-font-menus "msw-font-menu" "\ -Generates the `Font', `Size', and `Weight' submenus for the Options menu. -This is run the first time that a font-menu is needed for each device. -If you don't like the lazy invocation of this function, you can add it to -`create-device-hook' and that will make the font menus respond more quickly -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* mswindows-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 mswindows-font-regexp name) (setq family (match-string 1 name)) (setq entry (vassoc family (aref dcache 0)))) (when (and (null entry) (string-match mswindows-font-regexp truename)) (setq family (match-string 1 truename)) (setq entry (vassoc family (aref dcache 0)))) (when (null entry) (return-from mswindows-font-menu-font-data (make-vector 5 nil))) (when (string-match mswindows-font-regexp name) (setq weight (match-string 2 name)) (setq size (string-to-int (match-string 4 name)))) (when (string-match mswindows-font-regexp truename) (when (not (member weight (aref entry 1))) (setq weight (match-string 2 truename))) (when (not (member size (aref entry 2))) (setq size (string-to-int (match-string 4 truename)))) (setq slant (match-string 5 truename))) (vector entry family size weight slant))) - -;;;*** - ;;;### (autoloads (mwheel-install) "mwheel" "lisp/mwheel.el") (autoload 'mwheel-install "mwheel" "\ @@ -1441,8 +1297,6 @@ 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") ("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) @@ -1508,7 +1362,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. @@ -1524,7 +1378,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 @@ -1623,35 +1477,26 @@ ;;;### (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. +Delete (don't save) text in rectangle with point and mark as corners. The same range of columns is deleted in each line starting with the line -where the region begins and ending with the line where the region ends. - -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) +where the region begins and ending with the line where the region ends." t nil) (autoload 'delete-extract-rectangle "rect" "\ -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." nil nil) +Delete contents of rectangle and return it as a list of strings. +Arguments START and END are the corners of the rectangle. +The value is list of strings, one for each line of the rectangle." nil nil) (autoload 'extract-rectangle "rect" "\ -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) +Return contents of rectangle with corners at START and END. +Value is list of strings, one for each line of the rectangle." nil nil) (defvar killed-rectangle nil "\ -Rectangle for `yank-rectangle' to insert.") +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) +Delete rectangle with corners at point and mark; save as last killed one. +Calling from program, supply two args START and END, buffer positions. +But in programs you might prefer to use `delete-extract-rectangle'." t nil) (autoload 'yank-rectangle "rect" "\ Yank the last killed rectangle with upper left corner at point." t nil) @@ -1665,28 +1510,21 @@ and point is at the lower right corner." nil nil) (autoload 'open-rectangle "rect" "\ -Blank out the region-rectangle, shifting text right. - -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, fill with blanks even if there is no text -on the right side of the rectangle." t nil) +Blank out rectangle with corners at point and mark, shifting text right. +The text previously in the region is not overwritten by the blanks, +but instead winds up to the right of the rectangle." t nil) (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. -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) +Called from a program, takes three args; START, END and STRING." t nil) (autoload 'clear-rectangle "rect" "\ -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." t nil) +Blank out rectangle with corners at point and mark. +The text previously in the region is overwritten by the blanks. +When called from a program, requires two args which specify the corners." t nil) ;;;*** @@ -1881,9 +1719,15 @@ ;;;*** -;;;### (autoloads (x-reset-device-font-menus) "x-font-menu" "lisp/x-font-menu.el") +;;;### (autoloads (font-menu-weight-constructor font-menu-size-constructor font-menu-family-constructor reset-device-font-menus) "x-font-menu" "lisp/x-font-menu.el") + +(defcustom font-menu-ignore-scaled-fonts t "*If non-nil, then the font menu will try to show only bitmap fonts." :type 'boolean :group 'font-menu) -(autoload 'x-reset-device-font-menus "x-font-menu" "\ +(defcustom font-menu-this-frame-only-p nil "*If non-nil, then changing the default font from the font menu will only\naffect one frame instead of all frames." :type 'boolean :group 'font-menu) + +(fset 'install-font-menus 'reset-device-font-menus) + +(autoload 'reset-device-font-menus "x-font-menu" "\ Generates the `Font', `Size', and `Weight' submenus for the Options menu. This is run the first time that a font-menu is needed for each device. If you don't like the lazy invocation of this function, you can add it to @@ -1891,7 +1735,11 @@ 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))) +(autoload 'font-menu-family-constructor "x-font-menu" nil nil nil) + +(autoload 'font-menu-size-constructor "x-font-menu" nil nil nil) + +(autoload 'font-menu-weight-constructor "x-font-menu" nil nil nil) ;;;*** @@ -1907,4 +1755,4 @@ ;;;*** -(provide 'lisp-autoloads) +(provide 'Standard-autoloads) diff -r 12e008d41344 -r 697ef44129c6 lisp/auto-save.el --- a/lisp/auto-save.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/auto-save.el Mon Aug 13 11:20:41 2007 +0200 @@ -79,7 +79,7 @@ ;;; Acknowledgement: ;; This code is loosely derived from autosave-in-tmp.el by Jamie -;; Zawinski (the version I had was last modified 22 +;; Zawinski (the version I had was last modified 22 ;; dec 90 jwz) and code submitted to ange-ftp-lovers on Sun, 5 Apr ;; 92 23:20:47 EDT by drw@BOURBAKI.MIT.EDU (Dale R. Worley). ;; auto-save.el tries to cover the functionality of those two @@ -373,7 +373,7 @@ ;; save file in the same directory as FILENAME. But if this ;; directory is not writable, use auto-save-directory-fallback. ;; FILENAME is assumed to be in non-directory form (no trailing slash). - ;; It may be a name without a directory part (presumably it really + ;; It may be a name without a directory part (pesumably it really ;; comes from a buffer name then), the fallback is used then. ;; Optional PREFIX is string to use instead of "#" to prefix name. (let ((directory (file-name-directory filename))) diff -r 12e008d41344 -r 697ef44129c6 lisp/auto-show.el --- a/lisp/auto-show.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/auto-show.el Mon Aug 13 11:20:41 2007 +0200 @@ -92,6 +92,17 @@ :type 'number :group 'auto-show) +(defun auto-show-truncationp () + "True if line truncation is enabled for the selected window." + ;; XEmacs change (use specifiers) + ;; ### There should be a more straightforward way to do this from elisp. + (or truncate-lines + (and truncate-partial-width-windows + (< (+ (window-width) + (specifier-instance left-margin-width) + (specifier-instance right-margin-width)) + (frame-width))))) + (defun auto-show-mode (arg) "Turn automatic horizontal scroll mode on or off. With arg, turn auto scrolling on if arg is positive, off otherwise. @@ -117,7 +128,7 @@ ;; XEmacs addition: (defun auto-show-should-take-action-p () - (and auto-show-mode (window-truncated-p) + (and auto-show-mode (auto-show-truncationp) (equal (window-buffer) (current-buffer)) (not (memq this-command auto-show-inhibiting-commands)))) diff -r 12e008d41344 -r 697ef44129c6 lisp/autoload.el --- a/lisp/autoload.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/autoload.el Mon Aug 13 11:20:41 2007 +0200 @@ -87,8 +87,6 @@ (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. @@ -116,12 +114,10 @@ (defun autoload-trim-file-name (file) "Returns a relative pathname of FILE including the last directory." (setq file (expand-file-name file)) - (replace-in-string - (file-relative-name file (file-name-directory - (directory-file-name - (file-name-directory file)))) - "\\\\" "/")) - + (file-relative-name file (file-name-directory + (directory-file-name + (file-name-directory file))))) + ;;;###autoload (defun generate-file-autoloads (file &optional funlist) "Insert at point a loaddefs autoload section for FILE. @@ -343,7 +339,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/" +(defvar autoload-target-directory "../lisp/prim/" "Directory to put autoload declaration file into. Unless you know what you're doing, don't mess with this.") @@ -353,11 +349,7 @@ 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. - -Note that `batch-update-directory' binds this variable to its own value, -generally the file named `autoload-file-name' in the directory being -updated.") +autoloads go somewhere else.") (defconst cusload-file-name "custom-load.el" "Generic filename ot put custom loads into. @@ -367,7 +359,7 @@ (defun update-file-autoloads (file) "Update the autoloads for FILE in `generated-autoload-file' \(which FILE might bind in its local variables). -This function refuses to update autoloads files." +This functions refuses to update autoloads files." (interactive "fUpdate autoloads for file: ") (setq file (expand-file-name file)) (when (and (file-newer-than-file-p file generated-autoload-file) @@ -466,9 +458,7 @@ (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. -Note that, if this function is called from `batch-update-directory', -`generated-autoload-file' was rebound in that function." +Obsolete autoload entries for files that no longer exist are deleted." (interactive "DUpdate autoloads for directory: ") (setq dir (expand-file-name dir)) (let ((simple-dir (file-name-as-directory @@ -542,24 +532,20 @@ (goto-char (point-max)) (insert "\n(provide '" sym ")\n"))))) -;; #### this function is almost identical, but subtly different, -;; from batch-update-autoloads. Steve, it's your responsibility to -;; clean this up. The two should be merged, but I'm not sure what -;; package-creation scripts out there might be using this. --ben +(defvar autoload-package-name nil) ;;;###autoload (defun batch-update-directory () - "Update the autoloads for the directories on the command line. -Runs `update-file-autoloads' on each file in the given directory, and must -be used only with -batch." + "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." (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 (expand-file-name autoload-file-name - arg))) + (let ((generated-autoload-file (concat arg "/" autoload-file-name))) (cond ((file-directory-p arg) (message "Updating autoloads in directory %s..." arg) @@ -575,36 +561,6 @@ ) (setq command-line-args-left nil))) -;; #### i created the following. this one and the last should be merged into -;; batch-update-autoloads. --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 12e008d41344 -r 697ef44129c6 lisp/backquote.el --- a/lisp/backquote.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/backquote.el Mon Aug 13 11:20:41 2007 +0200 @@ -44,7 +44,7 @@ ;; (b) ",.foo" is the same as ". ,foo" ;; (c) because RMS isn't interested in using this version of backquote.el ;; -;; ben@xemacs.org added ,. support back in: +;; wing@666.com; added ,. support back in: ;; (a) yes, it is in CLtl2. Read closely on page 529. ;; (b) RMS in 19.30 adds C support for ,. even if it's not really ;; handled. diff -r 12e008d41344 -r 697ef44129c6 lisp/buff-menu.el --- a/lisp/buff-menu.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/buff-menu.el Mon Aug 13 11:20:41 2007 +0200 @@ -356,8 +356,6 @@ -(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) @@ -636,11 +634,6 @@ 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 12e008d41344 -r 697ef44129c6 lisp/buffer.el --- a/lisp/buffer.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/buffer.el Mon Aug 13 11:20:41 2007 +0200 @@ -60,7 +60,11 @@ (set-buffer-major-mode buf)))) (push-window-configuration) (set-buffer buf) - (set-window-buffer (last-nonminibuf-window) buf norecord) + (or norecord (record-buffer buf)) + (set-window-buffer (if (eq (selected-window) (minibuffer-window)) + (next-window (minibuffer-window)) + (selected-window)) + buf) buf)) (defun pop-to-buffer (bufname &optional not-this-window-p on-frame) diff -r 12e008d41344 -r 697ef44129c6 lisp/build-report.el --- a/lisp/build-report.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/build-report.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,8 @@ ;; Copyright (C) 1997 Adrian Aichner -;; Author: Adrian Aichner -;; Date: Sun., Apr. 20, 1997, 1998, 1999. +;; Author: Adrian Aichner, Teradyne GmbH Munich +;; Date: Sun., Apr. 20, 1997. ;; Version: 1.35 ;; Keywords: internal @@ -138,7 +138,7 @@ ;; 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,7 +151,6 @@ (defalias 'mime-edit-insert-binary-file 'mime-editor/insert-binary-file))) -;;;###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 @@ -214,7 +213,7 @@ (progn (mime-edit-insert-tag "text" - "plain" + "plain" (concat "\nContent-Disposition: attachment;" " filename=\"" @@ -230,7 +229,7 @@ (goto-char (point-min)) (delete-matching-lines (build-report-delete)) (goto-char (point-min)) - (insert "> Contents of " + (insert "> Contents of " build-report-make-output-file "\n> keeping lines matching\n> \"" (build-report-keep) @@ -240,7 +239,7 @@ (insert "> " build-report-make-output-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." @@ -259,7 +258,7 @@ (progn (mime-edit-insert-tag "text" - "plain" + "plain" (concat "\nContent-Disposition: attachment;" " filename=\"" diff -r 12e008d41344 -r 697ef44129c6 lisp/byte-optimize.el --- a/lisp/byte-optimize.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/byte-optimize.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;;; Copyright (c) 1991, 1994 Free Software Foundation, Inc. -;; Author: Jamie Zawinski +;; Author: Jamie Zawinski ;; Hallvard Furuseth ;; Keywords: internal @@ -19,7 +19,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. @@ -32,7 +32,7 @@ ;; You can, however, make a faster pig." ;; ;; Or, to put it another way, the emacs byte compiler is a VW Bug. This code -;; makes it be a VW Bug with fuel injection and a turbocharger... You're +;; makes it be a VW Bug with fuel injection and a turbocharger... You're ;; still not going to make it go faster than 70 mph, but it might be easier ;; to get it there. ;; @@ -64,17 +64,17 @@ ;; Simple defsubsts often produce forms like ;; (let ((v1 (f1)) (v2 (f2)) ...) ;; (FN v1 v2 ...)) -;; It would be nice if we could optimize this to +;; It would be nice if we could optimize this to ;; (FN (f1) (f2) ...) ;; but we can't unless FN is dynamically-safe (it might be dynamically ;; referring to the bindings that the lambda arglist established.) ;; One of the uncountable lossages introduced by dynamic scope... ;; -;; Maybe there should be a control-structure that says "turn on +;; Maybe there should be a control-structure that says "turn on ;; fast-and-loose type-assumptive optimizations here." Then when ;; we see a form like (car foo) we can from then on assume that ;; the variable foo is of type cons, and optimize based on that. -;; But, this won't win much because of (you guessed it) dynamic +;; But, this won't win much because of (you guessed it) dynamic ;; scope. Anything down the stack could change the value. ;; (Another reason it doesn't work is that it is perfectly valid ;; to call car with a null argument.) A better approach might @@ -109,7 +109,7 @@ ;; ;; However, if there was even a single let-binding around the COND, ;; it could not be byte-compiled, because there would be an "unbind" -;; byte-op between the final "call" and "return." Adding a +;; byte-op between the final "call" and "return." Adding a ;; Bunbind_all byteop would fix this. ;; ;; (defun foo (x y z) ... (foo a b c)) @@ -131,8 +131,8 @@ ;; ;; Wouldn't it be nice if Emacs Lisp had lexical scope. ;; -;; Idea: the form (lexical-scope) in a file means that the file may be -;; compiled lexically. This proclamation is file-local. Then, within +;; Idea: the form (lexical-scope) in a file means that the file may be +;; compiled lexically. This proclamation is file-local. Then, within ;; that file, "let" would establish lexical bindings, and "let-dynamic" ;; would do things the old way. (Or we could use CL "declare" forms.) ;; We'd have to notice defvars and defconsts, since those variables should @@ -142,17 +142,17 @@ ;; in the file being compiled (doing a boundp check isn't good enough.) ;; Fdefvar() would have to be modified to add something to the plist. ;; -;; A major disadvantage of this scheme is that the interpreter and compiler -;; would have different semantics for files compiled with (dynamic-scope). +;; A major disadvantage of this scheme is that the interpreter and compiler +;; would have different semantics for files compiled with (dynamic-scope). ;; Since this would be a file-local optimization, there would be no way to -;; modify the interpreter to obey this (unless the loader was hacked +;; modify the interpreter to obey this (unless the loader was hacked ;; in some grody way, but that's a really bad idea.) ;; ;; HA! RMS removed the following paragraph from his version of ;; byte-optimize.el. ;; ;; Really the Right Thing is to make lexical scope the default across -;; the board, in the interpreter and compiler, and just FIX all of +;; the board, in the interpreter and compiler, and just FIX all of ;; the code that relies on dynamic scope of non-defvarred variables. ;; Other things to consider: @@ -166,7 +166,7 @@ ;; error free also they may act as true-constants. ;;(disassemble #'(lambda (x) (and (point) (foo)))) -;; When +;; When ;; - all but one arguments to a function are constant ;; - the non-constant argument is an if-expression (cond-expression?) ;; then the outer function can be distributed. If the guarding @@ -295,7 +295,7 @@ (cons fn (cdr form))))))) ;;; ((lambda ...) ...) -;;; +;;; (defun byte-compile-unfold-lambda (form &optional name) (or name (setq name "anonymous lambda")) (let ((lambda (car form)) @@ -350,7 +350,7 @@ (byte-compile-warn "attempt to open-code %s with too many arguments" name)) form) - (let ((newform + (let ((newform (if bindings (cons 'let (cons (nreverse bindings) body)) (cons 'progn body)))) @@ -435,28 +435,28 @@ (cons (byte-optimize-form (nth 1 form) t) (cons (byte-optimize-form (nth 2 form) for-effect) (byte-optimize-body (cdr (cdr (cdr form))) t))))) - + ((memq fn '(save-excursion save-restriction save-current-buffer)) ;; those subrs which have an implicit progn; it's not quite good ;; enough to treat these like normal function calls. ;; This can turn (save-excursion ...) into (save-excursion) which ;; will be optimized away in the lap-optimize pass. (cons fn (byte-optimize-body (cdr form) for-effect))) - + ((eq fn 'with-output-to-temp-buffer) ;; this is just like the above, except for the first argument. (cons fn (cons (byte-optimize-form (nth 1 form) nil) (byte-optimize-body (cdr (cdr form)) for-effect)))) - + ((eq fn 'if) (cons fn (cons (byte-optimize-form (nth 1 form) nil) (cons (byte-optimize-form (nth 2 form) for-effect) (byte-optimize-body (nthcdr 3 form) for-effect))))) - + ((memq fn '(and or)) ; remember, and/or are control structures. ;; take forms off the back until we can't any more. ;; In the future it could conceivably be a problem that the @@ -473,10 +473,6 @@ (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))))) @@ -484,7 +480,7 @@ (byte-compile-warn "misplaced interactive spec: %s" (prin1-to-string form)) nil) - + ((memq fn '(defun defmacro function condition-case save-window-excursion)) ;; These forms are compiled as constants or by breaking out @@ -500,7 +496,7 @@ (cons fn (cons (byte-optimize-form (nth 1 form) for-effect) (cdr (cdr form))))) - + ((eq fn 'catch) ;; the body of a catch is compiled (and thus optimized) as a ;; top-level form, so don't do it here. The tag is never @@ -518,7 +514,7 @@ (setq form (macroexpand form byte-compile-macro-environment)))) (byte-optimize-form form for-effect)) - + ((not (symbolp fn)) (or (eq 'mocklisp (car-safe fn)) ; ha! (byte-compile-warn "%s is a malformed function" @@ -536,7 +532,7 @@ ;; appending a nil here might not be necessary, but it can't hurt. (byte-optimize-form (cons 'progn (append (cdr form) '(nil))) t)) - + (t ;; Otherwise, no args can be considered to be for-effect, ;; even if the called function is for-effect, because we @@ -606,7 +602,7 @@ ((keywordp ,form)))) ;; If the function is being called with constant numeric args, -;; evaluate as much as possible at compile-time. This optimizer +;; evaluate as much as possible at compile-time. This optimizer ;; assumes that the function is associative, like + or *. (defun byte-optimize-associative-math (form) (let ((args nil) @@ -703,37 +699,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) ; (+) - (condition-case () - (eval form) - (error 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)) + (cond ((null (cdr form)) + (condition-case () + (eval form) + (error 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)))) + ;; `add1' and `sub1' are a marginally fewer instructions + ;; than `plus' and `minus', so use them when possible. + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) 1)) + (list '1+ (nth 1 form))) ; (+ x 1) --> (1+ x) + ((and (null (nthcdr 3 form)) + (eq (nth 1 form) 1)) + (list '1+ (nth 2 form))) ; (+ 1 x) --> (1+ x) + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) -1)) + (list '1- (nth 1 form))) ; (+ x -1) --> (1- x) + ((and (null (nthcdr 3 form)) + (eq (nth 1 form) -1)) + (list '1- (nth 2 form))) ; (+ -1 x) --> (1- x) - (t (byte-optimize-predicate 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))) (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 an integer. - (let ((last (last (nthcdr 3 form)))) + ;; Now only first and last element can be a number. + (let ((last (car (reverse (nthcdr 3 form))))) (cond ((eq 0 last) ;; (- x y ... 0) --> (- x y ...) (setq form (copy-sequence form)) @@ -743,55 +739,57 @@ (numberp last)) (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form)) (delq last (copy-sequence (nthcdr 3 form)))))))) - - (case (length (cdr form)) - ((0) ; (-) - (condition-case () - (eval form) - (error 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)) +;;; ) + ) - ;; 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)))) + ;; `add1' and `sub1' are a marginally fewer instructions than `plus' + ;; and `minus', so use them when possible. + (cond ((and (null (nthcdr 3 form)) + (eq (nth 2 form) 1)) + (list '1- (nth 1 form))) ; (- x 1) --> (1- x) + ((and (null (nthcdr 3 form)) + (eq (nth 2 form) -1)) + (list '1+ (nth 1 form))) ; (- x -1) --> (1+ x) + (t + form)) + ) (defun byte-optimize-multiply (form) (setq form (byte-optimize-delay-constants-math form 1 '*)) - ;; If there is a constant integer in FORM, it is now the last element. + ;; If there is a constant 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 (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))))))) + ((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)))))) + +(defsubst byte-compile-butlast (form) + (nreverse (cdr (reverse form)))) (defun byte-optimize-divide (form) (setq form (byte-optimize-delay-constants-math form 2 '*)) - ;; If there is a constant integer in FORM, it is now the last element. - (let ((last (last (cdr (cdr form))))) + (let ((last (car (reverse (cdr (cdr form)))))) (if (numberp last) (cond ((= (length form) 3) (if (and (numberp (nth 1 form)) @@ -801,22 +799,22 @@ (error nil))) (setq form (list 'progn (/ (nth 1 form) last))))) ((= last 1) - (setq form (butlast form))) + (setq form (byte-compile-butlast form))) ((numberp (nth 1 form)) (setq form (cons (car form) (cons (/ (nth 1 form) last) - (butlast (cdr (cdr form))))) + (byte-compile-butlast (cdr (cdr form))))) last nil)))) - (cond + (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) + (byte-compile-butlast form) + (nth 1 form)))) + (form)))) (defun byte-optimize-logmumble (form) (setq form (byte-optimize-delay-constants-math form 1 (car form))) @@ -892,7 +890,6 @@ (put 'stringp 'byte-optimizer 'byte-optimize-predicate) (put 'string< 'byte-optimizer 'byte-optimize-predicate) (put 'string-lessp 'byte-optimizer 'byte-optimize-predicate) -(put 'length 'byte-optimizer 'byte-optimize-predicate) (put 'logand 'byte-optimizer 'byte-optimize-logmumble) (put 'logior 'byte-optimizer 'byte-optimize-logmumble) @@ -905,7 +902,7 @@ (put 'cdr-safe 'byte-optimizer 'byte-optimize-predicate) -;; I'm not convinced that this is necessary. Doesn't the optimizer loop +;; I'm not convinced that this is necessary. Doesn't the optimizer loop ;; take care of this? - Jamie ;; I think this may some times be necessary to reduce eg. (quote 5) to 5, ;; so arithmetic optimizers recognize the numeric constant. - Hallvard @@ -1036,12 +1033,6 @@ (put 'if 'byte-optimizer 'byte-optimize-if) (put 'while 'byte-optimizer 'byte-optimize-while) -;; Remove any reason for avoiding `char-before'. -(defun byte-optimize-char-before (form) - `(char-after (1- ,(or (nth 1 form) '(point))) ,@(cdr (cdr form)))) - -(put 'char-before 'byte-optimizer 'byte-optimize-char-before) - ;; byte-compile-negation-optimizer lives in bytecomp.el ;(put '/= 'byte-optimizer 'byte-compile-negation-optimizer) (put 'atom 'byte-optimizer 'byte-compile-negation-optimizer) @@ -1112,7 +1103,7 @@ (setq form (list 'cdr form))) form))) -;;; enumerating those functions which need not be called if the returned +;;; enumerating those functions which need not be called if the returned ;;; value is not used. That is, something like ;;; (progn (list (something-with-side-effects) (yow)) ;;; (foo)) @@ -1150,7 +1141,7 @@ length log log10 logand logb logior lognot logxor lsh marker-buffer max member memq min mod next-window nth nthcdr number-to-string - parse-colon-path plist-get previous-window + parse-colon-path previous-window radians-to-degrees rassq regexp-quote reverse round sin sqrt string< string= string-equal string-lessp string-to-char string-to-int string-to-number substring symbol-plist @@ -1164,7 +1155,7 @@ abs expt signum last butlast ldiff pairlis gcd lcm isqrt floor* ceiling* truncate* round* mod* rem* subseq - list-length getf + list-length get* getf )) (side-effect-and-error-free-fns '(arrayp atom @@ -1390,7 +1381,7 @@ byte-current-buffer byte-interactive-p)) (defconst byte-compile-side-effect-free-ops - (nconc + (nconc '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate @@ -1422,7 +1413,7 @@ ;;; varbind pop-up-windows ;;; not ;;; -;;; we break the program, because it will appear that pop-up-windows and +;;; we break the program, because it will appear that pop-up-windows and ;;; old-pop-ups are not EQ when really they are. So we have to know what ;;; the BOOL variables are, and not perform this optimization on them. ;;; @@ -1602,7 +1593,7 @@ ;; goto-X-if-non-nil goto-Y X: --> goto-Y-if-nil X: ;; ;; it is wrong to do the same thing for the -else-pop variants. - ;; + ;; ((and (or (eq 'byte-goto-if-nil (car lap0)) (eq 'byte-goto-if-not-nil (car lap0))) ; gotoX (eq 'byte-goto (car lap1)) ; gotoY @@ -1705,7 +1696,7 @@ str (concat str " %s") i (1+ i)))) (if opt-p - (let ((tagstr + (let ((tagstr (if (eq 'TAG (car (car tmp))) (format "%d:" (car (cdr (car tmp)))) (or (car tmp) "")))) @@ -1887,7 +1878,7 @@ (byte-goto-if-not-nil-else-pop . byte-goto-if-nil-else-pop)))) newtag) - + (nth 1 newtag) ) (setcdr tmp (cons (setcdr lap0 newtag) (cdr tmp))) diff -r 12e008d41344 -r 697ef44129c6 lisp/bytecomp-runtime.el --- a/lisp/bytecomp-runtime.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/bytecomp-runtime.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992, 1997 Free Software Foundation, Inc. -;; Author: Jamie Zawinski +;; Author: Jamie Zawinski ;; Author: Hallvard Furuseth ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped diff -r 12e008d41344 -r 697ef44129c6 lisp/bytecomp.el --- a/lisp/bytecomp.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/bytecomp.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,7 @@ ;;; Copyright (C) 1985-1987, 1991-1994 Free Software Foundation, Inc. ;;; Copyright (C) 1996 Ben Wing. -;; Author: Jamie Zawinski +;; Author: Jamie Zawinski ;; Hallvard Furuseth ;; Keywords: internal @@ -1355,7 +1355,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 nil t)) + (byte-recompile-directory directory nil t)) ;;;###autoload (defun byte-recompile-directory (directory &optional arg norecursion force) @@ -1522,7 +1522,11 @@ (unless byte-compile-overwrite-file (ignore-file-errors (delete-file target-file))) (if (file-writable-p target-file) - (write-region 1 (point-max) target-file) + (progn + (when (memq system-type '(ms-dos windows-nt)) + (defvar buffer-file-type) + (setq buffer-file-type t)) + (write-region 1 (point-max) target-file)) ;; This is just to give a better error message than write-region (signal 'file-error (list "Opening output file" @@ -1743,19 +1747,18 @@ ;; file if under Mule. If there are any extended characters in the ;; input file, use `escape-quoted' to make sure that both binary and ;; extended characters are output properly and distinguished properly. - ;; Otherwise, use `raw-text' for maximum portability with non-Mule + ;; Otherwise, use `no-conversion' for maximum portability with non-Mule ;; Emacsen. - (when (featurep '(or mule file-coding)) + (when (featurep 'mule) (defvar buffer-file-coding-system) - (if (or (featurep '(not mule)) ;; Don't scan buffer if we are not muleized - (save-excursion - (set-buffer byte-compile-inbuffer) - (goto-char (point-min)) - ;; mrb- There must be a better way than skip-chars-forward - (skip-chars-forward (concat (char-to-string 0) "-" - (char-to-string 255))) - (eq (point) (point-max)))) - (setq buffer-file-coding-system 'raw-text-unix) + (if (save-excursion + (set-buffer byte-compile-inbuffer) + (goto-char (point-min)) + ;; mrb- There must be a better way than skip-chars-forward + (skip-chars-forward (concat (char-to-string 0) "-" + (char-to-string 255))) + (eq (point) (point-max))) + (setq buffer-file-coding-system 'no-conversion) (insert "(require 'mule)\n;;;###coding system: escape-quoted\n") (setq buffer-file-coding-system 'escape-quoted) ;; #### Lazy loading not yet implemented for MULE files @@ -1964,7 +1967,7 @@ (while (if (setq form (cdr form)) (byte-compile-constp (car form)))) (null form))) - ;; eval the macro autoload into the compilation environment + ;; eval the macro autoload into the compilation enviroment (eval form)) (if name @@ -4037,42 +4040,27 @@ (error "`batch-byte-compile' is to be used only with -batch")) (let ((error nil)) (while command-line-args-left - (if (null (batch-byte-compile-one-file)) - (setq error t))) + (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))) (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 12e008d41344 -r 697ef44129c6 lisp/check-features.el --- a/lisp/check-features.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/check-features.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1998 by Free Software Foundation, Inc. -;; Author: SL Baur +;; Author: SL Baur ;; Keywords: internal ;; This file is part of XEmacs. diff -r 12e008d41344 -r 697ef44129c6 lisp/cl-compat.el --- a/lisp/cl-compat.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cl-compat.el Mon Aug 13 11:20:41 2007 +0200 @@ -56,10 +56,8 @@ (defmacro defkeyword (x &optional doc) (list* 'defconst x (list 'quote x) (and doc (list doc)))) -;; XEmacs change. -;; We have built-in function. -;;(defun keywordp (sym) -;; (and (symbolp sym) (eq (aref (symbol-name sym) 0) ?\:) (set sym sym))) +(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 12e008d41344 -r 697ef44129c6 lisp/cl-extra.el --- a/lisp/cl-extra.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cl-extra.el Mon Aug 13 11:20:41 2007 +0200 @@ -183,14 +183,16 @@ (nreverse cl-res)))) -(defun mapc (cl-func cl-seq &rest cl-rest) - "Like `mapcar', but does not accumulate values returned by the function." - (if cl-rest - (apply 'map nil cl-func cl-seq cl-rest) - ;; XEmacs change: in the simplest case we call mapc-internal, - ;; which really doesn't accumulate any results. - (mapc-internal cl-func cl-seq)) - cl-seq) +;; mapc is now in C, renamed from `mapc-internal'. + +;(defun mapc (cl-func cl-seq &rest cl-rest) +; "Like `mapcar', but does not accumulate values returned by the function." +; (if cl-rest +; (apply 'map nil cl-func cl-seq cl-rest) +; ;; XEmacs change: we call mapc-internal, which really doesn't +; ;; accumulate any results. +; (mapc-internal cl-func cl-seq)) +; cl-seq) (defun mapl (cl-func cl-list &rest cl-rest) "Like `maplist', but does not accumulate values returned by the function." @@ -638,7 +640,13 @@ ;; XEmacs: our `get' groks DEFAULT. (defalias 'get* 'get) -(defalias 'getf 'plist-get) + +(defun getf (plist tag &optional def) + "Search PROPLIST for property PROPNAME; return its value or DEFAULT. +PROPLIST is a list of the sort returned by `symbol-plist'." + (setplist '--cl-getf-symbol-- plist) + (or (get '--cl-getf-symbol-- tag) + (and def (get* '--cl-getf-symbol-- tag def)))) (defun cl-set-getf (plist tag val) (let ((p plist)) @@ -650,18 +658,29 @@ (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. ;; Only backward compatibility stuff remains here. (defun make-hashtable (size &optional test) - (make-hash-table :test test :size size)) + (make-hash-table :size size :test test :type 'non-weak)) (defun make-weak-hashtable (size &optional test) - (make-hash-table :test test :size size :weakness t)) + (make-hash-table :size size :test test :type 'weak)) (defun make-key-weak-hashtable (size &optional test) - (make-hash-table :test test :size size :weakness 'key)) + (make-hash-table :size size :test test :type 'key-weak)) (defun make-value-weak-hashtable (size &optional test) - (make-hash-table :test test :size size :weakness 'value)) + (make-hash-table :size size :test test :type 'value-weak)) (define-obsolete-function-alias 'hashtablep 'hash-table-p) (define-obsolete-function-alias 'hashtable-fullness 'hash-table-count) @@ -674,7 +693,6 @@ (make-obsolete 'make-weak-hashtable 'make-hash-table) (make-obsolete 'make-key-weak-hashtable 'make-hash-table) (make-obsolete 'make-value-weak-hashtable 'make-hash-table) -(make-obsolete 'hash-table-type 'hash-table-weakness) (when (fboundp 'x-keysym-hash-table) (make-obsolete 'x-keysym-hashtable 'x-keysym-hash-table)) diff -r 12e008d41344 -r 697ef44129c6 lisp/cl-macs.el --- a/lisp/cl-macs.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cl-macs.el Mon Aug 13 11:20:41 2007 +0200 @@ -81,7 +81,7 @@ #'(lambda (n p f) (list 'put (list 'quote n) (list 'quote p) (list 'function (cons 'lambda f)))))) - 'xemacs)) + (car (or features (setq features (list 'cl-kludge)))))) ;;; Initialization. @@ -106,6 +106,31 @@ (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 @@ -1622,12 +1647,12 @@ (defsetf extent-priority set-extent-priority) (defsetf extent-property (x y &optional ignored-arg) (arg) (list 'set-extent-property x y arg)) +(defsetf extent-end-position (ext) (store) + (list 'progn (list 'set-extent-endpoints (list 'extent-start-position ext) + store) store)) (defsetf extent-start-position (ext) (store) - `(progn (set-extent-endpoints ,ext ,store (extent-end-position ,ext)) - ,store)) -(defsetf extent-end-position (ext) (store) - `(progn (set-extent-endpoints ,ext (extent-start-position ,ext) ,store) - ,store)) + (list 'progn (list 'set-extent-endpoints store + (list 'extent-end-position ext)) store)) (defsetf face-background (f &optional s) (x) (list 'set-face-background f x s)) (defsetf face-background-pixmap (f &optional s) (x) (list 'set-face-background-pixmap f x s)) @@ -2719,11 +2744,10 @@ (setq form (list 'cons (car args) form))) form)) -(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 get* (sym prop &optional def) + (if def + (list 'getf (list 'symbol-plist sym) prop def) + (list 'get sym prop))) (define-compiler-macro typep (&whole form val type) (if (cl-const-expr-p type) @@ -2771,7 +2795,7 @@ ; abs expt signum last butlast ldiff ; pairlis gcd lcm ; isqrt floor* ceiling* truncate* round* mod* rem* subseq -; list-length getf)) +; list-length get* getf)) ; (put fun 'side-effect-free t)) ;;; Things that are side-effect-and-error-free. Moved to byte-optimize.el diff -r 12e008d41344 -r 697ef44129c6 lisp/cl-seq.el --- a/lisp/cl-seq.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cl-seq.el Mon Aug 13 11:20:41 2007 +0200 @@ -65,23 +65,6 @@ ;;; 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 diff -r 12e008d41344 -r 697ef44129c6 lisp/cl.el --- a/lisp/cl.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cl.el Mon Aug 13 11:20:41 2007 +0200 @@ -317,23 +317,6 @@ (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. @@ -697,9 +680,9 @@ ;(load "cl-defs") ;;; Define data for indentation and edebug. -(mapcar +(mapc #'(lambda (entry) - (mapcar + (mapc #'(lambda (func) (put func 'lisp-indent-function (nth 1 entry)) (put func 'lisp-indent-hook (nth 1 entry)) @@ -750,8 +733,6 @@ (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 12e008d41344 -r 697ef44129c6 lisp/cleantree.el --- a/lisp/cleantree.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cleantree.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1997 by Free Software Foundation, Inc. -;; Author: Steven L Baur +;; Author: Steven L Baur ;; Keywords: internal ;; This file is part of XEmacs. diff -r 12e008d41344 -r 697ef44129c6 lisp/cmdloop.el --- a/lisp/cmdloop.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cmdloop.el Mon Aug 13 11:20:41 2007 +0200 @@ -130,10 +130,9 @@ :group 'editing-basics) (defun command-error (error-object) - (let* ((old-debug-on-error debug-on-error) - (inhibit-quit t) - (debug-on-error nil) - (etype (car-safe error-object))) + (let ((inhibit-quit t) + (debug-on-error nil) + (etype (car-safe error-object))) (setq quit-flag nil) (setq standard-output t) (setq standard-input t) @@ -162,12 +161,7 @@ (if (noninteractive) (progn - (if old-debug-on-error - (progn - (message "Backtrace:\n\n") - (backtrace) - (message "\n"))) - (message "%s exiting\n." emacs-program-name) + (message "%s exiting." emacs-program-name) (kill-emacs -1))) t)) @@ -325,36 +319,23 @@ (if (and teach-extended-commands-p (interactive-p)) - ;; Remember the keys, run the command, and show the keys (if - ;; any). The funny variable names are a poor man's guarantee - ;; that we don't get tripped by this-command doing something - ;; funny. Quoth our forefathers: "We want lexical scope!" + ;; We need to fiddle with keys: remember the keys, run the + ;; command, and show the keys (if any). (let ((_execute_command_keys_ (where-is-internal this-command)) (_execute_command_name_ this-command)) ; the name can change (command-execute this-command t) - (when _execute_command_keys_ - ;; Normally the region is adjusted in post_command_hook; - ;; however, it is not called until after we finish. It - ;; looks ugly for the region to get updated after the - ;; delays, so we do it now. The code below is a Lispified - ;; copy of code in event-stream.c:post_command_hook(). - (if (and (not zmacs-region-stays) - (or (not (eq (selected-window) (minibuffer-window))) - (eq (zmacs-region-buffer) (current-buffer)))) - (zmacs-deactivate-region) - (zmacs-update-region)) - ;; Wait for a while, so the user can see a message printed, - ;; if any. - (when (sit-for 1) - (display-message - 'no-log - (format (if (cdr _execute_command_keys_) - "Command `%s' is bound to keys: %s" - "Command `%s' is bound to key: %s") - _execute_command_name_ - (sorted-key-descriptions _execute_command_keys_))) - (sit-for teach-extended-commands-timeout) - (clear-message 'no-log)))) + (when (and _execute_command_keys_ + ;; Wait for a while, so the user can see a message + ;; printed, if any. + (sit-for 1)) + (display-message + 'no-log + (format "Command `%s' is bound to key%s: %s" + _execute_command_name_ + (if (cdr _execute_command_keys_) "s" "") + (sorted-key-descriptions _execute_command_keys_))) + (sit-for teach-extended-commands-timeout) + (clear-message 'no-log))) ;; Else, just run the command. (command-execute this-command t))) diff -r 12e008d41344 -r 697ef44129c6 lisp/code-files.el --- a/lisp/code-files.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/code-files.el Mon Aug 13 11:20:41 2007 +0200 @@ -6,6 +6,8 @@ ;; This file is part of XEmacs. +;; This file is very similar to mule-files.el + ;; 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) @@ -21,21 +23,16 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: Not synched. - ;;; Commentary: -;; Derived from mule.el in the original Mule but heavily modified -;; by Ben Wing. +;;; Derived from mule.el in the original Mule but heavily modified +;;; by Ben Wing. ;; 1997/3/11 modified by MORIOKA Tomohiko to sync with Emacs 20 API. -;; This file was derived from the former mule-files.el which has been removed -;; as of XEmacs 21.2.15. - ;;; Code: -(setq-default buffer-file-coding-system 'raw-text) +(setq-default buffer-file-coding-system 'no-conversion) (put 'buffer-file-coding-system 'permanent-local t) (define-obsolete-variable-alias @@ -68,13 +65,7 @@ ("TUTORIAL\\.\\(?:hr\\|pl\\|ro\\)\\'" . iso-8859-2) ;; ("\\.\\(el\\|emacs\\|info\\(-[0-9]+\\)?\\|texi\\)$" . iso-2022-8) ;; ("\\(ChangeLog\\|CHANGES-beta\\)$" . iso-2022-8) - - ;; 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) - ) + ("/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, @@ -197,12 +188,22 @@ ((find-coding-system codesys)) )))) -;; 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 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)))))) (defun find-coding-system-magic-cookie () "Look for the coding-system magic cookie in the current buffer.\n" @@ -283,7 +284,7 @@ (save-excursion (set-buffer (get-buffer-create " *load*")) (erase-buffer) - (let ((coding-system-for-read 'raw-text)) + (let ((coding-system-for-read 'no-conversion)) (insert-file-contents path nil 1 3001)) (find-coding-system-magic-cookie)) (if elc @@ -370,6 +371,9 @@ the whole thing because (1) it preserves some marker positions and (2) it puts less data in the undo list. +NOTE: When Mule support is enabled, the REPLACE argument is +currently ignored. + The coding system used for decoding the file is determined as follows: 1. `coding-system-for-read', if non-nil. @@ -377,7 +381,7 @@ 3. The matching value for this filename from `file-coding-system-alist', if any. 4. `buffer-file-coding-system-for-read', if non-nil. -5. The coding system 'raw-text. +5. The coding system 'no-conversion. If a local value for `buffer-file-coding-system' in the current buffer does not exist, it is set to the coding system which was actually used @@ -406,7 +410,7 @@ ;; #4. buffer-file-coding-system-for-read ;; #5. - 'raw-text)) + 'no-conversion)) (if (consp coding-system) (setq return-val coding-system) (if (null (find-coding-system coding-system)) @@ -551,9 +555,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 +;;; mule-files.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/code-process.el --- a/lisp/code-process.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/code-process.el Mon Aug 13 11:20:41 2007 +0200 @@ -30,6 +30,10 @@ ;;; Code: +(eval-when-compile + (defvar buffer-file-type) + (defvar binary-process-output)) + (defvar process-coding-system-alist nil "Alist to decide a coding system to use for a process I/O operation. The format is ((PATTERN . VAL) ...), @@ -108,7 +112,8 @@ you quit again before the process exits." (let ((temp (make-temp-name - (concat (file-name-as-directory (temp-directory)) "emacs")))) + (concat (file-name-as-directory (temp-directory)) + (if (memq system-type '(ms-dos windows-nt)) "em" "emacs"))))) (unwind-protect (let (cs-r cs-w) (let (ret) @@ -125,9 +130,6 @@ (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)))) @@ -135,7 +137,10 @@ (or coding-system-for-read cs-r)) (coding-system-for-write (or coding-system-for-write cs-w))) - (write-region start end temp nil 'silent) + (if (memq system-type '(ms-dos windows-nt)) + (let ((buffer-file-type binary-process-output)) + (write-region start end temp nil 'silent)) + (write-region start end temp nil 'silent)) (if deletep (delete-region start end)) (apply #'call-process program temp buffer displayp args))) (ignore-file-errors (delete-file temp))))) @@ -193,9 +198,9 @@ See also the function `find-operation-coding-system'.") -(defun open-network-stream (name buffer host service &optional protocol) +(defun open-network-stream (name buffer host service) "Open a TCP connection for a service to a host. -Return a subprocess-object to represent the connection. +Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. Args are NAME BUFFER HOST SERVICE. NAME is name for process. It is modified if necessary to make it unique. @@ -206,17 +211,7 @@ with any buffer Third arg is name of the host to connect to, or its IP address. Fourth arg SERVICE is name of the service desired, or an integer - specifying a port number to connect to. -Fifth argument PROTOCOL is a network protocol. Currently 'tcp - (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 -`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' -are usually fine.) Note further that UDP protocol does not guard against -lost packets." + specifying a port number to connect to." (let (cs-r cs-w) (let (ret) (catch 'found @@ -250,6 +245,6 @@ (or coding-system-for-read cs-r)) (coding-system-for-write (or coding-system-for-write cs-w))) - (open-network-stream-internal name buffer host service protocol)))) + (open-network-stream-internal name buffer host service)))) -;;; code-process.el ends here +;;; mule-process.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/coding.el --- a/lisp/coding.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/coding.el Mon Aug 13 11:20:41 2007 +0200 @@ -21,7 +21,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. @@ -104,9 +104,6 @@ (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 () @@ -118,10 +115,7 @@ (interactive "zterminal-coding-system: ") (get-coding-system coding-system) ; correctness check (setq terminal-coding-system coding-system) - ; #### should this affect all current tty consoles ? - (if (eq (device-type) 'tty) - (set-console-tty-output-coding-system - (device-console) terminal-coding-system)) + (set-console-tty-coding-system (device-console) terminal-coding-system) (redraw-modeline t)) (defun set-pathname-coding-system (coding-system) @@ -186,9 +180,9 @@ "Return the base coding system of CODING-SYSTEM." (if (not (coding-system-eol-type coding-system)) coding-system - (find-coding-system + (find-coding-system (intern - (substring + (substring (symbol-name (coding-system-name coding-system)) 0 (string-match "-unix$\\|-dos$\\|-mac$" @@ -201,45 +195,17 @@ "Automatic conversion." '(mnemonic "Auto")) -;;; Make certain variables equivalent to coding-system aliases -(defun dontusethis-set-value-file-name-coding-system-handler (sym args fun harg handlers) - (define-coding-system-alias 'file-name (or (car args) 'binary))) - -(dontusethis-set-symbol-value-handler - 'file-name-coding-system - 'set-value - 'dontusethis-set-value-file-name-coding-system-handler) - -(defun dontusethis-set-value-terminal-coding-system-handler (sym args fun harg handlers) - (define-coding-system-alias 'terminal (or (car args) 'binary))) - -(dontusethis-set-symbol-value-handler - 'terminal-coding-system - 'set-value - 'dontusethis-set-value-terminal-coding-system-handler) - -(defun dontusethis-set-value-keyboard-coding-system-handler (sym args fun harg handlers) - (define-coding-system-alias 'keyboard (or (car args) 'binary))) - -(dontusethis-set-symbol-value-handler - 'keyboard-coding-system - 'set-value - 'dontusethis-set-value-keyboard-coding-system-handler) - -(unless (boundp 'file-name-coding-system) - (setq file-name-coding-system nil)) - -(when (not (featurep 'mule)) - ;; these are so that gnus and friends work when not mule - (copy-coding-system 'undecided 'iso-8859-1) - (copy-coding-system 'undecided 'iso-8859-2) - - (define-coding-system-alias 'ctext 'binary)) - +;; these are so that gnus and friends work when not mule +(or (featurep 'mule) + (progn + (copy-coding-system 'undecided 'iso-8859-1) + (copy-coding-system 'undecided 'iso-8859-2))) ;; compatibility for old XEmacsen (don't use it) (copy-coding-system 'undecided 'automatic-conversion) +(copy-coding-system 'no-conversion 'raw-text) + (make-compatible-variable 'enable-multibyte-characters "Unimplemented") (define-obsolete-variable-alias diff -r 12e008d41344 -r 697ef44129c6 lisp/compat.el --- a/lisp/compat.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -;;; 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 12e008d41344 -r 697ef44129c6 lisp/config.el --- a/lisp/config.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/config.el Mon Aug 13 11:20:41 2007 +0200 @@ -29,7 +29,7 @@ ;;; Code: -(defvar config-value-file (expand-file-name "config.values" doc-directory) +(defvar config-value-file (expand-file-name "config.values" exec-directory) "File containing configuration parameters and their values.") (defvar config-value-hash-table nil diff -r 12e008d41344 -r 697ef44129c6 lisp/cus-dep.el --- a/lisp/cus-dep.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cus-dep.el Mon Aug 13 11:20:41 2007 +0200 @@ -4,8 +4,8 @@ ;; ;; Author: Per Abrahamsen , then ;; Richard Stallman , then -;; Hrvoje Niksic (rewritten for XEmacs) -;; Maintainer: Hrvoje Niksic +;; Hrvoje Niksic (rewritten for XEmacs) +;; Maintainer: Hrvoje Niksic ;; Keywords: internal ;; This file is part of XEmacs. @@ -158,8 +158,7 @@ (with-temp-file cusload-file (insert ";;; " cusload-base-file " --- automatically extracted custom dependencies\n" - "\n;;; Code:\n\n" - "(autoload 'custom-add-loads \"cus-load\")\n\n") + "\n;;; Code:\n\n") (mapatoms (lambda (sym) (let ((members (get sym 'custom-group)) diff -r 12e008d41344 -r 697ef44129c6 lisp/cus-edit.el --- a/lisp/cus-edit.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cus-edit.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,9 @@ ;;; cus-edit.el --- Tools for customizating Emacs and Lisp packages. ;; -;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen -;; Maintainer: Hrvoje Niksic +;; Maintainer: Hrvoje Niksic ;; Keywords: help, faces ;; Version: 1.9960-x ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ @@ -55,7 +55,6 @@ (require 'cus-load) (require 'cus-start) -(require 'cus-file) ;; Huh? This looks dirty! (put 'custom-define-hook 'custom-type 'hook) @@ -400,7 +399,7 @@ (custom-unlispify-menu-entry symbol t))) (defun custom-prefix-add (symbol prefixes) - ;; Add SYMBOL to list of ignored PREFIXES. + ;; Addd SYMBOL to list of ignored PREFIXES. (cons (or (get symbol 'custom-prefix) (concat (symbol-name symbol) "-")) prefixes)) @@ -618,7 +617,7 @@ ;;; The Customize Commands -(defun custom-prompt-variable (prompt-var prompt-val &optional comment) +(defun custom-prompt-variable (prompt-var prompt-val) "Prompt for a variable and a value and return them as a list. PROMPT-VAR is the prompt for the variable, and PROMPT-VAL is the prompt for the value. The %s escape in PROMPT-VAL is replaced with @@ -628,13 +627,10 @@ it were the arg to `interactive' (which see) to interactively read the value. If the variable has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If optional COMMENT argument is non nil, also prompt for a comment and return -it as the third element in the list." +`:prompt-value' property of that widget will be used for reading the value." (let* ((var (read-variable prompt-var)) - (minibuffer-help-form '(describe-variable var)) - (val + (minibuffer-help-form '(describe-variable var))) + (list var (let ((prop (get var 'variable-interactive)) (type (get var 'custom-type)) (prompt (format prompt-val var))) @@ -653,36 +649,24 @@ (symbol-value var)) (not (boundp var)))) (t - (eval-minibuffer prompt)))))) - (if comment - (list var val - (read-string "Comment: " (get var 'variable-comment))) - (list var val)) - )) + (eval-minibuffer prompt))))))) ;;;###autoload -(defun customize-set-value (var val &optional comment) +(defun customize-set-value (var val) "Set VARIABLE to VALUE. VALUE is a Lisp object. If VARIABLE has a `variable-interactive' property, that is used as if it were the arg to `interactive' (which see) to interactively read the value. If VARIABLE has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If given a prefix (or a COMMENT argument), also prompt for a comment." +`:prompt-value' property of that widget will be used for reading the value." (interactive (custom-prompt-variable "Set variable: " - "Set %s to value: " - current-prefix-arg)) - - (set var val) - (cond ((string= comment "") - (put var 'variable-comment nil)) - (comment - (put var 'variable-comment comment)))) + "Set %s to value: ")) + + (set var val)) ;;;###autoload -(defun customize-set-variable (var val &optional comment) +(defun customize-set-variable (var val) "Set the default for VARIABLE to VALUE. VALUE is a Lisp object. If VARIABLE has a `custom-set' property, that is used for setting @@ -695,24 +679,14 @@ it were the arg to `interactive' (which see) to interactively read the value. If VARIABLE has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If given a prefix (or a COMMENT argument), also prompt for a comment." +`:prompt-value' property of that widget will be used for reading the value. " (interactive (custom-prompt-variable "Set variable: " - "Set customized value for %s to: " - current-prefix-arg)) + "Set customized value for %s to: ")) (funcall (or (get var 'custom-set) 'set-default) var val) - (put var 'customized-value (list (custom-quote val))) - (cond ((string= comment "") - (put var 'variable-comment nil) - (put var 'customized-variable-comment nil)) - (comment - (put var 'variable-comment comment) - (put var 'customized-variable-comment comment)))) - + (put var 'customized-value (list (custom-quote val)))) ;;;###autoload -(defun customize-save-variable (var val &optional comment) +(defun customize-save-variable (var val) "Set the default for VARIABLE to VALUE, and save it for future sessions. If VARIABLE has a `custom-set' property, that is used for setting VARIABLE, otherwise `set-default' is used. @@ -724,21 +698,11 @@ it were the arg to `interactive' (which see) to interactively read the value. If VARIABLE has a `custom-type' property, it must be a widget and the -`:prompt-value' property of that widget will be used for reading the value. - -If given a prefix (or a COMMENT argument), also prompt for a comment." +`:prompt-value' property of that widget will be used for reading the value. " (interactive (custom-prompt-variable "Set and ave variable: " - "Set and save value for %s as: " - current-prefix-arg)) + "Set and save value for %s as: ")) (funcall (or (get var 'custom-set) 'set-default) var val) (put var 'saved-value (list (custom-quote val))) - (custom-push-theme 'theme-value var 'user 'set (list (custom-quote val))) - (cond ((string= comment "") - (put var 'variable-comment nil) - (put var 'saved-variable-comment nil)) - (comment - (put var 'variable-comment comment) - (put var 'saved-variable-comment comment))) (custom-save-all)) ;;;###autoload @@ -878,12 +842,10 @@ (interactive) (let ((found nil)) (mapatoms (lambda (symbol) - (and (or (get symbol 'customized-face) - (get symbol 'customized-face-comment)) + (and (get symbol 'customized-face) (find-face symbol) (push (list symbol 'custom-face) found)) - (and (or (get symbol 'customized-value) - (get symbol 'customized-variable-comment)) + (and (get symbol 'customized-value) (boundp symbol) (push (list symbol 'custom-variable) found)))) (if (not found) @@ -897,12 +859,10 @@ (interactive) (let ((found nil)) (mapatoms (lambda (symbol) - (and (or (get symbol 'saved-face) - (get symbol 'saved-face-comment)) + (and (get symbol 'saved-face) (find-face symbol) (push (list symbol 'custom-face) found)) - (and (or (get symbol 'saved-value) - (get symbol 'saved-variable-comment)) + (and (get symbol 'saved-value) (boundp symbol) (push (list symbol 'custom-variable) found)))) (if (not found ) @@ -1034,6 +994,7 @@ (widget-insert "\nOperate on everything in this buffer:\n ") (widget-create 'push-button :tag "Set" + :tag-glyph '("set-up" "set-down") :help-echo "\ Make your editing in this buffer take effect for this session" :action (lambda (widget &optional event) @@ -1041,6 +1002,7 @@ (widget-insert " ") (widget-create 'push-button :tag "Save" + :tag-glyph '("save-up" "save-down") :help-echo "\ Make your editing in this buffer take effect for future Emacs sessions" :action (lambda (widget &optional event) @@ -1076,6 +1038,7 @@ (widget-insert " ") (widget-create 'push-button :tag "Done" + :tag-glyph '("done-up" "done-down") :help-echo "Remove the buffer" :action (lambda (widget &optional event) (Custom-buffer-done))) @@ -1248,7 +1211,7 @@ (defun custom-browse-insert-prefix (prefix) "Insert PREFIX. On XEmacs convert it to line graphics." - ;; #### Unfinished. + ;; ### Unfinished. (if nil ; (string-match "XEmacs" emacs-version) (progn (insert "*") @@ -1742,77 +1705,6 @@ (delete-region start (point))) found)) -;;; The `custom-comment' Widget. - -;; like the editable field -(defface custom-comment-face '((((class grayscale color) - (background light)) - (:background "gray85")) - (((class grayscale color) - (background dark)) - (:background "dim gray")) - (t - (:italic t))) - "Face used for comments on variables or faces" - :group 'custom-faces) - -;; like font-lock-comment-face -(defface custom-comment-tag-face - '((((class color) (background dark)) (:foreground "gray80")) - (((class color) (background light)) (:foreground "blue4")) - (((class grayscale) (background light)) - (:foreground "DimGray" :bold t :italic t)) - (((class grayscale) (background dark)) - (:foreground "LightGray" :bold t :italic t)) - (t (:bold t))) - "Face used for variables or faces comment tags" - :group 'custom-faces) - -(define-widget 'custom-comment 'string - "User comment" - :tag "Comment" - :help-echo "Edit a comment here" - :sample-face 'custom-comment-tag-face - :value-face 'custom-comment-face - :value-set 'custom-comment-value-set - :create 'custom-comment-create - :delete 'custom-comment-delete) - -(defun custom-comment-create (widget) - (let (ext) - (widget-default-create widget) - (widget-put widget :comment-extent - (setq ext (make-extent (widget-get widget :from) - (widget-get widget :to)))) - (set-extent-property ext 'start-open t) - (when (equal (widget-get widget :value) "") - (set-extent-property ext 'invisible t)) - )) - -(defun custom-comment-delete (widget) - (widget-default-delete widget) - (delete-extent (widget-get widget :comment-extent))) - -(defun custom-comment-value-set (widget value) - (widget-default-value-set widget value) - (if (equal value "") - (set-extent-property (widget-get widget :comment-extent) - 'invisible t) - (set-extent-property (widget-get widget :comment-extent) - 'invisible nil))) - -;; Those functions are for the menu. WIDGET is NOT the comment widget. It's -;; the global custom one -(defun custom-comment-show (widget) - (set-extent-property - (widget-get (widget-get widget :comment-widget) :comment-extent) - 'invisible nil)) - -(defun custom-comment-invisible-p (widget) - (extent-property - (widget-get (widget-get widget :comment-widget) :comment-extent) - 'invisible)) - ;;; The `custom-variable' Widget. (defface custom-variable-tag-face '((((class color) @@ -1978,40 +1870,23 @@ :value value) children)))) (unless (eq custom-buffer-style 'tree) + ;; Now update the state. (unless (eq (preceding-char) ?\n) (widget-insert "\n")) + (if (eq state 'hidden) + (widget-put widget :custom-state state) + (custom-variable-state-set widget)) ;; Create the magic button. (let ((magic (widget-create-child-and-convert widget 'custom-magic nil))) (widget-put widget :custom-magic magic) (push magic buttons)) + ;; Update properties. + (widget-put widget :custom-form form) + (widget-put widget :buttons buttons) + (widget-put widget :children children) ;; Insert documentation. - ;; #### NOTE: this is ugly!!!! I need to do update the :buttons property - ;; before the call to `widget-default-format-handler'. Otherwise, I - ;; loose my current `buttons'. This function shouldn't be called like - ;; this anyway. The doc string widget should be added like the others. - ;; --dv - (widget-put widget :buttons buttons) (widget-default-format-handler widget ?h) - ;; The comment field - (unless (eq state 'hidden) - (let* ((comment (get symbol 'variable-comment)) - (comment-widget - (widget-create-child-and-convert - widget 'custom-comment - :parent widget - :value (or comment "")))) - (widget-put widget :comment-widget comment-widget) - ;; Don't push it !!! Custom assumes that the first child is the - ;; value one. - (setq children (append children (list comment-widget))))) - ;; Update the rest of the properties properties. - (widget-put widget :custom-form form) - (widget-put widget :children children) - ;; Now update the state. - (if (eq state 'hidden) - (widget-put widget :custom-state state) - (custom-variable-state-set widget)) ;; See also. (unless (eq state 'hidden) (when (eq (widget-get widget :custom-level) 1) @@ -2035,32 +1910,22 @@ (value (if (default-boundp symbol) (funcall get symbol) (widget-get widget :value))) - (comment (get symbol 'variable-comment)) tmp - temp - (state (cond ((progn (setq tmp (get symbol 'customized-value)) - (setq temp - (get symbol 'customized-variable-comment)) - (or tmp temp)) + (state (cond ((setq tmp (get symbol 'customized-value)) (if (condition-case nil - (and (equal value (eval (car tmp))) - (equal comment temp)) + (equal value (eval (car tmp))) (error nil)) 'set 'changed)) - ((progn (setq tmp (get symbol 'saved-value)) - (setq temp (get symbol 'saved-variable-comment)) - (or tmp temp)) + ((setq tmp (get symbol 'saved-value)) (if (condition-case nil - (and (equal value (eval (car tmp))) - (equal comment temp)) + (equal value (eval (car tmp))) (error nil)) 'saved 'changed)) ((setq tmp (get symbol 'standard-value)) (if (condition-case nil - (and (equal value (eval (car tmp))) - (equal comment nil)) + (equal value (eval (car tmp))) (error nil)) 'standard 'changed)) @@ -2080,8 +1945,7 @@ (memq (widget-get widget :custom-state) '(modified changed))))) ("Reset to Saved" custom-variable-reset-saved (lambda (widget) - (and (or (get (widget-value widget) 'saved-value) - (get (widget-value widget) 'saved-variable-comment)) + (and (get (widget-value widget) 'saved-value) (memq (widget-get widget :custom-state) '(modified set changed rogue))))) ("Reset to Standard Settings" custom-variable-reset-standard @@ -2090,8 +1954,6 @@ (memq (widget-get widget :custom-state) '(modified set changed saved rogue))))) ("---" ignore ignore) - ("Add Comment" custom-comment-show custom-comment-invisible-p) - ("---" ignore ignore) ("Don't show as Lisp expression" custom-variable-edit (lambda (widget) (eq (widget-get widget :custom-form) 'lisp))) @@ -2143,34 +2005,18 @@ (child (car (widget-get widget :children))) (symbol (widget-value widget)) (set (or (get symbol 'custom-set) 'set-default)) - (comment-widget (widget-get widget :comment-widget)) - (comment (widget-value comment-widget)) - val) + val) (cond ((eq state 'hidden) (error "Cannot set hidden variable")) ((setq val (widget-apply child :validate)) (goto-char (widget-get val :from)) (error "%s" (widget-get val :error))) ((memq form '(lisp mismatch)) - (when (equal comment "") - (setq comment nil) - ;; Make the comment invisible by hand if it's empty - (set-extent-property (widget-get comment-widget :comment-extent) - 'invisible t)) (funcall set symbol (eval (setq val (widget-value child)))) - (put symbol 'customized-value (list val)) - (put symbol 'variable-comment comment) - (put symbol 'customized-variable-comment comment)) + (put symbol 'customized-value (list val))) (t - (when (equal comment "") - (setq comment nil) - ;; Make the comment invisible by hand if it's empty - (set-extent-property (widget-get comment-widget :comment-extent) - 'invisible t)) (funcall set symbol (setq val (widget-value child))) - (put symbol 'customized-value (list (custom-quote val))) - (put symbol 'variable-comment comment) - (put symbol 'customized-variable-comment comment))) + (put symbol 'customized-value (list (custom-quote val))))) (custom-variable-state-set widget) (custom-redraw-magic widget))) @@ -2181,8 +2027,6 @@ (child (car (widget-get widget :children))) (symbol (widget-value widget)) (set (or (get symbol 'custom-set) 'set-default)) - (comment-widget (widget-get widget :comment-widget)) - (comment (widget-value comment-widget)) val) (cond ((eq state 'hidden) (error "Cannot set hidden variable")) @@ -2190,34 +2034,14 @@ (goto-char (widget-get val :from)) (error "%s" (widget-get val :error))) ((memq form '(lisp mismatch)) - (when (equal comment "") - (setq comment nil) - ;; Make the comment invisible by hand if it's empty - (set-extent-property (widget-get comment-widget :comment-extent) - 'invisible t)) (put symbol 'saved-value (list (widget-value child))) - (custom-push-theme 'theme-value symbol 'user - 'set (list (widget-value child))) - (funcall set symbol (eval (widget-value child))) - (put symbol 'variable-comment comment) - (put symbol 'saved-variable-comment comment)) + (funcall set symbol (eval (widget-value child)))) (t - (when (equal comment "") - (setq comment nil) - ;; Make the comment invisible by hand if it's empty - (set-extent-property (widget-get comment-widget :comment-extent) - 'invisible t)) (put symbol 'saved-value (list (custom-quote (widget-value child)))) - (custom-push-theme 'theme-value symbol 'user - 'set (list (custom-quote (widget-value - child)))) - (funcall set symbol (widget-value child)) - (put symbol 'variable-comment comment) - (put symbol 'saved-variable-comment comment))) + (funcall set symbol (widget-value child)))) (put symbol 'customized-value nil) - (put symbol 'customized-variable-comment nil) (custom-save-all) (custom-variable-state-set widget) (custom-redraw-magic widget))) @@ -2225,20 +2049,14 @@ (defun custom-variable-reset-saved (widget) "Restore the saved value for the variable being edited by WIDGET." (let* ((symbol (widget-value widget)) - (set (or (get symbol 'custom-set) 'set-default)) - (value (get symbol 'saved-value)) - (comment (get symbol 'saved-variable-comment))) - (cond ((or value comment) - (put symbol 'variable-comment comment) - (condition-case nil - (funcall set symbol (eval (car value))) - (error nil))) - (t - (signal 'error (list "No saved value for variable" symbol)))) + (set (or (get symbol 'custom-set) 'set-default))) + (if (get symbol 'saved-value) + (condition-case nil + (funcall set symbol (eval (car (get symbol 'saved-value)))) + (error nil)) + (signal 'error (list "No saved value for variable" symbol))) (put symbol 'customized-value nil) - (put symbol 'customized-variable-comment nil) (widget-put widget :custom-state 'unknown) - ;; This call will possibly make the comment invisible (custom-redraw widget))) (defun custom-variable-reset-standard (widget) @@ -2248,20 +2066,11 @@ (if (get symbol 'standard-value) (funcall set symbol (eval (car (get symbol 'standard-value)))) (signal 'error (list "No standard setting known for variable" symbol))) - (put symbol 'variable-comment nil) (put symbol 'customized-value nil) - (put symbol 'customized-variable-comment nil) - (when (or (get symbol 'saved-value) (get symbol 'saved-variable-comment)) + (when (get symbol 'saved-value) (put symbol 'saved-value nil) - (custom-push-theme 'theme-value symbol 'user 'reset 'standard) - ;; As a special optimizations we do not (explictly) - ;; save resets to standard when no theme set the value. - (if (null (cdr (get symbol 'theme-value))) - (put symbol 'theme-value nil)) - (put symbol 'saved-variable-comment nil) (custom-save-all)) (widget-put widget :custom-state 'unknown) - ;; This call will possibly make the comment invisible (custom-redraw widget))) ;;; The `custom-face-edit' Widget. @@ -2271,7 +2080,7 @@ :format "%t: %v" :tag "Attributes" :extra-offset 12 - :button-args '(:help-echo "Control whether this attribute has any effect") + :button-args '(:help-echo "Control whether this attribute have any effect") :args (mapcar (lambda (att) (list 'group :inline t @@ -2307,33 +2116,19 @@ pm) (const :format "MSWindows " :sibling-args (:help-echo "\ -Microsoft Windows, displays") +Windows NT/95/97") mswindows) - (const :format "MSPrinter " + (const :format "DOS " :sibling-args (:help-echo "\ -Microsoft Windows, printers") - msprinter) +Plain MS-DOS") + pc) (const :format "TTY%n" :sibling-args (:help-echo "\ Plain text terminals") tty))) (group :sibling-args (:help-echo "\ -Only match display or printer devices") - (const :format "Output: " - class) - (checklist :inline t - :offset 0 - (const :format "Display " - :sibling-args (:help-echo "\ -Match display devices") - display) - (const :format "Printer%n" - :sibling-args (:help-echo "\ -Match printer devices") - printer))) - (group :sibling-args (:help-echo "\ Only match the frames with the specified color support") - (const :format "Color support: " + (const :format "Class: " class) (checklist :inline t :offset 0 @@ -2430,7 +2225,6 @@ (defun custom-face-value-create (widget) "Create a list of the display specifications for WIDGET." (let ((buttons (widget-get widget :buttons)) - children (symbol (widget-get widget :value)) (tag (widget-get widget :tag)) (state (widget-get widget :custom-state)) @@ -2480,16 +2274,6 @@ (widget-put widget :buttons buttons) ;; Insert documentation. (widget-default-format-handler widget ?h) - ;; The comment field - (unless (eq state 'hidden) - (let* ((comment (get symbol 'face-comment)) - (comment-widget - (widget-create-child-and-convert - widget 'custom-comment - :parent widget - :value (or comment "")))) - (widget-put widget :comment-widget comment-widget) - (push comment-widget children))) ;; See also. (unless (eq state 'hidden) (when (eq (widget-get widget :custom-level) 1) @@ -2504,7 +2288,12 @@ (unless (widget-get widget :custom-form) (widget-put widget :custom-form custom-face-default-form)) (let* ((symbol (widget-value widget)) - (spec (custom-face-get-spec symbol)) + (spec (or (get symbol 'customized-face) + (get symbol 'saved-face) + (get symbol 'face-defface-spec) + ;; Attempt to construct it. + (list (list t (face-custom-attributes-get + symbol (selected-frame)))))) (form (widget-get widget :custom-form)) (indent (widget-get widget :indent)) (edit (widget-create-child-and-convert @@ -2523,8 +2312,7 @@ 'sexp)) :value spec))) (custom-face-state-set widget) - (push edit children) - (widget-put widget :children children)) + (widget-put widget :children (list edit))) (message "Creating face editor...done")))))) (defvar custom-face-menu @@ -2532,14 +2320,11 @@ ("Save for Future Sessions" custom-face-save) ("Reset to Saved" custom-face-reset-saved (lambda (widget) - (or (get (widget-value widget) 'saved-face) - (get (widget-value widget) 'saved-face-comment)))) + (get (widget-value widget) 'saved-face))) ("Reset to Standard Setting" custom-face-reset-standard (lambda (widget) (get (widget-value widget) 'face-defface-spec))) ("---" ignore ignore) - ("Add Comment" custom-comment-show custom-comment-invisible-p) - ("---" ignore ignore) ("Show all display specs" custom-face-edit-all (lambda (widget) (not (eq (widget-get widget :custom-form) 'all)))) @@ -2576,30 +2361,15 @@ (defun custom-face-state-set (widget) "Set the state of WIDGET." - (let* ((symbol (widget-value widget)) - (comment (get symbol 'face-comment)) - tmp temp) - (widget-put widget :custom-state - (cond ((progn - (setq tmp (get symbol 'customized-face)) - (setq temp (get symbol 'customized-face-comment)) - (or tmp temp)) - (if (equal temp comment) - 'set - 'changed)) - ((progn - (setq tmp (get symbol 'saved-face)) - (setq temp (get symbol 'saved-face-comment)) - (or tmp temp)) - (if (equal temp comment) - 'saved - 'changed)) - ((get symbol 'face-defface-spec) - (if (equal comment nil) - 'standard - 'changed)) - (t - 'rogue))))) + (let ((symbol (widget-value widget))) + (widget-put widget :custom-state (cond ((get symbol 'customized-face) + 'set) + ((get symbol 'saved-face) + 'saved) + ((get symbol 'face-defface-spec) + 'standard) + (t + 'rogue))))) (defun custom-face-action (widget &optional event) "Show the menu for `custom-face' WIDGET. @@ -2620,18 +2390,9 @@ "Make the face attributes in WIDGET take effect." (let* ((symbol (widget-value widget)) (child (car (widget-get widget :children))) - (value (widget-value child)) - (comment-widget (widget-get widget :comment-widget)) - (comment (widget-value comment-widget))) - (when (equal comment "") - (setq comment nil) - ;; Make the comment invisible by hand if it's empty - (set-extent-property (widget-get comment-widget :comment-extent) - 'invisible t)) + (value (widget-value child))) (put symbol 'customized-face value) - (face-spec-set symbol value nil '(custom)) - (put symbol 'customized-face-comment comment) - (put symbol 'face-comment comment) + (face-spec-set symbol value) (custom-face-state-set widget) (custom-redraw-magic widget))) @@ -2639,21 +2400,10 @@ "Make the face attributes in WIDGET default." (let* ((symbol (widget-value widget)) (child (car (widget-get widget :children))) - (value (widget-value child)) - (comment-widget (widget-get widget :comment-widget)) - (comment (widget-value comment-widget))) - (when (equal comment "") - (setq comment nil) - ;; Make the comment invisible by hand if it's empty - (set-extent-property (widget-get comment-widget :comment-extent) - 'invisible t)) - (face-spec-set symbol value nil '(custom)) + (value (widget-value child))) + (face-spec-set symbol value) (put symbol 'saved-face value) - (custom-push-theme 'theme-face symbol 'user 'set value) (put symbol 'customized-face nil) - (put symbol 'face-comment comment) - (put symbol 'customized-face-comment nil) - (put symbol 'saved-face-comment comment) (custom-save-all) (custom-face-state-set widget) (custom-redraw-magic widget))) @@ -2662,18 +2412,12 @@ "Restore WIDGET to the face's default attributes." (let* ((symbol (widget-value widget)) (child (car (widget-get widget :children))) - (value (get symbol 'saved-face)) - (comment (get symbol 'saved-face-comment)) - (comment-widget (widget-get widget :comment-widget))) - (unless (or value comment) + (value (get symbol 'saved-face))) + (unless value (signal 'error (list "No saved value for this face" symbol))) (put symbol 'customized-face nil) - (put symbol 'customized-face-comment nil) - (face-spec-set symbol value nil '(custom)) - (put symbol 'face-comment comment) + (face-spec-set symbol value) (widget-value-set child value) - ;; This call manages the comment visibility - (widget-value-set comment-widget (or comment "")) (custom-face-state-set widget) (custom-redraw-magic widget))) @@ -2681,25 +2425,15 @@ "Restore WIDGET to the face's standard settings." (let* ((symbol (widget-value widget)) (child (car (widget-get widget :children))) - (value (get symbol 'face-defface-spec)) - (comment-widget (widget-get widget :comment-widget))) + (value (get symbol 'face-defface-spec))) (unless value (signal 'error (list "No standard setting for this face" symbol))) (put symbol 'customized-face nil) - (put symbol 'customized-face-comment nil) - (when (or (get symbol 'saved-face) (get symbol 'saved-face-comment)) + (when (get symbol 'saved-face) (put symbol 'saved-face nil) - (custom-push-theme 'theme-face symbol 'user 'reset 'standard) - ;; Do not explictly save resets to standards without themes. - (if (null (cdr (get symbol 'theme-face))) - (put symbol 'theme-face nil)) - (put symbol 'saved-face-comment nil) (custom-save-all)) - (face-spec-set symbol value nil '(custom)) - (put symbol 'face-comment nil) + (face-spec-set symbol value) (widget-value-set child value) - ;; This call manages the comment visibility - (widget-value-set comment-widget "") (custom-face-state-set widget) (custom-redraw-magic widget))) @@ -2769,7 +2503,7 @@ :tag "Hook") (defun custom-hook-convert-widget (widget) - ;; Handle `:options'. + ;; Handle `:custom-options'. (let* ((options (widget-get widget :options)) (other `(editable-list :inline t :entry-format "%i %d%v" @@ -3238,8 +2972,17 @@ (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'. + "Delete the call to SYMBOL form `custom-file'. Leave point at the location of the call, or after the last expression." (let ((find-file-hooks nil) (auto-mode-alist nil)) @@ -3259,152 +3002,87 @@ (throw 'found nil)))))) (defun custom-save-variables () - "Save all customized variables in `custom-file'." - (save-excursion - (custom-save-delete 'custom-load-themes) - (custom-save-delete 'custom-reset-variables) - (custom-save-delete 'custom-set-variables) - (custom-save-loaded-themes) - (custom-save-resets 'theme-value 'custom-reset-variables nil) - (let ((standard-output (current-buffer))) - (unless (bolp) - (princ "\n")) - (princ "(custom-set-variables") - (mapatoms (lambda (symbol) - (let ((spec (car-safe (get symbol 'theme-value))) - (requests (get symbol 'custom-requests)) - (now (not (or (get symbol 'standard-value) - (and (not (boundp symbol)) - (not (eq (get symbol 'force-value) - 'rogue)))))) - (comment (get symbol 'saved-variable-comment))) - (when (or (and spec (eq (car spec) 'user) - (eq (second spec) 'set)) comment) - (princ "\n '(") - (prin1 symbol) - (princ " ") - ;; This comment stuff is in the way #### - ;; Is (eq (third spec) (car saved-value)) ???? - ;; (prin1 (third spec)) - (prin1 (car (get symbol 'saved-value))) - (when (or now requests comment) - (princ (if now " t" " nil"))) - (when (or comment requests) - (princ " ") - (prin1 requests)) - (when comment - (princ " ") - (prin1 comment)) - (princ ")"))))) + "Save all customized variables in `custom-file'." + (save-excursion + (custom-save-delete 'custom-set-variables) + (let ((standard-output (current-buffer))) + (unless (bolp) + (princ "\n")) + (princ "(custom-set-variables") + (mapatoms (lambda (symbol) + (let ((value (get symbol 'saved-value)) + (requests (get symbol 'custom-requests)) + (now (not (or (get symbol 'standard-value) + (and (not (boundp symbol)) + (not (get symbol 'force-value))))))) + (when value + (princ "\n '(") + (prin1 symbol) + (princ " ") + (prin1 (car value)) + (cond (requests + (if now + (princ " t ") + (princ " nil ")) + (prin1 requests) + (princ ")")) + (now + (princ " t)")) + (t + (princ ")"))))))) (princ ")") (unless (looking-at "\n") (princ "\n"))))) -(defvar custom-save-face-ignoring nil) - -(defun custom-save-face-internal (symbol) - (let ((theme-spec (car-safe (get symbol 'theme-face))) - (comment (get symbol 'saved-face-comment)) - (now (not (or (get symbol 'face-defface-spec) - (and (not (find-face symbol)) - (not (eq (get symbol 'force-face) 'rogue))))))) - (when (or (and (not (memq symbol custom-save-face-ignoring)) - ;; Don't print default face here. - theme-spec - (eq (car theme-spec) 'user) - (eq (second theme-spec) 'set)) comment) - (princ "\n '(") - (prin1 symbol) - (princ " ") - (prin1 (get symbol 'saved-face)) - (if (or comment now) - (princ (if now " t" " nil"))) - (when comment - (princ " ") - (prin1 comment)) - (princ ")")))) - (defun custom-save-faces () "Save all customized faces in `custom-file'." (save-excursion - (custom-save-delete 'custom-reset-faces) (custom-save-delete 'custom-set-faces) - (custom-save-resets 'theme-face 'custom-reset-faces '(default)) (let ((standard-output (current-buffer))) (unless (bolp) (princ "\n")) (princ "(custom-set-faces") + (let ((value (get 'default 'saved-face))) ;; The default face must be first, since it affects the others. - (custom-save-face-internal 'default) - (let ((custom-save-face-ignoring '(default))) - (mapatoms #'custom-save-face-internal)) + (when value + (princ "\n '(default ") + (prin1 value) + (if (or (get 'default 'face-defface-spec) + (and (not (find-face 'default)) + (not (get 'default 'force-face)))) + (princ ")") + (princ " t)")))) + (mapatoms (lambda (symbol) + (let ((value (get symbol 'saved-face))) + (when (and (not (eq symbol 'default)) + ;; Don't print default face here. + value) + (princ "\n '(") + (prin1 symbol) + (princ " ") + (prin1 value) + (if (or (get symbol 'face-defface-spec) + (and (not (find-face symbol)) + (not (get symbol 'force-face)))) + (princ ")") + (princ " t)")))))) (princ ")") (unless (looking-at "\n") (princ "\n"))))) -(defun custom-save-resets (property setter special) - (let (started-writing ignored-special) - ;; (custom-save-delete setter) Done by caller - (let ((standard-output (current-buffer)) - (mapper `(lambda (object) - (let ((spec (car-safe (get object (quote ,property))))) - (when (and (not (memq object ignored-special)) - (eq (car spec) 'user) - (eq (second spec) 'reset)) - ;; Do not write reset statements unless necessary. - (unless started-writing - (setq started-writing t) - (unless (bolp) - (princ "\n")) - (princ "(") - (princ (quote ,setter)) - (princ "\n '(") - (prin1 object) - (princ " ") - (prin1 (third spec)) - (princ ")"))))))) - (mapc mapper special) - (setq ignored-special special) - (mapatoms mapper) - (when started-writing - (princ ")\n"))))) - - -(defun custom-save-loaded-themes () - (let ((themes (reverse (get 'user 'theme-loads-themes))) - (standard-output (current-buffer))) - (when themes - (unless (bolp) (princ "\n")) - (princ "(custom-load-themes") - (mapc (lambda (theme) - (princ "\n '") - (prin1 theme)) themes) - (princ " )\n")))) - ;;;###autoload (defun customize-save-customized () "Save all user options which have been set in this session." (interactive) (mapatoms (lambda (symbol) (let ((face (get symbol 'customized-face)) - (value (get symbol 'customized-value)) - (face-comment (get symbol 'customized-face-comment)) - (variable-comment - (get symbol 'customized-variable-comment))) + (value (get symbol 'customized-value))) (when face (put symbol 'saved-face face) - (custom-push-theme 'theme-face symbol 'user 'set value) (put symbol 'customized-face nil)) (when value (put symbol 'saved-value value) - (custom-push-theme 'theme-value symbol 'user 'set value) - (put symbol 'customized-value nil)) - (when variable-comment - (put symbol 'saved-variable-comment variable-comment) - (put symbol 'customized-variable-comment nil)) - (when face-comment - (put symbol 'saved-face-comment face-comment) - (put symbol 'customized-face-comment nil))))) + (put symbol 'customized-value nil))))) ;; We really should update all custom buffers here. (custom-save-all)) @@ -3584,19 +3262,6 @@ (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 12e008d41344 -r 697ef44129c6 lisp/cus-face.el --- a/lisp/cus-face.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cus-face.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen -;; Maintainer: Hrvoje Niksic +;; Maintainer: Hrvoje Niksic ;; Keywords: help, faces ;; Version: 1.9960-x ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ @@ -30,7 +30,6 @@ "Like `defface', but FACE is evaluated as a normal argument." ;; (when (fboundp 'pureload) ;; (error "Attempt to declare a face during dump")) - ;; #### should we possibly reset force-face here? (unless (get face 'face-defface-spec) (put face 'face-defface-spec spec) (unless (find-face face) @@ -40,12 +39,12 @@ frame) ;; Create global face. (make-empty-face face) - (face-display-set face value nil '(custom)) + (face-display-set face value) ;; Create frame local faces (while frames (setq frame (car frames) frames (cdr frames)) - (face-display-set face value frame '(custom))) + (face-display-set face value frame)) (init-face-from-resources face))) (when (and doc (null (face-doc-string face))) (set-face-doc-string face doc)) @@ -70,7 +69,7 @@ custom-set-face-font-size custom-face-font-size) (:family (editable-field :format "Font Family: %v" :help-echo "\ -Name of font family to use (e.g. times).") +Name of font family to use (e.g. times).") custom-set-face-font-family custom-face-font-family) (:background-pixmap (editable-field :format "Background pixmap: %v" :help-echo "\ @@ -111,7 +110,7 @@ The GET function should take two arguments, the face to examine, and optonally the frame where the face should be examined.") -(defun face-custom-attributes-set (face frame tags &rest atts) +(defun face-custom-attributes-set (face frame &rest atts) "For FACE on FRAME set the attributes [KEYWORD VALUE].... Each keyword should be listed in `custom-face-attributes'. @@ -122,7 +121,7 @@ (fun (nth 2 (assq name custom-face-attributes)))) (setq atts (cdr (cdr atts))) (condition-case nil - (funcall fun face value frame tags) + (funcall fun face value frame) (error nil))))) (defun face-custom-attributes-get (face frame) @@ -158,11 +157,11 @@ (list (list t (face-custom-attributes-get symbol (selected-frame)))))) -(defun custom-set-face-bold (face value &optional frame tags) +(defun custom-set-face-bold (face value &optional frame) "Set the bold property of FACE to VALUE." (if value - (make-face-bold face frame tags) - (make-face-unbold face frame tags))) + (make-face-bold face frame) + (make-face-unbold face frame))) ;; Really, we should get rid of these font.el dependencies... They ;; are still presenting a problem with dumping the faces (font.el is @@ -177,11 +176,11 @@ (fontobj (font-create-object font))) (font-bold-p fontobj))) -(defun custom-set-face-italic (face value &optional frame tags) +(defun custom-set-face-italic (face value &optional frame) "Set the italic property of FACE to VALUE." (if value - (make-face-italic face frame tags) - (make-face-unitalic face frame tags))) + (make-face-italic face frame) + (make-face-unitalic face frame))) (defun custom-face-italic (face &rest args) "Return non-nil if the font of FACE is italic." @@ -197,13 +196,13 @@ (and image (image-instance-file-name image)))) -(defun custom-set-face-font-size (face size &optional locale tags) +(defun custom-set-face-font-size (face size &rest args) "Set the font of FACE to SIZE" - (let* ((font (apply 'face-font-name face locale)) + (let* ((font (apply 'face-font-name face args)) ;; Gag (fontobj (font-create-object font))) (set-font-size fontobj size) - (apply 'font-set-face-font face fontobj locale tags))) + (apply 'font-set-face-font face fontobj args))) (defun custom-face-font-size (face &rest args) "Return the size of the font of FACE as a string." @@ -212,13 +211,13 @@ (fontobj (font-create-object font))) (format "%s" (font-size fontobj)))) -(defun custom-set-face-font-family (face family &optional locale tags) +(defun custom-set-face-font-family (face family &rest args) "Set the font of FACE to FAMILY." - (let* ((font (apply 'face-font-name face locale)) + (let* ((font (apply 'face-font-name face args)) ;; Gag (fontobj (font-create-object font))) (set-font-family fontobj family) - (apply 'font-set-face-font face fontobj locale tags))) + (apply 'font-set-face-font face fontobj args))) (defun custom-face-font-family (face &rest args) "Return the name of the font family of FACE." @@ -234,101 +233,40 @@ (let ((spec (face-spec-update-all-matching (custom-face-get-spec face) display plist))) (put face 'customized-face spec) - (face-spec-set face spec nil '(custom)))) + (face-spec-set face spec))) ;;; Initializing. ;;;###autoload (defun custom-set-faces (&rest args) "Initialize faces according to user preferences. -This asociates the setting with the USER theme. The arguments should be a list where each entry has the form: - (FACE SPEC [NOW [COMMENT]]) + (FACE SPEC [NOW]) SPEC will be stored as the saved value for FACE. If NOW is present and non-nil, FACE will also be created according to SPEC. -COMMENT is a string comment about FACE. See `defface' for the format of SPEC." - (apply #'custom-theme-set-faces 'user args)) - -;;;###autoload -(defun custom-theme-set-faces (theme &rest args) - "Initialize faces according to settings specified by args. -Records the settings as belonging to THEME. - -See `custom-set-faces' for a description of the arguments ARGS." - (custom-check-theme theme) - (let ((immediate (get theme 'theme-immediate))) - (while args - (let ((entry (car args))) - (if (listp entry) - (let ((face (nth 0 entry)) - (spec (nth 1 entry)) - (now (nth 2 entry)) - (comment (nth 3 entry))) - (put face 'saved-face spec) - (custom-push-theme 'theme-face face theme 'set spec) - (put face 'saved-face-comment comment) - (when (or now immediate) - (put face 'force-face (if now 'rogue 'immediate))) - (when (or now immediate (find-face face)) - (put face 'face-comment comment) - (unless (find-face face) - (make-empty-face face)) - (face-spec-set face spec nil '(custom))) - (setq args (cdr args))) - ;; Old format, a plist of FACE SPEC pairs. - (let ((face (nth 0 args)) - (spec (nth 1 args))) + (while args + (let ((entry (car args))) + (if (listp entry) + (let ((face (nth 0 entry)) + (spec (nth 1 entry)) + (now (nth 2 entry))) (put face 'saved-face spec) - (custom-push-theme 'theme-face face theme 'set spec)) - (setq args (cdr (cdr args)))))))) - -;;;###autoload -(defun custom-theme-face-value (face theme) - "Return spec of FACE in THEME if the THEME modifies the -FACE. Nil otherwise." - (car-safe (custom-theme-value theme (get face 'theme-face)))) - -(defun custom-theme-reset-internal-face (face to-theme) - (let ((spec (custom-theme-face-value face to-theme)) - was-in-theme) - (setq was-in-theme spec) - (setq spec (or spec (get face 'standard-value))) - (when spec - (put face 'save-face was-in-theme) - (when (or (get face 'force-face) (find-face face)) + (when now + (put face 'force-face t)) + (when (or now (find-face face)) (unless (find-face face) (make-empty-face face)) - (face-spec-set face spec))) - spec)) - -;;;###autoload -(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. - -ARGS is a list of lists of the form - - (face to-theme) - -This means reset face to its value in to-theme." - (mapc #'(lambda (arg) - (apply #'custom-theme-reset-internal-face arg) - (custom-push-theme (car arg) 'theme-face theme 'reset (cadr arg))) - args)) - -;;;###autoload -(defun custom-reset-faces (&rest args) - "Reset the value of the face to values previously defined. -Assosiate this setting with the 'user' theme. - -ARGS is defined as for `custom-theme-reset-faces'" - (apply #'custom-theme-reset-faces 'user args)) - + (face-spec-set face spec)) + (setq args (cdr args))) + ;; Old format, a plist of FACE SPEC pairs. + (let ((face (nth 0 args)) + (spec (nth 1 args))) + (put face 'saved-face spec)) + (setq args (cdr (cdr args))))))) ;;; The End. diff -r 12e008d41344 -r 697ef44129c6 lisp/cus-file.el --- a/lisp/cus-file.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -;;; 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)) - (init-file-directory (file-name-directory init-file))) - (if (or force-new - (string= init-file-directory - (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 12e008d41344 -r 697ef44129c6 lisp/cus-load.el --- a/lisp/cus-load.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cus-load.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1997 by Free Software Foundation, Inc. -;; Author: Steven L Baur +;; Author: Steven L Baur ;; Keywords: internal, help, faces ;; This file is part of XEmacs. diff -r 12e008d41344 -r 697ef44129c6 lisp/cus-start.el --- a/lisp/cus-start.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/cus-start.el Mon Aug 13 11:20:41 2007 +0200 @@ -60,11 +60,9 @@ (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) - (bell-inhibit-time sound integer) (echo-keystrokes keyboard integer) (gc-cons-threshold alloc integer) (next-screen-context-lines display integer) diff -r 12e008d41344 -r 697ef44129c6 lisp/custom-load.el --- a/lisp/custom-load.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/custom-load.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,6 @@ ;;; 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")) @@ -17,7 +15,7 @@ (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" "x-init" "toolbar-items" "cus-edit" "gnuserv" "sound")) +(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "x-init" "toolbar-items" "cus-edit" "gnuserv" "sound")) (custom-add-loads 'sound '("sound")) (custom-add-loads 'pui '("package-ui")) (custom-add-loads 'terminals '("gnuserv")) @@ -45,11 +43,10 @@ (custom-add-loads 'comm '("ldap")) (custom-add-loads 'backup '("files")) (custom-add-loads 'frames '("frame" "window-xemacs" "gui" "gnuserv")) -(custom-add-loads 'customize '("wid-edit" "cus-edit")) +(custom-add-loads 'customize '("cus-edit" "wid-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")) @@ -58,14 +55,13 @@ (custom-add-loads 'widget-button '("wid-edit")) (custom-add-loads 'paren-blinking '("simple")) (custom-add-loads 'find-file '("files")) -(custom-add-loads 'font-menu '("font-menu")) +(custom-add-loads 'font-menu '("x-font-menu")) (custom-add-loads 'files '("files")) (custom-add-loads 'build '("build-report")) (custom-add-loads 'font-lock '("font-lock")) (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" "gutter-items")) (custom-add-loads 'fill-comments '("simple")) (custom-add-loads 'windows '("window" "window-xemacs")) (custom-add-loads 'widget-faces '("wid-edit")) @@ -77,16 +73,15 @@ (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 '("printer" "cus-edit")) +(custom-add-loads 'wp '("cus-edit")) (custom-add-loads 'vc '("files")) (custom-add-loads 'isearch '("isearch-mode")) (custom-add-loads 'font-lock-faces '("font-lock")) (custom-add-loads 'modeline '("modeline")) -(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "cus-edit" "dragdrop")) +(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "dragdrop" "cus-edit")) (custom-add-loads 'matching '("simple" "isearch-mode" "hyper-apropos")) (custom-add-loads 'i18n '("cus-edit")) (custom-add-loads 'info '("toolbar-items" "info")) -(custom-add-loads 'x '("x-faces")) -(custom-add-loads 'buffers-tab '("gutter-items")) +(custom-add-loads 'x '("x-faces" "x-font-menu")) ;;; custom-load.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/custom.el --- a/lisp/custom.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/custom.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. ;; Author: Per Abrahamsen -;; Maintainer: Hrvoje Niksic +;; Maintainer: Hrvoje Niksic ;; Keywords: help, faces, dumped ;; Version: 1.9960-x ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ @@ -31,18 +31,12 @@ ;; This file only contain the code needed to declare and initialize ;; user options. The code to customize options is autoloaded from -;; `cus-edit.el'. +;; `cus-edit.el'. ;; ;; The code implementing face declarations is in `cus-face.el' ;;; Code: -(eval-when-compile - (load "cl-macs" nil t)) - -(autoload 'custom-declare-face "cus-face") -(autoload 'defun* "cl-macs") - (require 'widget) (defvar custom-define-hook nil @@ -61,8 +55,8 @@ (unless (default-boundp symbol) ;; Use the saved value if it exists, otherwise the standard setting. (set-default symbol (if (get symbol 'saved-value) - (eval (car (get symbol 'saved-value))) - (eval value))))) + (eval (car (get symbol 'saved-value))) + (eval value))))) (defun custom-initialize-set (symbol value) "Initialize SYMBOL with VALUE. @@ -70,83 +64,83 @@ `:set' to initialize SYMBOL." (unless (default-boundp symbol) (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (if (get symbol 'saved-value) - (eval (car (get symbol 'saved-value))) - (eval value))))) + symbol + (if (get symbol 'saved-value) + (eval (car (get symbol 'saved-value))) + (eval value))))) (defun custom-initialize-reset (symbol value) "Initialize SYMBOL with VALUE. Like `custom-initialize-set', but use the function specified by `:get' to reinitialize SYMBOL if it is already bound." (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (cond ((default-boundp symbol) - (funcall (or (get symbol 'custom-get) 'default-value) - symbol)) - ((get symbol 'saved-value) - (eval (car (get symbol 'saved-value)))) - (t - (eval value))))) + symbol + (cond ((default-boundp symbol) + (funcall (or (get symbol 'custom-get) 'default-value) + symbol)) + ((get symbol 'saved-value) + (eval (car (get symbol 'saved-value)))) + (t + (eval value))))) (defun custom-initialize-changed (symbol value) "Initialize SYMBOL with VALUE. -Like `custom-initialize-reset', but only use the `:set' function if the +Like `custom-initialize-reset', but only use the `:set' function if the not using the standard setting. Otherwise, use the `set-default'." (cond ((default-boundp symbol) - (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (funcall (or (get symbol 'custom-get) 'default-value) - symbol))) - ((get symbol 'saved-value) - (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (eval (car (get symbol 'saved-value))))) - (t - (set-default symbol (eval value))))) + (funcall (or (get symbol 'custom-set) 'set-default) + symbol + (funcall (or (get symbol 'custom-get) 'default-value) + symbol))) + ((get symbol 'saved-value) + (funcall (or (get symbol 'custom-set) 'set-default) + symbol + (eval (car (get symbol 'saved-value))))) + (t + (set-default symbol (eval value))))) (defun custom-declare-variable (symbol value doc &rest args) "Like `defcustom', but SYMBOL and VALUE are evaluated as normal arguments." ;; Remember the standard setting. (put symbol 'standard-value (list value)) ;; Maybe this option was rogue in an earlier version. It no longer is. - (when (eq (get symbol 'force-value) 'rogue) - ;; It no longer is. + (when (get symbol 'force-value) + ;; It no longer is. (put symbol 'force-value nil)) (when doc (put symbol 'variable-documentation doc)) (let ((initialize 'custom-initialize-reset) - (requests nil)) - (while args + (requests nil)) + (while args (let ((arg (car args))) - (setq args (cdr args)) - (check-argument-type 'keywordp arg) - (let ((keyword arg) - (value (car args))) - (unless args - (signal 'error (list "Keyword is missing an argument" keyword))) - (setq args (cdr args)) - (cond ((eq keyword :initialize) - (setq initialize value)) - ((eq keyword :set) - (put symbol 'custom-set value)) - ((eq keyword :get) - (put symbol 'custom-get value)) - ((eq keyword :require) - (setq requests (cons value requests))) - ((eq keyword :type) - (put symbol 'custom-type value)) - ((eq keyword :options) - (if (get symbol 'custom-options) - ;; Slow safe code to avoid duplicates. - (mapc (lambda (option) - (custom-add-option symbol option)) - value) - ;; Fast code for the common case. - (put symbol 'custom-options (copy-sequence value)))) - (t - (custom-handle-keyword symbol keyword value - 'custom-variable)))))) + (setq args (cdr args)) + (check-argument-type 'keywordp arg) + (let ((keyword arg) + (value (car args))) + (unless args + (signal 'error (list "Keyword is missing an argument" keyword))) + (setq args (cdr args)) + (cond ((eq keyword :initialize) + (setq initialize value)) + ((eq keyword :set) + (put symbol 'custom-set value)) + ((eq keyword :get) + (put symbol 'custom-get value)) + ((eq keyword :require) + (setq requests (cons value requests))) + ((eq keyword :type) + (put symbol 'custom-type value)) + ((eq keyword :options) + (if (get symbol 'custom-options) + ;; Slow safe code to avoid duplicates. + (mapc (lambda (option) + (custom-add-option symbol option)) + value) + ;; Fast code for the common case. + (put symbol 'custom-options (copy-sequence value)))) + (t + (custom-handle-keyword symbol keyword value + 'custom-variable)))))) (put symbol 'custom-requests requests) ;; Do the actual initialization. (funcall initialize symbol value)) @@ -164,29 +158,29 @@ If SYMBOL is not already bound, initialize it to VALUE. The remaining arguments should have the form - [KEYWORD VALUE]... + [KEYWORD VALUE]... The following KEYWORD's are defined: -:type VALUE should be a widget type for editing the symbols value. - The default is `sexp'. +:type VALUE should be a widget type for editing the symbols value. + The default is `sexp'. :options VALUE should be a list of valid members of the widget type. -:group VALUE should be a customization group. +:group VALUE should be a customization group. Add SYMBOL to that group. :initialize VALUE should be a function used to initialize the - variable. It takes two arguments, the symbol and value - given in the `defcustom' call. The default is - `custom-initialize-set' -:set VALUE should be a function to set the value of the symbol. - It takes two arguments, the symbol to set and the value to - give it. The default is `set-default'. -:get VALUE should be a function to extract the value of symbol. - The function takes one argument, a symbol, and should return - the current value for that symbol. The default is - `default-value'. + variable. It takes two arguments, the symbol and value + given in the `defcustom' call. The default is + `custom-initialize-set' +:set VALUE should be a function to set the value of the symbol. + It takes two arguments, the symbol to set and the value to + give it. The default is `set-default'. +:get VALUE should be a function to extract the value of symbol. + The function takes one argument, a symbol, and should return + the current value for that symbol. The default is + `default-value'. :require VALUE should be a feature symbol. Each feature will be - required after initialization, of the the user have saved this - option. + required after initialization, of the the user have saved this + option. Read the section about customization in the Emacs Lisp manual for more information." @@ -227,7 +221,7 @@ match one of the ITEM. The following REQ are defined: `type' (the value of `window-system') - Should be one of `x', `mswindows', or `tty'. + Should be one of `x' or `tty'. `class' (the frame's color support) Should be one of `color', `grayscale', or `mono'. @@ -243,7 +237,7 @@ (defun custom-declare-group (symbol members doc &rest args) "Like `defgroup', but SYMBOL is evaluated as a normal argument." - (while members + (while members (apply 'custom-add-to-group symbol (car members)) (pop members)) (put symbol 'custom-group (nconc members (get symbol 'custom-group))) @@ -254,15 +248,15 @@ (setq args (cdr args)) (check-argument-type 'keywordp arg) (let ((keyword arg) - (value (car args))) - (unless args - (signal 'error (list "Keyword is missing an argument" keyword))) - (setq args (cdr args)) - (cond ((eq keyword :prefix) - (put symbol 'custom-prefix value)) - (t - (custom-handle-keyword symbol keyword value - 'custom-group)))))) + (value (car args))) + (unless args + (signal 'error (list "Keyword is missing an argument" keyword))) + (setq args (cdr args)) + (cond ((eq keyword :prefix) + (put symbol 'custom-prefix value)) + (t + (custom-handle-keyword symbol keyword value + 'custom-group)))))) (run-hooks 'custom-define-hook) symbol) @@ -279,7 +273,7 @@ The remaining arguments should have the form - [KEYWORD VALUE]... + [KEYWORD VALUE]... The following KEYWORD's are defined: @@ -297,9 +291,9 @@ "To existing GROUP add a new OPTION of type WIDGET. If there already is an entry for that option, overwrite it." (let* ((members (get group 'custom-group)) - (old (assq option members))) + (old (assq option members))) (if old - (setcar (cdr old) widget) + (setcar (cdr old) widget) (put group 'custom-group (nconc members (list (list option widget)))))) (puthash group t custom-group-hash-table)) @@ -308,32 +302,32 @@ (defun custom-handle-all-keywords (symbol args type) "For customization option SYMBOL, handle keyword arguments ARGS. Third argument TYPE is the custom option type." - (while args + (while args (let ((arg (car args))) (setq args (cdr args)) (check-argument-type 'keywordp arg) (let ((keyword arg) - (value (car args))) - (unless args - (signal 'error (list "Keyword is missing an argument" keyword))) - (setq args (cdr args)) - (custom-handle-keyword symbol keyword value type))))) + (value (car args))) + (unless args + (signal 'error (list "Keyword is missing an argument" keyword))) + (setq args (cdr args)) + (custom-handle-keyword symbol keyword value type))))) (defun custom-handle-keyword (symbol keyword value type) "For customization option SYMBOL, handle KEYWORD with VALUE. Fourth argument TYPE is the custom option type." (cond ((eq keyword :group) - (custom-add-to-group value symbol type)) - ((eq keyword :version) - (custom-add-version symbol value)) - ((eq keyword :link) - (custom-add-link symbol value)) - ((eq keyword :load) - (custom-add-load symbol value)) - ((eq keyword :tag) - (put symbol 'custom-tag value)) - (t - (signal 'error (list "Unknown keyword" keyword))))) + (custom-add-to-group value symbol type)) + ((eq keyword :version) + (custom-add-version symbol value)) + ((eq keyword :link) + (custom-add-link symbol value)) + ((eq keyword :load) + (custom-add-load symbol value)) + ((eq keyword :tag) + (put symbol 'custom-tag value)) + (t + (signal 'error (list "Unknown keyword" keyword))))) (defun custom-add-option (symbol option) "To the variable SYMBOL add OPTION. @@ -362,278 +356,46 @@ (unless (member load loads) (put symbol 'custom-loads (cons load loads))))) -;;; deftheme macro - -(defvar custom-known-themes '(user standard) - "Themes that have been defthemed.") - -;; #### add strings for group -;; #### during bootstrap we cannot use cl-macs stuff -(defun* custom-define-theme (theme feature &optional doc - &key short-description immediate variable-reset-string - variable-set-string face-set-string face-reset-string - &allow-other-keys) - (push theme custom-known-themes) - (put theme 'theme-feature feature) - (put theme 'theme-documentation doc) - (if immediate (put theme 'theme-immediate immediate)) - (if variable-reset-string - (put theme 'theme-variable-reset-string variable-reset-string )) - (if variable-set-string - (put theme 'theme-variable-set-string variable-set-string )) - (if face-reset-string - (put theme 'theme-face-reset-string face-reset-string )) - (if face-set-string - (put theme 'theme-face-set-string face-set-string )) - (if short-description - (put theme 'theme-short-description short-description ))) - -(defun custom-make-theme-feature (theme) - (intern (concat (symbol-name theme) "-theme"))) - -(defmacro deftheme (theme &rest body) - "(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 -following keyboard arguments - -:short-description DESC - DESC is a short (one line) description of the theme. If not given DOC - is used. -:immediate FLAG - If FLAG is non-nil variables set in this theme are bound - immediately when loading the theme. -:variable-set-string VARIABLE_-SET-STRING - A string used by the UI to indicate that the value takes it - setting from this theme. It is passed to FORMAT with the - name of the theme a additional argument. - If not given, a generic description is used. -:variable-reset-string VARIABLE-RESET-STRING - As above but used in the case the variable has been forced to - the value in this theme. -:face-set-string FACE-SET-STRING -:face-reset-string FACE-RESET-STRING - As above but for faces." - (let ((feature (custom-make-theme-feature theme))) - `(custom-define-theme (quote ,theme) (quote ,feature) ,@body))) - -(defsubst custom-theme-p (theme) - "Non-nil when THEME has been defined." - (memq theme custom-known-themes)) - -(defsubst custom-check-theme (theme) - "Check whether THEME is valid and signal an error if NOT" - (unless (custom-theme-p theme) - (error "Unknown theme `%s'" theme))) - - -; #### do we need to deftheme 'user and/or 'standard here to make the -; code in cus-edit cleaner?. - ;;; Initializing. -(defun custom-push-theme (prop symbol theme mode value) - (let ((old (get symbol prop))) - (if (eq (car-safe (car-safe old)) theme) - (setq old (cdr old))) - (put symbol prop (cons (list theme mode value) old)))) +(defun custom-set-variables (&rest args) + "Initialize variables according to user preferences. -(defun custom-set-variables (&rest args) - "Initialize variables according to user preferences. -The settings are registered as theme `user'. The arguments should be a list where each entry has the form: - (SYMBOL VALUE [NOW [REQUEST [COMMENT]]]) + (SYMBOL VALUE [NOW]) The unevaluated VALUE is stored as the saved value for SYMBOL. If NOW is present and non-nil, VALUE is also evaluated and bound as -the default value for the SYMBOL. -REQUEST is a list of features we must 'require for SYMBOL. -COMMENT is a comment string about SYMBOL." - (apply 'custom-theme-set-variables 'user args)) - -(defun custom-theme-set-variables (theme &rest args) - "Initialize variables according to settings specified by args. -Records the settings as belonging to THEME. - -See `custom-set-variables' for a description of the arguments ARGS." - (custom-check-theme theme) - (let ((immediate (get theme 'theme-immediate))) - (while args * etc/custom/example-themes/example-theme.el: - (let ((entry (car args))) - (if (listp entry) - (let* ((symbol (nth 0 entry)) - (value (nth 1 entry)) - (now (nth 2 entry)) - (requests (nth 3 entry)) - (comment (nth 4 entry)) - (set (or (get symbol 'custom-set) 'set-default))) - (put symbol 'saved-value (list value)) - (custom-push-theme 'theme-value symbol theme 'set value) - (put symbol 'saved-variable-comment comment) - (cond ((or now immediate) - ;; Rogue variable, set it now. - (put symbol 'force-value (if now 'rogue 'immediate)) - (funcall set symbol (eval value))) - ((default-boundp symbol) - ;; Something already set this, overwrite it. - (funcall set symbol (eval value)))) - (and (or now (default-boundp symbol)) - (put symbol 'variable-comment comment)) - (when requests - (put symbol 'custom-requests requests) - (mapc 'require requests)) - (setq args (cdr args))) - ;; Old format, a plist of SYMBOL VALUE pairs. - (message "Warning: old format `custom-set-variables'") - (ding) - (sit-for 2) - (let ((symbol (nth 0 args)) - (value (nth 1 args))) - (put symbol 'saved-value (list value)) - (custom-push-theme 'theme-value symbol theme 'set value)) - (setq args (cdr (cdr args)))))))) - -(defvar custom-loaded-themes nil - "Themes in the order they are loaded.") - -(defun custom-theme-loaded-p (theme) - "Return non-nil when THEME has been loaded." - (memq theme custom-loaded-themes)) - -(defun provide-theme (theme) - "Indicate that this file provides THEME." - (custom-check-theme theme) - (provide (get theme 'theme-feature)) - (push theme custom-loaded-themes)) - -(defun require-theme (theme &optional soft) - "Try to load a theme by requiring its feature." - ;; Note we do no check for validity of the theme here. - ;; This allows to pull in themes by a file-name convention - (require (get theme 'theme-feature (custom-make-theme-feature theme)))) - -(defun custom-do-theme-reset (theme) - ; #### untested! slow! - (let (spec-list) - (mapatoms (lambda (symbol) - (setq spec-list (get symbol 'theme-value)) - (when spec-list - (setq spec-list (delete-if (lambda (elt) - (eq (car elt) theme)) - spec-list)) - (put symbol 'theme-value spec-list) - (custom-theme-reset-internal symbol 'user)) - (setq spec-list (get symbol 'theme-face)) - (when spec-list - (setq spec-list (delete-if (lambda (elt) - (eq (car elt) theme)) - spec-list)) - (put symbol 'theme-face spec-list) - (custom-theme-reset-internal-face symbol 'user)))))) - -(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 - - a SYMBOL - require the theme SYMBOL - - a list (reset THEME) - Undo all the settings made by THEME. - - a list (hidden THEME) - require the THEME but hide it from the user." - (custom-check-theme by-theme) - (dolist (theme body) - (cond ((and (consp theme) (eq (car theme) 'reset)) - (custom-do-theme-reset (cadr theme))) - ((and (consp theme) (eq (car theme) 'hidden)) - (require-theme (cadr theme)) - (unless (custom-theme-loaded-p (cadr theme)) - (put (cadr theme) 'theme-hidden t))) - (t - (require-theme theme) - (remprop theme 'theme-hidden))) - (push theme (get by-theme 'theme-loads-themes)))) - -(defun custom-load-themes (&rest body) - "Load themes for the USER theme as specified by BODY. - -BODY is as with custom-theme-load-themes." - (apply #'custom-theme-load-themes 'user body)) - - - - -(defsubst copy-upto-last (elt list) - "Copy all the elements of the list upto the last occurence of elt" - ;; Is it faster to do more work in C than to do less in elisp? - (nreverse (cdr (member elt (reverse list))))) - -(defun custom-theme-value (theme theme-spec-list) - "Determine the value for THEME defined by THEME-SPEC-LIST. -Returns (list value) if found. Nil otherwise." - ;; Note we do _NOT_ signal an error if the theme is unknown - ;; it might have gone away without the user knowing. - (let ((theme-or-lower (memq theme (cons 'user custom-loaded-themes))) - value) - (mapc #'(lambda (theme-spec) - (when (member (car theme-spec) theme-or-lower) - (setq value (cdr theme-spec)) - ;; We need to continue because if theme =A and we found - ;; B then if the load order is B A C B - ;; we actually want the value in C. - (setq theme-or-lower (copy-upto-last (car theme-spec) - theme-or-lower)) - ;; We could should circuit if this is now nil. - )) - theme-spec-list) - (if value - (if (eq (car value) 'set) - (list (cadr value)) - ;; Yet another reset spec. car value = reset - (custom-theme-value (cadr value) theme-spec-list))))) - - -(defun custom-theme-variable-value (variable theme) - "Return (list value) value of VARIABLE in THEME if the THEME modifies the -VARIABLE. Nil otherwise." - (custom-theme-value theme (get variable 'theme-value))) - -(defun custom-theme-reset-internal (symbol to-theme) - (let ((value (custom-theme-variable-value symbol to-theme)) - was-in-theme) - (setq was-in-theme value) - (setq value (or value (get symbol 'standard-value))) - (when value - (put symbol 'saved-value was-in-theme) - (if (or (get 'force-value symbol) (default-boundp symbol)) - (funcall (get symbol 'custom-set 'set-default) symbol - (eval (car value))))) - value)) - - -(defun custom-theme-reset-variables (theme &rest args) - "Reset the value of the variables to values previously defined. -Assosiate this setting with THEME. - -ARGS is a list of lists of the form - - (variable to-theme) - -This means reset variable to its value in to-theme." - (custom-check-theme theme) - (mapc #'(lambda (arg) - (apply #'custom-theme-reset-internal arg) - (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg))) - args)) - -(defun custom-reset-variables (&rest args) - "Reset the value of the variables to values previously defined. -Assosiate this setting with the `user' theme. - -The ARGS are as in `custom-theme-reset-variables'." - (apply #'custom-theme-reset-variables 'user args)) - +the default value for the SYMBOL." + (while args + (let ((entry (car args))) + (if (listp entry) + (let* ((symbol (nth 0 entry)) + (value (nth 1 entry)) + (now (nth 2 entry)) + (requests (nth 3 entry)) + (set (or (get symbol 'custom-set) 'set-default))) + (put symbol 'saved-value (list value)) + (cond (now + ;; Rogue variable, set it now. + (put symbol 'force-value t) + (funcall set symbol (eval value))) + ((default-boundp symbol) + ;; Something already set this, overwrite it. + (funcall set symbol (eval value)))) + (when requests + (put symbol 'custom-requests requests) + (mapc 'require requests)) + (setq args (cdr args))) + ;; Old format, a plist of SYMBOL VALUE pairs. + (message "Warning: old format `custom-set-variables'") + (ding) + (sit-for 2) + (let ((symbol (nth 0 args)) + (value (nth 1 args))) + (put symbol 'saved-value (list value))) + (setq args (cdr (cdr args))))))) ;;; The End. diff -r 12e008d41344 -r 697ef44129c6 lisp/device.el --- a/lisp/device.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/device.el Mon Aug 13 11:20:41 2007 +0200 @@ -31,18 +31,6 @@ ;;; Code: -;;; Initialization - -; Specifier tag 'printer which matches printers -(define-specifier-tag 'printer (function device-printer-p)) - -; Specifier tag 'display which matches displays -(define-specifier-tag 'display (function - (lambda (device) - (not (device-printer-p device))))) - -;;; Functions - (defun device-list () "Return a list of all devices." (apply 'nconc (mapcar 'console-device-list (console-list)))) @@ -53,8 +41,8 @@ Value is `tty' for a tty device (a character-only terminal), `x' for a device that is a screen on an X display, `ns' for a device that is a NeXTstep connection (not yet implemented), -`mswindows' for a device that is a MS Windows workstation, -`msprinter' for a device that is a MS Windows printer connection, +`mswindows' for a device that is a Windows or Windows NT connection, +`pc' for a device that is a direct-write MS-DOS screen (not yet implemented), `stream' for a stream device (which acts like a stdio stream), and `dead' for a deleted device." (or device (setq device (selected-device))) @@ -120,7 +108,7 @@ (defun call-device-method (name device &rest args) "Call a DEVICE-specific function with the generic name NAME. -If DEVICE is not provided then the selected device is used." +If DEVICE is not provide the selected device is used." (or device (setq device (selected-device))) (or (symbolp name) (error "function name must be a symbol")) (let ((devmeth (intern (concat (symbol-name diff -r 12e008d41344 -r 697ef44129c6 lisp/dialog.el --- a/lisp/dialog.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/dialog.el Mon Aug 13 11:20:41 2007 +0200 @@ -28,35 +28,33 @@ ;; 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 yes-or-no question with a popup dialog box. -Return t if the answer is \"yes\". + "Ask user a \"y or n\" question with a popup dialog box. +Returns t if answer is \"yes\". Takes one argument, which is the string to display to ask the question." - (save-selected-frame + (let ((echo-keystrokes 0) + event) (popup-dialog-box - (list prompt ["Yes" yes t] ["No" no t] nil ["Cancel" cancel t])) - (let (event) - (catch 'ynp-done - (while t - (setq event (next-command-event event)) - (when (misc-user-event-p event) - (message "%s" (event-object event)) - (case (event-object event) - ((yes) (throw 'ynp-done t)) - ((no) (throw 'ynp-done nil)) - ((cancel menu-no-selection-hook) (signal 'quit nil)))) - (unless (button-release-event-p event) ; don't beep twice - (beep) - (message "please answer the 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"))))))) (defun yes-or-no-p-maybe-dialog-box (prompt) "Ask user a yes-or-no question. Return t if answer is yes. @@ -80,9 +78,10 @@ (yes-or-no-p-dialog-box prompt) (y-or-n-p-minibuf prompt))) -(when (fboundp 'popup-dialog-box) - (fset 'yes-or-no-p 'yes-or-no-p-maybe-dialog-box) - (fset 'y-or-n-p 'y-or-n-p-maybe-dialog-box)) +(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. @@ -139,7 +138,7 @@ 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))) @@ -155,63 +154,4 @@ (apply 'message-box fmt args) (apply 'message fmt args))) -(defun make-dialog-box (&optional spec props parent) - "Create a frame suitable for use as a general dialog box. -The frame is made a child of PARENT (defaults to the selected frame), -and has additional properties PROPS, as well as `dialog-frame-plist'. -SPEC is a string or glyph to be placed in the gutter. If INVISIBLE is -non-nil then the frame is initially unmapped. -Normally the created frame has no modelines, menubars, scrollbars, -minibuffer or toolbars and is entirely covered by its gutter." - (or parent (setq parent (selected-frame))) - (let* ((ftop (frame-property parent 'top)) - (fleft (frame-property parent 'left)) - (fwidth (frame-pixel-width parent)) - (fheight (frame-pixel-height parent)) - (fonth (font-height (face-font 'default))) - (fontw (font-width (face-font 'default))) - (props (append props dialog-frame-plist)) - (dfheight (plist-get props 'height)) - (dfwidth (plist-get props 'width)) - (unmapped (plist-get props 'initially-unmapped)) - (gutter-spec spec) - (name (or (plist-get props 'name) "XEmacs")) - (frame nil)) - (plist-remprop props 'initially-unmapped) - ;; allow the user to just provide a glyph - (when (glyphp spec) - (setq gutter-spec (copy-sequence "\n")) - (set-extent-begin-glyph (make-extent 0 1 gutter-spec) 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 props - `(popup ,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)) - frame)) - - ;;; dialog.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/disass.el --- a/lisp/disass.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/disass.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,8 +3,8 @@ ;;; Copyright (C) 1986, 1991-1994 Free Software Foundation, Inc. ;; Author: Doug Cutting -;; Jamie Zawinski -;; Maintainer: XEmacs Development Team +;; Jamie Zawinski +;; Maintainer: Jamie Zawinski ;; Keywords: internal ;; This file is part of XEmacs. diff -r 12e008d41344 -r 697ef44129c6 lisp/dump-paths.el --- a/lisp/dump-paths.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/dump-paths.el Mon Aug 13 11:20:41 2007 +0200 @@ -39,12 +39,7 @@ (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n" roots))) - (let* ((package-locations - (packages-compute-package-locations - ;; temporary kludge: - ;; this should be synched with startup.el - (paths-construct-path '("~" ".xemacs")))) - (stuff (packages-find-packages roots package-locations))) + (let ((stuff (packages-find-packages roots))) (setq late-packages (car (cdr stuff)))) (setq late-package-load-path (packages-find-package-load-path late-packages)) diff -r 12e008d41344 -r 697ef44129c6 lisp/dumped-lisp.el --- a/lisp/dumped-lisp.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/dumped-lisp.el Mon Aug 13 11:20:41 2007 +0200 @@ -32,7 +32,7 @@ "events" "text-props" "process" ;; This is bad. network-streams may not be defined. - (when-feature multicast "multicast") ; #+network-streams implicitly true + (when-feature multicast "multicast") ; #+network-streams implicitely true "frame" ; move up here cause some stuff needs it here "map-ynp" "simple" @@ -49,7 +49,6 @@ ;; 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,13 +79,12 @@ "text-mode" "fill" "auto-save" ; Added for 20.4 - "movemail" ; Added for 21.2 + (when-feature windows-nt "winnt") (when-feature lisp-float-type "float-sup") "itimer" ; for vars auto-save-timeout and ; auto-gc-threshold "itimer-autosave" - "printer" (when-feature toolbar "toolbar") (when-feature scrollbar "scrollbar") (when-feature menubar "menubar") @@ -96,6 +94,7 @@ (when-feature mule "mule-coding") ;; Handle I/O of files with extended characters. (when-feature file-coding "code-files") + (when-feature mule "mule-files") ;; Handle process with encoding/decoding non-ascii coding-system. (when-feature file-coding "code-process") (when-feature mule "mule-help") @@ -135,8 +134,7 @@ (when-feature mule "japanese") (when-feature mule "korean") (when-feature mule "misc-lang") - (when-feature mule "thai-xtis-chars") - (when-feature mule "mule/thai-xtis") ; overloaded in leim/quail + (when-feature mule "thai-xtis") (when-feature mule "viet-chars") (when-feature mule "vietnamese") @@ -158,17 +156,15 @@ ;; Moved to sunpro-load.el - the default only for Sun. ;;(pureload "mime-setup") ;;; mule-load.el ends here - (when-feature (and gutter window-system) "gutter") (when-feature window-system "gui") (when-feature window-system "mode-motion") (when-feature window-system "mouse") - "select" + (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") (when-feature (and infodock (or x mswindows) menubar) "id-menus") - (when-feature (and gutter window-system) "gutter-items") (when-feature x "x-faces") (when-feature x "x-iso8859-1") (when-feature x "x-mouse") diff -r 12e008d41344 -r 697ef44129c6 lisp/easymenu.el --- a/lisp/easymenu.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/easymenu.el Mon Aug 13 11:20:41 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 maintor for compatability with FSF 20.4. ;;; Please: Coordinate changes with Inge Frick ;; Commentary: diff -r 12e008d41344 -r 697ef44129c6 lisp/etags.el --- a/lisp/etags.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/etags.el Mon Aug 13 11:20:41 2007 +0200 @@ -52,7 +52,7 @@ ;; Kyle Jones ;; added "Exact match, then inexact" code ;; added support for include directive. -;; Hrvoje Niksic +;; Hrvoje Niksic ;; various changes. @@ -190,12 +190,9 @@ (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)))) - (key (if (eq system-type 'windows-nt) - (replace-in-string key "\\\\" "/") - key)) - expression) + (let ((key (or buffer-file-name + (concat default-directory (buffer-name)))) + 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 @@ -505,7 +502,6 @@ ((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) @@ -602,8 +598,11 @@ (format "%s(default %s) " prompt default) prompt) tag-completion-table 'tag-completion-predicate nil nil - 'find-tag-history default)) - tag-name)) + 'find-tag-history)) + (if (string-equal tag-name "") + ;; #### - This is a really LAME way of doing it! --Stig + default ;indicate exact symbol match + tag-name))) (defvar last-tag-data nil "Information for continuing a tag search. @@ -642,7 +641,7 @@ (t (setq tag-table-currently-matching-exact t))) ;; \_ in the tagname is used to indicate a symbol boundary. - (setq exact-tagname (format "\C-?\\_%s\\_\C-a\\|\\_%s\\_" tagname tagname)) + (setq exact-tagname (concat "\\_" tagname "\\_")) (while (string-match "\\\\_" exact-tagname) (aset exact-tagname (1- (match-end 0)) ?b)) (save-excursion @@ -675,9 +674,7 @@ ;; tag searches? (while (re-search-forward tag-target nil t) (and (save-match-data - (save-excursion - (goto-char (match-beginning 0)) - (looking-at "[^\n\C-?]*\C-?"))) + (looking-at "[^\n\C-?]*\C-?")) ;; If we're looking for inexact matches, skip ;; exact matches since we've visited them ;; already. @@ -696,7 +693,6 @@ (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 @@ -739,16 +735,6 @@ (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 @@ -785,7 +771,7 @@ '(find-tag find-tag-other-window tags-loop-continue)))) (push-tag-mark)) (if other-window - (pop-to-buffer tag-buf t) + (pop-to-buffer tag-buf) (switch-to-buffer tag-buf)) (widen) (push-mark) @@ -801,7 +787,7 @@ ;;;###autoload (defun find-tag-other-window (tagname &optional next) - "*Find tag whose name contains TAGNAME, in another window. + "*Find tag whose name contains TAGNAME. 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 12e008d41344 -r 697ef44129c6 lisp/faces.el --- a/lisp/faces.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/faces.el Mon Aug 13 11:20:41 2007 +0200 @@ -31,7 +31,7 @@ ;; This file is dumped with XEmacs. ;; face implementation #1 (used Lisp vectors and parallel C vectors; -;; FSFmacs still uses this) authored by Jamie Zawinski +;; FSFmacs still uses this) authored by Jamie Zawinski ;; pre Lucid-Emacs 19.0. ;; face implementation #2 (used one face object per frame per face) @@ -292,41 +292,41 @@ The following symbols have predefined meanings: foreground The foreground color of the face. - For valid instantiators, see `make-color-specifier'. + For valid instantiators, see `color-specifier-p'. background The background color of the face. - For valid instantiators, see `make-color-specifier'. + For valid instantiators, see `color-specifier-p'. font The font used to display text covered by this face. - For valid instantiators, see `make-font-specifier'. + For valid instantiators, see `font-specifier-p'. 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 `make-image-specifier'. + For valid instantiators, see `image-specifier-p'. underline Underline all text covered by this face. - For valid instantiators, see `make-face-boolean-specifier'. + For valid instantiators, see `face-boolean-specifier-p'. strikethru Draw a line through all text covered by this face. - For valid instantiators, see `make-face-boolean-specifier'. + For valid instantiators, see `face-boolean-specifier-p'. highlight Highlight all text covered by this face. Only used by faces on TTY devices. - For valid instantiators, see `make-face-boolean-specifier'. + For valid instantiators, see `face-boolean-specifier-p'. dim Dim all text covered by this face. - For valid instantiators, see `make-face-boolean-specifier'. + For valid instantiators, see `face-boolean-specifier-p'. blinking Blink all text covered by this face. Only used by faces on TTY devices. - For valid instantiators, see `make-face-boolean-specifier'. + For valid instantiators, see `face-boolean-specifier-p'. reverse Reverse the foreground and background colors. Only used by faces on TTY devices. - For valid instantiators, see `make-face-boolean-specifier'. + For valid instantiators, see `face-boolean-specifier-p'. doc-string Description of what the face's normal use is. NOTE: This is not a specifier, unlike all @@ -433,7 +433,7 @@ FACE may be either a face object or a symbol representing a face. -FONT should be an instantiator (see `make-font-specifier'), a list of +FONT should be an instantiator (see `font-specifier-p'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or a font specifier object. @@ -490,7 +490,7 @@ FACE may be either a face object or a symbol representing a face. -COLOR should be an instantiator (see `make-color-specifier'), a list of +COLOR should be an instantiator (see `color-specifier-p'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or a color specifier object. @@ -547,7 +547,7 @@ FACE may be either a face object or a symbol representing a face. -COLOR should be an instantiator (see `make-color-specifier'), a list of +COLOR should be an instantiator (see `color-specifier-p'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or a color specifier object. @@ -595,7 +595,7 @@ FACE may be either a face object or a symbol representing a face. -PIXMAP should be an instantiator (see `make-image-specifier'), a list +PIXMAP should be an instantiator (see `image-specifier-p'), a list of instantiators, an alist of specifications (each mapping a locale to an instantiator list), or an image specifier object. @@ -652,7 +652,7 @@ how-to-add) "Change the underline property of FACE to UNDERLINE-P. UNDERLINE-P is normally a face-boolean instantiator; see - `make-face-boolean-specifier'. + `face-boolean-specifier-p'. 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 +667,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 - `make-face-boolean-specifier'. + `face-boolean-specifier-p'. 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 +682,7 @@ how-to-add) "Change whether FACE is highlighted in LOCALE (TTY locales only). HIGHLIGHT-P is normally a face-boolean instantiator; see - `make-face-boolean-specifier'. + `face-boolean-specifier-p'. 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 +696,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 - `make-face-boolean-specifier'. + `face-boolean-specifier-p'. 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 +711,7 @@ how-to-add) "Change whether FACE is blinking in LOCALE (TTY locales only). BLINKING-P is normally a face-boolean instantiator; see - `make-face-boolean-specifier'. + `face-boolean-specifier-p'. 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 +725,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 - `make-face-boolean-specifier'. + `face-boolean-specifier-p'. 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 +794,7 @@ ;; 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 &optional locale) "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 @@ -814,14 +814,13 @@ the specification; otherwise, the process just outlined is iterated over each existing device and the concatenated results substituted for the specification." - (let ((sp (face-property face property)) - temp-sp) + (let ((sp (face-property face property))) (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))))) (when name - (add-spec-to-specifier sp name locale tags))) + (add-spec-to-specifier sp name locale))) ;; otherwise, map over all specifications ... ;; but first, some further kludging: ;; (1) if we're frobbing the global property, make sure @@ -833,40 +832,33 @@ ;; (2) if we're frobbing a particular locale, nothing would ;; happen if that locale has no instantiators. So signal ;; an error to indicate this. - - - (setq temp-sp (copy-specifier sp)) (if (and (or (eq locale 'global) (eq locale 'all) (not locale)) (not (face-property face property 'global))) (copy-specifier (face-property 'default property) - temp-sp 'global)) + (face-property face property) + 'global)) (if (and (valid-specifier-locale-p locale) - (not (specifier-specs temp-sp locale))) + (not (face-property face property locale))) (error "Property must have a specification in locale %S" locale)) (map-specifier - temp-sp - (lambda (sp-arg locale inst-list func) + sp + (lambda (sp locale inst-list func) (let* ((device (dfw-device locale)) ;; if a device can be derived from the locale, ;; call frob-face-property-1 for that device. ;; Otherwise map frob-face-property-1 over each device. (result (if device - (list (frob-face-property-1 sp-arg device inst-list func)) + (list (frob-face-property-1 sp device inst-list func)) (mapcar (lambda (device) - (frob-face-property-1 sp-arg device + (frob-face-property-1 sp device inst-list func)) (device-list)))) new-result) ;; remove duplicates and nils from the obtained list of - ;; instantiators. Also add tags amd remove 'defaults'. + ;; instantiators. (mapcar (lambda (arg) - (when arg - (if (not (consp arg)) - (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. @@ -894,7 +886,7 @@ (setq inst-list (cdr inst-list))) (or result first-valid))) -(defun frob-face-font-2 (face locale tags unfrobbed-face frobbed-face +(defun frob-face-font-2 (face locale unfrobbed-face frobbed-face tty-thunk x-thunk standard-face-mapping) ;; another kludge to make things more intuitive. If we're ;; inheriting from a standard face in this locale, frob the @@ -942,9 +934,9 @@ (not (equal (face-property-instance face 'font domain) (face-property-instance unfrobbed-face 'font domain))) (set-face-property face 'font (vector frobbed-face) - the-locale tags)))))) + the-locale)))))) -(defun make-face-bold (face &optional locale tags) +(defun make-face-bold (face &optional locale) "Make FACE bold in LOCALE, if possible. This will attempt to make the font bold for X locales and will set the highlight flag for TTY locales. @@ -973,24 +965,24 @@ circumstances." (interactive (list (read-face-name "Make which face bold: "))) (frob-face-font-2 - face locale tags 'default 'bold + face locale 'default 'bold (lambda () ;; handle TTY specific entries (when (featurep 'tty) - (set-face-highlight-p face t locale (cons 'tty tags)))) + (set-face-highlight-p face t locale 'tty))) (lambda () ;; handle X 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 locale)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold locale tags)) + (frob-face-property face 'font 'mswindows-make-font-bold locale)) ) '(([default] . [bold]) ([bold] . t) ([italic] . [bold-italic]) ([bold-italic] . t)))) -(defun make-face-italic (face &optional locale tags) +(defun make-face-italic (face &optional locale) "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. @@ -998,24 +990,24 @@ 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 + face locale 'default 'italic (lambda () ;; handle TTY specific entries (when (featurep 'tty) - (set-face-underline-p face t locale (cons 'tty tags)))) + (set-face-underline-p face t locale 'tty))) (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 locale)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-italic locale tags)) + (frob-face-property face 'font 'mswindows-make-font-italic locale)) ) '(([default] . [italic]) ([bold] . [bold-italic]) ([italic] . t) ([bold-italic] . t)))) -(defun make-face-bold-italic (face &optional locale tags) +(defun make-face-bold-italic (face &optional locale) "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. @@ -1023,25 +1015,25 @@ 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 + face locale 'default 'bold-italic (lambda () ;; handle TTY specific entries (when (featurep 'tty) - (set-face-highlight-p face t locale (cons 'tty tags)) - (set-face-underline-p face t locale (cons 'tty tags)))) + (set-face-highlight-p face t locale 'tty) + (set-face-underline-p face t locale 'tty))) (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 locale)) (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 locale)) ) '(([default] . [italic]) ([bold] . [bold-italic]) ([italic] . [bold-italic]) ([bold-italic] . t)))) -(defun make-face-unbold (face &optional locale tags) +(defun make-face-unbold (face &optional locale) "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. @@ -1049,24 +1041,24 @@ 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 + face locale 'bold 'default (lambda () ;; handle TTY specific entries (when (featurep 'tty) - (set-face-highlight-p face nil locale (cons 'tty tags)))) + (set-face-highlight-p face nil locale 'tty))) (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 locale)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unbold locale tags)) + (frob-face-property face 'font 'mswindows-make-font-unbold locale)) ) '(([default] . t) ([bold] . [default]) ([italic] . t) ([bold-italic] . [italic])))) -(defun make-face-unitalic (face &optional locale tags) +(defun make-face-unitalic (face &optional locale) "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. @@ -1074,17 +1066,17 @@ 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 + face locale 'italic 'default (lambda () ;; handle TTY specific entries (when (featurep 'tty) - (set-face-underline-p face nil locale (cons 'tty tags)))) + (set-face-underline-p face nil locale 'tty))) (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 locale)) (when (featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unitalic locale tags)) + (frob-face-property face 'font 'mswindows-make-font-unitalic locale)) ) '(([default] . t) ([bold] . t) @@ -1205,32 +1197,27 @@ ;; Old name, used by custom. Also, FSFmacs name. (defvaralias 'initialize-face-resources 'init-face-from-resources) -;; Make sure all custom setting are added with this tag so we can -;; identify-them -(define-specifier-tag 'custom) - -(defun face-spec-set (face spec &optional frame tags) +(defun face-spec-set (face spec &optional frame) "Set FACE's face attributes according to the first matching entry in SPEC. If optional FRAME is non-nil, set it for that frame only. If it is nil, then apply SPEC to each frame individually. See `defface' for information about SPEC." (if frame (progn - (reset-face face frame tags) - (face-display-set face spec frame tags) + (reset-face face frame) + (face-display-set face spec frame) (init-face-from-resources face frame)) (let ((frames (relevant-custom-frames))) - (reset-face face nil tags) - ;; This should not be needed. We only remove our own specifiers - ;; (if (and (eq 'default face) (featurep 'x)) - ;; (x-init-global-faces)) - (face-display-set face spec nil tags) + (reset-face face) + (if (and (eq 'default face) (featurep 'x)) + (x-init-global-faces)) + (face-display-set face spec) (while frames - (face-display-set face spec (car frames) tags) + (face-display-set face spec (car frames)) (pop frames)) (init-face-from-resources face)))) -(defun face-display-set (face spec &optional frame tags) +(defun face-display-set (face spec &optional frame) "Set FACE to the attributes to the first matching entry in SPEC. Iff optional FRAME is non-nil, set it for that frame only. See `defface' for information about SPEC." @@ -1241,7 +1228,7 @@ (when (face-spec-set-match-display display frame) ;; Avoid creating frame local duplicates of the global face. (unless (and frame (eq display (get face 'custom-face-display))) - (apply 'face-custom-attributes-set face frame tags atts)) + (apply 'face-custom-attributes-set face frame atts)) (unless frame (put face 'custom-face-display display)) (setq spec nil))))) @@ -1360,24 +1347,6 @@ (get-custom-frame-properties frame)) (initialize-custom-faces frame))) -(defun startup-initialize-custom-faces () - "Reset faces created by defface. Only called at startup. -Don't use this function in your program." - (when default-custom-frame-properties - ;; Reset default value to the actual frame, not stream. - (setq default-custom-frame-properties - (extract-custom-frame-properties (selected-frame))) - ;; like initialize-custom-faces but removes property first. - (mapc (lambda (symbol) - (let ((spec (or (get symbol 'saved-face) - (get symbol 'face-defface-spec)))) - (when spec - ;; Reset faces created during auto-autoloads loading. - (reset-face symbol) - ;; And set it according to the spec. - (face-display-set symbol spec nil)))) - (face-list)))) - (defun make-empty-face (name &optional doc-string temporary) "Like `make-face', but doesn't query the resource database." @@ -1428,8 +1397,7 @@ (mswindows-init-device-faces device)) ;; Nothing to do for TTYs? ) - (or (eq 'stream (device-type device)) - (init-other-random-faces device)))) + (init-other-random-faces device))) (defun init-frame-faces (frame) (when init-face-from-resources @@ -1539,7 +1507,7 @@ ;; It's unreasonable to expect to be able to make a font italic all ;; the time. For many languages, italic is an alien concept. ;; Basically, because italic is not a globally meaningful concept, - ;; the use of the italic face should really be obsoleted. + ;; the use of the italic face should really be oboleted. ;; I disagree with above. In many languages, the concept of capital ;; letters is just as alien, and yet we use them. Italic is here to @@ -1589,17 +1557,14 @@ nil 'append)) ) -;; New function with 20.1, suggested by Per Abrahamsen, coded by Kyle -;; Jones and Hrvoje Niksic. +;; New function with 20.1, suggested by Per Abrahamsen, coded by Kyle Jones. (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 variables `x-bitmap-file-path' and -`mswindows-bitmap-file-path' under X and MS Windows respectively -are searched. +The directories listed in the `x-bitmap-file-path' variable 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 @@ -1610,33 +1575,20 @@ in that frame; otherwise change each frame." (while (not (find-face face)) (setq face (signal 'wrong-type-argument (list 'facep face)))) - (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))) + (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)) ;; Create the remaining standard faces now. This way, packages that we dump @@ -1653,7 +1605,6 @@ (set-face-underline-p 'underline t 'global '(default))) (make-face 'zmacs-region "Used on highlightes region between point and mark.") (make-face 'isearch "Used on region matched by isearch.") -(make-face 'isearch-secondary "Face to use for highlighting all matches.") (make-face 'list-mode-item-selected "Face for the selected list item in list-mode.") (make-face 'highlight "Highlight face.") @@ -1743,13 +1694,6 @@ ((mswindows default color) . "green")) 'global) -;; #### This should really, I mean *really*, be converted to some form -;; of `defface' one day. -(set-face-foreground 'isearch-secondary - '(((x default color) . "red3") - ((mswindows default color) . "red3")) - 'global) - ;; Define some logical color names to be used when reading the pixmap files. (if (featurep 'xpm) (setq xpm-color-symbols @@ -1761,8 +1705,7 @@ (and (featurep 'x) (x-get-resource "backgroundToolBarColor" - "BackgroundToolBarColor" 'string - nil nil 'warn)) + "BackgroundToolBarColor" 'string)) (face-background 'toolbar)))) (purecopy '("foregroundToolBarColor" @@ -1770,8 +1713,7 @@ (and (featurep 'x) (x-get-resource "foregroundToolBarColor" - "ForegroundToolBarColor" 'string - nil nil 'warn)) + "ForegroundToolBarColor" 'string)) (face-foreground 'toolbar)))) ))) diff -r 12e008d41344 -r 697ef44129c6 lisp/files.el --- a/lisp/files.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/files.el Mon Aug 13 11:20:41 2007 +0200 @@ -794,36 +794,29 @@ (setq tail (cdr tail)))) (when hack-homedir ;; Compute and save the abbreviated homedir name. - ;; We defer computing this until the first time it's needed, - ;; to give time for directory-abbrev-alist to be set properly. - ;; We include the separator at the end, to avoid spurious - ;; matches such as `/usr/foobar' when the home dir is - ;; `/usr/foo'. + ;; We defer computing this until the first time it's needed, to + ;; give time for directory-abbrev-alist to be set properly. + ;; We include a slash at the end, to avoid spurious matches + ;; such as `/usr/foobar' when the home dir is `/usr/foo'. (or abbreviated-home-dir (setq abbreviated-home-dir (let ((abbreviated-home-dir "$foo")) - (concat "\\`" - (regexp-quote - (abbreviate-file-name (expand-file-name "~"))) - "\\(" - (regexp-quote (string directory-sep-char)) - "\\|\\'\\)")))) + (concat "\\`" (regexp-quote (abbreviate-file-name + (expand-file-name "~"))) + "\\(/\\|\\'\\)")))) ;; If FILENAME starts with the abbreviated homedir, ;; make it start with `~' instead. (if (and (string-match abbreviated-home-dir filename) ;; If the home dir is just /, don't change it. - (not (and (= (match-end 0) 1) - (= (aref filename 0) directory-sep-char))) - (not (and (eq system-type 'windows-nt) + (not (and (= (match-end 0) 1) ;#### unix-specific + (= (aref filename 0) ?/))) + (not (and (memq system-type '(ms-dos windows-nt)) (save-match-data - (string-match (concat "\\`[a-zA-Z]:" - (regexp-quote - (string directory-sep-char)) - "\\'") - filename))))) + (string-match "^[a-zA-Z]:/$" filename))))) (setq filename (concat "~" - (match-string 1 filename) + (substring filename + (match-beginning 1) (match-end 1)) (substring filename (match-end 0)))))) filename))) @@ -1028,8 +1021,7 @@ (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. @@ -1165,7 +1157,6 @@ ("\\.m\\(?:[mes]\\|an\\)\\'" . nroff-mode) ("\\.icn\\'" . icon-mode) ("\\.\\(?:[ckz]?sh\\|shar\\)\\'" . sh-mode) - ("\\.pro\\'" . idlwave-mode) ;; #### Unix-specific! ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode) ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode) @@ -1194,9 +1185,7 @@ ("\\.lex\\'" . c-mode) ("\\.m\\'" . objc-mode) ("\\.oak\\'" . scheme-mode) - ("\\.[sj]?html?\\'" . html-mode) - ("\\.jsp\\'" . html-mode) - ("\\.xml\\'" . xml-mode) + ("\\.s?html?\\'" . html-mode) ("\\.htm?l?3\\'" . html3-mode) ("\\.\\(?:sgml?\\|dtd\\)\\'" . sgml-mode) ("\\.c?ps\\'" . postscript-mode) @@ -1206,7 +1195,7 @@ ("\\.m4\\'" . autoconf-mode) ("configure\\.in\\'" . autoconf-mode) ("\\.ml\\'" . lisp-mode) - ("\\.ma?ke?\\'" . makefile-mode) + ("\\.ma?k\\'" . makefile-mode) ("[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode) ("\\.X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode) ;; #### The following three are Unix-specific (but do we care?) @@ -1232,9 +1221,7 @@ ("python" . python-mode) ("awk\\b" . awk-mode) ("rexx" . rexx-mode) - ("scm\\|guile" . scheme-mode) - ("emacs" . emacs-lisp-mode) - ("make" . makefile-mode) + ("scm" . scheme-mode) ("^:" . sh-mode)) "Alist mapping interpreter names to major modes. This alist is used to guess the major mode of a file based on the @@ -1283,7 +1270,7 @@ from the end of the file name anything that matches one of these regexps.") (defvar user-init-file - nil ; set by command-line + "" ; set by command-line "File name including directory of user's initialization file.") (defun set-auto-mode (&optional just-from-file-name) @@ -1322,15 +1309,9 @@ (setq keep-going nil) (let ((alist auto-mode-alist) (mode nil)) - ;; Find first matching alist entry. - - ;; #### This is incorrect. In NT, case sensitivity is a volume - ;; property. For instance, NFS mounts *are* case sensitive. - ;; Need internal function (file-name-case-sensitive f), F - ;; being file or directory name. - kkm (let ((case-fold-search - (eq system-type 'windows-nt))) + (memq system-type '(windows-nt)))) (while (and (not mode) alist) (if (string-match (car (car alist)) name) (if (and (consp (cdr (car alist))) @@ -1542,7 +1523,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 @@ -1834,7 +1815,7 @@ (buffer-local-variables))) nil nil (buffer-name))) t - (if (and current-prefix-arg (featurep 'file-coding)) + (if (and current-prefix-arg (featurep 'mule)) (read-coding-system "Coding system: ")))) (and (eq (current-buffer) mouse-grabbed-buffer) (error "Can't write minibuffer window")) @@ -1888,7 +1869,7 @@ (let ((delete-old-versions ;; If have old versions to maybe delete, ;; ask the user to confirm now, before doing anything. - ;; But don't actually delete till later. + ;; But don't actually delete til later. (and targets (or (eq delete-old-versions t) (eq delete-old-versions nil)) @@ -2006,13 +1987,21 @@ (defun make-backup-file-name (file) "Create the non-numeric backup file name for FILE. This is a separate function so you can redefine it for customization." - (concat file "~")) + (if (eq system-type 'ms-dos) + (let ((fn (file-name-nondirectory file))) + (concat (file-name-directory file) + (if (string-match "\\([^.]*\\)\\(\\..*\\)?" fn) + (substring fn 0 (match-end 1))) + ".bak")) + (concat file "~"))) (defun backup-file-name-p (file) "Return non-nil if FILE is a backup file name (numeric or not). This is a separate function so you can redefine it for customization. You may need to redefine `file-name-sans-versions' as well." - (string-match "~\\'" file)) + (if (eq system-type 'ms-dos) + (string-match "\\.bak\\'" file) + (string-match "~\\'" file))) ;; This is used in various files. ;; The usage of bv-length is not very clean, @@ -2083,15 +2072,16 @@ "Convert FILENAME to be relative to DIRECTORY (default: default-directory). This function returns a relative file name which is equivalent to FILENAME when used with that default directory as the default. -If this is impossible (which can happen on MS Windows when the file name -and directory use different drive names) then it returns FILENAME." +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." (save-match-data (let ((fname (expand-file-name filename))) (setq directory (file-name-as-directory (expand-file-name (or directory default-directory)))) ;; On Microsoft OSes, if FILENAME and DIRECTORY have different ;; drive names, they can't be relative, so return the absolute name. - (if (and (eq system-type 'windows-nt) + (if (and (memq system-type '(ms-dos windows-nt)) (not (string-equal (substring fname 0 2) (substring directory 0 2)))) filename @@ -2221,21 +2211,19 @@ (error "Save not confirmed")) (save-restriction (widen) - - ;; Add final newline if required. See `require-final-newline'. - (when (and (not (eq (char-before (point-max)) ?\n)) ; common case - (char-before (point-max)) ; empty buffer? - (not (and (eq selective-display t) - (eq (char-before (point-max)) ?\r))) - (or (eq require-final-newline t) - (and require-final-newline - (y-or-n-p - (format "Buffer %s does not end in newline. Add one? " - (buffer-name)))))) - (save-excursion - (goto-char (point-max)) - (insert ?\n))) - + (and (> (point-max) 1) + (/= (char-after (1- (point-max))) ?\n) + (not (and (eq selective-display t) + (= (char-after (1- (point-max))) ?\r))) + (or (eq require-final-newline t) + (and require-final-newline + (y-or-n-p + (format "Buffer %s does not end in newline. Add one? " + (buffer-name))))) + (save-excursion + (goto-char (point-max)) + (insert ?\n))) + ;; ;; Run the write-file-hooks until one returns non-null. ;; Bind after-save-hook to nil while running the ;; write-file-hooks so that if this function is called @@ -2461,7 +2449,7 @@ (recursive-edit) ;; Return nil to ask about BUF again. nil) - "%_Display Buffer")))) + "display the current buffer")))) (abbrevs-done (and save-abbrevs abbrevs-changed (progn @@ -2692,7 +2680,7 @@ file-name))) (run-hooks 'before-revert-hook) ;; If file was backed up but has changed since, - ;; we should make another backup. + ;; we shd make another backup. (and (not auto-save-p) (not (verify-visited-file-modtime (current-buffer))) (setq buffer-backed-up nil)) @@ -2763,12 +2751,11 @@ (not (file-exists-p file-name))) (error "Auto-save file %s not current" file-name)) ((save-window-excursion - (if (not (eq system-type 'windows-nt)) - (with-output-to-temp-buffer "*Directory*" - (buffer-disable-undo standard-output) - (call-process "ls" nil standard-output nil - (if (file-symlink-p file) "-lL" "-l") - file file-name))) + (with-output-to-temp-buffer "*Directory*" + (buffer-disable-undo standard-output) + (call-process "ls" nil standard-output nil + (if (file-symlink-p file) "-lL" "-l") + file file-name)) (yes-or-no-p (format "Recover auto save file %s? " file-name))) (switch-to-buffer (find-file-noselect file t)) (let ((buffer-read-only nil)) @@ -3143,8 +3130,6 @@ (funcall handler 'insert-directory file switches wildcard full-directory-p) (cond - ;; #### mswindows-insert-directory should be called - ;; nt-insert-directory - kkm. ((and (fboundp 'mswindows-insert-directory) (eq system-type 'windows-nt)) (mswindows-insert-directory file switches wildcard full-directory-p)) diff -r 12e008d41344 -r 697ef44129c6 lisp/fill.el --- a/lisp/fill.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/fill.el Mon Aug 13 11:20:41 2007 +0200 @@ -33,7 +33,7 @@ ;; 97/3/14 Jareth Hein (jhod@po.iijnet.or.jp) added functions for kinsoku (asian text ;; line break processing) -;; 97/06/11 Steve Baur (steve@xemacs.org) converted broken +;; 97/06/11 Steve Baur (steve@altair.xemacs.org) converted broken ;; following-char/preceding-char calls to char-after/char-before. ;;; Code: @@ -226,10 +226,9 @@ ;; XEmacs change (if (not dont-skip-first) (forward-line 1)) - (cond ((>= (point) to) - (goto-char firstline)) - ((/= (point) from) - (setq at-second t))) + (if (>= (point) to) + (goto-char firstline) + (setq at-second t)) (move-to-left-margin) ;; XEmacs change (let ((start (point)) @@ -237,7 +236,7 @@ ;(eol (save-excursion (end-of-line) (point))) ) (setq result - (if (or dont-skip-first (not (looking-at paragraph-start))) + (if (not (looking-at paragraph-start)) (cond ((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) (buffer-substring-no-properties start (match-end 0))) (adaptive-fill-function (funcall adaptive-fill-function))))) @@ -383,7 +382,7 @@ (skip-chars-forward " \t") ;; Then change all newlines to spaces. ;;; 97/3/14 jhod: Kinsoku change - ;; Spacing is not necessary for characters of no word-separator. + ;; Spacing is not necessary for charcters of no word-separater. ;; The regexp word-across-newline is used for this check. (defvar word-across-newline) (if (not (and (featurep 'mule) @@ -430,8 +429,7 @@ ;; This is the actual filling loop. (let ((prefixcol 0) linebeg (re-break-point (if (featurep 'mule) - (concat "[ \n\t]\\|" word-across-newline - ".\\|." word-across-newline) + (concat "[ \n\t]\\|" word-across-newline) "[ \n\t]"))) (while (not (eobp)) (setq linebeg (point)) diff -r 12e008d41344 -r 697ef44129c6 lisp/find-paths.el --- a/lisp/find-paths.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/find-paths.el Mon Aug 13 11:20:41 2007 +0200 @@ -109,10 +109,6 @@ (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))) @@ -163,8 +159,7 @@ base)))) (defun paths-find-emacs-directory (roots suffix base - &optional envvar default keep-suffix - in-place-external) + &optional envvar default keep-suffix) "Find a directory in the XEmacs hierarchy. ROOTS must be a list of installation roots. SUFFIX is the subdirectory from there. @@ -173,9 +168,7 @@ specify the directory. DEFAULT is the preferred value. If KEEP-SUFFIX is non-nil, the suffix must be respected in searching -the directory. -If IN-PLACE-EXTERNAL is non-nil, the directory might be found outside -an in-place root-hierarchy." +the directory." (let ((preferred-value (or (and envvar (getenv envvar)) default))) (if (and preferred-value @@ -183,39 +176,28 @@ (file-name-as-directory preferred-value) (catch 'gotcha (while roots - (let ((root (car roots))) - ;; installed - (let ((path (paths-construct-emacs-directory root suffix base))) - (if (paths-file-readable-directory-p path) - (throw 'gotcha path))) - ;; in-place - (if (null keep-suffix) - (let ((path (paths-construct-emacs-directory root "" base))) - (if (paths-file-readable-directory-p path) - (throw 'gotcha path)))) - (if (and in-place-external - (paths-root-in-place-p root)) - (let ((path (paths-construct-emacs-directory - (paths-construct-path '("..") root) - "" base))) - (if (paths-file-readable-directory-p path) - (throw 'gotcha path))))) + (let* ((root (car roots)) + ;; installed + (path (paths-construct-emacs-directory root suffix base))) + (if (paths-file-readable-directory-p path) + (throw 'gotcha path) + ;; in-place + (if (null keep-suffix) + (let ((path (paths-construct-emacs-directory root "" base))) + (if (paths-file-readable-directory-p path) + (throw 'gotcha path)))))) (setq roots (cdr roots))) nil)))) -(defun paths-find-site-directory (roots base &optional envvar default in-place-external) - "Find a site-specific directory in the XEmacs hierarchy. -If IN-PLACE-EXTERNAL is non-nil, the directory might be found outside -an in-place root-hierarchy." +(defun paths-find-site-directory (roots base &optional envvar default) + "Find a site-specific directory in the XEmacs hierarchy." (paths-find-emacs-directory roots (file-name-as-directory (paths-construct-path (list "lib" emacs-program-name))) base - envvar default - nil - in-place-external)) + envvar default)) (defun paths-find-version-directory (roots base &optional envvar default enforce-version) @@ -236,13 +218,13 @@ ;; from more to less specific (paths-find-version-directory roots (concat base system-configuration) - envvar default) + envvar) (paths-find-version-directory roots base envvar) (paths-find-version-directory roots system-configuration - envvar))) + envvar default))) (defun construct-emacs-version-name () "Construct the raw XEmacs version number." diff -r 12e008d41344 -r 697ef44129c6 lisp/finder.el --- a/lisp/finder.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/finder.el Mon Aug 13 11:20:41 2007 +0200 @@ -150,9 +150,7 @@ (let ((processed nil) (directory-abbrev-alist (append - (mapcar (function (lambda (dir) - (cons (concat "^" (regexp-quote dir)) - ""))) + (mapcar (function (lambda (dir) (cons dir ""))) finder-abbreviate-directory-list) directory-abbrev-alist)) (using-load-path)) @@ -169,7 +167,7 @@ (lambda (d) (mapcar (lambda (f) - (when (and (not (member f processed)) (file-readable-p f)) + (when (not (member f processed)) (let (summary keystart keywords) (setq processed (cons f processed)) (if (not finder-compile-keywords-quiet) @@ -287,12 +285,8 @@ found))) (defun finder-commentary (file) - "Display FILE's commentary section. -FILE should be in a form suitable for passing to `locate-library'." - (interactive "sLibrary name: ") - (let* ((str (lm-commentary (or (finder-find-library file) - (finder-find-library (concat file ".el")) - (error "Can't find library %s" file))))) + (interactive) + (let* ((str (lm-commentary (finder-find-library file)))) (if (null str) (error "Can't find any Commentary section")) (pop-to-buffer "*Finder*") diff -r 12e008d41344 -r 697ef44129c6 lisp/font-lock.el --- a/lisp/font-lock.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/font-lock.el Mon Aug 13 11:20:41 2007 +0200 @@ -4,7 +4,7 @@ ;; Copyright (C) 1995 Amdahl Corporation. ;; Copyright (C) 1996 Ben Wing. -;; Author: Jamie Zawinski , for the LISPM Preservation Society. +;; Author: Jamie Zawinski , for the LISPM Preservation Society. ;; Minimally merged with FSF 19.34 by Barry Warsaw ;; Then (partially) synched with FSF 19.30, leading to: ;; Next Author: RMS @@ -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, you will see status messages only if the changed region is -large enough.) +chunk of text or revert a buffer, 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,123 +318,95 @@ ;;;###autoload (defvar font-lock-keywords nil - "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 ...) + "A list of the keywords to highlight. +Each element should be of the 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'. + MATCHER + (MATCHER . MATCH) + (MATCHER . FACENAME) + (MATCHER . HIGHLIGHT) + (MATCHER HIGHLIGHT ...) + (eval . FORM) - (\"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. +where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. - (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.) +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. For highlighting single items, typically only MATCH-HIGHLIGHT is required. -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. +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. 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) @@ -580,55 +552,25 @@ ;; #### 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. 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 +;; forget to properly quote their faces. (defvar font-lock-comment-face 'font-lock-comment-face - "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.") + "Don't even think of using this.") (defvar font-lock-doc-string-face 'font-lock-doc-string-face - "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.") + "Don't even think of using this.") (defvar font-lock-string-face 'font-lock-string-face - "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.") + "Don't even think of using this.") (defvar font-lock-keyword-face 'font-lock-keyword-face - "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.") + "Don't even think of using this.") (defvar font-lock-function-name-face 'font-lock-function-name-face - "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.") + "Don't even think of using this.") (defvar font-lock-variable-name-face 'font-lock-variable-name-face - "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.") + "Don't even think of using this.") (defvar font-lock-type-face 'font-lock-type-face - "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.") + "Don't even think of using this.") (defvar font-lock-reference-face 'font-lock-reference-face - "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.") + "Don't even think of using this.") (defvar font-lock-preprocessor-face 'font-lock-preprocessor-face - "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.") + "Don't even think of using this.") (defconst font-lock-face-list '(font-lock-comment-face @@ -642,10 +584,11 @@ 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)) @@ -668,17 +611,11 @@ '((((class color) (background dark)) (:foreground "light coral")) (((class color) (background light)) (:foreground "green4")) (t (:bold t))) - "Font Lock mode face used to highlight documentation strings. -This is currently supported only in Lisp-like modes, which are those -with \"lisp\" or \"scheme\" in their name. You can explicitly make -a mode Lisp-like by putting a non-nil `font-lock-lisp-like' property -on the major mode's symbol." + "Font Lock mode face used to highlight documentation strings." :group 'font-lock-faces) (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)) @@ -688,11 +625,6 @@ (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." @@ -887,20 +819,28 @@ (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 - (lprogress-display 'font-lock - "Fontifying %s... buffer too big." 'abort - (buffer-name))))) + (lmessage 'command "Fontifying %s... buffer too big." + (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))) @@ -1023,46 +963,45 @@ (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) - ;; 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) + (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))) - (t - (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))) + (quit + (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) - (lprogress-display 'font-lock "Fontifying %s... aborted." - 'abort (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) + (lmessage 'command "Fontifying %s... aborted." (buffer-name)))) + (run-hooks 'font-lock-after-fontify-buffer-hook)) (defun font-lock-default-unfontify-buffer () (font-lock-unfontify-region (point-min) (point-max)) @@ -1100,7 +1039,7 @@ (defun font-lock-default-unfontify-region (beg end &optional maybe-loudly) (when (and maybe-loudly font-lock-verbose (>= (- end beg) font-lock-message-threshold)) - (lprogress-display 'font-lock "Fontifying %s..." 0 (buffer-name))) + (lmessage 'progress "Fontifying %s..." (buffer-name))) (let ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) buffer-file-name buffer-file-truename) @@ -1108,7 +1047,10 @@ (and (not modified) (buffer-modified-p) (set-buffer-modified-p nil)))) ;; Following is the original FSF version (similar to our original -;; version, before the deferred stuff was added). +;; version, before all the crap I added below). +;; +;; Probably that crap should either be fixed up so it works better, +;; or tossed away. ;; ;; I think that lazy-lock v2 tries to do something similar. ;; Those efforts should be merged. @@ -1122,99 +1064,111 @@ ; (progn (goto-char beg) (beginning-of-line) (point)) ; (progn (goto-char end) (forward-line 1) (point)))))) -(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.") +(defvar font-lock-old-extent nil) +(defvar font-lock-old-len 0) -(defvar font-lock-pending-extent-table (make-hash-table :weakness 'key)) -(defvar font-lock-range-table (make-range-table)) +(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))) (defun font-lock-pre-idle-hook () - (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)))) + (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.") ;;; called when any modification is made to buffer text. This function -;;; 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. +;;; attempts to glump adjacent changes together so that excessive +;;; fontification is avoided. This function could easily be adapted +;;; to other after-change-functions. (defun font-lock-after-change-function (beg end old-len) - (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)))) + (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))) -(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))) + ;; 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))))))) + ;; Syntactic fontification functions. @@ -1330,16 +1284,6 @@ ; ;; Clean up. ; (and prev (remove-text-properties prev end '(face nil))))) -(defun font-lock-lisp-like (mode) - ;; Note: (or (get mode 'font-lock-lisp-like) (string-match ...)) is - ;; not enough because the property needs to be able to specify a nil - ;; value. - (if (plist-member (symbol-plist mode) 'font-lock-lisp-like) - (get mode 'font-lock-lisp-like) - ;; If the property is not specified, guess. Similar logic exists - ;; in add-log, but I think this encompasses more modes. - (string-match "lisp\\|scheme" (symbol-name mode)))) - (defun font-lock-fontify-syntactically-region (start end &optional loudly) "Put proper face on each string and comment between START and END. START should be at the beginning of a line." @@ -1347,29 +1291,26 @@ nil (when (and font-lock-verbose (>= (- end start) font-lock-message-threshold)) - (lprogress-display 'font-lock "Fontifying %s... (syntactically)" 5 - (buffer-name))) + (lmessage 'progress "Fontifying %s... (syntactically...)" + (buffer-name))) (font-lock-unfontify-region start end loudly) (goto-char start) (if (> end (point-max)) (setq end (point-max))) - (let ((lisp-like (font-lock-lisp-like major-mode))) - (syntactically-sectionize - #'(lambda (s e context depth) - (let (face) - (cond ((eq context 'string) - (setq face - ;; #### It would be nice if we handled - ;; Python and other non-Lisp languages with - ;; docstrings correctly. - (if (and lisp-like (= depth 1)) - ;; really we should only use this if - ;; in position 3 depth 1, but that's - ;; too expensive to compute. - 'font-lock-doc-string-face - 'font-lock-string-face))) - ((or (eq context 'comment) - (eq context 'block-comment)) - (setq face 'font-lock-comment-face) + (syntactically-sectionize + #'(lambda (s e context depth) + (let (face) + (cond ((eq context 'string) + ;;#### Should only do this is Lisp-like modes! + (setq face + (if (= depth 1) + ;; really we should only use this if + ;; in position 3 depth 1, but that's + ;; too expensive to compute. + 'font-lock-doc-string-face + 'font-lock-string-face))) + ((or (eq context 'comment) + (eq context 'block-comment)) + (setq face 'font-lock-comment-face) ; ;; Don't fontify whitespace at the beginning of lines; ; ;; otherwise comment blocks may not line up with code. ; ;; (This is sometimes a good idea, sometimes not; in any @@ -1382,9 +1323,9 @@ ; (skip-chars-forward " \t\n") ; (setq s (point))) )) - (font-lock-set-face s e face))) - start end) - ))) + (font-lock-set-face s e face))) + start end) + )) ;;; Additional text property functions. @@ -1531,22 +1472,18 @@ 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)) - (progress 5) (old-progress 5) - (iter 0) - (nkeywords (length keywords)) - 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)) (count 0) + 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)) @@ -1555,14 +1492,6 @@ (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)) - (lprogress-display '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)) @@ -1576,9 +1505,8 @@ (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 (lprogress-display 'font-lock "Fontifying %s... " 100 (buffer-name))))) + (if loudly (lmessage 'progress "Fontifying %s... done." (buffer-name))))) ;; Various functions. @@ -1602,6 +1530,19 @@ ((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. @@ -2381,9 +2322,8 @@ '("\\<\\(false\\|null\\|true\\)\\>" (1 font-lock-keyword-face)) ;; Class names: - (list (concat "\\<\\(class\\|interface\\)\\>\\s *" - java-font-lock-identifier-regexp) - 2 'font-lock-function-name-face) + (list (concat "\\\\s *" java-font-lock-identifier-regexp) + 1 'font-lock-function-name-face) ;; Package declarations: (list (concat "\\<\\(package\\|import\\)\\>\\s *" @@ -2504,11 +2444,11 @@ (goto-char (match-end 1)) (goto-char (match-end 0)) (1 font-lock-variable-name-face)))))) - + ;; Modifier keywords and Java doc tags (setq java-font-lock-keywords-3 (append - + '( ;; Feature scoping: ;; These must come first or the Modifiers from keywords-1 will @@ -2518,11 +2458,11 @@ ("\\" 0 font-lock-preprocessor-face) ("\\" 0 font-lock-reference-face)) java-font-lock-keywords-2 - + (list - ;; Javadoc tags - '("@\\(author\\|deprecated\\|exception\\|throws\\|param\\|return\\|see\\|since\\|version\\|serial\\|serialData\\|serialField\\)\\s " + ;; Java doc tags + '("@\\(author\\|exception\\|param\\|return\\|see\\|version\\)\\s " 0 font-lock-keyword-face t) ;; Doc tag - Parameter identifiers @@ -2530,32 +2470,19 @@ 1 'font-lock-variable-name-face t) ;; Doc tag - Exception types - (list (concat "@\\(exception\\|throws\\)\\s +" + (list (concat "@exception\\ s*" java-font-lock-identifier-regexp) - '(2 (if (equal (char-after (match-end 0)) ?.) + '(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 - 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 +\\([^}]+\\)}" - 0 font-lock-keyword-face t) - ;; Doc tag - Links - '("{ *@link\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}" - 1 font-lock-function-name-face t) - + ))) ) diff -r 12e008d41344 -r 697ef44129c6 lisp/font-menu.el --- a/lisp/font-menu.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,452 +0,0 @@ -;; font-menu.el --- Managing menus of fonts. - -;; Copyright (C) 1994 Free Software Foundation, Inc. -;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. -;; Copyright (C) 1997 Sun Microsystems - -;; Adapted from x-font-menu.el by Andy Piper - -;; 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. - -;; This file contains the device-nospecific font menu stuff - -;;; Commentary: -;;; -;;; Creates three menus, "Font", "Size", and "Weight", and puts them on the -;;; "Options" menu. The contents of these menus are the superset of those -;;; properties available on any fonts, but only the intersection of the three -;;; sets is selectable at one time. -;;; -;;; Known Problems: -;;; =============== -;;; Items on the Font menu are selectable if and only if that font exists in -;;; the same size and weight as the current font. This means that some fonts -;;; are simply not reachable from some other fonts - if only one font comes -;;; in only one point size (like "Nil", which comes only in 2), you will never -;;; be able to select it. It would be better if the items on the Fonts menu -;;; were always selectable, and selecting them would set the size to be the -;;; closest size to the current font's size. -;;; -;;; This attempts to change all other faces in an analogous way to the change -;;; that was made to the default face; if it can't, it will skip over the face. -;;; However, this could leave incongruous font sizes around, which may cause -;;; some nonreversibility problems if further changes are made. Perhaps it -;;; should remember the initial fonts of all faces, and derive all subsequent -;;; fonts from that initial state. -;;; -;;; xfontsel(1) is a lot more flexible (but probably harder to understand). -;;; -;;; The code to construct menus from all of the x11 fonts available from the -;;; server is autoloaded and executed the very first time that one of the Font -;;; menus is selected on each device. That is, if XEmacs has frames on two -;;; different devices, then separate font menu information will be maintained -;;; for each X display. If the font path changes after emacs has already -;;; asked the X server on a particular display for its list of fonts, this -;;; won't notice. Also, the first time that a font menu is posted on each -;;; display will entail a lengthy delay, but that's better than slowing down -;;; XEmacs startup. At any time (i.e.: after a font-path change or -;;; immediately after device creation), you can call -;;; `reset-device-font-menus' to rebuild the menus from all currently -;;; available fonts. -;;; -;;; There is knowledge here about the regexp match numbers in -;;; `mswindows-font-regexp' and `mswindows-font-regexp-foundry-and-family' defined in -;;; mswindows-faces.el. -;;; -;;; There are at least three kinds of fonts under X11r5: -;;; -;;; - bitmap fonts, which can be assumed to look as good as possible; -;;; - bitmap fonts which have been (or can be) automatically scaled to -;;; a new size, and which almost always look awful; -;;; - and true outline fonts, which should look ok at any size, but in -;;; practice (on at least some systems) look awful at any size, and -;;; even in theory are unlikely ever to look as good as non-scaled -;;; bitmap fonts. -;;; -;;; It would be nice to get this code to look for non-scaled bitmap fonts -;;; first, then outline fonts, then scaled bitmap fonts as a last resort. -;;; But it's not clear to me how to tell them apart based on their truenames -;;; and/or the result of XListFonts(). I welcome any and all explanations -;;; of the subtleties involved... -;;; -;;; -;;; If You Think You'Re Seeing A Bug: -;;; ================================= -;;; When reporting problems, send the following information: -;;; -;;; - Exactly what behavior you're seeing; -;;; - The output of the `xlsfonts' program; -;;; - The value of the variable `device-fonts-cache'; -;;; - The values of the following expressions, both before and after -;;; making a selection from any of the fonts-related menus: -;;; (face-font 'default) -;;; (font-truename (face-font 'default)) -;;; (font-properties (face-font 'default)) -;;; - The values of the following variables after making a selection: -;;; font-menu-preferred-resolution -;;; font-menu-registry-encoding -;;; -;;; There is a common misconception that "*-courier-medium-r-*-11-*", also -;;; known as "-adobe-courier-medium-r-normal--11-80-100-100-m-60-iso8859-1", -;;; is an 11-point font. It is not -- it is an 11-pixel font at 100dpi, -;;; which is an 8-point font (the number after -11- is the size in tenths -;;; of points). So if you expect to be seeing an "11" entry in the "Size" -;;; menu and are not, this may be why. -;;; -;;; In the real world (aka Solaris), one has to deal with fonts that -;;; appear to be medium-i but are really light-r, and fonts that -;;; resolve to different resolutions depending on the charset: -;;; -;;; (font-instance-truename -;;; (make-font-instance "-*-mincho-medium-i-normal-*-*-*-*-*-*-*-jisx0201*-*")) -;;; ==> -;;; "-morisawa-ryumin light kl-light-r-normal--10-100-72-72-m-50-jisx0201.1976-0" -;;; -;;; (list-fonts "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*") -;;; ==> -;;; ("-dt-interface user-medium-r-normal-s sans-12-120-72-72-m-70-iso8859-1" -;;; "-dt-interface user-medium-r-normal-s-14-120-75-75-m-120-jisx0208.1983-0" -;;; "-dt-interface user-medium-r-normal-s-14-120-75-75-m-60-jisx0201.1976-0") - -;;;###autoload -(defcustom font-menu-ignore-scaled-fonts nil - "*If non-nil, then the font menu will try to show only bitmap fonts." - :type 'boolean - :group 'font-menu) - -;;;###autoload -(defcustom font-menu-this-frame-only-p nil - "*If non-nil, then changing the default font from the font menu will only -affect one frame instead of all frames." - :type 'boolean - :group 'font-menu) - -(defcustom font-menu-max-items 25 - "*Maximum number of items in the font menu -If number of entries in a menu is larger than this value, split menu -into submenus of nearly equal length. If nil, never split menu into -submenus." - :group 'font-menu - :type '(choice (const :tag "no submenus" nil) - (integer))) - -(defcustom font-menu-submenu-name-format "%-12.12s ... %.12s" - "*Format specification of the submenu name. -Used by `font-menu-split-long-menu' if the number of entries in a menu is -larger than `font-menu-menu-max-items'. -This string should contain one %s for the name of the first entry and -one %s for the name of the last entry in the submenu. -If the value is a function, it should return the submenu name. The -function is be called with two arguments, the names of the first and -the last entry in the menu." - :group 'font-menu - :type '(choice (string :tag "Format string") - (function))) - -(defvar font-menu-preferred-resolution - (make-specifier-and-init 'generic '((global ((mswindows) . ":") - ((x) . "*-*"))) t) - "Preferred horizontal and vertical font menu resolution (e.g. \"75:75\").") - -(defvar font-menu-size-scaling - (make-specifier-and-init 'integer '((global ((mswindows) . 1) - ((x) . 10))) t) - "Scale factor used in defining font sizes.") - -;; only call XListFonts (and parse) once per device. -;; ( (device . [parsed-list-fonts family-menu size-menu weight-menu]) ...) -(defvar device-fonts-cache nil) - -(defsubst device-fonts-cache () - (or (cdr (assq (selected-device) device-fonts-cache)) - (and (reset-device-font-menus (selected-device)) - (cdr (assq (selected-device) device-fonts-cache))))) - -;;;###autoload -(fset 'install-font-menus 'reset-device-font-menus) -(make-obsolete 'install-font-menus 'reset-device-font-menus) - -;;;###autoload -(defun reset-device-font-menus (&optional device debug) - "Generates the `Font', `Size', and `Weight' submenus for the Options menu. -This is run the first time that a font-menu is needed for each device. -If you don't like the lazy invocation of this function, you can add it to -`create-device-hook' and that will make the font menus respond more quickly -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." - (message "Getting list of fonts from server... ") - (if (or noninteractive - (not (or device (setq device (selected-device))))) - nil - (call-device-method 'reset-device-font-menus device device debug) - (message "Getting list of fonts from server... done."))) - -(defun font-menu-split-long-menu (menu) - "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)) - (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))) - (inner (/ len outer)) - (rest (% len outer)) - (result nil)) - (setq menu (reverse menu)) - (while menu - (let ((in inner) - (sub nil) - (to (car menu))) - (while (> in 0) - (setq in (1- in) - sub (cons (car menu) sub) - menu (cdr menu))) - (setq result - (cons (cons (if (stringp font-menu-submenu-name-format) - (format font-menu-submenu-name-format - (menu-item-strip-accelerator-spec - (aref (car sub) 0)) - (menu-item-strip-accelerator-spec - (aref to 0))) - (funcall font-menu-submenu-name-format - (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))))) - (submenu-generate-accelerator-spec result))))) - -;;;###autoload -(defun font-menu-family-constructor (ignored) - (catch 'menu - (unless (console-on-window-system-p) - (throw 'menu '(["Cannot parse current font" ding nil]))) - (let* ((dcache (device-fonts-cache)) - (font-data (font-menu-font-data 'default dcache)) - (entry (aref font-data 0)) - (family (aref font-data 1)) - (size (aref font-data 2)) - (weight (aref font-data 3)) - f) - (unless family - (throw 'menu '(["Cannot parse current font" ding nil]))) - ;; Items on the Font menu are enabled iff that font exists in - ;; the same size and weight as the current font (scalable fonts - ;; exist in every size). Only the current font is marked as - ;; selected. - (font-menu-split-long-menu - (mapcar - (lambda (item) - (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 - (member "" (aref entry 1))) - (or (member size (aref entry 2)) - (and (not font-menu-ignore-scaled-fonts) - (member 0 (aref entry 2))))) - (enable-menu-item item) - (disable-menu-item item)) - (if (string-equal family f) - (select-toggle-menu-item item) - (deselect-toggle-menu-item item)) - item) - (aref dcache 1)))))) - -(define-device-method* font-menu-font-data) - -;;;###autoload -(defun font-menu-size-constructor (ignored) - (catch 'menu - (unless (console-on-window-system-p) - (throw 'menu '(["Cannot parse current font" ding nil]))) - (let* ((dcache (device-fonts-cache)) - (font-data (font-menu-font-data 'default dcache)) - (entry (aref font-data 0)) - (family (aref font-data 1)) - (size (aref font-data 2)) - ;;(weight (aref font-data 3)) - s) - (unless family - (throw 'menu '(["Cannot parse current font" ding nil]))) - ;; Items on the Size menu are enabled iff current font has - ;; that size. Only the size of the current font is selected. - ;; (If the current font comes in size 0, it is scalable, and - ;; thus has every size.) - (mapcar - (lambda (item) - (setq s (nth 3 (aref item 1))) - (if (or (member s (aref entry 2)) - (and (not font-menu-ignore-scaled-fonts) - (member 0 (aref entry 2)))) - (enable-menu-item item) - (disable-menu-item item)) - (if (eq size s) - (select-toggle-menu-item item) - (deselect-toggle-menu-item item)) - item) - (submenu-generate-accelerator-spec (aref dcache 2)))))) - -;;;###autoload -(defun font-menu-weight-constructor (ignored) - (catch 'menu - (unless (console-on-window-system-p) - (throw 'menu '(["Cannot parse current font" ding nil]))) - (let* ((dcache (device-fonts-cache)) - (font-data (font-menu-font-data 'default dcache)) - (entry (aref font-data 0)) - (family (aref font-data 1)) - ;;(size (aref font-data 2)) - (weight (aref font-data 3)) - w) - (unless family - (throw 'menu '(["Cannot parse current font" ding nil]))) - ;; Items on the Weight menu are enabled iff current font - ;; has that weight. Only the weight of the current font - ;; is selected. - (mapcar - (lambda (item) - (setq w (aref item 0)) - (if (member w (aref entry 1)) - (enable-menu-item item) - (disable-menu-item item)) - (if (string-equal weight w) - (select-toggle-menu-item item) - (deselect-toggle-menu-item item)) - item) - (submenu-generate-accelerator-spec (aref dcache 3)))))) - - -;;; Changing font sizes - -(defun font-menu-set-font (family weight size) - ;; This is what gets run when an item is selected from any of the three - ;; fonts menus. It needs to be rather clever. - ;; (size is measured in 10ths of points.) - (let* ((dcache (device-fonts-cache)) - (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-slant (aref font-data 4)) - (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 - (signal 'error '("Setting weight currently not supported"))) - (setq new-default-face-font - (font-menu-load-font - (or family from-family) - (or weight from-weight) - (or size from-size) - from-slant - (specifier-instance - font-menu-preferred-resolution (selected-device)))) - ;; This is such a gross hack. The border-glyph face under - ;; mswindows is in a symbol font. Thus it will not appear in the - ;; cache - being a junk family. What we should do is change the - ;; size but not the family, but this is more work than I care to - ;; invest at the moment. - (when (eq (device-type) 'mswindows) - (setq face-list-to-change - (delq 'border-glyph face-list-to-change))) - (dolist (face face-list-to-change) - (when (face-font-instance face) - (message "Changing font of `%s'..." face) - (condition-case c - (font-menu-change-face face - from-family from-weight from-size - family weight size) - (error - (display-error c nil) - (sit-for 1))))) - ;; Set the default face's font after hacking the other faces, so that - ;; the frame size doesn't change until we are all done. - - ;; If we need to be frame local we do the changes ourselves. - (if font-menu-this-frame-only-p - ;;; WMP - we need to honor font-menu-this-frame-only-p here! - (set-face-font 'default new-default-face-font - (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"))) - (message "Font %s" (face-font-name 'default))))) - - -(defun font-menu-change-face (face - from-family from-weight from-size - to-family to-weight to-size) - (or (symbolp face) (signal 'wrong-type-argument (list 'symbolp face))) - (let* ((dcache (device-fonts-cache)) - (font-data (font-menu-font-data face dcache)) - (face-family (aref font-data 1)) - (face-size (aref font-data 2)) - (face-weight (aref font-data 3)) - (face-slant (aref font-data 4))) - - (or face-family - (signal 'error (list "couldn't parse font name for face" face))) - - ;; If this face matches the old default face in the attribute we - ;; are changing, then change it to the new attribute along that - ;; dimension. Also, the face must have its own global attribute. - ;; If its value is inherited, we don't touch it. If any of this - ;; is not true, we leave it alone. - (when (and (face-font face 'global) - (cond - (to-family (string-equal face-family from-family)) - (to-weight (string-equal face-weight from-weight)) - (to-size (= face-size from-size)))) - (set-face-font face - (font-menu-load-font (or to-family face-family) - (or to-weight face-weight) - (or to-size face-size) - face-slant - (specifier-instance - font-menu-preferred-resolution - (selected-device))) - (and font-menu-this-frame-only-p - (selected-frame)))))) - -(define-device-method font-menu-load-font) - -(defun flush-device-fonts-cache (device) - ;; by Stig@hackvan.com - (let ((elt (assq device device-fonts-cache))) - (and elt - (setq device-fonts-cache (delq elt device-fonts-cache))))) - -(add-hook 'delete-device-hook 'flush-device-fonts-cache) - -(provide 'font-menu) - -;; font-menu ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/frame.el --- a/lisp/frame.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/frame.el Mon Aug 13 11:20:41 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 (property) - (if (lax-plist-member plist property) + (mapcar #'(lambda (propname) + (if (lax-plist-member plist propname) (progn (setq frame-initial-geometry-arguments - (cons property - (cons (lax-plist-get plist property) + (cons propname + (cons (lax-plist-get plist propname) frame-initial-geometry-arguments))) - (setq plist (lax-plist-remprop plist property))))) + (setq plist (lax-plist-remprop plist propname))))) '(height width top left user-size user-position)) plist) @@ -571,8 +571,8 @@ Value is `tty' for a tty frame (a character-only terminal), `x' for a frame that is an X window, `ns' for a frame that is a NeXTstep window (not yet implemented), -`mswindows' for a frame that is a MS Windows desktop window, -`msprinter' for a frame that is a MS Windows print job, +`mswindows' for a frame that is a Windows NT or Windows 95/97 window, +`pc' for a frame that is a direct-write MS-DOS frame (not yet implemented), `stream' for a stream frame (which acts like a stdio stream), and `dead' for a deleted frame." (or frame (setq frame (selected-frame))) diff -r 12e008d41344 -r 697ef44129c6 lisp/glyphs.el --- a/lisp/glyphs.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/glyphs.el Mon Aug 13 11:20:41 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, 2000 Ben Wing. +;; Copyright (C) 1995, 1996 Ben Wing. ;; Author: Chuck Thompson , Ben Wing ;; Maintainer: XEmacs Development Team @@ -26,287 +26,27 @@ ;;; 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: -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; image specifiers +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font 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. - -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). -" +specifiers." (make-specifier-and-init 'image spec-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; glyphs (defconst built-in-glyph-specifiers '(image contrib-p baseline) - "A list of the built-in glyph properties that are specifiers.") + "A list of the built-in face properties that are specifiers.") (defun glyph-property (glyph property &optional locale) "Return GLYPH's value of PROPERTY in LOCALE. @@ -547,7 +287,7 @@ "Change the image of GLYPH in LOCALE. SPEC should be an instantiator (a string or vector; see - `make-image-specifier' for a description of possible values here), + `image-specifier-p' 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. @@ -640,162 +380,20 @@ (set-glyph-property glyph 'baseline spec locale tag-set how-to-add)) (defun make-glyph (&optional spec-list 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'. + "Return a new `glyph' object of type TYPE. -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.) +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'. --- 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 instace, 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'." +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." (let ((glyph (make-glyph-internal type))) (and spec-list (set-glyph-image glyph spec-list)) glyph)) @@ -814,22 +412,38 @@ (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. -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'." +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'." (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. -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'." +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'." (make-glyph spec-list 'icon)) (defun nothing-image-instance-p (object) @@ -854,12 +468,9 @@ "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'." + "Return t if OBJECT is an image instance of type `subwindow'. +Subwindows are not implemented in this version of XEmacs." (and (image-instance-p object) (eq 'subwindow (image-instance-type object)))) ;;;;;;;;;; the built-in glyphs diff -r 12e008d41344 -r 697ef44129c6 lisp/gnuserv.el --- a/lisp/gnuserv.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/gnuserv.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,9 +3,9 @@ ;; Version: 3.11 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el -;; Hrvoje Niksic +;; Hrvoje Niksic ;; Maintainer: Jan Vroonhof , -;; Hrvoje Niksic +;; Hrvoje Niksic ;; Keywords: environment, processes, terminals ;; This file is part of XEmacs. @@ -73,7 +73,7 @@ ;; Jan Vroonhof ;; Customized. ;; -;; Hrvoje Niksic May/1997 +;; Hrvoje Niksic May/1997 ;; Completely rewritten. Now uses `defstruct' and other CL stuff ;; to define clients cleanly. Many thanks to Dave Gillespie! ;; @@ -348,13 +348,11 @@ ;; In case of an error, write the description to the ;; client, and then signal it. (error (setq gnuserv-string "") - (when gnuserv-current-client - (gnuserv-write-to-client gnuserv-current-client oops)) + (gnuserv-write-to-client gnuserv-current-client oops) (setq gnuserv-current-client nil) (signal (car oops) (cdr oops))) (quit (setq gnuserv-string "") - (when gnuserv-current-client - (gnuserv-write-to-client gnuserv-current-client oops)) + (gnuserv-write-to-client gnuserv-current-client oops) (setq gnuserv-current-client nil) (signal 'quit nil))) (setq gnuserv-string ""))) @@ -442,7 +440,6 @@ (client (make-gnuclient :id gnuserv-current-client :device device :frame new-frame))) - (select-frame frame) (setq gnuserv-current-client nil) ;; If the device was created by this client, push it to the list. (and (/= old-device-num (length (device-list))) diff -r 12e008d41344 -r 697ef44129c6 lisp/gpm.el --- a/lisp/gpm.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -;;; gpm.el --- Support the mouse when emacs run on a Linux console. - -;; Copyright (C) 1999 Free Software Foundation - -;; Author: William Perry -;; Keywords: mouse, terminals - -;; 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 GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -(defvar gpm-enabled-devices (make-hash-table :test 'eq - :size 13 - :weakness 'key) - "A hash table of devices with GPM currently turned on.") - -(defun gpm-mode (&optional arg device) - "Toggle GPM mouse mode. -With prefix arg, turn GPM mouse mode on if and only if arg is positive." - (interactive (list current-prefix-arg (selected-device))) - (cond - ((null arg) ; Toggle - (if (gethash device gpm-enabled-devices) - (progn - (gpm-enable device nil) - (remhash device gpm-enabled-devices)) - (gpm-enable device t) - (puthash device t gpm-enabled-devices))) - ((> arg 0) ; Turn on - (gpm-enable device t) - (puthash device t gpm-enabled-devices)) - ((gethash device gpm-enabled-devices) ; Turn off - (gpm-enable device nil) - (remhash device gpm-enabled-devices)))) - -(defun turn-on-gpm-mouse-tracking (&optional device) - ;; Enable mouse tracking on linux console - (gpm-mode 5 device)) - -(defun turn-off-gpm-mouse-tracking (&optional device) - ;; Disable mouse tracking on linux console - (gpm-mode -5 device)) - -(defun gpm-create-device-hook (device) - (if (and (not noninteractive) ; Don't want to do this in batch mode - (fboundp 'gpm-enable) ; Must have C-level GPM support - (eq system-type 'linux) ; Must be running linux - (eq (device-type device) 'tty) ; on a tty - (equal "linux" (console-tty-terminal-type ; an a linux terminal type - (device-console device)))) - (turn-on-gpm-mouse-tracking device))) - -(defun gpm-delete-device-hook (device) - (if (and (not noninteractive) ; Don't want to do this in batch mode - (fboundp 'gpm-enable) ; Must have C-level GPM support - (eq system-type 'linux) ; Must be running linux - (eq (device-type device) 'tty) ; on a tty - (equal "linux" (console-tty-terminal-type ; an a linux terminal type - (device-console device)))) - (turn-off-gpm-mouse-tracking device))) - -;; Restore normal mouse behaviour outside Emacs - -(add-hook 'suspend-hook 'turn-off-gpm-mouse-tracking) -(add-hook 'suspend-resume-hook 'turn-on-gpm-mouse-tracking) -(add-hook 'create-device-hook 'gpm-create-device-hook) -(add-hook 'delete-device-hook 'gpm-delete-device-hook) - -(provide 'gpm) diff -r 12e008d41344 -r 697ef44129c6 lisp/gui.el --- a/lisp/gui.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/gui.el Mon Aug 13 11:20:41 2007 +0200 @@ -64,7 +64,6 @@ menubar-visible-p nil has-modeline-p nil default-toolbar-visible-p nil - default-gutter-visible-p nil modeline-shadow-thickness 0 left ,(+ fleft (- (/ fwidth 2) (/ (* dfwidth fontw) @@ -83,7 +82,7 @@ "True if OBJECT is a GUI button." (and (vectorp object) (> (length object) 0) - (eq 'button (aref object 0)))) + (eq 'gui-button (aref object 0)))) (make-face 'gui-button-face "Face used for gui buttons") (if (not (face-differs-from-default-p 'gui-button-face)) @@ -98,15 +97,26 @@ "Make a GUI button whose label is STRING and whose action is ACTION. If the button is inserted in a buffer and then clicked on, and ACTION is non-nil, ACTION will be called with one argument, USER-DATA." - (vector 'button - :descriptor string - :face 'gui-button-face - :callback `(funcall (quote ,action) (quote ,user-data)))) + (vector 'gui-button + (if (featurep 'xpm) + (xpm-button-create + string gui-button-shadow-thickness + (color-instance-name (face-foreground-instance 'gui-button-face)) + (color-instance-name (face-background-instance 'gui-button-face))) + (xbm-button-create string gui-button-shadow-thickness)) + action user-data)) (defun insert-gui-button (button &optional pos buffer) "Insert GUI button BUTTON at POS in BUFFER." (check-argument-type 'gui-button-p button) - (make-annotation (make-glyph button) - pos 'text buffer nil)) + (let ((annotation + (make-annotation (make-glyph (car (aref button 1))) + pos 'text buffer nil + (make-glyph (cadr (aref button 1))))) + (action (aref button 2))) + (and action + (progn + (set-annotation-action annotation action) + (set-annotation-data annotation (aref button 3)))))) ;;; gui.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/gutter-items.el --- a/lisp/gutter-items.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,738 +0,0 @@ -;;; gutter-items.el --- Gutter content for XEmacs. - -;; Copyright (C) 1999 Free Software Foundation, Inc. -;; Copyright (C) 1999, 2000 Andy Piper. - -;; Maintainer: XEmacs Development Team -;; Keywords: frames, extensions, internal, dumped - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with Xmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;; Some of this is taken from the buffer-menu stuff in menubar-items.el - -;;; The Buffers tab - -(defgroup buffers-tab nil - "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.") - -(defvar gutter-buffers-tab-extent nil) - -(defcustom buffers-tab-max-size 6 - "*Maximum number of entries which may appear on the \"Buffers\" tab. -If this is 10, then only the ten most-recently-selected buffers will be -shown. If this is nil, then all buffers will be shown. Setting this to -a large number or nil will slow down tab responsiveness." - :type '(choice (const :tag "Show all" nil) - (integer 6)) - :group 'buffers-tab) - -(defcustom buffers-tab-switch-to-buffer-function 'buffers-tab-switch-to-buffer - "*The function to call to select a buffer from the buffers tab. -`switch-to-buffer' is a good choice, as is `pop-to-buffer'." - :type '(radio (function-item switch-to-buffer) - (function-item pop-to-buffer) - (function :tag "Other")) - :group 'buffers-tab) - -(defcustom buffers-tab-omit-function 'buffers-menu-omit-invisible-buffers - "*If non-nil, a function specifying the buffers to omit from the buffers tab. -This is passed a buffer and should return non-nil if the buffer should be -omitted. The default value `buffers-tab-omit-invisible-buffers' omits -buffers that are normally considered \"invisible\" (those whose name -begins with a space)." - :type '(choice (const :tag "None" nil) - function) - :group 'buffers-tab) - -(defcustom buffers-tab-selection-function 'select-buffers-tab-buffers-by-mode - "*If non-nil, a function specifying the buffers to select from the -buffers tab. This is passed two buffers and should return non-nil if -the second buffer should be selected. The default value -`select-buffers-tab-buffers-by-mode' groups buffers by major mode and -by `buffers-tab-grouping-regexp'." - - :type '(choice (const :tag "None" nil) - 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) - -(defcustom buffers-tab-face 'buffers-tab - "*Face to use for displaying the buffers tab." - :type 'face - :group 'buffers-tab) - -(defcustom buffers-tab-grouping-regexp - '("^\\(gnus-\\|message-mode\\|mime/viewer-mode\\)" - "^\\(emacs-lisp-\\|lisp-\\)") - "*If non-nil, a list of regular expressions for buffer grouping. -Each regular expression is applied to the current major-mode symbol -name and mode-name, if it matches then any other buffers that match -the same regular expression be added to the current group." - :type '(choice (const :tag "None" nil) - sexp) - :group 'buffers-tab) - -(defcustom buffers-tab-format-buffer-line-function 'format-buffers-tab-line - "*The function to call to return a string to represent a buffer in the -buffers tab. The function is passed a buffer and should return a -string. The default value `format-buffers-tab-line' just returns the -name of the buffer, optionally truncated to -`buffers-tab-max-buffer-line-length'. Also check out -`slow-format-buffers-menu-line' which returns a whole bunch of info -about a buffer." - :type 'function - :group 'buffers-tab) - -(defvar buffers-tab-default-buffer-line-length - (make-specifier-and-init 'generic '((global ((default) . 25))) t) - "*Maximum length of text which may appear in a \"Buffers\" tab. -This is a specifier, use set-specifier to modify it.") - -(defcustom buffers-tab-max-buffer-line-length - (specifier-instance buffers-tab-default-buffer-line-length) - "*Maximum length of text which may appear in a \"Buffers\" tab. -Buffer names over this length will be truncated with elipses. -If this is 0, then the full buffer name will be shown." - :type '(choice (const :tag "Show all" 0) - (integer 25)) - :group 'buffers-tab - :set #'(lambda (var val) - (set-specifier buffers-tab-default-buffer-line-length val) - (setq buffers-tab-max-buffer-line-length val))) - -(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. - ;; - ;; Andy, if you want to maintain the current look, you must - ;; *uncouple* the gutter order and buffers order. - (if (> (length (windows-of-buffer buffer)) 0) - (select-window (car (windows-of-buffer buffer))) - (switch-to-buffer buffer)))) - -(defun select-buffers-tab-buffers-by-mode (buf1 buf2) - "For use as a value of `buffers-tab-selection-function'. -This selects buffers by major mode `buffers-tab-grouping-regexp'." - (let ((mode1 (symbol-name (symbol-value-in-buffer 'major-mode buf1))) - (mode2 (symbol-name (symbol-value-in-buffer 'major-mode buf2))) - (modenm1 (symbol-value-in-buffer 'mode-name buf1)) - (modenm2 (symbol-value-in-buffer 'mode-name buf2))) - (cond ((or (eq mode1 mode2) - (eq modenm1 modenm2) - (and (string-match "^[^-]+-" mode1) - (string-match - (concat "^" (regexp-quote - (substring mode1 0 (match-end 0)))) - mode2)) - (and buffers-tab-grouping-regexp - (find-if #'(lambda (x) - (or - (and (string-match x mode1) - (string-match x mode2)) - (and (string-match x modenm1) - (string-match x modenm2)))) - buffers-tab-grouping-regexp))) - t) - (t nil)))) - -(defun format-buffers-tab-line (buffer) - "For use as a value of `buffers-tab-format-buffer-line-function'. -This just returns the buffer's name, optionally truncated." - (let ((len (specifier-instance buffers-tab-default-buffer-line-length))) - (if (and (> len 0) - (> (length (buffer-name buffer)) len)) - (if (string-match ".*<.>$" (buffer-name buffer)) - (concat (substring (buffer-name buffer) - 0 (- len 6)) "..." - (substring (buffer-name buffer) -3)) - (concat (substring (buffer-name buffer) - 0 (- len 3)) "...")) - (buffer-name buffer)))) - -(defsubst build-buffers-tab-internal (buffers) - (let ((selected t)) - (mapcar - #'(lambda (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))) - -;;; #### 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 -efficiency reasons. You can control how many buffers will be shown by -setting `buffers-tab-max-size'. You can control the text of the tab -items by redefining the function `format-buffers-menu-line'." - (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))) - ;; 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) - (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 (copy-sequence "\n"))) - (unless gutter-buffers-tab-extent - (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))) - - ;; 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." - ;; 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 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)) - :properties - (list :items - (buffers-tab-items nil frame force-selection))) - frame))))) - -;; 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-display-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-display-popup-period 0.5 - "The time that the progress gauge should remain up after completion") - -;; private variables -(defvar progress-text-glyph - (make-glyph [string :data ""])) - -(defvar progress-layout-glyph nil) -(defvar progress-gauge-glyph - (make-glyph - `[progress-gauge - :pixel-height (eval progress-glyph-height) - :pixel-width 250 - :descriptor "Progress"])) - -(defun set-progress-display-style (style) - "Control the appearance of the progress gauge. -If STYLE is 'large, the default, then the progress-display text is -displayed above the gauge itself. If STYLE is 'small then the gauge -and text are arranged side-by-side." - (cond - ((eq style 'small) - (setq progress-glyph-height 16) - (setq progress-layout-glyph - (make-glyph - `[layout - :orientation horizontal - :margin-width 4 - :items (,progress-gauge-glyph - [button - :pixel-height (eval progress-glyph-height) - ;; 'quit is special and acts "asynchronously". - :descriptor "Stop" :callback 'quit] - ,progress-text-glyph)]))) - (t - (setq progress-glyph-height 24) - (setq progress-layout-glyph - (make-glyph - `[layout - :orientation vertical :justify left - :margin-width 4 - :items (,progress-text-glyph - [layout - :orientation horizontal - :items (,progress-gauge-glyph - [button - :pixel-height (eval progress-glyph-height) - :descriptor " Stop " - ;; 'quit is special and acts "asynchronously". - :callback 'quit])])]))))) - -(defcustom progress-display-style 'large - "*Control the appearance of the progress gauge. -If 'large, the default, then the progress-display 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)) - :set #'(lambda (var val) - (set-progress-display-style val))) - -(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-display' or -`display-progress-display'/`clear-progress-display' functions.") - -(defvar progress-abort-glyph - (make-glyph - `[layout :orientation vertical :justify left - :items (,progress-text-glyph - [layout - :margin-width 4 - :pixel-height progress-glyph-height - :orientation horizontal])])) - -(defun progress-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." - (let ((buffer (get-buffer-create " *Gutter Area*"))) - (and (< (point-min buffer) (point-max buffer)) - (if return-string - (buffer-substring nil nil buffer) - t)))) - -;;; 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-display (&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 -area will be returned, or nil if the progress-stack is now empty. -If LABEL is nil, the entire progress-stack is cleared. - -Unless you need the return value or you need to specify a label, -you should just use (progress nil)." - (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) - progress-display-use-echo-area) - (clear-message label frame nil no-restore) - (or frame (setq frame (selected-frame))) - (remove-progress-display 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-display 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 progress-display-clear-when-idle (&optional label) - (add-one-shot-hook 'pre-idle-hook - `(lambda () - (clear-progress-display ',label)))) - -(defun remove-progress-display (&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 - (eq label (car (car progress-stack))))) - (setq progress-stack (cdr progress-stack))) - (let ((s progress-stack)) - (while (cdr s) - (let ((msg (car (cdr s)))) - (if (eq label (car msg)) - (progn - (setcdr s (cdr (cdr s)))) - (setq s (cdr s))))))) - -(defun progress-display-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-display (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)) - (tmsg (cdr top))) - (if (eq label (car top)) - (progn - (setcdr top message) - (if (equal tmsg message) - ;; #### use of set-image-instance-property is wrong. - ;; use set-glyph-image instead. - (set-image-instance-property - (glyph-image-instance progress-gauge-glyph - (frame-selected-window frame)) - :value value) - (raw-append-progress-display message value frame)) - (redisplay-gutter-area)) - (push (cons label message) progress-stack) - (raw-append-progress-display message value frame)) - (progress-display-dispatch-non-command-events) - ;; either get command events or sit waiting for them - (when (eq value 100) -; (sit-for progress-display-popup-period nil) - (clear-progress-display label)))) - -(defun abort-progress-display (label message &optional frame) - (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) - progress-display-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-gutter-element bottom-gutter 'progress gutter-string frame) - (set-specifier bottom-gutter-border-width 2 frame) - ;; #### use of set-image-instance-property is wrong. - ;; use set-glyph-image instead. - (set-image-instance-property - (glyph-image-instance progress-text-glyph - (frame-selected-window frame)) :data message) - (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. - (redisplay-gutter-area) - (sit-for progress-display-popup-period nil) - (clear-progress-display label frame) - (set-extent-begin-glyph ext progress-layout-glyph) - (set-gutter-element bottom-gutter 'progress gutter-string frame) - ))))) - -(defun raw-append-progress-display (message &optional value frame) - (unless (equal message "") - (let* ((inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays) - (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 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) - ;; #### use of set-image-instance-property is wrong. - ;; use set-glyph-image instead. - (set-image-instance-property - (glyph-image-instance progress-gauge-glyph - (frame-selected-window frame)) - :value val) - (set-image-instance-property - (glyph-image-instance progress-text-glyph (frame-selected-window frame)) - :data message) - (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 - (redisplay-gutter-area) - (progress-display-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-display-dispatch-non-command-events) - (redisplay-frame frame) - )))) - -(defun display-progress-display (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-display' to remove a labelled -message." - (cond ((eq value 'abort) - (abort-progress-display label message frame)) - ((or (not (valid-image-instantiator-format-p 'progress-gauge frame)) - progress-display-use-echo-area) - (display-message label - (concat message (if (eq value 100) "done." - (make-string (/ value 5) ?.))) - frame)) - (t - (append-progress-display label message value frame)))) - -(defun current-progress-display (&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-display-label (&optional frame) - (car (car progress-stack))) - -(defun progress-display (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." - (save-excursion - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress-display nil)) - (let ((str (apply 'format fmt args))) - (display-progress-display 'progress str value) - str)))) - -(defun lprogress-display (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'." - ;; #### 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-display label nil)) - (let ((str (apply 'format fmt args))) - (display-progress-display label str value) - str)))) - -;; -;; Simple search dialog -;; -(defvar search-dialog-direction t) -(defvar search-dialog-text - (make-glyph - [edit-field :width 15 :descriptor "" :active t :face default])) - -(defun search-dialog-callback (parent image-instance event) - (save-selected-frame - (select-frame parent) - (funcall (if search-dialog-direction - 'search-forward 'search-backward) - (image-instance-property - (glyph-image-instance search-dialog-text - (frame-selected-window - (event-channel event))) :text)) - (isearch-highlight (match-beginning 0) (match-end 0)))) - -(defun make-search-dialog () - "Popup a search dialog box." - (interactive) - (let* ((parent (selected-frame))) - (set-buffer-dedicated-frame - (get-buffer-create "Dialog") - (make-dialog-box - (make-glyph - `[layout - :orientation horizontal :justify left - :height 10 :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 "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 - (search-dialog-text - [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)))])])]) - '(height 10 width 40))))) - -(provide 'gutter-items) -;;; gutter-items.el ends here. diff -r 12e008d41344 -r 697ef44129c6 lisp/gutter.el --- a/lisp/gutter.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -;;; 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, extensions, internal, dumped - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with Xmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;; 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 neccessary 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 accomodate 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 -correspondong 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 12e008d41344 -r 697ef44129c6 lisp/help-nomule.el --- a/lisp/help-nomule.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/help-nomule.el Mon Aug 13 11:20:41 2007 +0200 @@ -100,19 +100,6 @@ ;; Now, signal the error (signal (car error-data) (cdr error-data))))))) -;; General Mule-compatibility stuffs -(define-function 'string-width 'length) - -;; The following was originally in subr.el -(defun make-char (charset &optional arg1 arg2) - "Make a character from CHARSET and octets ARG1 and ARG2. -This function is available for compatibility with Mule-enabled XEmacsen. -When CHARSET is `ascii', return (int-char ARG1). Otherwise, return -that value with the high bit set. ARG2 is always ignored." - (int-char (if (eq charset 'ascii) - arg1 - (logior arg1 #x80)))) - (provide 'help-nomule) diff -r 12e008d41344 -r 697ef44129c6 lisp/help.el --- a/lisp/help.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/help.el Mon Aug 13 11:20:41 2007 +0200 @@ -305,8 +305,8 @@ "Return the command invoked by KEY. Like `key-binding', but handles menu events and toolbar presses correctly. KEY is any value returned by `next-command-event'. -MENU-FLAG is a symbol that should be set to t if KEY is a menu event, - or nil otherwise" +MENU-FLAG is a symbol that should be set to T if KEY is a menu event, + or NIL otherwise" (let (defn) (and menu-flag (set menu-flag nil)) ;; If the key typed was really a menu selection, grab the form out @@ -461,9 +461,7 @@ (if (and (integerp help-max-help-buffers) (> help-max-help-buffers 0) (stringp name)) - (if help-buffer-prefix-string - (format "*%s: %s*" help-buffer-prefix-string name) - (format "*%s*" name)) + (format "*%s: %s*" help-buffer-prefix-string name) (format "*%s*" help-buffer-prefix-string))) ;; Use this function for displaying help when C-h something is pressed @@ -657,20 +655,9 @@ (gettext "key binding\n--- -------\n"))) (buffer (current-buffer)) (minor minor-mode-map-alist) - (extent-maps (mapcar-extents - 'extent-keymap - nil (current-buffer) (point) (point) nil 'keymap)) (local (current-local-map)) (shadow '())) (set-buffer standard-output) - (while extent-maps - (insert "Bindings for Text Region:\n" - heading) - (describe-bindings-internal - (car extent-maps) nil shadow prefix mouse-only-p) - (insert "\n") - (setq shadow (cons (car extent-maps) shadow) - extent-maps (cdr extent-maps))) (while minor (let ((sym (car (car minor))) (map (cdr (car minor)))) @@ -730,10 +717,7 @@ (stringp Installation-string)) (with-displaying-help-buffer (lambda () - (princ - (if (fboundp 'decode-coding-string) - (decode-coding-string Installation-string 'automatic-conversion) - Installation-string))) + (princ Installation-string)) "Installation") (error "No Installation information available."))) @@ -951,9 +935,8 @@ (format (gettext "Describe function (default %s): ") fn) (gettext "Describe function: ")) - obarray 'fboundp t nil 'function-history - (symbol-name fn))))) - (list (intern val)))) + obarray 'fboundp t nil 'function-history)))) + (list (if (equal val "") fn (intern val))))) (with-displaying-help-buffer (lambda () (describe-function-1 function) @@ -1021,27 +1004,24 @@ This function is used by `describe-function-1' to list function arguments in the standard Lisp style." - (let* ((fnc (indirect-function function)) - (fndef (if (eq (car-safe fnc) 'macro) - (cdr fnc) - fnc)) + (let* ((fndef (indirect-function function)) (arglist - (cond ((compiled-function-p fndef) - (compiled-function-arglist fndef)) - ((eq (car-safe fndef) 'lambda) - (nth 1 fndef)) - ((subrp fndef) - (let* ((doc (documentation function)) - (args (and (string-match - "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" - doc) - (match-string 1 doc)))) - ;; If there are no arguments documented for the - ;; subr, rather don't print anything. - (cond ((null args) t) - ((equal args "") nil) - (args)))) - (t t)))) + (cond ((compiled-function-p fndef) + (compiled-function-arglist fndef)) + ((eq (car-safe fndef) 'lambda) + (nth 1 fndef)) + ((subrp fndef) + (let* ((doc (documentation function)) + (args (and (string-match + "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" + doc) + (match-string 1 doc)))) + ;; If there are no arguments documented for the + ;; subr, rather don't print anything. + (cond ((null args) t) + ((equal args "") nil) + (args)))) + (t t)))) (cond ((listp arglist) (prin1-to-string (cons function (mapcar (lambda (arg) @@ -1244,9 +1224,8 @@ (if v (format "Describe variable (default %s): " v) (gettext "Describe variable: ")) - obarray 'boundp t nil 'variable-history - (symbol-name v))))) - (list (intern val)))) + obarray 'boundp t nil 'variable-history)))) + (list (if (equal val "") v (intern val))))) (with-displaying-help-buffer (lambda () (let ((origvar variable) @@ -1429,7 +1408,7 @@ (if cmd (princ " "))))) (terpri)))))) -;; Stop gap for 21.0 until we do help-char etc properly. +;; Stop gap for 21.0 untill we do help-char etc properly. (defun help-keymap-with-help-key (keymap form) "Return a copy of KEYMAP with an help-key binding according to help-char invoking FORM like help-form. An existing binding is not overridden. diff -r 12e008d41344 -r 697ef44129c6 lisp/hyper-apropos.el --- a/lisp/hyper-apropos.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/hyper-apropos.el Mon Aug 13 11:20:41 2007 +0200 @@ -58,9 +58,9 @@ ;; Massive changes by Christoph Wedler ;; Some changes for XEmacs 20.3 by hniksic -;; #### The maintainer is supposed to be stig, but I haven't seen him +;; ### The maintainer is supposed to be stig, but I haven't seen him ;; around for ages. The real maintainer for the moment is Hrvoje -;; Niksic . +;; Niksic . ;;; Code: @@ -243,22 +243,16 @@ (setq hyper-apropos-prev-wconfig (current-window-configuration))) (if (string= "" regexp) (if (get-buffer hyper-apropos-apropos-buf) - (progn - (setq regexp hyper-apropos-last-regexp) - (if toggle-apropos - (hyper-apropos-toggle-programming-flag) - (message "Using last search results"))) + (if toggle-apropos + (hyper-apropos-toggle-programming-flag) + (message "Using last search results")) (error "Be more specific...")) (set-buffer (get-buffer-create hyper-apropos-apropos-buf)) (setq buffer-read-only nil) (erase-buffer) (if toggle-apropos - (if (local-variable-p 'hyper-apropos-programming-apropos - (current-buffer)) - (setq hyper-apropos-programming-apropos - (not hyper-apropos-programming-apropos)) - (set (make-local-variable 'hyper-apropos-programming-apropos) - (not (default-value 'hyper-apropos-programming-apropos))))) + (set (make-local-variable 'hyper-apropos-programming-apropos) + (not (default-value 'hyper-apropos-programming-apropos)))) (let ((flist (apropos-internal regexp (if hyper-apropos-programming-apropos #'fboundp @@ -438,9 +432,7 @@ (if (and (or (symbolp defn) (symbolp (setq defn (car-safe defn)))) defn show) - (hyper-apropos-get-doc defn t)) - (or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode)) - (setq hyper-apropos-prev-wconfig (current-window-configuration))))))) + (hyper-apropos-get-doc defn t)))))) ;;;###autoload (defun hyper-describe-face (symbol &optional this-ref-buffer) @@ -462,9 +454,10 @@ ": ")) (mapcar #'(lambda (x) (list (symbol-name x))) (face-list)) - nil t nil 'hyper-apropos-face-history - (and v (symbol-name v))))) - (list (intern-soft val) + nil t nil 'hyper-apropos-face-history))) + (list (if (string= val "") + (progn (push (symbol-name v) hyper-apropos-face-history) v) + (intern-soft val)) current-prefix-arg))) (if (null symbol) (message "Sorry, nothing to describe.") @@ -531,10 +524,10 @@ (if v (format " (default %s): " v) ": ")) - obarray predicate t nil 'variable-history - (and v (symbol-name v))))) - (intern-soft val))) - + obarray predicate t nil 'variable-history))) + (if (string= val "") + (progn (push (symbol-name v) variable-history) v) + (intern-soft val)))) ;;;###autoload (define-obsolete-function-alias 'hypropos-read-variable-symbol 'hyper-apropos-read-variable-symbol) @@ -550,9 +543,10 @@ (format "%s (default %s): " prompt fn) (format "%s: " prompt)) obarray 'fboundp t nil - 'function-history - (and fn (symbol-name fn))))) - (intern-soft val))) + 'function-history))) + (if (equal val "") + (progn (push (symbol-name fn) function-history) fn) + (intern-soft val)))) (defun hyper-apropos-last-help (arg) "Go back to the last symbol documented in the *Hyper Help* buffer." @@ -1085,12 +1079,6 @@ nil (forward-char 3) (read (point-marker)))) - ((and - (eq major-mode 'hyper-apropos-help-mode) - (> (point) (point-min))) - (save-excursion - (goto-char (point-min)) - (hyper-apropos-this-symbol))) (t (let* ((st (progn (skip-syntax-backward "w_") @@ -1133,6 +1121,11 @@ (interactive (let ((var (hyper-apropos-this-symbol))) (or (and var (boundp var)) + (and (setq var (and (eq major-mode 'hyper-apropos-help-mode) + (save-excursion + (goto-char (point-min)) + (hyper-apropos-this-symbol)))) + (boundp var)) (setq var nil)) (list var (hyper-apropos-read-variable-value var)))) (and var @@ -1182,10 +1175,7 @@ (defun hyper-apropos-customize-variable () (interactive) (let ((var (hyper-apropos-this-symbol))) - (and - (or (and var (boundp var)) - (setq var nil)) - (customize-variable var)))) + (customize-variable var))) ;; ---------------------------------------------------------------------- ;; @@ -1207,6 +1197,11 @@ (interactive (let ((fn (hyper-apropos-this-symbol))) (or (fboundp fn) + (and (setq fn (and (eq major-mode 'hyper-apropos-help-mode) + (save-excursion + (goto-char (point-min)) + (hyper-apropos-this-symbol)))) + (fboundp fn)) (setq fn nil)) (list fn))) (if fn @@ -1262,7 +1257,11 @@ (defun hyper-apropos-popup-menu (event) (interactive "e") (mouse-set-point event) - (let* ((sym (hyper-apropos-this-symbol)) + (let* ((sym (or (hyper-apropos-this-symbol) + (and (eq major-mode 'hyper-apropos-help-mode) + (save-excursion + (goto-char (point-min)) + (hyper-apropos-this-symbol))))) (notjunk (not (null sym))) (command-p (if (commandp sym) t)) (variable-p (and sym (boundp sym))) diff -r 12e008d41344 -r 697ef44129c6 lisp/indent.el --- a/lisp/indent.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/indent.el Mon Aug 13 11:20:41 2007 +0200 @@ -93,7 +93,7 @@ (back-to-indentation) (let ((cur-col (current-column))) (cond ((< cur-col column) - (if (>= (- column (* (/ cur-col tab-width) tab-width)) tab-width) + (if (> (- column (* (/ cur-col tab-width) tab-width)) tab-width) (delete-region (point) (progn (skip-chars-backward " ") (point)))) (indent-to column)) diff -r 12e008d41344 -r 697ef44129c6 lisp/info.el --- a/lisp/info.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/info.el Mon Aug 13 11:20:41 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 'never +(defcustom Info-save-auto-generated-dir nil "*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) @@ -437,15 +437,9 @@ "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. - -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))") +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.") (defcustom Info-localdir-heading-regexp "^Locally installed XEmacs Packages:?" @@ -463,9 +457,8 @@ :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") (".info-z" . "gzip -dc %s") (".info.Z" . "uncompress -c %s") @@ -508,12 +501,9 @@ "List of possible matches for last Info-index command.") (defvar Info-index-first-alternative nil) -(defcustom Info-annotations-path - (list - (paths-construct-path (list user-init-directory "info.notes")) - (paths-construct-path '("~" ".infonotes")) - (paths-construct-path '("usr" "lib" "info.notes") - (char-to-string directory-sep-char))) +(defcustom Info-annotations-path '("~/.xemacs/info.notes" + "~/.infonotes" + "/usr/lib/info.notes") "*Names of files that contain annotations for different Info nodes. By convention, the first one should reside in your personal directory. The last should be a world-writable \"public\" annotations file." @@ -537,7 +527,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,7 +582,6 @@ (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 @@ -608,7 +597,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 `./' @@ -629,7 +618,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)) @@ -871,7 +860,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)) @@ -882,13 +871,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 @@ -957,7 +946,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) @@ -1017,7 +1006,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) @@ -1035,7 +1024,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))) @@ -1044,7 +1033,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 @@ -1083,12 +1072,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))) @@ -1109,7 +1098,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))) @@ -1124,7 +1113,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)) @@ -1132,7 +1121,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\\)?$" @@ -1146,13 +1135,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)))) ":" @@ -1168,10 +1157,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 @@ -1180,7 +1169,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) @@ -1189,8 +1178,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) @@ -1233,12 +1222,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)) @@ -1260,7 +1249,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'; @@ -1280,7 +1269,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) @@ -1496,10 +1485,12 @@ (or (equal tag "") (Info-find-node nil (format "<<%s>>" tag))))) ;;;###autoload -(defun Info-visit-file (file) +(defun Info-visit-file () "Directly visit an info file." - (interactive "fVisit Info file: ") - (Info-find-node (expand-file-name file) "Top")) + (interactive) + (let* ((insert-default-directory nil) + (file (read-file-name "Goto Info file: " "" ""))) + (or (equal file "") (Info-find-node (expand-file-name file) "Top")))) (defun Info-restore-point (&optional always) "Restore point to same location it had last time we were in this node." @@ -1518,33 +1509,13 @@ (set-window-start (get-buffer-window (current-buffer)) (+ (nth 2 entry) (point-min))))) -(defvar Info-read-node-completion-table) - -;; This function is used as the "completion table" while reading a node name. -;; It does completion using the alist in Info-read-node-completion-table -;; unless STRING starts with an open-paren. -(defun Info-read-node-name-1 (string predicate code) - (let ((no-completion (and (> (length string) 0) (eq (aref string 0) ?\()))) - (cond ((eq code nil) - (if no-completion - string - (try-completion string Info-read-node-completion-table predicate))) - ((eq code t) - (if no-completion - nil - (all-completions string Info-read-node-completion-table predicate))) - ((eq code 'lambda) - (if no-completion - t - (assoc string Info-read-node-completion-table)))))) - (defun Info-read-node-name (prompt &optional default) (Info-setup-initial) (let* ((completion-ignore-case t) - (Info-read-node-completion-table (Info-build-node-completions)) - (nodename (completing-read prompt 'Info-read-node-name-1 - nil t nil 'Info-minibuffer-history - default))) + (nodename (completing-read prompt + (Info-build-node-completions) + nil nil nil + 'Info-minibuffer-history))) (if (equal nodename "") (or default (Info-read-node-name prompt)) @@ -1588,7 +1559,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)))))))) @@ -1601,14 +1572,10 @@ ;;;###autoload (defun Info-search (regexp) "Search for REGEXP, starting from point, and select node it's found in." - (interactive (list - (read-from-minibuffer - (if Info-last-search - (format "Search (regexp, default %s): " - Info-last-search) - "Search (regexp): ") - nil nil nil nil nil Info-last-search))) - (setq Info-last-search regexp) + (interactive "sSearch (regexp): ") + (if (equal regexp "") + (setq regexp Info-last-search) + (setq Info-last-search regexp)) (with-search-caps-disable-folding regexp t (let ((found ()) (onode Info-current-node) @@ -1668,7 +1635,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 @@ -1685,7 +1652,7 @@ ;; Return the node name in the buffer following point. ;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp -;; saying which chars may appear in the node name. +;; saying which chas may appear in the node name. (defun Info-following-node-name (&optional allowedchars) (skip-chars-forward " \t") (buffer-substring @@ -1695,7 +1662,7 @@ (skip-chars-forward (concat (or allowedchars "^,\t\n") "(")) (if (looking-at "(") (skip-chars-forward "^)"))) - (skip-chars-backward " .") + (skip-chars-backward " ") (point)))) (defun Info-next (&optional n) @@ -1790,8 +1757,7 @@ default ") ") "Follow reference named: ") completions nil t nil - 'Info-minibuffer-history - default))) + 'Info-minibuffer-history))) (if (and (string= item "") default) (list default) (list item))) @@ -1875,19 +1841,7 @@ (if (looking-at ":") (buffer-substring beg (1- (point))) (skip-chars-forward " \t\n") - ;; Kludge. - ;; Allow dots in node name not followed by whitespace. - (re-search-forward - (concat "\\(([^)]+)[^." - (if multi-line "" "\n") - "]*\\|\\([^.,\t" - (if multi-line "" "\n") - ;; We consider dots followed by newline as - ;; end of nodename even if multil-line. - ;; Also stops at .). It is generated by @pxref. - ;; Skips sequential dots. - "]\\|\\.+[^ \t\n)]\\)+\\)")) - (match-string 1))) + (Info-following-node-name (if multi-line "^.,\t" "^.,\t\n")))) (while (setq i (string-match "\n" str i)) (aset str i ?\ )) str)) @@ -1930,8 +1884,7 @@ default) "Menu item: ") completions nil t nil - 'Info-minibuffer-history - default))) + 'Info-minibuffer-history))) ;; we rely on the fact that completing-read accepts an input ;; of "" even when the require-match argument is true and "" ;; is not a valid possibility @@ -1944,7 +1897,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)) @@ -2107,9 +2060,11 @@ (progn (Info-global-prev) (message "Node: %s" Info-current-node) - (goto-char (point-max)) - (recenter -1) - (move-to-window-line 0)) + (sit-for 0) + ;;(scroll-up 1) ; work around bug in pos-visible-in-window-p + ;;(scroll-down 1) + (while (not (pos-visible-in-window-p (point-max))) + (scroll-up))) (scroll-down))))) (defun Info-scroll-prev (arg) @@ -2119,9 +2074,9 @@ (not (eq Info-auto-advance t)) (not (eq last-command this-command))) (message "Hit %s again to go to previous node" - (if (mouse-event-p last-command-event) + (if (= last-command-char 0) "mouse button" - (key-description (event-key last-command-event)))) + (key-description (char-to-string last-command-char)))) (Info-page-prev) (setq this-command 'Info)) (scroll-down arg))) @@ -2138,7 +2093,7 @@ (interactive "sIndex topic: ") (let ((pattern (format "\n\\* \\([^\n:]*%s[^\n:]*\\):[ \t]*%s" (regexp-quote topic) - "\\(.*\\)\\.[ t]*\\([0-9]*\\)$")) + "\\([^.\n]*\\)\\.[ t]*\\([0-9]*\\)")) node) (message "Searching index for `%s'..." topic) (Info-goto-node "Top") @@ -2293,7 +2248,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: " @@ -3000,7 +2955,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 12e008d41344 -r 697ef44129c6 lisp/isearch-mode.el --- a/lisp/isearch-mode.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/isearch-mode.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ ;;; isearch-mode.el --- Incremental search minor mode. -;; Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc. +;; Copyright (C) 1992, 1993, 1997 Free Software Foundation, Inc. ;; Author: Daniel LaLiberte ;; Maintainer: XEmacs Development Team @@ -19,29 +19,35 @@ ;; 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. -;;; Synched up with: FSF 20.4. +;;; Synched up with: Not synched with FSF. ;;; Commentary: +;; LCD Archive Entry: +;; isearch-mode|Daniel LaLiberte|liberte@cs.uiuc.edu +;; |A minor mode replacement for isearch.el. + +;;==================================================================== ;; Instructions -;; Searching with isearch-mode.el should work just like isearch.el -;; [the one from Emacs 18], except it is done in a temporary minor -;; mode that terminates when you finish searching. +;; Searching with isearch-mode.el should work just like isearch.el, +;; except it is done in a temporary minor mode that terminates when +;; you finish searching. -;; For programmed use of isearch-mode, e.g. calling (isearch-forward), -;; isearch-mode behaves modally and does not return until the search -;; is completed. It uses a recursive-edit to behave this way. In -;; that case, you should still be able switch buffers, so be careful -;; not to get things confused. +;; Semi-modal searching is supported, using a recursive edit. If +;; isearching is started non-interactively by calling one of the +;; isearch commands (e.g. (isearch-forward), but not like gnus does +;; it: (call-interactively 'isearch-forward)), isearch-mode does not +;; return until the search is completed. You should still be able +;; switch buffers, so be careful not to get things confused. ;; The key bindings active within isearch-mode are defined below in ;; `isearch-mode-map' which is given bindings close to the default -;; characters of the original isearch.el. With `isearch-mode', +;; characters of isearch.el for version 19. With `isearch-mode', ;; however, you can bind multi-character keys and it should be easier ;; to add new commands. One bug though: keys with meta-prefix cannot ;; be longer than two chars. Also see minibuffer-local-isearch-map @@ -57,18 +63,16 @@ ;; Exiting immediately from isearch uses isearch-edit-string instead ;; of nonincremental-search, if search-nonincremental-instead is non-nil. ;; The name of this option should probably be changed if we decide to -;; keep the behavior. No point in forcing nonincremental search until -;; the last possible moment. +;; keep the behavior. One difference is that isearch-edit-string does +;; not support word search yet; perhaps isearch-mode should support it +;; even for incremental searches, but how? -;; TODO -;; - Integrate generalized command history to isearch-edit-string. -;; - Think about incorporating query-replace. -;; - Hooks and options for failed search. +;;==================================================================== +;;; Change History: -;;; Change Log: - -;; Changes before those recorded in ChangeLog: - +;; Header: /import/kaplan/kaplan/liberte/Isearch/RCS/isearch-mode.el,v 1.3 92/06/29 13:10:08 liberte Exp Locker: liberte +;; Log: isearch-mode.el,v +;; ;; 20-aug-92 Hacked by jwz for Lucid Emacs 19.3. ;; ;; Revision 1.3 92/06/29 13:10:08 liberte @@ -79,7 +83,7 @@ ;; Renamed all regex to regexp. ;; Got rid of found-start and found-point globals. ;; Generalized handling of upper-case chars. - + ;; Revision 1.2 92/05/27 11:33:57 liberte ;; Emacs version 19 has a search ring, which is supported here. ;; Other fixes found in the version 19 isearch are included here. @@ -96,20 +100,38 @@ ;;; Code: +(defgroup isearch nil + "Incremental search" + :prefix "search-" + :group 'matching) + + +(defun isearch-char-to-string (c) + (if (eventp c) + (make-string 1 (event-to-character c nil nil t)) + (make-string 1 c))) + +;(defun isearch-text-char-description (c) +; (isearch-char-to-string c)) + +(define-function 'isearch-text-char-description 'text-char-description) + ;;;========================================================================= ;;; User-accessible variables -(defgroup isearch nil - "Incremental search minor mode." - :prefix "search-" - :group 'matching) +(defvar search-last-string "" + "Last string search for by a search command. +This does not include direct calls to the primitive search functions, +and does not include searches that are aborted.") +(defvar search-last-regexp "" + "Last string searched for by a regexp search command. +This does not include direct calls to the primitive search functions, +and does not include searches that are aborted.") -(defcustom search-exit-option t - "*Non-nil means random control characters terminate incremental search." - :type 'boolean - :group 'isearch) +(defconst search-exit-option t + "Non-nil means random control characters terminate incremental search.") (defcustom search-slow-window-lines 1 "*Number of lines in slow search display windows. @@ -126,70 +148,16 @@ :type 'integer :group 'isearch) -;; We have `search-caps-disable-folding'. -;(defcustom search-upper-case 'not-yanks -; "*If non-nil, upper case chars disable case fold searching. -;That is, upper and lower case chars must match exactly. -;This applies no matter where the chars come from, but does not -;apply to chars in regexps that are prefixed with `\\'. -;If this value is `not-yanks', yanked text is always downcased." -; :type '(choice (const :tag "off" nil) -; (const not-yanks) -; (other :tag "on" t)) -; :group 'isearch) - (defcustom search-nonincremental-instead t - "*If non-nil, do a nonincremental search instead if exiting immediately. -Actually, `isearch-edit-string' is called to let you enter the search -string, and RET terminates editing and does a nonincremental search." + "*If non-nil, do a nonincremental search instead if exiting immediately." :type 'boolean :group 'isearch) - -;; FSF default is "\\s-+", but I think our default is better so I'm -;; leaving it. -(defcustom search-whitespace-regexp "\\(\\s-\\|[\n\r]\\)+" + +(defcustom search-whitespace-regexp "\\(\\s \\|[\n\r]\\)+" "*If non-nil, regular expression to match a sequence of whitespace chars." :type 'regexp :group 'isearch) -(defcustom search-highlight t - "*Whether incremental search and query-replace should highlight -the text that currently matches the search string." - :type 'boolean - :group 'isearch) - -;; I think the name `search-highlight' makes more sense, both because -;; of consistency with other search-* variables above, and because it -;; also applies to query-replace. -(define-obsolete-variable-alias 'isearch-highlight 'search-highlight) - -(defcustom search-invisible 'open - "If t incremental search can match hidden text. -nil means don't match invisible text. -If the value is `open', if the text matched is made invisible by -an overlay having an `invisible' property and that overlay has a property -`isearch-open-invisible', then incremental search will show the contents. -\(This applies when using `outline.el' and `hideshow.el'.)" - :type '(choice (const :tag "Match hidden text" t) - (const :tag "Open overlays" open) - (const :tag "Don't match hidden text" nil)) - :group 'isearch) - -(defcustom isearch-hide-immediately t - "If non-nil, re-hide an invisible match right away. -This variable makes a difference when `search-invisible' is set to `open'. -It means that after search makes some invisible text visible -to show the match, it makes the text invisible again when the match moves. -Ordinarily the text becomes invisible again at the end of the search." - :type 'boolean - :group 'isearch) - -(defvar isearch-mode-hook nil - "Function(s) to call after starting up an incremental search.") - -(defvar isearch-mode-end-hook nil - "Function(s) to call after terminating an incremental search.") - ;;;================================================================== ;;; Search ring. @@ -207,34 +175,22 @@ :type 'integer :group 'isearch) -;; The important difference between pre-20.4-merge yank-pointers and -;; current code is that the yank pointers positions used to be -;; preserved across the isearch sessions. I changed this because I -;; think the FSF code is closer to how the feature is supposed to -;; behave (read: to minibuffer histories.) (defvar search-ring-yank-pointer nil - "Index in `search-ring' of last string reused. -nil if none yet.") + "The tail of the search ring whose car is the last thing searched for.") (defvar regexp-search-ring-yank-pointer nil - "Index in `regexp-search-ring' of last string reused. -nil if none yet.") - -(defcustom search-ring-update nil - "*Non-nil if advancing or retreating in the search ring should cause search. -Default nil means edit the string from the search ring first." - :type 'boolean - :group 'isearch) + "The tail of the regular expression search ring whose car is the last +thing searched for.") ;;;==================================================== ;;; Define isearch-mode keymap. -(defvar isearch-mode-map +(defvar isearch-mode-map (let ((map (make-keymap))) (set-keymap-name map 'isearch-mode-map) ;; Bind all printing characters to `isearch-printing-char'. - ;; This isn't normally necessary, but if a printing character were - ;; bound to something other than self-insert-command in global-map, + ;; This isn't normally necessary, but if a printing character were + ;; bound to something other than self-insert-command in global-map, ;; then it would terminate the search and be executed without this. (let ((i 32) (str (make-string 1 0))) @@ -242,10 +198,7 @@ (aset str 0 i) (define-key map str 'isearch-printing-char) (setq i (1+ i)))) - - ;; Here FSF sets up various kludges to handle local bindings with - ;; meta char prefix keys. We don't need isearch-other-meta-char - ;; because we handle things differently (via pre-command-hook). + (define-key map "\t" 'isearch-printing-char) ;; Several non-printing chars change the searching behavior. ;; @@ -254,29 +207,26 @@ (define-key map "\C-r" 'isearch-repeat-backward) (define-key map "\C-g" 'isearch-abort) - ;; I wish this worked... - ;(define-key map [escape escape escape] 'isearch-cancel) - (define-key map [(meta escape) escape] 'isearch-cancel) - (define-key map "\C-q" 'isearch-quote-char) (define-key map "\C-m" 'isearch-exit) (define-key map "\C-j" 'isearch-printing-char) (define-key map "\t" 'isearch-printing-char) - ;; I prefer our default. - ;(define-key map " " 'isearch-whitespace-chars) - (define-key map "\M- " 'isearch-whitespace-chars) (define-key map "\C-w" 'isearch-yank-word) (define-key map "\C-y" 'isearch-yank-line) (define-key map "\M-y" 'isearch-yank-kill) - ;; Define keys for regexp chars * ? |. - ;; Nothing special for + because it matches at least once. + ;; Define keys for regexp chars * ? | (define-key map "*" 'isearch-*-char) (define-key map "?" 'isearch-*-char) (define-key map "|" 'isearch-|-char) + ;; Some bindings you may want to put in your isearch-mode-hook. + ;; Suggest some alternates... + ;; (define-key map "\C-t" 'isearch-toggle-regexp) + ;; (define-key map "\C-^" 'isearch-edit-string) + ;; delete and backspace delete backward, f1 is help, and C-h can be either (define-key map 'delete 'isearch-delete-char) (define-key map 'backspace 'isearch-delete-char) @@ -286,23 +236,15 @@ (define-key map "\M-n" 'isearch-ring-advance) (define-key map "\M-p" 'isearch-ring-retreat) + (define-key map "\M- " 'isearch-whitespace-chars) (define-key map "\M-\t" 'isearch-complete) - ;; I find this binding somewhat unintuitive, because it doesn't - ;; work if the mouse pointer is over the echo area -- it has to be - ;; over the search window. - (define-key map 'button2 'isearch-yank-selection) + (define-key map 'button2 'isearch-yank-x-selection) map) "Keymap for isearch-mode.") -;; Some bindings you may want to put in your isearch-mode-hook. -;; Suggest some alternates... -;; (define-key isearch-mode-map "\C-t" 'isearch-toggle-case-fold) -;; (define-key isearch-mode-map "\C-t" 'isearch-toggle-regexp) -;; (define-key isearch-mode-map "\C-^" 'isearch-edit-string) - -(defvar minibuffer-local-isearch-map +(defvar minibuffer-local-isearch-map (let ((map (make-sparse-keymap))) ;; #### - this should also be minor-mode-ified (set-keymap-parents map (list minibuffer-local-map)) @@ -312,8 +254,6 @@ (define-key map "\r" 'isearch-nonincremental-exit-minibuffer) (define-key map "\M-n" 'isearch-ring-advance-edit) (define-key map "\M-p" 'isearch-ring-retreat-edit) - (define-key map 'down 'isearch-ring-advance-edit) - (define-key map 'up 'isearch-ring-retreat-edit) (define-key map "\M-\t" 'isearch-complete-edit) (define-key map "\C-s" 'isearch-forward-exit-minibuffer) (define-key map "\C-r" 'isearch-reverse-exit-minibuffer) @@ -322,8 +262,7 @@ ;;;======================================================== ;; Internal variables declared globally for byte-compiler. -;; These are all set with setq while isearching -;; and bound locally while editing the search string. +;; These are all bound locally while editing the search string. (defvar isearch-forward nil) ; Searching in the forward direction. (defvar isearch-regexp nil) ; Searching for a regexp. @@ -335,7 +274,6 @@ (defvar isearch-success t) ; Searching is currently successful. (defvar isearch-invalid-regexp nil) ; Regexp not well formed. -(defvar isearch-within-brackets nil) ; Regexp has unclosed [. (defvar isearch-other-end nil) ; Start (end) of match if forward (backward). (defvar isearch-wrapped nil) ; Searching restarted from the top (bottom). (defvar isearch-barrier 0) @@ -344,12 +282,6 @@ (defvar isearch-case-fold-search nil) -;; Need this for toggling case in isearch-toggle-case-fold. When this -;; is non-nil, the case-sensitiveness of the search is set by the -;; user, and is may no longer be dynamically changed as per -;; search-caps-disable-folding. -(defvar isearch-fixed-case nil) - (defvar isearch-adjusted nil) (defvar isearch-slow-terminal-mode nil) ;;; If t, using a small window. @@ -376,9 +308,12 @@ ;; New value of isearch-forward after isearch-edit-string. (defvar isearch-new-forward nil) -;; Accumulate here the extents unhidden during searching. -(defvar isearch-unhidden-extents nil) ; in FSF: isearch-opened-overlays +(defvar isearch-mode-hook nil + "Function(s) to call after starting up an incremental search.") + +(defvar isearch-mode-end-hook nil + "Function(s) to call after terminating an incremental search.") ;;;============================================================== ;; Minor-mode-alist changes - kind of redundant with the @@ -386,28 +321,21 @@ (add-minor-mode 'isearch-mode 'isearch-mode) -(defvar isearch-mode nil) ;; Name of the minor mode, if non-nil. +(defvar isearch-mode nil) (make-variable-buffer-local 'isearch-mode) -;; We bind these in keydefs.el. -;(define-key global-map "\C-s" 'isearch-forward) -;(define-key global-map "\C-r" 'isearch-backward) -;(define-key global-map "\M-\C-s" 'isearch-forward-regexp) -;(define-key global-map "\M-\C-r" 'isearch-backward-regexp) - ;;;=============================================================== ;;; Entry points to isearch-mode. ;;; These four functions should replace those in loaddefs.el -;;; An alternative is to defalias isearch-forward etc to isearch-mode, -;;; and look at this-command to set the options accordingly. +;;; An alternative is to fset isearch-forward etc to isearch-mode, +;;; and look at the last command to set the options accordingly. -(defun isearch-forward (&optional regexp-p no-recursive-edit) - "\ -Do incremental search forward. +(defun isearch-forward (&optional regexp-p) + "Do incremental search forward. With a prefix argument, do an incremental regular expression search instead. \\ As you type characters, they add to the search string and are found. -The following non-printing keys are bound in `isearch-mode-map'. +The following non-printing keys are bound in `isearch-mode-map'. Type \\[isearch-delete-char] to cancel characters from end of search string. Type \\[isearch-exit] to exit, leaving point at location found. @@ -418,8 +346,6 @@ string and search for it. Type \\[isearch-yank-line] to yank rest of line onto end of search string\ and search for it. -Type \\[isearch-yank-kill] to yank last killed text onto end of search string\ - and search for it. Type \\[isearch-quote-char] to quote control character to search for it. Type \\[isearch-whitespace-chars] to match all whitespace chars in regexp. \\[isearch-abort] while searching or when search has failed cancels input\ @@ -451,38 +377,36 @@ ;; Type \\[isearch-edit-string] to edit the search string in the minibuffer. ;; Terminate editing and return to incremental searching with CR. - (interactive "_P\np") - (isearch-mode t (not (null regexp-p)) nil (not no-recursive-edit))) + (interactive "_P") + (isearch-mode t (not (null regexp-p)) nil (not (interactive-p)))) -(defun isearch-forward-regexp (&optional not-regexp no-recursive-edit) +(defun isearch-forward-regexp () "\ Do incremental search forward for regular expression. -With a prefix argument, do a regular string search instead. Like ordinary incremental search except that your input is treated as a regexp. See \\[isearch-forward] for more info." - (interactive "_P\np") - (isearch-mode t (null not-regexp) nil (not no-recursive-edit))) + (interactive "_") + (isearch-mode t t nil (not (interactive-p)))) -(defun isearch-backward (&optional regexp-p no-recursive-edit) +(defun isearch-backward (&optional regexp-p) "\ Do incremental search backward. -With a prefix argument, do a regular expression search instead. +With a prefix argument, do an incremental regular expression search instead. See \\[isearch-forward] for more information." - (interactive "_P\np") - (isearch-mode nil (not (null regexp-p)) nil (not no-recursive-edit))) + (interactive "_P") + (isearch-mode nil (not (null regexp-p)) nil (not (interactive-p)))) -(defun isearch-backward-regexp (&optional not-regexp no-recursive-edit) +(defun isearch-backward-regexp () "\ Do incremental search backward for regular expression. -With a prefix argument, do a regular string search instead. Like ordinary incremental search except that your input is treated as a regexp. See \\[isearch-forward] for more info." - (interactive "_P\np") - (isearch-mode nil (null not-regexp) nil (not no-recursive-edit))) + (interactive "_") + (isearch-mode nil t nil (not (interactive-p)))) -;; The problem here is that you can't scroll the help screen; as soon -;; as you press a key, it's gone. I don't know of a good way to fix -;; it, though. -hniksic +;; This function is way wrong, because you can't scroll the help +;; screen; as soon as you press a key, it's gone. I don't know of a +;; good way to fix it, though. -hniksic (defun isearch-mode-help () (interactive "_") (let ((w (selected-window))) @@ -496,9 +420,7 @@ ;; All the work is done by the isearch-mode commands. (defun isearch-mode (forward &optional regexp op-fun recursive-edit word-p) - "Start isearch minor mode. Called by `isearch-forward', etc. - -\\{isearch-mode-map}" + "Start isearch minor mode. Called by isearch-forward, etc." (if executing-kbd-macro (setq recursive-edit nil)) @@ -511,7 +433,6 @@ isearch-word word-p isearch-op-fun op-fun isearch-case-fold-search case-fold-search - isearch-fixed-case nil isearch-string "" isearch-message "" isearch-cmds nil @@ -521,7 +442,6 @@ isearch-adjusted nil isearch-yank-flag nil isearch-invalid-regexp nil - isearch-within-brackets nil isearch-slow-terminal-mode (and (<= (device-baud-rate) search-slow-speed) (> (window-height) @@ -531,14 +451,10 @@ isearch-just-started t isearch-opoint (point) - search-ring-yank-pointer nil - regexp-search-ring-yank-pointer nil - isearch-unhidden-extents nil isearch-window-configuration (current-window-configuration) - ;; #### What we really need is a buffer-local - ;; overriding-local-map. See isearch-pre-command-hook for - ;; more details. + ;; #### Should we remember the old value of + ;; overriding-local-map? overriding-local-map (progn (set-keymap-parents isearch-mode-map (nconc (current-minor-mode-maps) @@ -547,6 +463,7 @@ isearch-mode-map) isearch-selected-frame (selected-frame) + isearch-mode (gettext " Isearch") ) ;; XEmacs change: without clearing the match data, sometimes old values @@ -554,10 +471,7 @@ (store-match-data nil) (add-hook 'pre-command-hook 'isearch-pre-command-hook) - - (setq isearch-mode (gettext " Isearch")) - (redraw-modeline) - + (set-buffer-modified-p (buffer-modified-p)) ; update modeline (isearch-push-state) ) ; inhibit-quit is t before here @@ -565,26 +479,26 @@ (isearch-update) (run-hooks 'isearch-mode-hook) - ;; isearch-mode can be made modal (in the sense of not returning to - ;; the calling function until searching is completed) by entering + ;; isearch-mode can be made modal (in the sense of not returning to + ;; the calling function until searching is completed) by entering ;; a recursive-edit and exiting it when done isearching. (if recursive-edit (let ((isearch-recursive-edit t)) (recursive-edit))) - isearch-success) + ) ;;;==================================================== ;; Some high level utilities. Others below. (defun isearch-update () - ;; Called after each command to update the display. - (if (null unread-command-events) + ;; Called after each command to update the display. + (if (null unread-command-event) (progn (if (not (input-pending-p)) (isearch-message)) (if (and isearch-slow-terminal-mode - (not (or isearch-small-window + (not (or isearch-small-window (pos-visible-in-window-p)))) (let ((found-point (point))) (setq isearch-small-window t) @@ -606,24 +520,27 @@ (if (< isearch-other-end (point)) (isearch-highlight isearch-other-end (point)) (isearch-highlight (point) isearch-other-end)) - (isearch-dehighlight)) + (if (extentp isearch-extent) + (isearch-dehighlight nil))) )) (setq ;; quit-flag nil not for isearch-mode isearch-adjusted nil isearch-yank-flag nil) - (isearch-highlight-all-update) ) -(defun isearch-done (&optional nopush edit) +(defun isearch-done () ;; Called by all commands that terminate isearch-mode. (let ((inhibit-quit t)) ; danger danger! (if (and isearch-buffer (buffer-live-p isearch-buffer)) - ;; Some loser process filter might have switched the window's - ;; buffer, so be sure to set these variables back in the - ;; buffer we frobbed them in. But only if the buffer is still - ;; alive. - (with-current-buffer isearch-buffer + (save-excursion + ;; Some loser process filter might have switched the + ;; window's buffer, so be sure to set these variables back + ;; in the buffer we frobbed them in. But only if the buffer + ;; is still alive. + (set-buffer isearch-buffer) + ;; #### Should we restore the old value of + ;; overriding-local-map? (setq overriding-local-map nil) ;; Use remove-hook instead of just setting it to our saved value ;; in case some process filter has created a buffer and modified @@ -632,11 +549,8 @@ (remove-hook 'pre-command-hook 'isearch-pre-command-hook) (set-keymap-parents isearch-mode-map nil) (setq isearch-mode nil) - (redraw-modeline) - (isearch-dehighlight) - (isearch-highlight-all-cleanup) - (isearch-restore-invisible-extents nil nil) - )) + (set-buffer-modified-p (buffer-modified-p));; update modeline + (isearch-dehighlight t))) ;; it's not critical that this be inside inhibit-quit, but leaving ;; things in small-window-mode would be bad. @@ -654,41 +568,37 @@ ;; Maybe should test difference between and set mark iff > threshold. (if (and (buffer-live-p isearch-buffer) (/= (point isearch-buffer) isearch-opoint)) - ;; #### FSF doesn't do this if the region is active. Should - ;; we do the same? (progn (push-mark isearch-opoint t nil isearch-buffer) (or executing-kbd-macro (> (minibuffer-depth) 0) - (display-message 'command "Mark saved where search started"))))) + (display-message 'command "Mark saved where search started")))) + ) (setq isearch-buffer nil) ) ; inhibit-quit is t before here - (if (and (> (length isearch-string) 0) (not nopush)) + (if (> (length isearch-string) 0) ;; Update the ring data. - (isearch-update-ring isearch-string isearch-regexp)) + (if isearch-regexp + (if (not (setq regexp-search-ring-yank-pointer + (member isearch-string regexp-search-ring))) + (progn + (setq regexp-search-ring + (cons isearch-string regexp-search-ring) + regexp-search-ring-yank-pointer regexp-search-ring) + (if (> (length regexp-search-ring) regexp-search-ring-max) + (setcdr (nthcdr (1- regexp-search-ring-max) regexp-search-ring) + nil)))) + (if (not (setq search-ring-yank-pointer + ;; really need equal test instead of eq. + (member isearch-string search-ring))) + (progn + (setq search-ring (cons isearch-string search-ring) + search-ring-yank-pointer search-ring) + (if (> (length search-ring) search-ring-max) + (setcdr (nthcdr (1- search-ring-max) search-ring) nil)))))) (run-hooks 'isearch-mode-end-hook) - - (and (not edit) isearch-recursive-edit (exit-recursive-edit))) - -(defun isearch-update-ring (string &optional regexp) - "Add STRING to the beginning of the search ring. -REGEXP says which ring to use." - (if regexp - (if (or (null regexp-search-ring) - (not (string= string (car regexp-search-ring)))) - (progn - (setq regexp-search-ring - (cons string regexp-search-ring)) - (if (> (length regexp-search-ring) regexp-search-ring-max) - (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) - nil)))) - (if (or (null search-ring) - (not (string= string (car search-ring)))) - (progn - (setq search-ring (cons string search-ring)) - (if (> (length search-ring) search-ring-max) - (setcdr (nthcdr (1- search-ring-max) search-ring) nil)))))) + (if isearch-recursive-edit (exit-recursive-edit))) ;;;==================================================== @@ -697,16 +607,12 @@ (defun isearch-exit () "Exit search normally. However, if this is the first command after starting incremental -search and `search-nonincremental-instead' is non-nil, do a -nonincremental search instead via `isearch-edit-string'." +search and `search-nonincremental-instead' is non-nil, do an +incremental search via `isearch-edit-string'." (interactive) - (if (and search-nonincremental-instead + (if (and search-nonincremental-instead (= 0 (length isearch-string))) - (let ((isearch-nonincremental t) - ;; Highlighting only gets in the way of nonincremental - ;; search. - (search-highlight nil) - (isearch-highlight-all-matches nil)) + (let ((isearch-nonincremental t)) (isearch-edit-string)) (isearch-done))) @@ -715,112 +621,115 @@ "Edit the search string in the minibuffer. The following additional command keys are active while editing. \\ -\\[exit-minibuffer] to resume incremental searching with the edited string. -\\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search. +\\[exit-minibuffer] to exit editing and resume incremental searching. \\[isearch-forward-exit-minibuffer] to resume isearching forward. -\\[isearch-reverse-exit-minibuffer] to resume isearching backward. -\\[isearch-ring-advance-edit] to replace the search string with the next item in the search ring. -\\[isearch-ring-retreat-edit] to replace the search string with the previous item in the search ring. -\\[isearch-complete-edit] to complete the search string using the search ring. -\\ -If first char entered is \\[isearch-yank-word], then do word search instead." +\\[isearch-backward-exit-minibuffer] to resume isearching backward. +\\[isearch-ring-advance-edit] to replace the search string with the next\ + item in the search ring. +\\[isearch-ring-retreat-edit] to replace the search string with the next\ + item in the search ring. +\\[isearch-complete-edit] to complete the search string from the search ring." - ;; This code is very hairy for several reasons, explained in the code. - ;; Mainly, isearch-mode must be terminated while editing and then restarted. - ;; If there were a way to catch any change of buffer from the minibuffer, - ;; this could be simplified greatly. ;; Editing doesn't back up the search point. Should it? (interactive) (condition-case nil - (progn - (let ((isearch-nonincremental isearch-nonincremental) + (let ((minibuffer-local-map minibuffer-local-isearch-map) + isearch-nonincremental ; should search nonincrementally? + isearch-new-string + isearch-new-message + (isearch-new-forward isearch-forward) - ;; Locally bind all isearch global variables to protect them - ;; from recursive isearching. - ;; isearch-string -message and -forward are not bound - ;; so they may be changed. Instead, save the values. - (isearch-new-string isearch-string) - (isearch-new-message isearch-message) - (isearch-new-forward isearch-forward) - (isearch-new-word isearch-word) + ;; Locally bind all isearch global variables to protect them + ;; from recursive isearching. + (isearch-string isearch-string) + (isearch-message isearch-message) + (isearch-forward isearch-forward) ; set by commands below. - (isearch-regexp isearch-regexp) - (isearch-op-fun isearch-op-fun) - (isearch-cmds isearch-cmds) - (isearch-success isearch-success) - (isearch-wrapped isearch-wrapped) - (isearch-barrier isearch-barrier) - (isearch-adjusted isearch-adjusted) - (isearch-fixed-case isearch-fixed-case) - (isearch-yank-flag isearch-yank-flag) - (isearch-invalid-regexp isearch-invalid-regexp) - (isearch-within-brackets isearch-within-brackets) - ;;; Don't bind this. We want isearch-search, below, to set it. - ;;; And the old value won't matter after that. - ;;; (isearch-other-end isearch-other-end) - (isearch-opoint isearch-opoint) - (isearch-slow-terminal-mode isearch-slow-terminal-mode) - (isearch-small-window isearch-small-window) - (isearch-recursive-edit isearch-recursive-edit) - (isearch-window-configuration (current-window-configuration)) - (isearch-selected-frame (selected-frame)) - ) - ;; Actually terminate isearching until editing is done. - ;; This is so that the user can do anything without failure, - ;; like switch buffers and start another isearch, and return. + (isearch-forward isearch-forward) + (isearch-regexp isearch-regexp) + (isearch-word isearch-word) + (isearch-op-fun isearch-op-fun) + (isearch-cmds isearch-cmds) + (isearch-success isearch-success) + (isearch-wrapped isearch-wrapped) + (isearch-barrier isearch-barrier) + (isearch-adjusted isearch-adjusted) + (isearch-yank-flag isearch-yank-flag) + (isearch-invalid-regexp isearch-invalid-regexp) + (isearch-other-end isearch-other-end) + (isearch-opoint isearch-opoint) + (isearch-slow-terminal-mode isearch-slow-terminal-mode) + (isearch-small-window isearch-small-window) + (isearch-recursive-edit isearch-recursive-edit) + (isearch-window-configuration (current-window-configuration)) + (isearch-selected-frame (selected-frame)) + ) + ;; Actually terminate isearching until editing is done. + ;; This is so that the user can do anything without failure, + ;; like switch buffers and start another isearch, and return. ;; (condition-case nil - (isearch-done t t) + (isearch-done) ;;#### What does this mean? There is no such condition! -;; (exit nil)) ; was recursive editing +;; (exit nil)) ; was recursive editing - (unwind-protect - (progn - ;; Fake the prompt message for the sake of - ;; next-command-event below. - (isearch-message) - ;; If the first character the user types when we - ;; prompt them for a string is the yank-word - ;; character, then go into word-search mode. - ;; Otherwise unread that character and read a string - ;; the normal way. - (let* ((cursor-in-echo-area t) - (event (next-command-event))) - (if (eq 'isearch-yank-word - (lookup-key isearch-mode-map (vector event))) - (setq isearch-word t;; so message-prefix is right - isearch-new-word t) - (setq unread-command-event event))) - (setq isearch-new-string - (read-from-minibuffer - (isearch-message-prefix nil isearch-nonincremental) - isearch-string - minibuffer-local-isearch-map - nil - 't ;does its own history (but shouldn't) + (unwind-protect + (let ((prompt (isearch-message-prefix nil t)) + event) + ;; If the first character the user types when we prompt them + ;; for a string is the yank-word character, then go into + ;; word-search mode. Otherwise unread that character and + ;; read a string the normal way. + (let ((cursor-in-echo-area t)) + (display-message 'prompt prompt) + (setq event (next-command-event)) + (if (eq 'isearch-yank-word + (lookup-key isearch-mode-map (vector event))) + (setq isearch-word t) + (setq unread-command-event event))) + (setq isearch-new-string +;; (if (fboundp 'gmhist-old-read-from-minibuffer) +;; ;; Eschew gmhist crockery +;; (gmhist-old-read-from-minibuffer prompt isearch-string) + (read-string + prompt isearch-string + 't ;does its own history (but shouldn't) +;; (if isearch-regexp +;; ;; The search-rings aren't exactly minibuffer +;; ;; histories, but they are close enough +;; (cons 'regexp-search-ring +;; (- (length regexp-search-ring-yank-pointer) +;; (length regexp-search-ring))) +;; (cons 'search-ring +;; (- (length search-ring-yank-pointer) +;; (length search-ring)))) ) - isearch-new-message (mapconcat - 'isearch-text-char-description - isearch-new-string ""))) - ;; Always resume isearching by restarting it. - (isearch-mode isearch-forward - isearch-regexp - isearch-op-fun - isearch-recursive-edit - isearch-word) +;; ) + isearch-new-message (mapconcat + 'isearch-text-char-description + isearch-new-string "")) + ) + ;; Always resume isearching by restarting it. + (isearch-mode isearch-forward + isearch-regexp + isearch-op-fun + isearch-recursive-edit + isearch-word) + ) - ;; Copy new values in outer locals to isearch globals - (setq isearch-string isearch-new-string - isearch-message isearch-new-message - isearch-forward isearch-new-forward - isearch-word isearch-new-word)) + ;; Copy new values in outer locals to isearch globals + (setq isearch-string isearch-new-string + isearch-message isearch-new-message + isearch-forward isearch-new-forward) - ;; Empty isearch-string means use default. - (if (= 0 (length isearch-string)) - (setq isearch-string (or (car (if isearch-regexp - regexp-search-ring - search-ring)) - "")))) + ;; Empty isearch-string means use default. + (if (= 0 (length isearch-string)) + (setq isearch-string (if isearch-regexp search-last-regexp + search-last-string)) + ;; Set last search string now so it is set even if we fail. + (if search-last-regexp + (setq search-last-regexp isearch-string) + (setq search-last-string isearch-string))) ;; Reinvoke the pending search. (isearch-push-state) @@ -847,33 +756,25 @@ (setq isearch-new-forward nil) (exit-minibuffer)) -(defun isearch-cancel () - "Terminate the search and go back to the starting point." - (interactive) - (goto-char isearch-opoint) - (isearch-done t) - (signal 'quit '(isearch))) ; and pass on quit signal (defun isearch-abort () - "Abort incremental search mode if searching is successful, signaling quit. + "Quit incremental search mode if searching is successful, signalling quit. Otherwise, revert to previous successful search and continue searching. -Use `isearch-exit' to quit without signaling." +Use `isearch-exit' to quit without signalling." (interactive) -;; (ding) signal instead below, if quitting +;; (ding) signal instead below, if quiting (discard-input) (if isearch-success ;; If search is successful, move back to starting point ;; and really do quit. (progn (goto-char isearch-opoint) - (setq isearch-success nil) - (isearch-done t) ; exit isearch + (isearch-done) ; exit isearch (signal 'quit '(isearch))) ; and pass on quit signal - ;; If search is failing, or has an incomplete regexp, - ;; rub out until it is once more successful. - (while (or (not isearch-success) isearch-invalid-regexp) - (isearch-pop-state)) + ;; If search is failing, rub out until it is once more successful. + (while (not isearch-success) (isearch-pop-state)) (isearch-update))) + (defun isearch-repeat (direction) ;; Utility for isearch-repeat-forward and -backward. (if (eq isearch-forward (eq direction 'forward)) @@ -882,30 +783,35 @@ ;; If search string is empty, use last one. (setq isearch-string (or (if isearch-regexp - (car regexp-search-ring) - (car search-ring)) + (if regexp-search-ring-yank-pointer + (car regexp-search-ring-yank-pointer) + (car regexp-search-ring)) + (if search-ring-yank-pointer + (car search-ring-yank-pointer) + (car search-ring))) "") isearch-message (mapconcat 'isearch-text-char-description isearch-string "")) ;; If already have what to search for, repeat it. (or isearch-success - (progn + (progn + (goto-char (if isearch-forward (point-min) (point-max))) (setq isearch-wrapped t)))) ;; C-s in reverse or C-r in forward, change direction. (setq isearch-forward (not isearch-forward))) (setq isearch-barrier (point)) ; For subsequent \| if regexp. - (if (equal isearch-string "") (setq isearch-success t) - (if (and isearch-success (equal (match-end 0) (match-beginning 0)) + (if (and (equal (match-end 0) (match-beginning 0)) + isearch-success (not isearch-just-started)) ;; If repeating a search that found ;; an empty string, ensure we advance. (if (if isearch-forward (eobp) (bobp)) - ;; If there's nowhere to advance to, fail (and wrap next time). + ;; nowhere to advance to, so fail (and wrap next time) (progn (setq isearch-success nil) (and executing-kbd-macro @@ -915,7 +821,6 @@ (forward-char (if isearch-forward 1 -1)) (isearch-search)) (isearch-search))) - (isearch-push-state) (isearch-update)) @@ -940,21 +845,18 @@ (defun isearch-toggle-case-fold () "Toggle case folding in searching on or off." (interactive) - (setq isearch-case-fold-search (if isearch-case-fold-search nil 'yes) - isearch-fixed-case t) - (lmessage 'progress "%s%s [case %ssensitive]" - (isearch-message-prefix) - isearch-message - (if isearch-case-fold-search "in" "")) + (setq isearch-case-fold-search + (if isearch-case-fold-search nil 'yes)) + (message "%s%s [case %ssensitive]" + (isearch-message-prefix) + isearch-message + (if isearch-case-fold-search "in" "")) (setq isearch-adjusted t) - ;; Update the highlighting here so that it gets done before the - ;; one-second pause. - (isearch-highlight-all-update) (sit-for 1) (isearch-update)) (defun isearch-delete-char () - "Discard last input item and move point back. + "Discard last input item and move point back. If no previous match was done, just beep." (interactive) (if (null (cdr isearch-cmds)) @@ -974,7 +876,6 @@ (isearch-delete-char) (isearch-mode-help))) -;; This is similar to FSF isearch-yank-string, but more general. (defun isearch-yank (chunk) ;; Helper for isearch-yank-* functions. CHUNK can be a string or a ;; function. @@ -985,7 +886,7 @@ (goto-char isearch-other-end)) (buffer-substring (point) - (progn + (save-excursion (funcall chunk) (point))))))) ;; if configured so that typing upper-case characters turns off case @@ -1003,6 +904,7 @@ isearch-yank-flag t)) (isearch-search-and-update)) + (defun isearch-yank-word () "Pull next word from buffer into search string." (interactive) @@ -1023,34 +925,30 @@ (interactive) (isearch-yank 'forward-sexp)) -(defun isearch-yank-selection () - "Pull the current selection into the search string." +(defun isearch-yank-x-selection () + "Pull the current X selection into the search string." (interactive) - (isearch-yank (get-selection))) + (isearch-yank (x-get-selection))) -(defun isearch-yank-clipboard () - "Pull the current clipboard selection into the search string." +(defun isearch-yank-x-clipboard () + "Pull the current X clipboard selection into the search string." (interactive) - (isearch-yank (get-clipboard))) + (isearch-yank (x-get-clipboard))) (defun isearch-fix-case () - ;; The commented-out (and ...) form implies that, once - ;; isearch-case-fold-search becomes nil due to a capital letter - ;; typed in, it can never be restored to the original value. In - ;; that case, it's impossible to revert a case-sensitive search back - ;; to case-insensitive. - (if ;(and isearch-case-fold-search search-caps-disable-folding) - (and case-fold-search - ;; Make sure isearch-toggle-case-fold works. - (not isearch-fixed-case) - search-caps-disable-folding) - (setq isearch-case-fold-search + (if (and isearch-case-fold-search search-caps-disable-folding) + (setq isearch-case-fold-search (no-upper-case-p isearch-string isearch-regexp))) (setq isearch-mode (if case-fold-search (if isearch-case-fold-search " Isearch" ;As God Intended Mode " ISeARch") ;Warn about evil case via StuDLYcAps. - " Isearch"))) + "Isearch" +; (if isearch-case-fold-search +; " isearch" ;Presumably case-sensitive losers +; ;will notice this 1-char difference. +; " Isearch") ;Weenie mode. + ))) (defun isearch-search-and-update () ;; Do the search and update the display. @@ -1074,17 +972,16 @@ (regexp-quote isearch-string))))) (error nil)) (or isearch-yank-flag - (<= (match-end 0) + (<= (match-end 0) (min isearch-opoint isearch-barrier)))) - (setq isearch-success t + (setq isearch-success t isearch-invalid-regexp nil - isearch-within-brackets nil isearch-other-end (match-end 0)) ;; Not regexp, not reverse, or no match at point. (if (and isearch-other-end (not isearch-adjusted)) (goto-char (if isearch-forward isearch-other-end - (min isearch-opoint - isearch-barrier + (min isearch-opoint + isearch-barrier (1+ isearch-other-end))))) (isearch-search) )) @@ -1094,34 +991,31 @@ ;; *, ?, and | chars can make a regexp more liberal. -;; They can make a regexp match sooner or make it succeed instead of failing. +;; They can make a regexp match sooner +;; or make it succeed instead of failing. ;; So go back to place last successful search started ;; or to the last ^S/^R (barrier), whichever is nearer. -;; + needs no special handling because the string must match at least once. (defun isearch-*-char () "Handle * and ? specially in regexps." (interactive) - (if isearch-regexp - (let ((idx (length isearch-string))) - (while (and (> idx 0) - (eq (aref isearch-string (1- idx)) ?\\)) - (setq idx (1- idx))) - (when (= (mod (- (length isearch-string) idx) 2) 0) - (setq isearch-adjusted t) - ;; Get the isearch-other-end from before the last search. - ;; We want to start from there, - ;; so that we don't retreat farther than that. + (if isearch-regexp + + (progn + (setq isearch-adjusted t) + (let ((cs (nth (if isearch-forward + 5 ; isearch-other-end + 2) ; saved (point) + (car (cdr isearch-cmds))))) ;; (car isearch-cmds) is after last search; ;; (car (cdr isearch-cmds)) is from before it. - (let ((cs (nth 5 (car (cdr isearch-cmds))))) - (setq cs (or cs isearch-barrier)) - (goto-char - (if isearch-forward - (max cs isearch-barrier) - (min cs isearch-barrier))))))) + (setq cs (or cs isearch-barrier)) + (goto-char + (if isearch-forward + (max cs isearch-barrier) + (min cs isearch-barrier)))))) (isearch-process-search-char last-command-event)) - + (defun isearch-|-char () @@ -1133,59 +1027,42 @@ (goto-char isearch-barrier))) (isearch-process-search-char last-command-event)) -;; FSF: -;(defalias 'isearch-other-control-char 'isearch-other-meta-char) -; -;(defun isearch-other-meta-char () -;... -; - (defun isearch-quote-char () "Quote special characters for incremental search." (interactive) - ;; #### Here FSF does some special conversion of chars in 0200-0377 - ;; range. Maybe we should do the same. (isearch-process-search-char (read-quoted-char (isearch-message t)))) + (defun isearch-return-char () "Convert return into newline for incremental search. Obsolete." (interactive) (isearch-process-search-char ?\n)) + (defun isearch-printing-char () - "Add this ordinary printing character to the search string and search." + "Any other printing character => add it to the search string and search." (interactive) - (let ((event last-command-event)) - ;; If we are called by isearch-whitespace-chars because the - ;; context disallows whitespace search (e.g. within brackets), - ;; replace M-SPC with a space. FSF has similar code. - (and (eq this-command 'isearch-whitespace-chars) - (null (event-to-character event)) - (setq event (character-to-event ?\ ))) - (isearch-process-search-char event))) + (isearch-process-search-char last-command-event)) + (defun isearch-whitespace-chars () "Match all whitespace chars, if in regexp mode." - ;; FSF docstring adds: "If you want to search for just a space, type - ;; C-q SPC." But we don't need the addition because we have a - ;; different (better) default for the variable. (interactive) - (if isearch-regexp - (if (and search-whitespace-regexp (not isearch-within-brackets) - (not isearch-invalid-regexp)) - (isearch-process-search-string search-whitespace-regexp " ") - (isearch-printing-char)) - (progn - ;; This way of doing word search doesn't correctly extend current search. - ;; (setq isearch-word t) - ;; (setq isearch-adjusted t) - ;; (goto-char isearch-barrier) - (isearch-printing-char)))) + (if (and isearch-regexp search-whitespace-regexp) + (isearch-process-search-string search-whitespace-regexp " ") + (beep) + (isearch-process-search-char ?\ ) +; (if isearch-word +; nil +; (setq isearch-word t) +; (goto-char isearch-other-end) +; (isearch-process-search-char ?\ )) + )) (defun isearch-process-search-char (char) ;; Append the char to the search string, update the message and re-search. - (isearch-process-search-string (isearch-char-to-string char) + (isearch-process-search-string (isearch-char-to-string char) (isearch-text-char-description char))) (defun isearch-process-search-string (string message) @@ -1197,6 +1074,12 @@ ;;=========================================================== ;; Search Ring +(defcustom search-ring-update nil + "*Non-nil if advancing or retreating in the search ring should cause search. +Default nil means edit the string from the search ring first." + :type 'boolean + :group 'isearch) + (defun isearch-ring-adjust1 (advance) ;; Helper for isearch-ring-adjust (let* ((ring (if isearch-regexp regexp-search-ring search-ring)) @@ -1209,25 +1092,25 @@ () (set yank-pointer-name (setq yank-pointer - (mod (+ (or yank-pointer 0) - (if advance -1 1)) - length))) - (setq isearch-string (nth yank-pointer ring) + (nthcdr (% (+ (- length (length yank-pointer)) + (if advance (1- length) 1)) + length) ring))) + (setq isearch-string (car yank-pointer) isearch-message (mapconcat 'isearch-text-char-description isearch-string ""))))) (defun isearch-ring-adjust (advance) ;; Helper for isearch-ring-advance and isearch-ring-retreat -; (if (cdr isearch-cmds) ;; is there more than one thing on stack? -; (isearch-pop-state)) + (if (cdr isearch-cmds) ;; is there more than one thing on stack? + (isearch-pop-state)) (isearch-ring-adjust1 advance) + (isearch-push-state) (if search-ring-update (progn (isearch-search) (isearch-update)) (isearch-edit-string) - ) - (isearch-push-state)) + )) (defun isearch-ring-advance () "Advance to the next search string in the ring." @@ -1240,59 +1123,30 @@ (interactive) (isearch-ring-adjust nil)) -(defun isearch-ring-advance-edit (n) - "Insert the next element of the search history into the minibuffer." - (interactive "p") - (let* ((yank-pointer-name (if isearch-regexp - 'regexp-search-ring-yank-pointer - 'search-ring-yank-pointer)) - (yank-pointer (eval yank-pointer-name)) - (ring (if isearch-regexp regexp-search-ring search-ring)) - (length (length ring))) - (if (zerop length) - () - (set yank-pointer-name - (setq yank-pointer - (mod (- (or yank-pointer 0) n) - length))) - - (erase-buffer) - (insert (nth yank-pointer ring)) - (goto-char (point-max))))) +(defun isearch-ring-adjust-edit (advance) + "Use the next or previous search string in the ring while in minibuffer." + (isearch-ring-adjust1 advance) + (erase-buffer) + (insert isearch-string)) -(defun isearch-ring-retreat-edit (n) - "Inserts the previous element of the search history into the minibuffer." - (interactive "p") - (isearch-ring-advance-edit (- n))) - -;; Merging note: FSF comments out these functions and implements them -;; differently (see above), presumably because the versions below mess -;; with isearch-string, while what we really want them to do is simply -;; to insert the correct string to the minibuffer. +(defun isearch-ring-advance-edit () + (interactive) + (isearch-ring-adjust-edit 'advance)) -;;(defun isearch-ring-adjust-edit (advance) -;; "Use the next or previous search string in the ring while in minibuffer." -;; (isearch-ring-adjust1 advance) -;; (erase-buffer) -;; (insert isearch-string)) - -;;(defun isearch-ring-advance-edit () -;; (interactive) -;; (isearch-ring-adjust-edit 'advance)) - -;;(defun isearch-ring-retreat-edit () -;; "Retreat to the previous search string in the ring while in the minibuffer." -;; (interactive) -;; (isearch-ring-adjust-edit nil)) +(defun isearch-ring-retreat-edit () + "Retreat to the previous search string in the ring while in the minibuffer." + (interactive) + (isearch-ring-adjust-edit nil)) (defun isearch-complete1 () ;; Helper for isearch-complete and isearch-complete-edit - ;; Return t if completion OK, nil if no completion exists. + ;; Return t if completion OK, (let* ((ring (if isearch-regexp regexp-search-ring search-ring)) (alist (mapcar (function (lambda (string) (list string))) ring)) (completion-ignore-case case-fold-search) - (completion (try-completion isearch-string alist))) + (completion (try-completion isearch-string alist)) + ) (cond ((eq completion t) ;; isearch-string stays the same @@ -1300,14 +1154,12 @@ ((or completion ; not nil, must be a string (= 0 (length isearch-string))) ; shouldn't have to say this (if (equal completion isearch-string) ;; no extension? - (progn - (if completion-auto-help - (with-output-to-temp-buffer "*Isearch completions*" - (display-completion-list - (all-completions isearch-string alist)))) - t) - (and completion - (setq isearch-string completion)))) + (if completion-auto-help + (with-output-to-temp-buffer "*Isearch completions*" + (display-completion-list + (all-completions isearch-string alist)))) + (setq isearch-string completion)) + t) (t (temp-minibuffer-message "No completion") nil)))) @@ -1334,61 +1186,32 @@ ;;;============================================================== -;; The search status stack. +;; The search status stack (and isearch window-local variables, not used). (defun isearch-top-state () +;; (fetch-window-local-variables) (let ((cmd (car isearch-cmds))) - ;; #### Grr, this is so error-prone. If you add something to - ;; isearch-push-state, don't forget to update this. I thought I'd - ;; make a list of variables, and just do (mapcar* #'set vars - ;; values), but the (point) thing would spoil it, leaving to more - ;; complication. (setq isearch-string (car cmd) isearch-message (car (cdr cmd)) isearch-success (nth 3 cmd) isearch-forward (nth 4 cmd) isearch-other-end (nth 5 cmd) - isearch-word (nth 6 cmd) - isearch-invalid-regexp (nth 7 cmd) - isearch-wrapped (nth 8 cmd) - isearch-barrier (nth 9 cmd) - isearch-within-brackets (nth 10 cmd)) + isearch-invalid-regexp (nth 6 cmd) + isearch-wrapped (nth 7 cmd) + isearch-barrier (nth 8 cmd)) (goto-char (car (cdr (cdr cmd)))))) (defun isearch-pop-state () - (pop isearch-cmds) +;; (fetch-window-local-variables) + (setq isearch-cmds (cdr isearch-cmds)) (isearch-top-state) - - ;; Make sure isearch-case-fold-search gets the correct value. FSF - ;; simply stores isearch-case-fold-search to isearch-cmds. We - ;; should probably do the same. - (isearch-fix-case) - - ;; Here, as well as in isearch-search we must deal with the point - ;; landing at an invisible area which may need unhiding. - (if (or (not (eq search-invisible 'open)) - (not isearch-hide-immediately)) - ;; If search-invisible is t, invisible text is just like any - ;; other text. If it is nil, it is always skipped and we can't - ;; land inside. In both cases, we don't need to do anything. - ;; - ;; Similarly, if isearch-hide-immediately is nil, needn't - ;; re-hide the area here, and neither can we land back into a - ;; hidden one. - nil - (when isearch-other-end - ;; This will unhide the extents. - (isearch-range-invisible (point) isearch-other-end)) - (isearch-restore-invisible-extents (point) - (or isearch-other-end (point))))) + ) (defun isearch-push-state () - (setq isearch-cmds + (setq isearch-cmds (cons (list isearch-string isearch-message (point) - isearch-success isearch-forward isearch-other-end - isearch-word - isearch-invalid-regexp isearch-wrapped isearch-barrier - isearch-within-brackets) + isearch-success isearch-forward isearch-other-end + isearch-invalid-regexp isearch-wrapped isearch-barrier) isearch-cmds))) @@ -1399,41 +1222,27 @@ ;; Generate and print the message string. (let ((cursor-in-echo-area ellipsis) (m (concat - (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental) + (isearch-message-prefix c-q-hack) isearch-message - (isearch-message-suffix c-q-hack ellipsis) + (isearch-message-suffix c-q-hack) ))) - (if c-q-hack - m - (display-message 'progress (format "%s" m))))) + (if c-q-hack m (display-message 'progress (format "%s" m))))) -(defun isearch-message-prefix (&optional c-q-hack ellipsis nonincremental) +(defun isearch-message-prefix (&optional c-q-hack nonincremental) ;; If about to search, and previous search regexp was invalid, ;; check that it still is. If it is valid now, ;; let the message we display while searching say that it is valid. - (and isearch-invalid-regexp ellipsis + (and isearch-invalid-regexp (condition-case () (progn (re-search-forward isearch-string (point) t) - (setq isearch-invalid-regexp nil - isearch-within-brackets nil)) + (setq isearch-invalid-regexp nil)) (error nil))) - ;; If currently failing, display no ellipsis. - (or isearch-success (setq ellipsis nil)) - ;; #### - ! Emacs assembles strings all over the place, they can't - ;; all be internationalized in the manner proposed below... Add an - ;; explicit call to `gettext' and have the string snarfer pluck the - ;; english strings out of the comment below. XEmacs is on a - ;; purespace diet! -Stig - - ;; The comment below is dead and buried, but it can be rebuilt if - ;; necessary. -hniksic + ;; #### - Yo! Emacs assembles strings all over the place, they can't all + ;; be internationalized in the manner proposed below... Add an explicit + ;; call to `gettext' and have the string snarfer pluck the english + ;; strings out of the comment below. XEmacs is on a purespace diet! -Stig (let ((m (concat (if isearch-success nil "failing ") - (if (and isearch-wrapped - (if isearch-forward - (> (point) isearch-opoint) - (< (point) isearch-opoint))) - "overwrapped " - (if isearch-wrapped "wrapped ")) + (if isearch-wrapped "wrapped ") (if isearch-word "word ") (if isearch-regexp "regexp ") (if nonincremental "search" "I-search") @@ -1443,12 +1252,14 @@ (aset m 0 (upcase (aref m 0))) (gettext m))) -(defun isearch-message-suffix (&optional c-q-hack ellipsis) +(defun isearch-message-suffix (&optional c-q-hack) (concat (if c-q-hack "^Q" "") (if isearch-invalid-regexp (concat " [" isearch-invalid-regexp "]") ""))) +;;;;; #### - yuck...this is soooo lame. Is this really worth 4k of purespace??? +;;; ;;;(let ((i (logior (if isearch-success 32 0) ;;; (if isearch-wrapped 16 0) ;;; (if isearch-word 8 0) @@ -1457,7 +1268,68 @@ ;;; (if isearch-forward 1 0)))) ;;; (cond ;;; ((= i 63) (gettext "Wrapped word regexp search: ")) ; 111111 -;;; ...and so on, ad nauseam... +;;; ((= i 62) (gettext "Wrapped word regexp search backward: ")) ; 111110 +;;; ((= i 61) (gettext "Wrapped word regexp I-search: ")) ; 111101 +;;; ((= i 60) (gettext "Wrapped word regexp I-search backward: ")) ; 111100 +;;; ((= i 59) (gettext "Wrapped word search: ")) ; 111011 +;;; ((= i 58) (gettext "Wrapped word search backward: ")) ; 111010 +;;; ((= i 57) (gettext "Wrapped word I-search: ")) ; 111001 +;;; ((= i 56) (gettext "Wrapped word I-search backward: ")) ; 111000 +;;; ((= i 55) (gettext "Wrapped regexp search: ")) ; 110111 +;;; ((= i 54) (gettext "Wrapped regexp search backward: ")) ; 110110 +;;; ((= i 53) (gettext "Wrapped regexp I-search: ")) ; 110101 +;;; ((= i 52) (gettext "Wrapped regexp I-search backward: ")) ; 110100 +;;; ((= i 51) (gettext "Wrapped search: ")) ; 110011 +;;; ((= i 50) (gettext "Wrapped search backward: ")) ; 110010 +;;; ((= i 49) (gettext "Wrapped I-search: ")) ; 110001 +;;; ((= i 48) (gettext "Wrapped I-search backward: ")) ; 110000 +;;; ((= i 47) (gettext "Word regexp search: ")) ; 101111 +;;; ((= i 46) (gettext "Word regexp search backward: ")) ; 101110 +;;; ((= i 45) (gettext "Word regexp I-search: ")) ; 101101 +;;; ((= i 44) (gettext "Word regexp I-search backward: ")) ; 101100 +;;; ((= i 43) (gettext "Word search: ")) ; 101011 +;;; ((= i 42) (gettext "Word search backward: ")) ; 101010 +;;; ((= i 41) (gettext "Word I-search: ")) ; 101001 +;;; ((= i 40) (gettext "Word I-search backward: ")) ; 101000 +;;; ((= i 39) (gettext "Regexp search: ")) ; 100111 +;;; ((= i 38) (gettext "Regexp search backward: ")) ; 100110 +;;; ((= i 37) (gettext "Regexp I-search: ")) ; 100101 +;;; ((= i 36) (gettext "Regexp I-search backward: ")) ; 100100 +;;; ((= i 35) (gettext "Search: ")) ; 100011 +;;; ((= i 34) (gettext "Search backward: ")) ; 100010 +;;; ((= i 33) (gettext "I-search: ")) ; 100001 +;;; ((= i 32) (gettext "I-search backward: ")) ; 100000 +;;; ((= i 31) (gettext "Failing wrapped word regexp search: ")) ; 011111 +;;; ((= i 30) (gettext "Failing wrapped word regexp search backward: ")) ; 011110 +;;; ((= i 29) (gettext "Failing wrapped word regexp I-search: ")) ; 011101 +;;; ((= i 28) (gettext "Failing wrapped word regexp I-search backward: ")) ; 011100 +;;; ((= i 27) (gettext "Failing wrapped word search: ")) ; 011011 +;;; ((= i 26) (gettext "Failing wrapped word search backward: ")) ; 011010 +;;; ((= i 25) (gettext "Failing wrapped word I-search: ")) ; 011001 +;;; ((= i 24) (gettext "Failing wrapped word I-search backward: ")) ; 011000 +;;; ((= i 23) (gettext "Failing wrapped regexp search: ")) ; 010111 +;;; ((= i 22) (gettext "Failing wrapped regexp search backward: ")) ; 010110 +;;; ((= i 21) (gettext "Failing wrapped regexp I-search: ")) ; 010101 +;;; ((= i 20) (gettext "Failing wrapped regexp I-search backward: ")) ; 010100 +;;; ((= i 19) (gettext "Failing wrapped search: ")) ; 010011 +;;; ((= i 18) (gettext "Failing wrapped search backward: ")) ; 010010 +;;; ((= i 17) (gettext "Failing wrapped I-search: ")) ; 010001 +;;; ((= i 16) (gettext "Failing wrapped I-search backward: ")) ; 010000 +;;; ((= i 15) (gettext "Failing word regexp search: ")) ; 001111 +;;; ((= i 14) (gettext "Failing word regexp search backward: ")) ; 001110 +;;; ((= i 13) (gettext "Failing word regexp I-search: ")) ; 001101 +;;; ((= i 12) (gettext "Failing word regexp I-search backward: ")) ; 001100 +;;; ((= i 11) (gettext "Failing word search: ")) ; 001011 +;;; ((= i 10) (gettext "Failing word search backward: ")) ; 001010 +;;; ((= i 9) (gettext "Failing word I-search: ")) ; 001001 +;;; ((= i 8) (gettext "Failing word I-search backward: ")) ; 001000 +;;; ((= i 7) (gettext "Failing regexp search: ")) ; 000111 +;;; ((= i 6) (gettext "Failing regexp search backward: ")) ; 000110 +;;; ((= i 5) (gettext "Failing regexp I-search: ")) ; 000101 +;;; ((= i 4) (gettext "Failing regexp I-search backward: ")) ; 000100 +;;; ((= i 3) (gettext "Failing search: ")) ; 000011 +;;; ((= i 2) (gettext "Failing search backward: ")) ; 000010 +;;; ((= i 1) (gettext "Failing I-search: ")) ; 000001 ;;; ((= i 0) (gettext "Failing I-search backward: ")) ; 000000 ;;; (t (error "Something's rotten"))))) @@ -1471,7 +1343,6 @@ (put 'isearch-repeat-backward 'isearch-command t) (put 'isearch-delete-char 'isearch-command t) (put 'isearch-help-or-delete-char 'isearch-command t) -(put 'isearch-cancel 'isearch-command t) (put 'isearch-abort 'isearch-command t) (put 'isearch-quote-char 'isearch-command t) (put 'isearch-exit 'isearch-command t) @@ -1500,8 +1371,6 @@ (put 'isearch-forward-exit-minibuffer 'isearch-command t) (put 'isearch-reverse-exit-minibuffer 'isearch-command t) (put 'isearch-nonincremental-exit-minibuffer 'isearch-command t) -(put 'isearch-yank-selection 'isearch-command t) -(put 'isearch-yank-clipboard 'isearch-command t) (put 'isearch-yank-x-selection 'isearch-command t) (put 'isearch-yank-x-clipboard 'isearch-command t) @@ -1539,24 +1408,11 @@ ;; (cond ((not (eq (current-buffer) isearch-buffer)) ;; If the buffer (likely meaning "frame") has changed, bail. - ;; This can happen if the user types something into another - ;; frame. It can also happen if a proc filter has popped up - ;; another buffer, which is arguably a bad thing for it to - ;; have done, but the way in which isearch would have hosed - ;; you in that case is unarguably even worse. -jwz - (isearch-done) - - ;; `this-command' is set according to the value of - ;; `overriding-local-map', set by isearch-mode. This is - ;; wrong because that keymap makes sense only in isearch - ;; buffer. To make sure the right command is called, adjust - ;; `this-command' to the appropriate value, now that - ;; `isearch-done' has set `overriding-local-map' to nil. - - ;; FSF does similar magic in `isearch-other-meta-char', which - ;; is horribly complex. I *hope* what we do works in all - ;; cases. - (setq this-command (key-binding (this-command-keys)))) + ;; This can also happen if a proc filter has popped up another + ;; buffer, which is arguably a bad thing for it to have done, + ;; but the way in which isearch would have hosed you in that + ;; case is unarguably even worse. -jwz + (isearch-done)) (t (isearch-maybe-frob-keyboard-macros) (if (and this-command @@ -1597,39 +1453,44 @@ ;;;======================================================== ;;; Highlighting +(defcustom isearch-highlight t + "*Whether isearch and query-replace should highlight the text which +currently matches the search-string.") + (defvar isearch-extent nil) -;; this face is initialized by faces.el since isearch is preloaded. -;(make-face 'isearch) +;; this face is initialized by x-faces.el since isearch is preloaded. +;; this face is now created in initialize-faces +;;(make-face 'isearch) (defun isearch-make-extent (begin end) (let ((x (make-extent begin end (current-buffer)))) - ;; make the isearch extent always take precedence over any mouse- + ;; make the isearch extent always take prescedence over any mouse- ;; highlighted extents we may be passing through, since isearch, being ;; modal, is more interesting (there's nothing they could do with a ;; mouse-highlighted extent while in the midst of a search anyway). - (set-extent-priority x (+ mouse-highlight-priority 2)) + (set-extent-priority x (1+ mouse-highlight-priority)) (set-extent-face x 'isearch) (setq isearch-extent x))) (defun isearch-highlight (begin end) - (if (null search-highlight) + (if (null isearch-highlight) nil ;; make sure isearch-extent is in the current buffer - (or (and (extentp isearch-extent) - (extent-live-p isearch-extent)) + (or (extentp isearch-extent) (isearch-make-extent begin end)) (set-extent-endpoints isearch-extent begin end (current-buffer)))) -;; This used to have a TOTALLY flag that also deleted the extent. I -;; don't think this is necessary any longer, as isearch-highlight can -;; simply move the extent to another buffer. The IGNORED argument is -;; for the code that calls this function with an argument. --hniksic -(defun isearch-dehighlight (&optional ignored) - (and search-highlight - (extentp isearch-extent) - (extent-live-p isearch-extent) - (detach-extent isearch-extent))) +(defun isearch-dehighlight (totally) + (if (and isearch-highlight isearch-extent) + (if totally + (let ((inhibit-quit t)) + (if (extentp isearch-extent) + (delete-extent isearch-extent)) + (setq isearch-extent nil)) + (if (extentp isearch-extent) + (detach-extent isearch-extent) + (setq isearch-extent nil))))) ;;;======================================================== @@ -1641,54 +1502,33 @@ (isearch-fix-case) (condition-case lossage (let ((inhibit-quit nil) - (case-fold-search isearch-case-fold-search) - (retry t)) + (case-fold-search isearch-case-fold-search)) (if isearch-regexp (setq isearch-invalid-regexp nil)) - (setq isearch-within-brackets nil) - (while retry - (setq isearch-success - (funcall - (cond (isearch-word - (if isearch-forward - 'word-search-forward 'word-search-backward)) - (isearch-regexp - (if isearch-forward - 're-search-forward 're-search-backward)) - (t - (if isearch-forward 'search-forward 'search-backward))) - isearch-string nil t)) - ;; Clear RETRY unless we matched some invisible text - ;; and we aren't supposed to do that. - (if (or (eq search-invisible t) - (not isearch-success) - (bobp) (eobp) - (= (match-beginning 0) (match-end 0)) - (not (isearch-range-invisible - (match-beginning 0) (match-end 0)))) - (setq retry nil))) + (setq isearch-success + (funcall + (cond (isearch-word + (if isearch-forward + 'word-search-forward 'word-search-backward)) + (isearch-regexp + (if isearch-forward + 're-search-forward 're-search-backward)) + (t + (if isearch-forward 'search-forward 'search-backward))) + isearch-string nil t)) (setq isearch-just-started nil) - (when isearch-success - (setq isearch-other-end - (if isearch-forward (match-beginning 0) (match-end 0))) - (and isearch-hide-immediately - (isearch-restore-invisible-extents (match-beginning 0) - (match-end 0))))) + (if isearch-success + (setq isearch-other-end + (if isearch-forward (match-beginning 0) (match-end 0))))) - (quit (setq unread-command-events (nconc unread-command-events - (character-to-event (quit-char)))) + (quit (setq unread-command-event (character-to-event (quit-char))) (setq isearch-success nil)) - (invalid-regexp + (invalid-regexp (setq isearch-invalid-regexp (car (cdr lossage))) - (setq isearch-within-brackets (string-match "\\`Unmatched \\[" - isearch-invalid-regexp)) (if (string-match "\\`Premature \\|\\`Unmatched \\|\\`Invalid " isearch-invalid-regexp) - (setq isearch-invalid-regexp (gettext "incomplete input")))) - (error - ;; stack overflow in regexp search. - (setq isearch-invalid-regexp (car (cdr lossage))))) + (setq isearch-invalid-regexp (gettext "incomplete input"))))) (if isearch-success nil @@ -1708,79 +1548,59 @@ (ding nil 'isearch-failed)) (goto-char (nth 2 (car isearch-cmds))))) -;; Replaced with isearch-edit-string. -;(defun nonincremental-search (forward regexp) -;... +;;;================================================= +;; This is called from incremental-search +;; if the first input character is the exit character. -(defun isearch-unhide-extent (extent) - ;; Store the values for the `invisible' and `intangible' - ;; properties, and then set them to nil. This way the text hidden - ;; by this extent becomes visible. - (put extent 'isearch-invisible (get extent 'invisible)) - (put extent 'isearch-intangible (get extent 'intangible)) - (put extent 'invisible nil) - (put extent 'intangible nil)) +;; We store the search string in `isearch-string' +;; which has been bound already by `isearch-search' +;; so that, when we exit, it is copied into `search-last-string'. -(defun isearch-range-invisible (beg end) - "Return t if all the text from BEG to END is invisible. -Before that, if search-invisible is `open', unhide the extents with an -`isearch-open-invisible' property." - ;; isearch-search uses this to skip the extents that are invisible, - ;; but don't have `isearch-open-invisible' set. It is unclear - ;; what's supposed to happen if only a part of [BEG, END) overlaps - ;; the extent. - (let (to-be-unhidden) - (if (map-extents - (lambda (extent ignored) - (if (and (<= (extent-start-position extent) beg) - (>= (extent-end-position extent) end)) - ;; All of the region is covered by the extent. - (if (and (eq search-invisible 'open) - (get extent 'isearch-open-invisible)) - (progn - (push extent to-be-unhidden) - nil) ; keep mapping - ;; We can't or won't unhide this extent, so we must - ;; skip the whole match. We return from map-extents - ;; immediately. - t) - ;; Else, keep looking. - nil)) - nil beg end nil 'all-extents-closed 'invisible) - ;; The whole match must be skipped. Signal it by returning t - ;; to the caller. - t - ;; If any extents need to be unhidden, unhide them. - (mapc #'isearch-unhide-extent to-be-unhidden) - ;; Will leave this assert for some time, to catch bugs. - (assert (null (intersection to-be-unhidden isearch-unhidden-extents))) - (setq isearch-unhidden-extents (nconc to-be-unhidden - isearch-unhidden-extents)) - nil))) - -(defun isearch-restore-extent (extent) - (put extent 'invisible (get extent 'isearch-invisible)) - (put extent 'intangible (get extent 'isearch-intangible)) - (remprop extent 'isearch-invisible) - (remprop extent 'isearch-intangible)) - -;; FSF calls this function `isearch-clean-overlays'. -(defun isearch-restore-invisible-extents (beg end) - (cond - ((null beg) - ;; Delete all -- this is called at the end of isearch. - (mapc #'isearch-restore-extent isearch-unhidden-extents) - (setq isearch-unhidden-extents nil)) - (t - ;; Extents that do not overlap the match area can be safely - ;; restored to their hidden state. - (setq isearch-unhidden-extents - (delete-if (lambda (extent) - (unless (extent-in-region-p extent beg end - 'all-extents-closed) - (isearch-restore-extent extent) - t)) - isearch-unhidden-extents))))) +;(defun nonincremental-search (forward regexp) +; ;; This may be broken. Anyway, it is replaced by the isearch-edit-string. +; ;; Missing features: word search option, command history. +; (setq isearch-forward forward +; isearch-regexp regexp) +; (let (char function +; inhibit-quit +; (cursor-in-echo-area t)) +; ;; Prompt assuming not word search, +; (setq isearch-message +; (if isearch-regexp +; (if isearch-forward "Regexp search: " +; "Regexp search backward: ") +; (if isearch-forward "Search: " "Search backward: "))) +; (message "%s" isearch-message) +; ;; Read 1 char and switch to word search if it is ^W. +; (setq char (read-char)) +; (if (eq char search-yank-word-char) +; (setq isearch-message (if isearch-forward "Word search: " +; "Word search backward: ")) +; ;; Otherwise let that 1 char be part of the search string. +; (setq unread-command-event (character-to-event char)) +; ) +; (setq function +; (if (eq char search-yank-word-char) +; (if isearch-forward 'word-search-forward 'word-search-backward) +; (if isearch-regexp +; (if isearch-forward 're-search-forward 're-search-backward) +; (if isearch-forward 'search-forward 'search-backward)))) +; ;; Read the search string with corrected prompt. +; (setq isearch-string (read-string isearch-message isearch-string)) +; ;; Empty means use default. +; (if (= 0 (length isearch-string)) +; (setq isearch-string search-last-string) +; ;; Set last search string now so it is set even if we fail. +; (setq search-last-string isearch-string)) +; ;; Since we used the minibuffer, we should be available for redo. +; (setq command-history +; (cons (list function isearch-string) command-history)) +; ;; Go ahead and search. +; (if search-caps-disable-folding +; (setq isearch-case-fold-search +; (no-upper-case-p isearch-string isearch-regexp))) +; (let ((case-fold-search isearch-case-fold-search)) +; (funcall function isearch-string)))) (defun isearch-no-upper-case-p (string) "Return t if there are no upper case chars in string. @@ -1791,18 +1611,6 @@ (not (string-match "\\(^\\|[^\\]\\)[A-Z]" string)))) (make-obsolete 'isearch-no-upper-case-p 'no-upper-case-p) -;; Portability functions to support various Emacs versions. - -(defun isearch-char-to-string (c) - (if (eventp c) - (make-string 1 (event-to-character c nil nil t)) - (make-string 1 c))) - -;(defun isearch-text-char-description (c) -; (isearch-char-to-string c)) - -(define-function 'isearch-text-char-description 'text-char-description) - ;; Used by etags.el and info.el (defmacro with-caps-disable-folding (string &rest body) "\ Eval BODY with `case-fold-search' let to nil if STRING contains @@ -1816,203 +1624,4 @@ (put 'with-caps-disable-folding 'lisp-indent-function 1) (put 'with-caps-disable-folding 'edebug-form-spec '(form body)) - -;;;======================================================== -;;; Advanced highlighting - -;; When active, *every* visible match for the current search string is -;; highlighted: the current one using the normal isearch match color -;; and all the others using the `isearch-secondary' face. The extra -;; highlighting makes it easier to anticipate where the cursor will -;; land each time you press C-s or C-r to repeat a pending search. -;; Only the matches visible at any point are highlighted -- when you -;; move through the buffer, the highlighting is readjusted. - -;; This is based on ideas from Bob Glickstein's `ishl' package. It -;; has been merged with XEmacs by Darryl Okahata, and then completely -;; rewritten by Hrvoje Niksic. - -;; The code makes the following assumptions about the rest of this -;; file, so be careful when modifying it. - -;; * `isearch-highlight-all-update' should get called when the search -;; string changes, or when the search advances. This is done from -;; `isearch-update'. -;; * `isearch-highlight-all-cleanup' should get called when the search -;; is done. This is performed in `isearch-done'. -;; * `isearch-string' is expected to contain the current search string -;; as entered by the user. -;; * `isearch-opoint' is expected to contain the location where the -;; current search began. -;; * the type of the current search is expected to be given by -;; `isearch-word' and `isearch-regexp'. -;; * the variable `isearch-invalid-regexp' is expected to be true iff -;; `isearch-string' is an invalid regexp. - -(defcustom isearch-highlight-all-matches search-highlight - "*Non-nil means highlight all visible matches." - :type 'boolean - :group 'isearch) - -;; We can't create this face here, as isearch.el is preloaded. -;; #### Think up a better name for this! -;(defface isearch-secondary '((t (:foreground "red3"))) -; "Face to use for highlighting all matches." -; :group 'isearch) - -(defvar isearch-highlight-extents nil) -(defvar isearch-window-start nil) -(defvar isearch-window-end nil) -;; We compare isearch-string and isearch-case-fold-search to saved -;; values for better efficiency. -(defvar isearch-highlight-last-string nil) -(defvar isearch-highlight-last-case-fold-search nil) -(defvar isearch-highlight-last-regexp nil) - -(defun isearch-delete-extents-in-range (start end) - ;; Delete all highlighting extents that overlap [START, END). - (setq isearch-highlight-extents - (delete-if (lambda (extent) - (when (extent-in-region-p extent start end) - (delete-extent extent) - t)) - isearch-highlight-extents))) - -(defun isearch-highlight-all-cleanup () - ;; Stop lazily highlighting and remove extra highlighting from - ;; buffer. - (mapc #'delete-extent isearch-highlight-extents) - (setq isearch-highlight-extents nil) - (setq isearch-window-end nil - isearch-highlight-last-string nil)) - -(defun isearch-highlight-all-update () - ;; Update the highlighting if necessary. This needs to check if the - ;; search string has changed, or if the window has changed position - ;; in the buffer. - (let ((need-start-over nil)) - ;; NB: we don't check for isearch-success because if the point is - ;; after the last match, the search can be unsuccessful, and yet - ;; there are things to highlight. - (cond ((not isearch-highlight-all-matches)) - ((or (equal isearch-string "") - isearch-invalid-regexp) - (isearch-highlight-all-cleanup)) - ((not (eq isearch-case-fold-search - isearch-highlight-last-case-fold-search)) - ;; This case is usually caused by search string being - ;; changed, which would be caught below, but it can also be - ;; tripped using isearch-toggle-case-fold. - (setq need-start-over t)) - ((not (eq isearch-regexp isearch-highlight-last-regexp)) - ;; Ditto for isearch-toggle-regexp. - (setq need-start-over t)) - ((equal isearch-string isearch-highlight-last-string) - ;; The search string is the same. We need to do something - ;; if our position has changed. - - ;; It would be nice if we didn't have to do this; however, - ;; window-start doesn't support a GUARANTEE flag, so we must - ;; force redisplay to get the correct value for start and end - ;; of window. - (sit-for 0) - - ;; Check whether our location has changed. - (let ((start (window-start)) - (end (min (window-end) (point-max)))) - (cond ((and (= start isearch-window-start) - (= end isearch-window-end)) - ;; Our position is unchanged -- do nothing. - ) - ((and (> start isearch-window-start) - (> end isearch-window-end) - (<= start isearch-window-end)) - ;; We've migrated downward, but we overlap the old - ;; region. Delete the old non-overlapping extents - ;; and fill in the rest. - (isearch-delete-extents-in-range isearch-window-start start) - (isearch-highlightify-region isearch-window-end end) - (setq isearch-window-start start - isearch-window-end end)) - ((and (<= start isearch-window-start) - (<= end isearch-window-end) - (> end isearch-window-start)) - ;; We've migrated upward, but we overlap the old - ;; region. Delete the old non-overlapping extents - ;; and fill in the rest. - (isearch-delete-extents-in-range - end isearch-window-end) - (isearch-highlightify-region start isearch-window-start) - (setq isearch-window-start start - isearch-window-end end)) - (t - ;; The regions don't overlap, or they overlap in a - ;; weird way. - (setq need-start-over t))))) - (t - ;; The search string has changed. - - ;; If more input is pending, don't start over because - ;; starting over forces redisplay, and that slows down - ;; typing. - (unless (input-pending-p) - (setq need-start-over t)))) - (when need-start-over - ;; Force redisplay before removing the old extents, in order to - ;; avoid flicker. - (sit-for 0) - (isearch-highlight-all-cleanup) - (setq isearch-window-start (window-start) - isearch-window-end (min (window-end) (point-max))) - (isearch-highlightify-region isearch-window-start isearch-window-end)) - - (setq isearch-highlight-last-string isearch-string - isearch-highlight-last-case-fold-search isearch-case-fold-search - isearch-highlight-last-regexp isearch-regexp))) - -(defun isearch-highlight-advance (string forwardp) - ;; Search ahead for the next or previous match. This is the same as - ;; isearch-search, but without the extra baggage. Maybe it should - ;; be in a separate function. - (let ((case-fold-search isearch-case-fold-search)) - (funcall (cond (isearch-word (if forwardp - 'word-search-forward - 'word-search-backward)) - (isearch-regexp (if forwardp - 're-search-forward - 're-search-backward)) - (t (if forwardp - 'search-forward - 'search-backward))) - string nil t))) - -(defun isearch-highlightify-region (start end) - ;; Highlight all occurrences of isearch-string between START and - ;; END. To do this right, we have to search forward as long as - ;; there are matches that overlap [START, END), and then search - ;; backward the same way. - (save-excursion - (goto-char isearch-opoint) - (let ((lastpoint (point))) - (while (and (isearch-highlight-advance isearch-string t) - (/= lastpoint (point)) - (< (match-beginning 0) end)) - (let ((extent (make-extent (match-beginning 0) - (match-end 0)))) - (set-extent-priority extent (1+ mouse-highlight-priority)) - (put extent 'face 'isearch-secondary) - (push extent isearch-highlight-extents)) - (setq lastpoint (point)))) - (goto-char isearch-opoint) - (let ((lastpoint (point))) - (while (and (isearch-highlight-advance isearch-string nil) - (/= lastpoint (point)) - (>= (match-end 0) start)) - (let ((extent (make-extent (match-beginning 0) - (match-end 0)))) - (set-extent-priority extent (1+ mouse-highlight-priority)) - (put extent 'face 'isearch-secondary) - (push extent isearch-highlight-extents)) - (setq lastpoint (point)))))) - ;;; isearch-mode.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/iso8859-1.el --- a/lisp/iso8859-1.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/iso8859-1.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992, 1997 Free Software Foundation, Inc. -;; Author: Jamie Zawinski +;; Author: Jamie Zawinski ;; Created: 19-aug-92 ;; Maintainer: XEmacs Development Team ;; Keywords: internal, dumped diff -r 12e008d41344 -r 697ef44129c6 lisp/itimer.el --- a/lisp/itimer.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/itimer.el Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,6 @@ (provide 'itimer) -(require 'lisp-float-type) - ;; `itimer' feature means Emacs-Lisp programmers get: ;; itimerp ;; itimer-live-p @@ -48,7 +46,7 @@ ;; ;; See the doc strings of these functions for more information. -(defvar itimer-version "1.09" +(defvar itimer-version "1.07" "Version number of the itimer package.") (defvar itimer-list nil @@ -64,7 +62,7 @@ (defvar itimer-timer-last-wakeup nil "The time the timer driver function last ran.") -(defvar itimer-short-interval 1e-3 +(defvar itimer-short-interval (if (featurep 'lisp-float-type) 1e-3 1) "Interval used for scheduling an event a very short time in the future. Used internally to make the scheduler wake up early. Unit is seconds.") @@ -161,7 +159,7 @@ ;; Functions to access and modify itimer attributes. (defun itimerp (obj) - "Return non-nil if OBJ is an itimer." + "Return t if OBJ is an itimer." (and (consp obj) (eq (length obj) 8))) (defun itimer-live-p (obj) @@ -183,7 +181,7 @@ (defun itimer-restart (itimer) "Return the value to which ITIMER will be set at restart. -The value nil is returned if this itimer isn't set to restart." +Return nil if this itimer doesn't restart." (check-itimer itimer) (nth 2 itimer)) @@ -196,8 +194,8 @@ (defun itimer-is-idle (itimer) "Return non-nil if ITIMER is an idle timer. Normal timers expire after a set interval. Idle timers expire -only after Emacs has been idle for a specific interval. ``Idle'' -means no command events have occurred within the interval." +only after Emacs has been idle for a specific interval. +``Idle'' means no command events occur within the interval." (check-itimer itimer) (nth 4 itimer)) @@ -210,7 +208,7 @@ (defun itimer-function-arguments (itimer) "Return the function arguments of ITIMER as a list. -ITIMER's function is called with these arguments each time ITIMER expires." +ITIMER's function is called with these argument each time ITIMER expires." (check-itimer itimer) (nth 6 itimer)) @@ -304,7 +302,7 @@ (get-itimer (completing-read prompt itimer-list nil 'confirm initial-input))) (defun delete-itimer (itimer) - "Deletes ITIMER. ITIMER may be an itimer or the name of one." + "Delete ITIMER. ITIMER may be an itimer or the name of one." (check-itimer-coerce-string itimer) (setq itimer-list (delq itimer itimer-list))) @@ -329,13 +327,13 @@ must be an integer. Optional fourth arg RESTART non-nil means that this itimer should be restarted automatically after its function is called. Normally an itimer - is deleted at expiration after its function has returned. - If non-nil RESTART should be a number indicating the value at which the - itimer should be set at restart time. + is deleted at expiration after its function has returned. + If non-nil, RESTART should be a number indicating the value at which + the itimer should be set at restart time. Optional fifth arg IS-IDLE specifies if this is an idle timer. Normal timers expire after a set interval. Idle timers expire - only after Emacs has been idle for specific interval. ``Idle'' - means no command events have occurred within the interval. + only after Emacs has been idle for specific interval. + ``Idle'' means no command events occur within the interval. Returns the newly created itimer." (interactive (list (completing-read "Start itimer: " itimer-list) @@ -505,7 +503,7 @@ tab-stop-list '(22 32 40 60 67)) (abbrev-mode 0) (auto-fill-mode 0) - (buffer-disable-undo (current-buffer)) + (buffer-flush-undo (current-buffer)) (use-local-map itimer-edit-map) (set-syntax-table emacs-lisp-mode-syntax-table)) @@ -673,7 +671,7 @@ (inhibit-quit t)) (setq next-wakeup 600) (cond ((and (boundp 'last-command-event-time) - (consp last-command-event-time)) + (consp 'last-command-event-time)) (setq last-event-time last-command-event-time idle-time (itimer-time-difference (current-time) last-event-time))) @@ -714,22 +712,12 @@ (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. - last-event-time next-wakeup - itimer itimers time-elapsed) + (this-command nil)) (if (itimer-uses-arguments current-itimer) (apply (itimer-function current-itimer) (itimer-function-arguments current-itimer)) @@ -849,9 +837,11 @@ secs (+ secs 65536)) (setq carry 0)) (setq 65536-secs (- (nth 0 t1) (nth 0 t2) carry)) - (+ (* 65536-secs 65536.0) + ;; loses for interval larger than the maximum signed Lisp integer. + ;; can't really be helped. + (+ (* 65536-secs 65536) secs - (/ usecs 1000000.0)))) + (/ usecs (if (featurep 'lisp-float-type) 1e6 1000000))))) (defun itimer-timer-driver (&rest ignored) ;; inhibit quit because if the user quits at an inopportune diff -r 12e008d41344 -r 697ef44129c6 lisp/keydefs.el --- a/lisp/keydefs.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/keydefs.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,6 @@ ;;; 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 @@ -107,6 +106,9 @@ (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 @@ -238,7 +240,6 @@ (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) @@ -304,6 +305,9 @@ (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) @@ -385,7 +389,6 @@ ;; 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) @@ -507,73 +510,74 @@ ;; movement by units (define-key global-map 'left 'backward-char-command) +(define-key global-map 'up 'previous-line) (define-key global-map 'right 'forward-char-command) -(define-key global-map 'up 'previous-line) (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) - -;; 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) +;; 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 between windows (define-key global-map '(control tab) 'other-window) @@ -584,33 +588,16 @@ (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) -;; 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) +;; potential R6isms +(define-key global-map 'redo 'repeat-complex-command) (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-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 12e008d41344 -r 697ef44129c6 lisp/ldap.el --- a/lisp/ldap.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/ldap.el Mon Aug 13 11:20:41 2007 +0200 @@ -5,7 +5,7 @@ ;; Author: Oscar Figueiredo ;; Maintainer: Oscar Figueiredo ;; Created: Jan 1998 -;; Version: $Revision: 1.7.2.7 $ +;; Version: $Revision: 1.7.2.4 $ ;; Keywords: help comm ;; This file is part of XEmacs @@ -35,10 +35,6 @@ ;;; 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) @@ -149,315 +145,14 @@ (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 - :group 'ldap) - -(defcustom ldap-default-attribute-decoder nil - "*Decoder function to use for attributes whose syntax is unknown." - :type 'symbol - :group 'ldap) - -(defcustom ldap-coding-system nil - "*Coding system of LDAP string values. -LDAP v3 specifies the coding system of strings to be UTF-8. -Mule support is needed for this." - :type 'symbol - :group 'ldap) - -(defvar ldap-attribute-syntax-encoders - [nil ; 1 ACI Item N - nil ; 2 Access Point Y - nil ; 3 Attribute Type Description Y - nil ; 4 Audio N - nil ; 5 Binary N - nil ; 6 Bit String Y - ldap-encode-boolean ; 7 Boolean Y - nil ; 8 Certificate N - nil ; 9 Certificate List N - nil ; 10 Certificate Pair N - ldap-encode-country-string ; 11 Country String Y - ldap-encode-string ; 12 DN Y - nil ; 13 Data Quality Syntax Y - nil ; 14 Delivery Method Y - ldap-encode-string ; 15 Directory String Y - nil ; 16 DIT Content Rule Description Y - nil ; 17 DIT Structure Rule Description Y - nil ; 18 DL Submit Permission Y - nil ; 19 DSA Quality Syntax Y - nil ; 20 DSE Type Y - nil ; 21 Enhanced Guide Y - nil ; 22 Facsimile Telephone Number Y - nil ; 23 Fax N - nil ; 24 Generalized Time Y - nil ; 25 Guide Y - nil ; 26 IA5 String Y - number-to-string ; 27 INTEGER Y - nil ; 28 JPEG N - nil ; 29 Master And Shadow Access Points Y - nil ; 30 Matching Rule Description Y - nil ; 31 Matching Rule Use Description Y - nil ; 32 Mail Preference Y - nil ; 33 MHS OR Address Y - nil ; 34 Name And Optional UID Y - nil ; 35 Name Form Description Y - nil ; 36 Numeric String Y - nil ; 37 Object Class Description Y - nil ; 38 OID Y - nil ; 39 Other Mailbox Y - nil ; 40 Octet String Y - ldap-encode-address ; 41 Postal Address Y - nil ; 42 Protocol Information Y - nil ; 43 Presentation Address Y - ldap-encode-string ; 44 Printable String Y - nil ; 45 Subtree Specification Y - nil ; 46 Supplier Information Y - nil ; 47 Supplier Or Consumer Y - nil ; 48 Supplier And Consumer Y - nil ; 49 Supported Algorithm N - nil ; 50 Telephone Number Y - nil ; 51 Teletex Terminal Identifier Y - nil ; 52 Telex Number Y - nil ; 53 UTC Time Y - nil ; 54 LDAP Syntax Description Y - nil ; 55 Modify Rights Y - nil ; 56 LDAP Schema Definition Y - nil ; 57 LDAP Schema Description Y - nil ; 58 Substring Assertion Y - ] - "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") - -(defvar ldap-attribute-syntax-decoders - [nil ; 1 ACI Item N - nil ; 2 Access Point Y - nil ; 3 Attribute Type Description Y - nil ; 4 Audio N - nil ; 5 Binary N - nil ; 6 Bit String Y - ldap-decode-boolean ; 7 Boolean Y - nil ; 8 Certificate N - nil ; 9 Certificate List N - nil ; 10 Certificate Pair N - ldap-decode-string ; 11 Country String Y - ldap-decode-string ; 12 DN Y - nil ; 13 Data Quality Syntax Y - nil ; 14 Delivery Method Y - ldap-decode-string ; 15 Directory String Y - nil ; 16 DIT Content Rule Description Y - nil ; 17 DIT Structure Rule Description Y - nil ; 18 DL Submit Permission Y - nil ; 19 DSA Quality Syntax Y - nil ; 20 DSE Type Y - nil ; 21 Enhanced Guide Y - nil ; 22 Facsimile Telephone Number Y - nil ; 23 Fax N - nil ; 24 Generalized Time Y - nil ; 25 Guide Y - nil ; 26 IA5 String Y - string-to-number ; 27 INTEGER Y - nil ; 28 JPEG N - nil ; 29 Master And Shadow Access Points Y - nil ; 30 Matching Rule Description Y - nil ; 31 Matching Rule Use Description Y - nil ; 32 Mail Preference Y - nil ; 33 MHS OR Address Y - nil ; 34 Name And Optional UID Y - nil ; 35 Name Form Description Y - nil ; 36 Numeric String Y - nil ; 37 Object Class Description Y - nil ; 38 OID Y - nil ; 39 Other Mailbox Y - nil ; 40 Octet String Y - ldap-decode-address ; 41 Postal Address Y - nil ; 42 Protocol Information Y - nil ; 43 Presentation Address Y - ldap-decode-string ; 44 Printable String Y - nil ; 45 Subtree Specification Y - nil ; 46 Supplier Information Y - nil ; 47 Supplier Or Consumer Y - nil ; 48 Supplier And Consumer Y - nil ; 49 Supported Algorithm N - nil ; 50 Telephone Number Y - nil ; 51 Teletex Terminal Identifier Y - nil ; 52 Telex Number Y - nil ; 53 UTC Time Y - nil ; 54 LDAP Syntax Description Y - nil ; 55 Modify Rights Y - nil ; 56 LDAP Schema Definition Y - nil ; 57 LDAP Schema Description Y - nil ; 58 Substring Assertion Y - ] - "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") - - -(defvar ldap-attribute-syntaxes-alist - '((createtimestamp . 24) - (modifytimestamp . 24) - (creatorsname . 12) - (modifiersname . 12) - (subschemasubentry . 12) - (attributetypes . 3) - (objectclasses . 37) - (matchingrules . 30) - (matchingruleuse . 31) - (namingcontexts . 12) - (altserver . 26) - (supportedextension . 38) - (supportedcontrol . 38) - (supportedsaslmechanisms . 15) - (supportedldapversion . 27) - (ldapsyntaxes . 16) - (ditstructurerules . 17) - (nameforms . 35) - (ditcontentrules . 16) - (objectclass . 38) - (aliasedobjectname . 12) - (cn . 15) - (sn . 15) - (serialnumber . 44) - (c . 15) - (l . 15) - (st . 15) - (street . 15) - (o . 15) - (ou . 15) - (title . 15) - (description . 15) - (searchguide . 25) - (businesscategory . 15) - (postaladdress . 41) - (postalcode . 15) - (postofficebox . 15) - (physicaldeliveryofficename . 15) - (telephonenumber . 50) - (telexnumber . 52) - (telexterminalidentifier . 51) - (facsimiletelephonenumber . 22) - (x121address . 36) - (internationalisdnnumber . 36) - (registeredaddress . 41) - (destinationindicator . 44) - (preferreddeliverymethod . 14) - (presentationaddress . 43) - (supportedapplicationcontext . 38) - (member . 12) - (owner . 12) - (roleoccupant . 12) - (seealso . 12) - (userpassword . 40) - (usercertificate . 8) - (cacertificate . 8) - (authorityrevocationlist . 9) - (certificaterevocationlist . 9) - (crosscertificatepair . 10) - (name . 15) - (givenname . 15) - (initials . 15) - (generationqualifier . 15) - (x500uniqueidentifier . 6) - (dnqualifier . 44) - (enhancedsearchguide . 21) - (protocolinformation . 42) - (distinguishedname . 12) - (uniquemember . 34) - (houseidentifier . 15) - (supportedalgorithms . 49) - (deltarevocationlist . 9) - (dmdname . 15)) - "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") - - -;; Coding/decoding functions - -(defun ldap-encode-boolean (bool) - (if bool - "TRUE" - "FALSE")) - -(defun ldap-decode-boolean (str) - (cond - ((string-equal str "TRUE") - t) - ((string-equal str "FALSE") - nil) - (t - (error "Wrong LDAP boolean string: %s" str)))) - -(defun ldap-encode-country-string (str) - ;; We should do something useful here... - (if (not (= 2 (length str))) - (error "Invalid country string: %s" str))) - -(defun ldap-decode-string (str) - (if (fboundp 'decode-coding-string) - (decode-coding-string str ldap-coding-system))) - -(defun ldap-encode-string (str) - (if (fboundp 'encode-coding-string) - (encode-coding-string str ldap-coding-system))) - -(defun ldap-decode-address (str) - (mapconcat 'ldap-decode-string - (split-string str "\\$") - "\n")) - -(defun ldap-encode-address (str) - (mapconcat 'ldap-encode-string - (split-string str "\n") - "$")) - - -;; LDAP protocol functions - (defun ldap-get-host-parameter (host parameter) "Get the value of PARAMETER for HOST in `ldap-host-parameters-alist'." (plist-get (cdr (assoc host ldap-host-parameters-alist)) parameter)) -(defun ldap-decode-attribute (attr) - "Decode the attribute/value pair ATTR according to LDAP rules. -The attribute name is looked up in `ldap-attribute-syntaxes-alist' -and the corresponding decoder is then retrieved from -`ldap-attribute-syntax-decoders' and applied on the value(s)." - (let* ((name (car attr)) - (values (cdr attr)) - (syntax-id (cdr (assq (intern (downcase name)) - ldap-attribute-syntaxes-alist))) - decoder) - (if syntax-id - (setq decoder (aref ldap-attribute-syntax-decoders - (1- syntax-id))) - (setq decoder ldap-default-attribute-decoder)) - (if decoder - (cons name (mapcar decoder values)) - attr))) - -(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) +(defun ldap-search (filter &optional host attributes attrsonly withdn) "Perform an LDAP search. -FILTER is the search filter in RFC1558 syntax, i.e., something that +FILTER is the search filter in RFC1558 syntax, i.e. something that looks like \"(cn=John Smith)\". HOST is the LDAP host on which to perform the search. ATTRIBUTES is a list of attributes to retrieve; nil means retrieve all. @@ -472,142 +167,19 @@ entry according to the value of WITHDN." (interactive "sFilter:") (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - ldap - result) - (if ldap-verbose - (message "Opening LDAP connection to %s..." host)) - (setq ldap (ldap-open host host-plist)) - (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)))) - -(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" + (setq host ldap-default-host)) (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)) + (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))) - + (message "Searching with LDAP on %s..." host) + (prog1 (ldap-search-internal ldap filter + (plist-get host-plist 'base) + (plist-get host-plist 'scope) + attributes attrsonly withdn) + (ldap-close ldap)))) (provide 'ldap) diff -r 12e008d41344 -r 697ef44129c6 lisp/lib-complete.el --- a/lisp/lib-complete.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/lib-complete.el Mon Aug 13 11:20:41 2007 +0200 @@ -38,6 +38,7 @@ ;; Last Modified By: Heiko M|nkel ;; Additional XEmacs integration By: Chuck Thompson ;; Last Modified On: Thu Jul 1 14:23:00 1994 +;; RCS Info : $Revision: 1.3.2.2 $ $Locker: $ ;; ======================================================================== ;; NOTE: XEmacs must be redumped if this file is changed. ;; @@ -56,7 +57,6 @@ ;;; ChangeLog: ;; 4/26/97: sb Mule-ize. -;; 6/24/1999 much rewriting from Bob Weiner ;;; Code: @@ -217,6 +217,7 @@ (if tail (setcdr tail nil))))) ;;=== Read a filename, with completion in a search path =================== +(defvar read-library-internal-search-path) (defun read-library-internal (FILE FILTER FLAG) "Don't call this." @@ -254,93 +255,79 @@ (cond ((equal library "") DEFAULT) (FULL (locate-file library read-library-internal-search-path - '(".el" ".el.gz" ".elc"))) + '(".el" ".el.gz" ".elc"))) (t library)))) -(defun read-library-name (prompt) - "PROMPTs for and returns an existing Elisp library name (without any suffix) or the empty string." - (interactive) - (let ((read-library-internal-search-path load-path)) - (completing-read prompt - 'read-library-internal - (lambda (fn) - (cond - ((string-match "\\.el\\(\\.gz\\|\\.Z\\)?$" fn) - (substring fn 0 (match-beginning 0))))) - t nil))) - ;; NOTE: as a special case, read-library may be used to read a filename ;; relative to the current directory, returning a *relative* pathname ;; (read-file-name returns a full pathname). ;; ;; eg. (read-library "Local header: " '(nil) nil) +(defun get-library-path () + "Front end to read-library" + (read-library "Find Library file: " load-path nil t t + (function (lambda (fn) + (cond + ;; decompression doesn't work with mule -slb + ((string-match (if (featurep 'mule) + "\\.el$" + "\\.el\\(\\.gz\\)?$") fn) + (substring fn 0 (match-beginning 0)))))) + )) + ;;=== Replacement for load-library with completion ======================== (defun load-library (library) "Load the library named LIBRARY. This is an interface to the function `load'." (interactive - (list (read-library "Load library: " load-path nil nil nil - (function (lambda (fn) - (cond - ((string-match "\\.elc?$" fn) - (substring fn 0 (match-beginning 0)))))) - ))) + (list (read-library "Load Library: " load-path nil nil nil + (function (lambda (fn) + (cond + ((string-match "\\.elc?$" fn) + (substring fn 0 (match-beginning 0)))))) + ))) (load library)) -;;=== find-library with completion (Author: Bob Weiner) =================== +;;=== find-library with completion (Author: Heiko Muenkel) =================== -(defun find-library (library &optional codesys display-function) - "Find and display in the current window the source for the Elisp LIBRARY. -LIBRARY should be a name without any path information and may include or omit -the \".el\" suffix. Under XEmacs/Mule, the optional second argument CODESYS -specifies the coding system to use when decoding the file. Interactively, -with a prefix argument, this prompts for the coding system. Optional third -argument DISPLAY-FUNCTION must take two arguments, the filename to display -and CODESYS. The default for DISPLAY-FUNCTION is `find-file'." +(defun find-library (library &optional codesys) + "Find and edit the source for the library named LIBRARY. +The extension of the LIBRARY must be omitted. +Under XEmacs/Mule, the optional second argument specifies the +coding system to use when decoding the file. Interactively, +with a prefix argument, you will be prompted for the coding system." (interactive - (list (read-library-name "Find library: ") + (list (get-library-path) (if current-prefix-arg (read-coding-system "Coding System: ")))) - (let ((path (if (or (null library) (equal library "")) - nil - (locate-file library load-path - ;; decompression doesn't work with Mule -slb - (if (featurep 'mule) - ":.el:.elc" - ":.el:.el.gz:.el.Z:.elc"))))) - (if path (funcall (if (fboundp display-function) - display-function 'find-file) - path codesys) - (error "(find-library): Cannot locate library `%s'" library)))) + (find-file library codesys)) (defun find-library-other-window (library &optional codesys) - "Find and display in another window the source for the Elisp LIBRARY. -LIBRARY should be a name without any path information and may include or omit -the \".el\" suffix. Under XEmacs/Mule, the optional second argument CODESYS -specifies the coding system to use when decoding the file. Interactively, -with a prefix argument, this prompts for the coding system." + "Load the library named LIBRARY in another window. +Under XEmacs/Mule, the optional second argument specifies the +coding system to use when decoding the file. Interactively, +with a prefix argument, you will be prompted for the coding system." (interactive - (list (read-library-name "Find library in other window: ") + (list (get-library-path) (if current-prefix-arg - (read-coding-system "Coding System: ")))) - (find-library library codesys 'find-file-other-window)) + (read-coding-system "Coding System: ")))) + (find-file-other-window library codesys)) (defun find-library-other-frame (library &optional codesys) - "Find and display in another frame the source for the Elisp LIBRARY. -LIBRARY should be a name without any path information and may include or omit -the \".el\" suffix. Under XEmacs/Mule, the optional second argument CODESYS -specifies the coding system to use when decoding the file. Interactively, -with a prefix argument, this prompts for the coding system." + "Load the library named LIBRARY in a newly-created frame. +Under XEmacs/Mule, the optional second argument specifies the +coding system to use when decoding the file. Interactively, +with a prefix argument, you will be prompted for the coding system." (interactive - (list (read-library-name "Find library in other frame: ") + (list (get-library-path) (if current-prefix-arg (read-coding-system "Coding System: ")))) - (find-library library codesys 'find-file-other-frame)) + (find-file-other-frame library codesys)) -;; This conflicts with an existing binding. -;;(define-key global-map "\C-xl" 'find-library) +; This conflicts with an existing binding +;(define-key global-map "\C-xl" 'find-library) (define-key global-map "\C-x4l" 'find-library-other-window) (define-key global-map "\C-x5l" 'find-library-other-frame) diff -r 12e008d41344 -r 697ef44129c6 lisp/lisp-mnt.el --- a/lisp/lisp-mnt.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/lisp-mnt.el Mon Aug 13 11:20:41 2007 +0200 @@ -6,7 +6,7 @@ ;; Maintainer: Eric S. Raymond ;; Created: 14 Jul 1992 ;; Keywords: docs, maint -;; X-Modified-by: Bob Weiner , 4/14/95, to support +;; X-Modified-by: Bob Weiner , 4/14/95, to support ;; InfoDock headers. ;; X-Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out! diff -r 12e008d41344 -r 697ef44129c6 lisp/lisp-mode.el --- a/lisp/lisp-mode.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/lisp-mode.el Mon Aug 13 11:20:41 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,6 +32,8 @@ ;; 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 @@ -44,58 +46,55 @@ (defvar lisp-mode-abbrev-table nil) ;; XEmacs change -(defvar lisp-interaction-mode-popup-menu +(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 %_Whole Buffer" eval-current-buffer] - ["Evaluate Re%_gion" eval-region + ["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] - ["%_Instrument This Defun for Debugging" edebug-defun] + ["Evaluate This Defun" eval-defun] + ;; FSF says "Instrument Function for Debugging" + ["Debug This Defun" edebug-defun] "---" - ["Find %_Function Source..." find-function - :active (fboundp 'find-function)] - ["Find %_Variable Source..." find-variable - :active (fboundp 'find-variable)] - ["%_Trace Function..." trace-function-background] - ["%_Untrace All Functions" untrace-all + ["Trace a Function" trace-function-background] + ["Untrace All Functions" untrace-all :active (fboundp 'untrace-all)] "---" - ["%_Comment Out Region" comment-region + ["Comment Out Region" comment-region :active (region-exists-p)] + ["Indent Region" indent-region + :active (region-exists-p)] + ["Indent Line" lisp-indent-line] "---" - ["Indent %_Line or Region" - (if (region-exists-p) - (call-interactively 'indent-region) - (call-interactively 'lisp-indent-line))] - ["Indent B%_alanced Expression" indent-sexp] - ["Indent %_Defun" - (progn - (beginning-of-defun) - (indent-sexp))] - "---" - "Look for debug-on-error under Options->General" + ["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] ))) -(defvar emacs-lisp-mode-popup-menu +(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] - ["B%_yte-Compile/Load This File" emacs-lisp-byte-compile-and-load] - ["Byte-%_Recompile Directory..." byte-recompile-directory] + ["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)))) + (cdr lisp-interaction-mode-popup-menu-1)))) ;Don't have a menubar entry in Lisp Interaction mode. Otherwise, the ;*scratch* buffer has a Lisp menubar item! Very confusing. -;Jan Vroonhof really wants this, so it's back. --ben -(defvar lisp-interaction-mode-menubar-menu - (purecopy (cons "%_Lisp" (cdr lisp-interaction-mode-popup-menu)))) +;(defvar lisp-interaction-mode-menubar-menu +; (purecopy (cons "Lisp" (cdr lisp-interaction-mode-popup-menu)))) -(defvar emacs-lisp-mode-menubar-menu - (purecopy (cons "%_Lisp" (cdr emacs-lisp-mode-popup-menu)))) +(defvar emacs-lisp-mode-menubar-menu nil) +(defvar emacs-lisp-mode-menubar-menu-1 + (purecopy (cons "Lisp" (cdr emacs-lisp-mode-popup-menu-1)))) (if (not emacs-lisp-mode-syntax-table) (let ((i 0)) @@ -275,20 +274,22 @@ (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))) + ;; (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) (lisp-mode-variables nil) (run-hooks 'emacs-lisp-mode-hook)) -(put 'emacs-lisp-mode 'font-lock-lisp-like t) - (defvar lisp-mode-map () "Keymap for ordinary Lisp mode. All commands in `shared-lisp-mode-map' are inherited by this map.") @@ -363,14 +364,15 @@ (use-local-map lisp-interaction-mode-map) (setq major-mode 'lisp-interaction-mode) (setq mode-name "Lisp Interaction") - (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))) + ;; 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) + (set-syntax-table emacs-lisp-mode-syntax-table) (lisp-mode-variables nil) (run-hooks 'lisp-interaction-mode-hook)) @@ -756,7 +758,6 @@ (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 12e008d41344 -r 697ef44129c6 lisp/list-mode.el --- a/lisp/list-mode.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/list-mode.el Mon Aug 13 11:20:41 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, 2000 Ben Wing. +;; Copyright (C) 1996 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -63,32 +63,6 @@ (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) @@ -96,14 +70,14 @@ (use-local-map list-mode-map) (setq mode-name "List") (setq major-mode 'list-mode) - (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) + (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) (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 -;; visible. -- Bob Weiner, 06/20/1999 -; (set-specifier text-cursor-visible-p nil (current-buffer)) + (set-specifier text-cursor-visible-p nil (current-buffer)) (setq buffer-read-only t) (goto-char (point-min)) (run-hooks 'list-mode-hook)) @@ -249,11 +223,8 @@ 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. -When run, the completion buffer is the current buffer.") + "Normal hook run at the end of setting up the text of a completion buffer.") ; Unnecessary FSFmacs crock. We frob the extents directly in ; display-completion-list, so no "heuristics" like this are necessary. @@ -291,9 +262,6 @@ :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 @@ -317,8 +285,7 @@ :reference-buffer (:help-string completion-default-help-string) (:completion-string "Possible completions are:") - :window-width - :window-height) + :window-width) () (let ((old-buffer (current-buffer)) (bufferp (bufferp standard-output))) @@ -345,8 +312,7 @@ (selected-frame))) 80)))) (let ((count 0) - (max-width 0) - old-max-width) + (max-width 0)) ;; Find longest completion (let ((tail completions)) (while tail @@ -367,7 +333,6 @@ 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 @@ -377,15 +342,8 @@ (if (/= (% count cols) 0) ; want ceiling... (1+ (/ count cols)) (/ count cols))))))) - (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)) + (if (stringp cl-completion-string) + (princ (gettext cl-completion-string))) (let ((tail completions) (r 0) (regexp-string @@ -394,7 +352,7 @@ "[ \t]" completion-highlight-first-word-only))) (while (< r rows) - (and (> r 0) (terpri)) + (terpri) (let ((indent 0) (column 0) (tail2 tail)) @@ -464,9 +422,7 @@ ;; (put-text-property beg (point) 'list-mode-item t) ;; (goto-char end))))) )) - (save-excursion - (set-buffer standard-output) - (run-hooks 'completion-setup-hook)))) + (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. @@ -502,23 +458,21 @@ (define-derived-mode completion-list-mode list-mode "Completion List" "Major mode for buffers showing lists of possible completions. -\\{completion-list-mode-map}" +Type \\\\[choose-completion] in the completion list\ + to select the completion near point. +Use \\\\[mouse-choose-completion] to select one\ + with the mouse." (make-local-variable 'completion-base-size) (setq completion-base-size nil)) (let ((map completion-list-mode-map)) - (define-key map 'button2up 'mouse-choose-completion) - (define-key map 'button2 'undefined) - (define-key map "\C-m" 'choose-completion) (define-key map "\e\e\e" 'delete-completion-window) (define-key map "\C-g" 'minibuffer-keyboard-quit) - (define-key map "q" 'completion-list-mode-quit) - (define-key map " " 'completion-switch-to-minibuffer) - ;; [Tab] used to switch to the minibuffer but since [space] does that and - ;; since most applications in the world use [Tab] to select the next item - ;; in a list, do that in the *Completions* buffer too. -- Bob Weiner, - ;; BeOpen.com, 06/23/1999. - (define-key map "\t" 'next-list-mode-item)) + (define-key map "q" 'abort-recursive-edit) + (define-key map " " (lambda () (interactive) + (select-window (minibuffer-window)))) + (define-key map "\t" (lambda () (interactive) + (select-window (minibuffer-window))))) (defvar completion-reference-buffer nil "Record the buffer that was current when the completion list was requested. @@ -532,10 +486,6 @@ If this is nil, it means to compare text to determine which part of the tail end of the buffer's text is involved in completion.") -;; These names are referenced in the doc string for `completion-list-mode'. -(defalias 'choose-completion 'list-mode-item-keyboard-selected) -(defalias 'mouse-choose-completion 'list-mode-item-mouse-selected) - (defun delete-completion-window () "Delete the completion list window. Go to the window from which completion was requested." @@ -545,21 +495,6 @@ (if (get-buffer-window buf) (select-window (get-buffer-window buf))))) -(defun completion-switch-to-minibuffer () - "Move from a completions buffer to the active minibuffer window." - (interactive) - (select-window (minibuffer-window))) - -(defun completion-list-mode-quit () - "Abort any recursive edit and bury the completions buffer." - (interactive) - (condition-case () - (abort-recursive-edit) - (error nil)) - ;; If there was no recursive edit to abort, simply bury the completions - ;; list buffer. - (if (eq major-mode 'completion-list-mode) (bury-buffer))) - (defun completion-do-in-minibuffer () (interactive "_") (save-excursion diff -r 12e008d41344 -r 697ef44129c6 lisp/loaddefs.el --- a/lisp/loaddefs.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/loaddefs.el Mon Aug 13 11:20:41 2007 +0200 @@ -86,23 +86,10 @@ ;; making it more likely you will get a unique match. (setq completion-ignored-extensions (mapcar 'purecopy - ;; 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"))) + '(".o" ".elc" "~" ".bin" ".lbin" ".fasl" + ".dvi" ".toc" ".log" ".aux" ".a" ".ln" + ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot" ".fmt" + ".diff" ".oi" ".class"))) ;; This needs to be redone better. -slb diff -r 12e008d41344 -r 697ef44129c6 lisp/loadhist.el --- a/lisp/loadhist.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/loadhist.el Mon Aug 13 11:20:41 2007 +0200 @@ -123,11 +123,7 @@ (when dependents (error "Loaded libraries %s depend on %s" (prin1-to-string dependents) file)))) - (let* ((flist (feature-symbols feature)) - (file (car flist))) - (flet ((reset-aload (x) - (let ((aload (get x 'autoload))) - (if aload (fset x (cons 'autoload aload)))))) + (let* ((flist (feature-symbols feature)) (file (car flist))) (mapcar #'(lambda (x) (cond ((stringp x) nil) @@ -135,17 +131,12 @@ ;; Remove any feature names that this file provided. (if (eq (car x) 'provide) (setq features (delq (cdr x) features)))) - ((and (boundp x) - (fboundp x)) - (makunbound x) - (fmakunbound x) - (reset-aload x)) - ((boundp x) - (makunbound x)) + ((boundp x) (makunbound x)) ((fboundp x) (fmakunbound x) - (reset-aload x)))) - (cdr flist))) + (let ((aload (get x 'autoload))) + (if aload (fset x (cons 'autoload aload))))))) + (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 12e008d41344 -r 697ef44129c6 lisp/loadup.el --- a/lisp/loadup.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/loadup.el Mon Aug 13 11:20:41 2007 +0200 @@ -45,20 +45,13 @@ (defvar Installation-string nil "Description of XEmacs installation.") -;(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))) +(let ((gc-cons-threshold 30000)) ;; This is awfully damn early to be getting an error, right? (call-with-condition-handler 'really-early-error-handler #'(lambda () - ;; Initialize Installation-string. We do it before loading + ;; Initializa Installation-string. We do it before loading ;; anything so that dumped code can make use of its value. (setq Installation-string (save-current-buffer @@ -72,9 +65,8 @@ (prog1 (buffer-substring) (kill-buffer (current-buffer))))) - (let ((build-root (expand-file-name ".." invocation-directory))) - (setq load-path (list (expand-file-name "lisp" build-root))) - (setq module-load-path (list (expand-file-name "modules" build-root)))) + (setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) + (setq module-load-path (split-path (getenv "EMACSBOOTSTRAPMODULEPATH"))) ;; message not defined yet ... (external-debugging-output (format "\nUsing load-path %s" load-path)) @@ -117,9 +109,7 @@ (if full-path (prog1 (load full-path) - ;; but garbage collection really slows down loading. - (unless (memq 'quick-build internal-error-checking) - (garbage-collect))) + (garbage-collect)) (external-debugging-output (format "\nLoad file %s: not found\n" file)) ;; Uncomment in case of trouble @@ -127,7 +117,7 @@ ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) nil))) - (load (expand-file-name "../lisp/dumped-lisp.el")) + (load (concat default-directory "../lisp/dumped-lisp.el")) (let ((files preloaded-file-list) file) @@ -165,8 +155,7 @@ ;; 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) @@ -203,71 +192,6 @@ ) ;; 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 12e008d41344 -r 697ef44129c6 lisp/make-docfile.el --- a/lisp/make-docfile.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/make-docfile.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1985, 1986, 1992-1995, 1997 Free Software Foundation, Inc. ;; Author: Unknown -;; Maintainer: Steven L Baur +;; Maintainer: Steven L Baur ;; Keywords: internal ;; This file is part of XEmacs. @@ -75,8 +75,7 @@ (setq command-line-args (cdr command-line-args))) ;; Then process the list of Lisp files. -(let ((build-root (expand-file-name ".." invocation-directory))) - (setq load-path (list (expand-file-name "lisp" build-root)))) +(setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) (load "very-early-lisp" nil t) @@ -86,11 +85,13 @@ (load "packages.el") (load "setup-paths.el") (load "dump-paths.el") -(require 'custom) -(load "process") + +(setq + load-path + (nconc load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH")))) (let (preloaded-file-list) - (load (expand-file-name "../lisp/dumped-lisp.el")) + (load (concat default-directory "../lisp/dumped-lisp.el")) (let ((package-preloaded-file-list (packages-collect-package-dumped-lisps late-package-load-path))) diff -r 12e008d41344 -r 697ef44129c6 lisp/map-ynp.el --- a/lisp/map-ynp.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/map-ynp.el Mon Aug 13 11:20:41 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 A%_ll" . exit) - ("%_Cancel" . quit) + ("Yes All" . automatic) + ("No All" . exit) + ("Cancel" . quit) ,@(mapcar #'(lambda (elt) (cons (capitalize (nth 2 elt)) (vector (nth 1 elt)))) @@ -231,8 +231,7 @@ (lambda (elt) (format "%c to %s" (nth 0 elt) - (normalize-menu-item-name - (nth 2 elt))))) + (nth 2 elt)))) action-alist ";\n") (if action-alist ";\n") diff -r 12e008d41344 -r 697ef44129c6 lisp/menubar-items.el --- a/lisp/menubar-items.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/menubar-items.el Mon Aug 13 11:20:41 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, 2000 Ben Wing. -;; Copyright (C) 1997 MORIOKA Tomohiko. +;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1997 MORIOKA Tomohiko ;; Maintainer: XEmacs Development Team ;; Keywords: frames, extensions, internal, dumped @@ -26,27 +26,6 @@ ;; 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 @@ -62,785 +41,341 @@ (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] - ["%_Hex Edit File..." hexl-find-file - :active (fboundp 'hexl-find-file)] - ["%_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] + ["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 So%_me Buffers" save-some-buffers] + ["Save As..." write-file] + ["Save Some Buffers" save-some-buffers] "-----" - ["%_Print Buffer" generic-print-buffer - :active (or (valid-specifier-tag-p 'msprinter) - (and (not (eq system-type 'windows-nt)) - (fboundp 'lpr-buffer))) + ["Print Buffer" lpr-buffer + :active (fboundp 'lpr-buffer) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Prett%_y-Print Buffer" ps-print-buffer-with-faces + ["Pretty-Print Buffer" ps-print-buffer-with-faces :active (fboundp 'ps-print-buffer-with-faces) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] "-----" - ["%_Revert Buffer" revert-buffer + ["New Frame" make-frame] + ["Frame on Other Display..." make-frame-on-display] + ["Delete Frame" delete-frame + :active (not (eq (next-frame (selected-frame) 'nomini 'window-system) + (selected-frame)))] + "-----" + ["Split Window" split-window-vertically] + ["Un-Split (Keep This)" delete-other-windows + :active (not (one-window-p t))] + ["Un-Split (Keep Others)" delete-window + :active (not (one-window-p t))] + "-----" + ["Revert Buffer" revert-buffer :active (or buffer-file-name revert-buffer-function) :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] - ["Re%_cover File..." recover-file] - ["Recover S%_ession..." recover-session] + ["Delete Buffer" kill-this-buffer + :active t + :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] "-----" - ["E%_xit XEmacs" save-buffers-kill-emacs] + ["Exit 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 + "More" "")] + ["Redo" redo :included (fboundp 'redo) :active (not (or (eq buffer-undo-list t) - (eq last-buffer-undo-list nil) - (not (or (eq last-buffer-undo-list buffer-undo-list) - (and (null (car-safe buffer-undo-list)) - (eq last-buffer-undo-list - (cdr-safe buffer-undo-list))))) - (or (eq buffer-undo-list pending-undo-list) - (eq (cdr buffer-undo-list) pending-undo-list)))) + (eq last-buffer-undo-list nil) + (not (or (eq last-buffer-undo-list buffer-undo-list) + (and (null (car-safe buffer-undo-list)) + (eq last-buffer-undo-list + (cdr-safe buffer-undo-list))))) + (or (eq buffer-undo-list pending-undo-list) + (eq (cdr buffer-undo-list) pending-undo-list)))) :suffix (if (eq last-command 'redo) "More" "")] - "----" - ["Cu%_t" kill-primary-selection + ["Cut" kill-primary-selection + :active (selection-owner-p)] + ["Copy" copy-primary-selection :active (selection-owner-p)] - ["%_Copy" copy-primary-selection - :active (selection-owner-p)] - ["%_Paste" yank-clipboard-selection + ["Paste" yank-clipboard-selection :active (selection-exists-p 'CLIPBOARD)] - ["%_Delete" delete-primary-selection + ["Clear" delete-primary-selection :active (selection-owner-p)] "----" - ["Select %_All" mark-whole-buffer] - ["Select %_Page" mark-page] + ["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] "----" - ["%_Search..." make-search-dialog] - ["%_1 Replace..." query-replace] + ["Goto Line..." goto-line] + ["What Line" what-line] + ("Bookmarks" + :filter bookmark-menu-filter) "----" - ["%_2 Search (Regexp)..." isearch-forward-regexp] - ["%_3 Search Backward (Regexp)..." isearch-backward-regexp] - ["%_4 Replace (Regexp)..." query-replace-regexp] + ["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) - '("----" - ("%_Multilingual (\"Mule\")" - ("%_Describe Language Support") - ("%_Set Language Environment") + ,@(when (featurep 'mule) + '(("Mule" + ("Describe language support") + ("Set language environment") "--" - ["T%_oggle Input Method" toggle-input-method] - ["Select %_Input Method" set-input-method] - ["D%_escribe Input Method" describe-input-method] + ["Toggle input method" toggle-input-method] + ["Select input method" select-input-method] + ["Describe input method" describe-input-method] "--" - ["Describe Current %_Coding Systems" + ["Describe current coding 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 Cha%_racter Table" view-charset-by-menu] + ["Show character table" view-charset-by-menu] ;; not implemented yet - ["Show Dia%_gnosis for MULE" mule-diag :active nil] - ["Show \"%_hello\" in Many Languages" view-hello-file])) - ) - ) - - ("%_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))] - "----" - ("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))))] - ) - "----" - ["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)] - ) - - ("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" sort-lines :active (region-exists-p)] - ["%_Paragraphs" sort-paragraphs :active (region-exists-p)] - ["P%_ages" sort-pages :active (region-exists-p)] - ["%_Columns" sort-columns :active (region-exists-p)] - ["%_Regexp..." sort-regexp-fields :active (region-exists-p)] - ) - ("%_Center" - ["%_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] - ) - ) + ["Show diagnosis for MULE" mule-diag :active nil] + ["Show many languages" view-hello-file]))) - ("%_Tools" - ("%_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] - ) - + ("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)] "----" - - ("Ca%_lendar" - ["%_3-Month Calendar" calendar + ["Spell-Check Buffer" ispell-buffer + :active (fboundp 'ispell-buffer)] + ["Toggle VI emulation" toggle-viper-mode + :active (fboundp 'toggle-viper-mode)] + "----" + ("Calendar" + ["3-Month Calendar" calendar :active (fboundp 'calendar)] - ["%_Diary" diary + ["Diary" diary :active (fboundp 'diary)] - ["%_Holidays" holidays + ["Holidays" holidays :active (fboundp 'holidays)] ;; we're all pagans at heart ... - ["%_Phases of the Moon" phases-of-moon + ["Phases of the Moon" phases-of-moon :active (fboundp 'phases-of-moon)] - ["%_Sunrise/Sunset" sunrise-sunset + ["Sunrise/Sunset" sunrise-sunset :active (fboundp 'sunrise-sunset)]) - ("Ga%_mes" - ["%_Mine Game" xmine + ("Games" + ["Mine Game" xmine :active (fboundp 'xmine)] - ["%_Tetris" tetris + ["Tetris" tetris :active (fboundp 'tetris)] - ["%_Sokoban" sokoban + ["Sokoban" sokoban :active (fboundp 'sokoban)] - ["Quote from %_Zippy" yow + ["Quote from Zippy" yow :active (fboundp 'yow)] - ["%_Psychoanalyst" doctor + ["Psychoanalyst" doctor :active (fboundp 'doctor)] - ["Ps%_ychoanalyze Zippy!" psychoanalyze-pinhead + ["Psychoanalyze Zippy!" psychoanalyze-pinhead :active (fboundp 'psychoanalyze-pinhead)] - ["%_Random Flames" flame + ["Random Flames" flame :active (fboundp 'flame)] - ["%_Dunnet (Adventure)" dunnet + ["Dunnet (Adventure)" dunnet :active (fboundp 'dunnet)] - ["Towers of %_Hanoi" hanoi + ["Towers of Hanoi" hanoi :active (fboundp 'hanoi)] - ["Game of %_Life" life + ["Game of Life" life :active (fboundp 'life)] - ["M%_ultiplication Puzzle" mpuz - :active (fboundp 'mpuz)]) + ["Multiplication Puzzle" mpuz + :active (fboundp 'mpuz)])) - "----" - ) + ("Options" + ("Customize" + ("Emacs" :filter (lambda (&rest junk) + (cdr (custom-menu-create 'emacs)))) + ["Group..." customize-group] + ["Variable..." customize-variable] + ["Face..." customize-face] + ["Saved..." customize-saved] + ["Set..." customize-customized] + ["Apropos..." customize-apropos] + ["Browse..." customize-browse]) - ("%_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]) - ("Manage %_Packages" - ("%_Add Download Site" + ("Manage Packages" + ("Add Download Site" :filter (lambda (&rest junk) - (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 + (package-get-download-menu))) + ["Update Package Index" package-get-update-base] + ["List & Install" pui-list-packages] + ["Update Installed Packages" package-get-update-all] + ;; hack-o-matic, we can't force a laod of package-base here ;; since it triggers dialog box interactions which we can't - ;; deal with while using a menu - ("Using %_Custom" + ;; deal while using a menu + ("Using Custom" :filter (lambda (&rest junk) (if package-get-base - (submenu-generate-accelerator-spec - (cdr (custom-menu-create 'packages))) - '(["Please load Package Index" - (lamda (&rest junk) ()) nil])))) + (cdr (custom-menu-create 'packages)) + '(["Please load Package Index" (lamda (&rest junk) ()) nil])))) - ["%_Help" (Info-goto-node "(xemacs)Packages")]) + ["Help" (Info-goto-node "(xemacs)Packages")]) + "---" - ("%_Keyboard and Mouse" - ["%_Abbrev Mode" - (customize-set-variable 'abbrev-mode - (not (default-value 'abbrev-mode))) - :style toggle - :selected (default-value 'abbrev-mode)] - ["%_Delete Key Deletes Selection" + + ("Editing Options" + ["Overstrike" + (progn + (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual)) + (customize-set-variable 'overwrite-mode overwrite-mode)) + :style toggle :selected overwrite-mode] + ["Case Sensitive Search" + (customize-set-variable 'case-fold-search + (setq case-fold-search (not case-fold-search))) + :style toggle :selected (not case-fold-search)] + ["Case Matching Replace" + (customize-set-variable 'case-replace (not case-replace)) + :style toggle :selected case-replace] + ["Auto Delete Selection" (customize-set-variable 'pending-delete-mode (not pending-delete-mode)) :style toggle :selected (and (boundp 'pending-delete-mode) pending-delete-mode) :active (boundp 'pending-delete-mode)] - ["%_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] - ("`%_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)] - ["Active Re%_gions" + ["Active Regions" (customize-set-variable 'zmacs-regions (not zmacs-regions)) :style toggle :selected zmacs-regions] - "----" - ["%_Set Key..." global-set-key] - ["%_Unset Key..." global-unset-key] - "---" - ["%_Case Sensitive Search" - (customize-set-variable 'case-fold-search - (setq case-fold-search (not case-fold-search))) - :style toggle :selected (not case-fold-search)] - ["Case Matching %_Replace" - (customize-set-variable 'case-replace (not case-replace)) - :style toggle :selected case-replace] - "---" - ("%_Newline at End of File..." - ["%_Don't Require" + ["Mouse Paste At Text Cursor" + (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) + :style toggle :selected mouse-yank-at-point] + ("Newline at end of file..." + ["Don't require" (customize-set-variable 'require-final-newline nil) :style radio :selected (not require-final-newline)] - ["%_Require" + ["Require" (customize-set-variable 'require-final-newline t) :style radio :selected (eq require-final-newline t)] - ["%_Ask" + ["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" + ["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] - "---" - ["%_Mouse Paste at Text Cursor" - (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point)) - :style toggle :selected mouse-yank-at-point] - ["A%_void 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))] ) - ("%_General" - ["This Buffer %_Read Only" (toggle-read-only) - :style toggle :selected buffer-read-only] - ["%_Teach Extended Commands" + ("General Options" + ["Teach Extended Commands" (customize-set-variable 'teach-extended-commands-p (not teach-extended-commands-p)) :style toggle :selected teach-extended-commands-p] - ["Debug on %_Error" + ["Debug On Error" (customize-set-variable 'debug-on-error (not debug-on-error)) :style toggle :selected debug-on-error] - ["Debug on %_Quit" + ["Debug On Quit" (customize-set-variable 'debug-on-quit (not debug-on-quit)) :style toggle :selected debug-on-quit] - ["Debug on %_Signal" - (customize-set-variable 'debug-on-signal (not debug-on-signal)) - :style toggle :selected debug-on-signal] ) - - ("%_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'..." + ("Printing Options" + ["Command-Line Switches for `lpr'/`lp'..." ;; better to directly open a customization buffer, since the value ;; must be a list of strings, which is somewhat complex to prompt for. (customize-variable 'lpr-switches) (boundp 'lpr-switches)] - ("%_Pretty-Print Paper Size" - ["%_Letter" + ("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)] - ["Lette%_r-Small" + ["Letter-small" (customize-set-variable 'ps-paper-type 'letter-small) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter-small)) :active (boundp 'ps-paper-type)] - ["Le%_gal" + ["Legal" (customize-set-variable 'ps-paper-type 'legal) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal)) :active (boundp 'ps-paper-type)] - ["%_Statement" + ["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)] - ["Le%_dger" + ["Ledger" (customize-set-variable 'ps-paper-type 'ledger) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger)) :active (boundp 'ps-paper-type)] - ["A%_3" + ["A3" (customize-set-variable 'ps-paper-type 'a3) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3)) :active (boundp 'ps-paper-type)] - ["%_A4" + ["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)] - ["A4s%_mall" + ["A4small" (customize-set-variable 'ps-paper-type 'a4small) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small)) :active (boundp 'ps-paper-type)] - ["B%_4" + ["B4" (customize-set-variable 'ps-paper-type 'b4) :style radio :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4)) :active (boundp 'ps-paper-type)] - ["%_B5" + ["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. + ;; I'm wondering whether all this muck is usefull. (and (boundp 'original-face-background) original-face-background (set-face-background 'default original-face-background))) @@ -852,387 +387,67 @@ :style toggle :selected (and (boundp 'ps-print-color-p) ps-print-color-p) :active (boundp 'ps-print-color-p)]) - ("%_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..." + ("\"Other Window\" Location" + ["Always in Same Frame" (customize-set-variable - '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 '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))] - )) - - - "-----" - ("Display" - ,@(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)] - "-----" - ["Bl%_ock Cursor" - (progn - (customize-set-variable 'bar-cursor nil) - (force-cursor-redisplay)) + '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 (null bar-cursor)] - ["Bar Cursor (%_1 Pixel)" - (progn - (customize-set-variable 'bar-cursor t) - (force-cursor-redisplay)) + :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 bar-cursor t)] - ["Bar Cursor (%_2 Pixels)" - (progn - (customize-set-variable 'bar-cursor 2) - (force-cursor-redisplay)) + :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 (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] - - ("\"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)) + :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 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)] + :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t)) + :active (boundp 'gnuserv-frame)] ) - ,@(if (featurep 'toolbar) - '(("%_Toolbars" - ["%_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) - '(("G%_utters" - ["Buffers 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 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)] - ) - ))) "-----" - ("S%_yntax Highlighting" - ["%_In This Buffer" - (progn;; becomes buffer local + ("Syntax Highlighting" + ["In This Buffer" + (progn ;; becomes buffer local (font-lock-mode) (customize-set-variable 'font-lock-mode font-lock-mode)) :style toggle :selected (and (boundp 'font-lock-mode) font-lock-mode) :active (boundp 'font-lock-mode)] - ["%_Automatic" + ["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" + ["Fonts" (progn (require 'font-lock) (font-lock-use-default-fonts) @@ -1242,7 +457,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) @@ -1253,7 +468,7 @@ :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors) :active (boundp 'font-lock-mode)] "-----" - ["%_Least" + ["Least" (progn (require 'font-lock) (if (or (and (not (integerp font-lock-maximum-decoration)) @@ -1270,7 +485,7 @@ (not (eq t font-lock-maximum-decoration))) (and (integerp font-lock-maximum-decoration) (<= font-lock-maximum-decoration 0))))] - ["M%_ore" + ["More" (progn (require 'font-lock) (if (and (integerp font-lock-maximum-decoration) @@ -1283,7 +498,7 @@ :selected (and (boundp 'font-lock-maximium-decoration) (integerp font-lock-maximum-decoration) (= 1 font-lock-maximum-decoration))] - ["%_Even More" + ["Even More" (progn (require 'font-lock) (if (and (integerp font-lock-maximum-decoration) @@ -1296,7 +511,7 @@ :selected (and (boundp 'font-lock-maximum-decoration) (integerp font-lock-maximum-decoration) (= 2 font-lock-maximum-decoration))] - ["%_Most" + ["Most" (progn (require 'font-lock) (if (or (eq font-lock-maximum-decoration t) @@ -1312,8 +527,8 @@ (and (integerp font-lock-maximum-decoration) (>= font-lock-maximum-decoration 3))))] "-----" - ["La%_zy" - (progn;; becomes buffer local + ["Lazy" + (progn ;; becomes buffer local (lazy-shot-mode) (customize-set-variable 'lazy-shot-mode lazy-shot-mode) ;; this shouldn't be necessary so there has to @@ -1324,8 +539,8 @@ font-lock-mode) :style toggle :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)] - ["Cac%_hing" - (progn;; becomes buffer local + ["Caching" + (progn ;; becomes buffer local (fast-lock-mode) (customize-set-variable 'fast-lock-mode fast-lock-mode) ;; this shouldn't be necessary so there has to @@ -1337,134 +552,426 @@ :style toggle :selected (and (boundp 'fast-lock-mode) fast-lock-mode)] ) - ("Pa%_ren Highlighting" - ["%_None" + ("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" + ["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" + ["Steady Paren" (customize-set-variable 'paren-mode 'paren) :style radio :selected (and (boundp 'paren-mode) (eq paren-mode 'paren)) :active (boundp 'paren-mode)] - ["%_Expression" + ["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)] +;; ["Nested Shading" +;; (customize-set-variable 'paren-mode 'nested) +;; :style radio +;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested)) +;; :active (boundp 'paren-mode)] ) "-----" - ["Edit Fa%_ces..." (customize-face nil)] - ("Fo%_nt" :filter font-menu-family-constructor) - ("Si%_ze" :filter font-menu-size-constructor) - ;; ("Weig%_ht" :filter font-menu-weight-constructor) + ("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)] + ) + ))) + ("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 Init (.emacs) 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 "~/.emacs")) - (or (eq major-mode 'emacs-lisp-mode) - (emacs-lisp-mode)))] - ["%_Save Options to .emacs 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) "")] - "----" + ["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] ) - nil ; the partition: menus after this are flushright + ("Buffers" + :filter buffers-menu-filter + ["Read Only" (toggle-read-only) + :style toggle :selected buffer-read-only] + ["List All Buffers" list-buffers] + "--" + ) - ("%_Help" - ["%_About XEmacs..." about-xemacs] - "-----" - ["XEmacs %_News" view-emacs-news] - ["%_Obtaining XEmacs" describe-distribution] + ("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)] "-----" - ("%_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 (boundp 'browse-url-browser-function)] - ["%_Home Page" xemacs-www-page - :active (boundp 'browse-url-browser-function)]) - ("%_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] + ("Tags" + ["Find Tag..." find-tag] + ["Find Other Window..." find-tag-other-window] + ["Next Tag..." (find-tag nil)] + ["Next Other Window..." (find-tag-other-window nil)] + ["Next File" next-file] + "-----" + ["Tags Search..." tags-search] + ["Tags Replace..." tags-query-replace] + ["Continue Search/Replace" tags-loop-continue] + "-----" + ["Pop stack" pop-tag-mark] + ["Apropos..." tags-apropos] "-----" - ["%_Key..." describe-key] - ["%_Bindings" describe-bindings] - ["%_Mouse Bindings" describe-pointer] - ["%_Recent Keys" view-lossage] - "-----" - ["%_Function..." describe-function] - ["%_Variable..." describe-variable] - ["%_Locate Command..." where-is]) + ["Set Tags Table File..." visit-tags-table] + )) + + nil ; the partition: menus after this are flushright + + ("Help" + ["About XEmacs..." about-xemacs] + ("Basics" + ["Installation" describe-installation + :active (boundp 'Installation-string)] + ;; Tutorials. + ,(if (featurep 'mule) + ;; Mule tutorials. + (let ((lang language-info-alist) + submenu tut) + (while lang + (and (setq tut (assq 'tutorial (car lang))) + (not (string= (caar lang) "ASCII")) + (setq + submenu + (cons + `[,(caar lang) (help-with-tutorial nil ,(cdr tut))] + submenu))) + (setq lang (cdr lang))) + (append `("Tutorials" + :filter tutorials-menu-filter + ["Default" help-with-tutorial t + ,(concat "(" current-language-environment ")")]) + submenu)) + ;; Non mule tutorials. + (let ((lang tutorial-supported-languages) + submenu) + (while lang + (setq submenu + (cons + `[,(caar lang) + (help-with-tutorial ,(format "TUTORIAL.%s" + (cadr (car lang))))] + submenu)) + (setq lang (cdr lang))) + (append '("Tutorials" + ["English" help-with-tutorial]) + submenu))) + ["News" view-emacs-news] + ["Packages" finder-by-keyword] + ["Splash" xemacs-splash-buffer]) "-----" - ["%_Recent Messages" view-lossage] - ("%_Misc" - ["%_Current Installation Info" describe-installation - :active (boundp 'Installation-string)] - ["%_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)])))) + ("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])))) (defun maybe-add-init-button () "Don't call this. Adds `Load .emacs' button to menubar when starting up with -q." - (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"))) + ;; by Stig@hackvan.com + (cond + (init-file-user nil) + ((file-exists-p (expand-file-name ".emacs" "~")) + (add-menu-button nil + ["Load .emacs" + (progn (delete-menu-item '("Load .emacs")) + (load-user-init-file (user-login-name))) + ] + "Help")) + (t nil))) (add-hook 'before-init-hook 'maybe-add-init-button) @@ -1481,34 +988,34 @@ 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 + ["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 L%_ocation" bookmark-menu-locate + ["Insert location" 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] + ["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 @@ -1517,8 +1024,6 @@ "Customization of `Buffers' menu." :group 'menu) -(defvar buffers-menu-omit-chars-list '(?b ?p ?l)) - (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 @@ -1564,22 +1069,11 @@ :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 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." + "*The function to call to return a string to represent a buffer in the +buffers menu. The function is passed a buffer and should return a string. +The default value `format-buffers-menu-line' just returns the name of +the buffer. Also check out `slow-format-buffers-menu-line' which +returns a whole bunch of info about a buffer." :type 'function :group 'buffers-menu) @@ -1587,7 +1081,7 @@ 'sort-buffers-menu-by-mode-then-alphabetically "*If non-nil, a function to sort the list of buffers in the buffers menu. It will be passed two arguments (two buffers to compare) and should return -t if the first is \"less\" than the second. One possible value is +T if the first is \"less\" than the second. One possible value is `sort-buffers-menu-alphabetically'; another is `sort-buffers-menu-by-mode-then-alphabetically'." :type '(choice (const :tag "None" nil) @@ -1610,22 +1104,22 @@ function) :group 'buffers-menu) +(defun buffers-menu-omit-invisible-buffers (buf) + "For use as a value of `buffers-menu-omit-function'. +Omits normally invisible buffers (those whose name begins with a space)." + (not (null (string-match "\\` " (buffer-name buf))))) + (defun sort-buffers-menu-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-sort-function'. Sorts the buffers in alphabetical order by name, but puts buffers beginning with a star at the end of the list." (let* ((nam1 (buffer-name buf1)) (nam2 (buffer-name buf2)) - (inv1p (not (null (string-match "\\` " nam1)))) - (inv2p (not (null (string-match "\\` " nam2)))) (star1p (not (null (string-match "\\`*" nam1)))) (star2p (not (null (string-match "\\`*" nam2))))) - (cond ((not (eq inv1p inv2p)) - (not inv1p)) - ((not (eq star1p star2p)) - (not star1p)) - (t - (string-lessp nam1 nam2))))) + (if (not (eq star1p star2p)) + (not star1p) + (string-lessp nam1 nam2)))) (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-sort-function'. @@ -1633,44 +1127,32 @@ beginning with a star at the end of the list." (let* ((nam1 (buffer-name buf1)) (nam2 (buffer-name buf2)) - (inv1p (not (null (string-match "\\` " nam1)))) - (inv2p (not (null (string-match "\\` " nam2)))) (star1p (not (null (string-match "\\`*" nam1)))) (star2p (not (null (string-match "\\`*" nam2)))) (mode1 (symbol-value-in-buffer 'major-mode buf1)) (mode2 (symbol-value-in-buffer 'major-mode buf2))) - (cond ((not (eq inv1p inv2p)) - (not inv1p)) - ((not (eq star1p star2p)) - (not star1p)) + (cond ((not (eq star1p star2p)) (not star1p)) ((and star1p star2p (string-lessp nam1 nam2))) - ((string-lessp mode1 mode2) - t) - ((string-lessp mode2 mode1) - nil) - (t - (string-lessp nam1 nam2))))) + ((string-lessp mode1 mode2) t) + ((string-lessp mode2 mode1) nil) + (t (string-lessp nam1 nam2))))) ;; this version is too slow on some machines. -;; (vintage 1990, that is) -(defun slow-format-buffers-menu-line (buffer n) +(defun slow-format-buffers-menu-line (buffer) "For use as a value of `buffers-menu-format-buffer-line-function'. This returns a string containing a bunch of info about the buffer." - (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) "")))) + (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 n) +(defun format-buffers-menu-line (buffer) "For use as a value of `buffers-menu-format-buffer-line-function'. This just returns the buffer's name." - (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list) - (buffer-name buffer))) + (buffer-name buffer)) (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2) "For use as a value of `buffers-menu-grouping-function'. @@ -1699,46 +1181,41 @@ (buffer-name (current-buffer))))))) (defsubst build-buffers-menu-internal (buffers) - (let (name line (n 0)) + (let (name line) (mapcar #'(lambda (buffer) (if (eq buffer t) "---" - (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)))) + (setq line (funcall buffers-menu-format-buffer-line-function + buffer)) (if complex-buffers-menu-p (delq nil (list line - (vector "S%_witch to Buffer" + (vector "Switch to Buffer" (list buffers-menu-switch-to-buffer-function (setq name (buffer-name buffer))) t) (if (eq buffers-menu-switch-to-buffer-function 'switch-to-buffer) - (vector "Switch to Buffer, Other %_Frame" + (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. - ;; #### Also, avoid losing with non-ASCII buffer names. - ;; #### We still lose, however, if complex-buffers-menu-p. --mrb + ;; ### We don't want buffer names to be translated, + ;; ### so we put the buffer name in the suffix. + ;; ### Also, avoid losing with non-ASCII buffer names. + ;; ### We still lose, however, if complex-buffers-menu-p. --mrb (vector "" (list buffers-menu-switch-to-buffer-function (buffer-name buffer)) @@ -1806,13 +1283,10 @@ (defun language-environment-menu-filter (menu) "This is the menu filter for the \"Language Environment\" submenu." - (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))) + (mapcar (lambda (env-sym) + `[ ,(capitalize (symbol-name env-sym)) + (set-language-environment ',env-sym)]) + language-environment-list)) ;;; The Options menu @@ -1846,34 +1320,22 @@ ;;; The Help menu -(defun tutorials-menu-filter (menu-items) - (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))))) +(if (featurep 'mule) + (defun tutorials-menu-filter (menu-items) + ;; If there's a tutorial for the current language environment, make it + ;; appear first as the default one. Otherwise, use the english one. + (let* ((menu menu-items) + (item (pop menu-items))) + (aset + item 3 + (concat "(" + (if (assoc + 'tutorial + (assoc current-language-environment language-info-alist)) + current-language-environment + "English") + ")")) + menu))) (set-menubar default-menubar) @@ -1883,24 +1345,24 @@ (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" "")] - ["Cu%_t" kill-primary-selection + ["Cut" 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)] - ["%_Delete" delete-primary-selection + ["Clear" delete-primary-selection :active (selection-owner-p)] "-----" - ["Select %_Block" mark-paragraph] - ["Sp%_lit Window" split-window-vertically] - ["U%_nsplit Window" delete-other-windows] + ["Select Block" mark-paragraph] + ["Split Window" split-window-vertically] + ["Unsplit Window" delete-other-windows] )) (defvar global-popup-menu nil @@ -1914,7 +1376,7 @@ (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... +;; superceded by any local popup menu... (setq-default mode-popup-menu default-popup-menu) (defvar activate-popup-menu-hook nil @@ -1967,15 +1429,16 @@ (error "Pointer must be in a normal window")) (select-window window) (if current-menubar - (setq bmenu (assoc "%_Buffers" current-menubar))) + (setq bmenu (assoc "Buffers" current-menubar))) (if (null bmenu) - (setq bmenu (assoc "%_Buffers" default-menubar))) + (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." + "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) @@ -1983,12 +1446,12 @@ (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 + ;; ##### 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)) + (popup-menu (cons "Menubar Menu" popup-menubar)) )) (global-set-key 'button3 'popup-mode-menu) @@ -2054,4 +1517,4 @@ (provide 'x-menubar) (provide 'menubar-items) -;;; menubar-items.el ends here. +;;; x-menubar.el ends here. diff -r 12e008d41344 -r 697ef44129c6 lisp/menubar.el --- a/lisp/menubar.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/menubar.el Mon Aug 13 11:20:41 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 menubar-items.el +;; Some stuff in FSF menu-bar.el is in x-menubar.el ;;; Code: @@ -128,6 +128,19 @@ 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 diff -r 12e008d41344 -r 697ef44129c6 lisp/minibuf.el --- a/lisp/minibuf.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/minibuf.el Mon Aug 13 11:20:41 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, 2000 Ben Wing. +;; Copyright (C) 1995 Tinker Systems +;; Copyright (C) 1995, 1996 Ben Wing ;; Author: Richard Mlynarik ;; Created: 2-Oct-92 @@ -77,12 +77,10 @@ (defvar minibuffer-completion-confirm nil "Non-nil => demand confirmation of completion before exiting minibuffer.") -(defcustom minibuffer-confirm-incomplete nil +(defvar minibuffer-confirm-incomplete nil "If true, then in contexts where completing-read allows answers which are not valid completions, an extra RET must be typed to confirm the -response. This is helpful for catching typos, etc." - :type 'boolean - :group 'minibuffer) +response. This is helpful for catching typos, etc.") (defcustom completion-auto-help t "*Non-nil means automatically provide help for invalid completion input." @@ -111,12 +109,8 @@ ;(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.") @@ -350,8 +344,7 @@ keymap readp history - abbrev-table - default) + abbrev-table) "Read a string from the minibuffer, prompting with string PROMPT. If optional second arg INITIAL-CONTENTS is non-nil, it is a string to be inserted into the minibuffer before reading input. @@ -373,8 +366,6 @@ Positions are counted starting from 1 at the beginning of the list. Sixth arg ABBREV-TABLE, if non-nil, becomes the value of `local-abbrev-table' in the minibuffer. -Seventh arg DEFAULT, if non-nil, will be returned when user enters - an empty string. See also the variable completion-highlight-first-word-only for control over completion display." @@ -421,8 +412,7 @@ ;; `M-x doctor' makes history a local variable, and thus ;; our binding above is buffer-local and doesn't apply ;; once we switch buffers!!!! We demand better scope! - (_history_ history) - (minibuffer-default default)) + (_history_ history)) (unwind-protect (progn (set-buffer (reset-buffer buffer)) @@ -500,13 +490,8 @@ (let* ((val (progn (set-buffer buffer) (if minibuffer-exit-hook (run-hooks 'minibuffer-exit-hook)) - (if (and (eq (char-after (point-min)) nil) - default) - default - (buffer-string)))) - (histval (if (and default (string= val "")) - default - val)) + (buffer-string))) + (histval val) (err nil)) (if readp (condition-case e @@ -612,7 +597,7 @@ ;; Used by minibuffer-do-completion -(defvar last-exact-completion nil) +(defvar last-exact-completion) (defun temp-minibuffer-message (m) (let ((savemax (point-max))) @@ -763,7 +748,7 @@ (defun completing-read (prompt table &optional predicate require-match - initial-contents history default) + initial-contents history) "Read a string in the minibuffer, with completion. Args: PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-CONTENTS, HISTORY. PROMPT is a string to prompt with; normally it ends in a colon and a space. @@ -785,27 +770,19 @@ which INITIAL-CONTENTS corresponds to). If HISTORY is `t', no history will be recorded. Positions are counted starting from 1 at the beginning of the list. -DEFAULT, if non-nil, is the default value. Completion ignores case if the ambient value of `completion-ignore-case' is non-nil." (let ((minibuffer-completion-table table) (minibuffer-completion-predicate predicate) (minibuffer-completion-confirm (if (eq require-match 't) nil t)) - (last-exact-completion nil) - ret) - (setq ret (read-from-minibuffer prompt - initial-contents - (if (not require-match) - minibuffer-local-completion-map - minibuffer-local-must-match-map) - nil - history - nil - default)) - (if (and (string= ret "") - default) - default - ret))) + (last-exact-completion nil)) + (read-from-minibuffer prompt + initial-contents + (if (not require-match) + minibuffer-local-completion-map + minibuffer-local-must-match-map) + nil + history))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1254,9 +1231,7 @@ If N is negative, find the next or Nth next match." (interactive (let ((enable-recursive-minibuffers t) - (minibuffer-history-sexp-flag nil) - (minibuffer-max-depth (and minibuffer-max-depth - (1+ minibuffer-max-depth)))) + (minibuffer-history-sexp-flag nil)) (if (eq 't (symbol-value minibuffer-history-variable)) (error "History is not being recorded in this context")) (list (read-from-minibuffer "Previous element matching (regexp): " @@ -1304,9 +1279,7 @@ If N is negative, find the previous or Nth previous match." (interactive (let ((enable-recursive-minibuffers t) - (minibuffer-history-sexp-flag nil) - (minibuffer-max-depth (and minibuffer-max-depth - (1+ minibuffer-max-depth)))) + (minibuffer-history-sexp-flag nil)) (if (eq t (symbol-value minibuffer-history-variable)) (error "History is not being recorded in this context")) (list (read-from-minibuffer "Next element matching (regexp): " @@ -1330,10 +1303,7 @@ (let ((narg (- minibuffer-history-position n)) (minimum (if minibuffer-default -1 0))) (cond ((< narg minimum) - (error (if minibuffer-default - "No following item in %s" - "No following item in %s; no default available") - minibuffer-history-variable)) + (error "No following item in %s" minibuffer-history-variable)) ((> narg (length (symbol-value minibuffer-history-variable))) (error "No preceding item in %s" minibuffer-history-variable))) (erase-buffer) @@ -1384,14 +1354,11 @@ ;;;; reading various things from a minibuffer ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun read-expression (prompt &optional initial-contents history default-value) - "Return a Lisp object read using the minibuffer, prompting with PROMPT. -If non-nil, optional second arg INITIAL-CONTENTS is a string to insert - in the minibuffer before reading. -Third arg HISTORY, if non-nil, specifies a history list. -Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used - for history command, and as the value to return if the user enters the - empty string." +(defun read-expression (prompt &optional initial-contents history) + "Return a Lisp object read using the minibuffer. +Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS +is a string to insert in the minibuffer before reading. +Third arg HISTORY, if non-nil, specifies a history list." (let ((minibuffer-history-sexp-flag t) ;; Semi-kludge to get around M-x C-x o M-ESC trying to do completion. (minibuffer-completion-table nil)) @@ -1400,60 +1367,50 @@ read-expression-map t (or history 'read-expression-history) - lisp-mode-abbrev-table - default-value))) + lisp-mode-abbrev-table))) -(defun read-string (prompt &optional initial-contents history default-value) +(defun read-string (prompt &optional initial-contents history) "Return a string from the minibuffer, prompting with string PROMPT. If non-nil, optional second arg INITIAL-CONTENTS is a string to insert - in the minibuffer before reading. -Third arg HISTORY, if non-nil, specifies a history list. -Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used - for history command, and as the value to return if the user enters the - empty string." +in the minibuffer before reading. +Third arg HISTORY, if non-nil, specifies a history list." (let ((minibuffer-completion-table nil)) (read-from-minibuffer prompt initial-contents minibuffer-local-map - nil history nil default-value))) + nil history))) -(defun eval-minibuffer (prompt &optional initial-contents history default-value) +(defun eval-minibuffer (prompt &optional initial-contents history) "Return value of Lisp expression read using the minibuffer. Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS is a string to insert in the minibuffer before reading. -Third arg HISTORY, if non-nil, specifies a history list. -Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used - for history command, and as the value to return if the user enters the - empty string." - (eval (read-expression prompt initial-contents history default-value))) +Third arg HISTORY, if non-nil, specifies a history list." + (eval (read-expression prompt initial-contents history))) ;; The name `command-history' is already taken (defvar read-command-history '()) -(defun read-command (prompt &optional default-value) +(defun read-command (prompt) "Read the name of a command and return as a symbol. -Prompts with PROMPT. By default, return DEFAULT-VALUE." +Prompts with PROMPT." (intern (completing-read prompt obarray 'commandp t nil ;; 'command-history is not right here: that's a ;; list of evalable forms, not a history list. 'read-command-history - default-value))) + ))) -(defun read-function (prompt &optional default-value) +(defun read-function (prompt) "Read the name of a function and return as a symbol. -Prompts with PROMPT. By default, return DEFAULT-VALUE." +Prompts with PROMPT." (intern (completing-read prompt obarray 'fboundp t nil - 'function-history default-value))) + 'function-history))) -(defun read-variable (prompt &optional default-value) +(defun read-variable (prompt) "Read the name of a user variable and return it as a symbol. -Prompts with PROMPT. By default, return DEFAULT-VALUE. +Prompts with PROMPT. A user variable is one whose documentation starts with a `*' character." (intern (completing-read prompt obarray 'user-variable-p t nil - 'variable-history - (if (symbolp default-value) - (symbol-name default-value) - default-value)))) + 'variable-history))) (defun read-buffer (prompt &optional default require-match) "Read the name of a buffer and return as a string. @@ -1471,10 +1428,7 @@ result) (while (progn (setq result (completing-read prompt alist nil require-match - nil 'buffer-history - (if (bufferp default) - (buffer-name default) - default))) + nil 'buffer-history)) (cond ((not (equal result "")) nil) ((not require-match) @@ -1491,12 +1445,8 @@ (buffer-name result) result))) -(defun read-number (prompt &optional integers-only default-value) - "Read a number from the minibuffer, prompting with PROMPT. -If optional second argument INTEGERS-ONLY is non-nil, accept - only integer input. -If DEFAULT-VALUE is non-nil, return that if user enters an empty - line." +(defun read-number (prompt &optional integers-only) + "Read a number from the minibuffer." (let ((pred (if integers-only 'integerp 'numberp)) num) (while (not (funcall pred num)) @@ -1504,20 +1454,19 @@ (let ((minibuffer-completion-table nil)) (read-from-minibuffer prompt (if num (prin1-to-string num)) nil t - nil nil default-value)) + t)) ;no history (input-error nil) (invalid-read-syntax nil) (end-of-file nil))) (or (funcall pred num) (beep))) num)) -(defun read-shell-command (prompt &optional initial-input history default-value) +(defun read-shell-command (prompt &optional initial-input history) "Just like read-string, but uses read-shell-command-map: \\{read-shell-command-map}" (let ((minibuffer-completion-table nil)) (read-from-minibuffer prompt initial-input read-shell-command-map - nil (or history 'shell-command-history) - nil default-value))) + nil (or history 'shell-command-history)))) ;;; This read-file-name stuff probably belongs in files.el @@ -1544,24 +1493,6 @@ (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) @@ -1600,9 +1531,8 @@ read-file-name-map read-file-name-must-match-map) nil - history - nil - default)))) + history)) + )) ;;; ;; Kludge! Put "/foo/bar" on history rather than "/default//foo/bar" ;;; (let ((hist (cond ((not history) 'minibuffer-history) ;;; ((consp history) (car history)) @@ -1650,7 +1580,7 @@ (reset-buffer completion-buf) (let ((standard-output completion-buf)) (display-completion-list - (minibuf-directory-files full nil (if dir-p 'directory)) + (delete "." (directory-files full nil nil nil (if dir-p 'directory))) :user-data dir-p :reference-buffer minibuf :activate-callback 'read-file-name-activate-callback) @@ -1663,24 +1593,30 @@ ;; 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))) + (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))))) (defun read-file-name (prompt &optional dir default must-match initial-contents @@ -1689,27 +1625,22 @@ This will prompt with a dialog box if appropriate, according to `should-use-dialog-box-p'. Value is not expanded---you must call `expand-file-name' yourself. -Value is subject to interpretation by `substitute-in-file-name' however. +Value is subject to interpreted by substitute-in-file-name however. Default name to DEFAULT if user enters a null string. (If DEFAULT is omitted, the visited file name is used, except that if INITIAL-CONTENTS is specified, that combined with DIR is used.) Fourth arg MUST-MATCH non-nil means require existing file's name. Non-nil and non-t means also require confirmation after completion. -Fifth arg INITIAL-CONTENTS specifies text to start with. If this is not - specified, and `insert-default-directory' is non-nil, DIR or the current - directory will be used. +Fifth arg INITIAL-CONTENTS specifies text to start with. Sixth arg HISTORY specifies the history list to use. Default is `file-name-history'. DIR defaults to current buffer's directory default." (read-file-name-1 (or history 'file-name-history) prompt dir (or default - (and initial-contents - (abbreviate-file-name (expand-file-name - initial-contents dir) t)) - (and buffer-file-truename - (abbreviate-file-name buffer-file-name t))) + (if initial-contents (expand-file-name initial-contents dir) + buffer-file-name)) must-match initial-contents ;; A separate function (not an anonymous lambda-expression) ;; and passed as a symbol because of disgusting kludges in various @@ -1843,9 +1774,7 @@ ((eq action 't) ;; all completions (mapcar #'un-substitute-in-file-name - (if (string= name "") - (delete "./" (file-name-all-completions "" dir)) - (file-name-all-completions name dir)))) + (file-name-all-completions name dir))) (t;; nil ;; complete (let* ((d (or dir default-directory)) @@ -1874,13 +1803,17 @@ #'(lambda (action orig string specdir dir name) (let* ((dirs #'(lambda (fn) (let ((l (if (equal name "") - (minibuf-directory-files + (directory-files dir + nil "" + nil 'directories) - (minibuf-directory-files + (directory-files dir + nil (concat "\\`" (regexp-quote name)) + nil 'directories)))) (mapcar fn ;; Wretched unix @@ -1942,64 +1875,40 @@ 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 - ;; Delete ": " off the end. There must be an easier way! - (let ((end-pos (length prompt))) - (if (and (> end-pos 0) (eq (aref prompt (1- end-pos)) ? )) - (setq end-pos (1- end-pos))) - (if (and (> end-pos 0) (eq (aref prompt (1- end-pos)) ?:)) - (setq end-pos (1- end-pos))) - (substring prompt 0 end-pos)))) - ;; 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 - (minibuf-directory-files dir nil t) - :window-width (window-width window) - :window-height (window-text-area-height window) - :completion-string "" + (directory-files dir nil nil nil t) + :window-width (* 2 (window-width window)) :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 - (minibuf-directory-files dir nil 1) + (delete "." (directory-files dir nil nil 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))) - (ministring (buffer-substring nil nil minibuf)) - (in-dir (file-name-directory ministring)) + (in-dir (buffer-substring nil nil minibuf)) (full (expand-file-name file in-dir)) (filebuf (nth 0 user-data)) - (dirbuf (nth 1 user-data)) + (dirbuff (nth 1 user-data)) (filewin (nth 2 user-data)) (dirwin (nth 3 user-data))) (if (file-regular-p full) @@ -2008,34 +1917,29 @@ (insert-string (file-name-as-directory (abbreviate-file-name full t)) minibuf) (reset-buffer filebuf) - (if (not dirbuf) + (if (not dirbuff) (mouse-directory-display-completion-list filewin full minibuf user-data) (mouse-file-display-completion-list filewin full minibuf user-data) - (reset-buffer dirbuf) + (reset-buffer dirbuff) (mouse-directory-display-completion-list dirwin full minibuf user-data))))) -;; 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). +;; this is rather cheesified but gets the job done. (defun mouse-read-file-name-1 (history prompt dir default - must-match initial-contents - completer) - ;; file-p is t if we're reading files, nil if directories. + must-match initial-contents + completer) (let* ((file-p (eq 'read-file-name-internal completer)) (filebuf (get-buffer-create "*Completions*")) - (dirbuf (and file-p (generate-new-buffer " *mouse-read-file*"))) - (butbuf (generate-new-buffer " *mouse-read-file*")) + (dirbuff (and file-p (generate-new-buffer " *mouse-read-file*"))) + (butbuff (generate-new-buffer " *mouse-read-file*")) (frame (make-dialog-frame)) filewin dirwin user-data) (unwind-protect (progn (reset-buffer filebuf) - - ;; set up the frame. - (focus-frame frame) + (select-frame frame) (let ((window-min-height 1)) ;; #### should be 2 not 3, but that causes ;; "window too small to split" errors for some @@ -2048,80 +1952,16 @@ (setq filewin (frame-rightmost-window frame) dirwin (frame-leftmost-window frame)) (set-window-buffer filewin filebuf) - (set-window-buffer dirwin dirbuf)) + (set-window-buffer dirwin dirbuff)) (setq filewin (frame-highest-window frame)) (set-window-buffer filewin filebuf)) - (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) + (setq user-data (list filebuf dirbuff filewin dirwin)) + (set-window-buffer (frame-lowest-window frame) butbuff) + (set-buffer butbuff) (when dir (setq default-directory dir)) (when (featurep 'scrollbar) - (set-specifier scrollbar-width 0 butbuf)) + (set-specifier scrollbar-width 0 butbuff)) (insert " ") (insert-gui-button (make-gui-button "OK" (lambda (foo) @@ -2130,20 +1970,51 @@ (insert-gui-button (make-gui-button "Cancel" (lambda (foo) (abort-recursive-edit)))) - - ;; 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) + (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)))) (delete-frame frame) (kill-buffer filebuf) - (kill-buffer butbuf) - (and dirbuf (kill-buffer dirbuf))))) + (kill-buffer butbuff) + (and dirbuff (kill-buffer dirbuff))))) (defun read-face (prompt &optional must-match) "Read the name of a face from the minibuffer and return it as a symbol." @@ -2236,18 +2107,10 @@ ;;(if (featurep 'mule) -(defun read-coding-system (prompt &optional default-coding-system) +(defun read-coding-system (prompt) "Read a coding-system (or nil) from the minibuffer. -Prompting with string PROMPT. -If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. -DEFAULT-CODING-SYSTEM can be a string, symbol, or coding-system object." - (intern (completing-read prompt obarray 'find-coding-system t nil nil - (cond ((symbolp default-coding-system) - (symbol-name default-coding-system)) - ((coding-system-p default-coding-system) - (symbol-name (coding-system-name default-coding-system))) - (t - default-coding-system))))) +Prompting with string PROMPT." + (intern (completing-read prompt obarray 'find-coding-system t))) (defun read-non-nil-coding-system (prompt) "Read a non-nil coding-system from the minibuffer. diff -r 12e008d41344 -r 697ef44129c6 lisp/modeline.el --- a/lisp/modeline.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/modeline.el Mon Aug 13 11:20:41 2007 +0200 @@ -19,7 +19,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. @@ -59,52 +59,11 @@ :type 'boolean :group 'modeline) -(defcustom modeline-scrolling-method nil - "*If non-nil, dragging the modeline with the mouse may also scroll its -text horizontally (vertical motion controls window resizing and horizontal -motion controls modeline scrolling). - -With a value of t, the modeline text is scrolled in the same direction as -the mouse motion. With a value of 'scrollbar, the modeline is considered as -a scrollbar for its own text, which then moves in the opposite direction." - :type '(choice (const :tag "none" nil) - (const :tag "text" t) - (const :tag "scrollbar" scrollbar)) - :set (lambda (sym val) - (set-default sym val) - (when (featurep 'x) - (cond ((eq val t) - (set-glyph-image modeline-pointer-glyph "hand2" 'global 'x)) - ((eq val 'scrollbar) - (set-glyph-image modeline-pointer-glyph "fleur" 'global 'x)) - (t - (set-glyph-image modeline-pointer-glyph "sb_v_double_arrow" - '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) "Resize a window by dragging its modeline. This command should be bound to a button-press event in modeline-map. Holding down a mouse button and moving the mouse up and down will -make the clicked-on window taller or shorter. - -See also the variable `modeline-scrolling-method'." +make the clicked-on window taller or shorter." (interactive "e") (or (button-press-event-p event) (error "%s must be invoked by a mouse-press" this-command)) @@ -120,9 +79,9 @@ (start-event-frame (event-frame event)) (start-event-window (event-window event)) (start-nwindows (count-windows t)) - (hscroll-delta (face-width 'modeline)) - (start-hscroll (modeline-hscroll (event-window event))) - (start-x-pixel (event-x-pixel event)) +;; (hscroll-delta (face-width 'modeline)) +;; (start-hscroll (modeline-hscroll (event-window event))) +; (start-x-pixel (event-x-pixel event)) (last-timestamp 0) default-line-height modeline-height @@ -182,9 +141,7 @@ ;; scroll) nore Y pos (modeline drag) have changed. (and modeline-click-swaps-buffers (= depress-line (event-y event)) - (or (not modeline-scrolling-method) - (= start-hscroll - (modeline-hscroll start-event-window))) +;; (= start-hscroll (modeline-hscroll start-event-window)) (modeline-swap-buffers event))) ((button-event-p event) (setq done t)) @@ -196,14 +153,11 @@ drag-divider-event-lag) nil) (t - (when modeline-scrolling-method - (let ((delta (/ (- (event-x-pixel event) start-x-pixel) - hscroll-delta))) - (set-modeline-hscroll start-event-window - (if (eq modeline-scrolling-method t) - (- start-hscroll delta) - (+ start-hscroll delta))) - )) +;; (set-modeline-hscroll start-event-window +;; (+ (/ (- (event-x-pixel event) +;; start-x-pixel) +;; hscroll-delta) +;; start-hscroll)) (setq last-timestamp (event-timestamp event) y (event-y-pixel event) edges (window-pixel-edges start-event-window) @@ -309,9 +263,13 @@ (make-face 'modeline-mousable "Face for mousable portions of the modeline.") (set-face-parent 'modeline-mousable 'modeline nil '(default)) (when (featurep 'window-system) - (set-face-foreground 'modeline-mousable "firebrick" nil '(default color win)) - (set-face-font 'modeline-mousable [bold] nil '(default mono win)) - (set-face-font 'modeline-mousable [bold] nil '(default grayscale win))) + (set-face-foreground 'modeline-mousable + '(((default color x) . "firebrick") + ((default color mswindows) . "firebrick")) + 'global)) +(when (featurep 'x) + (set-face-font 'modeline-mousable [bold] nil '(default mono x)) + (set-face-font 'modeline-mousable [bold] nil '(default grayscale x))) (defmacro make-modeline-command-wrapper (command) `#'(lambda (event) @@ -345,8 +303,12 @@ (set-face-parent 'modeline-mousable-minor-mode 'modeline-mousable nil '(default)) (when (featurep 'window-system) - (set-face-foreground 'modeline-mousable-minor-mode '("green4" "forestgreen") - nil '(default color win))) + (set-face-foreground 'modeline-mousable-minor-mode + '(((default color x) . "green4") + ((default color x) . "forestgreen") + ((default color mswindows) . "green4") + ((default color mswindows) . "forestgreen")) + 'global)) (defvar modeline-mousable-minor-mode-extent (make-extent nil nil) ;; alliteration at its finest. @@ -429,7 +391,7 @@ name))) (if (setq el (assq toggle minor-mode-alist)) (setcdr el (list hacked-name)) - (funcall add-elt + (funcall add-elt (list toggle hacked-name) 'minor-mode-alist)))) (when keymap @@ -546,16 +508,20 @@ "Face for the buffer ID string in the modeline.") (set-face-parent 'modeline-buffer-id 'modeline nil '(default)) (when (featurep 'window-system) - (set-face-foreground 'modeline-buffer-id "blue4" nil '(default color win)) - (set-face-font 'modeline-buffer-id [bold-italic] nil '(default mono win)) - (set-face-font 'modeline-buffer-id [bold-italic] nil '(default grayscale win))) + (set-face-foreground 'modeline-buffer-id + '(((default color x) . "blue4") + ((default color mswindows) . "blue4")) + 'global)) +(when (featurep 'x) + (set-face-font 'modeline-buffer-id [bold-italic] nil '(default mono x)) + (set-face-font 'modeline-buffer-id [bold-italic] nil '(default grayscale x))) (when (featurep 'tty) (set-face-font 'modeline-buffer-id [bold-italic] nil '(default tty))) (defvar modeline-buffer-id-extent (make-extent nil nil) "Extent covering the whole of the buffer-id string.") (set-extent-face modeline-buffer-id-extent 'modeline-buffer-id) - + (defvar modeline-buffer-id-left-extent (make-extent nil nil) "Extent covering the left half of the buffer-id string.") (set-extent-keymap modeline-buffer-id-left-extent @@ -575,13 +541,8 @@ ; 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 - - (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,...).") +Its default value is \"XEmacs: %17b\" (NOT!). 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 @@ -634,14 +595,13 @@ (purecopy " ") 'global-mode-string (purecopy " %[(") - (cons modeline-minor-mode-extent - (list (purecopy "") 'mode-name 'minor-mode-alist)) - (cons modeline-narrowed-extent (purecopy "%n")) + (cons modeline-minor-mode-extent (list "" 'mode-name 'minor-mode-alist)) + (cons modeline-narrowed-extent "%n") 'modeline-process (purecopy ")%]----") - (list 'line-number-mode (purecopy "L%l--")) - (list 'column-number-mode (purecopy "C%c--")) - (cons -3 (purecopy "%p")) + (purecopy '(line-number-mode "L%l--")) + (purecopy '(column-number-mode "C%c--")) + (purecopy '(-3 . "%p")) (purecopy "-%-"))) ;;; Added for XEmacs 20.3. Provide wrapper for vc since it may not always be diff -r 12e008d41344 -r 697ef44129c6 lisp/mouse.el --- a/lisp/mouse.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mouse.el Mon Aug 13 11:20:41 2007 +0200 @@ -84,54 +84,11 @@ "Function that is called upon by `mouse-yank' to actually insert text.") (defun mouse-consolidated-yank () - "Insert the current selection or, if there is none under X insert -the X cutbuffer. A mark is pushed, so that the inserted text lies -between point and mark." (interactive) - (if (and (not (console-on-window-system-p)) - (and (featurep 'gpm) - (not gpm-minor-mode))) - (yank) - (push-mark) - (if (region-active-p) - (if (consp zmacs-region-extent) - ;; pirated code from insert-rectangle in rect.el - ;; perhaps that code should be modified to handle a list of extents - ;; as the rectangle to be inserted? - (let ((lines zmacs-region-extent) - (insertcolumn (current-column)) - (first t)) - (push-mark) - (while lines - (or first - (progn - (forward-line 1) - (or (bolp) (insert ?\n)) - (move-to-column insertcolumn t))) - (setq first nil) - (insert (extent-string (car lines))) - (setq lines (cdr lines)))) - (insert (extent-string zmacs-region-extent))) - (insert-selection t)))) - -(defun insert-selection (&optional check-cutbuffer-p move-point-event) - "Insert the current selection into buffer at point." - (interactive "P") - ;; we fallback to the clipboard if the current selection is not existent - (let ((text (if check-cutbuffer-p - (or (get-selection-no-error) - (get-cutbuffer) - (get-selection-no-error 'CLIPBOARD) - (error "No selection, clipboard or cut buffer available")) - (or (get-selection-no-error) - (get-selection 'CLIPBOARD))))) - (cond (move-point-event - (mouse-set-point move-point-event) - (push-mark (point))) - ((interactive-p) - (push-mark (point)))) - (insert text) - )) + (case (device-type) + (x (x-yank-function)) + (tty (yank)) + (otherwise (yank)))) (defun mouse-select () @@ -228,10 +185,9 @@ (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))) + (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 @@ -1383,7 +1339,7 @@ ;; vars is a list of glyph variables to check for a pointer ;; value. (vars (cond - ;; Checking if button is non-nil is not sufficient + ;; Checking if button is non-nil is not sufficent ;; since the pointer could be over a blank portion ;; of the toolbar. ((event-over-toolbar-p event) @@ -1525,10 +1481,10 @@ (setq last-timestamp (event-timestamp event)) ;; Enlarge the window, calculating change in characters ;; of default font. Do not let the window to become - ;; less than allowed minimum (not because that's critical + ;; less than alolwed minimum (not because that's critical ;; for the code performance, just the visual effect is ;; better: when cursor goes to the left of the next left - ;; divider, the window being resized shrinks to minimal + ;; divider, the vindow being resized shrinks to minimal ;; size. (enlarge-window (max (- window-min-width (window-width window)) (/ (- (event-x-pixel event) old-right) @@ -1538,7 +1494,7 @@ ;; if the change caused more than two windows to resize ;; (shifting the whole stack right is ugly), or if the ;; left window side has slipped (right side cannot be - ;; moved any further to the right, so enlarge-window + ;; moved any funrther to the right, so enlarge-window ;; plays bad games with the left edge. (if (or (/= (count-windows) (length old-edges-all-windows)) (/= old-left (car (window-pixel-edges window))) diff -r 12e008d41344 -r 697ef44129c6 lisp/movemail.el --- a/lisp/movemail.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -;;; movemail.el --- move mail spool to a place where XEmacs can munge it - -;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc. -;; Copyright (c) 1993, 1994 Sun Microsystems, Inc. -;; Copyright (C) 1995 Board of Trustees, University of Illinois - -;; Author: Mike Sperber -;; Maintainer: XEmacs Development Team -;; Keywords: internal, dumped - -;; This file is part of XEmacs. - -;; XEmacs is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; XEmacs is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Synched up with: Not in FSF. - -;;; Commentary: - -;; This file is dumped with XEmacs. - -;; This file handles calling movemail with the right locking command -;; line options. - -;;; Code: - -(defvar mail-lock-method - (let ((stuff (getenv "EMACSLOCKMETHOD"))) - (if stuff - (intern stuff) - configure-mail-lock-method)) - "mail spool locking method used by thios instance of XEmacs. -This must be one of the symbols in MAIL-LOCK-METHODS.") - -(defun move-mail-spool (from to &optional buffer pop-password) - "Move mail spool in file FROM to file TO. -BUFFER is a buffer for error messages. -POP-PASSWORD is a password for POP mailbox access." - (apply 'call-process - (expand-file-name "movemail" exec-directory) - nil buffer nil - "-m" - (symbol-name mail-lock-method) - from to - (and pop-password - (list pop-password)))) - -;;; movemail.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/msw-faces.el --- a/lisp/msw-faces.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/msw-faces.el Mon Aug 13 11:20:41 2007 +0200 @@ -29,40 +29,16 @@ ;; 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) - (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))) + (unless (face-font-instance 'default device) + (error "Can't find a suitable default font"))) + (defun mswindows-init-frame-faces (frame) ) -;; Other functions expect these regexps -(defconst mswindows-font-regexp - (let - ((- ":") - (fontname "\\([a-zA-Z ]+\\)") - (weight "\\([a-zA-Z]*\\)?") - (style "\\( [a-zA-Z]*\\)?") - (pointsize "\\([0-9]+\\)?") - (effects "\\([a-zA-Z ]*\\)?") - (charset "\\([a-zA-Z 0-9]*\\)") - ) - (concat "^" - fontname - weight style - pointsize - effects - charset "$"))) ;;; Fill in missing parts of a font spec. This is primarily intended as a ;;; helper function for the functions below. diff -r 12e008d41344 -r 697ef44129c6 lisp/msw-font-menu.el --- a/lisp/msw-font-menu.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -;; msw-font-menu.el --- Managing menus of mswindows fonts. - -;; Copyright (C) 1999 Free Software Foundation, Inc. - -;; Adapted from x-font-menu.el by Andy Piper - -;; 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. - -;;; mswindows fonts look like: -;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset] -;;; ie: -;;; Lucida Console:Regular:10 -;;; minimal: -;;; Courier New -;;; maximal: -;;; Courier New:Bold Italic:10:underline strikeout:western - -;;; Code: - -;; #### - implement these... -;; -;;; (defvar font-menu-ignore-proportional-fonts nil -;;; "*If non-nil, then the font menu will only show fixed-width fonts.") - -(require 'font-menu) - -(defvar mswindows-font-menu-registry-encoding nil - "Registry and encoding to use with font menu fonts.") - -(defvar mswindows-font-menu-junk-families - (purecopy - (mapconcat - #'identity - '("Symbol" - ) - "\\|")) - "A regexp matching font families which are uninteresting (e.g. cursor fonts).") - -(defvar mswindows-font-regexp-ascii nil - "This is used to filter out font families that can't display ASCII text. -It must be set at run-time.") - -;;;###autoload -(defun mswindows-reset-device-font-menus (device &optional debug) - "Generates the `Font', `Size', and `Weight' submenus for the Options menu. -This is run the first time that a font-menu is needed for each device. -If you don't like the lazy invocation of this function, you can add it to -`create-device-hook' and that will make the font menus respond more quickly -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." - (unless mswindows-font-regexp-ascii - (setq mswindows-font-regexp-ascii (if (featurep 'mule) - (charset-registry 'ascii) - "Western"))) - (setq mswindows-font-menu-registry-encoding (if (featurep 'mule) "" "Western")) - (let ((case-fold-search t) - family size weight entry - dev-cache cache families sizes weights) - (dolist (name (cond ((null debug) ; debugging kludge - (list-fonts "::::" device)) - ((stringp debug) (split-string debug "\n")) - (t debug))) - (when (and (string-match mswindows-font-regexp-ascii name) - (string-match mswindows-font-regexp name)) - (setq weight (capitalize (match-string 2 name)) - size (string-to-int (or (match-string 4 name) "0")) - family (match-string 1 name)) - (unless (string-match mswindows-font-menu-junk-families family) - (setq entry (or (vassoc name cache) - (car (setq cache - (cons (vector family nil nil t) - cache))))) - (or (member family families) (push family families)) - (or (member weight weights) (push weight weights)) - (or (member size sizes) (push size sizes)) - (or (member weight (aref entry 1)) (push weight (aref entry 1))) - (or (member size (aref entry 2)) (push size (aref entry 2)))))) - ;; - ;; Hack scalable fonts. - ;; Some fonts come only in scalable versions (the only size is 0) - ;; and some fonts come in both scalable and non-scalable versions - ;; (one size is 0). If there are any scalable fonts at all, make - ;; sure that the union of all point sizes contains at least some - ;; common sizes - it's possible that some sensible sizes might end - ;; up not getting mentioned explicitly. - ;; - (if (member 0 sizes) - (let ((common '(6 8 10 12 14 16 18 24))) - (while common - (or;;(member (car common) sizes) ; not enough slack - (let ((rest sizes) - (done nil)) - (while (and (not done) rest) - (if (and (> (car common) (- (car rest) 1)) - (< (car common) (+ (car rest) 1))) - (setq done t)) - (setq rest (cdr rest))) - done) - (setq sizes (cons (car common) sizes))) - (setq common (cdr common))) - (setq sizes (delq 0 sizes)))) - - (setq families (sort families 'string-lessp) - weights (sort weights 'string-lessp) - sizes (sort sizes '<)) - - (dolist (entry cache) - (aset entry 1 (sort (aref entry 1) 'string-lessp)) - (aset entry 2 (sort (aref entry 2) '<))) - - (setq dev-cache (assq device device-fonts-cache)) - (or dev-cache - (setq dev-cache (car (push (list device) device-fonts-cache)))) - (setcdr - dev-cache - (vector - cache - (mapcar (lambda (x) - (vector x - (list 'font-menu-set-font x nil nil) - ':style 'radio ':active nil ':selected nil)) - families) - (mapcar (lambda (x) - (vector (int-to-string x) - (list 'font-menu-set-font nil nil x) - ':style 'radio ':active nil ':selected nil)) - sizes) - (mapcar (lambda (x) - (vector x - (list 'font-menu-set-font nil x nil) - ':style 'radio ':active nil ':selected nil)) - weights))) - (cdr dev-cache))) - -;; Extract font information from a face. We examine both the -;; user-specified font name and the canonical (`true') font name. -;; These can appear to have totally different properties. - -;; We use the user-specified one if possible, else use the truename. -;; If the user didn't specify one get the truename and use the -;; possibly suboptimal data from that. -;;;###autoload -(defun* mswindows-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 mswindows-font-regexp name) - (setq family (match-string 1 name)) - (setq entry (vassoc family (aref dcache 0)))) - (when (and (null entry) - (string-match mswindows-font-regexp truename)) - (setq family (match-string 1 truename)) - (setq entry (vassoc family (aref dcache 0)))) - (when (null entry) - (return-from mswindows-font-menu-font-data (make-vector 5 nil))) - - (when (string-match mswindows-font-regexp name) - (setq weight (match-string 2 name)) - (setq size (string-to-int (match-string 4 name)))) - - (when (string-match mswindows-font-regexp truename) - (when (not (member weight (aref entry 1))) - (setq weight (match-string 2 truename))) - (when (not (member size (aref entry 2))) - (setq size (string-to-int (match-string 4 truename)))) - (setq slant (match-string 5 truename))) - - (vector entry family size weight slant))) - -(defun mswindows-font-menu-load-font (family weight size slant resolution) - "Try to load a font with the requested properties. -The weight, slant and resolution are only hints." - (when (integerp size) (setq size (int-to-string size))) - (let (font) - (catch 'got-font - (dolist (weight (list weight "")) - (dolist (slant - ;; oblique is not currently implemented - (cond ((string-equal slant "Oblique") '(" Italic" "")) - ((string-equal slant "Italic") '(" Italic" "")) - (t (list slant "")))) - (when (setq font - (make-font-instance - (concat family ":" weight slant ":" - size "::" - mswindows-font-menu-registry-encoding) - nil t)) - (throw 'got-font font))))))) - -(provide 'mswindows-font-menu) - -;;; msw-font-menu.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/msw-glyphs.el --- a/lisp/msw-glyphs.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/msw-glyphs.el Mon Aug 13 11:20:41 2007 +0200 @@ -27,27 +27,16 @@ ;;; Commentary: -;; Initialization code for MS Windows glyphs. +;; This file contains temporary definitions for 'mswindows glyphs. +;; Since there currently is no image support, the glyps are defined +;; TTY-style. This file has to be removed or reworked completely +;; when we have images. -;; This file is dumped with XEmacs (when MS Windows support is -;; compiled in). Make sure this is the first of msw-*.el files -;; dumped. +;; This file is dumped with XEmacs. ;;; 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) @@ -72,14 +61,11 @@ ;; 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 '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) + '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) (set-glyph-image octal-escape-glyph "\\") (set-glyph-image control-arrow-glyph "^") @@ -94,11 +80,11 @@ (if emacs-beta-version "xemacs-beta.xpm" "xemacs.xpm")) - 'global 'msgdi)) + 'global 'mswindows)) (t (set-glyph-image xemacs-logo "XEmacs " - 'global 'msgdi))) + 'global 'mswindows))) ) ;;; msw-glyphs.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/msw-init.el --- a/lisp/msw-init.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/msw-init.el Mon Aug 13 11:20:41 2007 +0200 @@ -47,7 +47,6 @@ (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) @@ -62,15 +61,13 @@ (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. - (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) + (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) ;; Random stuff - (global-set-key 'menu 'popup-mode-menu) + (define-key global-map 'menu 'popup-mode-menu) (setq mswindows-post-win-initted t))) diff -r 12e008d41344 -r 697ef44129c6 lisp/msw-select.el --- a/lisp/msw-select.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/msw-select.el Mon Aug 13 11:20:41 2007 +0200 @@ -38,7 +38,7 @@ (interactive "*") (setq last-command nil) (setq this-command 'yank) ; so that yank-pop works. - (let ((clip (get-clipboard)) (s (mark-marker)) (e (point-marker))) + (let ((clip (mswindows-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 @@ -49,6 +49,61 @@ (insert-rectangle clip) (insert clip)))) +(defun mswindows-own-clipboard (string) + "Paste the given string to the mswindows clipboard." + (mswindows-set-clipboard string)) +(defvar mswindows-selection-owned-p nil + "Whether we have a selection or not. +MS-Windows has no concept of ownership; don't use this.") + +(defun mswindows-own-selection (data &optional type) + "Make an MS-Windows selection of type TYPE and value DATA. +The argument TYPE is ignored, 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). + +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*. +Thus, editing done in the buffer after you specify the selection +can alter the effective value of the selection. + +The data may also be a vector of valid non-vector selection values. +Interactively, the text of the region is used as the selection value." + (interactive (if (not current-prefix-arg) + (list (read-string "Store text for pasting: ")) + (list (substring (region-beginning) (region-end))))) + (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))) + (if data + (progn +; (mswindows-set-clipboard data) + (setq mswindows-selection-owned-p data)) + (setq mswindows-selection-owned-p nil)) + (setq primary-selection-extent + (select-make-extent-for-selection + data primary-selection-extent)) + (setq zmacs-region-stays t) + data) +(defun mswindows-disown-selection (&optional secondary-p) + "Assuming we own the selection, disown it. With an argument, discard the +secondary selection instead of the primary selection." + (setq mswindows-selection-owned-p nil) + (mswindows-delete-selection)) + +(defun mswindows-selection-owner-p (&optional selection) + "Return t if current emacs process owns the given Selection. +The arg is ignored." + (not (eq mswindows-selection-owned-p nil))) + diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/auto-autoloads.el --- a/lisp/mule/auto-autoloads.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -;;; DO NOT MODIFY THIS FILE -(if (featurep 'mule-autoloads) (error "Already loaded")) - -;;;### (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" "\ -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) - -(autoload 'ccl-dump "mule-ccl" "\ -Disassemble compiled CCL-CODE." nil nil) - -(autoload 'declare-ccl-program "mule-ccl" "\ -Declare NAME as a name of CCL program. - -To compile a CCL program which calls another CCL program not yet -defined, it must be declared as a CCL program in advance. -Optional arg VECTOR is a compiled CCL code of the CCL program." nil 'macro) - -(autoload 'define-ccl-program "mule-ccl" "\ -Set NAME the compiled code of CCL-PROGRAM. -CCL-PROGRAM is `eval'ed before being handed to the CCL compiler `ccl-compile'. -The compiled code is a vector of integers." nil 'macro) - -(autoload 'check-ccl-program "mule-ccl" "\ -Check validity of CCL-PROGRAM. -If CCL-PROGRAM is a symbol denoting a valid CCL program, return -CCL-PROGRAM, else return nil. -If CCL-PROGRAM is a vector and optional arg NAME (symbol) is supplied, -register CCL-PROGRAM by name NAME, and return NAME." nil 'macro) - -(autoload 'ccl-execute-with-args "mule-ccl" "\ -Execute CCL-PROGRAM with registers initialized by the remaining args. -The return value is a vector of resulting CCL registers." nil nil) - -;;;*** - -(provide 'mule-autoloads) diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/chinese.el --- a/lisp/mule/chinese.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/chinese.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; chinese.el --- Support for Chinese -*- coding: iso-2022-7bit; -*- +;;; chinese.el --- Support for Chinese ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -104,34 +104,28 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (make-coding-system -;; 'iso-2022-cn 2 ?C +;; 'chinese-iso-7bit 2 ?C ;; "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)" ;; '(ascii ;; (nil chinese-gb2312 chinese-cns11643-1) ;; (nil chinese-cns11643-2) -;; nil -;; nil ascii-eol ascii-cntl seven locking-shift single-shift nil nil nil -;; init-bol) -;; '((safe-charsets ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2) -;; (mime-charset . iso-2022-cn))) - -;; (define-coding-system-alias 'chinese-iso-7bit 'iso-2022-cn) - -;; (make-coding-system -;; 'iso-2022-cn-ext 2 ?C -;; "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)" -;; '(ascii -;; (nil chinese-gb2312 chinese-cns11643-1) -;; (nil chinese-cns11643-2) ;; (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 ;; chinese-cns11643-6 chinese-cns11643-7) ;; nil ascii-eol ascii-cntl seven locking-shift single-shift nil nil nil -;; init-bol) -;; '((safe-charsets ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2 -;; chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 -;; chinese-cns11643-6 chinese-cns11643-7) -;; (mime-charset . iso-2022-cn-ext))) +;; init-bol)) + +;; (define-coding-system-alias 'iso-2022-cn 'chinese-iso-7bit) +;; (define-coding-system-alias 'iso-2022-cn-ext 'chinese-iso-7bit) +;; (define-prefix-command 'describe-chinese-environment-map) +;; (define-key-after describe-language-environment-map [Chinese] +;; '("Chinese" . describe-chinese-environment-map) +;; t) + +;; (define-prefix-command 'setup-chinese-environment-map) +;; (define-key-after setup-language-environment-map [Chinese] +;; '("Chinese" . setup-chinese-environment-map) +;; t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Chinese GB2312 (simplified) @@ -140,10 +134,8 @@ ;; (make-coding-system ;; 'chinese-iso-8bit 2 ?c ;; "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:CN-GB-2312)" -;; '(ascii chinese-gb2312 nil nil -;; nil ascii-eol ascii-cntl nil nil nil nil) -;; '((safe-charsets ascii chinese-gb2312) -;; (mime-charset . cn-gb-2312))) +;; '((ascii t) chinese-gb2312 chinese-sisheng nil +;; nil ascii-eol ascii-cntl nil nil single-shift nil)) (make-coding-system 'cn-gb-2312 'iso2022 @@ -157,19 +149,14 @@ ;; (define-coding-system-alias 'cn-gb-2312 'chinese-iso-8bit) ;; (define-coding-system-alias 'euc-china 'chinese-iso-8bit) -;; (define-coding-system-alias 'euc-cn 'chinese-iso-8bit) -(define-coding-system-alias 'gb2312 'cn-gb-2312) -(define-coding-system-alias 'chinese-euc 'cn-gb-2312) +(copy-coding-system 'cn-gb-2312 'gb2312) +(copy-coding-system 'cn-gb-2312 'chinese-euc) ;; (make-coding-system ;; 'chinese-hz 0 ?z ;; "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)" -;; nil -;; '((safe-charsets ascii chinese-gb2312) -;; (mime-charset . hz-gb-2312) -;; (post-read-conversion . post-read-decode-hz) -;; (pre-write-conversion . pre-write-encode-hz))) +;; nil) ;; (put 'chinese-hz 'post-read-conversion 'post-read-decode-hz) ;; (put 'chinese-hz 'pre-write-conversion 'pre-write-encode-hz) @@ -184,48 +171,41 @@ ;; (define-coding-system-alias 'hz-gb-2312 'chinese-hz) ;; (define-coding-system-alias 'hz 'chinese-hz) -(define-coding-system-alias 'hz 'hz-gb-2312) +(copy-coding-system 'hz-gb-2312 'hz) +(copy-coding-system 'hz-gb-2312 'chinese-hz) (defun post-read-decode-hz (len) - (let ((pos (point)) - (buffer-modified-p (buffer-modified-p)) - last-coding-system-used) - (prog1 - (decode-hz-region pos (+ pos len)) - (set-buffer-modified-p buffer-modified-p)))) + (let ((pos (point))) + (decode-hz-region pos (+ pos len)))) (defun pre-write-encode-hz (from to) - (let ((buf (current-buffer))) - (set-buffer (generate-new-buffer " *temp*")) + (let ((buf (current-buffer)) + (work (get-buffer-create " *pre-write-encoding-work*"))) + (set-buffer work) + (erase-buffer) (if (stringp from) (insert from) (insert-buffer-substring buf from to)) - (let (last-coding-system-used) - (encode-hz-region 1 (point-max))) + (encode-hz-region 1 (point-max)) nil)) (set-language-info-alist - "Chinese-GB" '((setup-function . setup-chinese-gb-environment-internal) - (charset chinese-gb2312 sisheng) - (coding-system cn-gb-2312 iso-2022-7bit hz-gb-2312) - (coding-priority cn-gb-2312 big5 iso-2022-7bit) - (input-method . "chinese-py-punct") - (features china-util) + "Chinese-GB" '((setup-function . (setup-chinese-gb-environment + . setup-chinese-environment-map)) + (charset . (chinese-gb2312 sisheng)) + (coding-system + . (cn-gb-2312 iso-2022-7bit hz-gb-2312)) (sample-text . "Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B") - (documentation . "Support for Chinese GB2312 character set.")) - '("Chinese")) + (documentation . ("Support for Chinese GB2312 character set." + . describe-chinese-environment-map)) + )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Chinese BIG5 (traditional) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (make-coding-system -;; 'chinese-big5 3 ?B "BIG5 8-bit encoding for Chinese (MIME:CN-BIG5)" -;; nil -;; '((safe-charsets ascii chinese-big5-1 chinese-big5-2) -;; (mime-charset . cn-big5) -;; (charset-origin-alist (chinese-big5-1 "BIG5" encode-big5-char) -;; (chinese-big5-2 "BIG5" encode-big5-char)))) +;; 'chinese-big5 3 ?B "BIG5 8-bit encoding for Chinese (MIME:CN-BIG5)") (make-coding-system 'big5 'big5 @@ -235,7 +215,8 @@ ;; (define-coding-system-alias 'big5 'chinese-big5) ;; (define-coding-system-alias 'cn-big5 'chinese-big5) -(define-coding-system-alias 'cn-big5 'big5) +(copy-coding-system 'big5 'cn-big5) +(copy-coding-system 'big5 'chinese-big5) ;; Big5 font requires special encoding. (define-ccl-program ccl-encode-big5-font @@ -259,29 +240,29 @@ (set-charset-ccl-program 'chinese-big5-2 ccl-encode-big5-font) (set-language-info-alist - "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2) - (coding-system big5 iso-2022-7bit) - (coding-priority big5 cn-gb-2312 iso-2022-7bit) - (input-method . "chinese-py-punct-b5") - (features china-util) + "Chinese-BIG5" '((setup-function . (setup-chinese-big5-environment + . setup-chinese-environment-map)) + (charset . (chinese-big5-1 chinese-big5-2)) + (coding-system . (big5 iso-2022-7bit)) (sample-text . "Cantonese ($(0GnM$(B,$(0N]0*Hd(B) $(0*/=((B, $(0+$)p(B") - (documentation . "Support for Chinese Big5 character set.")) - '("Chinese")) + (documentation . ("Support for Chinese Big5 character set." + . describe-chinese-environment-map)) + )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Chinese CNS11643 (traditional) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (set-language-info-alist -;; "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2 -;; chinese-cns11643-3 chinese-cns11643-4 -;; chinese-cns11643-5 chinese-cns11643-6 -;; chinese-cns11643-7) -;; (coding-system iso-2022-cn) -;; (coding-priority iso-2022-cn chinese-big5 chinese-iso-8bit) -;; (features china-util) -;; (input-method . "chinese-cns-quick") -;; (documentation . "Support for Chinese CNS character sets.")) -;; '("Chinese")) +;; "Chinese-CNS" '((setup-function . (setup-chinese-cns-environment +;; . setup-chinese-environment-map)) +;; (charset . (chinese-cns11643-1 chinese-cns11643-2 +;; chinese-cns11643-3 chinese-cns11643-4 +;; chinese-cns11643-5 chinese-cns11643-6 +;; chinese-cns11643-7)) +;; (coding-system . (chinese-iso-7bit)) +;; (documentation . ("Support for Chinese CNS character sets." +;; . describe-chinese-environment-map)) +;; )) ;;; chinese.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/custom-load.el --- a/lisp/mule/custom-load.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -;;; custom-load.el --- automatically extracted custom dependencies - -;;; Code: - -(custom-add-loads 'mule '("mule-cmds")) - -;;; custom-load.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/cyrillic.el --- a/lisp/mule/cyrillic.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/cyrillic.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; cyrillic.el --- Support for Cyrillic -*- coding: iso-2022-7bit; -*- +;;; cyrillic.el --- Support for languages which use Cyrillic characters ;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -32,23 +32,32 @@ ;; For syntax of Cyrillic (modify-syntax-entry 'cyrillic-iso8859-5 "w") -(modify-syntax-entry ?,L-(B ".") -(modify-syntax-entry ?,Lp(B ".") -(modify-syntax-entry ?,L}(B ".") +(modify-syntax-entry ?.LN- ".") +(modify-syntax-entry ?.LNp ".") +(modify-syntax-entry ?.LN} ".") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; CYRILLIC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (define-prefix-command 'describe-cyrillic-environment-map) +;; (define-key-after describe-language-environment-map [Cyrillic] +;; '("Cyrillic" . describe-cyrillic-environment-map) +;; t) + +;; (define-prefix-command 'setup-cyrillic-environment-map) +;; (define-key-after setup-language-environment-map [Cyrillic] +;; '("Cyrillic" . setup-cyrillic-environment-map) +;; t) + + ;; ISO-8859-5 staff ;; (make-coding-system ;; 'cyrillic-iso-8bit 2 ?5 ;; "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)" -;; '(ascii cyrillic-iso8859-5 nil nil -;; nil nil nil nil nil nil nil) -;; '((safe-charsets ascii cyrillic-iso8859-5) -;; (mime-charset . iso-8859-5))) +;; '((ascii t) (cyrillic-iso8859-5 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil)) ;; (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit) @@ -63,15 +72,14 @@ )) (set-language-info-alist - "Cyrillic-ISO" '((charset cyrillic-iso8859-5) + "Cyrillic-ISO" '((setup-function . (setup-cyrillic-iso-environment + . setup-cyrillic-environment-map)) + (charset . (cyrillic-iso8859-5)) (tutorial . "TUTORIAL.ru") - (coding-system iso-8859-5) - (coding-priority iso-8859-5) - (input-method . "cyrillic-yawerty") - (features cyril-util) - (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") - (documentation . "Support for Cyrillic ISO-8859-5.")) - '("Cyrillic")) + (coding-system . (iso-8859-5)) + (sample-text . "Russian (.LN@NcNaNaNZNXNY) N7NTN`NPNRNaNbNRNcNYNbNU!") + (documentation . ("Support for Cyrillic ISO-8859-5." + . describe-cyrillic-environment-map)))) ;; KOI-8 staff @@ -88,13 +96,13 @@ 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 ?$B(!(B ?$B("(B ?$B(#(B ?$B($(B ?$B(&(B ?$B(%(B ?$B('(B ?$B()(B ?$B(((B ?$B(*(B ?$B(+(B 32 ?$(G#'(B ?$(G#+(B ?$(G#/(B 32 - 32 ?$(C"F(B 32 32 ?$B"#(B 32 ?$B"e(B ?$A!V(B ?$A!\(B ?$A!](B ?,L (B 32 ?,A0(B ?,A2(B ?,A7(B ?,Aw(B - ?$(G#D(B 32 32 ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 ?$(G#E(B - 32 32 ?$(G#G(B ?,L!(B 32 32 32 32 32 32 32 32 ?$(G#F(B 32 32 ?,A)(B - ?,Ln(B ?,LP(B ?,LQ(B ?,Lf(B ?,LT(B ?,LU(B ?,Ld(B ?,LS(B ?,Le(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B - ?,L_(B ?,Lo(B ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,LV(B ?,LR(B ?,Ll(B ?,Lk(B ?,LW(B ?,Lh(B ?,Lm(B ?,Li(B ?,Lg(B ?,Lj(B - ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B - ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B ] + 144 ?$(C"F(B 146 147 ?$B"#(B 149 ?$B"e(B ?$A!V(B ?$A!\(B ?$A!](B ?.AN 32 ?N0 ?N2 ?N7 ?Nw + ?$(G#D(B 32 32 ?.LNq 32 32 32 32 32 32 32 32 32 32 32 ?$(G#E(B + 32 32 ?$(G#G(B ?.LN! 32 32 32 32 32 32 32 32 ?$(G#F(B 32 32 ?.AN) + ?.LNn ?NP ?NQ ?Nf ?NT ?NU ?Nd ?NS ?Ne ?NX ?NY ?NZ ?N[ ?N\ ?N] ?N^ + ?.LN_ ?No ?N` ?Na ?Nb ?Nc ?NV ?NR ?Nl ?Nk ?NW ?Nh ?Nm ?Ni ?Ng ?Nj + ?.LNN ?N0 ?N1 ?NF ?N4 ?N5 ?ND ?N3 ?NE ?N8 ?N9 ?N: ?N; ?N< ?N= ?N> + ?.LN? ?NO ?N@ ?NA ?NB ?NC ?N6 ?N2 ?NL ?NK ?N7 ?NH ?NM ?NI ?NG ?NJ ] "Cyrillic KOI8-R decoding table.") (defvar cyrillic-koi8-r-encode-table @@ -102,7 +110,7 @@ (i 0)) (while (< i 256) (let* ((ch (aref cyrillic-koi8-r-decode-table i)) - (split (split-char ch))) + (split (split-char-or-char-int ch))) (cond ((eq (car split) 'cyrillic-iso8859-5) (aset table (logior (nth 1 split) 128) i) ) @@ -133,22 +141,17 @@ (write-read-repeat r0 , cyrillic-koi8-r-encode-table)))))) "CCL program to encode KOI8.") -;; (make-coding-system -;; 'cyrillic-koi8 4 -;; ;; We used to use ?K. It is true that ?K is more strictly correct, -;; ;; but it is also used for Korean. -;; ;; So people who use koi8 for languages other than Russian -;; ;; will have to forgive us. -;; ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)" -;; '(ccl-decode-koi8 . ccl-encode-koi8) -;; '((safe-charsets ascii cyrillic-iso8859-5) -;; (mime-charset . koi8-r) -;; (valid-codes (0 . 127) 163 179 (192 . 255)) -;; (charset-origin-alist (cyrillic-iso8859-5 "KOI8-R" -;; cyrillic-encode-koi8-r-char)))) +;(make-coding-system +; 'cyrillic-koi8 4 +; ;; We used to use ?K. It is true that ?K is more strictly correct, +; ;; but it is also used for Korean. +; ;; So people who use koi8 for languages other than Russian +; ;; will have to forgive us. +; ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)" +; (cons ccl-decode-koi8 ccl-encode-koi8)) -;; (define-coding-system-alias 'koi8-r 'cyrillic-koi8) -;; (define-coding-system-alias 'koi8 'cyrillic-koi8) +;(define-coding-system-alias 'koi8-r 'cyrillic-koi8) +;(define-coding-system-alias 'koi8 'cyrillic-koi8) (make-coding-system 'koi8-r 'ccl @@ -157,102 +160,83 @@ encode ,ccl-encode-koi8 mnemonic "KOI8")) -;; it is not correct, but XEmacs doesn't have `ccl' category... -(coding-system-put 'koi8-r 'category 'iso-8-1) +;(define-coding-system-alias 'koi8-r 'koi8) ;; (define-ccl-program ccl-encode-koi8-font -;; `(0 -;; ((r1 |= 128) -;; (r1 = r1 ,cyrillic-koi8-r-encode-table))) +;; '(0 +;; ((r1 -= 160) +;; (r1 = r1 +;; [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32 +;; 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240 +;; 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241 +;; 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208 +;; 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209 +;; 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) +;; )) ;; "CCL program to encode Cyrillic chars to KOI font.") ;; (setq font-ccl-encoder-alist ;; (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist)) -;; (defvar cyrillic-koi8-r-nonascii-translation-table -;; (make-translation-table-from-vector cyrillic-koi8-r-decode-table) -;; "Value of `nonascii-translation-table' in Cyrillic-KOI8 language environment..") - (set-language-info-alist - "Cyrillic-KOI8" '((charset cyrillic-iso8859-5) - (coding-system koi8-r) - (coding-priority koi8-r) - (input-method . "cyrillic-yawerty") - (features cyril-util) + "Cyrillic-KOI8" '((setup-function . (setup-cyrillic-koi8-environment + . setup-cyrillic-environment-map)) + (charset . (cyrillic-iso8859-5)) + (coding-system . (koi8-r)) (tutorial . "TUTORIAL.ru") - (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") - (documentation . "Support for Cyrillic KOI8-R.")) - '("Cyrillic")) + (sample-text . "Russian (.LN@NcNaNaNZNXNY) N7NTN`NPNRNaNbNRNcNYNbNU!") + (documentation . ("Support for Cyrillic KOI-8." + . describe-cyrillic-environment-map)))) ;;; ALTERNATIVNYJ staff -(eval-and-compile - -(defvar cyrillic-alternativnyj-decode-table - [ - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - ?,L0(B ?,L1(B ?,L2(B ?,L3(B ?,L4(B ?,L5(B ?,L6(B ?,L7(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B ?,L?(B - ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,LD(B ?,LE(B ?,LF(B ?,LG(B ?,LH(B ?,LI(B ?,LJ(B ?,LK(B ?,LL(B ?,LM(B ?,LN(B ?,LO(B - ?,LP(B ?,LQ(B ?,LR(B ?,LS(B ?,LT(B ?,LU(B ?,LV(B ?,LW(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B ?,L_(B - 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 - 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 - 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 - ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,Ld(B ?,Le(B ?,Lf(B ?,Lg(B ?,Lh(B ?,Li(B ?,Lj(B ?,Lk(B ?,Ll(B ?,Lm(B ?,Ln(B ?,Lo(B - ?,L!(B ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 32 32 ?,Lp(B] - "Cyrillic ALTERNATIVNYJ decoding table.") - -(defvar cyrillic-alternativnyj-encode-table - (let ((table (make-vector 256 32)) - (i 0)) - (while (< i 256) - (let* ((ch (aref cyrillic-alternativnyj-decode-table i)) - (split (split-char ch))) - (if (eq (car split) 'cyrillic-iso8859-5) - (aset table (logior (nth 1 split) 128) i) - (if (/= ch 32) - (aset table ch i)))) - (setq i (1+ i))) - table) - "Cyrillic ALTERNATIVNYJ encoding table.") - -) - - (define-ccl-program ccl-decode-alternativnyj - `(3 + '(3 ((read r0) (loop - (write-read-repeat r0 ,cyrillic-alternativnyj-decode-table)))) + (write-read-repeat + r0 + [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + ?.LN0 ?N1 ?N2 ?N3 ?N4 ?N5 ?N6 ?N7 ?N8 ?N9 ?N: ?N; ?N< ?N= ?N> ?N? + ?.LN@ ?NA ?NB ?NC ?ND ?NE ?NF ?NG ?NH ?NI ?NJ ?NK ?NL ?NM ?NN ?NO + ?.LNP ?NQ ?NR ?NS ?NT ?NU ?NV ?NW ?NX ?NY ?NZ ?N[ ?N\ ?N] ?N^ ?N_ + 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 + 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 + 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 + ?.LN` ?Na ?Nb ?Nc ?Nd ?Ne ?Nf ?Ng ?Nh ?Ni ?Nj ?Nk ?Nl ?Nm ?Nn ?No + ?.LN! ?Nq 32 32 32 32 32 32 32 32 32 32 32 32 32 ?Np])))) "CCL program to decode Alternativnyj.") (define-ccl-program ccl-encode-alternativnyj `(1 ((read r0) (loop - (if (r0 != ,(charset-id 'cyrillic-iso8859-5)) - (write-read-repeat r0) - ((read r0) - (write-read-repeat r0 ,cyrillic-alternativnyj-encode-table)))))) + (if (r0 != ,(charset-id 'cyrillic-iso8859-5)) + (write-read-repeat r0) + ((read r0) + (r0 -= 160) + (write-read-repeat + r0 + [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32 + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 + 255 241 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) + ))))) "CCL program to encode Alternativnyj.") ;; (make-coding-system -;; 'cyrillic-alternativnyj 4 ?A -;; "ALTERNATIVNYJ 8-bit encoding for Cyrillic" -;; '(ccl-decode-alternativnyj . ccl-encode-alternativnyj) -;; '((safe-charsets ascii cyrillic-iso8859-5) -;; (valid-codes (0 . 175) (224 . 241) 255) -;; (charset-origin-alist (cyrillic-iso8859-5 "ALTERNATIVNYJ" -;; cyrillic-encode-koi8-r-char)))) - - -;; (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj) +;; 'alternativnyj 4 +;; ?A "Coding-system used for Alternativnyj" +;; (cons ccl-decode-alternativnyj ccl-encode-alternativnyj)) (make-coding-system 'alternativnyj 'ccl @@ -261,32 +245,65 @@ encode ,ccl-encode-alternativnyj mnemonic "Cy.Alt")) -;; it is not correct, but XEmacs doesn't have `ccl' category... -(coding-system-put 'alternativnyj 'category 'iso-8-1) - ;; (define-ccl-program ccl-encode-alternativnyj-font ;; '(0 -;; ((r1 |= 128) -;; (r1 = r1 ,cyrillic-alternativnyj-encode-table))) +;; ((r1 -= 160) +;; (r1 = r1 +;; [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32 +;; 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +;; 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 +;; 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 +;; 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 +;; 255 241 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) +;; )) ;; "CCL program to encode Cyrillic chars to Alternativnyj font.") ;; (setq font-ccl-encoder-alist ;; (cons (cons "alternativnyj" ccl-encode-alternativnyj-font) ;; font-ccl-encoder-alist)) -;; (defvar cyrillic-alternativnyj-nonascii-translation-table -;; (make-translation-table-from-vector cyrillic-alternativnyj-decode-table) -;; "Value of `nonascii-translation-table' in Cyrillic-ALT language environment.") +(set-language-info-alist + "Cyrillic-ALT" '((setup-function . (setup-cyrillic-alternativnyj-environment + . setup-cyrillic-environment-map)) + (charset . (cyrillic-iso8859-5)) + (coding-system . (alternativnyj)) + (tutorial . "TUTORIAL.ru") + (sample-text . "Russian (.LN@NcNaNaNZNXNY) N7NTN`NPNRNaNbNRNcNYNbNU!") + (documentation . ("Support for Cyrillic ALTERNATIVNYJ." + . describe-cyrillic-environment-map)))) + +;;; GENERAL + +(defun setup-cyrillic-environment () + "Setup multilingual environment for Cyrillic users." + (interactive) + (setq primary-language "Cyrillic") + + (setq coding-category-iso-8-1 'iso-8859-5) + + (set-coding-priority + '(coding-category-iso-7 + coding-category-iso-8-1)) + + (setq-default buffer-file-coding-system 'iso-8859-5) + (set-terminal-coding-system 'iso-8859-5) + (set-keyboard-coding-system 'iso-8859-5) + + (setq default-input-method '("Cyrillic" . "quail-yawerty")) + ) + +(defun describe-cyrillic-support () + "Describe how Emacs support Cyrillic." + (interactive) + (describe-language-support-internal "Cyrillic")) (set-language-info-alist - "Cyrillic-ALT" '((charset cyrillic-iso8859-5) - (coding-system alternativnyj) - (coding-priority alternativnyj) - (input-method . "cyrillic-yawerty") - (features cyril-util) - (tutorial . "TUTORIAL.ru") - (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") - (documentation . "Support for Cyrillic ALTERNATIVNYJ.")) - '("Cyrillic")) + "Cyrillic" '((setup-function . setup-cyrillic-environment) + (describe-function . describe-cyrillic-support) + (charset . (cyrillic-iso8859-5)) + (tutorial . "TUTORIAL.ru") + (coding-system . (iso-8859-5 koi8-r alternativnyj)) + (sample-text . "Russian (.LN@NcNaNaNZNXNY) N7NTN`NPNRNaNbNRNcNYNbNU!") + (documentation . nil))) ;;; cyrillic.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/english.el --- a/lisp/mule/english.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/english.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,8 @@ ;;; english.el --- English support -;; Copyright (C) 1997,1999 Electrotechnical Laboratory, JAPAN. +;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. +;; Copyright (C) 1997 MORIOKA Tomohiko ;; Keywords: multibyte character, character set, syntax, category @@ -26,19 +27,92 @@ ;; We need nothing special to support English on Emacs. Selecting ;; English as a language environment is one of the ways to reset -;; various multilingual environment to the original setting. +;; various multilingual environment to the original settting. + +;; modified for XEmacs by MORIOKA Tomohiko ;;; Code (defun setup-english-environment () "Reset multilingual environment of Emacs to the default status. -See the function `reset-language-environment' for more detail." +The default status is as follows. + + The default value of enable-multibyte-characters is t. + + The default value of buffer-file-coding-system is nil. + The coding system for terminal output is nil. + The coding system for keyboard input is nil. + + The order of priorities of coding categories and the coding system + bound to each category are as follows + coding category coding system + -------------------------------------------------- + coding-category-iso-7 iso-2022-7bit + coding-category-iso-8-1 iso-8859-1 + coding-category-iso-8-2 iso-8859-1 + coding-category-iso-7-else iso-2022-7bit-lock + coding-category-iso-8-else iso-2022-8bit-ss2 + coding-category-emacs-mule no-conversion + coding-category-sjis japanese-shift-jis + coding-category-big5 chinese-big5 + coding-category-binarry no-conversion +" (interactive) - (reset-language-environment)) + ;; (setq-default enable-multibyte-characters t) + + ;; (setq coding-category-iso-7 'iso-2022-7bit + ;; coding-category-iso-8-1 'iso-8859-1 + ;; coding-category-iso-8-2 'iso-8859-1 + ;; coding-category-iso-7-else 'iso-2022-7bit-lock + ;; coding-category-iso-8-else 'iso-2022-8bit-ss2 + ;; coding-category-emacs-mule 'no-conversion + ;; coding-category-sjis 'japanese-shift-jis + ;; coding-category-big5 'chinese-big5 + ;; coding-category-binary 'binary) + (set-coding-category-system 'iso-7 'iso-2022-7bit) + (set-coding-category-system 'iso-8-1 'iso-8859-1) + (set-coding-category-system 'iso-8-2 'iso-8859-1) + (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) + (set-coding-category-system 'iso-8-designate 'ctext) + (set-coding-category-system 'no-conversion 'no-conversion) + (set-coding-category-system 'shift-jis 'shift_jis) + (set-coding-category-system 'big5 'big5) + + ;; (set-coding-priority + ;; '(coding-category-iso-7 + ;; coding-category-iso-8-2 + ;; coding-category-iso-8-1 + ;; coding-category-iso-7-else + ;; coding-category-iso-8-else + ;; coding-category-emacs-mule + ;; coding-category-raw-text + ;; coding-category-sjis + ;; coding-category-big5 + ;; coding-category-binary)) + (set-coding-priority-list + '(iso-7 + iso-8-2 + iso-8-1 + iso-8-designate + iso-lock-shift + no-conversion + shift-jis + big5)) + + (set-default-coding-systems nil) + ;; Don't alter the terminal and keyboard coding systems here. + ;; The terminal still supports the same coding system + ;; that it supported a minute ago. +;;; (set-terminal-coding-system-internal nil) +;;; (set-keyboard-coding-system-internal nil) + + ;;(setq nonascii-insert-offset 0) + ) (set-language-info-alist - "English" '((tutorial . "TUTORIAL") - (charset ascii) + "English" '((setup-function . setup-english-environment) + (tutorial . "TUTORIAL") + (charset . (ascii)) (sample-text . "Hello!, Hi!, How are you?") (documentation . "\ Nothing special is needed to handle English.") diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/ethiopic.el --- a/lisp/mule/ethiopic.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/ethiopic.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ -;;; ethiopic.el --- Support for Ethiopic -*- coding: iso-2022-7bit; -*- +;;; ethiopic.el --- Support for Ethiopic -;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. +;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. ;; Copyright (C) 1997 MORIOKA Tomohiko diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/european.el --- a/lisp/mule/european.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/european.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; european.el --- European languages -*- coding: iso-2022-7bit; -*- +;;; european.el --- Support for European languages ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -27,8 +27,6 @@ ;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported. -;; #### latin.el would be a better name for this file. - ;;; Code: ;; For syntax of Latin-1 characters. @@ -50,114 +48,130 @@ (modify-syntax-entry ?,BW(B ".") (modify-syntax-entry ?,Bw(B ".") -;; For syntax of Latin-3 -(loop for c in '(?,C!(B ?,C&(B ?,C)(B ?,C*(B ?,C+(B ?,C,(B ?,C/(B ?,C1(B ?,C5(B ?,C6(B ?,C:(B ?,C;(B ?,C<(B ?,C?(B) - do (modify-syntax-entry c "w")) - -(loop for c from 64 to 126 - do (modify-syntax-entry (make-char 'latin-iso8859-3 c) "w")) - -(modify-syntax-entry (make-char 'latin-iso8859-3 32) "w") ; no-break space -(modify-syntax-entry ?,CW(B ".") -(modify-syntax-entry ?,Cw(B ".") - -;; For syntax of Latin-4 -(loop for c in '(?,D!(B ?,D"(B ?,D#(B ?,D%(B ?,D&(B ?,D)(B ?,D*(B ?,D+(B ?,D,(B ?,D.(B ?,D1(B ?,D3(B ?,D5(B ?,D6(B ?,D9(B ?,D:(B ?,D;(B ?,D<(B ?,D=(B ?,D>(B ?,D?(B) - do (modify-syntax-entry c "w")) - -(loop for c from 64 to 126 - do (modify-syntax-entry (make-char 'latin-iso8859-4 c) "w")) - -(modify-syntax-entry (make-char 'latin-iso8859-4 32) "w") ; no-break space -(modify-syntax-entry ?,DW(B ".") -(modify-syntax-entry ?,Dw(B ".") - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; EUROPEANS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (define-prefix-command 'describe-european-environment-map) +;; (define-key-after describe-language-environment-map [European] +;; '("European" . describe-european-environment-map) +;; t) + +;; (define-prefix-command 'setup-european-environment-map) +;; (define-key-after setup-language-environment-map [European] +;; '("European" . setup-european-environment-map) +;; t) + +;; Setup for LANGAUGE which uses one-byte 8-bit CHARSET, one-byte +;; 8-bit CODING-SYSTEM, and INPUT-METHOD. +(defun setup-8-bit-environment (language charset coding-system input-method) + (setup-english-environment) + (set-default-coding-systems coding-system) + ;; (setq coding-category-iso-8-1 coding-system + ;; coding-category-iso-8-2 coding-system) + (set-coding-category-system 'iso-8-1 coding-system) + (set-coding-category-system 'iso-8-2 coding-system) + + ;; (if charset + ;; (let ((nonascii-offset (- (make-char charset) 128))) + ;; ;; Set up for insertion of characters in this character set + ;; ;; when codes 0200 - 0377 are typed in. + ;; (setq nonascii-insert-offset nonascii-offset))) + + (if input-method + (setq default-input-method input-method)) + + ;; If this is a Latin-N character set, set up syntax for it in + ;; single-byte mode. We can't use require because the file + ;; must be eval'd each time in case we change from one Latin-N to another. + ;; (if (string-match "^Latin-\\([1-9]\\)$" language) + ;; (load (downcase language) nil t)) + ) ;; Latin-1 (ISO-8859-1) ;; (make-coding-system ;; 'iso-latin-1 2 ?1 -;; "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)" -;; '(ascii latin-iso8859-1 nil nil -;; nil nil nil nil nil nil nil nil nil nil nil nil t) -;; '((safe-charsets ascii latin-iso8859-1) -;; (mime-charset . iso-8859-1))) +;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-1, Compound Text Encoding)" +;; '((ascii t) (latin-iso8859-1 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t)) ;; (define-coding-system-alias 'iso-8859-1 'iso-latin-1) ;; (define-coding-system-alias 'latin-1 'iso-latin-1) - -;; (make-coding-system -;; 'compound-text 2 ?1 -;; "ISO 2022 based encoding used in inter client communication of X" -;; '((ascii t) (latin-iso8859-1 t) nil nil -;; nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t) -;; '((safe-charsets . t))) - -;; (define-coding-system-alias 'ctext 'compound-text) +;; (define-coding-system-alias 'ctext 'iso-latin-1) (defun setup-latin1-environment () "Set up multilingual environment (MULE) for European Latin-1 users." (interactive) - (set-language-environment "Latin-1")) + (setup-8-bit-environment "Latin-1" 'latin-iso8859-1 'iso-8859-1 + "latin-1-prefix")) (set-language-info-alist - "Latin-1" '((charset ascii latin-iso8859-1) - (coding-system iso-8859-1) - (coding-priority iso-8859-1) - (input-method . "latin-1-prefix") + "Latin-1" '((setup-function . (setup-latin1-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-1)) + (coding-system . (iso-8859-1)) (sample-text . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") - (documentation . "\ -This language environment is a generic one for Latin-1 (ISO-8859-1) -character set which supports the following languages: + (documentation . ("\ +These languages are supported with the Latin-1 (ISO-8859-1) character set: Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish. -We also have a German specific language environment \"German\".")) - '("European")) +" . describe-european-environment-map)) + )) (set-language-info-alist - "French" '((charset ascii latin-iso8859-1) - (coding-system iso-8859-1) - (coding-priority iso-8859-1) - (tutorial . "TUTORIAL.fr") - (sample-text - . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") - (documentation . ("\ + "German" '((setup-function . (setup-latin1-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-1)) + (coding-system . (iso-8859-1)) + (tutorial . "TUTORIAL.de") + (sample-text + . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") + (documentation . ("\ These languages are supported with the Latin-1 (ISO-8859-1) character set: Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish. -"))) - '("European")) +" . describe-european-environment-map)) + )) (set-language-info-alist - "Norwegian" '((charset ascii latin-iso8859-1) - (coding-system iso-8859-1) - (coding-priority iso-8859-1) - (tutorial . "TUTORIAL.no") - (sample-text - . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") - (documentation . ("\ + "French" '((setup-function . (setup-latin1-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-1)) + (coding-system . (iso-8859-1)) + (tutorial . "TUTORIAL.fr") + (sample-text + . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") + (documentation . ("\ These languages are supported with the Latin-1 (ISO-8859-1) character set: Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish. -"))) - '("European")) +" . describe-european-environment-map)) + )) +(set-language-info-alist + "Norwegian" '((setup-function . (setup-latin1-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-1)) + (coding-system . (iso-8859-1)) + (tutorial . "TUTORIAL.no") + (sample-text + . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") + (documentation . ("\ +These languages are supported with the Latin-1 (ISO-8859-1) character set: + Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic, + Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish. +" . describe-european-environment-map)) + )) ;; Latin-2 (ISO-8859-2) ;; (make-coding-system ;; 'iso-latin-2 2 ?2 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)" -;; '(ascii latin-iso8859-2 nil nil -;; nil nil nil nil nil nil nil) -;; '((safe-charsets ascii latin-iso8859-2) -;; (mime-charset . iso-8859-2))) +;; '((ascii t) (latin-iso8859-2 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil)) ;; (define-coding-system-alias 'iso-8859-2 'iso-latin-2) ;; (define-coding-system-alias 'latin-2 'iso-latin-2) @@ -174,65 +188,67 @@ (defun setup-latin2-environment () "Set up multilingual environment (MULE) for European Latin-2 users." (interactive) - (set-language-environment "Latin-2")) + (setup-8-bit-environment "Latin-2" 'latin-iso8859-2 'iso-8859-2 + "latin-2-prefix")) (set-language-info-alist - "Latin-2" '((charset ascii latin-iso8859-2) - (coding-system iso-8859-2) - (coding-priority iso-8859-2) - (input-method . "latin-2-prefix") - (documentation . "\ -This language environment is a generic one for Latin-2 (ISO-8859-2) -character set which supports the following languages: + "Latin-2" '((setup-function . (setup-latin2-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-2)) + (coding-system . (iso-8859-2)) + (documentation . ("\ +These languages are supported with the Latin-2 (ISO-8859-2) character set: Albanian, Czech, English, German, Hungarian, Polish, Romanian, - Serbian, Croatian, Slovak, Slovene, Sorbian (upper and lower), - and Swedish.")) - '("European")) + Serbian, Croatian, Slovak, Slovene, and Swedish. +" . describe-european-environment-map)) + )) (set-language-info-alist - "Croatian" '((charset ascii latin-iso8859-2) - (coding-system iso-8859-2) - (coding-priority iso-8859-2) + "Croatian" '((setup-function . (setup-latin2-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-2)) (tutorial . "TUTORIAL.hr") - (documentation . "\ -This language environment is a generic one for Latin-2 (ISO-8859-2) -character set which supports the following languages: + (coding-system . (iso-8859-2)) + (documentation . ("\ +These languages are supported with the Latin-2 (ISO-8859-2) character set: Albanian, Czech, English, German, Hungarian, Polish, Romanian, - Serbian, Croatian, Slovak, Slovene, Sorbian (upper and lower), - and Swedish.")) - '("European")) + Serbian, Croatian, Slovak, Slovene, and Swedish. +" . describe-european-environment-map)) + )) (set-language-info-alist - "Polish" '((charset ascii latin-iso8859-2) - (coding-system iso-8859-2) - (coding-priority iso-8859-2) - (tutorial . "TUTORIAL.pl") - (documentation . "\ -This language environment is a generic one for Latin-2 (ISO-8859-2) -character set which supports the following languages: + "Polish" '((setup-function . (setup-latin2-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-2)) + (tutorial . "TUTORIAL.pl") + (coding-system . (iso-8859-2)) + (documentation . ("\ +These languages are supported with the Latin-2 (ISO-8859-2) character set: Albanian, Czech, English, German, Hungarian, Polish, Romanian, - Serbian, Croatian, Slovak, Slovene, Sorbian (upper and lower), - and Swedish.")) - '("European")) + Serbian, Croatian, Slovak, Slovene, and Swedish. +" . describe-european-environment-map)) + )) ;; Romanian support originally from romanian.el (defun setup-romanian-environment () "Setup multilingual environment (MULE) for Romanian." (interactive) - (set-language-environment "Romanian")) + (setup-8-bit-environment "Romanian" 'latin-iso8859-2 'iso-8859-2 + "romanian")) (set-language-info-alist - "Romanian" '((charset ascii latin-iso8859-2) - (coding-system iso-8859-2) - (coding-priority iso-8859-2) - (input-method . "latin-2-postfix") + "Romanian" '((setup-function . (setup-romanian-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-2)) (tutorial . "TUTORIAL.ro") - (sample-text . "Bun,Bc(B ziua, bine a,B~(Bi venit!") - (documentation . t)) - '("European")) - -(provide 'romanian) + (coding-system . (iso-8859-2)) + (documentation . ("\ +These languages are supported with the Latin-2 (ISO-8859-2) character set: + Albanian, Czech, English, German, Hungarian, Polish, Romanian, + Serbian, Croatian, Slovak, Slovene, and Swedish. +" . describe-european-environment-map)) + )) ;; Czech support originally from czech.el ;; Author: Milan Zamazal @@ -241,18 +257,24 @@ (defun setup-czech-environment () "Set up multilingual environment (MULE) for czech users." (interactive) - (set-language-environment "Czech")) + (setup-8-bit-environment "Czech" 'latin-iso8859-2 'iso-8859-2 + "czech")) + (set-language-info-alist - "Czech" '((charset ascii latin-iso8859-2) - (coding-system iso-8859-2) - (coding-priority iso-8859-2) - (tutorial . "TUTORIAL.cs") - (sample-text . "P,Bx(Bejeme v,Ba(Bm hezk,B}(B den!") - (documentation . t)) - '("European")) + "Czech" + '((setup-function . (setup-czech-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-2)) + (coding-system . (iso-8859-2)) + (tutorial . "TUTORIAL.cs") + (documentation . ("\ +These languages are supported with the Latin-2 (ISO-8859-2) character set: +Albanian, Czech, English, German, Hungarian, Polish, Romanian, +Serbian, Croatian, Slovak, Slovene, and Swedish. +" . describe-european-environment-map)) +)) -(provide 'czech) ;; Latin-3 (ISO-8859-3) @@ -260,10 +282,8 @@ ;; (make-coding-system ;; 'iso-latin-3 2 ?3 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)" -;; '(ascii latin-iso8859-3 nil nil -;; nil nil nil nil nil nil nil) -;; '((safe-charsets ascii latin-iso8859-3) -;; (mime-charset . iso-8859-3))) +;; '((ascii t) (latin-iso8859-3 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil)) ;; (define-coding-system-alias 'iso-8859-3 'iso-latin-3) ;; (define-coding-system-alias 'latin-3 'iso-latin-3) @@ -280,29 +300,28 @@ (defun setup-latin3-environment () "Set up multilingual environment (MULE) for European Latin-3 users." (interactive) - (set-language-environment "Latin-3")) + (setup-8-bit-environment "Latin-3" 'latin-iso8859-3 'iso-8859-3 + "latin-3-prefix")) (set-language-info-alist - "Latin-3" '((charset ascii latin-iso8859-3) - (coding-system iso-8859-3) - (coding-priority iso-8859-3) - (input-method . "latin-3-prefix") - (documentation . "\ + "Latin-3" '((setup-function . (setup-latin3-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-3)) + (coding-system . (iso-8859-3)) + (documentation . ("\ These languages are supported with the Latin-3 (ISO-8859-3) character set: Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician, - German, Italian, Maltese, Spanish, and Turkish.")) - '("European")) - + German, Italian, Maltese, Spanish, and Turkish. +" . describe-european-environment-map)) + )) ;; Latin-4 (ISO-8859-4) ;; (make-coding-system ;; 'iso-latin-4 2 ?4 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)" -;; '(ascii latin-iso8859-4 nil nil -;; nil nil nil nil nil nil nil) -;; '((safe-charsets ascii latin-iso8859-4) -;; (mime-charset . iso-8895-4))) +;; '((ascii t) (latin-iso8859-4 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil)) ;; (define-coding-system-alias 'iso-8859-4 'iso-latin-4) ;; (define-coding-system-alias 'latin-4 'iso-latin-4) @@ -319,29 +338,28 @@ (defun setup-latin4-environment () "Set up multilingual environment (MULE) for European Latin-4 users." (interactive) - (set-language-environment "Latin-4")) + (setup-8-bit-environment "Latin-4" 'latin-iso8859-4 'iso-8859-4 + "latin-4-prefix")) (set-language-info-alist - "Latin-4" '((charset ascii latin-iso8859-4) - (coding-system iso-8859-4) - (coding-priority iso-8859-4) - (input-method . "latin-4-prefix") - (documentation . "\ + "Latin-4" '((setup-function . (setup-latin4-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-4)) + (coding-system . (iso-8859-4)) + (documentation . ("\ These languages are supported with the Latin-4 (ISO-8859-4) character set: Danish, English, Estonian, Finnish, German, Greenlandic, Lappish, - Latvian, Lithuanian, and Norwegian.")) - '("European")) - + Latvian, Lithuanian, and Norwegian. +" . describe-european-environment-map)) + )) ;; Latin-5 (ISO-8859-9) ;; (make-coding-system ;; 'iso-latin-5 2 ?9 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)" -;; '(ascii latin-iso8859-9 nil nil -;; nil nil nil nil nil nil nil) -;; '((safe-charsets ascii latin-iso8859-9) -;; (mime-charset . iso-8859-9))) +;; '((ascii t) (latin-iso8859-9 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil)) ;; (define-coding-system-alias 'iso-8859-9 'iso-latin-5) ;; (define-coding-system-alias 'latin-5 'iso-latin-5) @@ -358,52 +376,46 @@ (defun setup-latin5-environment () "Set up multilingual environment (MULE) for European Latin-5 users." (interactive) - (set-language-environment "Latin-5")) - -(set-language-info-alist - "Latin-5" '((charset ascii latin-iso8859-9) - (coding-system iso-8859-9) - (coding-priority iso-8859-9) - (input-method . "latin-5-prefix") - (documentation . "\ -These languages are supported with the Latin-5 (ISO-8859-9) character set.")) - '("European")) - - -(defun setup-german-environment () - "Set up multilingual environment (MULE) for German users." - (interactive) - (set-language-environment "German")) + (setup-8-bit-environment "Latin-5" 'latin-iso8859-9 'iso-8859-5 + "latin-5-prefix")) (set-language-info-alist - "German" '((tutorial . "TUTORIAL.de") - (charset ascii latin-iso8859-1) - (coding-system iso-8859-1) - (coding-priority iso-8859-1) - (input-method . "german-postfix") - (sample-text . "\ -German (Deutsch Nord) Guten Tag -German (Deutsch S,A|(Bd) Gr,A|_(B Gott") - (documentation . "\ -This language environment is almost the same as Latin-1, -but default input method is set to \"german-postfix\".")) - '("European")) + "Latin-5" '((setup-function . (setup-latin5-environment + . setup-european-environment-map)) + (charset . (ascii latin-iso8859-9)) + (coding-system . (iso-8859-5)) + (documentation . ("\ +These languages are supported with the Latin-5 (ISO-8859-9) character set. +" . describe-european-environment-map)) + )) + +;; (defun setup-european-environment () +;; "Setup multilingual environment (MULE) for European languages users. +;; It actually reset MULE to the default status, and +;; set quail-latin-1 as the default input method to be selected. +;; See also the documentation of setup-english-environment." +;; (setup-english-environment) +;; (setq default-input-method '("European" . "quail-latin-1"))) -(defun setup-slovenian-environment () - "Setup multilingual environment (MULE) for Slovenian." - (interactive) - (set-language-environment "Slovenian")) +;; (defun describe-european-support () +;; "Describe how Emacs support European languages." +;; (interactive) +;; (describe-language-support-internal "European")) -(set-language-info-alist - "Slovenian" '((charset . (ascii latin-iso8859-2)) - (coding-system . (iso-8859-2)) - (coding-priority . (iso-8859-2)) - (input-method . "latin-2-postfix") - (tutorial . "TUTORIAL.sl") - (sample-text . ",B.(Belimo vam uspe,B9(Ben dan!") - (documentation . t)) - '("European")) - -(provide 'slovenian) +;; (set-language-info-alist +;; "European" '((setup-function . setup-european-environment) +;; (describe-function . describe-european-support) +;; (charset . (ascii latin-iso8859-1 latin-iso8859-2 +;; latin-iso8859-3 latin-iso8859-4 latin-iso8859-9)) +;; (coding-system . (iso-8859-1 iso-8859-2 iso-8859-3 +;; iso-8859-4 iso-8859-9)) +;; (sample-text +;; . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") +;; (documentation . "\ +;; Almost all of European languages are supported by the character sets and +;; coding systems listed below. +;; To input them, LEIM (Libraries for Emacs Input Methods) should have been +;; installed.") +;; )) ;;; european.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/greek.el --- a/lisp/mule/greek.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/greek.el Mon Aug 13 11:20:41 2007 +0200 @@ -33,25 +33,31 @@ (loop for c from 54 to 126 do (modify-syntax-entry (make-char 'greek-iso8859-7 c) "w")) (modify-syntax-entry (make-char 'greek-iso8859-7 32) "w") ; no-break space -(modify-syntax-entry ?.FN7 ".") -(modify-syntax-entry ?N; ".") -(modify-syntax-entry ?N= ".") +(modify-syntax-entry ?,F7(B ".") +(modify-syntax-entry ?,F;(B ".") +(modify-syntax-entry ?,F=(B ".") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; GREEK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (define-language-environment 'greek +;; "Greek" +;; (lambda () +;; (set-coding-category-system 'iso-8-designate 'iso-8859-7) +;; (set-coding-priority-list '(iso-8-designate iso-8-1)) +;; (set-default-buffer-file-coding-system 'iso-8859-7) +;; (setq terminal-coding-system 'iso-8859-7) +;; (setq keyboard-coding-system 'iso-8859-7) +;; ;; (setq-default quail-current-package +;; ;; (assoc "greek" quail-package-alist)) +;; )) ;; (make-coding-system -;; 'greek-iso-8bit 2 ?7 -;; "ISO 2022 based 8-bit encoding for Greek (MIME:ISO-8859-7)" -;; '(ascii greek-iso8859-7 nil nil -;; nil nil nil nil nil nil nil) -;; '((safe-charsets ascii greek-iso8859-7) -;; (mime-charset . iso-8859-7))) - -;; (define-coding-system-alias 'iso-8859-7 'greek-iso-8bit) +;; 'iso-8859-7 2 ?7 "MIME ISO-8859-7" +;; '((ascii t) (greek-iso8859-7 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil)) (make-coding-system 'iso-8859-7 'iso2022 "MIME ISO-8859-7" @@ -65,14 +71,14 @@ (defun setup-greek-environment () "Setup multilingual environment (MULE) for Greek." (interactive) - (set-language-environment "Greek")) + (setup-8-bit-environment "Greek" 'greek-iso8859-7 'iso-8859-7 "greek") + ) (set-language-info-alist - "Greek" '((charset greek-iso8859-7) - (coding-system iso-8859-7) - (coding-priority iso-8859-7) - (input-method . "greek") - (sample-text . "Greek (NGNkNkN]NmNiNjNa) NCNeNiN\ NsNaNr") + "Greek" '((setup-function . setup-greek-environment) + (charset . (greek-iso8859-7)) + (coding-system . (iso-8859-7)) + (sample-text . "Greek (,FGkk]mija(B) ,FCei\(B ,Fsar(B") (documentation . t))) ;;; greek.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/hebrew.el --- a/lisp/mule/hebrew.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/hebrew.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; hebrew.el --- Support for Hebrew -*- coding: iso-2022-7bit; -*- +;;; hebrew.el --- Support for Hebrew ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -37,10 +37,8 @@ ;; (make-coding-system ;; 'hebrew-iso-8bit 2 ?8 ;; "ISO 2022 based 8-bit encoding for Hebrew (MIME:ISO-8859-8)" -;; '(ascii hebrew-iso8859-8 nil nil -;; nil ascii-eol ascii-cntl nil nil nil nil nil t) -;; '((safe-charsets ascii hebrew-iso8859-8) -;; (mime-charset . iso-8859-8))) +;; '((ascii t) (hebrew-iso8859-8 t) nil nil +;; nil ascii-eol ascii-cntl nil nil nil nil nil t)) ;; (define-coding-system-alias 'iso-8859-8 'hebrew-iso-8bit) @@ -53,7 +51,7 @@ charset-g3 t no-iso6429 t mnemonic "MIME/Hbrw" - )) +)) (make-coding-system 'ctext-hebrew 'iso2022 @@ -69,14 +67,26 @@ "Setup multilingual environment (MULE) for Hebrew. But, please note that right-to-left writing is not yet supported." (interactive) - (set-language-environment "Hebrew")) + (setup-8-bit-environment "Hebrew" 'hebrew-iso8859-8 'iso-8859-8 + "hebrew") + (set-coding-category-system 'iso-8-designate 'iso-8859-8) + (set-coding-priority-list + '(iso-8-designate + iso-8-1 + iso-7 + iso-8-2 + iso-lock-shift + no-conversion + shift-jis + big5)) + ) (set-language-info-alist - "Hebrew" '((charset hebrew-iso8859-8) - (coding-system iso-8859-8) - (coding-priority iso-8859-8) - (input-method . "hebrew") - (sample-text . "Hebrew [2],Hylem[0](B") + "Hebrew" '((setup-function . setup-hebrew-environment) + (describe-function . describe-hebrew-support) + (charset . (hebrew-iso8859-8)) + (coding-system . (iso-8859-8)) + (sample-text . "Hebrew ,Hylem(B") (documentation . "Right-to-left writing is not yet supported.") )) diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/japanese.el --- a/lisp/mule/japanese.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/japanese.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; japanese.el --- Japanese support -*- coding: iso-2022-7bit; -*- +;;; japanese.el --- Japanese support ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -144,11 +144,10 @@ ;; 'iso-2022-jp 2 ?J ;; "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)" ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208 -;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201) nil nil nil -;; short ascii-eol ascii-cntl seven) -;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208 -;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201) -;; (mime-charset . iso-2022-jp))) +;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil +;; short ascii-eol ascii-cntl seven)) + +;; (define-coding-system-alias 'junet 'iso-2022-jp) (make-coding-system 'iso-2022-jp 'iso2022 @@ -161,47 +160,26 @@ mnemonic "MULE/7bit" )) -(define-coding-system-alias 'junet 'iso-2022-jp) +(copy-coding-system 'iso-2022-jp 'junet) ;; (make-coding-system -;; 'iso-2022-jp-2 2 ?J -;; "ISO 2022 based 7bit encoding for CJK, Latin-1, and Greek (MIME:ISO-2022-JP-2)" -;; '((ascii japanese-jisx0208-1978 japanese-jisx0208 -;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 -;; chinese-gb2312 korean-ksc5601) nil -;; (nil latin-iso8859-1 greek-iso8859-7) nil -;; short ascii-eol ascii-cntl seven nil single-shift) -;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208 -;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 -;; chinese-gb2312 korean-ksc5601 -;; latin-iso8859-1 greek-iso8859-7) -;; (mime-charset . iso-2022-jp-2))) - -;; (make-coding-system -;; 'japanese-shift-jis 1 ?S -;; "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)" -;; nil -;; '((safe-charsets ascii japanese-jisx0208 japanese-jisx0208-1978 -;; latin-jisx0201 katakana-jisx0201) -;; (mime-charset . shift_jis) -;; (charset-origin-alist (japanese-jisx0208 "SJIS" encode-sjis-char) -;; (katakana-jisx0201 "SJIS" encode-sjis-char)))) +;; 'shift_jis 1 ?S +;; "Coding-system of Shift-JIS used in Japan." t) (make-coding-system 'shift_jis 'shift-jis "Coding-system of Shift-JIS used in Japan." '(mnemonic "Ja/SJIS")) -;; (define-coding-system-alias 'shift_jis 'japanese-shift-jis) -;; (define-coding-system-alias 'sjis 'japanese-shift-jis) +;;(define-coding-system-alias 'shift_jis 'sjis) + +(copy-coding-system 'shift_jis 'sjis) ;; (make-coding-system -;; 'japanese-iso-7bit-1978-irv 2 ?j -;; "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman" -;; '((ascii japanese-jisx0208-1978 japanese-jisx0208 -;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil -;; short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis) -;; '(ascii japanese-jisx0208-1978 japanese-jisx0208 latin-jisx0201)) +;; 'iso-2022-jp-1978-irv 2 ?J +;; "Coding-system used for old jis terminal." +;; '((ascii t) nil nil nil +;; short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis)) (make-coding-system 'iso-2022-jp-1978-irv 'iso2022 @@ -214,19 +192,15 @@ mnemonic "Ja-78/7bit" )) -;; (define-coding-system-alias 'iso-2022-jp-1978-irv 'japanese-iso-7bit-1978-irv) -;; (define-coding-system-alias 'old-jis 'japanese-iso-7bit-1978-irv) +;;(define-coding-system-alias 'iso-2022-jp-1978-irv 'old-jis) -(define-coding-system-alias 'old-jis 'iso-2022-jp-1978-irv) +(copy-coding-system 'iso-2022-jp-1978-irv 'old-jis) ;; (make-coding-system -;; 'japanese-iso-8bit 2 ?E -;; "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)" +;; 'euc-japan-1990 2 ?E +;; "Coding-system of Japanese EUC (Extended Unix Code)." ;; '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212 -;; short ascii-eol ascii-cntl nil nil single-shift) -;; '((safe-charsets ascii latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978 -;; katakana-jisx0201 japanese-jisx0212) -;; (mime-charset . euc-jp))) +;; short ascii-eol ascii-cntl nil nil single-shift)) (make-coding-system 'euc-jp 'iso2022 @@ -239,26 +213,20 @@ mnemonic "Ja/EUC" )) -;; (define-coding-system-alias 'euc-japan-1990 'japanese-iso-8bit) -;; (define-coding-system-alias 'euc-japan 'japanese-iso-8bit) -;; (define-coding-system-alias 'euc-jp 'japanese-iso-8bit) +;;(define-coding-system-alias 'euc-japan-1990 'euc-japan) -(define-coding-system-alias 'euc-japan 'euc-jp) ; only for w3 -(define-coding-system-alias 'japanese-euc 'euc-jp) +(copy-coding-system 'euc-jp 'euc-japan) ; only for w3 +(copy-coding-system 'euc-jp 'japanese-euc) (set-language-info-alist - "Japanese" '((setup-function . setup-japanese-environment-internal) - (exit-function . exit-japanese-environment) + "Japanese" '((setup-function . setup-japanese-environment) (tutorial . "TUTORIAL.ja") - (charset japanese-jisx0208 japanese-jisx0208-1978 - japanese-jisx0212 latin-jisx0201 katakana-jisx0201) - (coding-system iso-2022-jp euc-jp - shift_jis iso-2022-jp-2) - (coding-priority iso-2022-jp euc-jp - shift_jis iso-2022-jp-2) -;; (input-method . "japanese") - (features japan-util) - (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, )IºÝÆÁÊ")-A + (charset . (japanese-jisx0208 japanese-jisx0208-1978 + japanese-jisx0212 latin-jisx0201 + katakana-jisx0201)) + (coding-system . (iso-2022-jp euc-jp + shift_jis iso-2022-jp-1978-irv)) + (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B") (documentation . t))) ;;; japanese.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/korean.el --- a/lisp/mule/korean.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/korean.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; korean.el --- Support for Korean -*- coding: iso-2022-7bit; -*- +;;; korean.el --- Support for Korean ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -66,12 +66,10 @@ (setq-default its:*current-map* (its:get-mode-map "hangul")))) ;; (make-coding-system -;; 'korean-iso-8bit 2 ?K -;; "ISO 2022 based EUC encoding for Korean KSC5601 (MIME:EUC-KR)" -;; '(ascii korean-ksc5601 nil nil -;; nil ascii-eol ascii-cntl) -;; '((safe-charsets ascii korean-ksc5601) -;; (mime-charset . euc-kr))) +;; 'euc-kr 2 ?K +;; "Coding-system of Korean EUC (Extended Unix Code)." +;; '((ascii t) korean-ksc5601 nil nil +;; nil ascii-eol ascii-cntl)) (make-coding-system 'euc-kr 'iso2022 @@ -83,16 +81,14 @@ ;;(define-coding-system-alias 'euc-kr 'euc-korea) -(define-coding-system-alias 'korean-euc 'euc-kr) +(copy-coding-system 'euc-kr 'korean-euc) ;; (make-coding-system ;; 'iso-2022-kr 2 ?k -;; "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." +;; "MIME ISO-2022-KR" ;; '(ascii (nil korean-ksc5601) nil nil ;; nil ascii-eol ascii-cntl seven locking-shift nil nil nil nil nil -;; designation-bol) -;; '((safe-charsets ascii korean-ksc5601) -;; (mime-charset . iso-2022-kr))) +;; designation-bol)) (make-coding-system 'iso-2022-kr 'iso2022 @@ -105,23 +101,49 @@ mnemonic "Ko/7bit" eol-type lf)) -;; (define-coding-system-alias 'korean-iso-7bit-lock 'iso-2022-kr) +(defun setup-korean-environment () + "Setup multilingual environment (MULE) for Korean." + (interactive) + (setup-english-environment) + ;; (setq coding-category-iso-8-2 'euc-kr) + (set-coding-category-system 'iso-8-2 'euc-kr) + + ;; (set-coding-priority + ;; '(coding-category-iso-7 + ;; coding-category-iso-8-2 + ;; coding-category-iso-8-1)) + (set-coding-priority-list + '(iso-8-2 + iso-7 + iso-8-1 + iso-8-designate + iso-lock-shift + no-conversion + shift-jis + big5)) + + (set-default-coding-systems 'euc-kr) + + ;; (when (eq 'x (device-type (selected-device))) + ;; (x-use-halfwidth-roman-font 'korean-ksc5601 "ksc5636")) + + ;; EGG specific setup 97.02.05 jhod + (when (featurep 'egg) + (when (not (featurep 'egg-kor)) + (provide 'egg-kor) + (load "its-hangul") + (setq its:*standard-modes* + (cons (its:get-mode-map "hangul") its:*standard-modes*))) + (setq-default its:*current-map* (its:get-mode-map "hangul"))) + + (setq default-input-method "korean-hangul")) (set-language-info-alist - "Korean" '((setup-function . setup-korean-environment-internal) - (exit-function . exit-korean-environment) + "Korean" '((setup-function . setup-korean-environment) (tutorial . "TUTORIAL.ko") - (charset korean-ksc5601) - (coding-system euc-kr iso-2022-kr) - (coding-priority euc-kr iso-2022-kr) - (input-method . "korean-hangul") - (features korea-util) + (charset . (korean-ksc5601)) + (coding-system . (iso-2022-kr euc-kr)) (sample-text . "Hangul ($(CGQ1[(B) $(C>H3gGO<H3gGO=J4O1n(B") - (documentation . "\ -The following key bindings are available while using Korean input methods: - Shift-SPC: toggle-korean-input-mthod - Control-F9: quail-hangul-switch-symbol-ksc - F9: quail-hangul-switch-hanja") - )) + (documentation . t))) ;;; korean.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/misc-lang.el --- a/lisp/mule/misc-lang.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/misc-lang.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ ;;; misc-lang.el --- support for miscellaneous languages (characters) -;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. +;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. ;; Copyright (C) 1997 MORIOKA Tomohiko @@ -40,13 +40,11 @@ (defun setup-ipa-environment () "Setup multilingual environment (MULE) for IPA." (interactive) - (set-language-environment "IPA")) + (setup-english-environment)) (set-language-info-alist - "IPA" '((charset . (ipa)) - (coding-priority iso-2022-7bit) - (coding-system iso-2022-7bit) - (input-method . "ipa") + "IPA" '((setup-function . setup-ipa-environment) + (charset . (ipa)) (documentation . "\ IPA is International Phonetic Alphabet for English, French, German and Italian."))) diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-category.el --- a/lisp/mule/mule-category.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-category.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,6 @@ ;;; mule-category.el --- category functions for XEmacs/Mule. ;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1997, 1999 Electrotechnical Laboratory, JAPAN. -;; Licensed to the Free Software Foundation. ;; Copyright (C) 1995 Amdahl Corporation. ;; Copyright (C) 1995 Sun Microsystems. @@ -29,13 +27,13 @@ ;; type of char table. Some function names / arguments should be ;; parallel with syntax tables. -;; Written by Ben Wing . The initialization code +;; Written by Ben Wing . The initialization code ;; at the end of this file comes from Mule. ;; Some bugfixes by Jareth Hein ;;; Code: -(defvar defined-category-hashtable (make-hash-table :size 50)) +(defvar defined-category-hashtable (make-hashtable 50)) (defun define-category (designator doc-string) "Make a new category whose designator is DESIGNATOR. @@ -69,8 +67,8 @@ "Return an undefined category designator, or nil if there are none." (let ((a 32) found) (while (and (< a 127) (not found)) - (unless (gethash a defined-category-hashtable) - (setq found (make-char 'ascii a))) + (if (gethash a defined-category-hashtable) + (setq found a)) (setq a (1+ a))) found)) @@ -117,11 +115,11 @@ (let ((a 32) list) (while (< a 127) (if (= 1 (aref vec (- a 32))) - (setq list (cons (make-char 'ascii a) list))) + (setq list (cons a list))) (setq a (1+ a))) (nreverse list))))) -;; implemented in c, file chartab.c (97/3/14 jhod@po.iijnet.or.jp) +;; implimented in c, file chartab.c (97/3/14 jhod@po.iijnet.or.jp) ;(defun char-in-category-p (char category &optional table) ; "Return non-nil if CHAR is in CATEGORY. ;TABLE defaults to the current buffer's category table. @@ -137,9 +135,8 @@ "Describe the category specifications in the category table. The descriptions are inserted in a buffer, which is then displayed." (interactive) - (with-displaying-help-buffer - (lambda () - (describe-category-table (category-table) standard-output)))) + (with-output-to-temp-buffer "*Help*" + (describe-category-table (category-table) standard-output))) (defun describe-category-table (table stream) (let (first-char @@ -246,11 +243,9 @@ (let (i l) (define-category ?a "ASCII character set.") - (define-category ?l "Latin-1 through Latin-5 character set") (setq i 32) (while (< i 127) (modify-category-entry i ?a) - (modify-category-entry i ?l) (setq i (1+ i))) (setq l predefined-category-list) (while l @@ -260,23 +255,6 @@ (modify-category-entry (car (car l)) (nth 1 (car l))) (setq l (cdr l)))) -;;; Setting word boundary. - -(setq word-combining-categories - '((?l . ?l))) - -(setq word-separating-categories ; (2-byte character sets) - '((?A . ?K) ; Alpha numeric - Katakana - (?A . ?C) ; Alpha numeric - Chinese - (?H . ?A) ; Hiragana - Alpha numeric - (?H . ?K) ; Hiragana - Katakana - (?H . ?C) ; Hiragana - Chinese - (?K . ?A) ; Katakana - Alpha numeric - (?K . ?C) ; Katakana - Chinese - (?C . ?A) ; Chinese - Alpha numeric - (?C . ?K) ; Chinese - Katakana - )) - ;;; At the present, I know Japanese and Chinese text can ;;; break line at any point under a restriction of 'kinsoku'. (defvar word-across-newline "\\(\\cj\\|\\cc\\|\\ct\\)" diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-ccl.el --- a/lisp/mule/mule-ccl.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-ccl.el Mon Aug 13 11:20:41 2007 +0200 @@ -74,13 +74,11 @@ ;; (read REG ...) ;; | (read-if (REG OPERATOR ARG) CCL_BLOCK CCL_BLOCK) ;; | (read-branch REG CCL_BLOCK [CCL_BLOCK ...]) -;; | (read-multibyte-character REG {charset} REG {code-point}) ;; WRITE := ;; (write REG ...) ;; | (write EXPRESSION) ;; | (write integer) | (write string) | (write REG ARRAY) ;; | string -;; | (write-multibyte-character REG(charset) REG(codepoint)) ;; CALL := (call ccl-program-name) ;; END := (end) ;; @@ -91,15 +89,14 @@ ;; | < | > | == | <= | >= | != | de-sjis | en-sjis ;; ASSIGNMENT_OPERATOR := ;; += | -= | *= | /= | %= | &= | '|=' | ^= | <<= | >>= -;; ARRAY := '[' integer ... ']' +;; ARRAY := '[' interger ... ']' ;;; Code: (defconst ccl-command-table [if branch loop break repeat write-repeat write-read-repeat - read read-if read-branch write call end - read-multibyte-character write-multibyte-character] - "Vector of CCL commands (symbols).") + read read-if read-branch write call end] + "*Vector of CCL commands (symbols).") ;; Put a property to each symbol of CCL commands for the compiler. (let (op (i 0) (len (length ccl-command-table))) @@ -140,21 +137,8 @@ jump-cond-expr-register read-jump-cond-expr-const read-jump-cond-expr-register - ex-cmd ] - "Vector of CCL compiled codes (symbols).") - -(defconst ccl-extended-code-table - [read-multibyte-character - write-multibyte-character - translate-character - translate-character-const-tbl - nil nil nil nil nil nil nil nil nil nil nil nil ; 0x04-0x0f - iterate-multiple-map - map-multiple - map-single - ] - "Vector of CCL extended compiled codes (symbols).") + "*Vector of CCL compiled codes (symbols).") ;; Put a property to each symbol of CCL codes for the disassembler. (let (code (i 0) (len (length ccl-code-table))) @@ -164,15 +148,6 @@ (put code 'ccl-dump-function (intern (format "ccl-dump-%s" code))) (setq i (1+ i)))) -(let (code (i 0) (len (length ccl-extended-code-table))) - (while (< i len) - (setq code (aref ccl-extended-code-table i)) - (if code - (progn - (put code 'ccl-ex-code i) - (put code 'ccl-dump-function (intern (format "ccl-dump-%s" code))))) - (setq i (1+ i)))) - (defconst ccl-jump-code-list '(jump jump-cond write-register-jump write-register-read-jump write-const-jump write-const-read-jump write-string-jump @@ -187,7 +162,7 @@ (defconst ccl-register-table [r0 r1 r2 r3 r4 r5 r6 r7] - "Vector of CCL registers (symbols).") + "*Vector of CCL registers (symbols).") ;; Put a property to indicate register number to each symbol of CCL. ;; registers. @@ -200,7 +175,7 @@ (defconst ccl-arith-table [+ - * / % & | ^ << >> <8 >8 // nil nil nil < > == <= >= != de-sjis en-sjis] - "Vector of CCL arithmetic/logical operators (symbols).") + "*Vector of CCL arithmetic/logical operators (symbols).") ;; Put a property to each symbol of CCL operators for the compiler. (let (arith (i 0) (len (length ccl-arith-table))) @@ -211,7 +186,7 @@ (defconst ccl-assign-arith-table [+= -= *= /= %= &= |= ^= <<= >>= <8= >8= //=] - "Vector of CCL assignment operators (symbols).") + "*Vector of CCL assignment operators (symbols).") ;; Put a property to each symbol of CCL assignment operators for the compiler. (let (arith (i 0) (len (length ccl-assign-arith-table))) @@ -283,23 +258,13 @@ (aset ccl-program-vector ccl-current-ic code) (setq ccl-current-ic (1+ ccl-current-ic)))) -;; extended ccl command format -;; |- 14-bit -|- 3-bit --|- 3-bit --|- 3-bit --|- 5-bit -| -;; |- EX-OP --|-- REG3 --|-- REG2 --|-- REG ---|-- OP ---| -(defun ccl-embed-extended-command (ex-op reg reg2 reg3) - (let ((data (logior (ash (get ex-op 'ccl-ex-code) 3) - (if (symbolp reg3) - (get reg3 'ccl-register-number) - 0)))) - (ccl-embed-code 'ex-cmd reg data reg2))) - ;; Just advance `ccl-current-ic' by INC. (defun ccl-increment-ic (inc) (setq ccl-current-ic (+ ccl-current-ic inc))) ;;;###autoload (defun ccl-program-p (obj) - "Return t if OBJECT is a valid CCL compiled code." + "T if OBJECT is a valid CCL compiled code." (and (vectorp obj) (let ((i 0) (len (length obj)) (flag t)) (if (> len 1) @@ -559,9 +524,7 @@ (let ((unconditional-jump (ccl-compile-1 true-cmds))) (if (null false-cmds) ;; This is the place to jump to if condition is false. - (progn - (ccl-embed-current-address jump-cond-address) - (setq unconditional-jump nil)) + (ccl-embed-current-address jump-cond-address) (let (end-true-part-address) (if (not unconditional-jump) (progn @@ -839,119 +802,6 @@ (ccl-embed-code 'end 0 0) t) -;; Compile read-multibyte-character -(defun ccl-compile-read-multibyte-character (cmd) - (if (/= (length cmd) 3) - (error "CCL: Invalid number of arguments: %s" cmd)) - (let ((RRR (nth 1 cmd)) - (rrr (nth 2 cmd))) - (ccl-check-register rrr cmd) - (ccl-check-register RRR cmd) - (ccl-embed-extended-command 'read-multibyte-character rrr RRR 0)) - nil) - -;; Compile write-multibyte-character -(defun ccl-compile-write-multibyte-character (cmd) - (if (/= (length cmd) 3) - (error "CCL: Invalid number of arguments: %s" cmd)) - (let ((RRR (nth 1 cmd)) - (rrr (nth 2 cmd))) - (ccl-check-register rrr cmd) - (ccl-check-register RRR cmd) - (ccl-embed-extended-command 'write-multibyte-character rrr RRR 0)) - nil) - -;; Compile translate-character -;; (defun ccl-compile-translate-character (cmd) -;; (if (/= (length cmd) 4) -;; (error "CCL: Invalid number of arguments: %s" cmd)) -;; (let ((Rrr (nth 1 cmd)) -;; (RRR (nth 2 cmd)) -;; (rrr (nth 3 cmd))) -;; (ccl-check-register rrr cmd) -;; (ccl-check-register RRR cmd) -;; (cond ((and (symbolp Rrr) (not (get Rrr 'ccl-register-number))) -;; (if (not (get Rrr 'translation-table)) -;; (error "CCL: Invalid translation table %s in %s" Rrr cmd)) -;; (ccl-embed-extended-command 'translate-character-const-tbl -;; rrr RRR 0) -;; (ccl-embed-data Rrr)) -;; (t -;; (ccl-check-register Rrr cmd) -;; (ccl-embed-extended-command 'translate-character rrr RRR Rrr)))) -;; nil) - -;; (defun ccl-compile-iterate-multiple-map (cmd) -;; (ccl-compile-multiple-map-function 'iterate-multiple-map cmd) -;; nil) - -;; (defun ccl-compile-map-multiple (cmd) -;; (if (/= (length cmd) 4) -;; (error "CCL: Invalid number of arguments: %s" cmd)) -;; (let ((func '(lambda (arg mp) -;; (let ((len 0) result add) -;; (while arg -;; (if (consp (car arg)) -;; (setq add (funcall func (car arg) t) -;; result (append result add) -;; add (+ (-(car add)) 1)) -;; (setq result -;; (append result -;; (list (car arg))) -;; add 1)) -;; (setq arg (cdr arg) -;; len (+ len add))) -;; (if mp -;; (cons (- len) result) -;; result)))) -;; arg) -;; (setq arg (append (list (nth 0 cmd) (nth 1 cmd) (nth 2 cmd)) -;; (funcall func (nth 3 cmd) nil))) -;; (ccl-compile-multiple-map-function 'map-multiple arg)) -;; nil) - -;; (defun ccl-compile-map-single (cmd) -;; (if (/= (length cmd) 4) -;; (error "CCL: Invalid number of arguments: %s" cmd)) -;; (let ((RRR (nth 1 cmd)) -;; (rrr (nth 2 cmd)) -;; (map (nth 3 cmd)) -;; id) -;; (ccl-check-register rrr cmd) -;; (ccl-check-register RRR cmd) -;; (ccl-embed-extended-command 'map-single rrr RRR 0) -;; (cond ((symbolp map) -;; (if (get map 'code-conversion-map) -;; (ccl-embed-data map) -;; (error "CCL: Invalid map: %s" map))) -;; (t -;; (error "CCL: Invalid type of arguments: %s" cmd)))) -;; nil) - -;; (defun ccl-compile-multiple-map-function (command cmd) -;; (if (< (length cmd) 4) -;; (error "CCL: Invalid number of arguments: %s" cmd)) -;; (let ((RRR (nth 1 cmd)) -;; (rrr (nth 2 cmd)) -;; (args (nthcdr 3 cmd)) -;; map) -;; (ccl-check-register rrr cmd) -;; (ccl-check-register RRR cmd) -;; (ccl-embed-extended-command command rrr RRR 0) -;; (ccl-embed-data (length args)) -;; (while args -;; (setq map (car args)) -;; (cond ((symbolp map) -;; (if (get map 'code-conversion-map) -;; (ccl-embed-data map) -;; (error "CCL: Invalid map: %s" map))) -;; ((numberp map) -;; (ccl-embed-data map)) -;; (t -;; (error "CCL: Invalid type of arguments: %s" cmd))) -;; (setq args (cdr args))))) - - ;;; CCL dump staffs ;; To avoid byte-compiler warning. @@ -1219,69 +1069,17 @@ (insert "\n")) (setq i (1+ i))))) -(defun ccl-dump-ex-cmd (rrr cc) - (let* ((RRR (logand cc ?\x7)) - (Rrr (logand (ash cc -3) ?\x7)) - (ex-op (aref ccl-extended-code-table (logand (ash cc -6) ?\x3fff)))) - (insert (format "<%s> " ex-op)) - (funcall (get ex-op 'ccl-dump-function) rrr RRR Rrr))) - -(defun ccl-dump-read-multibyte-character (rrr RRR Rrr) - (insert (format "read-multibyte-character r%d r%d\n" RRR rrr))) - -(defun ccl-dump-write-multibyte-character (rrr RRR Rrr) - (insert (format "write-multibyte-character r%d r%d\n" RRR rrr))) - -;; (defun ccl-dump-translate-character (rrr RRR Rrr) -;; (insert (format "translation table(r%d) r%d r%d\n" Rrr RRR rrr))) - -;; (defun ccl-dump-translate-character-const-tbl (rrr RRR Rrr) -;; (let ((tbl (ccl-get-next-code))) -;; (insert (format "translation table(%S) r%d r%d\n" tbl RRR rrr)))) - -;; (defun ccl-dump-iterate-multiple-map (rrr RRR Rrr) -;; (let ((notbl (ccl-get-next-code)) -;; (i 0) id) -;; (insert (format "iterate-multiple-map r%d r%d\n" RRR rrr)) -;; (insert (format "\tnumber of maps is %d .\n\t [" notbl)) -;; (while (< i notbl) -;; (setq id (ccl-get-next-code)) -;; (insert (format "%S" id)) -;; (setq i (1+ i))) -;; (insert "]\n"))) - -;; (defun ccl-dump-map-multiple (rrr RRR Rrr) -;; (let ((notbl (ccl-get-next-code)) -;; (i 0) id) -;; (insert (format "map-multiple r%d r%d\n" RRR rrr)) -;; (insert (format "\tnumber of maps and separators is %d\n\t [" notbl)) -;; (while (< i notbl) -;; (setq id (ccl-get-next-code)) -;; (if (= id -1) -;; (insert "]\n\t [") -;; (insert (format "%S " id))) -;; (setq i (1+ i))) -;; (insert "]\n"))) - -;; (defun ccl-dump-map-single (rrr RRR Rrr) -;; (let ((id (ccl-get-next-code))) -;; (insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) - - ;; CCL emulation staffs ;; Not yet implemented. -;; Auto-loaded functions. - ;;;###autoload -(defmacro declare-ccl-program (name &optional vector) +(defmacro declare-ccl-program (name) "Declare NAME as a name of CCL program. To compile a CCL program which calls another CCL program not yet -defined, it must be declared as a CCL program in advance. -Optional arg VECTOR is a compiled CCL code of the CCL program." - `(put ',name 'ccl-program-idx (register-ccl-program ',name ,vector))) +defined, it must be declared as a CCL program in advance." + `(put ',name 'ccl-program-idx (register-ccl-program ',name nil))) ;;;###autoload (defmacro define-ccl-program (name ccl-program &optional doc) @@ -1294,27 +1092,9 @@ nil)) ;;;###autoload -(defmacro check-ccl-program (ccl-program &optional name) - "Check validity of CCL-PROGRAM. -If CCL-PROGRAM is a symbol denoting a valid CCL program, return -CCL-PROGRAM, else return nil. -If CCL-PROGRAM is a vector and optional arg NAME (symbol) is supplied, -register CCL-PROGRAM by name NAME, and return NAME." - `(let ((result ,ccl-program)) - (cond ((symbolp ,ccl-program) - (or (numberp (get ,ccl-program 'ccl-program-idx)) - (setq result nil))) - ((vectorp ,ccl-program) - (setq result ,name) - (register-ccl-program result ,ccl-program)) - (t - (setq result nil))) - result)) - -;;;###autoload (defun ccl-execute-with-args (ccl-prog &rest args) "Execute CCL-PROGRAM with registers initialized by the remaining args. -The return value is a vector of resulting CCL registers." +The return value is a vector of resulting CCL registeres." (let ((reg (make-vector 8 0)) (i 0)) (while (and args (< i 8)) diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-charset.el --- a/lisp/mule/mule-charset.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-charset.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,12 +1,8 @@ ;;; mule-charset.el --- Charset functions for Mule. - ;; Copyright (C) 1992 Free Software Foundation, Inc. ;; Copyright (C) 1995 Amdahl Corporation. ;; Copyright (C) 1996 Sun Microsystems. -;; Author: Unknown -;; Keywords: i18n, mule, internal - ;; This file is part of XEmacs. ;; XEmacs is free software; you can redistribute it and/or modify it @@ -24,14 +20,40 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: Not synched. API at source level synched with FSF 20.3.9. + +;;;; Composite character support -;;; Commentary: +(defun compose-region (start end &optional buffer) + "Compose characters in the current region into one composite character. +From a Lisp program, pass two arguments, START to END. +The composite character replaces the composed characters. +BUFFER defaults to the current buffer if omitted." + (interactive "r") + (let ((ch (make-composite-char (buffer-substring start end buffer)))) + (delete-region start end buffer) + (insert-char ch nil nil buffer))) -;; These functions are not compatible at the bytecode level with Emacs/Mule, -;; and they never will be. -sb [1999-05-26] +(defun decompose-region (start end &optional buffer) + "Decompose any composite characters in the current region. +From a Lisp program, pass two arguments, START to END. +This converts each composite character into one or more characters, +the individual characters out of which the composite character was formed. +Non-composite characters are left as-is. BUFFER defaults to the current +buffer if omitted." + (interactive "r") + (save-excursion + (set-buffer buffer) + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (let ((compcharset (get-charset 'composite))) + (while (< (point) (point-max)) + (let ((ch (char-after (point)))) + (if (eq compcharset (char-charset ch)) + (progn + (delete-char 1) + (insert (composite-char-string ch)))))))))) -;;; Code: ;;;; Classifying text according to charsets @@ -94,15 +116,10 @@ be automatically determined)." (charset-property charset 'columns)) -;; #### FSFmacs returns 0 (defun charset-direction (charset) - "Return the display direction (0 for `l2r' or 1 for `r2l') of CHARSET. -Only left-to-right is currently implemented." - (if (eq (charset-property charset 'direction) 'l2r) - 0 - 1)) + "Return the display direction (`l2r' or `r2l') of CHARSET." + (charset-property charset 'direction)) -;; Not in Emacs/Mule (defun charset-registry (charset) "Return the registry of CHARSET. This is a regular expression matching the registry field of fonts @@ -127,135 +144,3 @@ (defsetf charset-registry set-charset-registry) (defsetf charset-ccl-program set-charset-ccl-program) - -;;; FSF compatibility functions -(defun charset-after (&optional pos) - "Return charset of a character in current buffer at position POS. -If POS is nil, it defauls to the current point. -If POS is out of range, the value is nil." - (when (null pos) - (setq pos (point))) - (check-argument-type 'integerp pos) - (unless (or (< pos (point-min)) - (> pos (point-max))) - (char-charset (char-after pos)))) - -;; Yuck! -;; We're not going to support this. -;(defun charset-info (charset) -; "Return a vector of information of CHARSET. -;The elements of the vector are: -; CHARSET-ID, BYTES, DIMENSION, CHARS, WIDTH, DIRECTION, -; LEADING-CODE-BASE, LEADING-CODE-EXT, -; ISO-FINAL-CHAR, ISO-GRAPHIC-PLANE, -; REVERSE-CHARSET, SHORT-NAME, LONG-NAME, DESCRIPTION, -; PLIST, -;where -;CHARSET-ID (integer) is the identification number of the charset. -;BYTES (integer) is the length of multi-byte form of a character in -; the charset: one of 1, 2, 3, and 4. -;DIMENSION (integer) is the number of bytes to represent a character of -;the charset: 1 or 2. -;CHARS (integer) is the number of characters in a dimension: 94 or 96. -;WIDTH (integer) is the number of columns a character in the charset -; occupies on the screen: one of 0, 1, and 2. -;DIRECTION (integer) is the rendering direction of characters in the -; charset when rendering. If 0, render from left to right, else -; render from right to left. -;LEADING-CODE-BASE (integer) is the base leading-code for the -; charset. -;LEADING-CODE-EXT (integer) is the extended leading-code for the -; charset. All charsets of less than 0xA0 has the value 0. -;ISO-FINAL-CHAR (character) is the final character of the -; corresponding ISO 2022 charset. -;ISO-GRAPHIC-PLANE (integer) is the graphic plane to be invoked -; while encoding to variants of ISO 2022 coding system, one of the -; following: 0/graphic-plane-left(GL), 1/graphic-plane-right(GR). -;REVERSE-CHARSET (integer) is the charset which differs only in -; LEFT-TO-RIGHT value from the charset. If there's no such a -; charset, the value is -1. -;SHORT-NAME (string) is the short name to refer to the charset. -;LONG-NAME (string) is the long name to refer to the charset -;DESCRIPTION (string) is the description string of the charset. -;PLIST (property list) may contain any type of information a user -; want to put and get by functions `put-charset-property' and -; `get-charset-property' respectively." -; (vector -; (charset-id charset) -; 1 -; (charset-dimension charset) -; (charset-chars charset) -; (charset-width charset) -; (charset-direction charset) -; nil ;; (charset-leading-code-base (charset)) -; nil ;; (charset-leading-code-ext (charset)) -; (charset-iso-final-char charset) -; (charset-iso-graphic-plane charset) -; -1 -; (charset-short-name charset) -; (charset-long-name charset) -; (charset-description charset) -; (charset-plist charset))) - -;(make-compatible 'charset-info "Don't use this if you can help it.") - -(defun define-charset (charset-id charset property-vector) - "Define CHARSET-ID as the identification number of CHARSET with INFO-VECTOR. -If CHARSET-ID is nil, it is decided automatically, which means CHARSET is - treated as a private charset. -INFO-VECTOR is a vector of the format: - [DIMENSION CHARS WIDTH DIRECTION ISO-FINAL-CHAR ISO-GRAPHIC-PLANE - SHORT-NAME LONG-NAME DESCRIPTION] -The meanings of each elements is as follows: -DIMENSION (integer) is the number of bytes to represent a character: 1 or 2. -CHARS (integer) is the number of characters in a dimension: 94 or 96. -WIDTH (integer) is the number of columns a character in the charset -occupies on the screen: one of 0, 1, and 2. - -DIRECTION (integer) is the rendering direction of characters in the -charset when rendering. If 0, render from left to right, else -render from right to left. - -ISO-FINAL-CHAR (character) is the final character of the -corresponding ISO 2022 charset. - -ISO-GRAPHIC-PLANE (integer) is the graphic plane to be invoked -while encoding to variants of ISO 2022 coding system, one of the -following: 0/graphic-plane-left(GL), 1/graphic-plane-right(GR). - - -SHORT-NAME (string) is the short name to refer to the charset. - -LONG-NAME (string) is the long name to refer to the charset. - -DESCRIPTION (string) is the description string of the charset." - (make-charset charset (aref property-vector 8) - (list - 'short-name (aref property-vector 6) - 'long-name (aref property-vector 7) - 'dimension (aref property-vector 0) - 'columns (aref property-vector 2) - 'chars (aref property-vector 1) - 'final (aref property-vector 4) - 'graphic (aref property-vector 5) - 'direction (aref property-vector 3)))) - -(make-compatible 'define-charset "") - -;;; Charset property - -(defalias 'get-charset-property 'get) -(defalias 'put-charset-property 'put) -(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 12e008d41344 -r 697ef44129c6 lisp/mule/mule-cmds.el --- a/lisp/mule/mule-cmds.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-cmds.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ ;;; mule-cmds.el --- Commands for multilingual environment -;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. +;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. ;; Copyright (C) 1997 MORIOKA Tomohiko @@ -27,8 +27,8 @@ ;;; MULE related key bindings and menus. -(defvar mule-keymap (make-sparse-keymap "Mule") - "Keymap for Mule (Multilingual environment) specific commands.") +(defvar mule-keymap (make-sparse-keymap "MULE") + "Keymap for MULE (Multilingual environment) specific commands.") ;; Keep "C-x C-m ..." for mule specific commands. (define-key ctl-x-map "\C-m" mule-keymap) @@ -38,18 +38,18 @@ (define-key mule-keymap "t" 'set-terminal-coding-system) (define-key mule-keymap "k" 'set-keyboard-coding-system) (define-key mule-keymap "p" 'set-buffer-process-coding-system) -(define-key mule-keymap "x" 'set-selection-coding-system) -(define-key mule-keymap "X" 'set-next-selection-coding-system) -(define-key mule-keymap "\C-\\" 'set-input-method) +(define-key mule-keymap "\C-\\" 'select-input-method) (define-key mule-keymap "c" 'universal-coding-system-argument) ;;(define-key mule-keymap "c" 'list-coding-system-briefly) ; XEmacs -(define-key mule-keymap "C" 'describe-coding-system) ; XEmacs +(define-key mule-keymap "C" 'list-coding-system) ; XEmacs (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. @@ -63,80 +63,18 @@ ;; but it won't be used that frequently. (define-key global-map "\C-\\" 'toggle-input-method) -;;; This is no good because people often type Shift-SPC -;;; meaning to type SPC. -- rms. -;;; ;; Here's an alternative key binding for X users (Shift-SPACE). -;;; (define-key global-map [?\S- ] 'toggle-input-method) - -(defun coding-system-change-eol-conversion (coding-system eol-type) - "Return a coding system which differs from CODING-SYSTEM in eol conversion. -The returned coding system converts end-of-line by EOL-TYPE -but text as the same way as CODING-SYSTEM. -EOL-TYPE should be `lf', `crlf', `cr' or nil. -If EOL-TYPE is nil, the returned coding system detects -how end-of-line is formatted automatically while decoding. - -EOL-TYPE can be specified by an symbol `unix', `dos' or `mac'. -They means `lf', `crlf', and `cr' respectively." - (if (symbolp eol-type) - (setq eol-type (cond ((or (eq eol-type 'unix) - (eq eol-type 'lf)) - 'eol-lf) - ((or (eq eol-type 'dos) - (eq eol-type 'crlf)) - 'eol-crlf) - ((or (eq eol-type 'mac) - (eq eol-type 'cr)) - 'eol-cr) - (t eol-type)))) - (let ((orig-eol-type (coding-system-eol-type coding-system))) - (if (null orig-eol-type) - (if (not eol-type) - coding-system - (coding-system-property coding-system eol-type)) - (let ((base (coding-system-base coding-system))) - (if (not eol-type) - base - (if (= eol-type orig-eol-type) - coding-system - (setq orig-eol-type (coding-system-eol-type base)) - (if (null orig-eol-type) - (coding-system-property base eol-type)))))))) - -;; (defun coding-system-change-text-conversion (coding-system coding) -;; "Return a coding system which differs from CODING-SYSTEM in text conversion. -;; The returned coding system converts text by CODING -;; but end-of-line as the same way as CODING-SYSTEM. -;; If CODING is nil, the returned coding system detects -;; how text is formatted automatically while decoding." -;; (if (not coding) -;; (coding-system-base coding-system) -;; (let ((eol-type (coding-system-eol-type coding-system))) -;; (coding-system-change-eol-conversion -;; coding -;; (if (numberp eol-type) (aref [unix dos mac] eol-type)))))) - (defun view-hello-file () "Display the HELLO file which list up many languages and characters." (interactive) ;; We have to decode the file in any environment. - (let ((coding-system-for-read 'iso-2022-7bit)) + (let ((coding-system-for-read 'iso-2022-7)) (find-file-read-only (expand-file-name "HELLO" data-directory)))) (defun universal-coding-system-argument () "Execute an I/O command using the specified coding system." (interactive) - (let* ((default (and buffer-file-coding-system - (not (eq (coding-system-type buffer-file-coding-system) - t)) - (coding-system-name buffer-file-coding-system))) - (coding-system - (read-coding-system - (if default - (format "Coding system for following command (default, %s): " - default) - "Coding system for following command: ") - default)) + (let* ((coding-system + (read-coding-system "Coding system for following command: ")) (keyseq (read-key-sequence (format "Command to execute with %s:" coding-system))) (cmd (key-binding keyseq))) @@ -147,506 +85,183 @@ (defun set-default-coding-systems (coding-system) "Set default value of various coding systems to CODING-SYSTEM. -This sets the following coding systems: +The follwing coding systems are set: o coding system of a newly created buffer o default coding system for terminal output o default coding system for keyboard input - o default coding system for subprocess I/O - o default coding system for converting file names." + o default coding system for subprocess I/O" (check-coding-system coding-system) ;;(setq-default buffer-file-coding-system coding-system) (set-default-buffer-file-coding-system coding-system) - ;; (if default-enable-multibyte-characters - ;; (setq default-file-name-coding-system coding-system)) - ;; If coding-system is nil, honor that on MS-DOS as well, so - ;; that they could reset the terminal coding system. - ;; (unless (and (eq window-system 'pc) coding-system) - ;; (setq default-terminal-coding-system coding-system)) - (set-terminal-coding-system coding-system) + ;;(setq default-terminal-coding-system coding-system) + (setq terminal-coding-system coding-system) ;;(setq default-keyboard-coding-system coding-system) - (set-keyboard-coding-system coding-system) + (setq 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. (add-hook 'comint-exec-hook `(lambda () (let ((proc (get-buffer-process (current-buffer)))) - (set-process-input-coding-system - proc (or coding-system-for-read ',coding-system)) - (set-process-output-coding-system - proc (or coding-system-for-write ',coding-system)))) + (set-process-input-coding-system proc ',coding-system) + (set-process-output-coding-system proc ',coding-system))) 'append) (setq file-name-coding-system coding-system)) (defun prefer-coding-system (coding-system) "Add CODING-SYSTEM at the front of the priority list for automatic detection. -This also sets the following coding systems: +This also sets the following coding systems to CODING-SYSTEM: o coding system of a newly created buffer o default coding system for terminal output o default coding system for keyboard input - o default coding system for converting file names. - -If CODING-SYSTEM specifies a certain type of EOL conversion, the coding -systems set by this function will use that type of EOL conversion. - -This command does not change the default value of terminal coding system -for MS-DOS terminal, because DOS terminals only support a single coding -system, and Emacs automatically sets the default to that coding system at -startup." + o default coding system for subprocess I/O" (interactive "zPrefer coding system: ") - (if (not (and coding-system (find-coding-system coding-system))) + (if (not (and coding-system (coding-system-p coding-system))) (error "Invalid coding system `%s'" coding-system)) (let ((coding-category (coding-system-category coding-system)) - (base (coding-system-base coding-system)) - (eol-type (coding-system-eol-type coding-system))) + (parent (coding-system-parent coding-system))) (if (not coding-category) ;; CODING-SYSTEM is no-conversion or undecided. (error "Can't prefer the coding system `%s'" coding-system)) - (set-coding-category-system coding-category (or base coding-system)) - ;; (update-coding-systems-internal) - (or (eq coding-category (car (coding-category-list))) + (set coding-category (or parent coding-system)) + (if (not (eq coding-category (car coding-category-list))) ;; We must change the order. - (set-coding-priority-list (list coding-category))) - (if (and base (interactive-p)) - (message "Highest priority is set to %s (base of %s)" - base coding-system)) - ;; If they asked for specific EOL conversion, honor that. - (if (memq eol-type '(lf crlf mac)) - (setq coding-system - (coding-system-change-eol-conversion base eol-type)) - (setq coding-system base)) - (set-default-coding-systems coding-system))) - -;; (defun find-coding-systems-region-subset-p (list1 list2) -;; "Return non-nil if all elements in LIST1 are included in LIST2. -;; Comparison done with EQ." -;; (catch 'tag -;; (while list1 -;; (or (memq (car list1) list2) -;; (throw 'tag nil)) -;; (setq list1 (cdr list1))) -;; t)) - -;; (defun find-coding-systems-region (from to) -;; "Return a list of proper coding systems to encode a text between FROM and TO. -;; All coding systems in the list can safely encode any multibyte characters -;; in the text. -;; -;; If the text contains no multibyte characters, return a list of a single -;; element `undecided'." -;; (find-coding-systems-for-charsets (find-charset-region from to))) - -;; (defun find-coding-systems-string (string) -;; "Return a list of proper coding systems to encode STRING. -;; All coding systems in the list can safely encode any multibyte characters -;; in STRING. -;; -;; If STRING contains no multibyte characters, return a list of a single -;; element `undecided'." -;; (find-coding-systems-for-charsets (find-charset-string string))) - -;; (defun find-coding-systems-for-charsets (charsets) -;; "Return a list of proper coding systems to encode characters of CHARSETS. -;; CHARSETS is a list of character sets." -;; (if (or (null charsets) -;; (and (= (length charsets) 1) -;; (eq 'ascii (car charsets)))) -;; '(undecided) -;; (setq charsets (delq 'composition charsets)) -;; (let ((l (coding-system-list 'base-only)) -;; (charset-preferred-codings -;; (mapcar (function -;; (lambda (x) -;; (if (eq x 'unknown) -;; 'raw-text -;; (get-charset-property x 'preferred-coding-system)))) -;; charsets)) -;; (priorities (mapcar (function (lambda (x) (symbol-value x))) -;; coding-category-list)) -;; codings coding safe) -;; (if (memq 'unknown charsets) -;; ;; The region contains invalid multibyte characters. -;; (setq l '(raw-text))) -;; (while l -;; (setq coding (car l) l (cdr l)) -;; (if (and (setq safe (coding-system-get coding 'safe-charsets)) -;; (or (eq safe t) -;; (find-coding-systems-region-subset-p charsets safe))) -;; ;; We put the higher priority to coding systems included -;; ;; in CHARSET-PREFERRED-CODINGS, and within them, put the -;; ;; higher priority to coding systems which support smaller -;; ;; number of charsets. -;; (let ((priority -;; (+ (if (coding-system-get coding 'mime-charset) 4096 0) -;; (lsh (length (memq coding priorities)) 7) -;; (if (memq coding charset-preferred-codings) 64 0) -;; (if (> (coding-system-type coding) 0) 32 0) -;; (if (consp safe) (- 32 (length safe)) 0)))) -;; (setq codings (cons (cons priority coding) codings))))) -;; (mapcar 'cdr -;; (sort codings (function (lambda (x y) (> (car x) (car y)))))) -;; ))) - -;; (defun find-multibyte-characters (from to &optional maxcount excludes) -;; "Find multibyte characters in the region specified by FROM and TO. -;; If FROM is a string, find multibyte characters in the string. -;; The return value is an alist of the following format: -;; ((CHARSET COUNT CHAR ...) ...) -;; where -;; CHARSET is a character set, -;; COUNT is a number of characters, -;; CHARs are found characters of the character set. -;; Optional 3rd arg MAXCOUNT limits how many CHARs are put in the above list. -;; Optional 4th arg EXCLUDE is a list of character sets to be ignored. -;; -;; For invalid characters, CHARs are actually strings." -;; (let ((chars nil) -;; charset char) -;; (if (stringp from) -;; (let ((idx 0)) -;; (while (setq idx (string-match "[^\000-\177]" from idx)) -;; (setq char (aref from idx) -;; charset (char-charset char)) -;; (if (eq charset 'unknown) -;; (setq char (match-string 0))) -;; (if (or (eq charset 'unknown) -;; (not (or (eq excludes t) (memq charset excludes)))) -;; (let ((slot (assq charset chars))) -;; (if slot -;; (if (not (memq char (nthcdr 2 slot))) -;; (let ((count (nth 1 slot))) -;; (setcar (cdr slot) (1+ count)) -;; (if (or (not maxcount) (< count maxcount)) -;; (nconc slot (list char))))) -;; (setq chars (cons (list charset 1 char) chars))))) -;; (setq idx (1+ idx)))) -;; (save-excursion -;; (goto-char from) -;; (while (re-search-forward "[^\000-\177]" to t) -;; (setq char (preceding-char) -;; charset (char-charset char)) -;; (if (eq charset 'unknown) -;; (setq char (match-string 0))) -;; (if (or (eq charset 'unknown) -;; (not (or (eq excludes t) (memq charset excludes)))) -;; (let ((slot (assq charset chars))) -;; (if slot -;; (if (not (member char (nthcdr 2 slot))) -;; (let ((count (nth 1 slot))) -;; (setcar (cdr slot) (1+ count)) -;; (if (or (not maxcount) (< count maxcount)) -;; (nconc slot (list char))))) -;; (setq chars (cons (list charset 1 char) chars)))))))) -;; (nreverse chars))) - -;; (defvar last-coding-system-specified nil -;; "Most recent coding system explicitly specified by the user when asked. -;; This variable is set whenever Emacs asks the user which coding system -;; to use in order to write a file. If you set it to nil explicitly, -;; then call `write-region', then afterward this variable will be non-nil -;; only if the user was explicitly asked and specified a coding system.") + (setq coding-category-list + (cons coding-category + (delq coding-category coding-category-list)))) + (if (and parent (interactive-p)) + (message "Highest priority is set to %s (parent of %s)" + parent coding-system)) + (set-default-coding-systems (or parent coding-system)))) -;; (defun select-safe-coding-system (from to &optional default-coding-system) -;; "Ask a user to select a safe coding system from candidates. -;; The candidates of coding systems which can safely encode a text -;; between FROM and TO are shown in a popup window. -;; -;; Optional arg DEFAULT-CODING-SYSTEM specifies a coding system to be -;; checked at first. If omitted, buffer-file-coding-system of the -;; current buffer is used. -;; -;; If the text can be encoded safely by DEFAULT-CODING-SYSTEM, it is -;; returned without any user interaction. -;; -;; Kludgy feature: if FROM is a string, the string is the target text, -;; and TO is ignored." -;; (or default-coding-system -;; (setq default-coding-system buffer-file-coding-system)) -;; (let* ((charsets (if (stringp from) (find-charset-string from) -;; (find-charset-region from to))) -;; (safe-coding-systems (find-coding-systems-for-charsets charsets))) -;; (if (or (not enable-multibyte-characters) -;; (eq (car safe-coding-systems) 'undecided) -;; (eq default-coding-system 'no-conversion) -;; (and default-coding-system -;; (memq (coding-system-base default-coding-system) -;; safe-coding-systems))) -;; default-coding-system -;; -;; ;; At first, change each coding system to the corresponding -;; ;; mime-charset name if it is also a coding system. -;; (let ((l safe-coding-systems) -;; mime-charset) -;; (while l -;; (setq mime-charset (coding-system-get (car l) 'mime-charset)) -;; (if (and mime-charset (coding-system-p mime-charset)) -;; (setcar l mime-charset)) -;; (setq l (cdr l)))) -;; -;; (let ((non-safe-chars (find-multibyte-characters -;; from to 3 -;; (and default-coding-system -;; (coding-system-get default-coding-system -;; 'safe-charsets)))) -;; show-position overlays) -;; (save-excursion -;; ;; Highlight characters that default-coding-system can't encode. -;; (when (integerp from) -;; (goto-char from) -;; (let ((found nil)) -;; (while (and (not found) -;; (re-search-forward "[^\000-\177]" to t)) -;; (setq found (assq (char-charset (preceding-char)) -;; non-safe-chars)))) -;; (forward-line -1) -;; (setq show-position (point)) -;; (save-excursion -;; (while (and (< (length overlays) 256) -;; (re-search-forward "[^\000-\177]" to t)) -;; (let* ((char (preceding-char)) -;; (charset (char-charset char))) -;; (when (assq charset non-safe-chars) -;; (setq overlays (cons (make-overlay (1- (point)) (point)) -;; overlays)) -;; (overlay-put (car overlays) 'face 'highlight)))))) -;; -;; ;; At last, ask a user to select a proper coding system. -;; (unwind-protect -;; (save-window-excursion -;; (when show-position -;; ;; At first, be sure to show the current buffer. -;; (set-window-buffer (selected-window) (current-buffer)) -;; (set-window-start (selected-window) show-position)) -;; ;; Then, show a helpful message. -;; (with-output-to-temp-buffer "*Warning*" -;; (save-excursion -;; (set-buffer standard-output) -;; (insert "The target text contains the following non ASCII character(s):\n") -;; (let ((len (length non-safe-chars)) -;; (shown 0)) -;; (while (and non-safe-chars (< shown 3)) -;; (when (> (length (car non-safe-chars)) 2) -;; (setq shown (1+ shown)) -;; (insert (format "%25s: " (car (car non-safe-chars)))) -;; (let ((l (nthcdr 2 (car non-safe-chars)))) -;; (while l -;; (if (or (stringp (car l)) (char-valid-p (car l))) -;; (insert (car l))) -;; (setq l (cdr l)))) -;; (if (> (nth 1 (car non-safe-chars)) 3) -;; (insert "...")) -;; (insert "\n")) -;; (setq non-safe-chars (cdr non-safe-chars))) -;; (if (< shown len) -;; (insert (format "%27s\n" "...")))) -;; (insert (format "\ -;; These can't be encoded safely by the coding system %s. -;; -;; Please select one from the following safe coding systems:\n" -;; default-coding-system)) -;; (let ((pos (point)) -;; (fill-prefix " ")) -;; (mapcar (function (lambda (x) (princ " ") (princ x))) -;; safe-coding-systems) -;; (fill-region-as-paragraph pos (point))))) -;; -;; ;; Read a coding system. -;; (let* ((safe-names (mapcar (lambda (x) (list (symbol-name x))) -;; safe-coding-systems)) -;; (name (completing-read -;; (format "Select coding system (default %s): " -;; (car safe-coding-systems)) -;; safe-names nil t nil nil -;; (car (car safe-names))))) -;; (setq last-coding-system-specified (intern name)) -;; (if (integerp (coding-system-eol-type default-coding-system)) -;; (setq last-coding-system-specified -;; (coding-system-change-eol-conversion -;; last-coding-system-specified -;; (coding-system-eol-type default-coding-system)))) -;; last-coding-system-specified)) -;; (kill-buffer "*Warning*") -;; (while overlays -;; (delete-overlay (car overlays)) -;; (setq overlays (cdr overlays))))))))) - -;; (setq select-safe-coding-system-function 'select-safe-coding-system) - -;; (defun select-message-coding-system () -;; "Return a coding system to encode the outgoing message of the current buffer. -;; It at first tries the first coding system found in these variables -;; in this order: -;; (1) local value of `buffer-file-coding-system' -;; (2) value of `sendmail-coding-system' -;; (3) value of `default-buffer-file-coding-system' -;; (4) value of `default-sendmail-coding-system' -;; If the found coding system can't encode the current buffer, -;; or none of them are bound to a coding system, -;; it asks the user to select a proper coding system." -;; (let ((coding (or (and (local-variable-p 'buffer-file-coding-system) -;; buffer-file-coding-system) -;; sendmail-coding-system -;; default-buffer-file-coding-system -;; default-sendmail-coding-system))) -;; (if (eq coding 'no-conversion) -;; ;; We should never use no-conversion for outgoing mails. -;; (setq coding nil)) -;; (if (fboundp select-safe-coding-system-function) -;; (funcall select-safe-coding-system-function -;; (point-min) (point-max) coding) -;; coding))) -;;; Language support stuff. +;;; Language support staffs. (defvar language-info-alist nil - "Alist of language environment definitions. + "Alist of language names vs the corresponding information of various kind. Each element looks like: (LANGUAGE-NAME . ((KEY . INFO) ...)) -where LANGUAGE-NAME is a string, the name of the language environment, -KEY is a symbol denoting the kind of information, and -INFO is the data associated with KEY. -Meaningful values for KEY include +where LANGUAGE-NAME is a string, +KEY is a symbol denoting the kind of information, +INFO is any Lisp object which contains the actual information related +to KEY.") - documentation value is documentation of what this language environment - is meant for, and how to use it. - charset value is a list of the character sets used by this - language environment. - sample-text value is one line of text, - written using those character sets, - appropriate for this language environment. - setup-function value is a function to call to switch to this - language environment. - exit-function value is a function to call to leave this - language environment. - coding-system value is a list of coding systems that are good - for saving text written in this language environment. - This list serves as suggestions to the user; - in effect, as a kind of documentation. - coding-priority value is a list of coding systems for this language - environment, in order of decreasing priority. - This is used to set up the coding system priority - list when you switch to this language environment. - input-method value is a default input method for this language - environment. - features value is a list of features requested in this - language environment. - tutorial value is a tutorial file name written in the language.") - -(defun get-language-info (lang-env key) - "Return information listed under KEY for language environment LANG-ENV. -KEY is a symbol denoting the kind of information. -For a list of useful values for KEY and their meanings, -see `language-info-alist'." - (if (symbolp lang-env) - (setq lang-env (symbol-name lang-env))) - (let ((lang-slot (assoc-ignore-case lang-env language-info-alist))) +(defun get-language-info (language-name key) + "Return the information for LANGUAGE-NAME of the kind KEY. +KEY is a symbol denoting the kind of required information." + (if (symbolp language-name) + (setq language-name (symbol-name language-name))) + (let ((lang-slot (assoc-ignore-case language-name language-info-alist))) (if lang-slot (cdr (assq key (cdr lang-slot)))))) -(defun set-language-info (lang-env key info) - "Modify part of the definition of language environment LANG-ENV. -Specifically, this stores the information INFO under KEY -in the definition of this language environment. +(defun set-language-info (language-name key info) + "Set for LANGUAGE-NAME the information INFO under KEY. KEY is a symbol denoting the kind of information. -INFO is the value for that information. +INFO is any Lisp object which contains the actual information. + +Currently, the following KEYs are used by Emacs: + +charset: list of symbols whose values are charsets specific to the language. + +coding-system: list of coding systems specific to the language. + +tutorial: a tutorial file name written in the language. + +sample-text: one line short text containing characters of the language. + +documentation: t or a string describing how Emacs supports the language. + If a string is specified, it is shown before any other information + of the language by the command `describe-language-environment'. -For a list of useful values for KEY and their meanings, -see `language-info-alist'." - (if (symbolp lang-env) - (setq lang-env (symbol-name lang-env))) +setup-function: a function to call for setting up environment + convenient for a user of the language. + +If KEY is documentation or setup-function, you can also specify +a cons cell as INFO, in which case, the car part should be +a normal value as INFO for KEY (as described above), +and the cdr part should be a symbol whose value is a menu keymap +in which an entry for the language is defined. But, only the car part +is actually set as the information. + +We will define more KEYs in the future. To avoid conflict, +if you want to use your own KEY values, make them start with `user-'." + (if (symbolp language-name) + (setq language-name (symbol-name language-name))) (let (lang-slot key-slot) - (setq lang-slot (assoc lang-env language-info-alist)) + (setq lang-slot (assoc language-name language-info-alist)) (if (null lang-slot) ; If no slot for the language, add it. - (setq lang-slot (list lang-env) + (setq lang-slot (list language-name) language-info-alist (cons lang-slot language-info-alist))) (setq key-slot (assq key lang-slot)) (if (null key-slot) ; If no slot for the key, add it. (progn (setq key-slot (list key)) (setcdr lang-slot (cons key-slot (cdr lang-slot))))) - (setcdr key-slot info))) + ;; Setup menu. + (cond ((eq key 'documentation) + ;; (define-key-after + ;; (if (consp info) + ;; (prog1 (symbol-value (cdr info)) + ;; (setq info (car info))) + ;; describe-language-environment-map) + ;; (vector (intern language-name)) + ;; (cons language-name 'describe-specified-language-support) + ;; t) + (if (consp info) + (setq info (car info))) + (when (featurep 'menubar) + (eval-after-load + "menubar-items.elc" + `(add-menu-button + '("Mule" "Describe Language Support") + (vector ,language-name + '(describe-language-environment ,language-name) + t)))) + ) + ((eq key 'setup-function) + ;; (define-key-after + ;; (if (consp info) + ;; (prog1 (symbol-value (cdr info)) + ;; (setq info (car info))) + ;; setup-language-environment-map) + ;; (vector (intern language-name)) + ;; (cons language-name 'setup-specified-language-environment) + ;; t) + (if (consp info) + (setq info (car info))) + (when (featurep 'menubar) + (eval-after-load + "menubar-items.elc" + `(add-menu-button + '("Mule" "Set Language Environment") + (vector ,language-name + '(set-language-environment ,language-name) + t)))) + )) -(defun set-language-info-alist (lang-env alist &optional parents) - "Store ALIST as the definition of language environment LANG-ENV. -ALIST is an alist of KEY and INFO values. See the documentation of + (setcdr key-slot info) + )) + +(defun set-language-info-alist (language-name alist) + "Set for LANGUAGE-NAME the information in ALIST. +ALIST is an alist of KEY and INFO. See the documentation of `set-language-info' for the meanings of KEY and INFO." - (if (symbolp lang-env) - (setq lang-env (symbol-name lang-env))) - (let (; (describe-map describe-language-environment-map) - ; (setup-map setup-language-environment-map) - ) - ;; (if parents - ;; (let ((l parents) - ;; map parent-symbol parent) - ;; (while l - ;; (if (symbolp (setq parent-symbol (car l))) - ;; (setq parent (symbol-name parent)) - ;; (setq parent parent-symbol parent-symbol (intern parent))) - ;; (setq map (lookup-key describe-map (vector parent-symbol))) - ;; (if (not map) - ;; (progn - ;; (setq map (intern (format "describe-%s-environment-map" - ;; (downcase parent)))) - ;; (define-prefix-command map) - ;; (define-key-after describe-map (vector parent-symbol) - ;; (cons parent map) t))) - ;; (setq describe-map (symbol-value map)) - ;; (setq map (lookup-key setup-map (vector parent-symbol))) - ;; (if (not map) - ;; (progn - ;; (setq map (intern (format "setup-%s-environment-map" - ;; (downcase parent)))) - ;; (define-prefix-command map) - ;; (define-key-after setup-map (vector parent-symbol) - ;; (cons parent map) t))) - ;; (setq setup-map (symbol-value map)) - ;; (setq l (cdr l))))) - - ;; Set up menu items for this language env. - (let ((doc (assq 'documentation alist))) - (when doc - ;; (define-key-after describe-map (vector (intern lang-env)) - ;; (cons lang-env 'describe-specified-language-support) t) - (when (featurep 'menubar) - (eval-after-load - "menubar-items.elc" - `(add-menu-button - '("%_Edit" "%_Multilingual (\"Mule\")" - "%_Describe Language Support") - (vector ,lang-env - '(describe-language-environment ,lang-env) - t)))) - )) - ;; (define-key-after setup-map (vector (intern lang-env)) - ;; (cons lang-env 'setup-specified-language-environment) t) - (when (featurep 'menubar) - (eval-after-load - "menubar-items.elc" - `(add-menu-button - '("%_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))))) + (if (symbolp language-name) + (setq language-name (symbol-name language-name))) + (while alist + (set-language-info language-name (car (car alist)) (cdr (car alist))) + (setq alist (cdr alist)))) (defun read-language-name (key prompt &optional default) - "Read a language environment name which has information for KEY. -If KEY is nil, read any language environment. -Prompt with PROMPT. DEFAULT is the default choice of language environment. -This returns a language environment name as a string." + "Read language name which has information for KEY, prompting with PROMPT. +DEFAULT is the default choice of language. +This returns a language name as a string." (let* ((completion-ignore-case t) (name (completing-read prompt language-info-alist - (and key - (function (lambda (elm) (assq key elm)))) - t nil nil default))) + (function (lambda (elm) (assq key elm))) + t nil default))) (if (and (> (length name) 0) - (or (not key) - (get-language-info name key))) + (get-language-info name key)) name))) ;;; Multilingual input methods. @@ -661,7 +276,7 @@ ";;; %s -- list of LEIM (Library of Emacs Input Method) ;; ;; This file contains a list of LEIM (Library of Emacs Input Method) -;; in the same directory as this file. Loading this file registers +;; in the same directory as this file. Loading this file registeres ;; the whole input methods in Emacs. ;; ;; Each entry has the form: @@ -706,13 +321,10 @@ (put 'current-input-method-title 'permanent-local t) (defcustom default-input-method nil - "*Default input method for multilingual text (a string). + "*Default input method for multilingual text. This is the input method activated automatically by the command `toggle-input-method' (\\[toggle-input-method])." - :group 'mule - :type '(choice (const nil) string)) - -(put 'input-method-function 'permanent-local t) + :group 'mule) (defvar input-method-history nil "History list for some commands that read input methods.") @@ -736,40 +348,26 @@ (put 'describe-current-input-method-function 'permanent-local t) (defvar input-method-alist nil - "Alist of input method names vs how to use them. + "Alist of input method names vs the corresponding information to use it. Each element has the form: - (INPUT-METHOD LANGUAGE-ENV ACTIVATE-FUNC TITLE DESCRIPTION ARGS...) -See the function `register-input-method' for the meanings of the elements.") + (INPUT-METHOD LANGUAGE-NAME ACTIVATE-FUNC TITLE DESCRIPTION ...) +See the function `register-input-method' for the meanings of each elements.") -(defun register-input-method (input-method lang-env &rest args) - "Register INPUT-METHOD as an input method for language environment ENV. -INPUT-METHOD and LANG-ENV are symbols or strings. - +(defun register-input-method (input-method language-name &rest args) + "Register INPUT-METHOD as an input method for LANGUAGE-NAME. +INPUT-METHOD and LANGUAGE-NAME are symbols or strings. The remaining arguments are: - ACTIVATE-FUNC, TITLE, DESCRIPTION, and ARGS... -ACTIVATE-FUNC is a function to call to activate this method. -TITLE is a string to show in the mode line when this method is active. -DESCRIPTION is a string describing this method and what it is good for. -The ARGS, if any, are passed as arguments to ACTIVATE-FUNC. -All told, the arguments to ACTIVATE-FUNC are INPUT-METHOD and the ARGS. - -This function is mainly used in the file \"leim-list.el\" which is -created at building time of emacs, registering all quail input methods -contained in the emacs distribution. - -In case you want to register a new quail input method by yourself, be -careful to use the same input method title as given in the third -parameter of `quail-define-package' (if the values are different, the -string specified in this function takes precedence). - -The commands `describe-input-method' and `list-input-methods' need -this duplicated values to show some information about input methods -without loading the affected quail packages." - (if (symbolp lang-env) - (setq lang-env (symbol-name lang-env))) + ACTIVATE-FUNC, TITLE, DESCRIPTION, and ARG ... + where, +ACTIVATE-FUNC is a function to call for activating this method. +TITLE is a string shown in mode-line while this method is active, +DESCRIPTION is a string describing about this method, +Arguments to ACTIVATE-FUNC are INPUT-METHOD and ARGs." + (if (symbolp language-name) + (setq language-name (symbol-name language-name))) (if (symbolp input-method) (setq input-method (symbol-name input-method))) - (let ((info (cons lang-env args)) + (let ((info (cons language-name args)) (slot (assoc input-method input-method-alist))) (if slot (setcdr slot info) @@ -789,41 +387,30 @@ ;; This binding is necessary because input-method-history is ;; buffer local. (input-method (completing-read prompt input-method-alist - nil t nil 'input-method-history - default))) - (if (and input-method (symbolp input-method)) - (setq input-method (symbol-name input-method))) + nil t nil 'input-method-history) + ;;default) + )) (if (> (length input-method) 0) input-method (if inhibit-null (error "No valid input method is specified"))))) (defun activate-input-method (input-method) - "Switch to input method INPUT-METHOD for the current buffer. -If some other input method is already active, turn it off first. -If INPUT-METHOD is nil, deactivate any current input method." - (if (and input-method (symbolp input-method)) + "Turn INPUT-METHOD on. +If some input method is already on, turn it off at first." + (if (symbolp input-method) (setq input-method (symbol-name input-method))) (if (and current-input-method (not (string= current-input-method input-method))) - (inactivate-input-method)) - (unless (or current-input-method (null input-method)) + (inactivate-input-method)) + (unless current-input-method (let ((slot (assoc input-method input-method-alist))) (if (null slot) (error "Can't activate input method `%s'" input-method)) - (let ((func (nth 2 slot))) - (if (functionp func) - (apply (nth 2 slot) input-method (nthcdr 5 slot)) - (if (and (consp func) (symbolp (car func)) (symbolp (cdr func))) - (progn - (require (cdr func)) - (apply (car func) input-method (nthcdr 5 slot))) - (error "Can't activate input method `%s'" input-method)))) + (apply (nth 2 slot) input-method (nthcdr 5 slot)) (setq current-input-method input-method) (setq current-input-method-title (nth 3 slot)) - (unwind-protect - (run-hooks 'input-method-activate-hook) - (force-mode-line-update))))) + (run-hooks 'input-method-activate-hook)))) (defun inactivate-input-method () "Turn off the current input method." @@ -839,12 +426,12 @@ (unwind-protect (run-hooks 'input-method-inactivate-hook) (setq current-input-method nil - current-input-method-title nil) - (force-mode-line-update))))) + current-input-method-title nil))))) -(defun set-input-method (input-method) - "Select and activate input method INPUT-METHOD for the current buffer. -This also sets the default input method to the one you specify." +(defun select-input-method (input-method) + "Select and turn on INPUT-METHOD. +This sets the default input method to what you specify, +and turn it on for the current buffer." (interactive (let* ((default (or (car input-method-history) default-input-method))) (list (read-input-method-name @@ -856,35 +443,28 @@ (defun toggle-input-method (&optional arg) "Turn on or off a multilingual text input method for the current buffer. -With no prefix argument, if an input method is currently activated, -turn it off. Otherwise, activate an input method -- the one most -recently used, or the one specified in `default-input-method', or -the one read from the minibuffer. +With arg, read an input method from minibuffer and turn it on. -With a prefix argument, read an input method from the minibuffer and -turn it on. +Without arg, if some input method is currently activated, turn it off, +else turn on an input method selected last time +or the default input method (see `default-input-method'). -The default is to use the most recent input method specified -\(not including the currently active input method, if any)." +When there's no input method to turn on, turn on what read from minibuffer." (interactive "P") - (if (and current-input-method (not arg)) - (inactivate-input-method) - (let ((default (or (car input-method-history) default-input-method))) - (if (and arg default (equal current-input-method default) - (> (length input-method-history) 1)) - (setq default (nth 1 input-method-history))) + (let* ((default (or (car input-method-history) default-input-method))) + (if (and current-input-method (not arg)) + (inactivate-input-method) (activate-input-method (if (or arg (not default)) - (progn - (read-input-method-name - (if default "Input method (default %s): " "Input method: " ) - default t)) + (read-input-method-name + (if default "Input method (default %s): " "Input method: " ) + default t) default)) (or default-input-method (setq default-input-method current-input-method))))) (defun describe-input-method (input-method) - "Describe input method INPUT-METHOD." + "Describe input method INPUT-METHOD." (interactive (list (read-input-method-name "Describe input method (default, current choice): "))) @@ -904,11 +484,12 @@ (fboundp describe-current-input-method-function)) (funcall describe-current-input-method-function) (message "No way to describe the current input method `%s'" - current-input-method) + (cdr current-input-method)) (ding)) (error "No input method is activated now"))) -(defun read-multilingual-string (prompt &optional initial-input input-method) +(defun read-multilingual-string (prompt &optional initial-input + input-method) "Read a multilingual string from minibuffer, prompting with string PROMPT. The input method selected last time is activated in minibuffer. If optional second arg INITIAL-INPUT is non-nil, insert it in the minibuffer @@ -918,51 +499,37 @@ or a string." (setq input-method (or input-method - current-input-method default-input-method (read-input-method-name "Input method: " nil t))) (if (and input-method (symbolp input-method)) (setq input-method (symbol-name input-method))) - (let ((prev-input-method current-input-method)) - (unwind-protect - (progn - (activate-input-method input-method) - ;; FSF Emacs - ;; (read-string prompt initial-input nil nil t) - (read-string prompt initial-input nil)) - (activate-input-method prev-input-method)))) + (let ((current-input-method input-method)) + ;; FSFmacs + ;; (read-string prompt initial-input nil nil t))) + (read-string prompt initial-input nil))) ;; Variables to control behavior of input methods. All input methods ;; should react to these variables. -(defcustom input-method-verbose-flag 'default - "*A flag to control extra guidance given by input methods. -The value should be nil, t, `complex-only', or `default'. +(defcustom input-method-verbose-flag t + "*If this flag is non-nil, input methods give extra guidance. The extra guidance is done by showing list of available keys in echo -area. When you use the input method in the minibuffer, the guidance -is shown at the bottom short window (split from the existing window). - -If the value is t, extra guidance is always given, if the value is -nil, extra guidance is always suppressed. +area. -If the value is `complex-only', only complex input methods such as -`chinese-py' and `japanese' give extra guidance. - -If the value is `default', complex input methods always give extra -guidance, but simple input methods give it only when you are not in -the minibuffer. - -See also the variable `input-method-highlight-flag'." - :type '(choice (const t) (const nil) (const complex-only) (const default)) +For complex input methods such as `chinese-py' and `japanese', +when you use the input method in the minibuffer, the guidance is +shown at the bottom short window (split from the existing window). +For simple input methods, guidance is not shown +when you are in the minibuffer." + :type 'boolean :group 'mule) (defcustom input-method-highlight-flag t "*If this flag is non-nil, input methods highlight partially-entered text. For instance, while you are in the middle of a Quail input method sequence, the text inserted so far is temporarily underlined. -The underlining goes away when you finish or abort the input method sequence. -See also the variable `input-method-verbose-flag'." +The underlining goes away when you finish or abort the input method sequence." :type 'boolean :group 'mule) @@ -976,53 +543,22 @@ "Normal hook run just after an input method is inactivated. The variable `current-input-method' still keeps the input method name -just inactivated.") +just inacitvated.") (defvar input-method-after-insert-chunk-hook nil "Normal hook run just after an input method insert some chunk of text.") -(defvar input-method-exit-on-first-char nil - "This flag controls a timing when an input method returns. -Usually, the input method does not return while there's a possibility -that it may find a different translation if a user types another key. -But, it this flag is non-nil, the input method returns as soon as -the current key sequence gets long enough to have some valid translation.") - -(defvar input-method-use-echo-area nil - "This flag controls how an input method shows an intermediate key sequence. -Usually, the input method inserts the intermediate key sequence, -or candidate translations corresponding to the sequence, -at point in the current buffer. -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. 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. +input method temporalily. After the key is handled, the input method is +back on. But, if this flag is non-nil, the input method is never back on.") -(defvar set-language-environment-hook nil - "Normal hook run after some language environment is set. - -When you set some hook function here, that effect usually should not -be inherited to another language environment. So, you had better set -another function in `exit-language-environment-hook' (which see) to -cancel the effect.") - -(defvar exit-language-environment-hook nil - "Normal hook run after exiting from some language environment. -When this hook is run, the variable `current-language-environment' -is still bound to the language environment being exited. - -This hook is mainly used for canceling the effect of -`set-language-environment-hook' (which-see).") - -(put 'setup-specified-language-environment 'apropos-inhibit t) - (defun setup-specified-language-environment () - "Switch to a specified language environment." + "Set up multi-lingual environment convenient for the specified language." (interactive) (let (language-name) (if (and (symbolp last-command-event) @@ -1032,246 +568,30 @@ (set-language-environment language-name) (error "Bogus calling sequence")))) -(defcustom current-language-environment "English" - "The last language environment specified with `set-language-environment'. -This variable should be set only with \\[customize], which is equivalent -to using the function `set-language-environment'." - :link '(custom-manual "(emacs)Language Environments") - :set (lambda (symbol value) (set-language-environment value)) - :get (lambda (x) - (or (car-safe (assoc-ignore-case - (if (symbolp current-language-environment) - (symbol-name current-language-environment) - current-language-environment) - language-info-alist)) - "English")) - :type (cons 'choice (mapcar (lambda (lang) - (list 'const (car lang))) - language-info-alist)) - :initialize 'custom-initialize-default - :group 'mule - :type 'string) - -(defun reset-language-environment () - "Reset multilingual environment of Emacs to the default status. - -The default status is as follows: - - The default value of buffer-file-coding-system is nil. - The default coding system for process I/O is nil. - The default value for the command `set-terminal-coding-system' is nil. - The default value for the command `set-keyboard-coding-system' is nil. - - The order of priorities of coding categories and the coding system - bound to each category are as follows - coding category coding system - -------------------------------------------------- - iso-8-2 iso-8859-1 - iso-8-1 iso-8859-1 - iso-7 iso-2022-7bit - iso-lock-shift iso-2022-lock - iso-8-designate iso-2022-8bit-ss2 - no-conversion raw-text - shift-jis shift_jis - big5 big5 - ucs-4 ---- - utf-8 ---- -" - (interactive) - ;; This function formerly set default-enable-multibyte-characters to t, - ;; but that is incorrect. It should not alter the unibyte/multibyte choice. - - (set-coding-category-system 'iso-7 'iso-2022-7bit) - (set-coding-category-system 'iso-8-1 'iso-8859-1) - (set-coding-category-system 'iso-8-2 'iso-8859-1) - (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) - (set-coding-category-system 'iso-8-designate 'iso-2022-8bit-ss2) - (set-coding-category-system 'no-conversion 'raw-text) - (set-coding-category-system 'shift-jis 'shift_jis) - (set-coding-category-system 'big5 'big5) - (cond ((eq (coding-system-type (coding-category-system 'utf-8)) 'utf-8) - (set-coding-category-system 'ucs-4 'iso-10646-ucs-4) - (set-coding-category-system 'utf-8 'utf-8) - (set-coding-priority-list - '(iso-8-1 - iso-8-2 - iso-7 - iso-lock-shift - iso-8-designate - utf-8 - ucs-4 - no-conversion - shift-jis - big5)) - ) - (t - (set-coding-priority-list - '(iso-8-1 - iso-8-2 - iso-7 - iso-lock-shift - iso-8-designate - no-conversion - shift-jis - big5)) - )) - - ;; (update-coding-systems-internal) - - (set-default-coding-systems nil) - ;; Don't alter the terminal and keyboard coding systems here. - ;; The terminal still supports the same coding system - ;; that it supported a minute ago. -;;; (set-terminal-coding-system-internal nil) -;;; (set-keyboard-coding-system-internal nil) - - ;; (setq nonascii-translation-table nil - ;; nonascii-insert-offset 0) - ) +(defvar current-language-environment "English" + "The last language environment specified with `set-language-environment'.") (defun set-language-environment (language-name) "Set up multi-lingual environment for using LANGUAGE-NAME. This sets the coding system priority and the default input method -and sometimes other things. LANGUAGE-NAME should be a string -which is the name of a language environment. For example, \"Latin-1\" -specifies the character set for the major languages of Western Europe." - (interactive (list (read-language-name - nil - "Set language environment (default, English): "))) +and sometimes other things." + (interactive (list (read-language-name 'setup-function + "Set language environment: "))) (if language-name (if (symbolp language-name) (setq language-name (symbol-name language-name))) (setq language-name "English")) - (or (assoc-ignore-case language-name language-info-alist) + (if (null (get-language-info language-name 'setup-function)) (error "Language environment not defined: %S" language-name)) - (if current-language-environment - (let ((func (get-language-info current-language-environment - 'exit-function))) - (run-hooks 'exit-language-environment-hook) - (if (fboundp func) (funcall func)))) - (let ((default-eol-type (coding-system-eol-type - default-buffer-file-coding-system))) - (reset-language-environment) - - (setq current-language-environment language-name) - (set-language-environment-coding-systems language-name default-eol-type)) - (let ((input-method (get-language-info language-name 'input-method))) - (when input-method - (setq default-input-method input-method) - (if input-method-history - (setq input-method-history - (cons input-method - (delete input-method input-method-history)))))) - ;; (let ((nonascii (get-language-info language-name 'nonascii-translation)) - ;; (dos-table - ;; (if (eq window-system 'pc) - ;; (intern - ;; (concat "cp" dos-codepage "-nonascii-translation-table"))))) - ;; (cond - ;; ((char-table-p nonascii) - ;; (setq nonascii-translation-table nonascii)) - ;; ((and (eq window-system 'pc) (boundp dos-table)) - ;; ;; DOS terminals' default is to use a special non-ASCII translation - ;; ;; table as appropriate for the installed codepage. - ;; (setq nonascii-translation-table (symbol-value dos-table))) - ;; ((charsetp nonascii) - ;; (setq nonascii-insert-offset (- (make-char nonascii) 128))))) - - ;; (setq charset-origin-alist - ;; (get-language-info language-name 'charset-origin-alist)) - - ;; Unibyte setups if necessary. - ;; (unless default-enable-multibyte-characters - ;; ;; Syntax and case table. - ;; (let ((syntax (get-language-info language-name 'unibyte-syntax))) - ;; (if syntax - ;; (let ((set-case-syntax-set-multibyte nil)) - ;; (load syntax nil t)) - ;; ;; No information for syntax and case. Reset to the defaults. - ;; (let ((syntax-table (standard-syntax-table)) - ;; (case-table (standard-case-table)) - ;; (ch (if (eq window-system 'pc) 128 160))) - ;; (while (< ch 256) - ;; (modify-syntax-entry ch " " syntax-table) - ;; (aset case-table ch ch) - ;; (setq ch (1+ ch))) - ;; (set-char-table-extra-slot case-table 0 nil) - ;; (set-char-table-extra-slot case-table 1 nil) - ;; (set-char-table-extra-slot case-table 2 nil)) - ;; (set-standard-case-table (standard-case-table)) - ;; (let ((list (buffer-list))) - ;; (while list - ;; (with-current-buffer (car list) - ;; (set-case-table (standard-case-table))) - ;; (setq list (cdr list)))))) - ;; ;; Display table and coding system for terminal. - ;; (let ((coding (get-language-info language-name 'unibyte-display))) - ;; (if coding - ;; (standard-display-european-internal) - ;; (standard-display-default (if (eq window-system 'pc) 128 160) 255) - ;; (aset standard-display-table 146 nil)) - ;; (or (eq window-system 'pc) - ;; (set-terminal-coding-system coding)))) - - (let ((required-features (get-language-info language-name 'features))) - (while required-features - (require (car required-features)) - (setq required-features (cdr required-features)))) - (let ((func (get-language-info language-name 'setup-function))) - (if (fboundp func) - (funcall func))) - (run-hooks 'set-language-environment-hook) + (funcall (get-language-info language-name 'setup-function)) + (setq current-language-environment language-name) (force-mode-line-update t)) -;; (defun standard-display-european-internal () -;; ;; Actually set up direct output of non-ASCII characters. -;; (standard-display-8bit (if (eq window-system 'pc) 128 160) 255) -;; ;; Unibyte Emacs on MS-DOS wants to display all 8-bit characters with -;; ;; the native font, and codes 160 and 146 stand for something very -;; ;; different there. -;; (or (and (eq window-system 'pc) (not default-enable-multibyte-characters)) -;; (progn -;; ;; Make non-line-break space display as a plain space. -;; ;; Most X fonts do the wrong thing for code 160. -;; (aset standard-display-table 160 [32]) -;; ;; Most Windows programs send out apostrophe's as \222. Most X fonts -;; ;; don't contain a character at that position. Map it to the ASCII -;; ;; apostrophe. -;; (aset standard-display-table 146 [39])))) - -(defun set-language-environment-coding-systems (language-name - &optional eol-type) - "Do various coding system setups for language environment LANGUAGE-NAME. - -The optional arg EOL-TYPE specifies the eol-type of the default value -of buffer-file-coding-system set by this function." - (let* ((priority (get-language-info language-name 'coding-priority)) - (default-coding (car priority))) - (if priority - (let ((categories (mapcar 'coding-system-category priority)) - category checked-categories) - (set-default-coding-systems - (if (memq eol-type '(lf crlf cr unix dos mac)) - (coding-system-change-eol-conversion default-coding eol-type) - default-coding)) - ;; (setq default-sendmail-coding-system default-coding) - (while priority - (unless (memq (setq category (car categories)) checked-categories) - (set-coding-category-system category (car priority)) - (setq checked-categories (cons category checked-categories))) - (setq priority (cdr priority) - categories (cdr categories))) - (set-coding-priority-list (nreverse checked-categories)) - ;; (update-coding-systems-internal) - )))) - ;; Print all arguments with `princ', then print "\n". (defsubst princ-list (&rest args) (while args (princ (car args)) (setq args (cdr args))) (princ "\n")) -(put 'describe-specified-language-support 'apropos-inhibit t) - ;; Print a language specific information such as input methods, ;; charsets, and coding systems. This function is intended to be ;; called from the menu: @@ -1291,7 +611,7 @@ (interactive (list (read-language-name 'documentation - "Describe language environment (default, current choice): "))) + "Describe language environment (default, current choise): "))) (if (null language-name) (setq language-name current-language-environment)) (if (or (null language-name) @@ -1301,9 +621,8 @@ (setq language-name (symbol-name language-name))) (let ((doc (get-language-info language-name 'documentation))) (with-output-to-temp-buffer "*Help*" - (princ-list language-name " language environment" "\n") (if (stringp doc) - (progn + (progn (princ-list doc) (terpri))) (let ((str (get-language-info language-name 'sample-text))) @@ -1312,15 +631,9 @@ (princ "Sample text:\n") (princ-list " " str) (terpri)))) - (let ((input-method (get-language-info language-name 'input-method)) - (l (copy-sequence input-method-alist))) - (princ "Input methods") - (when input-method - (princ (format " (default, %s)" input-method)) - (setq input-method (assoc input-method input-method-alist)) - (setq l (cons input-method (delete input-method l)))) - (princ ":\n") - (while l + (princ "Input methods:\n") + (let ((l input-method-alist)) + (while l (if (string= language-name (nth 1 (car l))) (princ-list " " (car (car l)) (format " (`%s' in mode line)" (nth 3 (car l))))) @@ -1343,14 +656,9 @@ (princ ; (format " %s (`%c' in mode line):\n\t%s\n" ;; In XEmacs, `coding-system-mnemonic' returns string. (format " %s (`%s' in mode line):\n\t%s\n" - (car l) - (coding-system-mnemonic (car l)) - (coding-system-doc-string (car l)))) - ;; (let ((aliases (coding-system-get (car l) 'alias-coding-systems))) - ;; (when aliases - ;; (princ "\t") - ;; (princ (cons 'alias: (cdr aliases))) - ;; (terpri))) + (car l) + (coding-system-mnemonic (car l)) + (coding-system-doc-string (car l)))) (setq l (cdr l)))))))) ;;; Charset property @@ -1370,7 +678,7 @@ (defvar char-code-property-table (make-char-table 'generic) "Char-table containing a property list of each character code. - +;; See also the documentation of `get-char-code-property' and `put-char-code-property'") ;; (let ((plist (aref char-code-property-table char))) @@ -1391,70 +699,8 @@ (nconc plist (list propname value)))) (put-char-table char (list propname value) char-code-property-table) ))) - - -;; Pretty description of encoded string - -;; Alist of ISO 2022 control code vs the corresponding mnemonic string. -;; (defvar iso-2022-control-alist -;; '((?\x1b . "ESC") -;; (?\x0e . "SO") -;; (?\x0f . "SI") -;; (?\x8e . "SS2") -;; (?\x8f . "SS3") -;; (?\x9b . "CSI"))) - -;; (defun encoded-string-description (str coding-system) -;; "Return a pretty description of STR that is encoded by CODING-SYSTEM." -;; (setq str (string-as-unibyte str)) -;; (let ((char (aref str 0)) -;; desc) -;; (when (< char 128) -;; (setq desc (or (cdr (assq char iso-2022-control-alist)) -;; (char-to-string char))) -;; (let ((i 1) -;; (len (length str))) -;; (while (< i len) -;; (setq char (aref str i)) -;; (if (>= char 128) -;; (setq desc nil i len) -;; (setq desc (concat desc " " -;; (or (cdr (assq char iso-2022-control-alist)) -;; (char-to-string char))) -;; i (1+ i)))))) -;; (or desc -;; (mapconcat (function (lambda (x) (format "0x%02x" x))) str " ")))) - -;; (defun encode-coding-char (char coding-system) -;; "Encode CHAR by CODING-SYSTEM and return the resulting string. -;; If CODING-SYSTEM can't safely encode CHAR, return nil." -;; (if (cmpcharp char) -;; (setq char (car (decompose-composite-char char 'list)))) -;; (let ((str1 (char-to-string char)) -;; (str2 (make-string 2 char)) -;; (safe-charsets (and coding-system -;; (coding-system-get coding-system 'safe-charsets))) -;; enc1 enc2 i1 i2) -;; (when (or (eq safe-charsets t) -;; (memq (char-charset char) safe-charsets)) -;; ;; We must find the encoded string of CHAR. But, just encoding -;; ;; CHAR will put extra control sequences (usually to designate -;; ;; ASCII charset) at the tail if type of CODING is ISO 2022. -;; ;; To exclude such tailing bytes, we at first encode one-char -;; ;; string and two-char string, then check how many bytes at the -;; ;; tail of both encoded strings are the same. -;; -;; (setq enc1 (string-as-unibyte (encode-coding-string str1 coding-system)) -;; i1 (length enc1) -;; enc2 (string-as-unibyte (encode-coding-string str2 coding-system)) -;; i2 (length enc2)) -;; (while (and (> i1 0) (= (aref enc1 (1- i1)) (aref enc2 (1- i2)))) -;; (setq i1 (1- i1) i2 (1- i2))) -;; -;; ;; Now (substring enc1 i1) and (substring enc2 i2) are the same, -;; ;; and they are the extra control sequences at the tail to -;; ;; exclude. -;; (substring enc2 0 i2)))) - +;; (setcar (cdr slot) value) +;; (nconc plist (list propname value)))) +;; (aset char-code-property-table char (list propname value))))) ;;; mule-cmds.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-files.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/mule/mule-files.el Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,35 @@ +;;; mule-files.el --- File I/O functions for XEmacs/Mule. + +;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc. +;; Copyright (C) 1995 Amdahl Corporation. +;; Copyright (C) 1995 Sun Microsystems. + +;; 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: + +;;; Derived from mule.el in the original Mule but heavily modified +;;; by Ben Wing. Mostly moved to code-files.el + +;; 1997/3/11 modified by MORIOKA Tomohiko to sync with Emacs 20 API. + +;;; Code: + +(setq-default buffer-file-coding-system 'iso-2022-8) + +;;; mule-files.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-help.el --- a/lisp/mule/mule-help.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-help.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,8 @@ ;; Copyright (C) 1997 by Free Software Foundation, Inc. -;; Author: SL Baur -;; Keywords: help, internal, mule +;; Author: SL Baur +;; Keywords: help, internal ;; This file is part of XEmacs. @@ -57,9 +57,7 @@ (setq buffer-file-name file) (setq default-directory (expand-file-name "~/")) (setq buffer-auto-save-file-name nil) - (let ((coding-system-for-read - (get-language-info lang 'tutorial-coding-system))) - (insert-file-contents (locate-data-file filename))) + (insert-file-contents (locate-data-file filename)) (goto-char (point-min)) ;; The 'didactic' blank lines: Possibly insert blank lines ;; around <>, and change << >> to [ ]. @@ -85,4 +83,4 @@ (provide 'mule-help) -;;; mule-help.el ends here +;;; mule-help.el ends here \ No newline at end of file diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-init.el --- a/lisp/mule/mule-init.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-init.el Mon Aug 13 11:20:41 2007 +0200 @@ -116,7 +116,7 @@ (setenv "LC_MESSAGES" "C") (setenv "LC_TIME" "C")))) - ;; Register available input methods by loading LEIM list file. + ;; Register avairable input methods by loading LEIM list file. (load "leim-list.el" 'noerror 'nomessage 'nosuffix) ) diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-misc.el --- a/lisp/mule/mule-misc.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-misc.el Mon Aug 13 11:20:41 2007 +0200 @@ -64,7 +64,7 @@ (len (length string)) (i 0)) (while (< i len) - (setq col (+ col (charset-width (char-charset (aref string i))))) + (setq col (+ col (charset-columns (char-charset (aref string i))))) (setq i (1+ i))) col)) @@ -163,14 +163,14 @@ (defalias 'sref 'aref) (defalias 'map-char-concat 'mapcar) (defun char-bytes (character) - "Return number of bytes a CHARACTER occupies in a string or buffer. -It always returns 1 in XEmacs. It is for compatibility with MULE 2.3." + "Return number of length a CHARACTER occupies in a string or buffer. +It returns only 1 in XEmacs. It is for compatibility with MULE 2.3." 1) (defalias 'char-length 'char-bytes) (defun char-width (character) "Return number of columns a CHARACTER occupies when displayed." - (charset-width (char-charset character))) + (charset-columns (char-charset character))) (defalias 'char-columns 'char-width) (make-obsolete 'char-columns 'char-width) @@ -190,34 +190,34 @@ because its `find-charset-string' ignores ASCII charset." (delq 'ascii (charsets-in-region start end))) -;(defun split-char (char) -; "Return list of charset and one or two position-codes of CHAR." -; (let ((charset (char-charset char))) -; (if (eq charset 'ascii) -; (list charset (char-int char)) -; (let ((i 0) -; (len (charset-dimension charset)) -; (code (if (integerp char) -; char -; (char-int char))) -; dest) -; (while (< i len) -; (setq dest (cons (logand code 127) dest) -; code (lsh code -7) -; i (1+ i))) -; (cons charset dest) -; )))) +(defun split-char (char) + "Return list of charset and one or two position-codes of CHAR." + (let ((charset (char-charset char))) + (if (eq charset 'ascii) + (list charset (char-int char)) + (let ((i 0) + (len (charset-dimension charset)) + (code (if (integerp char) + char + (char-int char))) + dest) + (while (< i len) + (setq dest (cons (logand code 127) dest) + code (lsh code -7) + i (1+ i))) + (cons charset dest) + )))) -;(defun split-char-or-char-int (char) -; "Return list of charset and one or two position-codes of CHAR. -;CHAR must be character or integer." -; (if (characterp char) -; (split-char char) -; (let ((c (int-char char))) -; (if c -; (split-char c) -; (list 'ascii c) -; )))) +(defun split-char-or-char-int (char) + "Return list of charset and one or two position-codes of CHAR. +CHAR must be character or integer." + (if (characterp char) + (split-char char) + (let ((c (int-char char))) + (if c + (split-char c) + (list 'ascii c) + )))) ;;; Commands @@ -301,60 +301,4 @@ ;; (put env-sym 'quail-environ-doc-string doc-string) ;; (put env-sym 'set-quail-environ enable-function)) - -;;; @ coding-system category -;;; - -(defun coding-system-get (coding-system prop) - "Extract a value from CODING-SYSTEM's property list for property PROP." - (or (plist-get - (get (coding-system-name coding-system) 'coding-system-property) - prop) - (condition-case nil - (coding-system-property coding-system prop) - (error nil)))) - -(defun coding-system-put (coding-system prop val) - "Change value in CODING-SYSTEM's property list PROP to VAL." - (put (coding-system-name coding-system) - 'coding-system-property - (plist-put (get (coding-system-name coding-system) - 'coding-system-property) - prop val))) - -(defun coding-system-category (coding-system) - "Return the coding category of CODING-SYSTEM." - (or (coding-system-get coding-system 'category) - (let ((type (coding-system-type coding-system))) - (cond ((eq type 'no-conversion) - 'no-conversion) - ((eq type 'shift-jis) - 'shift-jis) - ((eq type 'ucs-4) - 'ucs-4) - ((eq type 'utf-8) - 'utf-8) - ((eq type 'big5) - 'big5) - ((eq type 'iso2022) - (cond ((coding-system-lock-shift coding-system) - 'iso-lock-shift) - ((coding-system-seven coding-system) - 'iso-7) - (t - (let ((dim 0) - ccs - (i 0)) - (while (< i 4) - (setq ccs (coding-system-charset coding-system i)) - (if (and ccs - (> (charset-dimension ccs) dim)) - (setq dim (charset-dimension ccs)) - ) - (setq i (1+ i))) - (cond ((= dim 1) 'iso-8-1) - ((= dim 2) 'iso-8-2) - (t 'iso-8-designate)) - )))))))) - ;;; mule-misc.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/mule-x-init.el --- a/lisp/mule/mule-x-init.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/mule-x-init.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ ;;; mule-x-init.el --- initialization code for X Windows under MULE ;; Copyright (C) 1994 Free Software Foundation, Inc. -;; Copyright (C) 1996 Ben Wing +;; Copyright (C) 1996 Ben Wing ;; Author: various ;; Keywords: mule X11 @@ -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 12e008d41344 -r 697ef44129c6 lisp/mule/thai-xtis-chars.el --- a/lisp/mule/thai-xtis-chars.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -;;; thai-xtis-chars.el --- definition of the Thai XTIS charset. - -;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. -;; Licensed to the Free Software Foundation. - -;; Author: MORIOKA Tomohiko - -;; Keywords: mule, multilingual, Thai, XTIS - -;; 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: - -;; For Thai, the pre-composed character set proposed by -;; Virach Sornlertlamvanich is supported. - -;;; Code: - -(make-charset 'thai-xtis "Precomposed Thai (XTIS by Virach)." - '(registry "xtis-0" - dimension 2 - columns 1 - chars 94 - final ?? - graphic 0)) - -(define-category ?x "Precomposed Thai character.") -(modify-category-entry 'thai-xtis ?x) - -;; thai-xtis-chars.el ends here. diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/thai-xtis.el --- a/lisp/mule/thai-xtis.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/thai-xtis.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; thai-xtis.el --- Support for Thai (XTIS) -*- coding: iso-2022-7bit; -*- +;;; thai-xtis.el --- Thai support for pre-composed font (for XTIS). ;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -35,180 +35,119 @@ ;;; Code: (when (featurep 'xemacs) - (let ((deflist '(;; chars syntax - ("$(?!0(B-$(?NxP0R0S0`0(B-$(?e0(B" "w") - ("$(?p0(B-$(?y0(B" "w") - ("$(?O0f0_0o0z0{0(B" "_") - )) - elm chars len syntax to ch i) - (while deflist - (setq elm (car deflist)) - (setq chars (car elm) - len (length chars) - syntax (nth 1 elm) - i 0) - (while (< i len) - (if (= (aref chars i) ?-) - (setq i (1+ i) - to (nth 1 (split-char (aref chars i)))) - (setq ch (nth 1 (split-char (aref chars i))) - to ch)) - (while (<= ch to) - (modify-syntax-entry (vector 'thai-xtis ch) syntax) - (setq ch (1+ ch))) - (setq i (1+ i))) - (setq deflist (cdr deflist)))) + (make-charset 'thai-xtis "Precomposed Thai (XTIS by Virach)." + '(registry "xtis-0$" + dimension 2 + chars 94 + final ?? + graphic 0)) - (put-charset-property 'thai-xtis 'preferred-coding-system 'tis-620) + (modify-syntax-entry 'thai-xtis "w") + + (define-category ?T "Precomposed Thai character.") + (modify-category-entry 'thai-xtis ?T) ) -;; This is the ccl-decode-thai-xtis automaton. -;; -;; "WRITE x y" == (insert (make-char 'thai-xtis x y)) -;; "write x" == (insert x) -;; rx' == (tis620-to-thai-xtis-second-byte-bitpattern rx) -;; r3 == "no vower nor tone" -;; r4 == (charset-id 'thai-xtis) -;; -;; | input (= r0) -;; state |-------------------------------------------- -;; | consonant | vowel | tone -;; ---------+-------------+-------------+---------------- -;; r1 == 0 | r1 = r0 | WRITE r0,r3 | WRITE r0,r3 -;; r2 == 0 | | | -;; ---------+-------------+-------------+---------------- -;; r1 == C | WRITE r1,r3 | r2 = r0' | WRITE r1,r3|r0' -;; r2 == 0 | r1 = r0 | | r1 = 0 -;; ---------+-------------+-------------+---------------- -;; r1 == C | WRITE r1,r2 | WRITE r1,r2 | WRITE r1,r2|r0' -;; r2 == V | r1 = r0 | WRITE r0,r3 | r1 = r2 = 0 -;; | r2 = 0 | r1 = r2 = 0 | -;; -;; -;; | input (= r0) -;; state |----------------------------------------- -;; | symbol | ASCII | EOF -;; ---------+-------------+-------------+------------- -;; r1 == 0 | WRITE r0,r3 | write r0 | -;; r2 == 0 | | | -;; ---------+-------------+-------------+------------- -;; r1 == C | WRITE r1,r3 | WRITE r1,r3 | WRITE r1,r3 -;; r2 == 0 | WRITE r0,r3 | write r0 | -;; | r1 = 0 | r1 = 0 | -;; ---------+-------------+-------------+------------- -;; r1 == C | WRITE r1,r2 | WRITE r1,r2 | WRITE r1,r2 -;; r2 == V | WRITE r0,r3 | write r0 | -;; | r1 = r2 = 0 | r1 = r2 = 0 | + +(defvar leading-code-private-21 #x9F) - -(eval-and-compile - -;; input : r5 = 1st byte, r6 = 2nd byte -;; Their values will be destroyed. -(define-ccl-program ccl-thai-xtis-write - '(0 - ((r5 = ((r5 & #x7F) << 7)) - (r6 = ((r6 & #x7F) | r5)) - (write-multibyte-character r4 r6)))) +(defconst thai-xtis-leading-code + (concat (char-to-string leading-code-private-21) + (char-to-string (charset-id 'thai-xtis)))) (define-ccl-program ccl-thai-xtis-consonant - '(0 + `(0 (if (r1 == 0) - (r1 = r0) - (if (r2 == 0) - ((r5 = r1) (r6 = r3) (call ccl-thai-xtis-write) - (r1 = r0)) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write) - (r1 = r0) - (r2 = 0)))))) + ((write ,thai-xtis-leading-code) + (write r0) + (r1 = r2)) + (if (r1 == r2) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0)) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0) + (r1 = r2)))))) + +(define-ccl-program ccl-thai-xtis-vowel-d1 + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + (r1 = ?\xb8) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) (define-ccl-program ccl-thai-xtis-vowel - '(0 - ((if (r1 == 0) - ((r5 = r0) (r6 = r3) (call ccl-thai-xtis-write)) - ((if (r2 == 0) - (r2 = ((r0 - 204) << 3)) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write) - (r5 = r0) (r6 = r3) (call ccl-thai-xtis-write) - (r1 = 0) - (r2 = 0)))))))) - -(define-ccl-program ccl-thai-xtis-vowel-d1 - '(0 - ((if (r1 == 0) - ((r5 = r0) (r6 = r3) (call ccl-thai-xtis-write)) - ((if (r2 == 0) - (r2 = #x38) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write) - (r5 = r0) (r6 = r3) (call ccl-thai-xtis-write) - (r1 = 0) - (r2 = 0)))))))) + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + (r1 = ((r0 - 188) << 3)) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) (define-ccl-program ccl-thai-xtis-vowel-ee - '(0 - ((if (r1 == 0) - ((r5 = r0) (r6 = r3) (call ccl-thai-xtis-write)) - ((if (r2 == 0) - (r2 = #x78) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write) - (r5 = r0) (r6 = r3) (call ccl-thai-xtis-write) - (r1 = 0) - (r2 = 0)))))))) + `(0 + (if (r1 == 0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + (r1 = ?\xf8) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) (define-ccl-program ccl-thai-xtis-tone - '(0 + `(0 (if (r1 == 0) - ((r5 = r0) (r6 = r3) (call ccl-thai-xtis-write)) - (if (r2 == 0) - ((r5 = r1) (r6 = ((r0 - #xE6) | r3)) (call ccl-thai-xtis-write) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + ((r0 -= 54) + (write r0) (r1 = 0)) - ((r5 = r1) (r6 = ((r0 - #xE6) | r2)) (call ccl-thai-xtis-write) - (r1 = 0) - (r2 = 0)))))) + ((r1 += (r0 - ?\xe6)) + (write r1) + (r1 = 0)))))) (define-ccl-program ccl-thai-xtis-symbol - '(0 - (if (r1 == 0) - ((r5 = r0) (r6 = r3) (call ccl-thai-xtis-write)) - (if (r2 == 0) - ((r5 = r1) (r6 = r3) (call ccl-thai-xtis-write) - (r5 = r0) (r6 = r3) (call ccl-thai-xtis-write) - (r1 = 0)) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write) - (r5 = r0) (r6 = r3) (call ccl-thai-xtis-write) - (r1 = 0) - (r2 = 0)))))) - -(define-ccl-program ccl-thai-xtis-ascii - '(0 + `(0 (if (r1 == 0) - (write r0) - (if (r2 == 0) - ((r5 = r1) (r6 = r3) (call ccl-thai-xtis-write) - (write r0) + ((write ,thai-xtis-leading-code) + (write r0 r2)) + (if (r1 == r2) + ((write r2) + (write ,thai-xtis-leading-code) + (write r0 r2) (r1 = 0)) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write) - (write r0) - (r1 = 0) - (r2 = 0)))))) - -(define-ccl-program ccl-thai-xtis-eof - '(0 - (if (r1 != 0) - (if (r2 == 0) - ((r5 = r1) (r6 = r3) (call ccl-thai-xtis-write)) - ((r5 = r1) (r6 = r2) (call ccl-thai-xtis-write)))))) + ((write r1) + (write ,thai-xtis-leading-code) + (write r0 r2) + (r1 = 0)))))) (define-ccl-program ccl-decode-thai-xtis `(4 ((read r0) (r1 = 0) - (r2 = 0) - (r3 = #x30) - (r4 = ,(charset-id 'thai-xtis)) + (r2 = ?\xb0) (loop (if (r0 < 161) - (call ccl-thai-xtis-ascii) + (if (r1 == 0) + (write r0) + (if (r1 == r2) + ((write r2 r0) + (r1 = 0)) + ((write r1 r0) + (r1 = 0)))) (branch (r0 - 161) (call ccl-thai-xtis-consonant) (call ccl-thai-xtis-consonant) @@ -307,11 +246,9 @@ (read r0) (repeat))) - (call ccl-thai-xtis-eof))) - -) - -(defconst leading-code-private-21 #x9F) + (if (r1 != 0) + (write r1) + nil))) (define-ccl-program ccl-encode-thai-xtis `(1 @@ -324,7 +261,7 @@ (write r0) (read r0) (r1 = (r0 & 7)) - (r0 = ((r0 - #xB0) >> 3)) + (r0 = ((r0 - ?\xb0) >> 3)) (if (r0 != 0) (write r0 [0 209 212 213 214 215 216 217 218 238])) (if (r1 != 0) @@ -337,14 +274,12 @@ (write-read-repeat r0)))))) (if (featurep 'xemacs) - (progn - (make-coding-system - 'tis-620 'ccl - "external=tis620, internal=thai-xtis" - `(mnemonic "TIS620" - decode ,ccl-decode-thai-xtis - encode ,ccl-encode-thai-xtis)) - (coding-system-put 'tis-620 'category 'iso-8-1)) + (make-coding-system + 'tis-620 'ccl + "external=tis620, internal=thai-xtis" + `(mnemonic "TIS620" + decode ,ccl-decode-thai-xtis + encode ,ccl-encode-thai-xtis)) (make-coding-system 'tis-620 4 ?T "external=tis620, internal=thai-xtis" '(ccl-decode-thai-xtis . ccl-encode-thai-xtis) @@ -354,10 +289,10 @@ (set-language-info-alist "Thai-XTIS" - '((charset thai-xtis) + '((setup-function . setup-thai-xtis-environment) + (exit-function . exit-thai-xtis-environment) + (charset thai-xtis) (coding-system tis-620 iso-2022-7bit) - (tutorial . "TUTORIAL.th") - (tutorial-coding-system . tis-620) (coding-priority tis-620 iso-2022-7bit) (sample-text . "$(?!:(B") (documentation . t))) diff -r 12e008d41344 -r 697ef44129c6 lisp/mule/vietnamese.el --- a/lisp/mule/vietnamese.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/mule/vietnamese.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; vietnamese.el --- Support for Vietnamese -*- coding: iso-2022-7bit; -*- +;;; vietnamese.el --- Support for Vietnamese ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. @@ -33,22 +33,22 @@ (defvar viet-viscii-decode-table [;; VISCII is a full 8-bit code. - 0 1 ?,2F(B 3 4 ?,2G(B ?,2g(B 7 8 9 10 11 12 13 14 15 - 16 17 18 19 ?,2V(B 21 22 23 24 ?,2[(B 26 27 28 29 ?,2\(B 31 + 0 1 ?.2NF 3 4 ?NG ?Ng 7 8 9 10 11 12 13 14 15 + 16 17 18 19 ?.2NV 21 22 23 24 ?N[ 26 27 28 29 ?N\ 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - ?,2U(B ?,2!(B ?,2"(B ?,2#(B ?,2$(B ?,2%(B ?,2&(B ?,2'(B ?,2((B ?,2)(B ?,2*(B ?,2+(B ?,2,(B ?,2-(B ?,2.(B ?,2/(B - ?,20(B ?,21(B ?,22(B ?,25(B ?,2~(B ?,2>(B ?,26(B ?,27(B ?,28(B ?,2v(B ?,2w(B ?,2o(B ?,2|(B ?,2{(B ?,2x(B ?,2O(B - ?,2u(B ?,1!(B ?,1"(B ?,1#(B ?,1$(B ?,1%(B ?,1&(B ?,1'(B ?,1((B ?,1)(B ?,1*(B ?,1+(B ?,1,(B ?,1-(B ?,1.(B ?,1/(B - ?,10(B ?,11(B ?,12(B ?,2^(B ?,2=(B ?,15(B ?,16(B ?,17(B ?,18(B ?,2q(B ?,2Q(B ?,2W(B ?,2X(B ?,1=(B ?,1>(B ?,2_(B - ?,2`(B ?,2a(B ?,2b(B ?,2c(B ?,2d(B ?,2e(B ?,1F(B ?,1G(B ?,2h(B ?,2i(B ?,2j(B ?,2k(B ?,2l(B ?,2m(B ?,2n(B ?,1O(B - ?,2p(B ?,1Q(B ?,2r(B ?,2s(B ?,2t(B ?,1U(B ?,1V(B ?,1W(B ?,1X(B ?,2y(B ?,2z(B ?,1[(B ?,1\(B ?,2}(B ?,1^(B ?,1_(B - ?,1`(B ?,1a(B ?,1b(B ?,1c(B ?,1d(B ?,1e(B ?,1f(B ?,1g(B ?,1h(B ?,1i(B ?,1j(B ?,1k(B ?,1l(B ?,1m(B ?,1n(B ?,1o(B - ?,1p(B ?,1q(B ?,1r(B ?,1s(B ?,1t(B ?,1u(B ?,1v(B ?,1w(B ?,1x(B ?,1y(B ?,1z(B ?,1{(B ?,1|(B ?,1}(B ?,1~(B ?,2f(B ] + ?.2NU ?N! ?N" ?N# ?N$ ?N% ?N& ?N' ?N( ?N) ?N* ?N+ ?N, ?N- ?N. ?N/ + ?.2N0 ?N1 ?N2 ?N5 ?N~ ?N> ?N6 ?N7 ?N8 ?Nv ?Nw ?No ?N| ?N{ ?Nx ?NO + ?.2Nu ?.1N! ?N" ?N# ?N$ ?N% ?N& ?N' ?N( ?N) ?N* ?N+ ?N, ?N- ?N. ?N/ + ?.1N0 ?N1 ?N2 ?.2N^ ?N= ?.1N5 ?N6 ?N7 ?N8 ?.2Nq ?NQ ?NW ?NX ?.1N= ?N> ?.2N_ + ?.2N` ?Na ?Nb ?Nc ?Nd ?Ne ?.1NF ?NG ?.2Nh ?Ni ?Nj ?Nk ?Nl ?Nm ?Nn ?.1NO + ?.2Np ?.1NQ ?.2Nr ?Ns ?Nt ?.1NU ?NV ?NW ?NX ?.2Ny ?Nz ?.1N[ ?N\ ?.2N} ?.1N^ ?N_ + ?.1N` ?Na ?Nb ?Nc ?Nd ?Ne ?Nf ?Ng ?Nh ?Ni ?Nj ?Nk ?Nl ?Nm ?Nn ?No + ?.1Np ?Nq ?Nr ?Ns ?Nt ?Nu ?Nv ?Nw ?Nx ?Ny ?Nz ?N{ ?N| ?N} ?N~ ?.2Nf ] "Vietnamese VISCII decoding table.") (defvar viet-viscii-encode-table @@ -58,7 +58,7 @@ char-component) (while (< i 256) (setq char-component - (split-char (aref viet-viscii-decode-table i))) + (split-char-or-char-int (aref viet-viscii-decode-table i))) (cond ((eq (car char-component) 'vietnamese-viscii-lower) (aset table-lower (nth 1 char-component) i)) ((eq (car char-component) 'vietnamese-viscii-upper) @@ -71,22 +71,22 @@ (defvar viet-vscii-decode-table [;; VSCII is a full 8-bit code. - 0 ?,2z(B ?,2x(B 3 ?,2W(B ?,2X(B ?,2f(B 7 8 9 10 11 12 13 14 15 - 16 ?,2Q(B ?,2_(B ?,2O(B ?,2V(B ?,2[(B ?,2}(B ?,2\(B 24 25 26 27 28 29 30 31 + 0 ?.2Nz ?Nx 3 ?NW ?NX ?Nf 7 8 9 10 11 12 13 14 15 + 16 ?.2NQ ?N_ ?NO ?NV ?N[ ?N} ?N\ 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - ?,2`(B ?,2d(B ?,2c(B ?,2a(B ?,2U(B ?,2#(B ?,2'(B ?,2h(B ?,2k(B ?,2((B ?,2i(B ?,2)(B ?,2.(B ?,2l(B ?,2o(B ?,2n(B - ?,2m(B ?,28(B ?,2r(B ?,2v(B ?,2u(B ?,2s(B ?,2w(B ?,25(B ?,26(B ?,27(B ?,2^(B ?,2>(B ?,2~(B ?,2y(B ?,2|(B ?,2{(B - 160 ?,2e(B ?,2b(B ?,2j(B ?,2t(B ?,2=(B ?,2_(B ?,2p(B ?,1e(B ?,1b(B ?,1j(B ?,1t(B ?,1>(B ?,1y(B ?,1p(B ?,2"(B - 192 193 194 195 196 ?,1`(B ?,1d(B ?,1c(B ?,1a(B ?,1U(B ?,2F(B ?,1"(B ?,1F(B ?,1G(B ?,1!(B ?,2G(B - ?,2!(B ?,2%(B ?,2&(B ?,2g(B ?,2%(B ?,2+(B ?,1#(B ?,1%(B ?,1&(B ?,1g(B ?,1$(B ?,1'(B ?,1h(B ?,2,(B ?,1k(B ?,1((B - ?,1i(B ?,1)(B ?,1+(B ?,1,(B ?,1-(B ?,1*(B ?,1.(B ?,1l(B ?,1o(B ?,2-(B ?,2*(B ?,20(B ?,1n(B ?,1m(B ?,18(B ?,1r(B - ?,21(B ?,1v(B ?,1u(B ?,1s(B ?,1w(B ?,10(B ?,11(B ?,12(B ?,1/(B ?,15(B ?,16(B ?,17(B ?,1^(B ?,1>(B ?,1~(B ?,1y(B - ?,22(B ?,1|(B ?,1{(B ?,1z(B ?,1x(B ?,1W(B ?,1X(B ?,1f(B ?,1Q(B ?,1q(B ?,1O(B ?,1V(B ?,1[(B ?,1}(B ?,1\(B ?,2/(B] + ?.2N` ?Nd ?Nc ?Na ?NU ?N# ?N' ?Nh ?Nk ?N( ?Ni ?N) ?N. ?Nl ?No ?Nn + ?.2Nm ?N8 ?Nr ?Nv ?Nu ?Ns ?Nw ?N5 ?N6 ?N7 ?N^ ?N> ?N~ ?Ny ?N| ?N{ + 160 ?.2Ne ?Nb ?Nj ?Nt ?N= ?N_ ?Np ?.1Ne ?Nb ?Nj ?Nt ?N> ?Ny ?Np ?.2N" + 192 193 194 195 196 ?.1N` ?Nd ?Nc ?Na ?NU ?.2NF ?.1N" ?NF ?NG ?N! ?.2NG + ?.2N! ?N% ?N& ?Ng ?N% ?N+ ?.1N# ?N% ?N& ?Ng ?N$ ?N' ?Nh ?.2N, ?.1Nk ?N( + ?.1Ni ?N) ?N+ ?N, ?N- ?N* ?N. ?Nl ?No ?.2N- ?N* ?N0 ?.1Nn ?Nm ?N8 ?Nr + ?.2N1 ?.1Nv ?Nu ?Ns ?Nw ?N0 ?N1 ?N2 ?N/ ?N5 ?N6 ?N7 ?N^ ?N> ?N~ ?Ny + ?.2N2 ?.1N| ?N{ ?Nz ?Nx ?NW ?NX ?Nf ?NQ ?Nq ?NO ?NV ?N[ ?N} ?N\ ?.2N/] "Vietnamese VSCII decoding table.") (defvar viet-vscii-encode-table @@ -96,7 +96,7 @@ char-component) (while (< i 256) (setq char-component - (split-char (aref viet-vscii-decode-table i))) + (split-char-or-char-int (aref viet-vscii-decode-table i))) (cond ((eq (car char-component) 'vietnamese-viscii-lower) (aset table-lower (nth 1 char-component) i)) ((eq (car char-component) 'vietnamese-viscii-upper) @@ -188,7 +188,7 @@ (;; Vietnamese upper (read r0) (r0 -= 128) - (write-read-repeat r0 ,(cdr viet-vscii-encode-table))) + (write-read-repeat r0 ,(cdr viet-viscii-encode-table))) ;; not Vietnamese (write-read-repeat r0)))))))) "CCL program to encode VSCII-1.") @@ -212,16 +212,10 @@ decode ,ccl-decode-viscii encode ,ccl-encode-viscii)) -;; it is not correct, but XEmacs doesn't have `ccl' category... -(coding-system-put 'viscii 'category 'iso-8-1) - ;; (make-coding-system ;; 'vietnamese-viscii 4 ?V ;; "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)" -;; '(ccl-decode-viscii . ccl-encode-viscii) -;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) -;; (mime-charset . viscii) -;; (valid-codes (0 . 255)))) +;; (cons ccl-decode-viscii ccl-encode-viscii)) ;; (define-coding-system-alias 'viscii 'vietnamese-viscii) @@ -235,9 +229,7 @@ ;; (make-coding-system ;; 'vietnamese-vscii 4 ?v ;; "8-bit encoding for Vietnamese VSCII-1" -;; '(ccl-decode-vscii . ccl-encode-vscii) -;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) -;; (valid-codes (0 . 255)))) +;; (cons ccl-decode-vscii ccl-encode-vscii)) ;; (define-coding-system-alias 'vscii 'vietnamese-vscii) @@ -252,13 +244,9 @@ ;; (make-coding-system ;; 'vietnamese-viqr 0 ?q ;; "Vietnamese latin transcription (VIQR)" -;; nil -;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) -;; (post-read-conversion . viqr-post-read-conversion) -;; (pre-write-conversion . viqr-pre-write-conversion) -;; (charset-origin-alist -;; (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char) -;; (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char)))) +;; nil) +;; (put 'vietnamese-viqr 'post-read-conversion 'viqr-post-read-conversion) +;; (put 'vietnamese-viqr 'pre-write-conversion 'viqr-pre-write-conversion) ;; (define-coding-system-alias 'viqr 'vietnamese-viqr) @@ -277,22 +265,15 @@ ;; (setq font-ccl-encoder-alist ;; (cons (cons "vscii" ccl-encode-vscii-font) font-ccl-encoder-alist)) -;; (defvar viet-viscii-nonascii-translation-table -;; (make-translation-table-from-vector viet-viscii-decode-table) -;; "Value of `nonascii-translation-table' in Vietnamese language environment.") - (set-language-info-alist - "Vietnamese" '((charset vietnamese-viscii-lower vietnamese-viscii-upper) - (coding-system viscii vscii viqr) - (coding-priority viscii) - (input-method . "vietnamese-viqr") - (features viet-util) - (sample-text . "Vietnamese (Ti,1*(Bng Vi,1.(Bt) Ch,1`(Bo b,1U(Bn") + "Vietnamese" '((setup-function . setup-vietnamese-environment) + (charset . (vietnamese-viscii-lower + vietnamese-viscii-upper)) + (coding-system . (viscii vscii viqr)) + (sample-text . "Vietnamese (Ti.1N*ng ViN.t) ChN`o bNUn") (documentation . "\ -For Vietnamese, Emacs uses special charsets internally. -They can be decoded from and encoded to VISCC, VSCII, and VIQR. -Current setting put higher priority to the coding system VISCII than VSCII. -If you prefer VSCII, please do: (prefer-coding-system 'vietnamese-vscii)") +For Vietnamese, Emacs uses special charasets internally. +They can be decoded from and encoded to VISCC, VSCII, and VIQR.") )) ;;; vietnamese.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/multicast.el --- a/lisp/multicast.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/multicast.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,25 +1,25 @@ ;;; multicast.el --- lisp frontend for multicast connections in XEmacs -;; Copyright (C) 1997-2000 Didier Verna. +;; Copyright (C) 1997-1998 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 12e008d41344 -r 697ef44129c6 lisp/objects.el --- a/lisp/objects.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/objects.el Mon Aug 13 11:20:41 2007 +0200 @@ -46,19 +46,7 @@ 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 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) -" +specifiers." (make-specifier-and-init 'font spec-list)) (defun font-name (font &optional domain charset) @@ -139,21 +127,7 @@ 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 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)." +how specifiers work." (make-specifier-and-init 'color spec-list)) (defun color-name (color &optional domain) @@ -172,24 +146,4 @@ 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 12e008d41344 -r 697ef44129c6 lisp/obsolete.el --- a/lisp/obsolete.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/obsolete.el Mon Aug 13 11:20:41 2007 +0200 @@ -171,10 +171,6 @@ set Info-directory-list.") (make-obsolete-variable 'Info-default-directory-list 'Info-directory-list) -(defvar init-file-user nil - "This used to be the name of the user whose init file was read at startup.") -(make-obsolete-variable 'init-file-user 'load-user-init-file-p) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;; hooks (make-compatible-variable 'lisp-indent-hook 'lisp-indent-function) @@ -246,11 +242,6 @@ (define-compatible-function-alias 'byte-code-function-p 'compiled-function-p) ;FSFmacs -(define-obsolete-function-alias 'isearch-yank-x-selection - 'isearch-yank-selection) -(define-obsolete-function-alias 'isearch-yank-x-clipboard - 'isearch-yank-clipboard) - ;; too bad there's not a way to check for aref, assq, and nconc ;; being called on the values of functions known to return keymaps, ;; or known to return vectors of events instead of strings... @@ -353,7 +344,7 @@ (setq idx (1+ idx) i (1+ i))) string)) -;; #### This function is not compatible with FSF in some cases. Hard +;; ### This function is not compatible with FSF in some cases. Hard ;; to fix, because it is hard to trace the logic of the FSF function. ;; In case we need the exact behavior, we can always copy the FSF ;; version, which is very long and does lots of unnecessary stuff. diff -r 12e008d41344 -r 697ef44129c6 lisp/package-admin.el --- a/lisp/package-admin.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/package-admin.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1997 by Free Software Foundation, Inc. -;; Author: SL Baur +;; Author: SL Baur ;; Keywords: internal ;; This file is part of XEmacs. @@ -166,7 +166,7 @@ (setq autoload-dir (feature-file package-feature)) (setq autoload-dir (file-name-directory autoload-dir)) (member autoload-dir late-package-load-path)) - ;; Find the corresponding entry in late-package + ;; Find the corresonding entry in late-package (setq pkg-dir (car-safe (member-if (lambda (h) (string-match (concat "^" (regexp-quote h)) diff -r 12e008d41344 -r 697ef44129c6 lisp/package-get.el --- a/lisp/package-get.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/package-get.el Mon Aug 13 11:20:41 2007 +0200 @@ -32,7 +32,7 @@ ;; Retrieve a package and any other required packages from an archive ;; ;; -;; Note (JV): Most of this no longer applies! +;; Note (JV): Most of this no longer aplies! ;; ;; The idea: ;; A new XEmacs lisp-only release is generated with the following steps: @@ -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 @@ -180,56 +180,37 @@ (list :tag "Remote" host-name directory) )) :group 'package-get) -;;;###autoload (defcustom package-get-download-sites '( ;; North America ("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") + ("cso.uiuc.edu" "ftp.cso.uiuc.edu" "pub/packages/xemacs/packages") ;; South America - ("unicamp.br (Brazil)" "ftp.unicamp.br" "pub/xemacs/packages") + ("unicamp.br" "ftp.unicamp.br" "pub/xemacs/packages") ;; Europe - ("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") + ("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") ;; Asia - ("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") - - ;; Africa - ("sun.ac.za (South Africa)" "ftp.sun.ac.za" "xemacs/packages") - - ;; Middle East - ("isu.net.sa (Saudi Arabia)" "ftp.isu.net.sa" "pub/mirrors/ftp.xemacs.org/packages") - - ;; Australia - ("aarnet.edu.au (Australia)" "mirror.aarnet.edu.au" "pub/xemacs/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. List format is '(site-description site-name directory-on-site). @@ -239,11 +220,11 @@ 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 (string :tag "Name") host-name directory)) + :type '(repeat (list hostname directory)) :group 'package-get) (defcustom package-get-remove-copy t - "*After copying and installing a package, if this is t, then remove the + "*After copying and installing a package, if this is T, then remove the copy. Otherwise, keep it around." :type 'boolean :group 'package-get) @@ -258,10 +239,6 @@ :type 'file :group 'package-get) -(defvar package-get-user-index-filename - (paths-construct-path (list user-init-directory package-get-base-filename)) - "Name for the user-specific location of the package-get database file.") - (defcustom package-get-always-update nil "*If Non-nil always make sure we are using the latest package index (base). Otherwise respect the `force-current' argument of `package-get-require-base'." @@ -284,17 +261,11 @@ (defun package-get-download-menu () "Build the `Add Download Site' menu." (mapcar (lambda (site) - (vector (car site) - `(if (member (quote ,(cdr site)) - package-get-remote) - (setq package-get-remote - (delete (quote ,(cdr site)) - package-get-remote)) - (package-ui-add-site (quote ,(cdr site)))) - :style 'toggle - :selected `(member (quote ,(cdr site)) - package-get-remote))) - package-get-download-sites)) + (vector (car site) + `(package-ui-add-site (quote ,(cdr site))) + :style 'toggle :selected + `(member (quote ,(cdr site)) package-get-remote))) + package-get-download-sites)) ;;;###autoload (defun package-get-require-base (&optional force-current) @@ -357,25 +328,26 @@ "Locate the package-get index file. Do not return remote paths if NO-REMOTE is non-nil." (or (package-get-locate-file package-get-base-filename t no-remote) - (if (file-exists-p package-get-user-index-filename) - package-get-user-index-filename))) + (locate-data-file package-get-base-filename) + package-get-base-filename)) + +(defvar package-get-user-package-location user-init-directory) (defun package-get-maybe-save-index (filename) "Offer to save the current buffer as the local package index file, if different." (let ((location (package-get-locate-index-file t))) (unless (and filename (equal filename location)) - (unless (and location - (equal (md5 (current-buffer)) - (with-temp-buffer - (insert-file-contents-literally location) - (md5 (current-buffer))))) - (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 "? ")) - (let ((coding-system-for-write 'binary)) - (write-file location))))))) - + (unless (equal (md5 (current-buffer)) + (with-temp-buffer + (insert-file-contents location) + (md5 (current-buffer)))) + (unless (file-writable-p location) + (setq location (expand-file-name package-get-base-filename + (expand-file-name "etc/" package-get-user-package-location)))) + (when (y-or-n-p (concat "Update package index in" location "? ")) + (write-file location)))))) + ;;;###autoload (defun package-get-update-base (&optional db-file force-current) @@ -400,7 +372,7 @@ (save-excursion (set-buffer buf) (erase-buffer buf) - (insert-file-contents-literally db-file) + (insert-file-contents-internal db-file) (package-get-update-base-from-buffer buf) (if (file-remote-p db-file) (package-get-maybe-save-index db-file))) @@ -453,7 +425,7 @@ "package-get DB verification? "))))) (t nil))))) (error "Package-get PGP signature failed to verify")) - ;; ToDo: We should call package-get-maybe-save-index on the region + ;; ToDo: We shoud call package-get-maybe-save-index on the region (package-get-update-base-entries content-beg content-end) (message "Updated package-get database")))) @@ -517,18 +489,19 @@ 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) @@ -543,7 +516,8 @@ ) (if package-symbol (list package-symbol) - (list package)))))) + (list package))) + ))) ;;;###autoload (defun package-get-delete-package (package &optional pkg-topdir) @@ -706,7 +680,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 +788,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,7 +819,9 @@ ;; Doing it with XEmacs removes the need for an external md5 program (message "Validating checksum for `%s'..." package) (sit-for 0) (with-temp-buffer - (insert-file-contents-literally full-package-filename) + ;; What ever happened to i-f-c-literally + (let (file-name-handler-alist) + (insert-file-contents-internal full-package-filename)) (if (not (string= (md5 (current-buffer)) (package-get-info-prop this-package 'md5sum))) @@ -898,7 +874,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 @@ -910,7 +886,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)) @@ -987,7 +963,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 @@ -999,7 +975,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 @@ -1025,10 +1001,6 @@ (package-get-info-prop (car this-package) 'version)))) (setq this-package (cdr this-package))))) (setq packages (cdr packages))) - (when (interactive-p) - (if found - (message "%S" found) - (message "No appropriate package found"))) found)) ;; @@ -1052,10 +1024,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 12e008d41344 -r 697ef44129c6 lisp/package-info.el --- a/lisp/package-info.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/package-info.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1998 by Free Software Foundation, Inc. -;; Author: SL Baur +;; Author: SL Baur ;; Keywords: internal ;; This file is part of XEmacs. @@ -48,11 +48,12 @@ ; (setq result (md5 (current-buffer)))) ; result)) -;;; APA: Stolen from package-get in package-get.el (defun pi-md5sum (file) (with-temp-buffer - (insert-file-contents-literally file) - (md5 (current-buffer)))) + (call-process "md5sum" file t) + (goto-char (point-min)) + (looking-at "[a-z0-9]+") + (buffer-substring (match-beginning 0) (match-end 0)))) (defun pi-update-key (key value) (save-excursion diff -r 12e008d41344 -r 697ef44129c6 lisp/package-ui.el --- a/lisp/package-ui.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/package-ui.el Mon Aug 13 11:20:41 2007 +0200 @@ -31,7 +31,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defgroup pui nil - "Convenient interface to the package system." + "Conventient 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-selected-packages + (setq pui-seleted-packages (delete pkg-sym pui-selected-packages))) (pui-update-package-display extent pkg-sym) )) @@ -358,8 +358,11 @@ (save-window-excursion (with-output-to-temp-buffer tmpbuf (display-completion-list (sort - (mapcar #'symbol-name pui-deleted-packages) - #'string<) + (mapcar '(lambda (pkg) + (symbol-name pkg) + ) + pui-deleted-packages) + 'string<) :activate-callback nil :help-string "Packages selected for removal:\n" :completion-string t @@ -386,12 +389,16 @@ ;; errors occur, which would normally be caused by display-buffer). (save-window-excursion (with-output-to-temp-buffer tmpbuf - (display-completion-list - (sort (mapcar #'symbol-name pui-selected-packages) #'string<) - :activate-callback nil - :help-string "Packages selected for installation:\n" - :completion-string t - )) + (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 + )) (setq tmpbuf (get-buffer-create tmpbuf)) (display-buffer tmpbuf) (setq do-install (y-or-n-p "Install these packages? ")) @@ -528,7 +535,7 @@ (set-buffer (event-buffer event)) (goto-char (event-point event)) (popup-menu pui-menu event) - ;; I agree with dired.el - this is seriously bogus. + ;; I agreee with dired.el this is seriously bogus. (while (popup-menu-up-p) (dispatch-event (next-event))))) @@ -611,66 +618,67 @@ ")) (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) @@ -685,7 +693,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 12e008d41344 -r 697ef44129c6 lisp/packages.el --- a/lisp/packages.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/packages.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,8 @@ ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Author: Steven L Baur -;; Maintainer: Steven L Baur +;; Author: Steven L Baur +;; Maintainer: Steven L Baur ;; Keywords: internal, lisp, dumped ;; This file is part of XEmacs. @@ -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.) Built in macros, such as -;; `when' and `unless' are fine, of course. +;; file must be loadable uncompiled.) This rules out CL-style +;; macros like `when', for instance. ;; ;; - not to use `defcustom'. If you must add user-customizable ;; variables here, use `defvar', and add the variable to @@ -55,7 +55,7 @@ ;;; Package versioning (defvar packages-package-list nil - "Database of loaded packages and version numbers") + "database of loaded packages and version numbers") (defvar packages-hierarchy-depth 1 "Depth of package hierarchies.") @@ -84,8 +84,16 @@ (defvar last-package-load-path nil "Load path for packages last in the load path.") -(defun packages-compute-package-locations (user-init-directory) - "Compute locations of the various package directories. +(defvar package-locations + (list + (list (paths-construct-path '("~" ".xemacs")) + 'early #'(lambda () t)) + (list "site-packages" 'late #'(lambda () t)) + (list "infodock-packages" 'late #'(lambda () (featurep 'infodock))) + (list "mule-packages" 'late #'(lambda () (featurep 'mule))) + (list "xemacs-packages" 'late #'(lambda () t)) + (list "packages" 'late #'(lambda () t))) + "Locations of the various package directories. This is a list each of whose elements describes one directory. A directory description is a three-element list. The first element is either an absolute path or a subdirectory @@ -94,16 +102,7 @@ depending on the load-path segment the hierarchy is supposed to show up in. The third component is a thunk which, if it returns NIL, causes -the directory to be ignored." - (list - (list (paths-construct-path (list user-init-directory "mule-packages")) - 'early #'(lambda () (featurep 'mule))) - (list (paths-construct-path (list user-init-directory "xemacs-packages")) - 'early #'(lambda () t)) - (list "site-packages" 'late #'(lambda () t)) - (list "infodock-packages" 'late #'(lambda () (featurep 'infodock))) - (list "mule-packages" 'late #'(lambda () (featurep 'mule))) - (list "xemacs-packages" 'late #'(lambda () t)))) +the directory to be ignored.") (defun package-get-key-1 (info key) "Locate keyword `key' in list." @@ -123,8 +122,9 @@ (let ((info (if (and attributes (floatp (car attributes))) (list :version (car attributes)) attributes))) + (remassq name packages-package-list) (setq packages-package-list - (cons (cons name info) (remassq name packages-package-list))))) + (cons (cons name info) packages-package-list)))) (defun package-require (name version) (let ((pkg (assq name packages-package-list))) @@ -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 nil nil t))) + (site-directory (paths-find-site-directory roots base))) (paths-uniq-append (and version-directory (list version-directory)) (and site-directory (list site-directory))))) @@ -429,7 +429,7 @@ (setq package-locations (cdr package-locations))) packages))) -(defun packages-find-packages (roots package-locations) +(defun packages-find-packages (roots) "Find the packages." (let ((envvar-value (getenv "EMACSPACKAGEPATH"))) (if envvar-value @@ -452,7 +452,7 @@ SUFFIXES is a list of names of package subdirectories to look for." (let ((directories (apply - #'nconc + #'append (mapcar #'(lambda (package) (mapcar #'(lambda (suffix) (file-name-as-directory (concat package suffix))) @@ -494,7 +494,7 @@ (defun packages-load-package-lisps (package-load-path base) "Load all Lisp files of a certain name along a load path. BASE is the base name of the files." - (mapcar #'(lambda (dir) + (mapc #'(lambda (dir) (let ((file-name (expand-file-name base dir))) (condition-case error (load file-name t t) @@ -513,7 +513,7 @@ (defun packages-handle-package-dumped-lisps (handle package-load-path) "Load dumped-lisp.el files along a load path. Call HANDLE on each file off definitions of PACKAGE-LISP there." - (mapcar #'(lambda (dir) + (mapc #'(lambda (dir) (let ((file-name (expand-file-name "dumped-lisp.el" dir))) (if (file-exists-p file-name) (let (package-lisp @@ -522,7 +522,7 @@ (load file-name) ;; dumped-lisp.el could have set this ... (if package-lisp - (mapcar #'(lambda (base) + (mapc #'(lambda (base) (funcall handle base)) package-lisp)))))) package-load-path)) diff -r 12e008d41344 -r 697ef44129c6 lisp/printer.el --- a/lisp/printer.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -;;; 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 ; "Okidata OL610e/PS PostScript" - "*Name of printer to print to. -If nil, use default. -Under MS Windows, this can have the form `\\\\STOLI\\HP-345-PS'." - :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) - (or (stringp printer-name) - (error "Please set `printer-name'")) - (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 12e008d41344 -r 697ef44129c6 lisp/process.el --- a/lisp/process.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/process.el Mon Aug 13 11:20:41 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, 2000 Ben Wing. +;; Copyright (C) 1995 Ben Wing. ;; Author: Ben Wing ;; Maintainer: XEmacs Development Team @@ -26,13 +26,6 @@ ;;; 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. @@ -40,6 +33,9 @@ ;;; Code: +(defvar binary-process-output) +(defvar buffer-file-type) + (defgroup processes nil "Process, subshell, compilation, and job control support." :group 'external @@ -74,110 +70,6 @@ (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'). @@ -223,10 +115,14 @@ you quit again before the process exits." (let ((temp (make-temp-name - (concat (file-name-as-directory (temp-directory)) "emacs")))) + (concat (file-name-as-directory (temp-directory)) + (if (memq system-type '(ms-dos windows-nt)) "em" "emacs"))))) (unwind-protect (progn - (write-region start end temp nil 'silent) + (if (memq system-type '(ms-dos windows-nt)) + (let ((buffer-file-type binary-process-output)) + (write-region start end temp nil 'silent)) + (write-region start end temp nil 'silent)) (if deletep (delete-region start end)) (apply #'call-process program temp buffer displayp args)) (ignore-file-errors (delete-file temp))))) @@ -403,7 +299,7 @@ Remaining arguments are strings to give program as arguments." (apply 'start-process-internal name buffer program program-args)) -(defun open-network-stream (name buffer host service &optional protocol) +(defun open-network-stream (name buffer host service) "Open a TCP connection for a service to a host. Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. @@ -416,44 +312,33 @@ with any buffer Third arg is name of the host to connect to, or its IP address. Fourth arg SERVICE is name of the service desired, or an integer - specifying a port number to connect to. -Fifth argument PROTOCOL is a network protocol. Currently 'tcp - (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 -`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' -are usually fine.) Note further that UDP protocol does not guard against -lost packets." - (open-network-stream-internal name buffer host service protocol)) + specifying a port number to connect to." + (open-network-stream-internal name buffer host service)) (defun shell-quote-argument (argument) "Quote an argument for passing as argument to an inferior shell." - (if (and (eq system-type 'windows-nt) - ;; #### this is a temporary hack. a better solution needs - ;; futzing with the c code. i'll do this shortly. - (let ((progname (downcase (file-name-nondirectory - shell-file-name)))) - (or (equal progname "command.com") - (equal progname "cmd.exe")))) + (if (eq system-type 'ms-dos) + ;; MS-DOS shells don't have quoting, so don't do any. argument - ;; Quote everything except POSIX filename characters. - ;; This should be safe enough even for really weird shells. - (let ((result "") (start 0) end) - (while (string-match "[^-0-9a-zA-Z_./]" argument start) - (setq end (match-beginning 0) - result (concat result (substring argument start end) - "\\" (substring argument end (1+ end))) - start (1+ end))) - (concat result (substring argument start))))) + (if (eq system-type 'windows-nt) + (concat "\"" argument "\"") + ;; Quote everything except POSIX filename characters. + ;; This should be safe enough even for really weird shells. + (let ((result "") (start 0) end) + (while (string-match "[^-0-9a-zA-Z_./]" argument start) + (setq end (match-beginning 0) + result (concat result (substring argument start end) + "\\" (substring argument end (1+ end))) + start (1+ end))) + (concat result (substring argument start)))))) -(defun shell-command-to-string (command) - "Execute shell command COMMAND and return its output as a string." +(defun exec-to-string (command) + "Execute COMMAND as an external process and return the output of that +process as a string" + ;; by "William G. Dubuque" (with-output-to-string (call-process shell-file-name nil t nil shell-command-switch command))) -(defalias 'exec-to-string 'shell-command-to-string) +(defalias 'shell-command-to-string 'exec-to-string) ;;; process.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/rect.el --- a/lisp/rect.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/rect.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,8 @@ ;;; rect.el --- rectangle functions for XEmacs. -;; Copyright (C) 1985-2000 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc. -;; Maintainer: Didier Verna +;; Maintainer: FSF ;; Keywords: internal ;; This file is part of XEmacs. @@ -22,25 +22,15 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;;; Synched up with: to be incorporated in a forthcoming GNU Emacs +;;; Synched up with: FSF 19.34. ;;; Commentary: -;; This package provides the operations on rectangles that are documented +;; This package provides the operations on rectangles that are ocumented ;; 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 -;; intrusive and fill lines with whitespaces only when needed. A few functions -;; are untouched though, as noted above their definition. - - ;;; Code: -;; #### NOTE: this function is untouched, but not used anymore. -;; `apply-on-rectangle' is used instead. It's still there because it's -;; documented so people might use it in their code, so I've decided not to -;; touch it. --dv ;; XEmacs: extra-args (defun operate-on-rectangle (function start end coerce-tabs &rest extra-args) "Call FUNCTION for each line of rectangle with corners at START, END. @@ -54,15 +44,15 @@ Point is at the end of the segment of this line within the rectangle." (let (startcol startlinepos endcol endlinepos) (save-excursion - (goto-char start) - (setq startcol (current-column)) - (beginning-of-line) - (setq startlinepos (point))) + (goto-char start) + (setq startcol (current-column)) + (beginning-of-line) + (setq startlinepos (point))) (save-excursion - (goto-char end) - (setq endcol (current-column)) - (forward-line 1) - (setq endlinepos (point-marker))) + (goto-char end) + (setq endcol (current-column)) + (forward-line 1) + (setq endlinepos (point-marker))) (if (< endcol startcol) ;; XEmacs (let ((tem startcol)) @@ -84,70 +74,36 @@ (forward-line 1))) (- endcol startcol))) -;; The replacement for `operate-on-rectangle' -- dv -(defun apply-on-rectangle (function start end &rest args) - "Call FUNCTION for each line of rectangle with corners at START and END. -FUNCTION is called with two arguments: the start and end columns of the -rectangle, plus ARGS extra arguments. Point is at the beginning of line -when the function is called." - (let (startcol startpt endcol endpt) - (save-excursion - (goto-char start) - (setq startcol (current-column)) - (beginning-of-line) - (setq startpt (point)) - (goto-char end) - (setq endcol (current-column)) - (forward-line 1) - (setq endpt (point-marker)) - ;; ensure the start column is the left one. - (if (< endcol startcol) - (let ((col startcol)) - (setq startcol endcol endcol col))) - ;; start looping over lines - (goto-char startpt) - (while (< (point) endpt) - (apply function startcol endcol args) - (forward-line 1))) - )) +(defun delete-rectangle-line (startdelpos ignore ignore) + (delete-region startdelpos (point))) +;; XEmacs: added lines arg +(defun delete-extract-rectangle-line (startdelpos begextra endextra lines) + (save-excursion + (extract-rectangle-line startdelpos begextra endextra lines)) + (delete-region startdelpos (point))) -(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) - "Delete the text in the region-rectangle without saving it. -The same range of columns is deleted in each line starting with the line -where the region begins and ending with the line where the region ends. +;; XEmacs: added lines arg +(defun extract-rectangle-line (startdelpos begextra endextra lines) + (let ((line (buffer-substring startdelpos (point))) + (end (point))) + (goto-char startdelpos) + (while (search-forward "\t" end t) + (let ((width (- (current-column) + (save-excursion (forward-char -1) + (current-column))))) + (setq line (concat (substring line 0 (- (point) end 1)) + (spaces-string width) + (substring line (+ (length line) (- (point) end))))))) + (if (or (> begextra 0) (> endextra 0)) + (setq line (concat (spaces-string begextra) + line + (spaces-string endextra)))) + (setcdr lines (cons line (cdr lines))))) ; XEmacs -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") - (apply-on-rectangle 'delete-rectangle-line start end fill)) - +(defconst spaces-strings + (purecopy '["" " " " " " " " " " " " " " " " "])) -;; 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 "")) @@ -155,100 +111,55 @@ (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))) - (if (< (move-to-column startcol (or fill 'coerce)) startcol) - (setcdr lines (cons (spaces-string (- endcol startcol)) - (cdr lines))) - ;; else - (setq pt (point)) - (move-to-column endcol t) - (setcdr lines (cons (buffer-substring pt (point)) (cdr lines))) - (delete-region pt (point))) - )) + +;;;###autoload +(defun delete-rectangle (start end) + "Delete (don't save) text in rectangle with point and mark as corners. +The same range of columns is deleted in each line starting with the line +where the region begins and ending with the line where the region ends." + (interactive "r") + (operate-on-rectangle 'delete-rectangle-line start end t)) ;;;###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. - -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) +(defun delete-extract-rectangle (start end) + "Delete contents of rectangle and return it as a list of strings. +Arguments START and END are the corners of the rectangle. +The value is list of strings, one for each line of the rectangle." + (let ((lines (list nil))) ; XEmacs change + (operate-on-rectangle 'delete-extract-rectangle-line + start end t lines) (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 -(defun extract-rectangle-line (startcol endcol lines) - (let (start end begextra endextra line) - (move-to-column startcol) - (setq start (point) - begextra (- (current-column) startcol)) - (move-to-column endcol) - (setq end (point) - endextra (- endcol (current-column))) - (setq line (buffer-substring start (point))) - (if (< begextra 0) - (setq endextra (+ endextra begextra) - begextra 0)) - (if (< endextra 0) - (setq endextra 0)) - (goto-char start) - (while (search-forward "\t" end t) - (let ((width (- (current-column) - (save-excursion (forward-char -1) - (current-column))))) - (setq line (concat (substring line 0 (- (point) end 1)) - (spaces-string width) - (substring line (+ (length line) - (- (point) end))))))) - (if (or (> begextra 0) (> endextra 0)) - (setq line (concat (spaces-string begextra) - line - (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) + "Return contents of rectangle with corners at START and END. +Value is list of strings, one for each line of the rectangle." + (let ((lines (list nil))) ; XEmacs change + (operate-on-rectangle 'extract-rectangle-line start end nil lines) (nreverse (cdr lines)))) - ;;;###autoload (defvar killed-rectangle nil - "Rectangle for `yank-rectangle' to insert.") + "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. +(defun kill-rectangle (start end) + "Delete rectangle with corners at point and mark; save as last killed one. +Calling from program, supply two args START and END, buffer positions. +But in programs you might prefer to use `delete-extract-rectangle'." + (interactive "r") + (if buffer-read-only + (progn + (setq killed-rectangle (extract-rectangle start end)) + (barf-if-buffer-read-only))) + (setq killed-rectangle (delete-extract-rectangle start end))) -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 () "Yank the last killed rectangle with upper left corner at point." - (interactive "*") + (interactive) (insert-rectangle killed-rectangle)) - -;; This function is untouched --dv ;;;###autoload (defun insert-rectangle (rectangle) "Insert text of RECTANGLE with upper left corner at point. @@ -264,85 +175,81 @@ (while lines (or first (progn - (forward-line 1) - (or (bolp) (insert ?\n)) - (move-to-column insertcolumn t))) + (forward-line 1) + (or (bolp) (insert ?\n)) + (move-to-column insertcolumn t))) (setq first nil) (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. - -When called from a program, the rectangle's corners are START and END. -With a prefix (or FILL) argument, fill with blanks even if there is no text -on the right side of the rectangle." - (interactive "*r\nP") - (apply-on-rectangle 'open-rectangle-line start end fill) +(defun open-rectangle (start end) + "Blank out rectangle with corners at point and mark, shifting text right. +The text previously in the region is not overwritten by the blanks, +but instead winds up to the right of the rectangle." + (interactive "r") + (operate-on-rectangle 'open-rectangle-line start end nil) (goto-char start)) - -(defun string-rectangle-line (startcol endcol string delete) - (move-to-column startcol t) - (if delete - (delete-rectangle-line startcol endcol nil)) - (insert string)) +(defun open-rectangle-line (startpos begextra endextra) + ;; Column where rectangle ends. + (let ((endcol (+ (current-column) endextra)) + whitewidth) + (goto-char startpos) + ;; Column where rectangle begins. + (let ((begcol (- (current-column) begextra))) + (skip-chars-forward " \t") + ;; Width of whitespace to be deleted and recreated. + (setq whitewidth (- (current-column) begcol))) + ;; Delete the whitespace following the start column. + (delete-region startpos (point)) + ;; Open the desired width, plus same amount of whitespace we just deleted. + (indent-to (+ endcol whitewidth)))) ;;;###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. - -If `pending-delete-mode' is active the string replace the region. -Otherwise this command does not delete or overwrite any existing text. +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: ") - (defvar pending-delete-mode) - (apply-on-rectangle 'string-rectangle-line start end string - (and (boundp 'pending-delete-mode) pending-delete-mode))) - -(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)) +Called from a program, takes three args; START, END and STRING." + (interactive "r\nsString rectangle: ") + (operate-on-rectangle 'string-rectangle-line start end t string)) ; XEmacs - -(defun clear-rectangle-line (startcol endcol fill) - (let ((pt (point-at-eol)) - spaces) - (when (= (move-to-column startcol (or fill 'coerce)) startcol) - (if (and (not fill) - (<= (save-excursion (goto-char pt) (current-column)) endcol)) - (delete-region (point) pt) - ;; else - (setq pt (point)) - (move-to-column endcol t) - (setq spaces (- (point) pt)) - (delete-region pt (point)) - (indent-to (+ (current-column) spaces)))) - )) +;; XEmacs: add string arg +(defun string-rectangle-line (startpos begextra endextra string) + (let (whitespace) + (goto-char startpos) + ;; Compute horizontal width of following whitespace. + (let ((ocol (current-column))) + (skip-chars-forward " \t") + (setq whitespace (- (current-column) ocol))) + ;; Delete the following whitespace. + (delete-region startpos (point)) + ;; Insert the desired string. + (insert string) + ;; Insert the same width of whitespace that we had before. + (indent-to (+ (current-column) whitespace)))) ;;;###autoload -(defun clear-rectangle (start end &optional fill) - "Blank out the region-rectangle. -The text previously in the region is overwritten with blanks. +(defun clear-rectangle (start end) + "Blank out rectangle with corners at point and mark. +The text previously in the region is overwritten by the blanks. +When called from a program, requires two args which specify the corners." + (interactive "r") + (operate-on-rectangle 'clear-rectangle-line start end 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 (startpos begextra endextra) + ;; Find end of whitespace after the rectangle. + (skip-chars-forward " \t") + (let ((column (+ (current-column) endextra))) + ;; Delete the text in the rectangle, and following whitespace. + (delete-region (point) + (progn (goto-char startpos) + (skip-chars-backward " \t") + (point))) + ;; Reindent out to same column that we were at. + (indent-to column))) (provide 'rect) diff -r 12e008d41344 -r 697ef44129c6 lisp/replace.el --- a/lisp/replace.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/replace.el Mon Aug 13 11:20:41 2007 +0200 @@ -679,7 +679,6 @@ ;; Loop finding occurrences that perhaps should be replaced. (while (and keep-going (not (eobp)) - (or (null limit) (< (point) limit)) (let ((case-fold-search qr-case-fold-search)) (funcall search-function search-string limit)) ;; If the search string matches immediately after @@ -689,8 +688,7 @@ (and regexp-flag (eq lastrepl (match-beginning 0)) (not match-again))) - (if (or (eobp) - (and limit (>= (point) limit))) + (if (eobp) nil ;; Don't replace the null string ;; right after end of previous replacement. diff -r 12e008d41344 -r 697ef44129c6 lisp/scrollbar.el --- a/lisp/scrollbar.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/scrollbar.el Mon Aug 13 11:20:41 2007 +0200 @@ -55,7 +55,7 @@ ;; vertical scrollbar functions ;; -;;; #### Move functions from C into Lisp here! +;;; ### Move functions from C into Lisp here! ;; ;; horizontal scrollbar functions diff -r 12e008d41344 -r 697ef44129c6 lisp/select.el --- a/lisp/select.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/select.el Mon Aug 13 11:20:41 2007 +0200 @@ -32,106 +32,74 @@ ;;; Code: -(defvar selected-text-type - (if (featurep 'mule) '(COMPOUND_TEXT STRING) 'STRING) - "The type atom used to obtain selections from the X server. -Can be either a valid X selection data type, or a list of such types. -COMPOUND_TEXT and STRING are the most commonly used data types. -If a list is provided, the types are tried in sequence until -there is a successful conversion.") - -(defvar selection-sets-clipboard nil - "Controls the selection's relationship to the clipboard. -When non-nil, any operation that sets the primary selection will also -set the clipboard.") - (defun copy-primary-selection () "Copy the selection to the Clipboard and the kill ring." (interactive) (and (console-on-window-system-p) (cut-copy-clear-internal 'copy))) +(define-obsolete-function-alias + 'x-copy-primary-selection + 'copy-primary-selection) (defun kill-primary-selection () "Copy the selection to the Clipboard and the kill ring, then delete it." (interactive "*") (and (console-on-window-system-p) (cut-copy-clear-internal 'cut))) +(define-obsolete-function-alias + 'x-kill-primary-selection + 'kill-primary-selection) (defun delete-primary-selection () "Delete the selection without copying it to the Clipboard or the kill ring." (interactive "*") (and (console-on-window-system-p) (cut-copy-clear-internal 'clear))) +(define-obsolete-function-alias + 'x-delete-primary-selection + 'delete-primary-selection) (defun yank-clipboard-selection () "Insert the current Clipboard selection at point." (interactive "*") - (when (console-on-window-system-p) - (setq last-command nil) - (setq this-command 'yank) ; so that yank-pop works. - (let ((clip (get-clipboard))) - (or clip (error "there is no clipboard selection")) - (push-mark) - (insert clip)))) - -(defun get-clipboard () - "Return text pasted to the clipboard." - (get-selection 'CLIPBOARD)) + (case (device-type (selected-device)) + (x (x-yank-clipboard-selection)) + (mswindows (mswindows-paste-clipboard)) + (otherwise nil))) -(define-device-method get-cutbuffer - "Return the value of one of the cut buffers. -This will do nothing under anything other than X.") +(defun selection-owner-p (&optional selection) + "Return t if current XEmacs process owns the given Selection. +The arg should be the name of the selection in question, typically one +of the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, +the symbol nil is the same as PRIMARY, and t is the same as +SECONDARY.)" + (interactive) + (case (device-type (selected-device)) + (x (x-selection-owner-p selection)) + (mswindows (mswindows-selection-owner-p selection)) + (otherwise nil))) -(defun get-selection-no-error (&optional type data-type) - "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))) +(defun selection-exists-p (&optional selection) + "Whether there is an owner for the given Selection. +The arg should be the name of the selection in question, typically one +of the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, +the symbol nil is the same as PRIMARY, and t is the same as +SECONDARY." + (interactive) + (case (device-type (selected-device)) + (x (x-selection-exists-p selection)) + (mswindows (mswindows-selection-exists-p)) + (otherwise nil))) -(defun get-selection (&optional type data-type) - "Return the value of a window-system selection. +(defun own-selection (data &optional type) + "Make an Windows selection of type TYPE and value DATA. 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." - (or type (setq type 'PRIMARY)) - (or data-type (setq data-type selected-text-type)) - (let ((text - (if (consp data-type) - (condition-case err - (get-selection-internal type (car data-type)) - (selection-conversion-error - (if (cdr data-type) - (get-selection type (cdr data-type)) - (signal (car err) (cdr err))))) - (get-selection-internal type data-type)))) - text)) - -;; FSFmacs calls this `x-set-selection', and reverses the -;; 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 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 behaviour 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). +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). 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* (note -that the window system clipboard does not necessarily duplicate this -behaviour - it doesn't on mswindows for example). +between the markers *at whatever time the selection is examined*. Thus, editing done in the buffer after you specify the selection can alter the effective value of the selection. @@ -141,69 +109,26 @@ (interactive (if (not current-prefix-arg) (list (read-string "Store text for pasting: ")) (list (substring (region-beginning) (region-end))))) - ;; 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) + (case (device-type (selected-device)) + (x (x-own-selection data type)) + (mswindows (mswindows-own-selection data type)) + (otherwise nil))) -(defun dehilight-selection (selection) - "for use as a value of `lost-selection-hooks'." - (cond ((eq selection 'PRIMARY) - (if primary-selection-extent - (let ((inhibit-quit t)) - (if (consp primary-selection-extent) - (mapcar 'delete-extent primary-selection-extent) - (delete-extent primary-selection-extent)) - (setq primary-selection-extent nil))) - (if zmacs-regions (zmacs-deactivate-region))) - ((eq selection 'SECONDARY) - (if secondary-selection-extent - (let ((inhibit-quit t)) - (if (consp secondary-selection-extent) - (mapcar 'delete-extent secondary-selection-extent) - (delete-extent secondary-selection-extent)) - (setq secondary-selection-extent nil))))) - nil) - -(setq lost-selection-hooks 'dehilight-selection) - -(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 own-clipboard (string) + "Paste the given string to the Clipboard." + (case (device-type (selected-device)) + (x (x-own-clipboard string)) + (mswindows (mswindows-own-clipboard string)) + (otherwise nil))) (defun disown-selection (&optional secondary-p) "Assuming we own the selection, disown it. With an argument, discard the secondary selection instead of the primary selection." - (disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY)) - (when (and selection-sets-clipboard - (or (not secondary-p) - (eq secondary-p 'PRIMARY) - (eq secondary-p 'CLIPBOARD))) - (disown-selection-internal 'CLIPBOARD))) + (case (device-type (selected-device)) + (x (x-disown-selection secondary-p)) + (mswindows (mswindows-disown-selection secondary-p)) + (otherwise nil))) + ;; from x-init.el ;; selections and active regions @@ -293,12 +218,12 @@ (default-mouse-track-next-move-rect start end previous-extent) )) previous-extent)))) +(define-obsolete-function-alias + 'x-select-make-extent-for-selection + 'select-make-extent-for-selection) ;; 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) @@ -317,6 +242,9 @@ (marker-buffer (cdr data))) (buffer-live-p (marker-buffer (car data))) (buffer-live-p (marker-buffer (cdr data)))))) +(define-obsolete-function-alias + 'x-valid-simple-selection-p + 'valid-simple-selection-p) (defun cut-copy-clear-internal (mode) (or (memq mode '(cut copy clear)) (error "unkown mode %S" mode)) @@ -359,423 +287,8 @@ (delete-region s e)))) (disown-selection nil) ))) - - -;;; Functions to convert the selection into various other selection -;;; types. - -;; These two 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)))))) - -;; 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) - ((extentp value) - (save-excursion - (set-buffer (extent-object value)) - (save-restriction - (widen) - (buffer-substring (extent-start-position value) - (extent-end-position value))))) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (or (eq (marker-buffer (car value)) (marker-buffer (cdr value))) - (signal 'error - (list "markers must be in the same buffer" - (car value) (cdr value)))) - (save-excursion - (set-buffer (or (marker-buffer (car value)) - (error "selection is in a killed buffer"))) - (save-restriction - (widen) - (buffer-substring (car value) (cdr value))))) - (t nil))) - -(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. - (if (stringp outval) - (cons 'STRING outval) - outval))) - -(defun select-convert-to-compound-text (selection type value) - ;; converts to compound text automatically - (select-convert-to-text selection type value)) - -(defun select-convert-to-length (selection type value) - (let ((value - (cond ((stringp value) - (length value)) - ((extentp value) - (extent-length value)) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (or (eq (marker-buffer (car value)) - (marker-buffer (cdr value))) - (signal 'error - (list "markers must be in the same buffer" - (car value) (cdr value)))) - (abs (- (car value) (cdr value))))))) - (if value ; force it to be in 32-bit format. - (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))) - (rest all)) - (while rest - (cond ((memq (car rest) (cdr rest)) - (setcdr rest (delq (car rest) (cdr rest)))) - (t - (setq rest (cdr rest))))) - (apply 'vector all))) - -(defun select-convert-to-delete (selection type value) - (disown-selection-internal selection) - ;; A return value of nil means that we do not know how to do this conversion, - ;; and replies with an "error". A return value of NULL means that we have - ;; done the conversion (and any side-effects) but have no value to return. - 'NULL) - -(defun select-convert-to-filename (selection type value) - (cond ((extentp value) - (buffer-file-name (or (extent-object value) - (error "selection is in a killed buffer")))) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (buffer-file-name (or (marker-buffer (car value)) - (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) - (setq a (extent-start-position value) - b (extent-end-position value))) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (setq a (car value) - b (cdr value)))) - (setq a (1- a) b (1- b)) ; zero-based - (if (< b a) (setq tmp a a b b tmp)) - (cons 'SPAN - (vector (cons (ash a -16) (logand a 65535)) - (cons (ash b -16) (logand b 65535)))))))) - -(defun select-convert-to-lineno (selection type value) - (let (a b buf tmp) - (cond ((cond ((extentp value) - (setq buf (extent-object value) - a (extent-start-position value) - b (extent-end-position value))) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (setq a (marker-position (car value)) - b (marker-position (cdr value)) - buf (marker-buffer (car value))))) - (save-excursion - (set-buffer buf) - (save-restriction - (widen) - (goto-char a) - (beginning-of-line) - (setq a (1+ (count-lines 1 (point)))) - (goto-char b) - (beginning-of-line) - (setq b (1+ (count-lines 1 (point)))))) - (if (< b a) (setq tmp a a b b tmp)) - (cons 'SPAN - (vector (cons (ash a -16) (logand a 65535)) - (cons (ash b -16) (logand b 65535)))))))) - -(defun select-convert-to-colno (selection type value) - (let (a b buf tmp) - (cond ((cond ((extentp value) - (setq buf (extent-object value) - a (extent-start-position value) - b (extent-end-position value))) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (setq a (car value) - b (cdr value) - buf (marker-buffer a)))) - (save-excursion - (set-buffer buf) - (goto-char a) - (setq a (current-column)) - (goto-char b) - (setq b (current-column))) - (if (< b a) (setq tmp a a b b tmp)) - (cons 'SPAN - (vector (cons (ash a -16) (logand a 65535)) - (cons (ash b -16) (logand b 65535)))))))) - -(defun select-convert-to-sourceloc (selection type value) - (let (a b buf file-name tmp) - (cond ((cond ((extentp value) - (setq buf (or (extent-object value) - (error "selection is in a killed buffer")) - a (extent-start-position value) - b (extent-end-position value) - file-name (buffer-file-name buf))) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (setq a (marker-position (car value)) - b (marker-position (cdr value)) - buf (or (marker-buffer (car value)) - (error "selection is in a killed buffer")) - file-name (buffer-file-name buf)))) - (save-excursion - (set-buffer buf) - (save-restriction - (widen) - (goto-char a) - (beginning-of-line) - (setq a (1+ (count-lines 1 (point)))) - (goto-char b) - (beginning-of-line) - (setq b (1+ (count-lines 1 (point)))))) - (if (< b a) (setq tmp a a b b tmp)) - (format "%s:%d" file-name a))))) - -(defun select-convert-to-os (selection type size) - (symbol-name system-type)) - -(defun select-convert-to-host (selection type size) - (system-name)) - -(defun select-convert-to-user (selection type size) - (user-full-name)) - -(defun select-convert-to-class (selection type size) - 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. -(defun select-convert-to-name (selection type size) - ;invocation-name - "xemacs") - -(defun select-convert-to-integer (selection type value) - (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)) - -;;; 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))) - -(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 - -;; #### Should this function take the text *out* of the buffer that's -;; being killed? Or should it do what the original code did and just -;; destroy the selection? -(defun select-buffer-killed-default (selection type value buffer) -;; This handler gets used if the type is "nil". - (cond ((extentp value) - (unless (eq (extent-object value) buffer) - value)) - ((markerp value) - (unless (eq (marker-buffer value) buffer) - value)) - ((and (consp value) - (markerp (car value)) - (markerp (cdr value))) - (unless (or (eq (marker-buffer (car value)) buffer) - (eq (marker-buffer (cdr value)) buffer)) - 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) - (TARGETS . select-convert-to-targets) - (LENGTH . select-convert-to-length) - (DELETE . select-convert-to-delete) - (FILE_NAME . select-convert-to-filename) - (CHARACTER_POSITION . select-convert-to-charpos) - (SOURCE_LOC . select-convert-to-sourceloc) - (LINE_NUMBER . select-convert-to-lineno) - (COLUMN_NUMBER . select-convert-to-colno) - (OWNER_OS . select-convert-to-os) - (HOST_NAME . select-convert-to-host) - (USER . select-convert-to-user) - (CLASS . select-convert-to-class) - (NAME . select-convert-to-name) - (ATOM . select-convert-to-atom) - (INTEGER . select-convert-to-integer) - (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 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)) +(define-obsolete-function-alias + 'x-cut-copy-clear-internal + 'cut-copy-clear-internal) ;;; select.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/setup-paths.el --- a/lisp/setup-paths.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/setup-paths.el Mon Aug 13 11:20:41 2007 +0200 @@ -42,14 +42,10 @@ "Depth of load-path searches in core Lisp paths.") (defvar paths-default-info-directories - (mapcar (function - (lambda (dirlist) - (paths-construct-path - dirlist (char-to-string directory-sep-char)))) - '(("usr" "local" "info") - ("usr" "info") - ("usr" "local" "share" "info") - ("usr" "share" "info"))) + (list (paths-construct-path '("usr" "local" "info") + (char-to-string directory-sep-char)) + (paths-construct-path '("usr" "info") + (char-to-string directory-sep-char))) "Directories appended to the end of the info path by default.") (defun paths-find-site-lisp-directory (roots) @@ -73,7 +69,7 @@ (defun paths-find-module-directory (roots) "Find the main modules directory of the XEmacs hierarchy." (paths-find-architecture-directory roots "modules" - nil configure-module-directory)) + configure-module-directory)) (defun paths-construct-load-path (roots early-package-load-path late-package-load-path last-package-load-path @@ -141,12 +137,28 @@ (defun paths-find-doc-directory (roots) "Find the documentation directory." - (paths-find-architecture-directory roots "lib-src" nil configure-doc-directory)) + (paths-find-architecture-directory roots "lib-src")) + +(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" - nil configure-exec-directory)) + (paths-find-architecture-directory roots "lib-src" configure-exec-directory)) (defun paths-construct-exec-path (roots exec-directory early-packages late-packages last-packages) diff -r 12e008d41344 -r 697ef44129c6 lisp/simple.el --- a/lisp/simple.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,6 @@ ;; 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 @@ -63,7 +62,7 @@ ;; Mule-2.3, and could probably use some feature additions (like additional wrap ;; styles, etc) -;; 97/06/11 Steve Baur (steve@xemacs.org) Convert use of +;; 97/06/11 Steve Baur (steve@altair.xemacs.org) Convert use of ;; (preceding|following)-char to char-(after|before). ;;; Code: @@ -671,7 +670,7 @@ cnt))) ;;; Modified by Bob Weiner, 8/24/95, to print narrowed line number also. -;;; Expanded by Bob Weiner, BeOpen, on 02/12/1997 +;;; Expanded by Bob Weiner, Altrasoft, on 02/12/1997 (defun what-line () "Print the following variants of the line number of point: Region line - displayed line within the active region @@ -719,18 +718,9 @@ (message "Line %d" buffer-line))))))) (setq zmacs-region-stays t)) -;; 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))))) - +;;; Bob Weiner, Altrasoft, 02/12/1998 +;;; Added the 3rd arg in `count-lines' to conditionalize the counting of +;;; collapsed lines. (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, @@ -738,13 +728,7 @@ 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. - -NOTE: The expression to return the current line number is not obvious: - -(1+ (count-lines 1 (point-at-bol))) - -See also `line-number'." +selective-display are excluded from the line count." (save-excursion (save-restriction (narrow-to-region start end) @@ -1103,50 +1087,22 @@ (skip-chars-forward " \t")) (defcustom kill-whole-line nil - "*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)) + "*If non-nil, `kill-line' with no arg at beg of line kills the whole line." + :type 'boolean :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, 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. + "Kill the rest of the current line; if no nonblanks there, kill thru newline. 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." +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." (interactive "*P") - (kill-region (if (and (interactive-p) - (not arg) - (eq kill-whole-line 'always)) - (save-excursion - (beginning-of-line) - (point)) - (point)) + (kill-region (point) ;; Don't shift point before doing the delete; that way, ;; undo will record the right position of point. ;; FSF @@ -1161,10 +1117,7 @@ (forward-line (prefix-numeric-value arg)) (if (eobp) (signal 'end-of-buffer nil)) - (if (or (looking-at "[ \t]*$") - (and (interactive-p) - (or (eq kill-whole-line 'always) - (and kill-whole-line (bolp))))) + (if (or (looking-at "[ \t]*$") (and kill-whole-line (bolp))) (forward-line 1) (end-of-line))) (point)))) @@ -1201,7 +1154,7 @@ ;;; the cut buffers. I'm afraid to change interface of `kill-hooks', ;;; so I add it. (1997-11-03 by MORIOKA Tomohiko) -(defcustom interprogram-cut-function 'own-clipboard +(defvar interprogram-cut-function nil "Function to call to make a killed region available to other programs. Most window systems provide some sort of facility for cutting and @@ -1214,15 +1167,9 @@ 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." - :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 +nil means appending to an \"old\" kill.") + +(defvar interprogram-paste-function nil "Function to call to get text cut from other programs. Most window systems provide some sort of facility for cutting and @@ -1240,13 +1187,7 @@ 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." - :type '(radio (function-item :tag "Get from Clipboard" - :format "%t\n" - get-clipboard) - (const :tag "None" nil) - (function :tag "Other")) - :group 'killing) +is equal (according to `string=') to the last text Emacs provided.") ;;;; The kill ring data structure. @@ -1682,71 +1623,10 @@ ; (set-marker (mark-marker) nil))) (defvar mark-ring nil - "The list of former marks of the current buffer, most recent first. -This variable is automatically buffer-local.") + "The list of former marks of the current buffer, most recent first.") (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 @@ -1768,14 +1648,6 @@ 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") @@ -1783,7 +1655,6 @@ (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)))) @@ -1798,7 +1669,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 (or dont-record-current-mark (null (mark t buffer))) ; XEmacs + (if (null (mark t buffer)) ; XEmacs nil ;; The save-excursion / set-buffer is necessary because mark-ring ;; is a buffer local variable @@ -1812,9 +1683,8 @@ (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 (and (not dont-record-current-mark) - (or (null global-mark-ring) - (not (eq (marker-buffer (car global-mark-ring)) buffer)))) + (if (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)) @@ -1824,13 +1694,7 @@ (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil buffer) (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil))))) - (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) + (or nomsg executing-kbd-macro (> (minibuffer-depth) 0) (display-message 'command "Mark set")) (if activate-region (progn @@ -1940,54 +1804,6 @@ :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'. @@ -2016,17 +1832,6 @@ (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. @@ -2046,17 +1851,6 @@ (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. @@ -2095,7 +1889,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") + (interactive "_p") ; XEmacs (if (and next-line-add-newlines (= arg 1)) (let ((opoint (point))) (end-of-line) @@ -2126,7 +1920,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") + (interactive "_p") ; XEmacs (if (interactive-p) (condition-case nil (line-move (- arg)) @@ -2136,25 +1930,6 @@ (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. @@ -2817,8 +2592,7 @@ bounce ;; 97/3/14 jhod: Kinsoku (re-break-point (if (featurep 'mule) - (concat "[ \t\n]\\|" word-across-newline - ".\\|." word-across-newline) + (concat "[ \t\n]\\|" word-across-newline) "[ \t\n]")) ;; end patch (first t)) @@ -2881,23 +2655,20 @@ (if (save-excursion (skip-chars-backward " \t") (= (point) fill-point)) - ;; 1999-09-17 hniksic: turn off Kinsoku until - ;; it's debugged. - (indent-new-comment-line) ;; 97/3/14 jhod: Kinsoku processing -; ;(indent-new-comment-line) -; (let ((spacep (memq (char-before (point)) '(?\ ?\t)))) -; (funcall comment-line-break-function) -; ;; if user type space explicitly, leave SPC -; ;; even if there is no WAN. -; (if spacep -; (save-excursion -; (goto-char fill-point) -; ;; put SPC except that there is SPC -; ;; already or there is sentence end. -; (or (memq (char-after (point)) '(?\ ?\t)) -; (fill-end-of-sentence-p) -; (insert ?\ ))))) + ;(indent-new-comment-line) + (let ((spacep (memq (char-before (point)) '(?\ ?\t)))) + (funcall comment-line-break-function) + ;; if user type space explicitly, leave SPC + ;; even if there is no WAN. + (if spacep + (save-excursion + (goto-char fill-point) + ;; put SPC except that there is SPC + ;; already or there is sentence end. + (or (memq (char-after (point)) '(?\ ?\t)) + (fill-end-of-sentence-p) + (insert ?\ ))))) (save-excursion (goto-char fill-point) (funcall comment-line-break-function))) @@ -3118,7 +2889,6 @@ (if (and comcol (not fill-prefix)) ; XEmacs - (ENE) from fa-extras. (let ((comment-column comcol) (comment-start comstart) - (block-comment-start comstart) (comment-end comment-end)) (and comment-end (not (equal comment-end "")) ; (if (not comment-multi-line) @@ -3391,10 +3161,6 @@ 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 @@ -3540,10 +3306,6 @@ '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. @@ -3586,11 +3348,31 @@ (if (and (boundp var) (specifierp (symbol-value var))) (set-specifier (symbol-value var) val) (set var val))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; case changing 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)) ;; A bunch of stuff was moved elsewhere: ;; completion-list-mode-map @@ -3631,79 +3413,12 @@ (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'.") @@ -3844,10 +3559,9 @@ (mark-marker t)))) (run-hooks 'zmacs-update-region-hook))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; message logging code ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;; +;;;;;; echo area stuff +;;;;;; ;;; #### Should this be moved to a separate file, for clarity? ;;; -hniksic @@ -3911,7 +3625,7 @@ ;; --hniksic (defcustom log-message-ignore-regexps '(;; Note: adding entries to this list slows down messaging - ;; significantly. Wherever possible, use message labels. + ;; significantly. Wherever possible, use message lables. ;; Often-seen messages "\\`\\'" ; empty message @@ -4168,10 +3882,10 @@ (display-message label str) str))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; warning code ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;; +;;;;;; warning stuff +;;;;;; (defcustom log-warning-minimum-level 'info "Minimum level of warnings that should be logged. @@ -4373,15 +4087,10 @@ (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"))) - + ;;; simple.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/site-load.el --- a/lisp/site-load.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/site-load.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,7 @@ ;;; site-load.el --- Template file for site-wide XEmacs customization ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Author: Steven L. Baur +;; Author: Steven L. Baur ;; Keywords: internal ;; This file is part of XEmacs. diff -r 12e008d41344 -r 697ef44129c6 lisp/specifier.el --- a/lisp/specifier.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/specifier.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,7 @@ ;;; specifier.el --- Lisp interface to specifiers ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1996, 2000 Ben Wing. +;; Copyright (C) 1995, 1996 Ben Wing. ;; Author: Ben Wing ;; Keywords: internal, dumped @@ -275,20 +275,18 @@ 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 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'). +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. NOTE: It does *not* work to give a VALUE of nil as a way of removing the specifications for a locale. Use `remove-specifier' @@ -405,40 +403,6 @@ 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...) @@ -528,58 +492,6 @@ ,(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 12e008d41344 -r 697ef44129c6 lisp/startup.el --- a/lisp/startup.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/startup.el Mon Aug 13 11:20:41 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. @@ -30,7 +30,7 @@ ;; This file is dumped with XEmacs. -;; -batch, -t, and -nw are processed by main() in emacs.c and are +;; -batch, -t, and -nw are processed by main() in emacs.c and are ;; never seen by lisp code. ;; -version and -help are special-cased as well: they imply -batch, @@ -104,35 +104,18 @@ (defvar emacs-roots nil "List of plausible roots of the XEmacs hierarchy.") -(defvar user-init-directory-base ".xemacs" - "Base of directory where user-installed init files may go.") - -(defvar user-init-directory - (file-name-as-directory - (paths-construct-path (list "~" user-init-directory-base))) - "Directory where user-installed init files may go.") - -(defvar user-init-file-base "init.el" - "Default name of the user init file if uncompiled. -This should be used for migration purposes only.") +(defvar init-file-user nil + "Identity of user whose `.emacs' file is or was read. +The value is nil if no init file is being used; otherwise, it may be either +the null string, meaning that the init file was taken from the user that +originally logged in, or it may be a string containing a user's name. -(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.") +In either of the latter cases, `(concat \"~\" init-file-user \"/\")' +evaluates to the name of the directory in which the `.emacs' file was +searched for. -(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.") +Setting `init-file-user' does not prevent Emacs from loading +`site-start.el'. The only way to do that is to use `--no-site-file'.") ;; #### called `site-run-file' in FSFmacs @@ -217,18 +200,12 @@ (princ (concat "\n" (emacs-version) "\n\n")) (princ (if (featurep 'x) - (concat "When creating a window on an X display, " - (emacs-name) - " accepts all standard X Toolkit -command line options plus the following: - -iconname Use title as the icon name. - -mc <color> Use color as the mouse color. - -cr <color> Use color as the text-cursor foregound color. - -private Install a private colormap. - -In addition, the") + (concat (emacs-name) + " accepts all standard X Toolkit command line options.\n" + "In addition, the") "The")) (princ " following options are accepted: + -t <device> Use TTY <device> instead of the terminal for input and output. This implies the -nw option. -nw Inhibit the use of any window-system-specific @@ -243,11 +220,7 @@ startup. Also implies `-vanilla'. -vanilla Equivalent to -q -no-site-file -no-early-packages. -q Same as -no-init-file. - -user-init-file <file> Use <file> as init file. - -user-init-directory <directory> use <directory> as init directory. -user <user> Load user's init file instead of your own. - Equivalent to -user-init-file ~<user>/.emacs - -user-init-directory ~<user>/.xemacs/ -u <user> Same as -user.\n") (let ((l command-switch-alist) (insert (lambda (&rest x) @@ -382,10 +355,11 @@ (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.") @@ -408,15 +382,14 @@ (setq emacs-roots (paths-find-emacs-roots invocation-directory invocation-name)) - + (if debug-paths (princ (format "emacs-roots:\n%S\n" emacs-roots) 'external-debugging-output)) - + (if (null emacs-roots) (startup-find-roots-warning) (startup-setup-paths emacs-roots - user-init-directory inhibit-early-packages inhibit-site-lisp debug-paths)) @@ -426,7 +399,7 @@ lisp-directory) (load (expand-file-name (file-name-sans-extension autoload-file-name) lisp-directory) nil t)) - + (if (not inhibit-autoloads) (progn (if (not inhibit-early-packages) @@ -460,9 +433,6 @@ (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)) @@ -511,11 +481,16 @@ ;; (and (not (equal string "")) string))))) ;; (and ctype ;; (string-match iso-8859-1-locale-regexp ctype))) - ;; (progn + ;; (progn ;; (standard-display-european t) ;; (require 'iso-syntax))) - (setq load-user-init-file-p (not (noninteractive))) + ;; Figure out which user's init file to load, + ;; either from the environment or from the options. + (setq init-file-user (if (noninteractive) nil (user-login-name))) + ;; If user has not done su, use current $HOME to find .emacs. + (and init-file-user (string= init-file-user (user-real-login-name)) + (setq init-file-user "")) ;; Allow (at least) these arguments anywhere in the command line (let ((new-args nil) @@ -525,7 +500,7 @@ (cond ((or (string= arg "-q") (string= arg "-no-init-file")) - (setq load-user-init-file-p nil)) + (setq init-file-user nil)) ((string= arg "-no-site-file") (setq site-start-file nil)) ((or (string= arg "-no-early-packages") @@ -536,23 +511,11 @@ ;; Some work on this one already done in emacs.c. (string= arg "-no-autoloads") (string= arg "--no-autoloads")) - (setq load-user-init-file-p nil + (setq init-file-user nil site-start-file nil)) - ((string= arg "-user-init-file") - (setq user-init-file (pop args))) - ((string= arg "-user-init-directory") - (setq user-init-directory (file-name-as-directory (pop args)))) ((or (string= arg "-u") - (string= arg "-user")) - (let* ((user (pop args)) - (home-user (concat "~" user))) - (setq user-init-directory (file-name-as-directory - (paths-construct-path - (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 "-user")) + (setq init-file-user (pop args))) ((string= arg "-debug-init") (setq init-file-debug t)) ((string= arg "-unmapped") @@ -564,9 +527,7 @@ (while args (push (pop args) new-args))) (t (push arg new-args)))) - - (setq init-file-user (and load-user-init-file-p "")) - + (nreverse new-args))) (defconst initial-scratch-message "\ @@ -607,11 +568,6 @@ ;; and deletes the stdio device. (frame-initialize)) - ;; Reinitialize faces if necessary. This function changes face if - ;; it is created during auto-autoloads loading. Otherwise, it - ;; does nothing. - (startup-initialize-custom-faces) - ;; ;; We have normality, I repeat, we have normality. Anything you still ;; can't cope with is therefore your own problem. (And we don't need @@ -620,7 +576,7 @@ ;;; Load init files. (load-init-file) - + (with-current-buffer (get-buffer "*scratch*") (erase-buffer) ;; (insert initial-scratch-message) @@ -645,7 +601,7 @@ ;; If -batch, terminate after processing the command options. (when (noninteractive) (kill-emacs t)))) -(defun load-terminal-library () +(defun load-terminal-library () (when term-file-prefix (let ((term (getenv "TERM")) hyphend) @@ -656,94 +612,43 @@ (setq term (substring term 0 hyphend)) (setq term nil)))))) -(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-exists-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-exists-p expanded) - (throw 'found expanded)))) - nil))) - -(defun find-user-init-file (&optional init-directory home-directory) - "Determine the user's init file." - (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)) - (file-exists-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. +(defconst user-init-directory "/.xemacs/" + "Directory where user-installed packages may go.") +(define-obsolete-variable-alias + 'emacs-user-extension-dir + 'user-init-directory) -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." - (if (or user-init-file - (setq user-init-file (find-user-init-file user-init-directory))) - (load user-init-file t t t)) - (if (not custom-file) - (setq custom-file (make-custom-file-name user-init-file))) - (if (and (not (string= custom-file user-init-file)) - (file-exists-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. - ;; (Plus how to get help and how to undo.) - ;; Don't you dare turn this off for anyone except yourself. - (load "default" t t)))) +(defun load-user-init-file (init-file-user) + "This function actually reads the init file, .emacs." + (when init-file-user +;; purge references to init.el and options.el +;; convert these to use paths-construct-path for eventual migration to init.el +;; needs to be converted when idiom for constructing "~user" paths is created +; (setq user-init-file +; (paths-construct-path (list (concat "~" init-file-user) +; user-init-directory +; "init.el"))) +; (unless (file-exists-p (expand-file-name user-init-file)) + (setq user-init-file + (paths-construct-path (list (concat "~" init-file-user) + (cond + ((eq system-type 'ms-dos) "_emacs") + (t ".emacs"))))) +; ) + (load user-init-file t t t) +;; This should not be loaded since custom stuff currently goes into .emacs +; (let ((default-custom-file +; (paths-construct-path (list (concat "~" init-file-user) +; user-init-directory +; "options.el"))) +; (when (string= custom-file default-custom-file) +; (load default-custom-file t t))) + (unless inhibit-default-init + (let ((inhibit-startup-message nil)) + ;; Users are supposed to be told their rights. + ;; (Plus how to get help and how to undo.) + ;; Don't you dare turn this off for anyone except yourself. + (load "default" t t))))) ;;; Load user's init file and default ones. (defun load-init-file () @@ -764,14 +669,12 @@ (debug-on-error-initial (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) - (progn - ;; Do this without a condition-case if the user wants to debug. - (load-user-init-file)) + (if init-file-debug + ;; Do this without a condition-case if the user wants to debug. + (load-user-init-file init-file-user) (condition-case error (progn - (if load-user-init-file-p - (load-user-init-file)) + (load-user-init-file init-file-user) (setq init-file-had-error nil)) (error (message "Error in init file: %s" (error-message-string error)) @@ -864,7 +767,7 @@ (file-count 0) (line nil) (end-of-options nil) - file-p arg tem) + first-file-buffer file-p arg tem) (while command-line-args-left (setq arg (pop command-line-args-left)) (cond @@ -885,14 +788,14 @@ (setq end-of-options t)) (t (setq file-p t))) - + (when file-p (setq file-p nil) (incf file-count) (setq arg (expand-file-name arg dir)) (cond - ((= file-count 1) - (find-file arg)) + ((= file-count 1) (setq first-file-buffer + (progn (find-file arg) (current-buffer)))) (noninteractive (find-file arg)) (t (find-file-other-window arg))) (when line @@ -923,7 +826,7 @@ (setq e (read-key-sequence (let ((p (keymap-prompt map t))) (cond ((symbolp map) - (if p + (if p (format "%s %s " map p) (format "%s " map))) (p) @@ -1002,7 +905,7 @@ (defun startup-center-spaces (glyph) ;; Return the number of spaces to insert in order to center ;; the given glyph (may be a string or a pixmap). - ;; Assume spaces are as wide as avg-pixwidth. + ;; Assume spaces are as wide as avg-pixwidth. ;; Won't be quite right for proportional fonts, but it's the best we can do. ;; Maybe the new redisplay will export something a glyph-width function. ;;; #### Yes, there is a glyph-width function but it isn't quite what @@ -1013,7 +916,7 @@ ;; This function is used in about.el too. (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width)))) (fill-area-width (* avg-pixwidth (- fill-column left-margin))) - (glyph-pixwidth (cond ((stringp glyph) + (glyph-pixwidth (cond ((stringp glyph) (* avg-pixwidth (length glyph))) ;; #### the pixmap option should be removed ;;((pixmapp glyph) @@ -1033,12 +936,12 @@ `( "\ Sun provides support for the WorkShop/XEmacs integration package only. All other XEmacs packages are provided to you \"AS IS\".\n" - ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") + ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG")))) (if (and (not (featurep 'mule)) ;; Already got mule? ;; No Mule support on tty's yet - (not (eq 'tty (console-type))) + (not (eq 'tty (console-type))) lang ;; Non-English locale? (not (string= lang "C")) (not (string-match "^en" lang)) @@ -1050,7 +953,7 @@ XEmacs, by either running the command `xemacs-mule', or by using the X resource `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop. \n"))))) - ((key describe-no-warranty) + ((key describe-no-warranty) ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n")) ((key describe-copying) ": conditions to give out copies of XEmacs\n") @@ -1063,11 +966,11 @@ Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved. Copyright (C) 1994-1996 Board of Trustees, University of Illinois Copyright (C) 1995-1996 Ben Wing\n")) - + ((face (blue bold underline) "\nInformation, on-line help:\n\n") "XEmacs comes with plenty of documentation...\n\n" ,@(if (string-match "beta" emacs-version) - `((key describe-beta) + `((key describe-beta) ": " (face (red bold) "This is an Experimental version of XEmacs.\n")) `( "\n")) @@ -1096,7 +999,7 @@ ; "If non-nil, function called to provide the startup logo. ;This function should return an initialized glyph if it is used.") -;; This will hopefully go away when gettext is functional. +;; This will hopefully go away when gettext is functionnal. (defconst splash-frame-static-body `(,(emacs-version) "\n\n" (face italic "`C-' means the control key,`M-' means the meta key\n\n"))) @@ -1117,7 +1020,7 @@ (1+ indice ))) ))) -;; #### This function now returns the (possibly nil) timeout circulating the +;; ### This function now returns the (possibly nil) timeout circulating the ;; splash-frame elements (defun display-splash-frame () (let ((logo xemacs-logo) @@ -1166,8 +1069,7 @@ ;; don't let /tmp_mnt/... get into the load-path or exec-path. (abbreviate-file-name invocation-directory))) -(defun startup-setup-paths (roots user-init-directory - &optional +(defun startup-setup-paths (roots &optional inhibit-early-packages inhibit-site-lisp debug-paths) "Setup all the various paths. @@ -1182,9 +1084,7 @@ early)) (setq late-packages late) (setq last-packages last)) - (packages-find-packages - roots - (packages-compute-package-locations user-init-directory))) + (packages-find-packages roots)) (setq early-package-load-path (packages-find-package-load-path early-packages)) (setq late-package-load-path (packages-find-package-load-path late-packages)) @@ -1228,11 +1128,23 @@ (paths-construct-info-path roots early-packages late-packages last-packages)) - + (if debug-paths (princ (format "Info-directory-list:\n%S\n" Info-directory-list) 'external-debugging-output)) + (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 @@ -1246,7 +1158,7 @@ (if debug-paths (princ (format "exec-path:\n%S\n" exec-path) 'external-debugging-output)) - + (setq doc-directory (paths-find-doc-directory roots)) (if debug-paths @@ -1280,15 +1192,20 @@ (princ (buffer-string) 'external-debugging-output))) (defun startup-setup-paths-warning () - (let ((warnings '())) + (let ((lock (if (boundp 'lock-directory) lock-directory 't)) + (warnings '())) + (if (and (stringp lock) (null (file-directory-p lock))) + (setq lock nil)) (cond ((null (and lisp-directory exec-directory data-directory doc-directory - load-path)) + load-path + lock)) (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 12e008d41344 -r 697ef44129c6 lisp/subr.el --- a/lisp/subr.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/subr.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,6 @@ ;; 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 @@ -118,9 +117,7 @@ This function does nothing if HOOK is already local in the current buffer. -Do not use `make-local-variable' to make a hook variable buffer-local. - -See also `add-local-hook' and `remove-local-hook'." +Do not use `make-local-variable' to make a hook variable buffer-local." (if (local-variable-p hook (current-buffer)) ; XEmacs nil (or (boundp hook) (set hook nil)) @@ -142,11 +139,7 @@ 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-local-hook' and `add-one-shot-hook'." +function, it is changed to a list of functions." (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. @@ -192,114 +185,25 @@ (null (symbol-value hook)) ;value is nil, or (null function)) ;function is nil, then nil ;Do nothing. - (flet ((hook-remove - (function hook-value) - (flet ((hook-test - (fn hel) - (or (equal fn hel) - (and (symbolp hel) - (equal fn - (get hel 'one-shot-hook-fun)))))) - (if (and (consp hook-value) - (not (functionp hook-value))) - (if (member* function hook-value :test 'hook-test) - (setq hook-value - (delete* function (copy-sequence hook-value) - :test 'hook-test))) - (if (equal hook-value function) - (setq hook-value nil))) - hook-value))) - (if (or local - ;; Detect the case where make-local-variable was used on a hook - ;; and do what we used to do. - (and (local-variable-p hook (current-buffer)) - (not (memq t (symbol-value hook))))) - (set hook (hook-remove function (symbol-value hook))) - (set-default hook (hook-remove function (default-value hook))))))) - -;; 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)) + (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))))) (defun add-to-list (list-var element) "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. @@ -335,22 +239,6 @@ (define-function 'rplaca 'setcar) (define-function 'rplacd 'setcdr) -(defun copy-symbol (symbol &optional copy-properties) - "Return a new uninterned symbol with the same name as SYMBOL. -If COPY-PROPERTIES is non-nil, the new symbol will have a copy of -SYMBOL's value, function, and property lists." - (let ((new (make-symbol (symbol-name symbol)))) - (when copy-properties - ;; This will not copy SYMBOL's chain of forwarding objects, but - ;; I think that's OK. Callers should not expect such magic to - ;; keep working in the copy in the first place. - (and (boundp symbol) - (set new (symbol-value symbol))) - (and (fboundp symbol) - (fset new (symbol-function symbol))) - (setplist new (copy-list (symbol-plist symbol)))) - new)) - ;;;; String functions. ;; XEmacs @@ -406,14 +294,10 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (or pattern (setq pattern "[ \f\t\n\r\v]+")) - (let (parts (start 0) (len (length string))) - (if (string-match pattern string) - (setq parts (cons (substring string 0 (match-beginning 0)) parts) - start (match-end 0))) - (while (and (< start len) - (string-match pattern string (if (> start (match-beginning 0)) - start - (1+ start)))) + ;; The FSF version of this function takes care not to cons in case + ;; of infloop. Maybe we should synch? + (let (parts (start 0)) + (while (string-match pattern string start) (setq parts (cons (substring string start (match-beginning 0)) parts) start (match-end 0))) (nreverse (cons (substring string start) parts)))) @@ -435,8 +319,7 @@ "Collect output to `standard-output' while evaluating FORMS and return it as a string." ;; by "William G. Dubuque" <wgd@zurich.ai.mit.edu> w/ mods from Stig - `(with-current-buffer (get-buffer-create - (generate-new-buffer-name " *string-output*")) + `(with-current-buffer (get-buffer-create " *string-output*") (setq buffer-read-only nil) (buffer-disable-undo (current-buffer)) (erase-buffer) @@ -447,7 +330,7 @@ (erase-buffer)))) (defmacro with-current-buffer (buffer &rest body) - "Temporarily make BUFFER the current buffer and execute the forms in BODY. + "Execute the forms in BODY with BUFFER as the current buffer. The value returned is the value of the last form in BODY. See also `with-temp-buffer'." `(save-current-buffer @@ -490,10 +373,16 @@ "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." - `(with-temp-buffer - (insert ,str) - ,@body - (buffer-string))) + `(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))))) (defun insert-face (string face) "Insert STRING and highlight with FACE. Return the extent created." @@ -676,6 +565,9 @@ (interactive) nil) +(define-function 'mapc-internal 'mapc) +(make-obsolete 'mapc-internal 'mapc) + (define-function 'eval-in-buffer 'with-current-buffer) (make-obsolete 'eval-in-buffer 'with-current-buffer) @@ -722,12 +614,6 @@ (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 @@ -742,17 +628,13 @@ The arguments OLD-END and OLD-BUFFER are supported for backward compatibility with pre-21.2 XEmacsen times when arguments to this function were (buffer-string &optional START END BUFFER)." - (cond - ((or (stringp buffer) (bufferp buffer)) - ;; Most definitely the new way. - (buffer-substring nil nil buffer)) - ((or (stringp old-buffer) (bufferp old-buffer) - (natnump buffer) (natnump old-end)) - ;; Definitely the old way. - (buffer-substring buffer old-end old-buffer)) - (t - ;; Probably the old way. - (buffer-substring buffer old-end old-buffer)))) + (if (or (null buffer) + (bufferp buffer) + (stringp buffer)) + ;; The new way + (buffer-substring nil nil buffer) + ;; The old way + (buffer-substring buffer old-end old-buffer))) ;; This was not present before. I think Jamie had some objections ;; to this, so I'm leaving this undefined for now. --ben diff -r 12e008d41344 -r 697ef44129c6 lisp/symbols.el --- a/lisp/symbols.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/symbols.el Mon Aug 13 11:20:41 2007 +0200 @@ -124,7 +124,7 @@ (let ((event (apply getfun harg args))) (if (event-live-p event) nil - (setq event (make-event)) + (setq event (allocate-event)) (apply setfun harg event args)) (character-to-event value event))) diff -r 12e008d41344 -r 697ef44129c6 lisp/term/pc-win.el --- a/lisp/term/pc-win.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/term/pc-win.el Mon Aug 13 11:20:41 2007 +0200 @@ -114,7 +114,7 @@ ;; We have only one font, so... (add-hook 'before-init-hook 'msdos-face-setup) ;; --------------------------------------------------------------------------- -;; More or less useful imitations of certain X-functions. A lot of the +;; More or less useful immitations of certain X-functions. A lot of the ;; values returned are questionable, but usually only the form of the ;; returned value matters. Also, by the way, recall that `ignore' is ;; a useful function for returning 'nil regardless of argument. diff -r 12e008d41344 -r 697ef44129c6 lisp/term/scoansi.el --- a/lisp/term/scoansi.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/term/scoansi.el Mon Aug 13 11:20:41 2007 +0200 @@ -22,7 +22,7 @@ ;; HISTORY ;; jkj - Jan 18, 1993: Created. -;; jkj - Nov 18, 1993: Modified to work with Emacs 19.21 +;; jkj - Nov 18, 1993: Mdified to work with Emacs 19.21 ;; ;; First of all, the normal cursor movement keys. Some of these, if not diff -r 12e008d41344 -r 697ef44129c6 lisp/text-props.el --- a/lisp/text-props.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/text-props.el Mon Aug 13 11:20:41 2007 +0200 @@ -4,7 +4,7 @@ ;; Copyright (C) 1995 Amdahl Corporation. ;; Copyright (C) 1995 Ben Wing. -;; Author: Jamie Zawinski <jwz@jwz.org> +;; Author: Jamie Zawinski <jwz@netscape.com> ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, wp, faces, dumped diff -r 12e008d41344 -r 697ef44129c6 lisp/toolbar.el --- a/lisp/toolbar.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/toolbar.el Mon Aug 13 11:20:41 2007 +0200 @@ -54,13 +54,13 @@ (defcustom default-toolbar-position ;; added for the options menu - dverna (default-toolbar-position) - "The location of the default toolbar. It can be 'top, 'bottom, 'left or + "The location of the default toolbar. It can be 'top, 'bootom, '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,9 +123,6 @@ (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. @@ -146,8 +143,9 @@ (setq last-pressed-toolbar-button button)) ;; Added by Bob Weiner, Motorola Inc., 10/6/95, to handle ;; presses on blank portions of toolbars. - (when (functionp toolbar-blank-press-function) - (funcall toolbar-blank-press-function event))))) + (and (boundp 'toolbar-blank-press-function) + (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. @@ -200,21 +198,4 @@ (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 12e008d41344 -r 697ef44129c6 lisp/update-elc.el --- a/lisp/update-elc.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/update-elc.el Mon Aug 13 11:20:41 2007 +0200 @@ -39,6 +39,9 @@ ;; (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 + ;;; Code: (defvar processed nil) @@ -59,8 +62,7 @@ ; ;; -batch gets filtered out. ; (nthcdr 3 command-line-args)))) -(let ((build-root (expand-file-name ".." invocation-directory))) - (setq load-path (list (expand-file-name "lisp" build-root)))) +(setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) (load "very-early-lisp" nil t) @@ -81,13 +83,8 @@ ;; (print (prin1-to-string update-elc-files-to-compile)) -(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))) +(let (preloaded-file-list site-load-packages) + (load (concat default-directory "../lisp/dumped-lisp.el")) ;; Path setup (let ((package-preloaded-file-list @@ -96,7 +93,6 @@ (setq preloaded-file-list (append package-preloaded-file-list preloaded-file-list - '("bytecomp") packages-hardcoded-lisp))) (load (concat default-directory "../site-packages") t t) @@ -108,26 +104,6 @@ (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 @@ -147,14 +123,7 @@ (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)))) - - (if need-to-dump - (condition-case nil - (write-region-internal "foo" nil "../src/NEEDTODUMP") - (file-error nil))) - - ) + (setq preloaded-file-list (cdr preloaded-file-list))))) (setq update-elc-files-to-compile (append update-elc-files-to-compile processed)) @@ -170,7 +139,7 @@ update-elc-files-to-compile)) (load "loadup-el.el")) (condition-case nil - (delete-file "../src/NOBYTECOMPILE") + (delete-file "./NOBYTECOMPILE") (file-error nil))) (kill-emacs) diff -r 12e008d41344 -r 697ef44129c6 lisp/version.el --- a/lisp/version.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/version.el Mon Aug 13 11:20:41 2007 +0200 @@ -37,19 +37,16 @@ (defconst emacs-version (purecopy - (format "%d.%d %s%s%s%s" + (format "%d.%d %s%s%s" emacs-major-version emacs-minor-version - (if emacs-patch-level - (format "(patch %d)" emacs-patch-level) + (if xemacs-codename + (concat "\"" xemacs-codename "\"") "") + " XEmacs Lucid" (if xemacs-betaname (concat " " xemacs-betaname) - "") - (if xemacs-codename - (concat " \"" xemacs-codename "\"") - "") - " XEmacs Lucid")) + ""))) "Version numbers of this version of XEmacs.") (if (featurep 'infodock) @@ -110,19 +107,16 @@ (t (insert version-string)))))) ;; from emacs-vers.el -(defun emacs-version>= (major &optional minor patch) - "Return true if the Emacs version is >= to the given MAJOR, MINOR, - and PATCH numbers. -The MAJOR version number argument is required, but the other arguments -argument are optional. Only the Non-nil arguments are used in the test." - (let ((emacs-patch (or emacs-patch-level emacs-beta-version -1))) - (cond ((> emacs-major-version major)) - ((< emacs-major-version major) nil) - ((null minor)) - ((> emacs-minor-version minor)) - ((< emacs-minor-version minor) nil) - ((null patch)) - ((>= emacs-patch patch))))) +(defun emacs-version>= (major &optional minor) + "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers. +The MAJOR version number argument is required, but the MINOR version number +argument is optional. If the minor version number is not specified (or is the +symbol `nil') then only the major version numbers are considered in the test." + (if (null minor) + (>= emacs-major-version major) + (or (> emacs-major-version major) + (and (= emacs-major-version major) + (>= emacs-minor-version minor))))) ;;; We hope that this alias is easier for people to find. (define-function 'version 'emacs-version) @@ -131,9 +125,10 @@ ;; `what(1)' can extract from the executable or a core file. We don't ;; actually need this to be pointed to from lisp; pure objects can't ;; be GCed. -(purecopy (concat "\n@" "(#)" (emacs-version) - "\n@" "(#)" "Configuration: " - system-configuration "\n")) +(or (memq system-type '(windows-nt ms-dos)) + (purecopy (concat "\n@" "(#)" (emacs-version) + "\n@" "(#)" "Configuration: " + system-configuration "\n"))) ;;Local variables: ;;version-control: never diff -r 12e008d41344 -r 697ef44129c6 lisp/very-early-lisp.el --- a/lisp/very-early-lisp.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/very-early-lisp.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1998 by Free Software Foundation, Inc. -;; Author: SL Baur <steve@xemacs.org> +;; Author: SL Baur <steve@altair.xemacs.org> ;; Michael Sperber [Mr. Preprocessor] <sperber@Informatik.Uni-Tuebingen.De> ;; Keywords: internal, dumped @@ -32,8 +32,8 @@ ;;; Code: -;;; Intended replacement for read-time Lisp reader macros #-, #+ - +;;; Macros from Michael Sperber to replace read-time Lisp reader macros #-, #+ +;;; ####fixme duplicated in make-docfile.el and update-elc.el (defmacro assemble-list (&rest components) "Assemble a list from COMPONENTS. This is a poor man's backquote: @@ -55,17 +55,17 @@ "Insert STUFF as a list element if FEATURE is a loaded feature. This is intended for use as a component of ASSEMBLE-LIST." (list 'splice - (list 'if (list 'featurep (list 'quote feature)) - (list 'list stuff) - '()))) + (if (featurep feature) + (list 'list stuff) + '()))) (defmacro unless-feature (feature stuff) "Insert STUFF as a list element if FEATURE is NOT a loaded feature. This is intended for use as a component of ASSEMBLE-LIST." (list 'splice - (list 'if (list 'featurep (list 'quote feature)) - '() - (list 'list stuff)))) + (if (featurep feature) + '() + (list 'list stuff)))) (provide 'very-early-lisp) diff -r 12e008d41344 -r 697ef44129c6 lisp/wid-edit.el --- a/lisp/wid-edit.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/wid-edit.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,9 @@ ;;; wid-edit.el --- Functions for creating and using widgets. ;; -;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> -;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> +;; Maintainer: Hrvoje Niksic <hniksic@srce.hr> ;; Keywords: extensions ;; Version: 1.9960-x ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ @@ -49,7 +49,7 @@ :group 'hypermedia) (defgroup widget-documentation nil - "Options controlling the display of documentation strings." + "Options controling the display of documentation strings." :group 'widgets) (defgroup widget-faces nil @@ -601,7 +601,7 @@ ;; In WIDGET, match the start of VALS. (cond ((widget-get widget :inline) (widget-apply widget :match-inline vals)) - ((and (listp vals) + ((and vals (widget-apply widget :match (car vals))) (cons (list (car vals)) (cdr vals))) (t nil))) @@ -1898,6 +1898,9 @@ :group 'widgets :type 'boolean) +;; Cache already created GUI objects. +(defvar widget-push-button-cache nil) + (defcustom widget-push-button-prefix "[" "String used as prefix for buttons." :type 'string @@ -1922,7 +1925,7 @@ (tag-glyph (widget-get widget :tag-glyph)) (text (concat widget-push-button-prefix tag widget-push-button-suffix)) - gui) + (gui-glyphs (lax-plist-get widget-push-button-cache tag))) (cond (tag-glyph (widget-glyph-insert widget text tag-glyph)) ;; We must check for console-on-window-system-p here, @@ -1930,10 +1933,18 @@ ;; components for colors, and they are not known on TTYs). ((and widget-push-button-gui (console-on-window-system-p)) - (let* ((gui-button-shadow-thickness 1)) - (setq gui (make-glyph - (make-gui-button tag 'widget-gui-action widget)))) - (widget-glyph-insert-glyph widget gui)) + (unless gui-glyphs + (let* ((gui-button-shadow-thickness 1) + (gui (make-gui-button tag 'widget-gui-action widget))) + (setq + gui-glyphs + (list + (make-glyph `(,(nth 0 (aref gui 1)) [string :data ,text])) + (make-glyph `(,(nth 1 (aref gui 1)) [string :data ,text])) + (make-glyph `(,(nth 2 (aref gui 1)) [string :data ,text])))) + (laxputf widget-push-button-cache tag gui-glyphs))) + (widget-glyph-insert-glyph + widget (nth 0 gui-glyphs) (nth 1 gui-glyphs) (nth 2 gui-glyphs))) (t (insert text))))) @@ -2521,7 +2532,7 @@ found)) (defun widget-checklist-match-up (args vals) - ;; Return the first type from ARGS that matches VALS. + ;; Rerturn the first type from ARGS that matches VALS. (let (current found) (while (and args (null found)) (setq current (car args) @@ -2543,7 +2554,7 @@ result)) (defun widget-checklist-validate (widget) - ;; Ticked children must be valid. + ;; Ticked chilren must be valid. (let ((children (widget-get widget :children)) child button found) (while (and children (not found)) diff -r 12e008d41344 -r 697ef44129c6 lisp/widget.el --- a/lisp/widget.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/widget.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> -;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> +;; Maintainer: Hrvoje Niksic <hniksic@srce.hr> ;; Keywords: help, extensions, faces, hypermedia, dumped ;; Version: 1.9960-x ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ diff -r 12e008d41344 -r 697ef44129c6 lisp/window.el --- a/lisp/window.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/window.el Mon Aug 13 11:20:41 2007 +0200 @@ -295,8 +295,8 @@ (select-frame frame)))) ;; check to make sure that the window is the full width ;; of the frame - (window-leftmost-p window) - (window-rightmost-p window) + (eq (nth 2 edges) + (frame-pixel-width)) (zerop (nth 0 edges)) ;; The whole buffer must be visible. (pos-visible-in-window-p (point-min) window) @@ -351,4 +351,5 @@ minibuf all-frames device) wins)) + ;;; window.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/winnt.el --- a/lisp/winnt.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/winnt.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -;;; winnt.el --- Lisp routines for MS Windows. +;;; winnt.el --- Lisp routines for Windows NT. ;; Copyright (C) 1994 Free Software Foundation, Inc. @@ -39,14 +39,11 @@ ;; #### 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) +;; For appending suffixes to directories and files in shell completions. +(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 ";") @@ -85,4 +82,56 @@ (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 12e008d41344 -r 697ef44129c6 lisp/x-compose.el --- a/lisp/x-compose.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-compose.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992, 1993, 1997 Free Software Foundation, Inc. -;; Author: Jamie Zawinski <jwz@jwz.org> +;; Author: Jamie Zawinski <jwz@netscape.com> ;; Maintainer: XEmacs Development Team ;; Rewritten by Martin Buchholz far too many times. ;; @@ -73,7 +73,7 @@ ;; work, depending on what system and keyboard you are using. If it ;; doesn't, you'll have to read the man page for xmodmap. You might want ;; to get the "xkeycaps" program from -;; <URL:http://www.jwz.org/xkeycaps/>, +;; <URL:http://people.netscape.com/jwz/xkeycaps/>, ;; which is a graphical front end to xmodmap ;; that hides xmodmap's arcane syntax from you. diff -r 12e008d41344 -r 697ef44129c6 lisp/x-faces.el --- a/lisp/x-faces.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-faces.el Mon Aug 13 11:20:41 2007 +0200 @@ -3,7 +3,7 @@ ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996 Ben Wing. -;; Author: Jamie Zawinski <jwz@jwz.org> +;; Author: Jamie Zawinski <jwz@netscape.com> ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, internal, dumped @@ -492,13 +492,11 @@ (or (null locale) (eq locale 'global))) (progn (or fn (setq fn (x-get-resource - "font" "Font" 'string locale nil 'warn))) + "font" "Font" 'string locale))) (or fg (setq fg (x-get-resource - "foreground" "Foreground" 'string locale nil - 'warn))) + "foreground" "Foreground" 'string locale))) (or bg (setq bg (x-get-resource - "background" "Background" 'string locale nil - 'warn))))) + "background" "Background" 'string locale))))) ;; ;; "*cursorColor: foo" is equivalent to setting the background of the ;; text-cursor face. @@ -506,8 +504,7 @@ (if (and (eq (face-name face) 'text-cursor) (or (null locale) (eq locale 'global))) (setq bg (or (x-get-resource - "cursorColor" "CursorColor" 'string locale nil 'warn) - bg))) + "cursorColor" "CursorColor" 'string locale) 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. @@ -738,8 +735,7 @@ ;; If reverseVideo was specified, swap the foreground and background ;; of the default and modeline faces. ;; - (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame - nil 'warn)) + (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame)) ;; 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 12e008d41344 -r 697ef44129c6 lisp/x-font-menu.el --- a/lisp/x-font-menu.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-font-menu.el Mon Aug 13 11:20:41 2007 +0200 @@ -4,10 +4,9 @@ ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1997 Sun Microsystems -;; Author: Jamie Zawinski <jwz@jwz.org> +;; Author: Jamie Zawinski <jwz@netscape.com> ;; Restructured by: Jonathan Stigelman <Stig@hackvan.com> ;; Mule-ized by: Martin Buchholz -;; More restructuring for MS-Windows by Andy Piper <andy@xemacs.org> ;; This file is part of XEmacs. @@ -25,6 +24,105 @@ ;; 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. + +;;; Commentary: +;;; +;;; Creates three menus, "Font", "Size", and "Weight", and puts them on the +;;; "Options" menu. The contents of these menus are the superset of those +;;; properties available on any fonts, but only the intersection of the three +;;; sets is selectable at one time. +;;; +;;; Known Problems: +;;; =============== +;;; Items on the Font menu are selectable if and only if that font exists in +;;; the same size and weight as the current font. This means that some fonts +;;; are simply not reachable from some other fonts - if only one font comes +;;; in only one point size (like "Nil", which comes only in 2), you will never +;;; be able to select it. It would be better if the items on the Fonts menu +;;; were always selectable, and selecting them would set the size to be the +;;; closest size to the current font's size. +;;; +;;; This attempts to change all other faces in an analagous way to the change +;;; that was made to the default face; if it can't, it will skip over the face. +;;; However, this could leave incongruous font sizes around, which may cause +;;; some nonreversibility problems if further changes are made. Perhaps it +;;; should remember the initial fonts of all faces, and derive all subsequent +;;; fonts from that initial state. +;;; +;;; xfontsel(1) is a lot more flexible (but probably harder to understand). +;;; +;;; The code to construct menus from all of the x11 fonts available from the +;;; server is autoloaded and executed the very first time that one of the Font +;;; menus is selected on each device. That is, if XEmacs has frames on two +;;; different devices, then separate font menu information will be maintained +;;; for each X display. If the font path changes after emacs has already +;;; asked the X server on a particular display for its list of fonts, this +;;; won't notice. Also, the first time that a font menu is posted on each +;;; display will entail a lengthy delay, but that's better than slowing down +;;; XEmacs startup. At any time (i.e.: after a font-path change or +;;; immediately after device creation), you can call +;;; `reset-device-font-menus' to rebuild the menus from all currently +;;; available fonts. +;;; +;;; There is knowledge here about the regexp match numbers in +;;; `x-font-regexp' and `x-font-regexp-foundry-and-family' defined in +;;; x-faces.el. +;;; +;;; There are at least three kinds of fonts under X11r5: +;;; +;;; - bitmap fonts, which can be assumed to look as good as possible; +;;; - bitmap fonts which have been (or can be) automatically scaled to +;;; a new size, and which almost always look awful; +;;; - and true outline fonts, which should look ok at any size, but in +;;; practice (on at least some systems) look awful at any size, and +;;; even in theory are unlikely ever to look as good as non-scaled +;;; bitmap fonts. +;;; +;;; It would be nice to get this code to look for non-scaled bitmap fonts +;;; first, then outline fonts, then scaled bitmap fonts as a last resort. +;;; But it's not clear to me how to tell them apart based on their truenames +;;; and/or the result of XListFonts(). I welcome any and all explanations +;;; of the subtleties involved... +;;; +;;; +;;; If You Think You'Re Seeing A Bug: +;;; ================================= +;;; When reporting problems, send the following information: +;;; +;;; - Exactly what behavior you're seeing; +;;; - The output of the `xlsfonts' program; +;;; - The value of the variable `device-fonts-cache'; +;;; - The values of the following expressions, both before and after +;;; making a selection from any of the fonts-related menus: +;;; (face-font 'default) +;;; (font-truename (face-font 'default)) +;;; (font-properties (face-font 'default)) +;;; - The values of the following variables after making a selection: +;;; font-menu-preferred-resolution +;;; font-menu-registry-encoding +;;; +;;; There is a common misconception that "*-courier-medium-r-*-11-*", also +;;; known as "-adobe-courier-medium-r-normal--11-80-100-100-m-60-iso8859-1", +;;; is an 11-point font. It is not -- it is an 11-pixel font at 100dpi, +;;; which is an 8-point font (the number after -11- is the size in tenths +;;; of points). So if you expect to be seeing an "11" entry in the "Size" +;;; menu and are not, this may be why. +;;; +;;; In the real world (aka Solaris), one has to deal with fonts that +;;; appear to be medium-i but are really light-r, and fonts that +;;; resolve to different resolutions depending on the charset: +;;; +;;; (font-instance-truename +;;; (make-font-instance "-*-mincho-medium-i-normal-*-*-*-*-*-*-*-jisx0201*-*")) +;;; ==> +;;; "-morisawa-ryumin light kl-light-r-normal--10-100-72-72-m-50-jisx0201.1976-0" +;;; +;;; (list-fonts "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*") +;;; ==> +;;; ("-dt-interface user-medium-r-normal-s sans-12-120-72-72-m-70-iso8859-1" +;;; "-dt-interface user-medium-r-normal-s-14-120-75-75-m-120-jisx0208.1983-0" +;;; "-dt-interface user-medium-r-normal-s-14-120-75-75-m-60-jisx0201.1976-0") + ;;; Code: ;; #### - implement these... @@ -32,12 +130,57 @@ ;;; (defvar font-menu-ignore-proportional-fonts nil ;;; "*If non-nil, then the font menu will only show fixed-width fonts.") -(require 'font-menu) +(defgroup font-menu () + "Settings for the font menu" + :group 'x) + +;;;###autoload +(defcustom font-menu-ignore-scaled-fonts t + "*If non-nil, then the font menu will try to show only bitmap fonts." + :type 'boolean + :group 'font-menu) + +;;;###autoload +(defcustom font-menu-this-frame-only-p nil + "*If non-nil, then changing the default font from the font menu will only +affect one frame instead of all frames." + :type 'boolean + :group 'font-menu) -(defvar x-font-menu-registry-encoding nil +(defcustom font-menu-max-items 25 + "*Maximum number of items in the font menu +If number of entries in a menu is larger than this value, split menu +into submenus of nearly equal length. If nil, never split menu into +submenus." + :group 'font-menu + :type '(choice (const :tag "no submenus" nil) + (integer))) + +(defcustom font-menu-submenu-name-format "%-12.12s ... %.12s" + "*Format specification of the submenu name. +Used by `font-menu-split-long-menu' if the number of entries in a menu is +larger than `font-menu-menu-max-items'. +This string should contain one %s for the name of the first entry and +one %s for the name of the last entry in the submenu. +If the value is a function, it should return the submenu name. The +function is be called with two arguments, the names of the first and +the last entry in the menu." + :group 'font-menu + :type '(choice (string :tag "Format string") + (function))) + + +;; only call XListFonts (and parse) once per device. +;; ( (device . [parsed-list-fonts family-menu size-menu weight-menu]) ...) +(defvar device-fonts-cache nil) + +(defvar font-menu-registry-encoding nil "Registry and encoding to use with font menu fonts.") -(defvar x-fonts-menu-junk-families +(defvar font-menu-preferred-resolution "*-*" + "Preferred horizontal and vertical font menu resolution (e.g. \"75-75\").") + +(defvar fonts-menu-junk-families (purecopy (mapconcat #'identity @@ -51,6 +194,11 @@ "\\|")) "A regexp matching font families which are uninteresting (e.g. cursor fonts).") +(eval-when-compile + (defsubst device-fonts-cache () + (or (cdr (assq (selected-device) device-fonts-cache)) + (reset-device-font-menus (selected-device))))) + (defun hack-font-truename (fn) "Filter the output of `font-instance-truename' to deal with Japanese fontsets." (if (string-match "," (font-instance-truename fn)) @@ -65,12 +213,26 @@ ret) (font-instance-truename fn))) +;;;###autoload +(fset 'install-font-menus 'reset-device-font-menus) +(make-obsolete 'install-font-menus 'reset-device-font-menus) + (defvar x-font-regexp-ascii nil "This is used to filter out font families that can't display ASCII text. It must be set at run-time.") +(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 x-reset-device-font-menus (device &optional debug) +(defun reset-device-font-menus (&optional device debug) "Generates the `Font', `Size', and `Weight' submenus for the Options menu. This is run the first time that a font-menu is needed for each device. If you don't like the lazy invocation of this function, you can add it to @@ -80,100 +242,107 @@ ;; by Stig@hackvan.com ;; #### - this should implement a `menus-only' option, which would ;; recalculate the menus from the cache w/o having to do list-fonts again. - (unless x-font-regexp-ascii - (setq x-font-regexp-ascii (if (featurep 'mule) - (charset-registry 'ascii) - "iso8859-1"))) - (setq x-font-menu-registry-encoding - (if (featurep 'mule) "*-*" "iso8859-1")) - (let ((case-fold-search t) - family size weight entry monospaced-p - dev-cache cache families sizes weights) - (dolist (name (cond ((null debug) ; debugging kludge - (list-fonts "*-*-*-*-*-*-*-*-*-*-*-*-*-*" device)) - ((stringp debug) (split-string debug "\n")) - (t debug))) - (when (and (string-match x-font-regexp-ascii name) - (string-match x-font-regexp name)) - (setq weight (capitalize (match-string 1 name)) - size (string-to-int (match-string 6 name))) - (or (string-match x-font-regexp-foundry-and-family name) - (error "internal error")) - (setq family (capitalize (match-string 1 name))) - (or (string-match x-font-regexp-spacing name) - (error "internal error")) - (setq monospaced-p (string= "m" (match-string 1 name))) - (unless (string-match x-fonts-menu-junk-families family) - (setq entry (or (vassoc family cache) - (car (setq cache - (cons (vector family nil nil t) - cache))))) - (or (member family families) (push family families)) - (or (member weight weights) (push weight weights)) - (or (member size sizes) (push size sizes)) - (or (member weight (aref entry 1)) (push weight (aref entry 1))) - (or (member size (aref entry 2)) (push size (aref entry 2))) - (aset entry 3 (and (aref entry 3) monospaced-p))))) - ;; - ;; Hack scalable fonts. - ;; Some fonts come only in scalable versions (the only size is 0) - ;; and some fonts come in both scalable and non-scalable versions - ;; (one size is 0). If there are any scalable fonts at all, make - ;; sure that the union of all point sizes contains at least some - ;; common sizes - it's possible that some sensible sizes might end - ;; up not getting mentioned explicitly. - ;; - (if (member 0 sizes) - (let ((common '(60 80 100 120 140 160 180 240))) - (while common - (or;;(member (car common) sizes) ; not enough slack - (let ((rest sizes) - (done nil)) - (while (and (not done) rest) - (if (and (> (car common) (- (car rest) 5)) - (< (car common) (+ (car rest) 5))) - (setq done t)) - (setq rest (cdr rest))) - done) - (setq sizes (cons (car common) sizes))) - (setq common (cdr common))) - (setq sizes (delq 0 sizes)))) - - (setq families (sort families 'string-lessp) - weights (sort weights 'string-lessp) - sizes (sort sizes '<)) - - (dolist (entry cache) - (aset entry 1 (sort (aref entry 1) 'string-lessp)) - (aset entry 2 (sort (aref entry 2) '<))) + (message "Getting list of fonts from server... ") + (if (or noninteractive + (not (or device (setq device (selected-device)))) + (not (eq (device-type device) 'x))) + nil + (unless x-font-regexp-ascii + (setq x-font-regexp-ascii (if (featurep 'mule) + (charset-registry 'ascii) + "iso8859-1"))) + (setq font-menu-registry-encoding + (if (featurep 'mule) "*-*" "iso8859-1")) + (let ((case-fold-search t) + family size weight entry monospaced-p + dev-cache cache families sizes weights) + (dolist (name (cond ((null debug) ; debugging kludge + (list-fonts "*-*-*-*-*-*-*-*-*-*-*-*-*-*" device)) + ((stringp debug) (split-string debug "\n")) + (t debug))) + (when (and (string-match x-font-regexp-ascii name) + (string-match x-font-regexp name)) + (setq weight (capitalize (match-string 1 name)) + size (string-to-int (match-string 6 name))) + (or (string-match x-font-regexp-foundry-and-family name) + (error "internal error")) + (setq family (capitalize (match-string 1 name))) + (or (string-match x-font-regexp-spacing name) + (error "internal error")) + (setq monospaced-p (string= "m" (match-string 1 name))) + (unless (string-match fonts-menu-junk-families family) + (setq entry (or (vassoc family cache) + (car (setq cache + (cons (vector family nil nil t) + cache))))) + (or (member family families) (push family families)) + (or (member weight weights) (push weight weights)) + (or (member size sizes) (push size sizes)) + (or (member weight (aref entry 1)) (push weight (aref entry 1))) + (or (member size (aref entry 2)) (push size (aref entry 2))) + (aset entry 3 (and (aref entry 3) monospaced-p))))) + ;; + ;; Hack scalable fonts. + ;; Some fonts come only in scalable versions (the only size is 0) + ;; and some fonts come in both scalable and non-scalable versions + ;; (one size is 0). If there are any scalable fonts at all, make + ;; sure that the union of all point sizes contains at least some + ;; common sizes - it's possible that some sensible sizes might end + ;; up not getting mentioned explicitly. + ;; + (if (member 0 sizes) + (let ((common '(60 80 100 120 140 160 180 240))) + (while common + (or;;(member (car common) sizes) ; not enough slack + (let ((rest sizes) + (done nil)) + (while (and (not done) rest) + (if (and (> (car common) (- (car rest) 5)) + (< (car common) (+ (car rest) 5))) + (setq done t)) + (setq rest (cdr rest))) + done) + (setq sizes (cons (car common) sizes))) + (setq common (cdr common))) + (setq sizes (delq 0 sizes)))) - (setq dev-cache (assq device device-fonts-cache)) - (or dev-cache - (setq dev-cache (car (push (list device) device-fonts-cache)))) - (setcdr - dev-cache - (vector - cache - (mapcar (lambda (x) - (vector x - (list 'font-menu-set-font x nil nil) - ':style 'radio ':active nil ':selected nil)) - families) - (mapcar (lambda (x) - (vector (if (/= 0 (% x 10)) - ;; works with no LISP_FLOAT_TYPE - (concat (int-to-string (/ x 10)) "." - (int-to-string (% x 10))) - (int-to-string (/ x 10))) - (list 'font-menu-set-font nil nil x) - ':style 'radio ':active nil ':selected nil)) - sizes) - (mapcar (lambda (x) - (vector x - (list 'font-menu-set-font nil x nil) - ':style 'radio ':active nil ':selected nil)) - weights))) - (cdr dev-cache))) + (setq families (sort families 'string-lessp) + weights (sort weights 'string-lessp) + sizes (sort sizes '<)) + + (dolist (entry cache) + (aset entry 1 (sort (aref entry 1) 'string-lessp)) + (aset entry 2 (sort (aref entry 2) '<))) + + (message "Getting list of fonts from server... done.") + + (setq dev-cache (assq device device-fonts-cache)) + (or dev-cache + (setq dev-cache (car (push (list device) device-fonts-cache)))) + (setcdr + dev-cache + (vector + cache + (mapcar (lambda (x) + (vector x + (list 'font-menu-set-font x nil nil) + ':style 'radio ':active nil ':selected nil)) + families) + (mapcar (lambda (x) + (vector (if (/= 0 (% x 10)) + ;; works with no LISP_FLOAT_TYPE + (concat (int-to-string (/ x 10)) "." + (int-to-string (% x 10))) + (int-to-string (/ x 10))) + (list 'font-menu-set-font nil nil x) + ':style 'radio ':active nil ':selected nil)) + sizes) + (mapcar (lambda (x) + (vector x + (list 'font-menu-set-font nil x nil) + ':style 'radio ':active nil ':selected nil)) + weights))) + (cdr dev-cache)))) ;; Extract font information from a face. We examine both the ;; user-specified font name and the canonical (`true') font name. @@ -183,8 +352,7 @@ ;; We use the user-specified one if possible, else use the truename. ;; If the user didn't specify one (with "-dt-*-*", for example) ;; get the truename and use the possibly suboptimal data from that. -;;;###autoload -(defun* x-font-menu-font-data (face dcache) +(defun* font-menu-font-data (face dcache) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) @@ -202,7 +370,7 @@ (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))) + (return-from font-menu-font-data (make-vector 5 nil))) (when (string-match x-font-regexp name) (setq weight (capitalize (match-string 1 name))) @@ -217,7 +385,229 @@ (vector entry family size weight slant))) -(defun x-font-menu-load-font (family weight size slant resolution) +(defun font-menu-split-long-menu (menu) + "Split MENU according to `font-menu-max-items'." + (let ((len (length menu))) + (if (or (null font-menu-max-items) + (null (featurep 'lisp-float-type)) + (<= len font-menu-max-items)) + 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))) + (inner (/ len outer)) + (rest (% len outer)) + (result nil)) + (setq menu (reverse menu)) + (while menu + (let ((in inner) + (sub nil) + (to (car menu))) + (while (> in 0) + (setq in (1- in) + sub (cons (car menu) sub) + menu (cdr menu))) + (setq result + (cons (cons (if (stringp font-menu-submenu-name-format) + (format font-menu-submenu-name-format + (aref (car sub) 0) (aref to 0)) + (funcall font-menu-submenu-name-format + (aref (car sub) 0) (aref to 0))) + sub) + result) + rest (1+ rest)) + (if (= rest outer) (setq inner (1+ inner))))) + result)))) + +;;;###autoload +(defun font-menu-family-constructor (ignored) + (catch 'menu + (unless (eq 'x (device-type (selected-device))) + (throw 'menu '(["Cannot parse current font" ding nil]))) + (let* ((dcache (device-fonts-cache)) + (font-data (font-menu-font-data 'default dcache)) + (entry (aref font-data 0)) + (family (aref font-data 1)) + (size (aref font-data 2)) + (weight (aref font-data 3)) + f) + (unless family + (throw 'menu '(["Cannot parse current font" ding nil]))) + ;; Items on the Font menu are enabled iff that font exists in + ;; the same size and weight as the current font (scalable fonts + ;; exist in every size). Only the current font is marked as + ;; selected. + (font-menu-split-long-menu + (mapcar + (lambda (item) + (setq f (aref item 0) + entry (vassoc f (aref dcache 0))) + ;; The user can no longer easily control the weight using the menu + ;; Note it is silly anyway as it could very well be that the font + ;; has no common size+weight combinations with the default font. +;; (if (and (member weight (aref entry 1)) +;; (or (member size (aref entry 2)) +;; (and (not font-menu-ignore-scaled-fonts) +;; (member 0 (aref entry 2))))) +;; (enable-menu-item item) +;; (disable-menu-item item)) + (if (and font-menu-ignore-scaled-fonts (member 0 (aref entry 2))) + (disable-menu-item item) + (enable-menu-item item)) + (if (string-equal family f) + (select-toggle-menu-item item) + (deselect-toggle-menu-item item)) + item) + (aref dcache 1)))))) + +;;;###autoload +(defun font-menu-size-constructor (ignored) + (catch 'menu + (unless (eq 'x (device-type (selected-device))) + (throw 'menu '(["Cannot parse current font" ding nil]))) + (let* ((dcache (device-fonts-cache)) + (font-data (font-menu-font-data 'default dcache)) + (entry (aref font-data 0)) + (family (aref font-data 1)) + (size (aref font-data 2)) + ;;(weight (aref font-data 3)) + s) + (unless family + (throw 'menu '(["Cannot parse current font" ding nil]))) + ;; Items on the Size menu are enabled iff current font has + ;; that size. Only the size of the current font is selected. + ;; (If the current font comes in size 0, it is scalable, and + ;; thus has every size.) + (mapcar + (lambda (item) + (setq s (nth 3 (aref item 1))) + (if (or (member s (aref entry 2)) + (and (not font-menu-ignore-scaled-fonts) + (member 0 (aref entry 2)))) + (enable-menu-item item) + (disable-menu-item item)) + (if (eq size s) + (select-toggle-menu-item item) + (deselect-toggle-menu-item item)) + item) + (aref dcache 2))))) + +;;;###autoload +(defun font-menu-weight-constructor (ignored) + (catch 'menu + (unless (eq 'x (device-type (selected-device))) + (throw 'menu '(["Cannot parse current font" ding nil]))) + (let* ((dcache (device-fonts-cache)) + (font-data (font-menu-font-data 'default dcache)) + (entry (aref font-data 0)) + (family (aref font-data 1)) + ;;(size (aref font-data 2)) + (weight (aref font-data 3)) + w) + (unless family + (throw 'menu '(["Cannot parse current font" ding nil]))) + ;; Items on the Weight menu are enabled iff current font + ;; has that weight. Only the weight of the current font + ;; is selected. + (mapcar + (lambda (item) + (setq w (aref item 0)) + (if (member w (aref entry 1)) + (enable-menu-item item) + (disable-menu-item item)) + (if (string-equal weight w) + (select-toggle-menu-item item) + (deselect-toggle-menu-item item)) + item) + (aref dcache 3))))) + + +;;; Changing font sizes + +(defun font-menu-set-font (family weight size) + ;; This is what gets run when an item is selected from any of the three + ;; fonts menus. It needs to be rather clever. + ;; (size is measured in 10ths of points.) + (let* ((dcache (device-fonts-cache)) + (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-slant (aref font-data 4)) + new-default-face-font + new-props) + (unless from-family + (signal 'error '("couldn't parse font name for default face"))) + (when weight + (signal 'error '("Setting weight currently not supported"))) + (setq new-default-face-font + (font-menu-load-font (or family from-family) + (or weight from-weight) + (or size from-size) + from-slant + font-menu-preferred-resolution)) + (dolist (face (delq 'default (face-list))) + (when (face-font-instance face) + (message "Changing font of `%s'..." face) + (condition-case c + (font-menu-change-face face + from-family from-weight from-size + family weight size) + (error + (display-error c nil) + (sit-for 1))))) + ;; Set the default face's font after hacking the other faces, so that + ;; the frame size doesn't change until we are all done. + + ;; If we need to be frame local we do the changes ourselves. + (if font-menu-this-frame-only-p + ;;; WMP - we need to honor font-menu-this-frame-only-p here! + (set-face-font 'default new-default-face-font + (and font-menu-this-frame-only-p (selected-frame))) + ;; OK Let Customize do it. + (when (and family (not (equal family from-family))) + (setq new-props (append (list :family family) new-props))) + (when (and size (not (equal size from-size))) + (setq new-props (append + (list :size (concat (int-to-string (/ size 10)) "pt")) new-props))) + (custom-set-face-update-spec 'default '((type x)) new-props) + (message "Font %s" (face-font-name 'default))))) + + +(defun font-menu-change-face (face + from-family from-weight from-size + to-family to-weight to-size) + (or (symbolp face) (signal 'wrong-type-argument (list 'symbolp face))) + (let* ((dcache (device-fonts-cache)) + (font-data (font-menu-font-data face dcache)) + (face-family (aref font-data 1)) + (face-size (aref font-data 2)) + (face-weight (aref font-data 3)) + (face-slant (aref font-data 4))) + + (or face-family + (signal 'error (list "couldn't parse font name for face" face))) + + ;; If this face matches the old default face in the attribute we + ;; are changing, then change it to the new attribute along that + ;; dimension. Also, the face must have its own global attribute. + ;; If its value is inherited, we don't touch it. If any of this + ;; is not true, we leave it alone. + (when (and (face-font face 'global) + (cond + (to-family (string-equal face-family from-family)) + (to-weight (string-equal face-weight from-weight)) + (to-size (= face-size from-size)))) + (set-face-font face + (font-menu-load-font (or to-family face-family) + (or to-weight face-weight) + (or to-size face-size) + face-slant + font-menu-preferred-resolution) + (and font-menu-this-frame-only-p + (selected-frame)))))) + +(defun font-menu-load-font (family weight size slant resolution) "Try to load a font with the requested properties. The weight, slant and resolution are only hints." (when (integerp size) (setq size (int-to-string size))) @@ -237,10 +627,18 @@ (make-font-instance (concat "-*-" family "-" weight "-" slant "-*-*-*-" size "-" resolution "-*-*-" - x-font-menu-registry-encoding) + font-menu-registry-encoding) nil t)) (throw 'got-font font)))))))) +(defun flush-device-fonts-cache (device) + ;; by Stig@hackvan.com + (let ((elt (assq device device-fonts-cache))) + (and elt + (setq device-fonts-cache (delq elt device-fonts-cache))))) + +(add-hook 'delete-device-hook 'flush-device-fonts-cache) + (provide 'x-font-menu) ;;; x-font-menu.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/x-init.el --- a/lisp/x-init.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-init.el Mon Aug 13 11:20:41 2007 +0200 @@ -305,8 +305,8 @@ (init-x-toolbar)) (if (and (featurep 'infodock) (featurep 'toolbar)) (require 'id-x-toolbar)) - (if (featurep 'gutter) (init-gutter)) - (if (featurep 'mule) (init-mule-x-win)) + (if (featurep 'mule) + (init-mule-x-win)) ;; these are only ever called if zmacs-regions is true. (add-hook 'zmacs-deactivate-region-hook (lambda () diff -r 12e008d41344 -r 697ef44129c6 lisp/x-iso8859-1.el --- a/lisp/x-iso8859-1.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-iso8859-1.el Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992, 1993, 1997 Free Software Foundation, Inc. -;; Author: Jamie Zawinski <jwz@jwz.org> +;; Author: Jamie Zawinski <jwz@netscape.com> ;; Created: 15-jun-92 ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, internal, dumped diff -r 12e008d41344 -r 697ef44129c6 lisp/x-misc.el --- a/lisp/x-misc.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-misc.el Mon Aug 13 11:20:41 2007 +0200 @@ -66,7 +66,7 @@ (let* ((name (caar resource-list)) (class (cdar resource-list)) (resource - (x-get-resource name class type locale nil 'warn))) + (x-get-resource name class type locale nil t))) (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 'warn)) + (x-get-resource name class type locale nil t)) (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 'warn)) + (x-get-resource name class type locale nil t)) ;;; x-misc.el ends here diff -r 12e008d41344 -r 697ef44129c6 lisp/x-mouse.el --- a/lisp/x-mouse.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-mouse.el Mon Aug 13 11:20:41 2007 +0200 @@ -36,8 +36,6 @@ ;;(define-key global-map '(shift button2) 'x-mouse-kill) (define-key global-map '(control button2) 'x-set-point-and-move-selection) -(define-obsolete-function-alias 'x-insert-selection 'insert-selection) - (defun x-mouse-kill (event) "Kill the text between the point and mouse and copy it to the clipboard and to the cut buffer" @@ -45,10 +43,51 @@ (let ((old-point (point))) (mouse-set-point event) (let ((s (buffer-substring old-point (point)))) - (own-clipboard s) + (x-own-clipboard s) (x-store-cutbuffer s)) (kill-region old-point (point)))) +(defun x-yank-function () + "Insert the current X selection or, if there is none, insert the X cutbuffer. +A mark is pushed, so that the inserted text lies between point and mark." + (push-mark) + (if (region-active-p) + (if (consp zmacs-region-extent) + ;; pirated code from insert-rectangle in rect.el + ;; perhaps that code should be modified to handle a list of extents + ;; as the rectangle to be inserted? + (let ((lines zmacs-region-extent) + (insertcolumn (current-column)) + (first t)) + (push-mark) + (while lines + (or first + (progn + (forward-line 1) + (or (bolp) (insert ?\n)) + (move-to-column insertcolumn t))) + (setq first nil) + (insert (extent-string (car lines))) + (setq lines (cdr lines)))) + (insert (extent-string zmacs-region-extent))) + (x-insert-selection t))) + +(defun x-insert-selection (&optional check-cutbuffer-p move-point-event) + "Insert the current selection into buffer at point." + (interactive "P") + (let ((text (if check-cutbuffer-p + (or (condition-case () (x-get-selection) (error ())) + (x-get-cutbuffer) + (error "No selection or cut buffer available")) + (x-get-selection)))) + (cond (move-point-event + (mouse-set-point move-point-event) + (push-mark (point))) + ((interactive-p) + (push-mark (point)))) + (insert text) + )) + (make-obsolete 'x-set-point-and-insert-selection 'mouse-yank) (defun x-set-point-and-insert-selection (event) "Set point where clicked and insert the primary selection or the cut buffer." @@ -63,9 +102,9 @@ ;; to fail; just let the appropriate error message get issued. (We need ;; to insert the selection and set point first, or the selection may ;; get inserted at the wrong place.) - (and (selection-owner-p) + (and (x-selection-owner-p) primary-selection-extent - (insert-selection t event)) + (x-insert-selection t event)) (kill-primary-selection)) (defun mouse-track-and-copy-to-cutbuffer (event) @@ -100,48 +139,41 @@ (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 nil 'warn) + (or (x-get-resource "textPointer" "Cursor" 'string device) "xterm")) (set-glyph-image selection-pointer-glyph - (or (x-get-resource "selectionPointer" "Cursor" 'string device - nil 'warn) + (or (x-get-resource "selectionPointer" "Cursor" 'string device) "top_left_arrow")) (set-glyph-image nontext-pointer-glyph - (or (x-get-resource "spacePointer" "Cursor" 'string device nil 'warn) + (or (x-get-resource "spacePointer" "Cursor" 'string device) "xterm")) ; was "crosshair" (set-glyph-image modeline-pointer-glyph - (or (x-get-resource "modeLinePointer" "Cursor" 'string device - nil 'warn) + (or (x-get-resource "modeLinePointer" "Cursor" 'string device) ;; "fleur")) "sb_v_double_arrow")) (set-glyph-image gc-pointer-glyph - (or (x-get-resource "gcPointer" "Cursor" 'string device nil 'warn) + (or (x-get-resource "gcPointer" "Cursor" 'string device) "watch")) (when (featurep 'scrollbar) (set-glyph-image scrollbar-pointer-glyph - (or (x-get-resource "scrollbarPointer" "Cursor" 'string device - nil 'warn) + (or (x-get-resource "scrollbarPointer" "Cursor" 'string device) "top_left_arrow"))) (set-glyph-image busy-pointer-glyph - (or (x-get-resource "busyPointer" "Cursor" 'string device nil 'warn) + (or (x-get-resource "busyPointer" "Cursor" 'string device) "watch")) (set-glyph-image toolbar-pointer-glyph - (or (x-get-resource "toolBarPointer" "Cursor" 'string device - nil 'warn) + (or (x-get-resource "toolBarPointer" "Cursor" 'string device) "left_ptr")) (set-glyph-image divider-pointer-glyph - (or (x-get-resource "dividerPointer" "Cursor" 'string device - nil 'warn) + (or (x-get-resource "dividerPointer" "Cursor" 'string device) "sb_h_double_arrow")) (let ((fg - (x-get-resource "pointerColor" "Foreground" 'string device - nil 'warn))) + (x-get-resource "pointerColor" "Foreground" 'string device))) (and fg (set-face-foreground 'pointer fg))) (let ((bg - (x-get-resource "pointerBackground" "Background" 'string device - nil 'warn))) + (x-get-resource "pointerBackground" "Background" 'string device))) (and bg (set-face-background 'pointer bg))) (setq x-pointers-initialized t)) diff -r 12e008d41344 -r 697ef44129c6 lisp/x-scrollbar.el --- a/lisp/x-scrollbar.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-scrollbar.el Mon Aug 13 11:20:41 2007 +0200 @@ -80,7 +80,7 @@ ;; Now do ScrollBarPlacement.scrollBarPlacement (let ((case-fold-search t) (resval (x-get-resource "ScrollBarPlacement" "scrollBarPlacement" - 'string locale nil 'warn))) + 'string locale))) (cond ((null resval)) ((string-match "^top[_-]left$" resval) diff -r 12e008d41344 -r 697ef44129c6 lisp/x-select.el --- a/lisp/x-select.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-select.el Mon Aug 13 11:20:41 2007 +0200 @@ -35,30 +35,95 @@ ;;; Code: -(define-obsolete-function-alias 'x-selection-exists-p 'selection-exists-p) -(define-obsolete-function-alias 'x-selection-owner-p 'selection-owner-p) -(define-obsolete-variable-alias 'x-selection-converter-alist 'selection-converter-alist) -(define-obsolete-variable-alias 'x-lost-selection-hooks 'lost-selection-hooks) -(define-obsolete-variable-alias 'x-selected-text-type 'selected-text-type) -(define-obsolete-function-alias 'x-valid-simple-selection-p 'valid-simple-selection-p) -(define-obsolete-function-alias 'x-own-selection 'own-selection) -(define-obsolete-function-alias 'x-disown-selection 'disown-selection) -(define-obsolete-function-alias 'x-delete-primary-selection 'delete-primary-selection) -(define-obsolete-function-alias 'x-copy-primary-selection 'copy-primary-selection) -(define-obsolete-function-alias 'x-kill-primary-selection 'kill-primary-selection) -(define-obsolete-function-alias 'x-select-make-extent-for-selection - 'select-make-extent-for-selection) -(define-obsolete-function-alias 'x-cut-copy-clear-internal 'cut-copy-clear-internal) -(define-obsolete-function-alias 'x-get-selection 'get-selection) -(define-obsolete-function-alias 'x-get-clipboard 'get-clipboard) -(define-obsolete-function-alias 'x-yank-clipboard-selection - 'yank-clipboard-selection) -(define-obsolete-function-alias 'x-disown-selection-internal - 'disown-selection-internal) +(defvar x-selected-text-type + (if (featurep 'mule) '(COMPOUND_TEXT STRING) 'STRING) + "The type atom used to obtain selections from the X server. +Can be either a valid X selection data type, or a list of such types. +COMPOUND_TEXT and STRING are the most commonly used data types. +If a list is provided, the types are tried in sequence until +there is a successful conversion.") + +(defun x-get-selection (&optional type data-type) + "Return the value of an X Windows 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." + (or type (setq type 'PRIMARY)) + (or data-type (setq data-type x-selected-text-type)) + (let ((text + (if (consp data-type) + (condition-case err + (x-get-selection-internal type (car data-type)) + (selection-conversion-error + (if (cdr data-type) + (x-get-selection type (cdr data-type)) + (signal (car err) (cdr err))))) + (x-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)) (defun x-get-secondary-selection () "Return text selected from some X window." - (get-selection 'SECONDARY)) + (x-get-selection 'SECONDARY)) + +(defun x-get-clipboard () + "Return text pasted to the clipboard." + (x-get-selection 'CLIPBOARD)) + +;; FSFmacs calls this `x-set-selection', and reverses the +;; arguments (duh ...). This order is more logical. +(defun x-own-selection (data &optional type) + "Make an X Windows 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). + +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*. +Thus, editing done in the buffer after you specify the selection +can alter the effective value of the selection. + +The data may also be a vector of valid non-vector selection values. + +Interactively, the text of the region is used as the selection value." + (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 (x-valid-simple-selection-p data) + (and (vectorp data) + (let ((valid t) + (i (1- (length data)))) + (while (>= i 0) + (or (x-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 data + (x-own-selection-internal type data) + (x-disown-selection-internal 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)))) + (setq zmacs-region-stays t) + data) + +(defun x-valid-simple-selection-p (data) + (valid-simple-selection-p data)) (defun x-own-secondary-selection (selection &optional type) "Make a secondary X Selection of the given argument. The argument may be a @@ -69,7 +134,39 @@ (list (cons ;; these need not be ordered. (copy-marker (point-marker)) (copy-marker (mark-marker)))))) - (own-selection selection 'SECONDARY)) + (x-own-selection selection 'SECONDARY)) + + +(defun x-own-clipboard (string) + "Paste the given string to the X Clipboard." + (x-own-selection string 'CLIPBOARD)) + + +(defun x-disown-selection (&optional secondary-p) + "Assuming we own the selection, disown it. With an argument, discard the +secondary selection instead of the primary selection." + (x-disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY))) + +(defun x-dehilight-selection (selection) + "for use as a value of `x-lost-selection-hooks'." + (cond ((eq selection 'PRIMARY) + (if primary-selection-extent + (let ((inhibit-quit t)) + (if (consp primary-selection-extent) + (mapcar 'delete-extent primary-selection-extent) + (delete-extent primary-selection-extent)) + (setq primary-selection-extent nil))) + (if zmacs-regions (zmacs-deactivate-region))) + ((eq selection 'SECONDARY) + (if secondary-selection-extent + (let ((inhibit-quit t)) + (if (consp secondary-selection-extent) + (mapcar 'delete-extent secondary-selection-extent) + (delete-extent secondary-selection-extent)) + (setq secondary-selection-extent nil))))) + nil) + +(setq x-lost-selection-hooks 'x-dehilight-selection) (defun x-notice-selection-requests (selection type successful) "for possible use as the value of x-sent-selection-hooks." @@ -88,6 +185,36 @@ ;(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 (x-selection-owner-p selection) + (setq value (x-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))))) + (x-disown-selection-internal selection)))) + + ;;; Cut Buffer support ;;; FSF name x-get-cut-buffer @@ -123,6 +250,253 @@ (x-store-cutbuffer-internal 'CUT_BUFFER0 string)))) +;;; Random utility functions + +(defun x-yank-clipboard-selection () + "Insert the current Clipboard selection at point." + (interactive "*") + (setq last-command nil) + (setq this-command 'yank) ; so that yank-pop works. + (let ((clip (x-get-clipboard))) + (or clip (error "there is no clipboard selection")) + (push-mark) + (insert clip))) + +;;; 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. + +(defun xselect-convert-to-text (selection type value) + (cond ((stringp value) + value) + ((extentp value) + (save-excursion + (set-buffer (extent-object value)) + (save-restriction + (widen) + (buffer-substring (extent-start-position value) + (extent-end-position value))))) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (or (eq (marker-buffer (car value)) (marker-buffer (cdr value))) + (signal 'error + (list "markers must be in the same buffer" + (car value) (cdr value)))) + (save-excursion + (set-buffer (or (marker-buffer (car value)) + (error "selection is in a killed buffer"))) + (save-restriction + (widen) + (buffer-substring (car value) (cdr value))))) + (t nil))) + +(defun xselect-convert-to-string (selection type value) + (let ((outval (xselect-convert-to-text selection type value))) + ;; force the string to be not in Compound Text format. + (if (stringp outval) + (cons 'STRING outval) + outval))) + +(defun xselect-convert-to-compound-text (selection type value) + ;; converts to compound text automatically + (xselect-convert-to-text selection type value)) + +(defun xselect-convert-to-length (selection type value) + (let ((value + (cond ((stringp value) + (length value)) + ((extentp value) + (extent-length value)) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (or (eq (marker-buffer (car value)) + (marker-buffer (cdr value))) + (signal 'error + (list "markers must be in the same buffer" + (car value) (cdr value)))) + (abs (- (car value) (cdr value))))))) + (if value ; force it to be in 32-bit format. + (cons (ash value -16) (logand value 65535)) + nil))) + +(defun xselect-convert-to-targets (selection type value) + ;; return a vector of atoms, but remove duplicates first. + (let* ((all (cons 'TIMESTAMP (mapcar 'car selection-converter-alist))) + (rest all)) + (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))) + +(defun xselect-convert-to-delete (selection type value) + (x-disown-selection-internal selection) + ;; A return value of nil means that we do not know how to do this conversion, + ;; and replies with an "error". A return value of NULL means that we have + ;; done the conversion (and any side-effects) but have no value to return. + 'NULL) + +(defun xselect-convert-to-filename (selection type value) + (cond ((extentp value) + (buffer-file-name (or (extent-object value) + (error "selection is in a killed buffer")))) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (buffer-file-name (or (marker-buffer (car value)) + (error "selection is in a killed buffer")))) + (t nil))) + +(defun xselect-convert-to-charpos (selection type value) + (let (a b tmp) + (cond ((cond ((extentp value) + (setq a (extent-start-position value) + b (extent-end-position value))) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (setq a (car value) + b (cdr value)))) + (setq a (1- a) b (1- b)) ; zero-based + (if (< b a) (setq tmp a a b b tmp)) + (cons 'SPAN + (vector (cons (ash a -16) (logand a 65535)) + (cons (ash b -16) (logand b 65535)))))))) + +(defun xselect-convert-to-lineno (selection type value) + (let (a b buf tmp) + (cond ((cond ((extentp value) + (setq buf (extent-object value) + a (extent-start-position value) + b (extent-end-position value))) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (setq a (marker-position (car value)) + b (marker-position (cdr value)) + buf (marker-buffer (car value))))) + (save-excursion + (set-buffer buf) + (save-restriction + (widen) + (goto-char a) + (beginning-of-line) + (setq a (1+ (count-lines 1 (point)))) + (goto-char b) + (beginning-of-line) + (setq b (1+ (count-lines 1 (point)))))) + (if (< b a) (setq tmp a a b b tmp)) + (cons 'SPAN + (vector (cons (ash a -16) (logand a 65535)) + (cons (ash b -16) (logand b 65535)))))))) + +(defun xselect-convert-to-colno (selection type value) + (let (a b buf tmp) + (cond ((cond ((extentp value) + (setq buf (extent-object value) + a (extent-start-position value) + b (extent-end-position value))) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (setq a (car value) + b (cdr value) + buf (marker-buffer a)))) + (save-excursion + (set-buffer buf) + (goto-char a) + (setq a (current-column)) + (goto-char b) + (setq b (current-column))) + (if (< b a) (setq tmp a a b b tmp)) + (cons 'SPAN + (vector (cons (ash a -16) (logand a 65535)) + (cons (ash b -16) (logand b 65535)))))))) + +(defun xselect-convert-to-sourceloc (selection type value) + (let (a b buf file-name tmp) + (cond ((cond ((extentp value) + (setq buf (or (extent-object value) + (error "selection is in a killed buffer")) + a (extent-start-position value) + b (extent-end-position value) + file-name (buffer-file-name buf))) + ((and (consp value) + (markerp (car value)) + (markerp (cdr value))) + (setq a (marker-position (car value)) + b (marker-position (cdr value)) + buf (or (marker-buffer (car value)) + (error "selection is in a killed buffer")) + file-name (buffer-file-name buf)))) + (save-excursion + (set-buffer buf) + (save-restriction + (widen) + (goto-char a) + (beginning-of-line) + (setq a (1+ (count-lines 1 (point)))) + (goto-char b) + (beginning-of-line) + (setq b (1+ (count-lines 1 (point)))))) + (if (< b a) (setq tmp a a b b tmp)) + (format "%s:%d" file-name a))))) + +(defun xselect-convert-to-os (selection type size) + (symbol-name system-type)) + +(defun xselect-convert-to-host (selection type size) + (system-name)) + +(defun xselect-convert-to-user (selection type size) + (user-full-name)) + +(defun xselect-convert-to-class (selection type size) + 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. +(defun xselect-convert-to-name (selection type size) + ;invocation-name + "xemacs") + +(defun xselect-convert-to-integer (selection type value) + (and (integerp value) + (cons (ash value -16) (logand value 65535)))) + +(defun xselect-convert-to-atom (selection type value) + (and (symbolp value) value)) + +(defun xselect-convert-to-identity (selection type value) ; used internally + (vector value)) + +(setq selection-converter-alist + '((TEXT . xselect-convert-to-text) + (STRING . xselect-convert-to-string) + (COMPOUND_TEXT . xselect-convert-to-compound-text) + (TARGETS . xselect-convert-to-targets) + (LENGTH . xselect-convert-to-length) + (DELETE . xselect-convert-to-delete) + (FILE_NAME . xselect-convert-to-filename) + (CHARACTER_POSITION . xselect-convert-to-charpos) + (SOURCE_LOC . xselect-convert-to-sourceloc) + (LINE_NUMBER . xselect-convert-to-lineno) + (COLUMN_NUMBER . xselect-convert-to-colno) + (OWNER_OS . xselect-convert-to-os) + (HOST_NAME . xselect-convert-to-host) + (USER . xselect-convert-to-user) + (CLASS . xselect-convert-to-class) + (NAME . xselect-convert-to-name) + (ATOM . xselect-convert-to-atom) + (INTEGER . xselect-convert-to-integer) + (_EMACS_INTERNAL . xselect-convert-to-identity) + )) + ;FSFmacs (provide 'select) ;;; x-select.el ends here. diff -r 12e008d41344 -r 697ef44129c6 lisp/x-win-sun.el --- a/lisp/x-win-sun.el Mon Aug 13 11:19:22 2007 +0200 +++ b/lisp/x-win-sun.el Mon Aug 13 11:20:41 2007 +0200 @@ -246,10 +246,8 @@ ;;; themselves are in x-win.el in case someone wants to use them when ;;; not running on a Sun display.) - (or (lookup-key global-map 'find) - (define-key global-map 'find 'ow-find)) - (or (lookup-key global-map '(shift find)) - (define-key global-map '(shift find) 'ow-find-backward)) + (define-key global-map 'find 'ow-find) + (define-key global-map '(shift find) 'ow-find-backward) ) diff -r 12e008d41344 -r 697ef44129c6 lwlib/ChangeLog --- a/lwlib/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,544 +1,3 @@ -2000-07-19 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.35 is released. - -2000-07-09 Martin Buchholz <martin@xemacs.org> - - * 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 <ben@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.34 is released. - -2000-05-01 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.33 is released. - -2000-04-19 Martin Buchholz <martin@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * lwlib-Xaw.c (lw_xaw_widget_p): include asciiTextWidgetClass as - an athena widget. - -2000-04-05 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * lwlib.c (merge_widget_value_args): only merge when the two args - are actually different. - -2000-03-21 Didier Verna <didier@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.32 is released. - -2000-03-14 Ben Wing <ben@xemacs.org> - - * xlwmenu.c (massage_resource_name): Handle %_ and %%. - -2000-02-20 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.31 is released. - -2000-02-22 Andy Piper <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.30 is released. - -2000-02-21 Andy Piper <andy@xemacs.org> - - * 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 <vroonhof@math.ethz.ch> - - * 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 <andy@xemacs.org> - - * xlwgauge.c (GaugeExpose): remove shadows. - -2000-02-16 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.29 is released. - -2000-02-09 Valdis Kletnieks <Valdis.Kletnieks@vt.edu> - - * config.h.in (ATHENA_INCLUDE): Workaround bugs in both xlc and - old gccs. - -2000-02-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.28 is released. - -2000-01-25 Andy Piper <andy@xemacs.org> - - * xlwtabs.c (TabsChangeManaged): Make sure we unmanage the hilight - widget as well. - -2000-01-28 Martin Buchholz <martin@xemacs.org> - - * xlwgauge.c (GaugeConvert): bcopy ==> memcpy - -2000-01-24 Andy Piper <andy@xemacs.org> - - * xlwtabs.c (XawTabsSetTop): Unhighlight before changing the - stacking order. - (XawTabsSetHighlight): Don't unhighlight here. - -2000-01-22 Martin Buchholz <martin@xemacs.org> - - * *.h: Use consistent C-standards-approved guard macro names. - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.27 is released. - -2000-01-15 Andy Piper <andy@xemacs.org> - - * lwlib-Xlw.c (lw_update_one_widget): make sure global - properties gets set. - -2000-01-07 Martin Buchholz <martin@xemacs.org> - - * config.h.in (ATHENA_INCLUDE): CPP trickery to make old cpps happy. - This extends support for gcc 2.6 (e.g. on BSD/OS 2.0) - - * lwlib.c: Fix up memset calls. - - * lwlib-Xm.c (xm_update_text): Warning suppression. - (xm_update_text_field): Warning suppression. - -2000-01-03 Martin Buchholz <martin@xemacs.org> - - * lwlib-Xaw.c (xaw_update_one_widget): Emergency fix for this crash: - (yes-or-no-p-dialog-box "Yes or No") - -1999-12-31 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.26 is released. - -1999-12-29 Andy Piper <andy@xemacs.org> - - * xlwtabs.c (TabsHighlight): use displayChildren for highlighting - not num_children. - (TabsPage): ditto. - -1999-12-24 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.25 is released. - -1999-12-23 Andy Piper <andy@xemacs.org> - - * lwlib.c (lw_copy_widget_value_args): don't create empty - widget_args just because someone might use them later. This makes - all widgets look like they've changed. - -1999-12-22 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: Fix for X11R5 from Damon Lipparelli - <lipp@primus.com>. - -1999-12-21 Martin Buchholz <martin@xemacs.org> - - * xlwscrollbar.c (seg_pixel_sizes): ((expr)) ==> (expr) - -1999-12-12 Daniel Pittman <daniel@danann.net> - - * lwlib-Xaw.c: - * xlwcheckbox.c: - * xlwgauge.h: - * xlwgaugeP.h: - * xlwradio.c: - * xlwradio.h: - * xlwradioP.h: - Clean up Athena widget support: - - Athena headers now use dynamic include paths. - -1999-12-08 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: sync with Tabs 2.2. - * xlwtabP.h: ditto. - -1999-12-14 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.24 is released. - -1999-12-14 Andy Piper <andy@xemacs.org> - - * xlwtabs.c (TabsResize): reset need_layout so that we don't go - into infloop death. - -1999-12-14 Andy Piper <andy@xemacs.org> - - * xlwtabs.c (TabsSetValues): re-allocate GCs if font has changed. - -1999-12-13 Andy Piper <andy@xemacs.org> - - * xlwtabs.c (TabsResize): We need to expose the tabs after - clearing the window they are in. - -1999-12-08 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: sync with Tabs 2.1. - -1999-12-07 Andy Piper <andy@xemacs.org> - - * lwlib-Xlw.c (lw_lucid_widget_p): make sure we pick up the - clip-window as well. - -1999-12-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.23 is released. - -1999-12-05 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: back up to previous rev to make syncing easier. Fix - gcc moans. - - * lwlib-Xaw.c (xaw_update_one_widget): use XtIsSubclass. - -1999-11-29 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.21 is released. - -1999-11-26 Martin Buchholz <martin@xemacs.org> - - * xlwtabs.c: Remove unused variables. Fix warnings. - -1999-11-10 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.20 is released - -1999-09-09 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: updated tabs widget from Ed Falk. - * xlwtabs.h: ditto. - * xlwtabsP.h: ditto. - -1999-09-22 Martin Buchholz <martin@xemacs.org> - - * lwlib-internal.h: - * lwlib-utils.h: - Move declaration of destroy_all_children from lwlib-internal.h to - lwlib-utils.h, where it belongs. - -1999-09-21 Andy Piper <andy@xemacs.org> - - * lwlib-Xm.c (xm_update_label): don't clobber pixmap type labels - with text. - -1999-09-22 Martin Buchholz <martin@xemacs.org> - - * xlwtabs.c: Fix C++ compilability. - -1999-09-18 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: Put in tabs sync because clipping should fix useability - problems. - -1999-09-13 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: Back out tabs sync because of reported useability - problems. - -1999-09-09 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: updated tabs widget from Ed Falk. - * xlwtabs.h: ditto. - * xlwtabsP.h: ditto. - * xlwgcs.c: ditto. - * xlwgcs.h: ditto. - -1999-09-03 Martin Buchholz <martin@xemacs.org> - - * xlwgauge.c: Ansify. - Include <stdlib.h> 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, - so 5th parameter must be of type XtPointer, not XPointer. - (GaugeGetValue): This is a XtTimerCallbackProc, - so 2nd parameter must be of type XtIntervalId *, not XtIntervalId. - - -1999-09-01 Martin Buchholz <martin@xemacs.org> - - * lwlib.c (free_widget_value_contents): Use proper type for cast. - - * xlwradio.c: Use function prototypes everywhere. - * xlwcheckbox.c: - * xlwradio.c: - * xlwradioP.h: Move declarations of non-static functions defined - in xlwradio.c into xlwradioP.h. - -1999-09-02 Andy Piper <andy@xemacs.org> - - * xlwgcs.c: include xmu.h - -1999-09-01 Andy Piper <andy@xemacs.org> - - * xlwgauge.c: rearrange headers yet again. - * xlwcheckbox.c: ditto. - * xlwradio.c: ditto. - * xlwtabs.c: ditto. - -1999-09-01 Andy Piper <andy@xemacs.org> - - * xlwgauge.c: use xmu.h - * xlwcheckbox.c: ditto. - * xlwradio.c: ditto. - -1999-08-31 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: - * xlwgcs.c: - * xlwradio.c: - * xlwcheckbox.c: - * xlwgauge.c: Fix for losing systems without Xmu. - -1999-08-31 Andy Piper <andy@xemacs.org> - - * lwlib-Xm.c (xm_update_one_widget): fix for AIX compiler lossage. - -1999-08-30 Andy Piper <andy@xemacs.org> - - * lwlib.c (free_widget_value_contents): be more precise about - freeing user defined args. - - * lwlib-Xaw.c (xaw_update_one_widget): make sure we use val not - its contents for hierarchies one deep. - -1999-08-29 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: temporary fixes pending a new release. - * xlwtabsP.h: ditto. - - * lwlib-Xm.c (xm_update_one_widget): update user defined args. - (xm_create_label): set args after creation as well as before. - - * lwlib-Xlw.c (xlw_create_tab_control): orient tabs horizontally. - (xlw_update_tab_control): actually update the children rather than - the parent. - - * lwlib-Xaw.c (xaw_update_one_widget): update user defined args. - (xaw_create_label): set args after creation as well as before. - -1999-08-23 Andy Piper <andy@xemacs.org> - - * lwlib-Xm.c (xm_update_label): don't concatenate value to itself. - - * lwlib-Xm.c (xm_create_label_field): new function for creating labels. - (xm_creation_table): use it. - - * lwlib-Xaw.c (xaw_create_label_field): new function for creating labels. - (xaw_creation_table): use it. - -1999-08-16 Andy Piper <andy@xemacs.org> - - * lwlib.h: declare free_widget_value_tree. - - * lwlib.c (free_widget_value_tree): make non-static. - - * lwlib-Xm.c (xm_update_label): free val_string when updating. - -1999-08-04 Andy Piper <andy@xemacs.org> - - * lwlib-Xm.c (mark_dead_instance_destroyed): change so that its - defined for widgets. - (xm_nosel_callback): ditto. - - * xlwtabsP.h: sync with 1.5. - - * xlwtabs.c: sync with 1.18. - -1999-07-28 Andy Piper <andy@xemacs.org> - - * xlwtabs.c: new lucid tabs widget from Ed Falk. - * xlwtabs.h: ditto. - * xlwtabsP.h: ditto. - * xlwgcs.c: GC manipulation for tab widgets. - * xlwgcs.h: ditto. - - * xlwgauge.c: new athena gauge widget from Ed Falk. - * xlwgauge.h: ditto. - * xlwgaugeP.h: ditto. - - * xlwradio.c: new athena radio widget from Ed Falk. - * xlwradio.h: ditto. - * xlwradioP.h: ditto. - - * xlwcheckbox.c: new athena checkbox widget from Ed Falk. - * xlwcheckbox.h: ditto. - * xlwcheckboxP.h: ditto. - - * lwlib-utils.c (destroy_all_children): moved from lwlib-Xm.c. - - * lwlib-internal.h: declare destroy_all_children. - - * lwlib-config.c: add widget checks. - - * lwlib-Xm.h: declare xm_create_label; - - * lwlib-Xm.c (destroy_all_children): move to lwlib-utils.c. - (xm_update_label): enable for widgets. - (xm_update_one_widget): ditto. - (xm_create_button): rename in line with lwlib-Xaw.c - (xm_create_progress): ditto. - (xm_create_text_field): ditto. - (xm_create_combo_box): ditto. - (xm_create_label): new function. - (xm_creation_table): rename widget creation functions. - (xm_destroy_instance): enable for widgets. - (xm_generic_callback): ditto. - (xm_generic_callback): ditto. - - * lwlib-Xlw.c (xlw_tab_control_callback): new function. a special - callback that calls the correct function depending on what tab is - selected. - (xlw_create_tab_control): new function. - (build_tabs_in_widget): new function. puts tabs in a tab widget, - uses Xaw or Xm depending on how XEmacs was compiled. - (xlw_update_tab_control): update the resources for each - tab. optionally rebuild the contents of the tab widget. - (xlw_creation_table): add tab widget creation function. - (lw_lucid_widget_p): add tab widget. - (xlw_update_one_widget): ditto. - - * lwlib-Xaw.h: declare xaw_create_label; - - * lwlib-Xaw.c (lw_xaw_widget_p): add widgets classes. - (xaw_update_one_widget): ditto. - (xaw_update_one_value): add code from the Xm version. - (xaw_generic_callback): add Xm hack for setting command - states. beef up lookup of call data. - (xaw_create_button): new function. - (xaw_create_label): new function for use by tab widget. - (xaw_create_progress): new function. - (xaw_create_text_field): new function. - (xaw_creation_table): add new widget type creation functions. - - * Makefile.in.in: add dependencies for new lw widgets. - -1999-07-30 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.19 is released - -1999-07-13 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.18 is released - -1999-07-05 Didier Verna <didier@xemacs.org> - - * lwlib-Xm.c (xm_update_one_widget): add missing #ifdefs around - call to xm_update_label. - -1999-06-28 Andy Piper <andy@xemacs.org> - - * lwlib-Xm.c: unconditionally enable text field & list code. - (make_progress): new function. creates a slider. - (make_text_field): new function. creates an edit field. - (make_combo_box): new function. creates a combo box. - (xm_creation_table): add new widget functions. - -1999-06-25 Andy Piper <andy@xemacs.org> - - * lwlib.h (_widget_value): add arglist slots. - declare new functions. - - * lwlib.c (free_widget_value_contents): handle arglists when - freeing. - (lw_add_value_args_to_args): new function. add arglist entries - from a widget_value structure. - - * lwlib-Xm.c (make_button): new function, create a motif button - for display in a buffer as a glyph. - (xm_creation_table): add make_button. - -1999-06-22 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.17 is released - -1999-06-11 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.16 is released - -1999-06-04 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.15 is released - -1999-05-17 Jerry James <jerry@cs.ucsb.edu> - - * xlwmenu.c (make_shadow_gcs): Test bottom_shadow_pixmap before - using it. - 1999-05-14 XEmacs Build Bot <builds@cvs.xemacs.org> * XEmacs 21.2.14 is released diff -r 12e008d41344 -r 697ef44129c6 lwlib/Makefile.in.in --- a/lwlib/Makefile.in.in Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/Makefile.in.in Mon Aug 13 11:20:41 2007 +0200 @@ -95,18 +95,11 @@ ## Following correct as of 19980312 -lwlib-Xaw.o: $(CONFIG_H) lwlib-Xaw.h lwlib-internal.h lwlib.h xlwmenu.h xlwradio.h \ -xlwgauge.h xlwcheckbox.h -lwlib-Xlw.o: $(CONFIG_H) lwlib-Xlw.h lwlib-internal.h lwlib.h xlwmenu.h xlwscrollbar.h \ -xlwtabs.h xlwgcs.h +lwlib-Xaw.o: $(CONFIG_H) lwlib-Xaw.h lwlib-internal.h lwlib.h xlwmenu.h +lwlib-Xlw.o: $(CONFIG_H) lwlib-Xlw.h lwlib-internal.h lwlib.h xlwmenu.h xlwscrollbar.h lwlib-Xm.o: $(CONFIG_H) lwlib-Xm.h lwlib-internal.h lwlib-utils.h lwlib.h xlwmenu.h lwlib-config.o: $(CONFIG_H) lwlib.h xlwmenu.h lwlib-utils.o: $(CONFIG_H) lwlib-utils.h lwlib.o: $(CONFIG_H) lwlib-Xaw.h lwlib-Xlw.h lwlib-Xm.h lwlib-internal.h lwlib-utils.h lwlib.h xlwmenu.h xlwmenu.o: $(CONFIG_H) lwlib.h xlwmenu.h xlwmenuP.h xlwscrollbar.o: $(CONFIG_H) xlwscrollbar.h xlwscrollbarP.h -xlwtabs.o: $(CONFIG_H) xlwtabs.h xlwtabsP.h -xlwradio.o: $(CONFIG_H) xlwradio.h xlwradioP.h -xlwcheckbox.o: $(CONFIG_H) xlwcheckbox.h xlwcheckboxP.h -xlwgauge.o: $(CONFIG_H) xlwgauge.h xlwgaugeP.h -xlwgcs.o: $(CONFIG_H) xlwgcs.h diff -r 12e008d41344 -r 697ef44129c6 lwlib/config.h.in --- a/lwlib/config.h.in Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/config.h.in Mon Aug 13 11:20:41 2007 +0200 @@ -29,18 +29,4 @@ #undef NEED_ATHENA #undef NEED_LUCID -/* The exact path to the Athena header files depends on which `flavor' - of Athena is being used - hence configure defines them for us. */ - -#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 12e008d41344 -r 697ef44129c6 lwlib/lwlib-Xaw.c --- a/lwlib/lwlib-Xaw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-Xaw.c Mon Aug 13 11:20:41 2007 +0200 @@ -33,23 +33,15 @@ #include <X11/Shell.h> #ifdef LWLIB_SCROLLBARS_ATHENA -#include ATHENA_Scrollbar_h_ +#include <X11/Xaw/Scrollbar.h> #endif #ifdef LWLIB_DIALOGS_ATHENA -#include ATHENA_Dialog_h_ -#include ATHENA_Form_h_ -#include ATHENA_Command_h_ -#include ATHENA_Label_h_ +#include <X11/Xaw/Dialog.h> +#include <X11/Xaw/Form.h> +#include <X11/Xaw/Command.h> +#include <X11/Xaw/Label.h> #endif -#ifdef LWLIB_WIDGETS_ATHENA -#include ATHENA_Toggle_h_ -#include "xlwradio.h" -#include "xlwcheckbox.h" -#include "xlwgauge.h" -#ifndef NEED_MOTIF -#include ATHENA_AsciiText_h_ -#endif -#endif + #include <X11/Xatom.h> static void xaw_generic_callback (Widget, XtPointer, XtPointer); @@ -65,14 +57,6 @@ #ifdef LWLIB_DIALOGS_ATHENA || XtIsSubclass (widget, dialogWidgetClass) #endif -#ifdef LWLIB_WIDGETS_ATHENA - || XtIsSubclass (widget, labelWidgetClass) - || XtIsSubclass (widget, toggleWidgetClass) - || XtIsSubclass (widget, gaugeWidgetClass) -#ifndef NEED_MOTIF - || XtIsSubclass (widget, asciiTextWidgetClass) -#endif -#endif ); } @@ -134,13 +118,6 @@ 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)) { @@ -148,16 +125,6 @@ XtSetArg (al [0], XtNlabel, val->contents->value); XtSetValues (widget, al, 1); } -#endif /* LWLIB_DIALOGS_ATHENA */ -#ifdef LWLIB_WIDGETS_ATHENA - else if (XtClass (widget) == labelWidgetClass) - { - Arg al [1]; - XtSetArg (al [0], XtNlabel, val->value); - XtSetValues (widget, al, 1); - } -#endif /* LWLIB_WIDGETS_ATHENA */ -#if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA) else if (XtIsSubclass (widget, commandWidgetClass)) { Dimension bw = 0; @@ -187,63 +154,17 @@ XtRemoveAllCallbacks (widget, XtNcallback); XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance); -#ifdef LWLIB_WIDGETS_ATHENA - /* set the selected state */ - if (XtIsSubclass (widget, toggleWidgetClass)) - { - XtSetArg (al [0], XtNstate, val->selected); - XtSetValues (widget, al, 1); - } -#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 xaw_update_one_value (widget_instance *instance, Widget widget, widget_value *val) { -#ifdef LWLIB_WIDGETS_ATHENA - widget_value *old_wv; - - /* copy the call_data slot into the "return" widget_value */ - for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next) - if (!strcmp (val->name, old_wv->name)) - { - val->call_data = old_wv->call_data; - break; - } - - if (XtIsSubclass (widget, toggleWidgetClass)) - { - Arg al [1]; - XtSetArg (al [0], XtNstate, &val->selected); - XtGetValues (widget, al, 1); - val->edited = True; - } -#ifndef NEED_MOTIF - else if (XtIsSubclass (widget, asciiTextWidgetClass)) - { - Arg al [2]; - String buf = 0; - XtSetArg (al [0], XtNstring, &buf); - XtGetValues (widget, al, 1); - - if (val->value) - { - free (val->value); - val->value = 0; - } - /* I don't think this causes a leak. */ - if (buf) - val->value = strdup (buf); - val->edited = True; - } -#endif -#endif /* LWLIB_WIDGETS_ATHENA */ + /* This function is not used by the scrollbars and those are the only + Athena widget implemented at the moment so do nothing. */ + return; } void @@ -344,8 +265,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) @@ -453,8 +374,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; @@ -519,21 +440,7 @@ Widget instance_widget; LWLIB_ID id; XtPointer user_data; -#ifdef LWLIB_WIDGETS_ATHENA - /* We want the selected status to change only when we decide it - should change. Yuck but correct. */ - if (XtIsSubclass (widget, toggleWidgetClass)) - { - Boolean check; - Arg al [1]; - XtSetArg (al [0], XtNstate, &check); - XtGetValues (widget, al, 1); - - XtSetArg (al [0], XtNstate, !check); - XtSetValues (widget, al, 1); - } -#endif /* LWLIB_WIDGETS_ATHENA */ lw_internal_update_other_instances (widget, closure, call_data); if (! instance) @@ -557,26 +464,17 @@ #else /* Damn! Athena doesn't give us a way to hang our own data on the buttons, so we have to go find it... I guess this assumes that - all instances of a button have the same call data. - - ... Which is a totally bogus assumption --andyp */ + all instances of a button have the same call data. */ { - widget_value *val = instance->info->val; - /* If the widget is a buffer/gutter widget then we already have - the one we are looking for, so don't try and descend the widget - tree. */ - if (val->contents) + widget_value *val = instance->info->val->contents; + char *name = XtName (widget); + while (val) { - char *name = XtName (widget); - val = val->contents; - while (val) - { - if (val->name && !strcmp (val->name, name)) - break; - val = val->next; - } - if (! val) abort (); + if (val->name && !strcmp (val->name, name)) + break; + val = val->next; } + if (! val) abort (); user_data = val->call_data; } #endif @@ -716,184 +614,12 @@ } #endif /* LWLIB_SCROLLBARS_ATHENA */ -#ifdef LWLIB_WIDGETS_ATHENA -/* glyph widgets */ -static Widget -xaw_create_button (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget button = 0; - widget_value* val = instance->info->val; - - XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; - XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; - XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++; - /* The highlight doesn't appear to be dynamically set which makes it - look ugly. I think this may be a LessTif bug but for now we just - get rid of it. */ - XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - if (!val->call_data) - button = XtCreateManagedWidget (val->name, labelWidgetClass, - instance->parent, al, ac); - - else - { - if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) - { - XtSetArg (al [ac], XtNstate, val->selected); ac++; - button = XtCreateManagedWidget - (val->name, - val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass, - instance->parent, al, ac); - } - else - { - button = XtCreateManagedWidget (val->name, commandWidgetClass, - instance->parent, al, ac); - } - XtRemoveAllCallbacks (button, XtNcallback); - XtAddCallback (button, XtNcallback, xaw_generic_callback, (XtPointer)instance); - } - - XtManageChild (button); - - return button; -} - -static Widget -xaw_create_label_field (widget_instance *instance) -{ - return xaw_create_label (instance->parent, instance->info->val); -} - -Widget -xaw_create_label (Widget parent, widget_value* val) -{ - Arg al[20]; - int ac = 0; - Widget label = 0; - - XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; - XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; - XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - label = XtCreateManagedWidget (val->name, labelWidgetClass, - parent, al, ac); - - /* 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; -} - -static Widget -xaw_create_progress (widget_instance *instance) -{ - Arg al[20]; - 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++; - } - else - { - 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++; - XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - scale = XtCreateManagedWidget (val->name, gaugeWidgetClass, - instance->parent, al, ac); - /* add the callback */ - if (val->call_data) - XtAddCallback (scale, XtNgetValue, xaw_generic_callback, (XtPointer)instance); - - XtManageChild (scale); - - return scale; -} - -#ifndef NEED_MOTIF -#define TEXT_BUFFER_SIZE 128 -static Widget -xaw_create_text_field (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget text = 0; - widget_value* val = instance->info->val; - - 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 xaw_creation_table [] = { #ifdef LWLIB_SCROLLBARS_ATHENA - {"vertical-scrollbar", xaw_create_vertical_scrollbar }, - {"horizontal-scrollbar", xaw_create_horizontal_scrollbar }, -#endif -#ifdef LWLIB_WIDGETS_ATHENA - {"button", xaw_create_button }, - { "label", xaw_create_label_field }, -#ifndef NEED_MOTIF - {"text-field", xaw_create_text_field }, -#endif - {"progress", xaw_create_progress }, + {"vertical-scrollbar", xaw_create_vertical_scrollbar}, + {"horizontal-scrollbar", xaw_create_horizontal_scrollbar}, #endif {NULL, NULL} }; - diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-Xaw.h --- a/lwlib/lwlib-Xaw.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-Xaw.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ -#ifndef INCLUDED_lwlib_Xaw_h_ -#define INCLUDED_lwlib_Xaw_h_ +#ifndef LWLIB_XAW_H +#define LWLIB_XAW_H #include "lwlib-internal.h" @@ -8,9 +8,6 @@ Widget xaw_create_dialog (widget_instance* instance); -Widget -xaw_create_label (Widget parent, widget_value* val); - Boolean lw_xaw_widget_p (Widget widget); @@ -31,4 +28,4 @@ void xaw_pop_instance (widget_instance* instance, Boolean up); -#endif /* INCLUDED_lwlib_Xaw_h_ */ +#endif /* LWLIB_XAW_H */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-Xlw.c --- a/lwlib/lwlib-Xlw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-Xlw.c Mon Aug 13 11:20:41 2007 +0200 @@ -20,35 +20,20 @@ #include <config.h> #include <stdlib.h> /* for abort () */ -#include <stdio.h> /* for abort () */ #include <limits.h> #include "lwlib-Xlw.h" -#include "lwlib-utils.h" #include <X11/StringDefs.h> #include <X11/IntrinsicP.h> #include <X11/ObjectP.h> #include <X11/CompositeP.h> #include <X11/Shell.h> -#ifdef HAVE_WIDGETS -#include "../src/EmacsManager.h" -#endif #ifdef LWLIB_MENUBARS_LUCID #include "xlwmenu.h" #endif #ifdef LWLIB_SCROLLBARS_LUCID #include "xlwscrollbar.h" #endif -#ifdef LWLIB_TABS_LUCID -#ifdef NEED_MOTIF -#include "lwlib-Xm.h" -#endif -#ifdef NEED_ATHENA -#include "lwlib-Xaw.h" -#endif -#include "../src/xmu.h" -#include "xlwtabs.h" -#endif @@ -316,172 +301,6 @@ #endif /* LWLIB_SCROLLBARS_LUCID */ -#ifdef LWLIB_TABS_LUCID -/* tab control - - lwlib is such an incredible hairy crock. I just cannot believe - it! There are random dependencies between functions, there is a - total lack of genericity, even though it initially appears to be - generic. It should all be junked and begun again. Building tabs are - an example - in theory we should be able to reuse a lot of the - general stuff because we want to put labels of whatever toolkit we - are using in the tab. Instead we have to hack it by hand. */ -static void -xlw_tab_control_callback (Widget w, XtPointer client_data, XtPointer call_data) -{ - /* call data is the topmost widget */ - widget_instance* instance = (widget_instance*)client_data; - Widget top = (Widget)call_data; - char *name = XtName (top); - widget_value* widget_val; - XtPointer widget_arg; - LWLIB_ID id; - lw_callback post_activate_cb; - - if (w->core.being_destroyed) - return; - - /* Grab these values before running any functions, in case running - the selection_cb causes the widget to be destroyed. */ - id = instance->info->id; - post_activate_cb = instance->info->post_activate_cb; - - /* search for the widget_val for the selected tab */ - for (widget_val = instance->info->val->contents; widget_val; - widget_val = widget_val->next) - { - if (!strcmp (widget_val->name, name)) - break; - } - - widget_arg = widget_val ? widget_val->call_data : NULL; - - if (instance->info->selection_cb && - widget_val && - widget_val->enabled && - !widget_val->contents) - instance->info->selection_cb (w, id, widget_arg); - - if (post_activate_cb) - post_activate_cb (w, id, widget_arg); -} - -static Widget -xlw_create_tab_control (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget tab = 0; - widget_value* val = instance->info->val; - - XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; - XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; - XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; - XtSetArg (al [ac], XtNresizable, False); ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - tab = XtCreateManagedWidget (val->name, tabsWidgetClass, - instance->parent, al, ac); - XtRemoveAllCallbacks (tab, XtNcallback); - XtAddCallback (tab, XtNcallback, xlw_tab_control_callback, (XtPointer)instance); - - XtManageChild (tab); - - return tab; -} - -static void build_tabs_in_widget (widget_instance* instance, Widget widget, - widget_value* val) -{ - widget_value* cur = val; - for (cur = val; cur; cur = cur->next) - { - if (cur->value) - { -#ifdef LWLIB_WIDGETS_MOTIF - xm_create_label (widget, cur); -#else - xaw_create_label (widget, cur); -#endif - } - cur->change = NO_CHANGE; - } -} - -static void -xlw_update_tab_control (widget_instance* instance, Widget widget, widget_value* val) -{ - Widget* children; - unsigned int num_children; - int i; - widget_value *cur = 0; - - XtRemoveAllCallbacks (widget, XtNcallback); - XtAddCallback (widget, XtNcallback, xlw_tab_control_callback, (XtPointer)instance); - - if (val->change == STRUCTURAL_CHANGE - || - (val->contents && val->contents->change == STRUCTURAL_CHANGE)) - { - destroy_all_children (widget); - build_tabs_in_widget (instance, widget, val->contents); - } - - children = XtCompositeChildren (widget, &num_children); - if (children) - { - for (i = 0, cur = val->contents; i < num_children; i++) - { - if (!cur) - abort (); - if (children [i]->core.being_destroyed - || strcmp (XtName (children [i]), cur->name)) - continue; -#ifdef NEED_MOTIF - if (lw_motif_widget_p (children [i])) - xm_update_one_widget (instance, children [i], cur, False); -#endif -#ifdef NEED_ATHENA - if (lw_xaw_widget_p (children [i])) - xaw_update_one_widget (instance, children [i], cur, False); -#endif - cur = cur->next; - } - XtFree ((char *) children); - } - if (cur) - abort (); -} -#endif /* LWLIB_TABS_LUCID */ - -#ifdef HAVE_WIDGETS -static Widget -xlw_create_clip_window (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget clip = 0; - widget_value* val = instance->info->val; - - XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; - XtSetArg (al [ac], XtNsensitive, TRUE); ac++; - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - /* Create a clip window to contain the subwidget. Incredibly the - XEmacs manager seems to be the most appropriate widget for - this. Nothing else is simple enough and yet does what is - required. */ - clip = XtCreateManagedWidget (val->name, - emacsManagerWidgetClass, - instance->parent, al, ac); - - return clip; -} -#endif - widget_creation_entry xlw_creation_table [] = { @@ -493,12 +312,6 @@ {"vertical-scrollbar", xlw_create_vertical_scrollbar}, {"horizontal-scrollbar", xlw_create_horizontal_scrollbar}, #endif -#ifdef LWLIB_TABS_LUCID - {"tab-control", xlw_create_tab_control}, -#endif -#ifdef HAVE_WIDGETS - {"clip-window", xlw_create_clip_window}, -#endif {NULL, NULL} }; @@ -514,20 +327,12 @@ if (the_class == xlwScrollBarWidgetClass) return True; #endif -#ifdef LWLIB_TABS_LUCID - if (the_class == tabsWidgetClass) - return True; -#endif #ifdef LWLIB_MENUBARS_LUCID if (the_class == overrideShellWidgetClass) return XtClass (((CompositeWidget)widget)->composite.children [0]) == xlwMenuWidgetClass; #endif -#ifdef HAVE_WIDGETS - if (the_class == emacsManagerWidgetClass) - return True; -#endif return False; } @@ -535,7 +340,9 @@ xlw_update_one_widget (widget_instance* instance, Widget widget, widget_value* val, Boolean deep_p) { - WidgetClass class = XtClass (widget); + WidgetClass class; + + class = XtClass (widget); if (0) ; @@ -558,15 +365,6 @@ xlw_update_scrollbar (instance, widget, val); } #endif -#ifdef LWLIB_TABS_LUCID - else if (class == tabsWidgetClass) - { - 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 12e008d41344 -r 697ef44129c6 lwlib/lwlib-Xm.c --- a/lwlib/lwlib-Xm.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-Xm.c Mon Aug 13 11:20:41 2007 +0200 @@ -4,13 +4,13 @@ This file is part of the Lucid Widget Library. -The Lucid Widget Library is free software; you can redistribute it and/or +The Lucid Widget Library 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. The Lucid Widget Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of +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. @@ -60,23 +60,17 @@ #include <Xm/Separator.h> #include <Xm/DialogS.h> #include <Xm/Form.h> -#ifdef LWLIB_WIDGETS_MOTIF -#include <Xm/Scale.h> -#if XmVERSION > 1 -#include <Xm/ComboBoxP.h> -#endif -#endif #ifdef LWLIB_MENUBARS_MOTIF static void xm_pull_down_callback (Widget, XtPointer, XtPointer); +#if 0 +static void xm_pop_down_callback (Widget, XtPointer, XtPointer); +#endif /* 0 */ #endif static void xm_internal_update_other_instances (Widget, XtPointer, XtPointer); -static void xm_pop_down_callback (Widget, XtPointer, XtPointer); static void xm_generic_callback (Widget, XtPointer, XtPointer); -static void mark_dead_instance_destroyed (Widget widget, XtPointer closure, - XtPointer call_data); -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) +#ifdef LWLIB_DIALOGS_MOTIF static void xm_nosel_callback (Widget, XtPointer, XtPointer); #endif #ifdef LWLIB_SCROLLBARS_MOTIF @@ -90,7 +84,7 @@ #endif /* Structures to keep destroyed instances */ -typedef struct _destroyed_instance +typedef struct _destroyed_instance { char* name; char* type; @@ -130,7 +124,7 @@ instance->next = NULL; return instance; } - + static void free_destroyed_instance (destroyed_instance* instance) { @@ -149,7 +143,7 @@ Boolean lw_motif_widget_p (Widget widget) { - return + return #ifdef LWLIB_DIALOGS_MOTIF XtClass (widget) == xmDialogShellWidgetClass || #endif @@ -161,7 +155,7 @@ { XtResource resource; char *result = NULL; - + resource.resource_name = "labelString"; resource.resource_class = "LabelString"; /* #### should be Xmsomething... */ resource.resource_type = XtRString; @@ -175,6 +169,35 @@ return result; } +#ifdef LWLIB_MENUBARS_MOTIF + +static void +destroy_all_children (Widget widget) +{ + Widget* children; + unsigned int number; + int i; + + children = XtCompositeChildren (widget, &number); + if (children) + { + /* Unmanage all children and destroy them. They will only be + * really destroyed when we get out of DispatchEvent. */ + for (i = 0; i < number; i++) + { + Widget child = children [i]; + if (!child->core.being_destroyed) + { + XtUnmanageChild (child); + XtDestroyWidget (child); + } + } + XtFree ((char *) children); + } +} + +#endif /* LWLIB_MENUBARS_MOTIF */ + #ifdef LWLIB_DIALOGS_MOTIF @@ -196,7 +219,7 @@ #endif /* LWLIB_DIALOGS_MOTIF */ -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) /* update the label of anything subclass of a label */ static void @@ -208,14 +231,6 @@ XmString name_string = NULL; Arg al [20]; int ac = 0; - int type; - - /* Don't clobber pixmap types. */ - XtSetArg (al [0], XmNlabelType, &type); - XtGetValues (widget, al, 1); - - if (type == XmPIXMAP) - return; if (val->value) { @@ -245,36 +260,30 @@ char *res_name = NULL; res_name = resource_string (widget, val->name); - /* Concatenating the value with itself seems just plain daft. */ if (!res_name) - { - built_string = - XmStringCreateLtoR (val->value, XmSTRING_DEFAULT_CHARSET); - } - else - { - 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); - } + res_name = val->name; + + 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); } XtSetArg (al [ac], XmNlabelString, built_string); ac++; XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++; } - + if (val->key) { key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET); @@ -292,9 +301,6 @@ if (name_string) XmStringFree (name_string); - - if (val_string) - XmStringFree (val_string); } #endif /* defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) */ @@ -357,7 +363,7 @@ XtRemoveAllCallbacks (widget, XmNcascadingCallback); XtAddCallback (widget, XmNcascadingCallback, xm_pull_down_callback, instance); - } + } } #endif /* LWLIB_MENUBARS_MOTIF */ @@ -372,7 +378,7 @@ instance); XtSetArg (al [0], XmNset, val->selected); XtSetArg (al [1], XmNalignment, XmALIGNMENT_BEGINNING); - XtSetValues (widget, al, 1); + XtSetValues (widget, al, 2); } static void @@ -417,29 +423,6 @@ } } -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 -/* update of combo box */ -static void -xm_update_combo_box (widget_instance* instance, Widget widget, widget_value* val) -{ - widget_value* cur; - int i; - XtRemoveAllCallbacks (widget, XmNselectionCallback); - XtAddCallback (widget, XmNselectionCallback, xm_generic_callback, - instance); - for (cur = val->contents, i = 0; cur; cur = cur->next) - if (cur->value) - { - XmString xmstr = XmStringCreate (cur->value, XmSTRING_DEFAULT_CHARSET); - i += 1; - XmListAddItem (CB_List (widget), xmstr, 0); - if (cur->selected) - XmListSelectPos (CB_List (widget), i, False); - XmStringFree (xmstr); - } -} -#endif - #ifdef LWLIB_MENUBARS_MOTIF /* update a popup menu, pulldown menu or a menubar */ @@ -476,7 +459,7 @@ num_children = 0; for (child_index = 0, cur = val; cur; child_index++, cur = cur->next) - { + { ac = 0; button = 0; XtSetArg (al [ac], XmNsensitive, cur->enabled); ac++; @@ -594,7 +577,7 @@ menu = NULL; XtSetArg (al [0], XmNsubMenuId, &menu); XtGetValues (widget, al, 1); - + contents = val->contents; if (!menu) @@ -675,12 +658,14 @@ #endif /* LWLIB_MENUBARS_MOTIF */ +#ifdef LWLIB_DIALOGS_MOTIF + /* update text widgets */ static void xm_update_text (widget_instance* instance, Widget widget, widget_value* val) { - XmTextSetString (widget, val->value ? val->value : (char *) ""); + XmTextSetString (widget, val->value ? val->value : ""); XtRemoveAllCallbacks (widget, XmNactivateCallback); XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); @@ -692,7 +677,7 @@ xm_update_text_field (widget_instance* instance, Widget widget, widget_value* val) { - XmTextFieldSetString (widget, val->value ? val->value : (char *) ""); + XmTextFieldSetString (widget, val->value ? val->value : ""); XtRemoveAllCallbacks (widget, XmNactivateCallback); XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); @@ -700,6 +685,7 @@ xm_internal_update_other_instances, instance); } +#endif /* LWLIB_DIALOGS_MOTIF */ #ifdef LWLIB_SCROLLBARS_MOTIF @@ -782,22 +768,22 @@ widget_value* val, Boolean deep_p) { WidgetClass class; - Arg al [20]; - int ac = 0; - + Arg al [2]; + /* Mark as not edited */ val->edited = False; /* Common to all widget types */ - XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; - XtSetArg (al [ac], XmNuserData, val->call_data); ac++; - XtSetValues (widget, al, ac); + XtSetArg (al [0], XmNsensitive, val->enabled); + XtSetArg (al [1], XmNuserData, val->call_data); + XtSetValues (widget, al, 2); -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) /* Common to all label like widgets */ if (XtIsSubclass (widget, xmLabelWidgetClass)) xm_update_label (instance, widget, val); #endif + class = XtClass (widget); /* Class specific things */ if (class == xmPushButtonWidgetClass || @@ -822,7 +808,7 @@ XtSetArg (al [0], XmNradioBehavior, &radiobox); XtGetValues (widget, al, 1); - + if (radiobox) xm_update_radiobox (instance, widget, val); #ifdef LWLIB_MENUBARS_MOTIF @@ -830,6 +816,7 @@ xm_update_menu (instance, widget, val, deep_p); #endif } +#ifdef LWLIB_DIALOGS_MOTIF else if (class == xmTextWidgetClass) { xm_update_text (instance, widget, val); @@ -838,25 +825,17 @@ { xm_update_text_field (instance, widget, val); } +#endif else if (class == xmListWidgetClass) { xm_update_list (instance, widget, val); } -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - else if (class == xmComboBoxWidgetClass) - { - xm_update_combo_box (instance, widget, val); - } -#endif #ifdef LWLIB_SCROLLBARS_MOTIF else if (class == xmScrollBarWidgetClass) { 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 */ @@ -874,7 +853,7 @@ val->call_data = old_wv->call_data; break; } - + if (class == xmToggleButtonWidgetClass || class == xmToggleButtonGadgetClass) { Arg al [1]; @@ -882,6 +861,7 @@ XtGetValues (widget, al, 1); val->edited = True; } +#ifdef LWLIB_DIALOGS_MOTIF else if (class == xmTextWidgetClass) { if (val->value) @@ -896,6 +876,7 @@ val->value = XmTextFieldGetString (widget); val->edited = True; } +#endif else if (class == xmRowColumnWidgetClass) { Boolean radiobox = 0; @@ -927,20 +908,11 @@ val->edited = True; } } - else if (class == xmListWidgetClass -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - || class == xmComboBoxWidgetClass -#endif - ) + else if (class == xmListWidgetClass) { int pos_cnt; int* pos_list; - Widget list = widget; -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - if (class == xmComboBoxWidgetClass) - list = CB_List (widget); -#endif - if (XmListGetSelectedPos (list, &pos_list, &pos_cnt)) + if (XmListGetSelectedPos (widget, &pos_list, &pos_cnt)) { int i; widget_value* cur; @@ -974,7 +946,7 @@ /* This function is for activating a button from a program. It's wrong because we pass a NULL argument in the call_data which is not Motif compatible. This is used from the XmNdefaultAction callback of the List widgets to - have a double-click put down a dialog box like the button would do. + have a dble-click put down a dialog box like the button woudl do. I could not find a way to do that with accelerators. */ static void @@ -1024,7 +996,7 @@ /* This is a kludge to disable drag-and-drop in dialog boxes. The symptom was a segv down in libXm somewhere if you used the middle button on a dialog box to begin a drag; when you released the button to make a drop - things would lose if you were not over the button where you started the + things would lose if you were not over the button where you started the drag (canceling the operation). This was probably due to the fact that the dialog boxes were not set up to handle a drag but were trying to do so anyway for some reason. @@ -1039,7 +1011,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) { @@ -1057,7 +1029,7 @@ Arg al[64]; /* Arg List */ int ac; /* Arg Count */ int i; - + #ifdef DND_KLUDGE XtTranslations dnd_override = XtParseTranslationTable (disable_dnd_trans); # define DO_DND_KLUDGE(widget) XtOverrideTranslations ((widget), dnd_override) @@ -1105,7 +1077,7 @@ XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(al[ac], XmNrightOffset, 13); ac++; row = XmCreateRowColumn (form, "row", al, ac); - + n_children = 0; for (i = 0; i < left_buttons; i++) { @@ -1147,7 +1119,7 @@ al, ac); DO_DND_KLUDGE (children [n_children]); n_children++; - + for (i = 0; i < right_buttons; i++) { char button_name [16]; @@ -1159,9 +1131,9 @@ if (! button) button = children [n_children]; n_children++; } - + XtManageChildren (children, n_children); - + ac = 0; XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; @@ -1260,7 +1232,7 @@ list activate the default button */ XtAddCallback (value, XmNdefaultActionCallback, activate_button, button); } - + ac = 0; XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; @@ -1276,7 +1248,7 @@ XtSetArg(al[ac], XmNrightOffset, 13); ac++; message = XmCreateLabel (form, "message", al, ac); DO_DND_KLUDGE (message); - + if (list) XtManageChild (value); @@ -1291,7 +1263,7 @@ children [i] = icon; i++; children [i] = icon_separator; i++; XtManageChildren (children, i); - + if (text_input_slot || list) { XtInstallAccelerators (value, button); @@ -1302,7 +1274,7 @@ XtInstallAccelerators (form, button); XmProcessTraversal(value, XmTRAVERSE_CURRENT); } - + #ifdef DND_KLUDGE XtFree ((char *) dnd_override); #endif @@ -1349,6 +1321,14 @@ } static void +mark_dead_instance_destroyed (Widget widget, XtPointer closure, + XtPointer call_data) +{ + destroyed_instance* instance = (destroyed_instance*)closure; + instance->widget = NULL; +} + +static void recenter_widget (Widget widget) { Widget parent = XtParent (widget); @@ -1373,7 +1353,7 @@ x = (Position) ((parent_width - child_width) / 2); y = (Position) ((parent_height - child_height) / 2); - + XtTranslateCoords (parent, x, y, &x, &y); if ((Dimension) (x + child_width) > screen_width) @@ -1439,8 +1419,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; @@ -1486,7 +1466,7 @@ shell_name = "Question"; break; } - + total_buttons = name [1] - '0'; if (name [3] == 'T' || name [3] == 't') @@ -1496,9 +1476,9 @@ } else if (name [3]) right_buttons = name [4] - '0'; - + left_buttons = total_buttons - right_buttons; - + widget = make_dialog (name, parent, pop_up_p, shell_name, icon_name, text_input_slot, radio_box, list, left_buttons, right_buttons); @@ -1557,7 +1537,7 @@ { {xm_scrollbar_callback, NULL}, {NULL, NULL} }; callbacks[0].closure = (XtPointer) instance; - + XtSetArg (al[ac], XmNminimum, 1); ac++; XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++; XtSetArg (al[ac], XmNincrement, 1); ac++; @@ -1591,199 +1571,10 @@ #endif /* LWLIB_SCROLLBARS_MOTIF */ -#ifdef LWLIB_WIDGETS_MOTIF -/* glyph widgets */ -static Widget -xm_create_button (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget button = 0; - widget_value* val = instance->info->val; - - 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++; - /* The highlight doesn't appear to be dynamically set which makes it - look ugly. I think this may be a LessTif bug but for now we just - get rid of it. */ - XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - if (!val->call_data) - button = XmCreateLabel (instance->parent, val->name, al, ac); - - else if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) - { - XtSetArg (al [ac], XmNset, val->selected); ac++; - XtSetArg (al [ac], XmNindicatorType, - (val->type == TOGGLE_TYPE ? - XmN_OF_MANY : XmONE_OF_MANY)); ac++; - XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++; - button = XmCreateToggleButton (instance->parent, val->name, al, ac); - XtRemoveAllCallbacks (button, XmNvalueChangedCallback); - XtAddCallback (button, XmNvalueChangedCallback, xm_generic_callback, - (XtPointer)instance); - } - else - { - button = XmCreatePushButton (instance->parent, val->name, al, ac); - XtAddCallback (button, XmNactivateCallback, xm_generic_callback, - (XtPointer)instance); - } - - XtManageChild (button); - - return button; -} - -static Widget -xm_create_progress (widget_instance *instance) -{ - Arg al[20]; - 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++; - } - else - { - 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++; - XtSetArg (al [ac], XmNorientation, XmHORIZONTAL); ac++; - /* The highlight doesn't appear to be dynamically set which makes it - look ugly. I think this may be a LessTif bug but for now we just - get rid of it. */ - XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - scale = XmCreateScale (instance->parent, val->name, al, ac); - if (val->call_data) - XtAddCallback (scale, XmNvalueChangedCallback, xm_generic_callback, - (XtPointer)instance); - - XtManageChild (scale); - - return scale; -} - -static Widget -xm_create_text_field (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget text = 0; - widget_value* val = instance->info->val; - - 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++; - /* The highlight doesn't appear to be dynamically set which makes it - look ugly. I think this may be a LessTif bug but for now we just - get rid of it. */ - XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - text = XmCreateTextField (instance->parent, val->name, al, ac); - if (val->call_data) - XtAddCallback (text, XmNvalueChangedCallback, xm_generic_callback, - (XtPointer)instance); - - XtManageChild (text); - - return text; -} - -static Widget -xm_create_label_field (widget_instance *instance) -{ - return xm_create_label (instance->parent, instance->info->val); -} - -Widget -xm_create_label (Widget parent, widget_value* val) -{ - Arg al[20]; - int ac = 0; - Widget label = 0; - - XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; - XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; - /* The highlight doesn't appear to be dynamically set which makes it - look ugly. I think this may be a LessTif bug but for now we just - get rid of it. */ - XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - label = XmCreateLabel (parent, val->name, al, ac); - - XtManageChild (label); - - /* 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); - XtSetValues (label, al, ac); - - return label; -} - -#if XmVERSION > 1 -static Widget -xm_create_combo_box (widget_instance *instance) -{ - Arg al[20]; - int ac = 0; - Widget combo = 0; - widget_value* val = instance->info->val; - - 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++; - /* The highlight doesn't appear to be dynamically set which makes it - look ugly. I think this may be a LessTif bug but for now we just - get rid of it. */ - XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; - - /* add any args the user supplied for creation time */ - lw_add_value_args_to_args (val, al, &ac); - - combo = XmCreateDropDownComboBox (instance->parent, val->name, al, ac); - if (val->call_data) - XtAddCallback (combo, XmNselectionCallback, xm_generic_callback, - (XtPointer)instance); - - XtManageChild (combo); - - return combo; -} -#endif -#endif /* LWLIB_WIDGETS_MOTIF */ - - -/* Table of functions to create widgets */ + /* Table of functions to create widgets */ widget_creation_entry -xm_creation_table [] = +xm_creation_table [] = { #ifdef LWLIB_MENUBARS_MOTIF {"menubar", make_menubar}, @@ -1793,15 +1584,6 @@ {"vertical-scrollbar", make_vertical_scrollbar}, {"horizontal-scrollbar", make_horizontal_scrollbar}, #endif -#ifdef LWLIB_WIDGETS_MOTIF - {"button", xm_create_button}, - {"progress", xm_create_progress}, - {"text-field", xm_create_text_field}, - {"label", xm_create_label_field}, -#if XmVERSION > 1 - {"combo-box", xm_create_combo_box}, -#endif -#endif {NULL, NULL} }; @@ -1809,7 +1591,7 @@ void xm_destroy_instance (widget_instance* instance) { -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) +#ifdef LWLIB_DIALOGS_MOTIF /* It appears that this is used only for dialog boxes. */ Widget widget = instance->widget; /* recycle the dialog boxes */ @@ -1840,7 +1622,7 @@ XtDestroyWidget (instance->widget); } -#endif /* LWLIB_DIALOGS_MOTIF || LWLIB_WIDGETS_MOTIF */ +#endif /* LWLIB_DIALOGS_MOTIF */ } /* popup utility */ @@ -1918,12 +1700,12 @@ if (up) XtManageChild (widget); else - XtUnmanageChild (widget); + XtUnmanageChild (widget); } } -/* motif callback */ +/* motif callback */ enum do_call_type { pre_activate, selection, no_selection, post_activate }; @@ -1973,7 +1755,7 @@ } /* Like lw_internal_update_other_instances except that it does not do - anything if its shell parent is not managed. This is to protect + anything if its shell parent is not managed. This is to protect lw_internal_update_other_instances to dereference freed memory if the widget was ``destroyed'' by caching it in the all_destroyed_instances list */ @@ -1993,7 +1775,7 @@ static void xm_generic_callback (Widget widget, XtPointer closure, XtPointer call_data) { -#if (defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF)) +#if (defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_DIALOGS_MOTIF)) /* We want the selected status to change only when we decide it should change. Yuck but correct. */ if (XtClass (widget) == xmToggleButtonWidgetClass @@ -2008,17 +1790,30 @@ XtSetArg (al [0], XmNset, !check); XtSetValues (widget, al, 1); } -#endif +#endif lw_internal_update_other_instances (widget, closure, call_data); do_call (widget, closure, selection); } +#ifdef LWLIB_DIALOGS_MOTIF + static void -xm_pop_down_callback (Widget widget, XtPointer closure, XtPointer call_data) +xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) { - do_call (widget, closure, post_activate); + /* This callback is only called when a dialog box is dismissed with the wm's + destroy button (WM_DELETE_WINDOW.) We want the dialog box to be destroyed + in that case, not just unmapped, so that it releases its keyboard grabs. + But there are problems with running our callbacks while the widget is in + the process of being destroyed, so we set XmNdeleteResponse to XmUNMAP + instead of XmDESTROY and then destroy it ourself after having run the + callback. + */ + do_call (widget, closure, no_selection); + XtDestroyWidget (widget); } +#endif + #ifdef LWLIB_MENUBARS_MOTIF static void @@ -2028,13 +1823,21 @@ if (call_data) { /* new behavior for incremental menu construction */ - + } else -#endif +#endif do_call (widget, closure, pre_activate); } +#if 0 +static void +xm_pop_down_callback (Widget widget, XtPointer closure, XtPointer call_data) +{ + do_call (widget, closure, post_activate); +} +#endif /* 0 */ + #endif /* LWLIB_MENUBARS_MOTIF */ #ifdef LWLIB_SCROLLBARS_MOTIF @@ -2127,31 +1930,6 @@ } #endif /* LWLIB_SCROLLBARS_MOTIF */ -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) -static void -mark_dead_instance_destroyed (Widget widget, XtPointer closure, - XtPointer call_data) -{ - destroyed_instance* instance = (destroyed_instance*)closure; - instance->widget = NULL; -} - -static void -xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) -{ - /* This callback is only called when a dialog box is dismissed with the wm's - destroy button (WM_DELETE_WINDOW.) We want the dialog box to be destroyed - in that case, not just unmapped, so that it releases its keyboard grabs. - But there are problems with running our callbacks while the widget is in - the process of being destroyed, so we set XmNdeleteResponse to XmUNMAP - instead of XmDESTROY and then destroy it ourself after having run the - callback. - */ - do_call (widget, closure, no_selection); - XtDestroyWidget (widget); -} -#endif - /* set the keyboard focus */ void diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-Xm.h --- a/lwlib/lwlib-Xm.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-Xm.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ -#ifndef INCLUDED_lwlib_Xm_h_ -#define INCLUDED_lwlib_Xm_h_ +#ifndef LWLIB_XM_H +#define LWLIB_XM_H #include "lwlib-internal.h" @@ -8,9 +8,6 @@ Widget xm_create_dialog (widget_instance* instance); -Widget -xm_create_label (Widget parent, widget_value* val); - Boolean lw_motif_widget_p (Widget widget); @@ -36,4 +33,4 @@ extern Widget first_child (Widget); /* garbage */ -#endif /* INCLUDED_lwlib_Xm_h_ */ +#endif /* LWLIB_XM_H */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-config.c --- a/lwlib/lwlib-config.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-config.c Mon Aug 13 11:20:41 2007 +0200 @@ -88,13 +88,3 @@ int lwlib_does_not_support_dialogs; # endif #endif - -#ifdef LWLIB_WIDGETS_MOTIF -int lwlib_widgets_motif; -#else -# ifdef LWLIB_WIDGETS_ATHENA -int lwlib_widgets_athena; -# else -int lwlib_does_not_support_widgets; -# endif -#endif diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-internal.h --- a/lwlib/lwlib-internal.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-internal.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ -#ifndef INCLUDED_lwlib_internal_h_ -#define INCLUDED_lwlib_internal_h_ +#ifndef LWLIB_INTERNAL_H +#define LWLIB_INTERNAL_H #include "lwlib.h" @@ -39,7 +39,7 @@ typedef struct _widget_creation_entry { - const char* type; + CONST char* type; widget_creation_function function; } widget_creation_entry; @@ -55,4 +55,5 @@ widget_info *lw_get_widget_info (LWLIB_ID id); -#endif /* INCLUDED_lwlib_internal_h_ */ +#endif /* LWLIB_INTERNAL_H */ + diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-utils.c --- a/lwlib/lwlib-utils.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-utils.c Mon Aug 13 11:20:41 2007 +0200 @@ -31,31 +31,6 @@ #include <X11/ObjectP.h> #include "lwlib-utils.h" -void -destroy_all_children (Widget widget) -{ - Widget* children; - unsigned int number; - int i; - - children = XtCompositeChildren (widget, &number); - if (children) - { - /* Unmanage all children and destroy them. They will only be - * really destroyed when we get out of DispatchEvent. */ - for (i = 0; i < number; i++) - { - Widget child = children [i]; - if (!child->core.being_destroyed) - { - XtUnmanageChild (child); - XtDestroyWidget (child); - } - } - XtFree ((char *) children); - } -} - /* Redisplay the contents of the widget, without first clearing it. */ void XtNoClearRefreshWidget (Widget widget) diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib-utils.h --- a/lwlib/lwlib-utils.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib-utils.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,6 @@ -#ifndef INCLUDED_lwlib_utils_h_ -#define INCLUDED_lwlib_utils_h_ +#ifndef _LWLIB_UTILS_H_ +#define _LWLIB_UTILS_H_ -void destroy_all_children (Widget widget); void XtNoClearRefreshWidget (Widget); typedef void (*XtApplyToWidgetsProc) (Widget, XtPointer); @@ -21,5 +20,4 @@ #ifdef USE_DEBUG_MALLOC #include <dmalloc.h> #endif - -#endif /* INCLUDED_lwlib_utils_h_ */ +#endif /* _LWLIB_UTILS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib.c --- a/lwlib/lwlib.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,9 +40,6 @@ #endif #ifdef NEED_MOTIF #include "lwlib-Xm.h" -#ifdef LWLIB_WIDGETS_MOTIF -#include <Xm/Xm.h> -#endif #endif #ifdef NEED_ATHENA #include "lwlib-Xaw.h" @@ -70,13 +67,13 @@ /* Forward declarations */ -static void instantiate_widget_instance (widget_instance *instance); -static void free_widget_value_args (widget_value* wv); +static void +instantiate_widget_instance (widget_instance *instance); /* 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; @@ -111,7 +108,7 @@ } if (wv) { - memset (wv, '\0', sizeof (widget_value)); + memset (wv, 0, sizeof (widget_value)); } return wv; } @@ -128,6 +125,8 @@ widget_value_free_list = wv; } +static void free_widget_value_tree (widget_value *wv); + static void free_widget_value_contents (widget_value *wv) { @@ -156,9 +155,6 @@ free_widget_value_tree (wv->contents); wv->contents = (widget_value *) 0xDEADBEEF; } - - free_widget_value_args (wv); - if (wv->next) { free_widget_value_tree (wv->next); @@ -166,7 +162,7 @@ } } -void +static void free_widget_value_tree (widget_value *wv) { if (!wv) @@ -188,7 +184,7 @@ if (val->scrollbar_data) *copy->scrollbar_data = *val->scrollbar_data; else - memset (copy->scrollbar_data, '\0', sizeof (scrollbar_values)); + memset (copy->scrollbar_data, 0, sizeof (scrollbar_values)); } /* @@ -235,40 +231,6 @@ #endif /* NEED_SCROLLBARS */ -#ifdef HAVE_WIDGETS -/* - * Return true if old->args was not equivalent - * to new->args. - */ -static Boolean -merge_widget_value_args (widget_value *old, widget_value *new) -{ - Boolean changed = False; - - if (new->args && !old->args) - { - lw_copy_widget_value_args (new, old); - changed = True; - } - /* Generally we don't want to lose values that are already in the - widget. */ - else if (!new->args && old->args) - { - lw_copy_widget_value_args (old, new); - changed = True; - } - 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). */ - lw_copy_widget_value_args (new, old); - changed = True; - } - - return changed; -} -#endif /* HAVE_WIDGETS */ - /* Make a complete copy of a widget_value tree. Store CHANGE into the widget_value tree's `change' field. */ @@ -301,8 +263,6 @@ copy->next = copy_widget_value_tree (val->next, change); copy->toolkit_data = NULL; copy->free_toolkit_data = False; - - lw_copy_widget_value_args (val, copy); #ifdef NEED_SCROLLBARS copy_scrollbar_values (val, copy); #endif @@ -329,7 +289,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) @@ -357,7 +317,7 @@ safe_free_str (info->type); safe_free_str (info->name); free_widget_value_tree (info->val); - memset (info, '\0', sizeof (widget_info)); + memset ((void*)info, 0xDEADBEEF, sizeof (widget_info)); free (info); } @@ -392,7 +352,7 @@ static void free_widget_instance (widget_instance *instance) { - memset (instance, '\0', sizeof (widget_instance)); + memset ((void *) instance, 0xDEADBEEF, sizeof (widget_instance)); free (instance); } @@ -502,13 +462,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 WIN32_NATIVE +#ifndef WINDOWSNT static change_type max (change_type i1, change_type i2) { @@ -617,14 +577,6 @@ change = max (change, INVISIBLE_CHANGE); val1->call_data = val2->call_data; } -#ifdef HAVE_WIDGETS - if (merge_widget_value_args (val1, val2)) - { - EXPLAIN (val1->name, change, VISIBLE_CHANGE, "widget change", 0, 0); - change = max (change, VISIBLE_CHANGE); - } -#endif - #ifdef NEED_SCROLLBARS if (merge_scrollbar_values (val1, val2)) { @@ -689,7 +641,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; @@ -826,7 +778,7 @@ 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++) @@ -836,7 +788,7 @@ } 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] */ @@ -920,7 +872,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) @@ -956,7 +908,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) @@ -1048,14 +1000,14 @@ } void -lw_destroy_everything (void) +lw_destroy_everything () { while (all_widget_info) lw_destroy_all_widgets (all_widget_info->id); } void -lw_destroy_all_pop_ups (void) +lw_destroy_all_pop_ups () { widget_info *info; widget_info *next; @@ -1348,86 +1300,3 @@ } } } - -void lw_add_value_args_to_args (widget_value* wv, ArgList addto, int* offset) -{ - int i; - if (wv->args && wv->args->nargs) - { - for (i = 0; i<wv->args->nargs; i++) - { - addto[i + *offset] = wv->args->args[i]; - } - *offset += wv->args->nargs; - } -} - -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)); - memset (wv->args, '\0', sizeof (widget_args)); - wv->args->ref_count = 1; - wv->args->nargs = 0; - wv->args->args = (ArgList) malloc (sizeof (Arg) * 10); - memset (wv->args->args, '\0', sizeof (Arg) * 10); - } - - if (wv->args->nargs > 10) - return; - - /* 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) -{ - if (wv->args) - { - if (--wv->args->ref_count <= 0) - { -#ifdef LWLIB_WIDGETS_MOTIF - int i; - for (i = 0; i < wv->args->nargs; i++) - { - if (!strcmp (wv->args->args[i].name, XmNfontList)) - XmFontListFree ((XmFontList)wv->args->args[i].value); - } -#endif - free (wv->args->args); - free (wv->args); - wv->args = 0; - } - } -} - -void lw_copy_widget_value_args (widget_value* val, widget_value* copy) -{ - if (val == copy || val->args == copy->args) - return; - - if (copy->args) - { - free_widget_value_args (copy); - } - - if (val->args) - { - copy->args = val->args; - copy->args->ref_count++; - } -} - diff -r 12e008d41344 -r 697ef44129c6 lwlib/lwlib.h --- a/lwlib/lwlib.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/lwlib.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,17 @@ -#ifndef INCLUDED_lwlib_h_ -#define INCLUDED_lwlib_h_ +#ifndef LWLIB_H +#define LWLIB_H + +#undef CONST #include <X11/Intrinsic.h> +/* 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 @@ -97,17 +106,6 @@ int scrollbar_x, scrollbar_y; } scrollbar_values; -typedef struct _widget_args -{ - /* some things are only possible at creation time. args are applied - to widgets at creation time. */ - ArgList args; - int nargs; - /* Copying args is impossible so we make the caller give us heap allocated - args and free them when on-one wants them any more. */ - int ref_count; -} widget_args; - typedef struct _widget_value { /* This slot is only partially utilized right now. */ @@ -149,12 +147,10 @@ /* data defining a scrollbar; only valid if type == "scrollbar" */ scrollbar_values *scrollbar_data; - /* A reference counted arg structure. */ - struct _widget_args *args; /* we resource the widget_value structures; this points to the next - one on the free list if this one has been deallocated. */ + one on the free list if this one has been deallocated. + */ struct _widget_value *free_list; - } widget_value; @@ -180,17 +176,13 @@ /* do this for the other toolkits too */ #endif /* LWLIB_MENUBARS_LUCID */ -#if defined (LWLIB_TABS_LUCID) -#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, @@ -209,13 +201,9 @@ Boolean lw_get_some_values (LWLIB_ID id, widget_value* val); void lw_pop_up_all_widgets (LWLIB_ID id); void lw_pop_down_all_widgets (LWLIB_ID id); -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 *malloc_widget_value (void); void free_widget_value (widget_value *); -void free_widget_value_tree (widget_value *wv); widget_value *replace_widget_value_tree (widget_value*, widget_value*); void lw_popup_menu (Widget, XEvent *); @@ -226,4 +214,4 @@ /* Silly Energize hack to invert the "sheet" button */ void lw_show_busy (Widget w, Boolean busy); -#endif /* INCLUDED_lwlib_h_ */ +#endif /* LWLIB_H */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwcheckbox.c --- a/lwlib/xlwcheckbox.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,415 +0,0 @@ -/* Checkbox 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: Checkbox.c 1.1 */ - -/* - * Checkbox.c - Checkbox button widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: June 30, 1997 - * - * Overview: This widget is identical to the Radio widget in behavior, - * except that the button is square and has a check mark. - */ - - -#include <config.h> -#include <stdio.h> - -#include <X11/IntrinsicP.h> -#include <X11/StringDefs.h> -#include ATHENA_XawInit_h_ -#include "../src/xmu.h" -#include "xlwcheckboxP.h" - - -/* by using the same size for the checkbox as for the diamond box, - * we can let the Radio widget do the vast majority of the work. - */ - -#define BOX_SIZE 8 -#define DRAW_CHECK 0 /* don't draw the check mark */ - -#define cclass(w) ((CheckboxWidgetClass)((w)->core.widget_class)) - -#ifdef _ThreeDP_h -#define swid(cw) ((cw)->threeD.shadow_width) -#else -#define swid(cw) ((cw)->core.border_width) -#endif - -#define bsize(cw) (cclass(cw)->radio_class.dsize) -#define bs(cw) (bsize(cw) + 2*swid(cw)) - - -#if DRAW_CHECK -#define check_width 14 -#define check_height 14 -static u_char check_bits[] = { - 0x00, 0x00, 0x00, 0x20, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x03, - 0x8c, 0x03, 0xde, 0x01, 0xff, 0x01, 0xfe, 0x00, 0xfc, 0x00, 0x78, 0x00, - 0x70, 0x00, 0x20, 0x00}; -#endif - - -/**************************************************************** - * - * Full class record constant - * - ****************************************************************/ - - -#if DRAW_CHECK -static char defaultTranslations[] = - "<EnterWindow>: highlight()\n\ - <LeaveWindow>: unpress(draw) unhighlight()\n\ - <Btn1Down>: press()\n\ - <Btn1Down>,<Btn1Up>: unpress(nodraw) toggle() notify()"; -#endif - - - -#define offset(field) XtOffsetOf(CheckboxRec, field) -static XtResource resources[] = { - {XtNtristate, XtCTristate, XtRBoolean, sizeof(Boolean), - offset(checkbox.tristate), XtRImmediate, (XtPointer)FALSE}, -} ; -#undef offset - - /* Member functions */ - -static void CheckboxClassInit (void); -static void CheckboxInit (Widget, Widget, ArgList, Cardinal *); -#if DRAW_CHECK -static void CheckboxRealize (Widget, Mask *, XSetWindowAttributes *); -#endif -static void DrawCheck (Widget); - - - /* Action procs */ -#if DRAW_CHECK -static void CheckboxPress (Widget, XEvent *, String *, Cardinal *); -static void CheckboxUnpress (Widget, XEvent *, String *, Cardinal *); -#endif - - /* internal privates */ - -#if DRAW_CHECK -static XtActionsRec actionsList[] = -{ - {"press", CheckboxPress}, - {"unpress", CheckboxUnpress}, -} ; -#endif - -#define SuperClass ((RadioWidgetClass)&radioClassRec) - -CheckboxClassRec checkboxClassRec = { - { - (WidgetClass) SuperClass, /* superclass */ - "Checkbox", /* class_name */ - sizeof(CheckboxRec), /* size */ - CheckboxClassInit, /* class_initialize */ - NULL, /* class_part_initialize */ - FALSE, /* class_inited */ - CheckboxInit, /* initialize */ - NULL, /* initialize_hook */ -#if DRAW_CHECK - CheckboxRealize, /* realize */ - actionsList, /* actions */ - XtNumber(actionsList), /* num_actions */ -#else - XtInheritRealize, /* realize */ - NULL, /* actions */ - 0, /* num_actions */ -#endif - resources, /* resources */ - XtNumber(resources), /* resource_count */ - NULLQUARK, /* xrm_class */ - TRUE, /* compress_motion */ - TRUE, /* compress_exposure */ - TRUE, /* compress_enterleave */ - FALSE, /* visible_interest */ - NULL, /* destroy */ - XtInheritResize, /* resize */ - XtInheritExpose, /* expose */ - NULL, /* set_values */ - NULL, /* set_values_hook */ - XtInheritSetValuesAlmost, /* set_values_almost */ - NULL, /* get_values_hook */ - NULL, /* accept_focus */ - XtVersion, /* version */ - NULL, /* callback_private */ -#if DRAW_CHECK - defaultTranslations, /* tm_table */ -#else - XtInheritTranslations, /* tm_table */ -#endif - XtInheritQueryGeometry, /* query_geometry */ - XtInheritDisplayAccelerator, /* display_accelerator */ - NULL /* extension */ - }, /* CoreClass fields initialization */ - { - XtInheritChangeSensitive /* change_sensitive */ - }, /* SimpleClass fields initialization */ -#ifdef _ThreeDP_h - { - XtInheritXaw3dShadowDraw /* field not used */ - }, /* ThreeDClass fields initialization */ -#endif - { - 0 /* field not used */ - }, /* LabelClass fields initialization */ - { - 0 /* field not used */ - }, /* CommandClass fields initialization */ - { - RadioSet, /* Set Procedure. */ - RadioUnset, /* Unset Procedure. */ - NULL /* extension. */ - }, /* ToggleClass fields initialization */ - { - BOX_SIZE, - DrawCheck, /* draw procedure */ - NULL /* extension. */ - }, /* RadioClass fields initialization */ - { - NULL /* extension. */ - }, /* CheckboxClass fields initialization */ -}; - - /* for public consumption */ -WidgetClass checkboxWidgetClass = (WidgetClass) &checkboxClassRec; - - - - - - -/**************************************************************** - * - * Class Methods - * - ****************************************************************/ - -static void -CheckboxClassInit (void) -{ - XawInitializeWidgetSet(); -} - - -/*ARGSUSED*/ -static void -CheckboxInit (Widget request, - Widget new, - ArgList args, - Cardinal *num_args) -{ -#if DRAW_CHECK - CheckboxWidget cw = (CheckboxWidget) new; - cw->checkbox.checkmark = None ; - cw->checkbox.checkmark_GC = None ; -#endif -} - - -#if DRAW_CHECK -static void -CheckboxRealize(Widget w, - Mask *valueMask, - XSetWindowAttributes *attributes) -{ - CheckboxWidget cw = (CheckboxWidget) w; - XtGCMask value_mask, dynamic_mask, dontcare_mask ; - XGCValues values ; - - /* first, call superclass realize */ - (*checkboxWidgetClass->core_class.superclass->core_class.realize) - (w, valueMask, attributes); - - /* TODO: cache this via xmu */ - if( cw->checkbox.checkmark == None ) - cw->checkbox.checkmark = - XCreateBitmapFromData( XtDisplay(w), XtWindow(w), - check_bits,check_width,check_height); - - values.fill_style = FillStippled ; - values.stipple = cw->checkbox.checkmark ; - values.foreground = cw->label.foreground ; - value_mask = GCFillStyle | GCStipple | GCForeground ; - dynamic_mask = GCTileStipXOrigin | GCTileStipYOrigin ; - dontcare_mask = GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle | - GCFont | GCSubwindowMode | GCGraphicsExposures | - GCDashOffset | GCDashList | GCArcMode ; - cw->checkbox.checkmark_GC = - XtAllocateGC(w, 0, value_mask, &values, dynamic_mask, dontcare_mask) ; -} -#endif - - -/* Function Name: CheckboxDestroy - * Description: Destroy Callback for checkbox widget. - * Arguments: w - the checkbox widget that is being destroyed. - * junk, grabage - not used. - * Returns: none. - */ - -/* ARGSUSED */ -static void -CheckboxDestroy (Widget w, - XtPointer junk, - XtPointer garbage) -{ -#if DRAW_CHECK - CheckboxWidget cw = (CheckboxWidget) w; - - /* TODO: cache this via xmu */ - if( cw->checkbox.checkmark != None ) - XFreePixmap( XtDisplay(w), cw->checkbox.checkmark ) ; - if( cw->checkbox.checkmark_GC != None ) - XtReleaseGC(w, cw->checkbox.checkmark_GC) ; -#endif -} - - - -#if DRAW_CHECK -/************************************************************ - * - * Actions Procedures - * - ************************************************************/ - -/* ARGSUSED */ -static void -CheckboxPress (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params) /* unused */ -{ - CheckboxWidget cw = (CheckboxWidget) w ; - if( !cw->checkbox.pressed ) { - cw->checkbox.pressed = TRUE ; - ((CheckboxWidgetClass)(w->core.widget_class))->radio_class.drawDiamond(w) ; - } -} - -static void -CheckboxUnpress (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params) /* unused */ -{ - CheckboxWidget cw = (CheckboxWidget) w ; - int i ; - - if( cw->checkbox.pressed ) { - cw->checkbox.pressed = FALSE ; - if( *num_params > 0 && **params == 'd' ) - ((CheckboxWidgetClass)(w->core.widget_class))->radio_class.drawDiamond(w); - } -} -#endif - - - - - -/************************************************************ - * - * Internal Procedures - * - ************************************************************/ - -static void -DrawCheck (Widget w) -{ - CheckboxWidget cw = (CheckboxWidget) w ; - Display *dpy = XtDisplay(w) ; - Window win = XtWindow(w) ; - GC gc ; - -#ifdef _ThreeDP_h - XPoint pts[6] ; -#endif - Dimension s = swid(cw); - Dimension bsz = bsize(cw); - Position bx,by ; /* Check upper-left */ - Dimension bw,bh ; -#ifdef _ThreeDP_h - GC top, bot; -#endif - GC ctr ; - - /* foreground GC */ - gc = XtIsSensitive(w) ? cw->command.normal_GC : cw->label.gray_GC ; - - bw = bh = bs(cw) ; - bx = cw->label.internal_width ; - by = cw->core.height/2 - bh/2 ; - -#ifdef _ThreeDP_h - if( !cw->command.set ) { - top = cw->threeD.top_shadow_GC ; - bot = cw->threeD.bot_shadow_GC ; - } else { - top = cw->threeD.bot_shadow_GC ; - bot = cw->threeD.top_shadow_GC ; - } - ctr = cw->command.inverse_GC ; -#else - ctr = cw->command.set ? cw->command.normal_GC : cw->command.inverse_GC ; -#endif - - XFillRectangle(dpy,win,ctr, bx+s,by+s, bsz,bsz) ; - -#ifdef _ThreeDP_h - /* top-left shadow */ - pts[0].x = bx ; pts[0].y = by ; - pts[1].x = bw ; pts[1].y = 0 ; - pts[2].x = -s ; pts[2].y = s ; - pts[3].x = -bsz ; pts[3].y = 0 ; - pts[4].x = 0 ; pts[4].y = bsz ; - pts[5].x = -s ; pts[5].y = s ; - XFillPolygon(dpy,win,top, pts,6, Nonconvex,CoordModePrevious) ; - /* bottom-right shadow */ - pts[0].x = bx+bw ; pts[0].y = by+bh ; - pts[1].x = -bw ; pts[1].y = 0 ; - pts[2].x = s ; pts[2].y = -s ; - pts[3].x = bsz ; pts[3].y = 0 ; - pts[4].x = 0 ; pts[4].y = -bsz ; - pts[5].x = s ; pts[5].y = -s ; - XFillPolygon(dpy,win,bot, pts,6, Nonconvex,CoordModePrevious) ; -#else - XDrawRectangle(dpy,win,gc, bx+s,by+s, bsz,bsz) ; -#endif - -#if DRAW_CHECK - if( cw->command.set && cw->checkbox.checkmark_GC != None ) { - XSetTSOrigin(dpy,cw->checkbox.checkmark_GC, bx+s, by+s) ; - XFillRectangle(dpy,win,cw->checkbox.checkmark_GC, - bx+s, by+s, check_width,check_height) ; - } -#endif -} diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwcheckbox.h --- a/lwlib/xlwcheckbox.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* Checkbox 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: Checkbox.h 1.1 */ - -/* - * Checkbox.h - Checkbox widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: June 30, 1997 - */ - -#ifndef _XawCheckbox_h -#define _XawCheckbox_h - -/*********************************************************************** - * - * Checkbox Widget - * - * The Checkbox widget is identical to the Radio widget in behavior but - * not in appearance. The Checkbox widget looks like a small diamond - * shaped button to the left of the label. - * - ***********************************************************************/ - -#include "xlwradio.h" - -/* Resources: - - Name Class RepType Default Value - ---- ----- ------- ------------- - tristate Tristate Boolean FALSE - - radioGroup RadioGroup Widget NULL - radioData RadioData Pointer (XPointer) Widget - state State Boolean Off - background Background Pixel XtDefaultBackground - bitmap Pixmap Pixmap None - border BorderColor Pixel XtDefaultForeground - borderWidth BorderWidth Dimension 1 - callback Callback Pointer NULL - cursor Cursor Cursor None - destroyCallback Callback Pointer NULL - font Font XFontStructx* XtDefaultFont - foreground Foreground Pixel XtDefaultForeground - height Height Dimension text height - highlightThickness Thickness Dimension 2 - insensitiveBorder sensitive Pixmap Gray - internalHeight Height Dimension 2 - internalWidth Width Dimension 4 - justify Justify XtJustify XtJustifyCenter - label Label String NULL - mappedWhenManaged MappedWhenManaged Boolean True - resize Resize Boolean True - sensitive Sensitive Boolean True - width Width Dimension text width - x Position Position 0 - y Position Position 0 - -*/ - -/* - * These should be in StringDefs.h but aren't so we will define - * them here if they are needed. - */ - - -#define XtCTristate "Tristate" - -#define XtNtristate "tristate" - -extern WidgetClass checkboxWidgetClass; - -typedef struct _CheckboxClassRec *CheckboxWidgetClass; -typedef struct _CheckboxRec *CheckboxWidget; - - -/************************************************************ - * - * Public Functions - * - ************************************************************/ - -#endif /* _XawCheckbox_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwcheckboxP.h --- a/lwlib/xlwcheckboxP.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* Checkbox 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. */ - -/* - * CheckboxP.h - Private definitions for Checkbox widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: June 30, 1997 - */ - -#ifndef _XawCheckboxP_h -#define _XawCheckboxP_h - -#include "xlwcheckbox.h" -#include "xlwradioP.h" - -/************************************ - * - * Class structure - * - ***********************************/ - - /* New fields for the Checkbox widget class record */ -typedef struct _CheckboxClass { - XtPointer extension; -} CheckboxClassPart; - - /* Full class record declaration */ -typedef struct _CheckboxClassRec { - CoreClassPart core_class; - SimpleClassPart simple_class; -#ifdef _ThreeDP_h - ThreeDClassPart threeD_class; -#endif - LabelClassPart label_class; - CommandClassPart command_class; - ToggleClassPart toggle_class; - RadioClassPart radio_class; - CheckboxClassPart checkbox_class; -} CheckboxClassRec; - -extern CheckboxClassRec checkboxClassRec; - -/*************************************** - * - * Instance (widget) structure - * - **************************************/ - - /* New fields for the Checkbox widget record */ -typedef struct { - /* resources */ - Boolean tristate ; - - /* private data */ - Boolean pressed ; - Pixmap checkmark ; /* TODO: share these via xmu? */ - GC checkmark_GC ; - XtPointer extension; -} CheckboxPart; - - /* Full widget declaration */ -typedef struct _CheckboxRec { - CorePart core; - SimplePart simple; -#ifdef _ThreeDP_h - ThreeDPart threeD; -#endif - LabelPart label; - CommandPart command; - TogglePart toggle; - RadioPart radio; - CheckboxPart checkbox; -} CheckboxRec; - -#endif /* _XawCheckboxP_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwgauge.c --- a/lwlib/xlwgauge.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1138 +0,0 @@ -/* Gauge 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: Gauge.c 1.2 */ - -/* - * Gauge.c - Gauge widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: July 9, 1997 - * - * Note: for fun and demonstration purposes, I have added selection - * capabilities to this widget. If you select the widget, you create - * a primary selection containing the current value of the widget in - * both integer and string form. If you copy into the widget, the - * primary selection is converted to an integer value and the gauge is - * set to that value. - */ - -/* TODO: display time instead of value - */ - -#define DEF_LEN 50 /* default width (or height for vertical gauge) */ -#define MIN_LEN 10 /* minimum reasonable width (height) */ -#define TIC_LEN 6 /* length of tic marks */ -#define GA_WID 3 /* width of gauge */ -#define MS_PER_SEC 1000 - -#include <config.h> -#include <stdlib.h> -#include <stdio.h> -#include <ctype.h> -#include <X11/IntrinsicP.h> -#include <X11/Xatom.h> -#include <X11/StringDefs.h> -#include ATHENA_XawInit_h_ -#include "xlwgaugeP.h" -#include "../src/xmu.h" -#ifdef HAVE_XMU -#include <X11/Xmu/Atoms.h> -#include <X11/Xmu/Drawing.h> -#include <X11/Xmu/StdSel.h> -#endif - - -/**************************************************************** - * - * Gauge resources - * - ****************************************************************/ - - -static char defaultTranslations[] = - "<Btn1Up>: select()\n\ - <Key>F1: select(CLIPBOARD)\n\ - <Btn2Up>: paste()\n\ - <Key>F2: paste(CLIPBOARD)" ; - - - -#define offset(field) XtOffsetOf(GaugeRec, field) -static XtResource resources[] = { - {XtNvalue, XtCValue, XtRInt, sizeof(int), - offset(gauge.value), XtRImmediate, (XtPointer)0}, - {XtNminValue, XtCMinValue, XtRInt, sizeof(int), - offset(gauge.v0), XtRImmediate, (XtPointer)0}, - {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int), - offset(gauge.v1), XtRImmediate, (XtPointer)100}, - {XtNntics, XtCNTics, XtRInt, sizeof(int), - offset(gauge.ntics), XtRImmediate, (XtPointer) 0}, - {XtNnlabels, XtCNLabels, XtRInt, sizeof(int), - offset(gauge.nlabels), XtRImmediate, (XtPointer) 0}, - {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *), - offset(gauge.labels), XtRStringArray, NULL}, - {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean), - offset(gauge.autoScaleUp), XtRImmediate, FALSE}, - {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean), - offset(gauge.autoScaleDown), XtRImmediate, FALSE}, - {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation), - offset(gauge.orientation), XtRImmediate, (XtPointer)XtorientHorizontal}, - {XtNupdate, XtCInterval, XtRInt, sizeof(int), - offset(gauge.update), XtRImmediate, (XtPointer)0}, - {XtNgetValue, XtCCallback, XtRCallback, sizeof(XtPointer), - offset(gauge.getValue), XtRImmediate, (XtPointer)NULL}, -}; -#undef offset - - - - /* member functions */ - -static void GaugeClassInit (void); -static void GaugeInit (Widget, Widget, ArgList, Cardinal *); -static void GaugeDestroy (Widget); -static void GaugeResize (Widget); -static void GaugeExpose (Widget, XEvent *, Region); -static Boolean GaugeSetValues (Widget, Widget, Widget, ArgList, Cardinal *); -static XtGeometryResult GaugeQueryGeometry (Widget, XtWidgetGeometry *, - XtWidgetGeometry *); - - /* action procs */ - -static void GaugeSelect (Widget, XEvent *, String *, Cardinal *); -static void GaugePaste (Widget, XEvent *, String *, Cardinal *); - - /* internal privates */ - -static void GaugeSize (GaugeWidget, Dimension *, Dimension *, Dimension); -static void MaxLabel (GaugeWidget, Dimension *, Dimension *, - Dimension *, Dimension *); -static void AutoScale (GaugeWidget); -static void EnableUpdate (GaugeWidget); -static void DisableUpdate (GaugeWidget); - -static void GaugeGetValue (XtPointer, XtIntervalId *); -static void GaugeMercury (Display *, Window, GC, GaugeWidget, Cardinal, Cardinal); - -static Boolean GaugeConvert (Widget, Atom *, Atom *, Atom *, - XtPointer *, u_long *, int *); -static void GaugeLoseSel (Widget, Atom *); -static void GaugeDoneSel (Widget, Atom *, Atom *); -static void GaugeGetSelCB (Widget, XtPointer, Atom *, Atom *, - XtPointer, u_long *, int *); - -static GC Get_GC (GaugeWidget, Pixel); - - -static XtActionsRec actionsList[] = -{ - {"select", GaugeSelect}, - {"paste", GaugePaste}, -} ; - - - -/**************************************************************** - * - * Full class record constant - * - ****************************************************************/ - -GaugeClassRec gaugeClassRec = { - { -/* core_class fields */ - /* superclass */ (WidgetClass) &labelClassRec, - /* class_name */ "Gauge", - /* widget_size */ sizeof(GaugeRec), - /* class_initialize */ GaugeClassInit, - /* class_part_initialize */ NULL, - /* class_inited */ FALSE, - /* initialize */ GaugeInit, - /* initialize_hook */ NULL, - /* realize */ XtInheritRealize, /* TODO? */ - /* actions */ actionsList, - /* num_actions */ XtNumber(actionsList), - /* resources */ resources, - /* num_resources */ XtNumber(resources), - /* xrm_class */ NULLQUARK, - /* compress_motion */ TRUE, - /* compress_exposure */ TRUE, - /* compress_enterleave */ TRUE, - /* visible_interest */ FALSE, - /* destroy */ GaugeDestroy, - /* resize */ GaugeResize, - /* expose */ GaugeExpose, - /* set_values */ GaugeSetValues, - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ NULL, - /* accept_focus */ NULL, - /* version */ XtVersion, - /* callback_private */ NULL, - /* tm_table */ defaultTranslations, - /* query_geometry */ GaugeQueryGeometry, - /* display_accelerator */ XtInheritDisplayAccelerator, - /* extension */ NULL - }, -/* Simple class fields initialization */ - { - /* change_sensitive */ XtInheritChangeSensitive - }, -#ifdef _ThreeDP_h -/* ThreeD class fields initialization */ - { - XtInheritXaw3dShadowDraw /* shadowdraw */ - }, -#endif -/* Label class fields initialization */ - { - /* ignore */ 0 - }, -/* Gauge class fields initialization */ - { - /* extension */ NULL - }, -}; - -WidgetClass gaugeWidgetClass = (WidgetClass)&gaugeClassRec; - - - - -/**************************************************************** - * - * Member Procedures - * - ****************************************************************/ - -static void -GaugeClassInit (void) -{ - XawInitializeWidgetSet(); -#ifdef HAVE_XMU - XtAddConverter(XtRString, XtROrientation, XmuCvtStringToOrientation, - NULL, 0) ; -#endif -} - - - -/* ARGSUSED */ -static void -GaugeInit (Widget request, - Widget new, - ArgList args, - Cardinal *num_args) -{ - GaugeWidget gw = (GaugeWidget) new; - - if( gw->gauge.v0 == 0 && gw->gauge.v1 == 0 ) { - gw->gauge.autoScaleUp = gw->gauge.autoScaleDown = TRUE ; - AutoScale(gw) ; - } - - /* If size not explicitly set, set it to our preferred size now. */ - - if( request->core.width == 0 || request->core.height == 0 ) - { - Dimension w,h ; - GaugeSize(gw, &w,&h, DEF_LEN) ; - if( request->core.width == 0 ) - new->core.width = w ; - if( request->core.height == 0 ) - new->core.height = h ; - gw->core.widget_class->core_class.resize(new) ; - } - - gw->gauge.selected = None ; - gw->gauge.selstr = NULL ; - - if( gw->gauge.update > 0 ) - EnableUpdate(gw) ; - - gw->gauge.inverse_GC = Get_GC(gw, gw->core.background_pixel) ; -} - -static void -GaugeDestroy (Widget w) -{ - GaugeWidget gw = (GaugeWidget)w; - - if( gw->gauge.selstr != NULL ) - XtFree(gw->gauge.selstr) ; - - if( gw->gauge.selected != None ) - XtDisownSelection(w, gw->gauge.selected, CurrentTime) ; - - XtReleaseGC(w, gw->gauge.inverse_GC) ; - - if( gw->gauge.update > 0 ) - DisableUpdate(gw) ; -} - - -/* React to size change from manager. Label widget will compute some - * internal stuff, but we need to override. - */ - -static void -GaugeResize (Widget w) -{ - GaugeWidget gw = (GaugeWidget)w; - int size ; /* height (width) of gauge */ - int vmargin ; /* vertical (horizontal) margin */ - int hmargin ; /* horizontal (vertical) margin */ - - vmargin = gw->gauge.orientation == XtorientHorizontal ? - gw->label.internal_height : gw->label.internal_width ; - hmargin = gw->gauge.orientation == XtorientHorizontal ? - gw->label.internal_width : gw->label.internal_height ; - - /* TODO: need to call parent resize proc? I don't think so since - * we're recomputing everything from scratch anyway. - */ - - /* find total height (width) of contents */ - - size = GA_WID+2 ; /* gauge itself + edges */ - - if( gw->gauge.ntics > 1 ) /* tic marks */ - size += vmargin + TIC_LEN ; - - if( gw->gauge.nlabels > 1 ) - { - Dimension lwm, lw0, lw1 ; /* width of max, left, right labels */ - Dimension lh ; - - MaxLabel(gw,&lwm,&lh, &lw0,&lw1) ; - - if( gw->gauge.orientation == XtorientHorizontal ) - { - gw->gauge.margin0 = lw0 / 2 ; - gw->gauge.margin1 = lw1 / 2 ; - size += lh + vmargin ; - } - else - { - gw->gauge.margin0 = - gw->gauge.margin1 = lh / 2 ; - size += lwm + vmargin ; - } - } - else - gw->gauge.margin0 = gw->gauge.margin1 = 0 ; - - gw->gauge.margin0 += hmargin ; - gw->gauge.margin1 += hmargin ; - - /* Now distribute height (width) over components */ - - if( gw->gauge.orientation == XtorientHorizontal ) - gw->gauge.gmargin = (gw->core.height-size)/2 ; - else - gw->gauge.gmargin = (gw->core.width-size)/2 ; - - gw->gauge.tmargin = gw->gauge.gmargin + GA_WID+2 + vmargin ; - if( gw->gauge.ntics > 1 ) - gw->gauge.lmargin = gw->gauge.tmargin + TIC_LEN + vmargin ; - else - gw->gauge.lmargin = gw->gauge.tmargin ; -} - -/* - * Repaint the widget window - */ - -/* ARGSUSED */ -static void -GaugeExpose (Widget w, - XEvent *event, - Region region) -{ - GaugeWidget gw = (GaugeWidget) w; -register Display *dpy = XtDisplay(w) ; -register Window win = XtWindow(w) ; - GC gc; /* foreground, background */ - GC gctop, gcbot ; /* dark, light shadows */ - - int len ; /* length (width or height) of widget */ - int hgt ; /* height (width) of widget */ - int e0,e1 ; /* ends of the gauge */ - int x ; - int y ; /* vertical (horizontal) position */ - int i ; - int v0 = gw->gauge.v0 ; - int v1 = gw->gauge.v1 ; - int value = gw->gauge.value ; - - gc = XtIsSensitive(w) ? gw->label.normal_GC : gw->label.gray_GC ; - - -#ifdef _ThreeDP_h - gctop = gw->threeD.bot_shadow_GC ; - gcbot = gw->threeD.top_shadow_GC ; -#else - gctop = gcbot = gc ; -#endif - - if( gw->gauge.orientation == XtorientHorizontal ) { - len = gw->core.width ; - hgt = gw->core.height ; - } else { - len = gw->core.height ; - hgt = gw->core.width ; - } - - /* if the gauge is selected, signify by drawing the background - * in a constrasting color. - */ - - if( gw->gauge.selected ) - { - XFillRectangle(dpy,win, gc, 0,0, w->core.width,w->core.height) ; - gc = gw->gauge.inverse_GC ; - } - - e0 = gw->gauge.margin0 ; /* left (top) end */ - e1 = len - gw->gauge.margin1 -1 ; /* right (bottom) end */ - - /* Draw the Gauge itself */ - - y = gw->gauge.gmargin ; - - if( gw->gauge.orientation == XtorientHorizontal ) /* horizontal */ - { - XDrawLine(dpy,win,gctop, e0+1,y, e1-1,y) ; - XDrawLine(dpy,win,gctop, e0,y+1, e0,y+GA_WID) ; - XDrawLine(dpy,win,gcbot, e0+1, y+GA_WID+1, e1-1, y+GA_WID+1) ; - XDrawLine(dpy,win,gcbot, e1,y+1, e1,y+GA_WID) ; - } - else /* vertical */ - { - XDrawLine(dpy,win,gctop, y,e0+1, y,e1-1) ; - XDrawLine(dpy,win,gctop, y+1,e0, y+GA_WID,e0) ; - XDrawLine(dpy,win,gcbot, y+GA_WID+1,e0+1, y+GA_WID+1, e1-1) ; - XDrawLine(dpy,win,gcbot, y+1,e1, y+GA_WID,e1) ; - } - - - /* draw the mercury */ - - GaugeMercury(dpy, win, gc, gw, 0,value) ; - - - if( gw->gauge.ntics > 1 ) - { - y = gw->gauge.tmargin ; - for(i=0; i<gw->gauge.ntics; ++i) - { - x = e0 + i*(e1-e0-1)/(gw->gauge.ntics-1) ; - if( gw->gauge.orientation == XtorientHorizontal ) { - XDrawLine(dpy,win,gcbot, x,y+1, x,y+TIC_LEN-2) ; - XDrawLine(dpy,win,gcbot, x,y, x+1,y) ; - XDrawLine(dpy,win,gctop, x+1,y+1, x+1,y+TIC_LEN-2) ; - XDrawLine(dpy,win,gctop, x,y+TIC_LEN-1, x+1,y+TIC_LEN-1) ; - } - else { - XDrawLine(dpy,win,gcbot, y+1,x, y+TIC_LEN-2,x) ; - XDrawLine(dpy,win,gcbot, y,x, y,x+1) ; - XDrawLine(dpy,win,gctop, y+1,x+1, y+TIC_LEN-2,x+1) ; - XDrawLine(dpy,win,gctop, y+TIC_LEN-1,x, y+TIC_LEN-1,x+1) ; - } - } - } - - /* draw labels */ - if( gw->gauge.nlabels > 1 ) - { - char label[20], *s = label ; - int xlen, wd,h =0 ; - - if( gw->gauge.orientation == XtorientHorizontal ) - y = gw->gauge.lmargin + gw->label.font->max_bounds.ascent - 1 ; - else { - y = gw->gauge.lmargin ; - h = gw->label.font->max_bounds.ascent / 2 ; - } - - for(i=0; i<gw->gauge.nlabels; ++i) - { - if( gw->gauge.labels == NULL ) - sprintf(label, "%d", v0+i*(v1 - v0)/(gw->gauge.nlabels - 1)) ; - else - s = gw->gauge.labels[i] ; - if( s != NULL ) { - x = e0 + i*(e1-e0-1)/(gw->gauge.nlabels-1) ; - xlen = strlen(s) ; - if( gw->gauge.orientation == XtorientHorizontal ) { - 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,xlen) ; - } - } - } - } -} - - -/* - * Set specified arguments into widget - */ - -static Boolean -GaugeSetValues (Widget old, - Widget request, - Widget new, - ArgList args, - Cardinal *num_args) -{ - GaugeWidget oldgw = (GaugeWidget) old; - GaugeWidget gw = (GaugeWidget) new; - Boolean was_resized = False; - - if( gw->gauge.selected != None ) { - XtDisownSelection(new, gw->gauge.selected, CurrentTime) ; - gw->gauge.selected = None ; - } - - /* Changes to v0,v1,labels, ntics, nlabels require resize & redraw. */ - /* Change to value requires redraw and possible resize if autoscale */ - - was_resized = - gw->gauge.v0 != oldgw->gauge.v0 || - gw->gauge.v1 != oldgw->gauge.v1 || - gw->gauge.ntics != oldgw->gauge.ntics || - gw->gauge.nlabels != oldgw->gauge.nlabels || - gw->gauge.labels != oldgw->gauge.labels ; - - if( (gw->gauge.autoScaleUp && gw->gauge.value > gw->gauge.v1) || - (gw->gauge.autoScaleDown && gw->gauge.value < gw->gauge.v1/3 )) - { - AutoScale(gw) ; - was_resized = TRUE ; - } - - if( was_resized ) { - if( gw->label.resize ) - GaugeSize(gw, &gw->core.width, &gw->core.height, DEF_LEN) ; - else - GaugeResize(new) ; - } - - if( gw->gauge.update != oldgw->gauge.update ) - { - if( gw->gauge.update > 0 ) - EnableUpdate(gw) ; - else - DisableUpdate(gw) ; - } - - if( gw->core.background_pixel != oldgw->core.background_pixel ) - { - XtReleaseGC(new, gw->gauge.inverse_GC) ; - gw->gauge.inverse_GC = Get_GC(gw, gw->core.background_pixel) ; - } - - return was_resized || gw->gauge.value != oldgw->gauge.value || - XtIsSensitive(old) != XtIsSensitive(new); -} - - -static XtGeometryResult -GaugeQueryGeometry (Widget w, - XtWidgetGeometry *intended, - XtWidgetGeometry *preferred) -{ - register GaugeWidget gw = (GaugeWidget)w; - - if( intended->width == w->core.width && - intended->height == w->core.height ) - return XtGeometryNo ; - - preferred->request_mode = CWWidth | CWHeight; - GaugeSize(gw, &preferred->width, &preferred->height, DEF_LEN) ; - - if( (!(intended->request_mode & CWWidth) || - intended->width >= preferred->width) && - (!(intended->request_mode & CWHeight) || - intended->height >= preferred->height) ) - return XtGeometryYes; - else - return XtGeometryAlmost; -} - - - - -/**************************************************************** - * - * Action Procedures - * - ****************************************************************/ - -static void -GaugeSelect (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) -{ - GaugeWidget gw = (GaugeWidget)w ; - Atom seln = XA_PRIMARY ; - - if( gw->gauge.selected != None ) { - XtDisownSelection(w, gw->gauge.selected, CurrentTime) ; - gw->gauge.selected = None ; - } - - if( *num_params > 0 ) { - seln = XInternAtom(XtDisplay(w), params[0], False) ; - printf("atom %s is %ld\n", params[0], seln) ; - } - - if( ! XtOwnSelection(w, seln, event->xbutton.time, GaugeConvert, - GaugeLoseSel, GaugeDoneSel) ) - { - /* in real code, this error message would be replaced by - * something more elegant, or at least deleted - */ - - fprintf(stderr, "Gauge failed to get selection, try again\n") ; - } - else - { - gw->gauge.selected = TRUE ; - gw->gauge.selstr = (String)XtMalloc(4*sizeof(int)) ; - sprintf(gw->gauge.selstr, "%d", gw->gauge.value) ; - GaugeExpose(w,0,0) ; - } -} - - -static Boolean -GaugeConvert (Widget w, - Atom *selection, /* usually XA_PRIMARY */ - Atom *target, /* requested target */ - Atom *type, /* returned type */ - XtPointer *value, /* returned value */ - u_long *length, /* returned length */ - int *format) /* returned format */ -{ - GaugeWidget gw = (GaugeWidget)w ; - XSelectionRequestEvent *req ; - - printf( "requesting selection %s:%s\n", - XGetAtomName(XtDisplay(w),*selection), - XGetAtomName(XtDisplay(w),*target)); - -#ifdef HAVE_XMU - if( *target == XA_TARGETS(XtDisplay(w)) ) - { - Atom *rval, *stdTargets ; - u_long stdLength ; - - /* XmuConvertStandardSelection can handle this. This function - * will return a list of standard targets. We prepend TEXT, - * STRING and INTEGER to the list and return it. - */ - - req = XtGetSelectionRequest(w, *selection, NULL) ; - XmuConvertStandardSelection(w, req->time, selection, target, - type, (XPointer*)&stdTargets, &stdLength, format) ; - - *type = XA_ATOM ; /* TODO: needed? */ - *length = stdLength + 3 ; - rval = (Atom *) XtMalloc(sizeof(Atom)*(stdLength+3)) ; - *value = (XtPointer) rval ; - *rval++ = XA_INTEGER ; - *rval++ = XA_STRING ; - *rval++ = XA_TEXT(XtDisplay(w)) ; - memcpy((char *)rval, (char *)stdTargets, stdLength*sizeof(Atom)) ; - XtFree((char*) stdTargets) ; - *format = 8*sizeof(Atom) ; /* TODO: needed? */ - return True ; - } - - else -#endif - if( *target == XA_INTEGER ) - { - *type = XA_INTEGER ; - *length = 1 ; - *value = (XtPointer) &gw->gauge.value ; - *format = 8*sizeof(int) ; - return True ; - } - - else if( *target == XA_STRING -#ifdef HAVE_XMU - || - *target == XA_TEXT(XtDisplay(w)) -#endif - ) - { - *type = *target ; - *length = strlen(gw->gauge.selstr)*sizeof(char) ; - *value = (XtPointer) gw->gauge.selstr ; - *format = 8 ; - return True ; - } - - else - { - /* anything else, we just give it to XmuConvertStandardSelection() */ -#ifdef HAVE_XMU - req = XtGetSelectionRequest(w, *selection, NULL) ; - if( XmuConvertStandardSelection(w, req->time, selection, target, - type, (XPointer *) value, length, format) ) - return True ; - else -#endif - { - printf( - "Gauge: requestor is requesting unsupported selection %s:%s\n", - XGetAtomName(XtDisplay(w),*selection), - XGetAtomName(XtDisplay(w),*target)); - return False ; - } - } -} - - - -static void -GaugeLoseSel (Widget w, - Atom *selection) /* usually XA_PRIMARY */ -{ - GaugeWidget gw = (GaugeWidget)w ; - Display *dpy = XtDisplay(w) ; - Window win = XtWindow(w) ; - - if( gw->gauge.selstr != NULL ) { - XtFree(gw->gauge.selstr) ; - gw->gauge.selstr = NULL ; - } - - gw->gauge.selected = False ; - XClearWindow(dpy,win) ; - GaugeExpose(w,0,0) ; -} - - -static void -GaugeDoneSel (Widget w, - Atom *selection, /* usually XA_PRIMARY */ - Atom *target) /* requested target */ -{ - /* selection done, anything to do? */ -} - - -static void -GaugePaste (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) -{ - Atom seln = XA_PRIMARY ; - - if( *num_params > 0 ) { - seln = XInternAtom(XtDisplay(w), params[0], False) ; - printf("atom %s is %ld\n", params[0], seln) ; - } - - /* try for integer value first */ - XtGetSelectionValue(w, seln, XA_INTEGER, - GaugeGetSelCB, (XtPointer)XA_INTEGER, - event->xbutton.time) ; -} - -static void -GaugeGetSelCB (Widget w, - XtPointer client, - Atom *selection, - Atom *type, - XtPointer value, - u_long *length, - int *format) -{ - Display *dpy = XtDisplay(w) ; - Atom target = (Atom)client ; - int *iptr ; - char *cptr ; - - if( *type == XA_INTEGER ) { - iptr = (int *)value ; - XawGaugeSetValue(w, *iptr) ; - } - - else if( *type == XA_STRING -#ifdef HAVE_XMU - || - *type == XA_TEXT(dpy) -#endif - ) - { - cptr = (char *)value ; - XawGaugeSetValue(w, atoi(cptr)) ; - } - - /* failed, try string */ - else if( *type == None && target == XA_INTEGER ) - XtGetSelectionValue(w, *selection, XA_STRING, - GaugeGetSelCB, (XtPointer)XA_STRING, - CurrentTime) ; -} - - - -/**************************************************************** - * - * Public Procedures - * - ****************************************************************/ - - - /* Change gauge value. Only undraw or draw what needs to be - * changed. - */ - -void -XawGaugeSetValue (Widget w, - Cardinal value) -{ - GaugeWidget gw = (GaugeWidget)w ; - int oldvalue ; - GC gc ; - - if( gw->gauge.selected != None ) { - XtDisownSelection(w, gw->gauge.selected, CurrentTime) ; - gw->gauge.selected = None ; - } - - if( !XtIsRealized(w) ) { - gw->gauge.value = value ; - return ; - } - - /* need to rescale? */ - if(( gw->gauge.autoScaleUp && value > gw->gauge.v1) || - (gw->gauge.autoScaleDown && value < gw->gauge.v1/3 )) - { - XtVaSetValues(w, XtNvalue, value, 0) ; - return ; - } - - oldvalue = gw->gauge.value ; - gw->gauge.value = value ; - - gc = XtIsSensitive(w) ? gw->label.normal_GC : gw->label.gray_GC ; - GaugeMercury(XtDisplay(w), XtWindow(w), gc, gw, oldvalue,value) ; -} - - -Cardinal -XawGaugeGetValue (Widget w) -{ - GaugeWidget gw = (GaugeWidget)w ; - return gw->gauge.value ; -} - - - - -/**************************************************************** - * - * Private Procedures - * - ****************************************************************/ - - /* draw the mercury over a specific region */ - -static void -GaugeMercury (Display *dpy, - Window win, - GC gc, - GaugeWidget gw, - Cardinal val0, - Cardinal val1) -{ - int v0 = gw->gauge.v0 ; - int v1 = gw->gauge.v1 ; - int vd = v1 - v0 ; - Dimension len ; /* length (width or height) of gauge */ - Position e0, e1 ; /* gauge ends */ - Position p0, p1 ; /* mercury ends */ - int y ; /* vertical (horizontal) position */ - Boolean undraw = FALSE ; - - len = gw->gauge.orientation == XtorientHorizontal ? - gw->core.width : gw->core.height ; - - e0 = gw->gauge.margin0 ; /* left (top) end */ - e1 = len - gw->gauge.margin1 -1 ; /* right (bottom) end */ - - if( vd <= 0 ) vd = 1 ; - - if( val0 < v0 ) val0 = v0 ; - else if( val0 > v1 ) val0 = v1 ; - if( val1 < v0 ) val1 = v0 ; - else if( val1 > v1 ) val1 = v1 ; - - p0 = (val0-v0)*(e1-e0-1)/vd ; - p1 = (val1-v0)*(e1-e0-1)/vd ; - - if( p1 == p0 ) - return ; - - y = gw->gauge.gmargin ; - - if( p1 < p0 ) - { - Position tmp = p0 ; - p0 = p1 ; - p1 = tmp ; - gc = gw->label.normal_GC ; - XSetForeground(dpy,gc, gw->core.background_pixel) ; - undraw = TRUE ; - } - - if( gw->gauge.orientation == XtorientHorizontal ) - XFillRectangle(dpy,win,gc, e0+p0+1,y+1, p1-p0,GA_WID) ; - else - XFillRectangle(dpy,win,gc, y+1,e1-p1, GA_WID,p1-p0) ; - - if( undraw ) - XSetForeground(dpy,gc, gw->label.foreground) ; -} - - - -/* Search the labels, find the largest one. */ -/* TODO: handle vertical fonts? */ - -static void -MaxLabel (GaugeWidget gw, - Dimension *wid, /* max label width */ - Dimension *hgt, /* max label height */ - Dimension *w0, /* width of first label */ - Dimension *w1) /* width of last label */ -{ - char lstr[80], *lbl ; - int w ; - XFontStruct *font = gw->label.font ; - int i ; - int lw = 0; - int v0 = gw->gauge.v0 ; - int dv = gw->gauge.v1 - v0 ; - int n = gw->gauge.nlabels ; - - if( n > 0 ) - { - if( --n <= 0 ) {n = 1 ; v0 += dv/2 ;} - - /* loop through all labels, figure out how much room they - * need. - */ - w = 0 ; - for(i=0; i<gw->gauge.nlabels; ++i) - { - if( gw->gauge.labels == NULL ) /* numeric labels */ - sprintf(lbl = lstr,"%d", v0 + i*dv/n) ; - else - lbl = gw->gauge.labels[i] ; - - if( lbl != NULL ) { - lw = XTextWidth(font, lbl, strlen(lbl)) ; - w = Max( w, lw ) ; - } - else - lw = 0 ; - - if( i == 0 && w0 != NULL ) *w0 = lw ; - } - if( w1 != NULL ) *w1 = lw ; - - *wid = w ; - *hgt = font->max_bounds.ascent + font->max_bounds.descent ; - } - else - *wid = *hgt = 0 ; -} - - -/* Determine the preferred size for this widget. choose 100x100 for - * debugging. - */ - -static void -GaugeSize (GaugeWidget gw, - Dimension *wid, - Dimension *hgt, - Dimension min_len) -{ - int w,h ; /* width, height of gauge */ - int vmargin ; /* vertical margin */ - int hmargin ; /* horizontal margin */ - - hmargin = gw->label.internal_width ; - vmargin = gw->label.internal_height ; - - /* find total height (width) of contents */ - - - /* find minimum size for undecorated gauge */ - - if( gw->gauge.orientation == XtorientHorizontal ) - { - w = min_len ; - h = GA_WID+2 ; /* gauge itself + edges */ - } - else - { - w = GA_WID+2 ; - h = min_len ; - } - - if( gw->gauge.ntics > 0 ) - { - if( gw->gauge.orientation == XtorientHorizontal ) - { - w = Max(w, gw->gauge.ntics*3) ; - h += vmargin + TIC_LEN ; - } - else - { - w += hmargin + TIC_LEN ; - h = Max(h, gw->gauge.ntics*3) ; - } - } - - - /* If labels are requested, this gets a little interesting. - * We want the end labels centered on the ends of the gauge and - * the centers of the labels evenly spaced. The labels at the ends - * will not be the same width, meaning that the gauge itself need - * not be centered in the widget. - * - * First, determine the spacing. This is the width of the widest - * label, plus the internal margin. Total length of the gauge is - * spacing * (nlabels-1). To this, we add half the width of the - * left-most label and half the width of the right-most label - * to get the entire desired width of the widget. - */ - if( gw->gauge.nlabels > 0 ) - { - Dimension lwm, lw0, lw1 ; /* width of max, left, right labels */ - Dimension lh ; - - MaxLabel(gw,&lwm,&lh, &lw0,&lw1) ; - - if( gw->gauge.orientation == XtorientHorizontal ) - { - lwm = (lwm+hmargin) * (gw->gauge.nlabels-1) + (lw0+lw1)/2 ; - w = Max(w, lwm) ; - h += lh + vmargin ; - } - else - { - lh = lh*gw->gauge.nlabels + (gw->gauge.nlabels - 1)*vmargin ; - h = Max(h, lh) ; - w += lwm + hmargin ; - } - } - - w += hmargin*2 ; - h += vmargin*2 ; - - *wid = w ; - *hgt = h ; -} - - - -static void -AutoScale (GaugeWidget gw) -{ - static int scales[3] = {1,2,5} ; - int sptr = 0, smult=1 ; - - if( gw->gauge.autoScaleDown ) - gw->gauge.v1 = 0 ; - while( gw->gauge.value > gw->gauge.v1 ) - { - if( ++sptr > 2 ) { - sptr = 0 ; - smult *= 10 ; - } - gw->gauge.v1 = scales[sptr] * smult ; - } -} - -static void -EnableUpdate (GaugeWidget gw) -{ - gw->gauge.intervalId = - XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)gw), - gw->gauge.update * MS_PER_SEC, GaugeGetValue, - (XtPointer)gw) ; -} - -static void -DisableUpdate (GaugeWidget gw) -{ - XtRemoveTimeOut(gw->gauge.intervalId) ; -} - -static void -GaugeGetValue (XtPointer clientData, - XtIntervalId *intervalId) -{ - GaugeWidget gw = (GaugeWidget)clientData ; - Cardinal value ; - - if( gw->gauge.update > 0 ) - EnableUpdate(gw) ; - - if( gw->gauge.getValue != NULL ) - { - XtCallCallbackList((Widget)gw, gw->gauge.getValue, (XtPointer)&value); - XawGaugeSetValue((Widget)gw, value) ; - } -} - - -static GC -Get_GC (GaugeWidget gw, - Pixel fg) -{ - XGCValues values ; -#define vmask GCForeground -#define umask (GCBackground|GCSubwindowMode|GCGraphicsExposures|GCDashOffset\ - |GCFont|GCDashList|GCArcMode) - - values.foreground = fg ; - - return XtAllocateGC((Widget)gw, 0, vmask, &values, 0L, umask) ; -} diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwgauge.h --- a/lwlib/xlwgauge.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* Gauge 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: Gauge.h 1.1 */ - -/* - * Gauge.h - Gauge widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: July 8, 1997 - */ - -#ifndef _XawGauge_h -#define _XawGauge_h - -/*********************************************************************** - * - * Gauge Widget - * - * The Gauge widget looks something like a thermometer. Application - * defines the values at the ends of the range and the current value - * and Gauge draws accordingly. Gauge does not accept input. - * - ***********************************************************************/ - -#include ATHENA_Label_h_ - -/* Resources: - - Name Class RepType Default Value - ---- ----- ------- ------------- - value Value Cardinal 0 - minValue MinValue Cardinal 0 - maxValue MaxValue Cardinal 100 - ntics NTics Cardinal 0 + - nlabels NLabels Cardinal 0 ++ - labels Labels String * NULL +++ - orientation Orientation XtOrientation horizontal - autoScaleUp AutoScaleUp Boolean FALSE ++++ - autoScaleDown AutoScaleDown Boolean FALSE ++++ - getValue Callback XtCallbackList NULL +++++ - update Interval int 0 (seconds) = disabled - - encoding Encoding unsigned char XawTextEncoding8bit - font Font XFontStruct* XtDefaultFont - foreground Foreground Pixel XtDefaultForeground - internalHeight Height Dimension 2 - internalWidth Width Dimension 4 - resize Resize Boolean True - background Background Pixel XtDefaultBackground - bitmap Pixmap Pixmap None - border BorderColor Pixel XtDefaultForeground - borderWidth BorderWidth Dimension 1 - cursor Cursor Cursor None - cursorName Cursor String NULL - destroyCallback Callback XtCallbackList NULL - height Height Dimension varies - insensitiveBorder Insensitive Pixmap Gray - mappedWhenManaged MappedWhenManaged Boolean True - pointerColor Foreground Pixel XtDefaultForeground - pointerColorBackground Background Pixel XtDefaultBackground - sensitive Sensitive Boolean True - width Width Dimension text width - x Position Position 0 - y Position Position 0 - - + Ntics sets the number of tic marks next to the gauge. If 0, no - tic marks will be drawn. - ++ Nlabels sets the number of labels next to the gauge. - +++ 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. - ++++ AutoScale allows the gauge to set its own value limits. Default is - False unless upper & lower limits are both 0. - - +++++ The GetValue() callback proc is called with these arguments: - static void - myGetValue(gauge, client, rval) - Widget gauge ; - XtPointer client ; - XtPointer rval ; - { - *(Cardinal *)rval = value ; - } - -*/ - -/* - * Resource names not provided in StringDefs.h - */ - -#ifndef XtNvalue -#define XtNvalue "value" -#define XtCValue "Value" -#endif - -#ifndef XtNorientation -#define XtNorientation "orientation" -#define XtCOrientation "Orientation" -#endif - -#define XtNntics "ntics" -#define XtCNTics "NTics" - -#ifndef XtNnlabels -#define XtNnlabels "nlabels" -#define XtCNLabels "NLabels" -#endif -#ifndef XtNlabels -#define XtNlabels "labels" -#define XtCLabels "Labels" -#endif - -#ifndef XtNminValue -#define XtNminValue "minValue" -#define XtCMinValue "MinValue" -#endif -#ifndef XtNmaxValue -#define XtNmaxValue "maxValue" -#define XtCMaxValue "MaxValue" -#endif - -#ifndef XtNautoScaleUp -#define XtNautoScaleUp "autoScaleUp" -#define XtCAutoScaleUp "AutoScaleUp" -#define XtNautoScaleDown "autoScaleDown" -#define XtCAutoScaleDown "AutoScaleDown" -#endif - -#ifndef XtNupdate -#define XtNupdate "update" -#endif - -#ifndef XtNgetValue -#define XtNgetValue "getValue" -#endif - - -/* Class record constants */ - -extern WidgetClass gaugeWidgetClass; - -typedef struct _GaugeClassRec *GaugeWidgetClass; -typedef struct _GaugeRec *GaugeWidget; - - -_XFUNCPROTOBEGIN - -extern void XawGaugeSetValue( -#if NeedFunctionPrototypes - Widget gauge, - Cardinal value -#endif -); - -extern Cardinal XawGaugeGetValue( -#if NeedFunctionPrototypes - Widget gauge -#endif -); - -_XFUNCPROTOEND - -#endif /* _XawGauge_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwgaugeP.h --- a/lwlib/xlwgaugeP.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* Gauge 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. */ - -/* - * GaugeP.h - Gauge widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: July 9, 1997 - */ - -#ifndef _XawGaugeP_h -#define _XawGaugeP_h - -/*********************************************************************** - * - * Gauge Widget Private Data - * - * Gauge has little in common with the label widget, but can make use - * of some label resources, so is subclassed from label. - * - ***********************************************************************/ - -#include "xlwgauge.h" -#include ATHENA_LabelP_h_ - -/* New fields for the Gauge widget class record */ - -typedef struct {XtPointer extension;} GaugeClassPart; - -/* Full class record declaration */ -typedef struct _GaugeClassRec { - CoreClassPart core_class; - SimpleClassPart simple_class; -#ifdef _ThreeDP_h - ThreeDClassPart threeD_class; -#endif - LabelClassPart label_class; - GaugeClassPart gauge_class; -} GaugeClassRec; - -extern GaugeClassRec gaugeClassRec; - -/* New fields for the Gauge widget record */ -typedef struct { - /* resources */ - int value, v0,v1 ; - int ntics, nlabels ; - String *labels ; - XtOrientation orientation ; - Boolean autoScaleUp ; /* scales automatically */ - Boolean autoScaleDown ; /* scales automatically */ - int update ; /* update interval */ - XtCallbackList getValue ; /* proc to call to fetch a point */ - - /* private state */ - Dimension gmargin ; /* edges <-> gauge */ - Dimension tmargin ; /* top (left) edge <-> tic marks */ - Dimension lmargin ; /* tic marks <-> labels */ - Dimension margin0 ; /* left/bottom margin */ - Dimension margin1 ; /* right/top margin */ - XtIntervalId intervalId ; - Atom selected ; - String selstr ; /* selection string, if any */ - GC inverse_GC ; -} GaugePart; - - -/**************************************************************** - * - * Full instance record declaration - * - ****************************************************************/ - -typedef struct _GaugeRec { - CorePart core; - SimplePart simple; -#ifdef _ThreeDP_h - ThreeDPart threeD; -#endif - LabelPart label; - GaugePart gauge; -} GaugeRec; - -#endif /* _XawGaugeP_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwgcs.c --- a/lwlib/xlwgcs.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,545 +0,0 @@ - /* 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. */ - -/* - * Gcs.c - Utility functions to allocate GCs. - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: Sept 29, 1998 - */ - -/* Functions: - * - * GC AllocFgGC(w, fg, font) - * Return a GC with foreground set as specified. - * If font is None, then the returned GC is allocated with font specified - * as a "don't care" value. - * - * GC - * AllocBackgroundGC(w, font) - * Return a GC with the foreground set to the widget's background color. - * - * GC - * AllocGreyGC(w, fg, font, contrast, be_nice_to_cmap) - * Widget w ; - * Pixel fg ; - * Font font ; - * int contrast ; - * int be_nice_to_cmap ; - * - * Return a GC suitable for rendering a widget in its "inactive" color. - * Normally returns a GC with a color somewhere between the widget's - * background color and the specified foreground. If font is None, then - * the returned GC is allocated with font specified as "don't care". - * If be_nice_to_cmap is True, the returned GC is created using a 50% - * dither instead of a new color. - * - * - * GC - * AllocShadeGC(w, fg, bg, font, contrast, be_nice_to_cmap) - * Widget w ; - * Pixel fg, bg ; - * Font font ; - * int contrast ; - * int be_nice_to_cmap ; - * - * Return a GC suitable for rendering in a shade somewhere between - * bg and fg, as determined by contrast (0 = bg, 100 = fg) - * If font is None, then the returned GC is allocated with - * font specified as "don't care". If be_nice_to_cmap - * is True, the returned GC is created using a 50% dither - * instead of a new color. - * - * - * GC - * AllocTopShadowGC(w, contrast, be_nice_to_cmap) - * Return a GC suitable for rendering the "top shadow" decorations of - * a widget. Returns a GC with foreground computed from widget's - * background color and contrast. If be_nice_to_cmap is True, the - * returned GC will use a foreground color of white. If widget depth - * is 1, this function will use a foreground color of black. - * - * GC - * AllocBotShadowGC(w, contrast, be_nice_to_cmap) - * Return a GC suitable for rendering the "bottom shadow" decorations - * of a widget. Returns a GC with foreground computed from widget's - * background color and contrast. If be_nice_to_cmap is True, the - * returned GC will use a foreground color of black. - * - * GC - * AllocArmGC(w, contrast, be_nice_to_cmap) - * Return a GC suitable for rendering the "armed" decorations of a - * widget. This GC would typically be used to fill in the widget's - * background. Returns a GC with foreground computed from widget's - * background color and contrast. If be_nice_to_cmap is True, the - * returned GC will use a foreground color of black and a 50% dither. - * - * - * void - * Draw3dBox(w, x,y,wid,hgt,s, topgc, botgc) - * Utility function. Draws a raised shadow box with outside dimensions - * as specified by x,y,wid,hgt and shadow width specified by s. - * A lowered shadow box may be generated by swapping topgc and botgc. - * - */ - -#include <config.h> -#include <stdio.h> - -#include <X11/Xlib.h> -#include <X11/IntrinsicP.h> -#include <X11/StringDefs.h> -#include "../src/xmu.h" -#include "xlwgcs.h" - - /* Color & GC allocation. - * - * Frame widgets use the following graphics contexts: - * - * Foreground tab label text drawn this way - * Insensitive Fg foreground color greyed out. - * Background frame background color - * Top shadow upper-left highlight around widget - * Bottom shadow lower-right highlight around widget - * Arm shadow button pressed and ready to be released - * - * - * GC's are defined as follows, depending on attributes and - * window depth: - * - * Monochrome: - * Foreground = foreground color attribute or BlackPixel() - * Grey = Foreground color + 50% dither - * Background = background color attribute or WhitePixel() - * top shadow = foreground - * bottom shadow = foreground - * arm shadow = (what?) - * - * Color, beNiceToColormap=true: - * Foreground = foreground color attribute or BlackPixel() - * Grey = Foreground color + 50% dither - * Background = background color attribute or WhitePixel() - * top shadow = white - * bottom shadow = black - * arm shadow = (what?) - * - * Color, beNiceToColormap=false: - * Foreground = foreground color attribute or BlackPixel() - * Grey = (foreground color + background color)/2 - * Background = background color attribute or WhitePixel() - * top shadow = background * 1.2 - * bottom shadow = background * .6 - * arm shadow = background * .8 - * - * Special cases: - * If background is white, ?? - * if background is black, ?? - * - * - * 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.) - */ - - - -#if XtSpecificationRelease < 5 - -static GC XtAllocateGC(Widget, int, u_long, XGCValues *, u_long, u_long) ; - -#endif - - -#if NeedFunctionPrototypes -static Pixmap getDitherPixmap(Widget, int contrast) ; -#else -static Pixmap getDitherPixmap() ; -#endif - - /* return a GC with the specified foreground and optional font */ - -GC -AllocFgGC(Widget w, Pixel fg, Font font) -{ - XGCValues values ; - u_long vmask, dcmask ; - - values.foreground = fg ; - values.font = font ; - - if( font != None ) { - vmask = GCForeground|GCFont ; - dcmask = GCSubwindowMode|GCDashOffset| - GCDashList|GCArcMode|GCBackground|GCGraphicsExposures ; - } else { - vmask = GCForeground ; - dcmask = GCFont|GCSubwindowMode|GCDashOffset| - GCDashList|GCArcMode|GCBackground|GCGraphicsExposures ; - } - - return XtAllocateGC(w, w->core.depth, vmask, &values, 0L, dcmask) ; -} - - - /* return gc with widget background color as the foreground */ - -GC -AllocBackgroundGC(Widget w, Font font) -{ - return AllocFgGC(w, w->core.background_pixel, font) ; -} - - - /* Allocate an "inactive" GC. Color is grey (possibly via - * dither pattern). - */ - -GC -AllocGreyGC(Widget w, Pixel fg, Font font, int contrast, Bool be_nice_to_cmap) -{ - return AllocShadeGC(w, fg, w->core.background_pixel, - font, contrast, be_nice_to_cmap) ; -} - - - /* Allocate a GC somewhere between two colors. */ - -GC -AllocShadeGC(Widget w, Pixel fg, Pixel bg, Font font, - int contrast, Bool be_nice_to_cmap) -{ - XGCValues values ; - u_long vmask, dcmask ; - - values.foreground = fg ; - values.background = bg ; - values.font = font ; - - if( font != None ) { - vmask = GCForeground|GCFont ; - dcmask = GCSubwindowMode|GCDashOffset| - GCDashList|GCArcMode|GCGraphicsExposures ; - } else { - vmask = GCForeground; - dcmask = GCFont|GCSubwindowMode|GCDashOffset| - GCDashList|GCArcMode|GCGraphicsExposures ; - } -#ifdef HAVE_XMU - if( be_nice_to_cmap || w->core.depth == 1) - { - if( contrast <= 5 ) - values.foreground = bg ; - else if( contrast >= 95 ) - values.foreground = fg ; - else { - vmask |= GCBackground|GCStipple|GCFillStyle ; - values.fill_style = FillOpaqueStippled ; - values.stipple = getDitherPixmap(w, contrast) ; - } - - return XtAllocateGC(w, w->core.depth, vmask, &values, 0L, dcmask) ; - } - else -#endif - { - dcmask |= GCBackground ; - values.foreground = AllocGreyPixel(w, fg, bg, contrast) ; - return XtAllocateGC(w, w->core.depth, vmask, &values, 0L, dcmask) ; - } -} - - /* return top-shadow gc. */ - -GC -AllocTopShadowGC(Widget w, int contrast, Bool be_nice_to_cmap) -{ - Screen *scr = XtScreen (w); - XGCValues values ; - - if( w->core.depth == 1 ) - values.foreground = BlackPixelOfScreen(scr) ; - else if( be_nice_to_cmap ) - values.foreground = WhitePixelOfScreen(scr) ; - else - values.foreground = AllocShadowPixel(w, 100+contrast) ; - - return XtAllocateGC(w, w->core.depth, - GCForeground, &values, - 0L, - GCBackground|GCFont|GCSubwindowMode|GCGraphicsExposures| - GCDashOffset|GCDashList|GCArcMode) ; -} - - /* return bottom-shadow gc. */ - -GC -AllocBotShadowGC(Widget w, int contrast, Bool be_nice_to_cmap) -{ - Screen *scr = XtScreen (w); - XGCValues values ; - - if( w->core.depth == 1 || be_nice_to_cmap ) - values.foreground = BlackPixelOfScreen(scr) ; - else - values.foreground = AllocShadowPixel(w, 100-contrast) ; - - return XtAllocateGC(w, w->core.depth, - GCForeground, &values, - 0L, - GCBackground|GCFont|GCSubwindowMode|GCGraphicsExposures| - GCDashOffset|GCDashList|GCArcMode) ; -} - - /* return arm-shadow gc. */ - -GC -AllocArmGC(Widget w, int contrast, Bool be_nice_to_cmap) -{ - Screen *scr = XtScreen (w); - XGCValues values ; - - /* Not clear exactly what we should do here. Take a look at - * Xaw3d to see what they do. - */ -#ifdef HAVE_XMU - if( w->core.depth == 1 || be_nice_to_cmap ) - { - values.background = w->core.background_pixel ; - if( values.background == BlackPixelOfScreen(scr) ) - values.foreground = WhitePixelOfScreen(scr) ; - else - values.foreground = BlackPixelOfScreen(scr) ; - values.fill_style = FillStippled ; - values.stipple = XmuCreateStippledPixmap(XtScreen(w), 1L, 0L, 1) ; - - return XtAllocateGC(w, w->core.depth, - GCForeground|GCBackground|GCStipple|GCFillStyle, - &values, 0L, - GCFont|GCSubwindowMode|GCGraphicsExposures| - GCDashOffset|GCDashList|GCArcMode) ; - } - else -#endif - { - values.foreground = AllocShadowPixel(w, 100-contrast) ; - return XtAllocateGC(w, w->core.depth, - GCForeground, &values, - 0L, - GCBackground|GCFont|GCSubwindowMode|GCGraphicsExposures| - GCDashOffset|GCDashList|GCArcMode) ; - } -} - - -Pixel -AllocShadowPixel(Widget w, int scale) -{ - XColor get_c, set_c ; - Display *dpy = XtDisplay(w) ; - Screen *scr = XtScreen(w) ; - Colormap cmap ; - Pixel maxColor ; - - cmap = w->core.colormap ; - - get_c.pixel = w->core.background_pixel ; - if( get_c.pixel == WhitePixelOfScreen(scr) || - get_c.pixel == BlackPixelOfScreen(scr) ) - { - /* what we *ought* to do is choose gray75 as the base color, - * or perhaps gray83. Instead, we choose colors that are - * the same as ThreeD would choose. - */ - if( scale > 100 ) scale = 200 - scale ; - set_c.red = set_c.green = set_c.blue = 65535*scale/100 ; - } - else - { - XQueryColor(dpy, cmap, &get_c) ; - /* adjust scale so that brightest component does not - * exceed 65535; otherwise hue would change. - */ - if( scale > 100 ) { - maxColor = Max(get_c.red, Max(get_c.green, get_c.blue)) ; - if( scale*maxColor > 65535*100 ) - scale = 65535*100/maxColor ; - } - set_c.red = scale * get_c.red / 100 ; - set_c.green = scale * get_c.green / 100 ; - set_c.blue = scale * get_c.blue / 100 ; - } - set_c.flags = DoRed | DoGreen | DoBlue ; - if( XAllocColor(dpy, cmap, &set_c) ) - return set_c.pixel ; - else if( scale > 100 ) - return WhitePixelOfScreen(scr) ; - else - return BlackPixelOfScreen(scr) ; -} - - - /* Allocate a pixel partway between foreground and background */ - - -Pixel -AllocGreyPixel(Widget w, Pixel fg, Pixel bg, int scale) -{ - XColor get_cf, get_cb ; - Display *dpy = XtDisplay(w) ; - Colormap cmap ; - - cmap = w->core.colormap ; - - get_cf.pixel = fg ; - get_cb.pixel = bg ; - - XQueryColor(dpy, cmap, &get_cf) ; - XQueryColor(dpy, cmap, &get_cb) ; - - return AllocGreyPixelC(w, &get_cf, &get_cb, scale) ; -} - - - - /* Allocate a pixel partway between foreground and background */ - - -Pixel -AllocGreyPixelC(Widget w, XColor *fg, XColor *bg, int scale) -{ - XColor set_c ; - Display *dpy = XtDisplay(w) ; - int r,g,b ; - Colormap cmap = w->core.colormap ; - - r = (fg->red * scale + bg->red * (100-scale)) / 100 ; - g = (fg->green * scale + bg->green * (100-scale)) / 100 ; - b = (fg->blue * scale + bg->blue * (100-scale)) / 100 ; - - if( scale > 100 || scale < 0 ) /* look out for overflow */ - { - int minc, maxc ; - maxc = Max(r, Max(g,b)) ; - minc = Min(r, Min(g,b)) ; - if( maxc > 65535 ) - { - maxc /= 16 ; - r = r*(65535/16) / maxc ; - g = g*(65535/16) / maxc ; - b = b*(65535/16) / maxc ; - } - if( minc < 0 ) - { - r = Max(r,0) ; - g = Max(g,0) ; - b = Max(b,0) ; - } - } - - set_c.red = r ; set_c.green = g ; set_c.blue = b ; - set_c.flags = DoRed | DoGreen | DoBlue ; - (void)XAllocColor(dpy, cmap, &set_c) ; - return set_c.pixel ; -} - - - - - - /* draw a 3-d box */ - -void -Draw3dBox(Widget w, int x, int y, int wid, int hgt, int s, GC topgc, GC botgc) -{ - Display *dpy = XtDisplay(w) ; - Window win = XtWindow(w) ; - - if( s == 0 ) return ; - - if( s == 1 ) { - XDrawLine(dpy,win,botgc, x,y+hgt-1, x+wid-1,y+hgt-1) ; - XDrawLine(dpy,win,botgc, x+wid-1,y, x+wid-1,y+hgt-1) ; - XDrawLine(dpy,win,topgc, x,y, x,y+hgt-1) ; - XDrawLine(dpy,win,topgc, x,y, x+wid-1,y) ; - } - else - { - XPoint pts[6] ; - - /* bottom-right shadow */ - pts[0].x = x ; pts[0].y = y + hgt ; - pts[1].x = s ; pts[1].y = -s ; - pts[2].x = wid-2*s ; pts[2].y = 0 ; - pts[3].x = 0 ; pts[3].y = -(hgt-2*s) ; - pts[4].x = s ; pts[4].y = -s ; - pts[5].x = 0 ; pts[5].y = hgt ; - XFillPolygon(dpy,win,botgc, pts,6, Nonconvex,CoordModePrevious) ; - - /* top-left shadow */ - pts[0].x = x ; pts[0].y = y ; - pts[1].x = wid ; pts[1].y = 0 ; - pts[2].x = -s ; pts[2].y = s ; - pts[3].x = -wid+2*s ; pts[3].y = 0 ; - pts[4].x = 0 ; pts[4].y = hgt-2*s ; - pts[5].x = -s ; pts[5].y = s ; - XFillPolygon(dpy,win,topgc, pts,6, Nonconvex,CoordModePrevious) ; - } -} - -#if XtSpecificationRelease < 5 - -static GC -XtAllocateGC(Widget w, int depth, u_long mask, XGCValues *values, - u_long dynamic, du_long ontcare) -{ - return XtGetGC(w, mask, values) ; -} -#endif - - -static u_char screen0[2] = {0,0} ; -static u_char screen25[2] = {0,0xaa} ; -static u_char screen75[2] = {0xaa,0xff} ; -static u_char screen100[2] = {0xff,0xff} ; - -static Pixmap -getDitherPixmap(Widget w, int contrast) -{ - Display *dpy = XtDisplay(w) ; - Window win = XtWindow(w) ; - - if( contrast <= 5 ) - return XCreateBitmapFromData(dpy,win, (char *)screen0, 2,2) ; - else if( contrast <= 37 ) - return XCreateBitmapFromData(dpy,win, (char *)screen25, 2,2) ; - else if( contrast <= 62 ) - return XmuCreateStippledPixmap(XtScreen(w), 1L, 0L, 1) ; - else if( contrast <= 95 ) - return XCreateBitmapFromData(dpy,win, (char *)screen75, 2,2) ; - else - return XCreateBitmapFromData(dpy,win, (char *)screen100, 2,2) ; -} diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwgcs.h --- a/lwlib/xlwgcs.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ - /* 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 - -/* Overview of functions provided here: - * - * AllocFgGC() - * Given a foreground pixel & a font, return an appropriate GC - * - * AllocBackgroundGC() - * Given a widget, return a GC for painting the background color - * - * 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 - * solid color, as appropriate. - * - * Contrast 0 = background color, 100 = foreground color. It is legal - * for contrast to be more than 100 or less than 0. - * - * AllocGreyGC() - * Given widget, foreground, font, contrast & be_nice_to_colormap, - * return a shade GC (see above) based on foreground and widget - * background. - * - * AllocTopShadowGC() - * Given widget, contrast & be_nice_to_colormap, return a GC suitable - * for rendering the top shadow. - * - * Contrast 0 = use background pixel. Contrast > 0 = use brighter - * colors. - * - * AllocBotShadowGC() - * Given widget, contrast & be_nice_to_colormap, return a GC suitable - * for rendering the bottom shadow. - * - * Contrast 0 = use background pixel. Contrast > 0 = use darker - * colors. - * - * AllocArmShadowGC() - * Given widget, contrast & be_nice_to_colormap, return a GC suitable - * for rendering the "armed" shadow. - * - * Contrast 0 = use background pixel. Contrast > 0 = use darker - * colors. - * - * AllocShadowPixel() - * Given a widget & scale factor, allocate & return a color darker - * or lighter than the background pixel, as determined by scale. - * - * Scale 100 = use background pixel. Scale > 100 = brighter color, - * Scale < 100 = darker color. - * - * AllocGreyPixel() - * Given two pixel values and scale factor, allocate & return a - * pixel value between them, according to scale. - * - * Scale == 0: background color - * Scale == 100: foreground color - * 0<Scale<100: intermediate color - * Scale > 100: more foreground - * Scale < 0: more background - * - * - * AllocGreyPixelC() - * Given two color values and scale factor, allocate & return a - * pixel value between them, according to scale. - * - * Scale == 0: background color - * Scale == 100: foreground color - * 0<Scale<100: intermediate color - * Scale > 100: more foreground - * Scale < 0: more background - * - * Draw3dBox() - * Given box dimensions, shadow width, top shadow GC & bottom shadow GC, - * draw a 3-d box. - */ - -#if NeedFunctionPrototypes - -extern GC AllocFgGC( Widget w, Pixel fg, Font font) ; -extern GC AllocBackgroundGC( Widget w, Font font) ; -extern GC AllocShadeGC( Widget w, Pixel fg, Pixel bg, Font, - int contrast, Bool ) ; -extern GC AllocGreyGC( Widget w, Pixel fg, Font, int, Bool ) ; -extern GC AllocTopShadowGC( Widget w, int contrast, int ) ; -extern GC AllocBotShadowGC( Widget w, int contrast, int ) ; -extern GC AllocArmGC( Widget w, int contrast, int) ; -extern Pixel AllocShadowPixel(Widget, int scale) ; -extern Pixel AllocGreyPixel(Widget, Pixel fg, Pixel bg, int scale) ; -extern Pixel AllocGreyPixelC(Widget, XColor *fg, XColor *bg, int scale) ; -extern void Draw3dBox(Widget w, int x, int y, int wid, int hgt, int s, - GC topgc, GC botgc) ; - -#if XtSpecificationRelease < 5 -extern GC XtAllocateGC(Widget, int depth, u_long mask, - XGCValues *, u_long dynamic, u_long dontcare) ; -#endif - -#else - -extern GC AllocFgGC() ; -extern GC AllocBackgroundGC() ; -extern GC AllocShadeGC() ; -extern GC AllocGreyGC() ; -extern GC AllocTopShadowGC() ; -extern GC AllocBotShadowGC() ; -extern GC AllocArmGC() ; -extern Pixel AllocShadowPixel() ; -extern Pixel AllocGreyPixel() ; -extern Pixel AllocGreyPixelC() ; -extern void Draw3dBox() ; - -#if XtSpecificationRelease < 5 -extern GC XtAllocateGC() ; -#endif - -#endif - -#endif /* GCS_H */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwmenu.c --- a/lwlib/xlwmenu.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/xlwmenu.c Mon Aug 13 11:20:41 2007 +0200 @@ -457,7 +457,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,26 +479,16 @@ Boolean firstp = True; while (*in) { - if (*in == '%' && *(in + 1) == '_') - in += 2; - else + char ch = massaged_resource_char[(unsigned char) *in++]; + if (ch) { - 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; - } + 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; @@ -516,21 +506,23 @@ 0, XtRImmediate, 0 } }; -/* 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. -*/ +/* + * 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. + */ static char* -parameterize_string (const char *string, const char *value) +parameterize_string (CONST char *string, CONST char *value) { - const char *percent; + char *percent; char *result; unsigned int done = 0; unsigned int ntimes; @@ -539,25 +531,24 @@ { result = XtMalloc(1); result[0] = '\0'; - return result; + return (result); } if (!value) value = ""; - for (ntimes = 1, percent = string; - (percent = strchr (percent, '%')); + for (ntimes = 1, result = (char *) string; (percent = strchr(result, '%')); ntimes++) - percent++; + result = &percent[1]; 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; - const char *p; + char *p; if (percent[1] == '%') { /* it's a real % */ @@ -1538,7 +1529,7 @@ 2 * mw->menu.vertical_margin + 2 * mw->menu.shadow_thickness); /* no left column decoration */ - *toggle_width = mw->menu.horizontal_margin + mw->menu.shadow_thickness; + *toggle_width = mw->menu.horizontal_margin + mw->menu.shadow_thickness;; *label_width = string_width_u (mw, resource_widget_value (mw, val)); *bindings_width = mw->menu.horizontal_margin + mw->menu.shadow_thickness; @@ -1882,7 +1873,7 @@ static struct _shadow_names { - const char * name; + CONST char * name; shadow_type type; } shadow_names[] = { @@ -2818,22 +2809,30 @@ 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 */ - if (mw->menu.bottom_shadow_pixmap && - mw->menu.bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP) +#ifdef NEED_MOTIF + if (mw->menu.top_shadow_pixmap && + mw->menu.top_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); diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwmenu.h --- a/lwlib/xlwmenu.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/xlwmenu.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ -#ifndef INCLUDED_xlwmenu_h_ -#define INCLUDED_xlwmenu_h_ +#ifndef _XlwMenu_h +#define _XlwMenu_h /*********************************************************************** * @@ -56,7 +56,6 @@ # define XmCTopShadowPixmap "TopShadowPixmap" # define XmNbottomShadowPixmap "bottomShadowPixmap" # define XmCBottomShadowPixmap "BottomShadowPixmap" -# define XmUNSPECIFIED_PIXMAP 2 # define XmRHorizontalDimension "HorizontalDimension" # define XmNspacing "spacing" # define XmCSpacing "Spacing" @@ -91,4 +90,4 @@ widget_value *xlw_get_entries (int allp); int xlw_menu_level (void); -#endif /* INCLUDED_xlwmenu_h_ */ +#endif /* _XlwMenu_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwmenuP.h --- a/lwlib/xlwmenuP.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/xlwmenuP.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ -#ifndef INCLUDED_xlwmenuP_h_ -#define INCLUDED_xlwmenuP_h_ +#ifndef _XlwMenuP_h +#define _XlwMenuP_h #include "xlwmenu.h" #include <X11/CoreP.h> @@ -117,4 +117,4 @@ /* Class pointer. */ extern XlwMenuClassRec xlwMenuClassRec; -#endif /* INCLUDED_xlwmenuP_h_ */ +#endif /* _XlwMenuP_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwradio.c --- a/lwlib/xlwradio.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,597 +0,0 @@ -/* Radio 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: Radio.c 1.1 */ - -/* - * Radio.c - Radio button widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: June 30, 1997 - * - * - * Overview: This widget is identical to the Toggle widget in behavior, - * but completely different in appearance. This widget looks like a small - * diamond-shaped button with a label to the right. - * - * To make this work, we subclass the Toggle widget to inherit its behavior - * and to inherit the label-drawing function from which Toggle is - * subclassed. We then completely replace the Expose, Set, Unset - * and Highlight member functions. - * - * The Set and Unset actions are slightly unorthodox. In Toggle's - * ClassInit function, Toggle searches the Command actions list and - * "steals" the Set and Unset functions, caching pointers to them in its - * class record. It then calls these functions from its own ToggleSet - * and Toggle actions. - * - * We, in turn, override the Set() and Unset() actions in our own ClassRec. - */ - - -#include <config.h> -#include <stdio.h> - -#include <X11/IntrinsicP.h> -#include <X11/StringDefs.h> -#include ATHENA_XawInit_h_ -#include "../src/xmu.h" -#include "xlwradioP.h" - -#define BOX_SIZE 13 - -#define rclass(w) ((RadioWidgetClass)((w)->core.widget_class)) - - -#ifdef _ThreeDP_h -#define swid(rw) ((rw)->threeD.shadow_width) -#else -#define swid(rw) ((rw)->core.border_width) -#endif - -#define bsize(rw) (rclass(rw)->radio_class.dsize) -#define bs(rw) (bsize(rw) + 2*swid(rw)) - - - -/**************************************************************** - * - * Full class record constant - * - ****************************************************************/ - - /* The translations table from Toggle do not need to be - * overridden by Radio - */ - - - /* Member functions */ - -static void RadioInit (Widget, Widget, ArgList, Cardinal *); -static void RadioExpose (Widget, XEvent *, Region); -static void RadioResize (Widget); -static void RadioDestroy (Widget, XtPointer, XtPointer); -static void RadioClassInit (void); -static void RadioClassPartInit (WidgetClass); -static Boolean RadioSetValues (Widget, Widget, Widget, ArgList, Cardinal *); -static void DrawDiamond (Widget); -static XtGeometryResult RadioQueryGeometry (Widget, XtWidgetGeometry *, - XtWidgetGeometry *); - - /* Action procs */ - -static void RadioHighlight (Widget, XEvent *, String *, Cardinal *); -static void RadioUnhighlight (Widget, XEvent *, String *, Cardinal *); - - /* internal privates */ - -static void RadioSize (RadioWidget, Dimension *, Dimension *); - - /* The actions table from Toggle is almost perfect, but we need - * to override Highlight, Set, and Unset. - */ - -static XtActionsRec actionsList[] = -{ - {"highlight", RadioHighlight}, - {"unhighlight", RadioUnhighlight}, -}; - -#define SuperClass ((ToggleWidgetClass)&toggleClassRec) - -RadioClassRec radioClassRec = { - { - (WidgetClass) SuperClass, /* superclass */ - "Radio", /* class_name */ - sizeof(RadioRec), /* size */ - RadioClassInit, /* class_initialize */ - RadioClassPartInit, /* class_part_initialize */ - FALSE, /* class_inited */ - RadioInit, /* initialize */ - NULL, /* initialize_hook */ - XtInheritRealize, /* realize */ - actionsList, /* actions */ - XtNumber(actionsList), /* num_actions */ - NULL, /* resources */ - 0, /* resource_count */ - NULLQUARK, /* xrm_class */ - TRUE, /* compress_motion */ - TRUE, /* compress_exposure */ - TRUE, /* compress_enterleave */ - FALSE, /* visible_interest */ - NULL, /* destroy */ - RadioResize, /* resize */ - RadioExpose, /* expose */ - RadioSetValues, /* set_values */ - NULL, /* set_values_hook */ - XtInheritSetValuesAlmost, /* set_values_almost */ - NULL, /* get_values_hook */ - NULL, /* accept_focus */ - XtVersion, /* version */ - NULL, /* callback_private */ - XtInheritTranslations, /* tm_table */ - RadioQueryGeometry, /* query_geometry */ - XtInheritDisplayAccelerator, /* display_accelerator */ - NULL /* extension */ - }, /* CoreClass fields initialization */ - { - XtInheritChangeSensitive /* change_sensitive */ - }, /* SimpleClass fields initialization */ -#ifdef _ThreeDP_h - { - XtInheritXaw3dShadowDraw /* field not used */ - }, /* ThreeDClass fields initialization */ -#endif - { - 0 /* field not used */ - }, /* LabelClass fields initialization */ - { - 0 /* field not used */ - }, /* CommandClass fields initialization */ - { - RadioSet, /* Set Procedure. */ - RadioUnset, /* Unset Procedure. */ - NULL /* extension. */ - }, /* ToggleClass fields initialization */ - { - BOX_SIZE, - DrawDiamond, /* draw procedure */ - NULL /* extension. */ - } /* RadioClass fields initialization */ -}; - - /* for public consumption */ -WidgetClass radioWidgetClass = (WidgetClass) &radioClassRec; - - - - - - -/**************************************************************** - * - * Class Methods - * - ****************************************************************/ - -static void -RadioClassInit (void) -{ - XawInitializeWidgetSet(); -} - -static void -RadioClassPartInit (WidgetClass class) -{ - RadioWidgetClass c = (RadioWidgetClass) class ; - RadioWidgetClass super = (RadioWidgetClass)c->core_class.superclass ; - - if( c->radio_class.drawDiamond == NULL || - c->radio_class.drawDiamond == XtInheritDrawDiamond ) - { - c->radio_class.drawDiamond = super->radio_class.drawDiamond ; - } -} - - - - -/*ARGSUSED*/ -static void -RadioInit (Widget request, - Widget new, - ArgList args, - Cardinal *num_args) -{ - RadioWidget rw = (RadioWidget) new; - RadioWidget rw_req = (RadioWidget) request; - Dimension w,h ; - - /* Select initial size for the widget */ - if( rw_req->core.width == 0 || rw_req->core.height == 0 ) - { - RadioSize(rw, &w,&h) ; - if( rw_req->core.width == 0 ) - rw->core.width = w ; - if( rw_req->core.height == 0 ) - rw->core.height = h ; - rw->core.widget_class->core_class.resize(new) ; - } -} - -/* Function Name: RadioDestroy - * Description: Destroy Callback for radio widget. - * Arguments: w - the radio widget that is being destroyed. - * junk, grabage - not used. - * Returns: none. - */ - -/* ARGSUSED */ -static void -RadioDestroy (Widget w, - XtPointer junk, - XtPointer garbage) -{ - /* TODO: get rid of this */ -} - - -/* React to size change from manager. Label widget will compute some internal - * stuff, but we need to override. This code requires knowledge of the - * internals of the Label widget. - */ - -static void -RadioResize (Widget w) -{ - RadioWidget rw = (RadioWidget)w ; - - /* call parent resize proc */ - SuperClass->core_class.resize(w) ; - - /* override label offset */ - - switch( rw->label.justify ) { - case XtJustifyLeft: - 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; - break ; - } -} - - -/* - * Repaint the widget window. - */ - -static void -RadioExpose (Widget w, - XEvent *event, - Region region) -{ - RadioWidget rw = (RadioWidget) w ; - Display *dpy = XtDisplay(w) ; - Window win = XtWindow(w) ; - GC gc ; - Pixmap left_bitmap ; - extern WidgetClass labelWidgetClass ; - - /* Note: the Label widget examines the region to decide if anything - * needs to be drawn. I'm not sure that this is worth the effort, - * but it bears thinking on. - */ - - /* Command widget may sometimes override the label GC in order - * to draw inverse video. We don't use inverse video, so we need - * to restore the label's normal GC. - */ - rw->label.normal_GC = rw->command.normal_GC ; - - - /* Let label widget draw the label. If there was an lbm_x - * field, we could let Label draw the bitmap too. But there - * isn't, so we need to temporarily remove the bitmap and - * draw it ourself later. - */ - left_bitmap = rw->label.left_bitmap ; - rw->label.left_bitmap = None ; - labelWidgetClass->core_class.expose(w,event,region) ; - rw->label.left_bitmap = left_bitmap ; - - /* now manually draw the left bitmap. TODO: 3-d look, xaw-xpm */ - gc = XtIsSensitive(w) ? rw->label.normal_GC : rw->label.gray_GC ; - if( left_bitmap != None && rw->label.lbm_width > 0 ) - { - /* TODO: handle pixmaps */ - XCopyPlane(dpy, left_bitmap, win, gc, - 0,0, rw->label.lbm_width, rw->label.lbm_height, - (int) rw->label.internal_width*2 + bs(rw), - (int) rw->label.internal_height + rw->label.lbm_y, - (u_long) 1L) ; - } - - /* Finally, the button itself */ - ((RadioWidgetClass)(w->core.widget_class))->radio_class.drawDiamond(w) ; -} - - - - -/************************************************************ - * - * Set specified arguments into widget - * - ***********************************************************/ - - -/* ARGSUSED */ -static Boolean -RadioSetValues (Widget current, - Widget request, - Widget new, - ArgList args, - Cardinal *num_args) -{ - RadioWidget oldrw = (RadioWidget) current; - RadioWidget newrw = (RadioWidget) new; - - /* Need to find out if the size of the widget changed. Set new size - * if it did and resize is permitted. One way to determine of the - * widget changed size would be to scan the args list. Another way - * is to compare the old and new widgets and see if any of several - * size-related fields have been changed. The Label widget chose the - * former method, but I choose the latter. - */ - - if( newrw->label.resize && - ( newrw->core.width != oldrw->core.width || - newrw->core.height != oldrw->core.height || - newrw->core.border_width != oldrw->core.border_width ) ) - { - 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 ; -} - -static XtGeometryResult -RadioQueryGeometry (Widget w, - XtWidgetGeometry *intended, - XtWidgetGeometry *preferred) -{ - RadioWidget rw = (RadioWidget) w; - - preferred->request_mode = CWWidth | CWHeight; - RadioSize(rw, &preferred->width, &preferred->height) ; - - if ( ((intended->request_mode & (CWWidth | CWHeight)) - == (CWWidth | CWHeight)) && - intended->width == preferred->width && - intended->height == preferred->height) - return XtGeometryYes; - else if (preferred->width == w->core.width && - preferred->height == w->core.height) - return XtGeometryNo; - else - return XtGeometryAlmost; -} - - - - - -/************************************************************ - * - * Action Procedures - * - ************************************************************/ - -/* - * Draw the highlight border around the widget. The Command widget - * did this by drawing through a mask. We do it by just drawing the - * border. - */ - -static void -DrawHighlight (Widget w, - GC gc) -{ - RadioWidget rw = (RadioWidget)w; - XRectangle rects[4] ; - Dimension ht = rw->command.highlight_thickness ; - - if( ht <= 0 || - ht > rw->core.width/2 || - ht > rw->core.height/2 ) - return ; - - if( ! XtIsRealized(w) ) - return ; - - rects[0].x = 0 ; rects[0].y = 0 ; - rects[0].width = rw->core.width ; rects[0].height = ht ; - rects[1].x = 0 ; rects[1].y = rw->core.height - ht ; - rects[1].width = rw->core.width ; rects[1].height = ht ; - rects[2].x = 0 ; rects[2].y = ht ; - rects[2].width = ht ; rects[2].height = rw->core.height - ht*2 ; - rects[3].x = rw->core.width - ht ; rects[3].y = ht ; - rects[3].width = ht ; rects[3].height = rw->core.height - ht*2 ; - XFillRectangles( XtDisplay(w), XtWindow(w), gc, rects, 4) ; -} - -static void -RadioHighlight (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) -{ - RadioWidget rw = (RadioWidget)w; - DrawHighlight(w, rw->command.normal_GC) ; -} - - -static void -RadioUnhighlight (Widget w, - XEvent *event, - String *params, - Cardinal *num_params) -{ - RadioWidget rw = (RadioWidget)w; - DrawHighlight(w, rw->command.inverse_GC) ; -} - - -/* ARGSUSED */ -void -RadioSet (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params) /* unused */ -{ - RadioWidget rw = (RadioWidget)w; - RadioWidgetClass class = (RadioWidgetClass) w->core.widget_class ; - - if( rw->command.set ) - return ; - - rw->command.set = TRUE ; - if( XtIsRealized(w) ) - class->radio_class.drawDiamond(w) ; -} - - -/* ARGSUSED */ -void -RadioUnset (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params) /* unused */ -{ - RadioWidget rw = (RadioWidget)w; - RadioWidgetClass class = (RadioWidgetClass) w->core.widget_class ; - - if( ! rw->command.set ) - return ; - - rw->command.set = FALSE ; - if( XtIsRealized(w) ) - class->radio_class.drawDiamond(w) ; -} - - - - -/************************************************************ - * - * Internal Procedures - * - ************************************************************/ - - -/* Size of widget. Width is size of box plus width of border around - * box plus width of label plus three margins plus the size of the left - * bitmap, if any. Height is max(box,bitmap,label) plus two margins. - */ - -static void -RadioSize (RadioWidget rw, - Dimension *w, - Dimension *h) -{ - *w = rw->label.label_width + bs(rw) + LEFT_OFFSET(rw) + - 3 * rw->label.internal_width ; - *h = Max( rw->label.label_height, bs(rw) ) + - 2 * rw->label.internal_width ; -} - - -static void -DrawDiamond (Widget w) -{ - RadioWidget rw = (RadioWidget) w ; - Display *dpy = XtDisplay(w) ; - Window win = XtWindow(w) ; - GC gc, gci ; - - XPoint pts[5] ; - Dimension del = bsize(rw)/2 ; - Position x,y ; /* diamond center */ -#ifdef _ThreeDP_h - int i=0; - Dimension s = swid(rw) ; - GC top, bot, ctr ; -#endif - gc = XtIsSensitive(w) ? rw->command.normal_GC : rw->label.gray_GC ; - - gci = rw->command.set ? rw->command.normal_GC : rw->command.inverse_GC ; - - x = rw->label.internal_width + bs(rw)/2 ; - y = rw->core.height/2 ; - -#ifdef _ThreeDP_h - if( ! rw->command.set ) { - top = rw->threeD.top_shadow_GC ; - bot = rw->threeD.bot_shadow_GC ; - ctr = gc ; /* TODO */ - } else { - top = rw->threeD.bot_shadow_GC ; - bot = rw->threeD.top_shadow_GC ; - ctr = gc ; /* TODO */ - } -#endif - - pts[0].x = x - del ; - pts[0].y = y ; - pts[1].x = x ; - pts[1].y = y - del ; - pts[2].x = x + del ; - pts[2].y = y ; - pts[3].x = x ; - pts[3].y = y + del ; - pts[4] = pts[0] ; - XFillPolygon(dpy,win,gci, pts,4, Convex, CoordModeOrigin) ; - -#ifdef _ThreeDP_h - for(i=0; i<s; ++i) { - XDrawLine(dpy,win,bot, x-i-del,y, x,y+del+i) ; - XDrawLine(dpy,win,bot, x+del+i,y, x,y+del+i) ; - } - for(i=0; i<s; ++i) { - XDrawLine(dpy,win,top, x-del-i,y, x,y-del-i) ; - XDrawLine(dpy,win,top, x+del+i,y, x,y-del-i) ; - } -#else - XDrawLines(dpy,win,gc, pts,5, CoordModeOrigin) ; -#endif -} diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwradio.h --- a/lwlib/xlwradio.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* Radio 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: Radio.h 1.1 */ - -/* - * Radio.h - Radio button widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: June 30, 1997 - */ - -#ifndef _XawRadio_h -#define _XawRadio_h - -/*********************************************************************** - * - * Radio Widget - * - * The Radio widget is identical to the Toggle widget in behavior but - * not in appearance. The Radio widget looks like a small diamond - * shaped button to the left of the label. - * - ***********************************************************************/ - -#include ATHENA_Toggle_h_ - -/* Resources: - - Name Class RepType Default Value - ---- ----- ------- ------------- - radioGroup RadioGroup Widget NULL - radioData RadioData Pointer (XPointer) Widget - state State Boolean Off - background Background Pixel XtDefaultBackground - bitmap Pixmap Pixmap None - border BorderColor Pixel XtDefaultForeground - borderWidth BorderWidth Dimension 1 - callback Callback Pointer NULL - cursor Cursor Cursor None - destroyCallback Callback Pointer NULL - font Font XFontStructx* XtDefaultFont - foreground Foreground Pixel XtDefaultForeground - height Height Dimension text height - highlightThickness Thickness Dimension 2 - insensitiveBorder sensitive Pixmap Gray - internalHeight Height Dimension 2 - internalWidth Width Dimension 4 - justify Justify XtJustify XtJustifyCenter - label Label String NULL - mappedWhenManaged MappedWhenManaged Boolean True - resize Resize Boolean True - sensitive Sensitive Boolean True - width Width Dimension text width - x Position Position 0 - y Position Position 0 - -*/ - -/* - * These should be in StringDefs.h but aren't so we will define - * them here if they are needed. - */ - - -extern WidgetClass radioWidgetClass; - -typedef struct _RadioClassRec *RadioWidgetClass; -typedef struct _RadioRec *RadioWidget; - - -/************************************************************ - * - * Public Functions - * - ************************************************************/ - -#endif /* _XawRadio_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwradioP.h --- a/lwlib/xlwradioP.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* Radio 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. */ - -/* - * RadioP.h - Private definitions for Radio widget - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: June 30, 1997 - * - */ - -#ifndef _XawRadioP_h -#define _XawRadioP_h - -#include "xlwradio.h" -#include ATHENA_ToggleP_h_ - -/*********************************************************************** - * - * Radio Widget Private Data - * - ***********************************************************************/ - -#define streq(a, b) ( strcmp((a), (b)) == 0 ) - -typedef void (*XawDiamondProc) (Widget); - -void RadioSet (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params); /* unused */ - -void RadioUnset (Widget w, - XEvent *event, - String *params, /* unused */ - Cardinal *num_params); /* unused */ - -/************************************ - * - * Class structure - * - ***********************************/ - - /* New fields for the Radio widget class record */ -typedef struct _RadioClass { - Dimension dsize ; /* diamond size */ - XawDiamondProc drawDiamond ; - /* TODO: 3-d and xaw-xpm features? */ - XtPointer extension; -} RadioClassPart; - -#define XtInheritDrawDiamond ((XawDiamondProc)_XtInherit) - - /* Full class record declaration */ -typedef struct _RadioClassRec { - CoreClassPart core_class; - SimpleClassPart simple_class; -#ifdef _ThreeDP_h - ThreeDClassPart threeD_class; -#endif - LabelClassPart label_class; - CommandClassPart command_class; - ToggleClassPart toggle_class; - RadioClassPart radio_class; -} RadioClassRec; - -extern RadioClassRec radioClassRec; - -/*************************************** - * - * Instance (widget) structure - * - **************************************/ - - /* New fields for the Radio widget record */ -typedef struct { - /* resources */ - /* TODO: 3-d and xaw-xpm features? */ - - /* private data */ - XtPointer extension; -} RadioPart; - - /* Full widget declaration */ -typedef struct _RadioRec { - CorePart core; - SimplePart simple; -#ifdef _ThreeDP_h - ThreeDPart threeD; -#endif - LabelPart label; - CommandPart command; - TogglePart toggle; - RadioPart radio; -} RadioRec; - -#endif /* _XawRadioP_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwscrollbar.c --- a/lwlib/xlwscrollbar.c Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/xlwscrollbar.c Mon Aug 13 11:20:41 2007 +0200 @@ -485,9 +485,11 @@ } /*-------------------------- 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) @@ -512,10 +514,14 @@ 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); @@ -973,7 +979,7 @@ if (ss < SS_MIN) { /* add a percent amount for integer rounding */ - float tmp = (((float) (SS_MIN - ss) * (float) value) / total) + 0.5; + float tmp = ((((float) (SS_MIN - ss) * (float) value)) / total) + 0.5; above -= (int) tmp; ss = SS_MIN; diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwscrollbar.h --- a/lwlib/xlwscrollbar.h Mon Aug 13 11:19:22 2007 +0200 +++ b/lwlib/xlwscrollbar.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Created by Douglas Keller <dkeller@vnet.ibm.com> */ -#ifndef INCLUDED_xlwscrollbar_h_ -#define INCLUDED_xlwscrollbar_h_ +#ifndef _XlwScrollbar_h +#define _XlwScrollbar_h #include <X11/Core.h> @@ -140,4 +140,4 @@ void XlwScrollBarSetValues(Widget widget, int value, int sliderSize, int increment, int pageIncrement, Boolean notify); -#endif /* INCLUDED_xlwscrollbar_h_ */ +#endif diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwtabs.c --- a/lwlib/xlwtabs.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2101 +0,0 @@ - /* 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 - * - * Author: Edward A. Falk - * falk@falconer.vip.best.com - * - * Date: July 29, 1997 - * - * - * Overall layout of this widget is as follows: - * - * ________ ,---------. _________ - * | label || Label || Label | \ tabs - * |________|| ||_________| / - * |+----------------------------+| \ - * || || | - * || child widget window || > frame - * |+----------------------------+| | - * +------------------------------+ / - * - * The height of the tabs includes the shadow width, top and bottom - * margins, and the height of the text. - * - * The height of the frame includes the top and bottom shadow width and the - * size of the child widget window. - * - * The tabs overlap the frame and each other vertically by the shadow - * width, so that when the topmost tab is drawn, it obliterates part of - * the frame. - */ - -/* - * TODO: min child height = tab height - */ - -#include <config.h> -#include <stdio.h> - -#include <X11/Xlib.h> -#include <X11/IntrinsicP.h> -#include <X11/StringDefs.h> -#include "../src/xmu.h" -#include "xlwtabsP.h" -#include "xlwgcs.h" - -#define MIN_WID 10 -#define MIN_HGT 10 -#define INDENT 3 /* tabs indented from edge by this much */ -#define SPACING 0 /* distance between tabs */ -#define SHADWID 1 /* default shadow width */ -#define TABDELTA 2 /* top tab grows this many pixels */ -#define TABLDELTA 2 /* top tab label offset this many pixels */ - - -/**************************************************************** - * - * IndexTabs Resources - * - ****************************************************************/ - -static char defaultTranslations[] = "\ - <BtnUp>: select() \n\ - <FocusIn>: highlight() \n\ - <FocusOut>: unhighlight() \n\ - <Key>Page_Up: page(up) \n\ - <Key>KP_Page_Up: page(up) \n\ - <Key>Prior: page(up) \n\ - <Key>KP_Prior: page(up) \n\ - <Key>Page_Down: page(down) \n\ - <Key>KP_Page_Down: page(down) \n\ - <Key>Next: page(down) \n\ - <Key>KP_Next: page(down) \n\ - <Key>Home: page(home) \n\ - <Key>KP_Home: page(home) \n\ - <Key>End: page(end) \n\ - <Key>KP_End: page(end) \n\ - <Key>Up: highlight(up) \n\ - <Key>KP_Up: highlight(up) \n\ - <Key>Down: highlight(down) \n\ - <Key>KP_Down: highlight(down) \n\ - <Key> : page(select) \n\ - " ; - -static char accelTable[] = " #augment\n\ - <Key>Page_Up: page(up) \n\ - <Key>KP_Page_Up: page(up) \n\ - <Key>Prior: page(up) \n\ - <Key>KP_Prior: page(up) \n\ - <Key>Page_Down: page(down) \n\ - <Key>KP_Page_Down: page(down) \n\ - <Key>Next: page(down) \n\ - <Key>KP_Next: page(down) \n\ - <Key>Home: page(home) \n\ - <Key>KP_Home: page(home) \n\ - <Key>End: page(end) \n\ - <Key>KP_End: page(end) \n\ - <Key>Up: highlight(up) \n\ - <Key>KP_Up: highlight(up) \n\ - <Key>Down: highlight(down) \n\ - <Key>KP_Down: highlight(down) \n\ - <Key> : page(select) \n\ - " ; -static XtAccelerators defaultAccelerators ; - -#define offset(field) XtOffsetOf(TabsRec, tabs.field) -static XtResource resources[] = { - - {XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, sizeof(Boolean), - offset(selectInsensitive), XtRImmediate, (XtPointer) True}, - {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), - offset(font), XtRString, (XtPointer) XtDefaultFont}, - {XtNinternalWidth, XtCWidth, XtRDimension, sizeof(Dimension), - offset(internalWidth), XtRImmediate, (XtPointer)4 }, - {XtNinternalHeight, XtCHeight, XtRDimension, sizeof(Dimension), - offset(internalHeight), XtRImmediate, (XtPointer)4 }, - {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), - XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer)0}, - {XtNtopWidget, XtCTopWidget, XtRWidget, sizeof(Widget), - offset(topWidget), XtRImmediate, NULL}, - {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer), - offset(callbacks), XtRCallback, NULL}, - {XtNpopdownCallback, XtCCallback, XtRCallback, sizeof(XtPointer), - offset(popdownCallbacks), XtRCallback, NULL}, - {XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, sizeof(Boolean), - offset(be_nice_to_cmap), XtRImmediate, (XtPointer) True}, - {XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, sizeof(int), - offset(top_shadow_contrast), XtRImmediate, (XtPointer) 20}, - {XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, sizeof(int), - offset(bot_shadow_contrast), XtRImmediate, (XtPointer) 40}, - {XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, sizeof(int), - offset(insensitive_contrast), XtRImmediate, (XtPointer) 33}, - {XtNaccelerators, XtCAccelerators, XtRAcceleratorTable,sizeof(XtTranslations), - XtOffsetOf(TabsRec,core.accelerators), XtRString, accelTable}, -}; -#undef offset - - - - /* constraint resources */ - -#define offset(field) XtOffsetOf(TabsConstraintsRec, tabs.field) -static XtResource tabsConstraintResources[] = { - {XtNtabLabel, XtCLabel, XtRString, sizeof(String), - offset(label), XtRString, NULL}, - {XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, sizeof(Pixmap), - offset(left_bitmap), XtRImmediate, None}, - {XtNtabForeground, XtCForeground, XtRPixel, sizeof(Pixel), - offset(foreground), XtRString, (XtPointer) XtDefaultForeground}, - {XtNresizable, XtCResizable, XtRBoolean, sizeof(Boolean), - offset(resizable), XtRImmediate, (XtPointer) True}, -} ; -#undef offset - - - - -#if !NeedFunctionPrototypes - - /* FORWARD REFERENCES: */ - - /* member functions */ - -static void TabsClassInit(); -static void TabsInit(); -static void TabsResize(); -static void TabsExpose(); -static void TabsDestroy(); -static void TabsRealize(); -static Boolean TabsSetValues(); -static Boolean TabsAcceptFocus(); -static XtGeometryResult TabsQueryGeometry(); -static XtGeometryResult TabsGeometryManager(); -static void TabsChangeManaged(); -static void TabsConstraintInitialize() ; -static Boolean TabsConstraintSetValues() ; - - /* action procs */ - -static void TabsSelect() ; -static void TabsPage() ; -static void TabsHighlight() ; -static void TabsUnhighlight() ; - - /* internal privates */ - -static void TabsAllocGCs() ; /* get rendering GCs */ -static void TabsFreeGCs() ; /* return rendering GCs */ -static void DrawTabs() ; /* draw all tabs */ -static void DrawTab() ; /* draw one index tab */ -static void DrawFrame() ; /* draw frame around contents */ -static void DrawTrim() ; /* draw trim around a tab */ -static void DrawBorder() ; /* draw border */ -static void DrawHighlight() ; /* draw highlight */ -static void UndrawTab() ; /* undraw interior of a tab */ -static void TabWidth() ; /* recompute tab size */ -static void GetPreferredSizes() ; /* query all children for their sizes */ -static void MaxChild() ; /* find max preferred child size */ -static int PreferredSize() ; /* compute preferred size */ -static int PreferredSize2() ; /* compute preferred size */ -static int PreferredSize3() ; /* compute preferred size */ -static void MakeSizeRequest() ; /* try to change size */ -static void getBitmapInfo() ; -static int TabLayout() ; /* lay out tabs */ -static void TabsShuffleRows() ; /* bring current tab to bottom row */ - -static void TabsAllocFgGC() ; -static void TabsAllocGreyGC() ; - -#else - -static void TabsClassInit(void) ; -static void TabsInit( Widget req, Widget new, ArgList, Cardinal *nargs) ; -static void TabsConstraintInitialize(Widget, Widget, ArgList, Cardinal *) ; -static void TabsRealize(Widget, Mask *, XSetWindowAttributes *) ; -static void TabsDestroy( Widget w) ; -static void TabsResize( Widget w) ; -static void TabsExpose( Widget w, XEvent *event, Region region) ; -static Boolean TabsSetValues(Widget, Widget, Widget, ArgList, Cardinal *) ; -static Boolean TabsAcceptFocus(Widget, Time *); -static Boolean TabsConstraintSetValues(Widget, Widget, Widget, - ArgList, Cardinal *) ; -static XtGeometryResult TabsQueryGeometry(Widget, - XtWidgetGeometry *, XtWidgetGeometry *) ; -static XtGeometryResult TabsGeometryManager(Widget, - XtWidgetGeometry *, XtWidgetGeometry *) ; -static void TabsChangeManaged( Widget w) ; - -static void TabsSelect(Widget, XEvent *, String *, Cardinal *) ; -static void TabsPage(Widget, XEvent *, String *, Cardinal *) ; -static void TabsHighlight(Widget, XEvent *, String *, Cardinal *) ; -static void TabsUnhighlight(Widget, XEvent *, String *, Cardinal *) ; - -static void DrawTabs( TabsWidget tw, Bool labels) ; -static void DrawTab( TabsWidget tw, Widget child, Bool labels) ; -static void DrawFrame( TabsWidget tw) ; -static void DrawTrim( TabsWidget, int x, int y, - int wid, int hgt, Bool bottom, Bool undraw) ; -static void DrawBorder( TabsWidget tw, Widget child, Bool undraw) ; -static void DrawHighlight( TabsWidget tw, Widget child, Bool undraw) ; -static void UndrawTab( TabsWidget tw, Widget child) ; - -static void TabWidth( Widget w) ; -static int TabLayout( TabsWidget, int wid, int hgt, Dimension *r_hgt, - Bool query_only) ; -static void GetPreferredSizes(TabsWidget) ; -static void MaxChild(TabsWidget, Widget except, Dimension, Dimension) ; -static void TabsShuffleRows( TabsWidget tw) ; -static int PreferredSize( TabsWidget, - Dimension *reply_width, Dimension *reply_height, - Dimension *reply_cw, Dimension *reply_ch) ; -static int PreferredSize2( TabsWidget, int cw, int ch, - Dimension *rw, Dimension *rh) ; -static int PreferredSize3( TabsWidget, int wid, int hgt, - Dimension *rw, Dimension *rh) ; -static void MakeSizeRequest(TabsWidget) ; - -static void TabsAllocGCs(TabsWidget) ; -static void TabsFreeGCs(TabsWidget) ; -static void getBitmapInfo( TabsWidget tw, TabsConstraints tab) ; -static void TabsAllocFgGC( TabsWidget tw) ; -static void TabsAllocGreyGC( TabsWidget tw) ; - -#endif - -#define AddRect(i,xx,yy,w,h) \ - do{rects[(i)].x=(xx); rects[i].y=(yy); \ - rects[i].width=(w); rects[i].height=(h);}while(0) - -static XtActionsRec actionsList[] = - { - {"select", TabsSelect}, - {"page", TabsPage}, - {"highlight", TabsHighlight}, - {"unhighlight", TabsUnhighlight}, - } ; - - -/**************************************************************** -* -* Full class record constant -* -****************************************************************/ - -#ifndef NEED_MOTIF -#define SuperClass (&constraintClassRec) -#else -#define SuperClass (&xmManagerClassRec) -#endif - -TabsClassRec tabsClassRec = { - { -/* core_class fields */ - /* superclass */ (WidgetClass) SuperClass, - /* class_name */ "Tabs", - /* widget_size */ sizeof(TabsRec), - /* class_initialize */ TabsClassInit, - /* class_part_init */ NULL, /* TODO? */ - /* class_inited */ FALSE, - /* initialize */ TabsInit, - /* initialize_hook */ NULL, - /* realize */ TabsRealize, - /* actions */ actionsList, - /* num_actions */ XtNumber(actionsList), - /* resources */ resources, - /* num_resources */ XtNumber(resources), - /* xrm_class */ NULLQUARK, - /* compress_motion */ TRUE, -#if XtSpecificationRelease < 6 - /* compress_exposure */ XtExposeCompressMaximal, -#else - /* compress_exposure */ XtExposeCompressMaximal|XtExposeNoRegion, -#endif - /* compress_enterleave*/ TRUE, - /* visible_interest */ TRUE, - /* destroy */ TabsDestroy, - /* resize */ TabsResize, - /* expose */ TabsExpose, - /* set_values */ TabsSetValues, - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ NULL, - /* accept_focus */ TabsAcceptFocus, - /* version */ XtVersion, - /* callback_private */ NULL, - /* tm_table */ defaultTranslations, - /* query_geometry */ TabsQueryGeometry, - /* display_accelerator*/ XtInheritDisplayAccelerator, - /* extension */ NULL - }, - { -/* composite_class fields */ - /* geometry_manager */ TabsGeometryManager, - /* change_managed */ TabsChangeManaged, - /* insert_child */ XtInheritInsertChild, /* TODO? */ - /* delete_child */ XtInheritDeleteChild, /* TODO? */ - /* extension */ NULL - }, - { -/* constraint_class fields */ - /* subresources */ tabsConstraintResources, - /* subresource_count */ XtNumber(tabsConstraintResources), - /* constraint_size */ sizeof(TabsConstraintsRec), - /* initialize */ TabsConstraintInitialize, - /* destroy */ NULL, - /* set_values */ TabsConstraintSetValues, - /* extension */ NULL, - }, -#ifdef NEED_MOTIF -/* Manager Class fields */ - { - /* translations */ NULL, - /* syn_resources */ NULL, - /* num_syn_resources */ 0, - /* syn_constraint_resources */ NULL, - /* num_syn_constraint_resources */ 0, - /* parent_process */ XmInheritParentProcess, - /* extension */ NULL - }, -#endif - { -/* Tabs class fields */ - /* extension */ NULL, - } -}; - -WidgetClass tabsWidgetClass = (WidgetClass)&tabsClassRec; - - - -#ifdef DEBUG -#ifdef __STDC__ -#define assert(e) \ - if(!(e)) fprintf(stderr,"yak! %s at %s:%d\n",#e,__FILE__,__LINE__) -#else -#define assert(e) \ - if(!(e)) fprintf(stderr,"yak! e at %s:%d\n",__FILE__,__LINE__) -#endif -#else -#define assert(e) -#endif - - - - -/**************************************************************** - * - * Member Procedures - * - ****************************************************************/ - -static void -TabsClassInit(void) -{ - defaultAccelerators = XtParseAcceleratorTable(accelTable) ; - /* TODO: register converter for labels? */ -} - - - - /* Init a newly created tabs widget. Compute height of tabs - * and optionally compute size of widget. */ - -/* ARGSUSED */ - -static void -TabsInit(Widget request, Widget new, ArgList args, Cardinal *num_args) -{ - TabsWidget newTw = (TabsWidget)new; - - newTw->tabs.numRows = 0 ; - newTw->tabs.displayChildren = 0; - - GetPreferredSizes(newTw) ; - - /* height is easy, it's the same for all tabs: - * TODO: font height + height of tallest bitmap. - */ - newTw->tabs.tab_height = 2 * newTw->tabs.internalHeight + SHADWID ; - - if( newTw->tabs.font != NULL ) - newTw->tabs.tab_height += newTw->tabs.font->max_bounds.ascent + - newTw->tabs.font->max_bounds.descent ; - - /* GC allocation is deferred until XtRealize() */ - - /* if size not explicitly set, set it to our preferred size now. */ - - if( request->core.width == 0 || request->core.height == 0 ) - { - Dimension w,h ; - PreferredSize(newTw, &w, &h, NULL,NULL) ; - if( request->core.width == 0 ) new->core.width = w ; - if( request->core.height == 0 ) new->core.height = h ; - XtClass(new)->core_class.resize(new) ; - } - - /* defer GC allocation, etc., until Realize() time. */ - newTw->tabs.foregroundGC = - newTw->tabs.backgroundGC = - newTw->tabs.greyGC = - newTw->tabs.topGC = - newTw->tabs.botGC = None ; - - newTw->tabs.grey50 = None ; - - newTw->tabs.needs_layout = False ; - - newTw->tabs.hilight = NULL ; - -#ifdef NEED_MOTIF - newTw->manager.navigation_type = XmTAB_GROUP ; - newTw->manager.traversal_on = True ; -#endif -} - - - /* Init the constraint part of a new tab child. Compute the - * size of the tab. - */ -/* ARGSUSED */ -static void -TabsConstraintInitialize(Widget request, Widget new, - ArgList args, Cardinal *num_args) -{ - TabsConstraints tab = (TabsConstraints) new->core.constraints ; - tab->tabs.greyAlloc = False ; /* defer allocation of pixel */ - - getBitmapInfo((TabsWidget)XtParent(new), tab) ; - TabWidth(new) ; -} - - - - /* Called when tabs widget first realized. Create the window - * and allocate the GCs - */ - -static void -TabsRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes) -{ - TabsWidget tw = (TabsWidget) w; - - attributes->bit_gravity = NorthWestGravity; - *valueMask |= CWBitGravity; - - SuperClass->core_class.realize(w, valueMask, attributes); - - TabsAllocGCs(tw) ; -} - - - -static void -TabsDestroy(Widget w) -{ - TabsFreeGCs((TabsWidget)w) ; -} - - - /* Parent has resized us. This will require that the tabs be - * laid out again. - */ - -static void -TabsResize(Widget w) -{ - TabsWidget tw = (TabsWidget) w; - int i ; - int num_children = tw->composite.num_children ; - Widget *childP ; - TabsConstraints tab ; - Dimension cw,ch,bw ; - - /* Our size has now been dictated by the parent. Lay out the - * tabs, lay out the frame, lay out the children. Remember - * that the tabs overlap each other and the frame by shadowWidth. - * Also, the top tab is larger than the others, so if there's only - * one row, the widget must be made taller to accommodate this. - * - * Once the tabs are laid out, if there is more than one - * row, we may need to shuffle the rows to bring the top tab - * to the bottom row. - */ - - tw->tabs.needs_layout = False ; - - if( num_children > 0 && tw->composite.children != NULL ) - { - /* Loop through the tabs and assign rows & x positions */ - (void) TabLayout(tw, tw->core.width, tw->core.height, NULL, False) ; - num_children = tw->tabs.displayChildren; - - /* assign a top widget, bring it to bottom row. */ - TabsShuffleRows(tw) ; - - /* now assign child positions & sizes. Positions are all the - * same: just inside the frame. Sizes are also all the same. - */ - - tw->tabs.child_width = cw = tw->core.width - 2 * SHADWID ; - tw->tabs.child_height = ch = - tw->core.height - tw->tabs.tab_total - 2 * SHADWID ; - - - for(i=0, childP=tw->composite.children; - i < num_children; - ++i, ++childP) - if( XtIsManaged(*childP) ) - { - tab = (TabsConstraints) (*childP)->core.constraints ; - bw = (*childP)->core.border_width ; - XtConfigureWidget(*childP, SHADWID,tw->tabs.tab_total+SHADWID, - cw-bw*2,ch-bw*2, bw) ; - } - if( XtIsRealized(w) ) { - XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; - /* should not be necessary to explicitly repaint after a - * resize, but XEmacs folks tell me it is. - */ - XtClass(tw)->core_class.expose((Widget)tw,NULL,None) ; - } - } -} /* Resize */ - - - - /* Redraw entire Tabs widget */ - -/* ARGSUSED */ -static void -TabsExpose(Widget w, XEvent *event, Region region) -{ - TabsWidget tw = (TabsWidget) w; - - if( tw->tabs.needs_layout ) - XtClass(w)->core_class.resize(w) ; - - DrawTabs(tw, True) ; -} - - - /* Called when any Tabs widget resources are changed. */ - -/* ARGSUSED */ -static Boolean -TabsSetValues(Widget current, Widget request, Widget new, - ArgList args, Cardinal *num_args) -{ - TabsWidget curtw = (TabsWidget) current ; - TabsWidget tw = (TabsWidget) new ; - Boolean needRedraw = False ; - Widget *childP ; - int i ; - - - if( tw->tabs.font != curtw->tabs.font || - tw->tabs.internalWidth != curtw->tabs.internalWidth || - tw->tabs.internalHeight != curtw->tabs.internalHeight ) - { - tw->tabs.tab_height = 2 * tw->tabs.internalHeight + SHADWID ; - - if( tw->tabs.font != NULL ) - tw->tabs.tab_height += tw->tabs.font->max_bounds.ascent + - tw->tabs.font->max_bounds.descent ; - - /* Tab size has changed. Resize all tabs and request a new size */ - for(i=0, childP=tw->composite.children; - i < tw->composite.num_children; - ++i, ++childP) - if( XtIsManaged(*childP) ) - TabWidth(*childP) ; - PreferredSize(tw, &tw->core.width, &tw->core.height, NULL,NULL) ; - needRedraw = True ; - tw->tabs.needs_layout = True ; - } - - /* TODO: if any color changes, need to recompute GCs and redraw */ - - if( tw->core.background_pixel != curtw->core.background_pixel || - tw->core.background_pixmap != curtw->core.background_pixmap || - tw->tabs.font != curtw->tabs.font ) - if( XtIsRealized(new) ) - { - TabsFreeGCs(tw) ; - TabsAllocGCs(tw) ; - needRedraw = True ; - } - - if( tw->core.sensitive != curtw->core.sensitive ) - needRedraw = True ; - - /* If top widget changes, need to change stacking order, redraw tabs. - * Window system will handle the redraws. - */ - - if( tw->tabs.topWidget != curtw->tabs.topWidget ) - { - if( XtIsRealized(tw->tabs.topWidget) ) - { - Widget w = tw->tabs.topWidget ; - TabsConstraints tab = (TabsConstraints) w->core.constraints ; - - XRaiseWindow(XtDisplay(w), XtWindow(w)) ; -#ifdef NEED_MOTIF - XtVaSetValues(curtw->tabs.topWidget, XmNtraversalOn, False, 0) ; - XtVaSetValues(w, XmNtraversalOn, True, 0) ; -#endif - - if( tab->tabs.row != tw->tabs.numRows-1 ) - TabsShuffleRows(tw) ; - - needRedraw = True ; - } - else - tw->tabs.needs_layout = True ; - } - - return needRedraw ; -} - - - /* Called when any child constraint resources change. */ - -/* ARGSUSED */ -static Boolean -TabsConstraintSetValues(Widget current, Widget request, Widget new, - ArgList args, Cardinal *num_args) -{ - TabsWidget tw = (TabsWidget) XtParent(new) ; - TabsConstraints ctab = (TabsConstraints) current->core.constraints ; - TabsConstraints tab = (TabsConstraints) new->core.constraints ; - - - /* if label changes, need to re-layout the entire widget */ - /* if foreground changes, need to redraw tab label */ - - /* TODO: only need resize of new bitmap has different dimensions - * from old bitmap. - */ - - if( tab->tabs.label != ctab->tabs.label || /* Tab size has changed. */ - tab->tabs.left_bitmap != ctab->tabs.left_bitmap ) - { - TabWidth(new) ; - tw->tabs.needs_layout = True ; - - if( tab->tabs.left_bitmap != ctab->tabs.left_bitmap ) - getBitmapInfo(tw, tab) ; - - /* If there are no subclass ConstraintSetValues procedures remaining - * to be invoked, and if the preferred size has changed, ask - * for a resize. - */ - if( XtClass((Widget)tw) == tabsWidgetClass ) - MakeSizeRequest(tw) ; - } - - - /* The child widget itself never needs a redisplay, but the parent - * Tabs widget might. - */ - - if( XtIsRealized(new) ) - { - if( tw->tabs.needs_layout ) { - XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; - XtClass(tw)->core_class.expose((Widget)tw,NULL,None) ; - } - - else if( tab->tabs.foreground != ctab->tabs.foreground ) - DrawTab(tw, new, True) ; - } - - return False ; -} - - -static Boolean -TabsAcceptFocus(Widget w, Time *t) -{ - if( !w->core.being_destroyed && XtIsRealized(w) && - XtIsSensitive(w) && XtIsManaged(w) && w->core.visible ) - { - Widget p ; - for(p = XtParent(w); !XtIsShell(p); p = XtParent(p)) ; - XtSetKeyboardFocus(p,w) ; - return True ; - } - else - return False ; -} - - - -/* - * 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?) - */ - -static XtGeometryResult -TabsQueryGeometry(Widget w, - XtWidgetGeometry *intended, XtWidgetGeometry *preferred) -{ - register TabsWidget tw = (TabsWidget)w ; - XtGeometryMask mode = intended->request_mode ; - - preferred->request_mode = CWWidth | CWHeight ; - PreferredSize(tw, &preferred->width, &preferred->height, NULL,NULL) ; - - if( (!(mode & CWWidth) || intended->width == w->core.width) && - (!(mode & CWHeight) || intended->height == w->core.height) ) - return XtGeometryNo ; - - if( (!(mode & CWWidth) || intended->width >= preferred->width) && - (!(mode & CWHeight) || intended->height >= preferred->height) ) - return XtGeometryYes; - - return XtGeometryAlmost; -} - - - -/* - * Geometry Manager; called when a child wants to be resized. - */ - -static XtGeometryResult -TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) -{ - TabsWidget tw = (TabsWidget) XtParent(w); - Dimension s = SHADWID ; - TabsConstraints tab = (TabsConstraints)w->core.constraints; - XtGeometryResult result ; - Dimension rw, rh ; - - /* Position request always denied */ - - if( ((req->request_mode & CWX) && req->x != w->core.x) || - ((req->request_mode & CWY) && req->y != w->core.y) || - !tab->tabs.resizable ) - return XtGeometryNo ; - - /* Make all three fields in the request valid */ - if( !(req->request_mode & CWWidth) ) - req->width = w->core.width; - if( !(req->request_mode & CWHeight) ) - req->height = w->core.height; - if( !(req->request_mode & CWBorderWidth) ) - req->border_width = w->core.border_width; - - if( req->width == w->core.width && - req->height == w->core.height && - req->border_width == w->core.border_width ) - return XtGeometryNo ; - - rw = req->width + 2 * req->border_width ; - rh = req->height + 2 * req->border_width ; - - /* find out how big the children want to be now */ - MaxChild(tw, w, rw, rh) ; - - - /* Size changes must see if the new size can be accommodated. - * The Tabs widget keeps all of its children the same - * size. A request to shrink will be accepted only if the - * new size is still big enough for all other children. A - * request to shrink that is not big enough for all children - * returns an "almost" response with the new proposed size - * or a "no" response if unable to shrink at all. - * - * A request to grow will be accepted only if the Tabs parent can - * grow to accommodate. - * - * TODO: - * We could get fancy here and re-arrange the tabs if it is - * necessary to compromise with the parent, but we'll save that - * for another day. - */ - - if (req->request_mode & (CWWidth | CWHeight | CWBorderWidth)) - { - Dimension cw,ch ; /* children's preferred size */ - Dimension aw,ah ; /* available size we can give child */ - Dimension th ; /* space used by tabs */ - Dimension wid,hgt ; /* Tabs widget size */ - - cw = tw->tabs.max_cw ; - ch = tw->tabs.max_ch ; - - /* find out what *my* resulting preferred size would be */ - - PreferredSize2(tw, cw, ch, &wid, &hgt) ; - - /* Would my size change? If so, ask to be resized. */ - - if( wid != tw->core.width || hgt != tw->core.height ) - { - Dimension oldWid = tw->core.width, oldHgt = tw->core.height ; - XtWidgetGeometry myrequest, myreply ; - - myrequest.width = wid ; - myrequest.height = hgt ; - myrequest.request_mode = CWWidth | CWHeight ; - - /* If child is only querying, or if we're going to have to - * offer the child a compromise, then make this a query only. - */ - - if( (req->request_mode & XtCWQueryOnly) || rw < cw || rh < ch ) - myrequest.request_mode |= XtCWQueryOnly ; - - result = XtMakeGeometryRequest((Widget)tw, &myrequest, &myreply) ; - - /* !$@# Athena Box widget changes the core size even if QueryOnly - * is set. I'm convinced this is a bug. At any rate, to work - * around the bug, we need to restore the core size after every - * query geometry request. This is only partly effective, - * as there may be other boxes further up the tree. - */ - if( myrequest.request_mode & XtCWQueryOnly ) { - tw->core.width = oldWid ; - tw->core.height = oldHgt ; - } - - /* based on the parent's response, determine what the - * resulting Tabs widget size would be. - */ - - switch( result ) { - case XtGeometryYes: - case XtGeometryDone: - tw->tabs.needs_layout = True ; - break ; - - case XtGeometryNo: - wid = tw->core.width ; - hgt = tw->core.height ; - break ; - - case XtGeometryAlmost: - wid = myreply.width ; - hgt = myreply.height ; - tw->tabs.needs_layout = True ; - break ; - } - } - - /* Within the constraints imposed by the parent, what is - * the max size we can give the child? - */ - (void) TabLayout(tw, wid, hgt, &th, True) ; - aw = wid - 2*s ; - ah = hgt - th - 2*s ; - - /* OK, make our decision. If requested size is >= max sibling - * preferred size, AND requested size <= available size, then - * we accept. Otherwise, we offer a compromise. - */ - - if( rw == aw && rh == ah ) - { - /* Acceptable. If this wasn't a query, change *all* children - * to this size. - */ - if( req->request_mode & XtCWQueryOnly ) - return XtGeometryYes ; - else - { - Widget *childP = tw->composite.children ; - int i,bw ; - w->core.border_width = req->border_width ; - for(i=tw->tabs.displayChildren; --i >= 0; ++childP) - if( XtIsManaged(*childP) ) - { - bw = (*childP)->core.border_width ; - XtConfigureWidget(*childP, s,tw->tabs.tab_total+s, - rw-2*bw, rh-2*bw, bw) ; - } -#ifdef COMMENT - /* TODO: under what conditions will we need to redraw? */ - XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; - XtClass(tw)->core_class.expose((Widget)tw,NULL,NULL) ; -#endif /* COMMENT */ - return XtGeometryDone ; - } - } - - /* Cannot grant child's request. Describe what we *can* do - * and return counter-offer. - */ - reply->width = aw - 2 * req->border_width ; - reply->height = ah - 2 * req->border_width ; - reply->border_width = req->border_width ; - reply->request_mode = CWWidth | CWHeight | CWBorderWidth ; - return XtGeometryAlmost ; - } - - return XtGeometryYes ; -} - - - - - /* The number of children we manage has changed; recompute - * size from scratch. - */ - -static void -TabsChangeManaged(Widget w) -{ - TabsWidget tw = (TabsWidget)w ; - Widget *childP = tw->composite.children ; - int i ; - - if( tw->tabs.topWidget != NULL && - ( !XtIsManaged(tw->tabs.topWidget) || - tw->tabs.topWidget->core.being_destroyed ) ) - tw->tabs.topWidget = NULL ; - - /* Check whether the highlight tab is still valid. */ - if( tw->tabs.hilight != NULL && - ( !XtIsManaged(tw->tabs.hilight) || - tw->tabs.hilight->core.being_destroyed ) ) - tw->tabs.hilight = NULL ; - - GetPreferredSizes(tw) ; - MakeSizeRequest(tw) ; - - XtClass(w)->core_class.resize(w) ; - if( XtIsRealized(w) ) - { - Display *dpy = XtDisplay(w) ; - XClearWindow(dpy, XtWindow(w)) ; - XtClass(w)->core_class.expose(w,NULL,NULL) ; - - /* make sure the top widget stays on top. This requires - * making sure that all new children are realized first. - */ - if( tw->tabs.topWidget != NULL && XtIsRealized(tw->tabs.topWidget) ) - { - for(i=tw->tabs.displayChildren; --i >= 0; ++childP) - if( !XtIsRealized(*childP) ) - XtRealizeWidget(*childP) ; - - XRaiseWindow(dpy, XtWindow(tw->tabs.topWidget)) ; - } - } - -#ifdef NEED_MOTIF - /* Only top widget may receive input */ - - for(childP = tw->composite.children, i=tw->composite.num_children; - --i >= 0; - ++childP) - { - XtVaSetValues(*childP, XmNtraversalOn, False, 0) ; - } - - if( tw->tabs.topWidget != NULL ) - XtVaSetValues(tw->tabs.topWidget, XmNtraversalOn, True, 0) ; -#endif -} - - - - -/**************************************************************** - * - * Action Procedures - * - ****************************************************************/ - - - /* User clicks on a tab, figure out which one it was. */ - -/* ARGSUSED */ -static void -TabsSelect(Widget w, XEvent *event, String *params, Cardinal *num_params) -{ - TabsWidget tw = (TabsWidget) w ; - Widget *childP ; - Position x,y ; - Dimension h = tw->tabs.tab_height ; - int i ; - -#ifdef NEED_MOTIF - XmProcessTraversal (w, XmTRAVERSE_CURRENT) ; -#endif - - /* TODO: is there an Xmu function or something to do this instead? */ - switch( event->type ) { - case ButtonPress: - case ButtonRelease: - x = event->xbutton.x ; y = event->xbutton.y ; break ; - case KeyPress: - case KeyRelease: - x = event->xkey.x ; y = event->xkey.y ; break ; - default: - return ; - } - - /* TODO: determine which tab was clicked, if any. Set that - * widget to be top of stacking order with XawTabsSetTop(). - */ - for(i=0, childP=tw->composite.children; - i < tw->tabs.displayChildren; - ++i, ++childP) - if( XtIsManaged(*childP) ) - { - TabsConstraints tab = (TabsConstraints)(*childP)->core.constraints; - if( x > tab->tabs.x && x < tab->tabs.x + tab->tabs.width && - y > tab->tabs.y && y < tab->tabs.y + h ) - { - if( *childP != tw->tabs.topWidget && - (XtIsSensitive(*childP) || tw->tabs.selectInsensitive) ) - XawTabsSetTop(*childP, True) ; - break ; - } - } -} - - - /* User hits a key */ - -static void -TabsPage(Widget w, XEvent *event, String *params, Cardinal *num_params) -{ - TabsWidget tw = (TabsWidget) w ; - Widget newtop = NULL; - Widget *childP ; - int idx ; - int nc = tw->tabs.displayChildren ; - - if( nc <= 0 ) - return ; - - if( *num_params < 1 ) { - XtAppWarning(XtWidgetToApplicationContext(w), - "Tabs: page() action called with no arguments") ; - return ; - } - - if( tw->tabs.topWidget == NULL ) - tw->tabs.topWidget = tw->composite.children[0] ; - - for(idx=0, childP=tw->composite.children; idx < nc; ++idx, ++childP ) - if( tw->tabs.topWidget == *childP ) - break ; - - switch( params[0][0] ) { - case 'u': /* up */ - case 'U': - if( --idx < 0 ) - idx = nc-1 ; - newtop = tw->composite.children[idx] ; - break ; - - case 'd': /* down */ - case 'D': - if( ++idx >= nc ) - idx = 0 ; - newtop = tw->composite.children[idx] ; - break ; - - case 'h': - case 'H': - default: - newtop = tw->composite.children[0] ; - break ; - - case 'e': - case 'E': - newtop = tw->composite.children[nc-1] ; - break ; - - case 's': /* selected */ - case 'S': - if( (newtop = tw->tabs.hilight) == NULL ) - return ; - break ; - } - - XawTabsSetTop(newtop, True) ; -} - - - /* User hits up/down key */ - -static void -TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) -{ - TabsWidget tw = (TabsWidget) w ; - Widget newhl = NULL; - Widget *childP ; - int idx ; - int nc = tw->tabs.displayChildren ; - - if( nc <= 0 ) - return ; - - if( *num_params < 1 ) - { - if( tw->tabs.hilight != NULL ) - DrawHighlight(tw, tw->tabs.hilight, False) ; - return ; - } - - if( tw->tabs.hilight == NULL ) - newhl = tw->composite.children[0] ; - - else - { - /* find index of currently highlit child */ - for(idx=0, childP=tw->composite.children; idx < nc; ++idx, ++childP ) - if( tw->tabs.hilight == *childP ) - break ; - - switch( params[0][0] ) { - case 'u': /* up */ - case 'U': - if( --idx < 0 ) - idx = nc-1 ; - newhl = tw->composite.children[idx] ; - break ; - - case 'd': /* down */ - case 'D': - if( ++idx >= nc ) - idx = 0 ; - newhl = tw->composite.children[idx] ; - break ; - - case 'h': - case 'H': - newhl = tw->composite.children[0] ; - break ; - - case 'e': - case 'E': - newhl = tw->composite.children[nc-1] ; - break ; - - default: - newhl = tw->tabs.hilight ; - break ; - } - } - - XawTabsSetHighlight(w, newhl) ; -} - - - -static void -TabsUnhighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) -{ - TabsWidget tw = (TabsWidget) w ; - int nc = tw->composite.num_children ; - - if( nc <= 0 ) - return ; - - if( tw->tabs.hilight != NULL ) - DrawHighlight(tw, tw->tabs.hilight, True) ; -} - - - - - -/**************************************************************** - * - * Public Procedures - * - ****************************************************************/ - - - /* Set the top tab, optionally call all callbacks. */ -void -XawTabsSetTop(Widget w, Bool callCallbacks) -{ - TabsWidget tw = (TabsWidget)w->core.parent ; - TabsConstraints tab ; - Widget oldtop = tw->tabs.topWidget ; - - if( !XtIsSubclass(w->core.parent, tabsWidgetClass) ) - { - char line[256] ; - sprintf(line, "XawTabsSetTop: widget \"%.64s\" is not the child of a tabs widget.", XtName(w)) ; - XtAppWarning(XtWidgetToApplicationContext(w), line) ; - return ; - } - - if( callCallbacks ) - XtCallCallbackList(w, tw->tabs.popdownCallbacks, - (XtPointer)tw->tabs.topWidget) ; - - if( !XtIsRealized(w) ) { - tw->tabs.topWidget = w ; - tw->tabs.needs_layout = True ; - tw->tabs.hilight = NULL; /* The highlight tab might disappear. */ - return ; - } - - XRaiseWindow(XtDisplay(w), XtWindow(w)) ; -#ifdef NEED_MOTIF - XtVaSetValues(oldtop, XmNtraversalOn, False, 0) ; - XtVaSetValues(w, XmNtraversalOn, True, 0) ; -#endif - - tab = (TabsConstraints) w->core.constraints ; - - /* Unhighlight before we start messing with the stacking order. */ - if( tw->tabs.hilight != NULL ) - { - DrawHighlight(tw, tw->tabs.hilight, True) ; - tw->tabs.hilight = NULL; - } - - if( tab->tabs.row == 0 ) - { - /* Easy case; undraw current top, undraw new top, assign new - * top, redraw all borders. - * We *could* just erase and execute a full redraw, but I like to - * reduce screen flicker. - */ - UndrawTab(tw, oldtop) ; /* undraw old */ - DrawBorder(tw, oldtop, True) ; - UndrawTab(tw, w) ; /* undraw new */ - DrawBorder(tw, w, True) ; - tw->tabs.topWidget = w ; - DrawTab(tw, oldtop, True) ; /* redraw old */ - DrawTab(tw, w, True) ; /* redraw new */ - DrawTabs(tw, False) ; - } - else - { - tw->tabs.topWidget = w ; - TabsShuffleRows(tw) ; - XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; - XtClass(tw)->core_class.expose((Widget)tw,NULL,None) ; - } - - XawTabsSetHighlight((Widget)tw, w) ; - - if( callCallbacks ) - XtCallCallbackList(w, tw->tabs.callbacks, (XtPointer)w) ; -} - - - /* Set the top tab, optionally call all callbacks. */ -void -XawTabsSetHighlight(Widget t, Widget w) -{ - TabsWidget tw = (TabsWidget)t ; - - if( !XtIsSubclass(t, tabsWidgetClass) ) - return ; - - if( XtIsRealized(t) && w != tw->tabs.hilight ) - { - if( w != NULL ) - DrawHighlight(tw, w, False) ; - } - - tw->tabs.hilight = w ; -} - - - - -/**************************************************************** - * - * Private Procedures - * - ****************************************************************/ - - -static void -TabsAllocGCs(TabsWidget tw) -{ - TabsAllocFgGC(tw) ; - TabsAllocGreyGC(tw) ; - tw->tabs.backgroundGC = AllocBackgroundGC((Widget)tw, None) ; - tw->tabs.topGC = AllocTopShadowGC((Widget)tw, - tw->tabs.top_shadow_contrast, tw->tabs.be_nice_to_cmap) ; - tw->tabs.botGC = AllocBotShadowGC((Widget)tw, - tw->tabs.bot_shadow_contrast, tw->tabs.be_nice_to_cmap) ; -} - - -static void -TabsFreeGCs(TabsWidget tw) -{ - Widget w = (Widget) tw; - - XtReleaseGC(w, tw->tabs.foregroundGC) ; - XtReleaseGC(w, tw->tabs.greyGC) ; - XtReleaseGC(w, tw->tabs.backgroundGC) ; - XtReleaseGC(w, tw->tabs.topGC) ; - XtReleaseGC(w, tw->tabs.botGC) ; -#ifdef HAVE_XMU - XmuReleaseStippledPixmap(XtScreen(w), tw->tabs.grey50) ; -#endif -} - - - - - - /* Redraw entire Tabs widget */ - -static void -DrawTabs(TabsWidget tw, Bool labels) -{ - Widget *childP ; - int i,j ; - Dimension s = SHADWID ; - Dimension th = tw->tabs.tab_height ; - Position y ; - TabsConstraints tab ; - - 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.) - */ - - y = tw->tabs.numRows == 1 ? TABDELTA : 0 ; - for(i=0; i<tw->tabs.numRows; ++i, y += th) - { - for( j=tw->tabs.displayChildren, childP=tw->composite.children; - --j >= 0; ++childP ) - if( XtIsManaged(*childP) ) - { - tab = (TabsConstraints)(*childP)->core.constraints; - if( tab->tabs.row == i && *childP != tw->tabs.topWidget ) - DrawTab(tw, *childP, labels) ; - } - if( i != tw->tabs.numRows -1 ) - DrawTrim(tw, 0,y+th, tw->core.width, th+s, False,False) ; - } - - DrawFrame(tw) ; - - /* and now the top tab */ - if( tw->tabs.topWidget != NULL ) - DrawTab(tw, tw->tabs.topWidget, labels) ; -} - - - -/* Draw one tab. Corners are rounded very slightly. */ - -static void -DrawTab(TabsWidget tw, Widget child, Bool labels) -{ - GC gc ; - int x,y ; - - if( !XtIsRealized((Widget)tw)) - return ; - - DrawBorder(tw, child, False) ; - - if( labels ) - { - TabsConstraints tab = (TabsConstraints)child->core.constraints; - Display *dpy = XtDisplay((Widget)tw) ; - Window win = XtWindow((Widget)tw) ; - String lbl = tab->tabs.label != NULL ? - tab->tabs.label : XtName(child) ; - - if( XtIsSensitive(child) ) - { - gc = tw->tabs.foregroundGC ; - XSetForeground(dpy, gc, tab->tabs.foreground) ; - } - else - { - /* grey pixel allocation deferred until now */ - if( !tab->tabs.greyAlloc ) - { - if( tw->tabs.be_nice_to_cmap || tw->core.depth == 1 ) - tab->tabs.grey = tab->tabs.foreground ; - else - tab->tabs.grey = AllocGreyPixel((Widget)tw, - tab->tabs.foreground, - tw->core.background_pixel, - tw->tabs.insensitive_contrast ) ; - tab->tabs.greyAlloc = True ; - } - gc = tw->tabs.greyGC ; - XSetForeground(dpy, gc, tab->tabs.grey) ; - } - - x = tab->tabs.x ; - y = tab->tabs.y ; - if( child == tw->tabs.topWidget ) - y -= TABLDELTA ; - - if( tab->tabs.left_bitmap != None && tab->tabs.lbm_width > 0 ) - { - if( tab->tabs.lbm_depth == 1 ) - XCopyPlane(dpy, tab->tabs.left_bitmap, win,gc, - 0,0, tab->tabs.lbm_width, tab->tabs.lbm_height, - x+tab->tabs.lbm_x, y+tab->tabs.lbm_y, 1L) ; - else - XCopyArea(dpy, tab->tabs.left_bitmap, win,gc, - 0,0, tab->tabs.lbm_width, tab->tabs.lbm_height, - x+tab->tabs.lbm_x, y+tab->tabs.lbm_y) ; - } - - if( lbl != NULL && tw->tabs.font != NULL ) - XDrawString(dpy,win,gc, - x+tab->tabs.l_x, y+tab->tabs.l_y, - lbl, (int)strlen(lbl)) ; - } - - if( child == tw->tabs.hilight ) - DrawHighlight(tw, child, False) ; -} - - - /* draw frame all the way around the child windows. */ - -static void -DrawFrame(TabsWidget tw) -{ - GC topgc = tw->tabs.topGC ; - GC botgc = tw->tabs.botGC ; - Dimension s = SHADWID ; - Dimension ch = tw->tabs.child_height ; - Draw3dBox((Widget)tw, 0,tw->tabs.tab_total, - tw->core.width, ch+2*s, s, topgc, botgc) ; -} - - - /* draw trim around a tab or underneath a row of tabs */ - -static void -DrawTrim(TabsWidget tw, /* widget */ - int x, /* upper-left corner */ - int y, - int wid, /* total size */ - int hgt, - Bool bottom, /* draw bottom? */ - Bool undraw) /* undraw all */ -{ - Display *dpy = XtDisplay((Widget)tw) ; - Window win = XtWindow((Widget)tw) ; - GC bggc = tw->tabs.backgroundGC ; - GC topgc = undraw ? bggc : tw->tabs.topGC ; - GC botgc = undraw ? bggc : tw->tabs.botGC ; - if( bottom ) - XDrawLine(dpy,win,bggc, x,y+hgt-1, x+wid-1,y+hgt-1) ; /* bottom */ - XDrawLine(dpy,win,topgc, x,y+2, x,y+hgt-2) ; /* left */ - XDrawPoint(dpy,win,topgc, x+1,y+1) ; /* corner */ - XDrawLine(dpy,win,topgc, x+2,y, x+wid-3,y) ; /* top */ - XDrawLine(dpy,win,botgc, x+wid-2,y+1, x+wid-2,y+hgt-2) ; /* right */ - XDrawLine(dpy,win,botgc, x+wid-1,y+2, x+wid-1,y+hgt-2) ; /* right */ -} - - -/* Draw one tab border. */ - -static void -DrawBorder(TabsWidget tw, Widget child, Bool undraw) -{ - TabsConstraints tab = (TabsConstraints)child->core.constraints; - Position x = tab->tabs.x ; - Position y = tab->tabs.y ; - Dimension twid = tab->tabs.width ; - Dimension thgt = tw->tabs.tab_height ; - - /* top tab requires a little special attention; it overlaps - * neighboring tabs slightly, so the background must be cleared - * in the region of the overlap to partially erase those neighbors. - * TODO: is this worth doing with regions instead? - */ - if( child == tw->tabs.topWidget ) - { - Display *dpy = XtDisplay((Widget)tw) ; - Window win = XtWindow((Widget)tw) ; - GC bggc = tw->tabs.backgroundGC ; - XRectangle rects[3] ; - x -= TABDELTA ; - y -= TABDELTA ; - twid += TABDELTA*2 ; - thgt += TABDELTA ; - AddRect(0, x,y+1,twid,TABDELTA) ; - AddRect(1, x+1,y,TABDELTA,thgt) ; - AddRect(2, x+twid-TABDELTA-1,y,TABDELTA,thgt) ; - XFillRectangles(dpy,win,bggc, rects, 3) ; - } - - DrawTrim(tw, x,y,twid,thgt+1, child == tw->tabs.topWidget, undraw) ; -} - - -/* Draw highlight around tab that has focus */ - -static void -DrawHighlight(TabsWidget tw, Widget child, Bool undraw) -{ - TabsConstraints tab = (TabsConstraints)child->core.constraints; - Display *dpy = XtDisplay((Widget)tw) ; - Window win = XtWindow((Widget)tw) ; - GC gc ; - Position x = tab->tabs.x ; - Position y = tab->tabs.y ; - Dimension wid = tab->tabs.width ; - Dimension hgt = tw->tabs.tab_height ; - XPoint points[6] ; - - /* top tab does not have a highlight */ - - if( child == tw->tabs.topWidget ) - return ; - - if( undraw ) - gc = tw->tabs.backgroundGC ; - - else if( XtIsSensitive(child) ) - { - gc = tw->tabs.foregroundGC ; - XSetForeground(dpy, gc, tab->tabs.foreground) ; - } - else - { - gc = tw->tabs.greyGC ; - XSetForeground(dpy, gc, tab->tabs.grey) ; - } - - points[0].x = x+1 ; points[0].y = y+hgt-1 ; - points[1].x = x+1 ; points[1].y = y+2 ; - points[2].x = x+2 ; points[2].y = y+1 ; - points[3].x = x+wid-4 ; points[3].y = y+1 ; - points[4].x = x+wid-3 ; points[4].y = y+2 ; - points[5].x = x+wid-3 ; points[5].y = y+hgt-1 ; - - XDrawLines(dpy,win,gc, points,6, CoordModeOrigin) ; -} - - -/* Undraw one tab interior */ - -static void -UndrawTab(TabsWidget tw, Widget child) -{ - TabsConstraints tab = (TabsConstraints)child->core.constraints; - Position x = tab->tabs.x ; - Position y = tab->tabs.y ; - Dimension twid = tab->tabs.width ; - Dimension thgt = tw->tabs.tab_height ; - Display *dpy = XtDisplay((Widget)tw) ; - Window win = XtWindow((Widget)tw) ; - GC bggc = tw->tabs.backgroundGC ; - - XFillRectangle(dpy,win,bggc, x,y, twid,thgt) ; -} - - - - - - /* GEOMETRY UTILITIES */ - - /* Overview: - * - * MaxChild(): ask all children (except possibly one) their - * preferred sizes, set max_cw, max_ch accordingly. - * - * GetPreferredSizes(): ask all children their preferred sizes, - * set max_cw, max_ch accordingly. - * - * PreferredSize(): given max_cw, max_ch, return tabs widget - * preferred size. Iterate with other widths in order to get - * a reasonable aspect ratio. - * - * PreferredSize2(): Given child dimensions, return Tabs - * widget dimensions. - * - * PreferredSize3(): Same, except given child dimensions plus - * shadow. - */ - - - /* Compute the width of one child's tab. Positions will be computed - * elsewhere. - * - * height: font height + vertical_space*2 + shadowWid*2 - * width: string width + horizontal_space*2 + shadowWid*2 - * - * All tabs are the same height, so that is computed elsewhere. - */ - -static void -TabWidth(Widget w) -{ - TabsConstraints tab = (TabsConstraints) w->core.constraints ; - TabsWidget tw = (TabsWidget)XtParent(w) ; - String lbl = tab->tabs.label != NULL ? - tab->tabs.label : XtName(w) ; - XFontStruct *font = tw->tabs.font ; - int iw = tw->tabs.internalWidth ; - - tab->tabs.width = iw + SHADWID*2 ; - tab->tabs.l_x = tab->tabs.lbm_x = SHADWID + iw ; - - if( tab->tabs.left_bitmap != None ) - { - tab->tabs.width += tab->tabs.lbm_width + iw ; - tab->tabs.l_x += tab->tabs.lbm_width + iw ; - tab->tabs.lbm_y = (tw->tabs.tab_height - tab->tabs.lbm_height)/2 ; - } - - if( lbl != NULL && font != NULL ) - { - tab->tabs.width += XTextWidth( font, lbl, (int)strlen(lbl) ) + iw ; - tab->tabs.l_y = (tw->tabs.tab_height + - tw->tabs.font->max_bounds.ascent - - tw->tabs.font->max_bounds.descent)/2 ; - } -} - - - - /* Lay out tabs to fit in given width. Compute x,y position and - * row number for each tab. Return number of rows and total height - * required by all tabs. If there is only one row, add TABDELTA - * height to the total. Rows are assigned bottom to top. - * - * Tabs are indented from the edges by INDENT. - * - * TODO: if they require more than two rows and the total height:width - * ratio is more than 2:1, then try something else. - */ - -static int -TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_only) -{ - int i, row ; - int num_children = tw->composite.num_children ; - Widget *childP ; - Dimension w ; - Position x,y ; - TabsConstraints tab ; - - if (!query_only) - tw->tabs.displayChildren = 0; - - /* Algorithm: loop through children, assign X positions. If a tab - * would extend beyond the right edge, start a new row. After all - * rows are assigned, make a second pass and assign Y positions. - */ - - if( num_children > 0 ) - { - /* Loop through the tabs and see how much space they need. */ - - row = 0 ; - x = INDENT ; - y = 0 ; - wid -= INDENT ; - for(i=num_children, childP=tw->composite.children; --i >= 0; ++childP) - if( XtIsManaged(*childP) ) - { - tab = (TabsConstraints) (*childP)->core.constraints ; - w = tab->tabs.width ; - if( x + w > wid ) { /* new row */ - if (y + tw->tabs.tab_height > hgt) - break; - ++row ; - x = INDENT ; - y += tw->tabs.tab_height ; - } - if( !query_only ) { - tab->tabs.x = x ; - tab->tabs.y = y ; - tab->tabs.row = row ; - } - x += w + SPACING ; - if (!query_only) - tw->tabs.displayChildren++; - } - /* If there was only one row, increse the height by TABDELTA */ - if( ++row == 1 ) - { - y = TABDELTA ; - if( !query_only ) - for(i=num_children, childP=tw->composite.children; - --i >= 0 ; ++childP) - if( XtIsManaged(*childP) ) - { - tab = (TabsConstraints) (*childP)->core.constraints ; - tab->tabs.y = y ; - } - } - y += tw->tabs.tab_height ; - } - else - row = y = 0 ; - - if( !query_only ) { - tw->tabs.tab_total = y ; - tw->tabs.numRows = row ; - } - - if( reply_height != NULL ) - *reply_height = y ; - - return row ; -} - - - - /* Find max preferred child size. Returned sizes include child - * border widths. - */ - -static void -GetPreferredSizes(TabsWidget tw) -{ - MaxChild(tw, NULL, 0,0) ; -} - - - - /* Find max preferred child size. Returned sizes include child - * border widths. If except is non-null, don't ask that one. - */ - -static void -MaxChild(TabsWidget tw, Widget except, Dimension cw, Dimension ch) -{ - int i ; - Widget *childP = tw->composite.children ; - XtWidgetGeometry preferred ; - - for(i=tw->composite.num_children; --i >=0; ++childP) - if( XtIsManaged(*childP) && *childP != except ) - { - (void) XtQueryGeometry(*childP, NULL, &preferred) ; - cw = Max(cw, preferred.width + preferred.border_width * 2 ) ; - ch = Max(ch, preferred.height + preferred.border_width * 2 ) ; - } - - tw->tabs.max_cw = cw ; - tw->tabs.max_ch = ch ; -} - - - - /* rotate row numbers to bring current widget to bottom row, - * compute y positions for all tabs - */ - -static void -TabsShuffleRows(TabsWidget tw) -{ - TabsConstraints tab ; - int move ; - int nrows ; - Widget *childP ; - Dimension th = tw->tabs.tab_height ; - Position bottom ; - int i ; - - /* There must be a top widget. If not, assign one. */ - if( tw->tabs.topWidget == NULL && tw->composite.children != NULL ) - for(i=tw->composite.num_children, childP=tw->composite.children; - --i >= 0; - ++childP) - if( XtIsManaged(*childP) ) { - tw->tabs.topWidget = *childP ; - break ; - } - - if( tw->tabs.topWidget != NULL ) - { - nrows = tw->tabs.numRows ; - assert( nrows > 0 ) ; - - if( nrows > 1 ) - { - tab = (TabsConstraints) tw->tabs.topWidget->core.constraints ; - assert( tab != NULL ) ; - - /* how far to move top row */ - move = nrows - tab->tabs.row ; - bottom = tw->tabs.tab_total - th ; - - for(i=tw->tabs.displayChildren, childP=tw->composite.children; - --i >= 0; - ++childP) - if( XtIsManaged(*childP) ) - { - tab = (TabsConstraints) (*childP)->core.constraints ; - tab->tabs.row = (tab->tabs.row + move) % nrows ; - tab->tabs.y = bottom - tab->tabs.row * th ; - } - } - } -} - - - /* Find preferred size. Ask children, find size of largest, - * add room for tabs & return. This can get a little involved, - * as we don't want to have too many rows of tabs; we may widen - * the widget to reduce # of rows. - * - * This function requires that max_cw, max_ch already be set. - */ - -static int -PreferredSize( - TabsWidget tw, - Dimension *reply_width, /* total widget size */ - Dimension *reply_height, - Dimension *reply_cw, /* child widget size */ - Dimension *reply_ch) -{ - Dimension cw,ch ; /* child width, height */ - Dimension wid,hgt ; - Dimension rwid,rhgt ; - int nrow ; - - wid = cw = tw->tabs.max_cw ; - hgt = ch = tw->tabs.max_ch ; - - nrow = PreferredSize2(tw, wid,hgt, &rwid, &rhgt) ; - - /* Check for absurd results (more than 2 rows, high aspect - * ratio). Try wider size if needed. - * TODO: make sure this terminates. - */ - - if( nrow > 2 && rhgt > rwid ) - { - Dimension w0, w1 ; - int maxloop = 20 ; - - /* step 1: start doubling size until it's too big */ - do { - w0 = wid ; - wid = Max(wid*2, wid+20) ; - nrow = PreferredSize2(tw, wid,hgt, &rwid,&rhgt) ; - } while( nrow > 2 && rhgt > rwid ) ; - w1 = wid ; - - /* step 2: use Newton's method to find ideal size. Stop within - * 8 pixels. - */ - while( --maxloop > 0 && w1 > w0 + 8 ) - { - wid = (w0+w1)/2 ; - nrow = PreferredSize2(tw, wid,hgt, &rwid,&rhgt) ; - if( nrow > 2 && rhgt > rwid ) - w0 = wid ; - else - w1 = wid ; - } - wid = w1 ; - } - - *reply_width = rwid ; - *reply_height = rhgt ; - if( reply_cw != NULL ) *reply_cw = cw ; - if( reply_ch != NULL ) *reply_ch = ch ; - return nrow ; -} - - - /* Find preferred size, given size of children. */ - -static int -PreferredSize2( - TabsWidget tw, - int cw, /* child width, height */ - int ch, - Dimension *reply_width, /* total widget size */ - Dimension *reply_height) -{ - Dimension s = SHADWID ; - - /* make room for shadow frame */ - cw += s*2 ; - ch += s*2 ; - - return PreferredSize3(tw, cw, ch, reply_width, reply_height) ; -} - - - /* Find preferred size, given size of children+shadow. */ - -static int -PreferredSize3( - TabsWidget tw, - int wid, /* child width, height */ - int hgt, - Dimension *reply_width, /* total widget size */ - Dimension *reply_height) -{ - Dimension th ; /* space used by tabs */ - int nrows ; - - if( tw->composite.num_children > 0 ) - nrows = TabLayout(tw, wid, hgt, &th, True) ; - else { - th = 0 ; - nrows = 0 ; - } - - *reply_width = Max(wid, MIN_WID) ; - *reply_height = Max(th+hgt, MIN_HGT) ; - - return nrows ; -} - - -static void -MakeSizeRequest(TabsWidget tw) -{ - Widget w = (Widget)tw ; - XtWidgetGeometry request, reply ; - XtGeometryResult result ; - Dimension cw,ch ; - - request.request_mode = CWWidth | CWHeight ; - PreferredSize(tw, &request.width, &request.height, &cw, &ch) ; - - if( request.width == tw->core.width && - request.height == tw->core.height ) - return ; - - result = XtMakeGeometryRequest(w, &request, &reply) ; - - if( result == XtGeometryAlmost ) - { - /* Bugger. Didn't get what we want, but were offered a - * compromise. If the width was too small, recompute - * based on the too-small width and try again. - * If the height was too small, make a wild-ass guess - * at a wider width and try again. - */ - - if( reply.width < request.width && reply.height >= request.height ) - { - Dimension s = SHADWID ; - ch += s*2 ; - PreferredSize3(tw, reply.width,ch, &request.width, &request.height); - result = XtMakeGeometryRequest(w, &request, &reply) ; - if( result == XtGeometryAlmost ) - (void) XtMakeGeometryRequest(w, &reply, NULL) ; - } - - else - (void) XtMakeGeometryRequest(w, &reply, NULL) ; - } -} - - -static void -getBitmapInfo(TabsWidget tw, TabsConstraints tab) -{ - Window root ; - int x,y ; - unsigned int bw ; - - if( tab->tabs.left_bitmap == None || - !XGetGeometry(XtDisplay(tw), tab->tabs.left_bitmap, &root, &x, &y, - &tab->tabs.lbm_width, &tab->tabs.lbm_height, - &bw, &tab->tabs.lbm_depth) ) - tab->tabs.lbm_width = tab->tabs.lbm_height = 0 ; -} - - - - - /* Code copied & modified from Gcs.c. This version has dynamic - * foreground. - */ - -static void -TabsAllocFgGC(TabsWidget tw) -{ - Widget w = (Widget) tw; - XGCValues values ; - - values.background = tw->core.background_pixel ; - values.font = tw->tabs.font->fid ; - values.line_style = LineOnOffDash ; - values.line_style = LineSolid ; - - tw->tabs.foregroundGC = - XtAllocateGC(w, w->core.depth, - GCBackground|GCFont|GCLineStyle, &values, - GCForeground, - GCSubwindowMode|GCGraphicsExposures|GCDashOffset| - GCDashList|GCArcMode) ; -} - -static void -TabsAllocGreyGC(TabsWidget tw) -{ - Widget w = (Widget) tw; - XGCValues values ; - - values.background = tw->core.background_pixel ; - values.font = tw->tabs.font->fid ; -#ifdef HAVE_XMU - if( tw->tabs.be_nice_to_cmap || w->core.depth == 1) - { - values.fill_style = FillStippled ; - tw->tabs.grey50 = - values.stipple = XmuCreateStippledPixmap(XtScreen(w), 1L, 0L, 1) ; - - tw->tabs.greyGC = - XtAllocateGC(w, w->core.depth, - GCBackground|GCFont|GCStipple|GCFillStyle, &values, - GCForeground, - GCSubwindowMode|GCGraphicsExposures|GCDashOffset| - GCDashList|GCArcMode) ; - } - else -#endif - { - tw->tabs.greyGC = - XtAllocateGC(w, w->core.depth, - GCFont, &values, - GCForeground, - GCBackground|GCSubwindowMode|GCGraphicsExposures|GCDashOffset| - GCDashList|GCArcMode) ; - } -} diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwtabs.h --- a/lwlib/xlwtabs.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/* 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. */ - -/* - * This widget manages one or more child widgets, exactly one of which is - * visible. Above the child widgets is a graphic that looks like index - * tabs from file folders. Each tab corresponds to one of the child widgets. - * By clicking on a tab, the user can bring the corresponding widget to - * the top of the stack. - */ - - -#ifndef _Tabs_h -#define _Tabs_h - -#include <X11/Constraint.h> - - -/*********************************************************************** - * - * Tabs Widget (subclass of CompositeClass) - * - ***********************************************************************/ - -/* Parameters: - - Name Class RepType Default Value - ---- ----- ------- ------------- - font Font XFontStruct* XtDefaultFont - internalWidth Width Dimension 4 *1 - internalHeight Height Dimension 2 *1 - topWidget TopWidget Widget *2 - callback Callback XtCallbackList NULL *3 - popdownCallback Callback XtCallbackList NULL *4 - selectInsensitive SelectInsensitive Boolean True *5 - beNiceToColormap BeNiceToColormap Boolean False *6 - topShadowContrast TopShadowContrast int 20 - bottomShadowContrast BottomShadowContrast int 40 - insensitiveContrast InsensitiveContrast int 33 *7 - - background Background Pixel XtDefaultBackground - border BorderColor Pixel XtDefaultForeground - borderWidth BorderWidth Dimension 1 - destroyCallback Callback Pointer NULL - hSpace HSpace Dimension 4 - height Height Dimension 0 - mappedWhenManaged MappedWhenManaged Boolean True - orientation Orientation XtOrientation vertical - vSpace VSpace Dimension 4 - width Width Dimension 0 - x Position Position 0 - y Position Position 0 - - Notes: - - 1 internalWidth, internalHeight specify the margins around the text - in the tabs. - 2 topWidget identifies the widget which is currently visible. - 3 callbacks are called whenever the user selects a tab. Call_data is - the new top widget. - 4 popdownCallbacks are called whenever the user selects a tab. Call_data is - the old (no longer visible) top widget. Note that popdownCallbacks - are called before callbacks. - 5 SelectInsensitive determines whether or not insensitive children may - be selected anyway. - 6 BeNiceToColormap causes the Tabs widget to use fewer colors. - 7 InsensitiveContrast sets the contrast used for labels of insensitive widgets. - -*/ - -/* Constraint parameters: - Name Class RepType Default Value - ---- ----- ------- ------------- - tabLabel Label String widget name - tabLeftBitmap LeftBitmap Pixmap None - tabForeground Foreground Pixel XtDefaultForeground - resizable Resizable Boolean False -*/ - -/* New fields */ - -#ifndef XtNtabLabel -#define XtNtabLabel "tabLabel" -#define XtNtabForeground "tabForeground" -#endif - -#ifndef XtNtabLeftBitmap -#define XtNtabLeftBitmap "tabLeftBitmap" -#endif - -#ifndef XtCLeftBitmap -#define XtCLeftBitmap "LeftBitmap" -#endif - -#ifndef XtCResizable -#define XtCResizable "Resizable" -#endif - -#ifndef XtNselectInsensitive -#define XtNselectInsensitive "selectInsensitive" -#define XtCSelectInsensitive "SelectInsensitive" -#endif - -#ifndef XtNnlabels -#define XtNnlabels "nlabels" -#define XtCNLabels "NLabels" -#endif -#ifndef XtNlabels -#define XtNlabels "labels" -#define XtCLabels "Labels" -#endif - -#ifndef XtNtopWidget -#define XtNtopWidget "topWidget" -#define XtCTopWidget "TopWidget" -#endif - -#ifndef XtNhSpace -#define XtNhSpace "hSpace" -#define XtCHSpace "HSpace" -#define XtNvSpace "vSpace" -#define XtCVSpace "VSpace" -#endif - -#ifndef XtNresizable -#define XtNresizable "resizable" -#endif - -#ifndef XtNinsensitiveContrast -#define XtNinsensitiveContrast "insensitiveContrast" -#define XtCInsensitiveContrast "InsensitiveContrast" -#endif - -#ifndef XtNshadowWidth -#define XtNshadowWidth "shadowWidth" -#define XtCShadowWidth "ShadowWidth" -#define XtNtopShadowPixel "topShadowPixel" -#define XtCTopShadowPixel "TopShadowPixel" -#define XtNbottomShadowPixel "bottomShadowPixel" -#define XtCBottomShadowPixel "BottomShadowPixel" -#define XtNtopShadowContrast "topShadowContrast" -#define XtCTopShadowContrast "TopShadowContrast" -#define XtNbottomShadowContrast "bottomShadowContrast" -#define XtCBottomShadowContrast "BottomShadowContrast" -#endif - -#ifndef XtNtopShadowPixmap -#define XtNtopShadowPixmap "topShadowPixmap" -#define XtCTopShadowPixmap "TopShadowPixmap" -#define XtNbottomShadowPixmap "bottomShadowPixmap" -#define XtCBottomShadowPixmap "BottomShadowPixmap" -#endif - -#ifndef XtNbeNiceToColormap -#define XtNbeNiceToColormap "beNiceToColormap" -#define XtCBeNiceToColormap "BeNiceToColormap" -#define XtNbeNiceToColourmap "beNiceToColormap" -#define XtCBeNiceToColourmap "BeNiceToColormap" -#endif - -/* Class record constants */ - -extern WidgetClass tabsWidgetClass; - -typedef struct _TabsClassRec *TabsWidgetClass; -typedef struct _TabsRec *TabsWidget; - -_XFUNCPROTOBEGIN - -extern void -XawTabsSetTop( -#if NeedFunctionPrototypes - Widget w, - Bool callCallbacks -#endif -) ; - -extern void -XawTabsSetHighlight( -#if NeedFunctionPrototypes - Widget tabs, - Widget w -#endif -) ; - -_XFUNCPROTOEND - -#endif /* _Tabs_h */ diff -r 12e008d41344 -r 697ef44129c6 lwlib/xlwtabsP.h --- a/lwlib/xlwtabsP.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* 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: TabsP.h 1.8 */ - -/* - * TabsP.h - Private definitions for Index Tabs widget - */ - -#ifndef _TabsP_h -#define _TabsP_h - -/*********************************************************************** - * - * Tabs Widget Private Data - * - ***********************************************************************/ - -#include <X11/IntrinsicP.h> - -#ifdef NEED_MOTIF -#include <Xm/XmP.h> -#include <Xm/ManagerP.h> -#endif - -#include "xlwtabs.h" - -/* New fields for the Tabs widget class record */ -typedef struct {XtPointer extension;} TabsClassPart; - -/* Full class record declaration */ -typedef struct _TabsClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ConstraintClassPart constraint_class; -#ifdef NEED_MOTIF - XmManagerClassPart manager_class; -#endif - TabsClassPart tabs_class; -} TabsClassRec; - -extern TabsClassRec tabsClassRec; - - - -/**************************************************************** - * - * instance record declaration - * - ****************************************************************/ - -/* New fields for the Tabs widget record */ -typedef struct { - /* resources */ - XFontStruct *font ; - Dimension internalHeight, internalWidth ; - Widget topWidget ; - XtCallbackList callbacks ; - XtCallbackList popdownCallbacks ; - Boolean selectInsensitive ; - Boolean be_nice_to_cmap ; - int top_shadow_contrast ; - int bot_shadow_contrast ; - int insensitive_contrast ; - - /* private state */ - Widget hilight ; - GC foregroundGC ; - GC backgroundGC ; - GC greyGC ; - GC topGC ; - GC botGC ; - Dimension tab_height ; /* height of tabs (all the same) */ - /* Note: includes top shadow only */ - Dimension tab_total ; /* total height of all tabs */ - Dimension child_width, child_height; /* child size, including borders */ - Dimension max_cw, max_ch ; /* max child preferred size */ - Cardinal numRows ; - Cardinal displayChildren ; - XtGeometryMask last_query_mode; - Boolean needs_layout ; - Pixmap grey50 ; /* TODO: cache this elsewhere */ -} TabsPart; - - -typedef struct _TabsRec { - CorePart core; - CompositePart composite; - ConstraintPart constraint; -#ifdef NEED_MOTIF - XmManagerPart manager; -#endif - TabsPart tabs; -} TabsRec; - - - - -/**************************************************************** - * - * constraint record declaration - * - ****************************************************************/ - -typedef struct _TabsConstraintsPart { - /* resources */ - String label ; - Pixmap left_bitmap ; - Pixel foreground ; - Boolean resizable ; - - /* private state */ - Pixel grey ; - Boolean greyAlloc ; - Dimension width ; /* tab width */ - Position x,y ; /* tab base position */ - short row ; /* tab row */ - Position l_x, l_y ; /* label position */ - Position lbm_x, lbm_y ; /* bitmap position */ - unsigned int lbm_width, lbm_height, lbm_depth ; -} TabsConstraintsPart ; - -typedef struct _TabsConstraintsRec { -#ifdef NEED_MOTIF - XmManagerConstraintPart manager; -#endif - TabsConstraintsPart tabs ; -} TabsConstraintsRec, *TabsConstraints ; - - -#endif /* _TabsP_h */ diff -r 12e008d41344 -r 697ef44129c6 man/ChangeLog --- a/man/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/man/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,600 +1,3 @@ -2000-07-19 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.35 is released. - -2000-07-10 Martin Buchholz <martin@xemacs.org> - - * Makefile: rm -f ==> $(RM) - -2000-07-09 Martin Buchholz <martin@xemacs.org> - - * lispref/postgresql.texi: - - Don't mention ".so" extension. - - Make installation instructions more generic. - - Mention M-x describe-installation. - -2000-07-08 Ben Wing <ben@xemacs.org> - - * xemacs-faq.texi (Q6.4.1): Update the perennial nonstart under - Windows problem with binary locs and latest info. - -2000-06-17 Adrian Aichner <aichner@ecf.teradyne.com> - - * lispref/glyphs.texi: Fix trivial typos. - * lispref/gutter.texi: Ditto. - * lispref/loading.texi: Ditto. - * lispref/postgresql.texi: Ditto. - -2000-06-14 Adrian Aichner <aichner@ecf.teradyne.com> - - * internals/internals.texi (Markers and Extents): Fix trivial typo. - -2000-06-11 Adrian Aichner <aichner@ecf.teradyne.com> - - * 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 <ben@xemacs.org> - - * 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 <aichner@ecf.teradyne.com> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.34 is released. - -2000-05-17 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs/basic.texi: Document translation of tutorial. - * xemacs/startup.texi: Remove lock-directory. - * xemacs/enterings.texi: Update. - -2000-05-17 Yoshiki Hayashi <yoshiki@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * xemacs/basic.texi: - * xemacs/enterings.texi: - * xemacs/mini.texi: - Partial sync with FSF Emacs 20.6 and some update. - -2000-05-01 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.33 is released. - -2000-04-11 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs-faq.texi (Q2.1.24): Removed wrong header. - -2000-04-01 Oscar Figueiredo <oscar@xemacs.org> - - * lispref/ldap.texi: Documentation of the add/modify/delete and - internationalization APIs - - * lispref/lispref.texi: Updated LDAP-related menus - -2000-03-20 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.32 is released. - -2000-03-15 SL Baur <steve@musashimaru.m17n.org> - - * lispref/postgresql.texi (Unimplemented libpq Functions): Update - documentation to reflect the latest code. - -2000-03-07 SL Baur <steve@musashimaru.m17n.org> - - * 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 <yoshiki@xemacs.org> - - * lispref/glyphs.texi (Image Specifiers): Remove parenthesis. - -2000-03-06 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs-faq.texi: Put node before section. - -2000-03-05 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * xemacs-faq.texi (Macintosh port): Made texinfmt-friendly. - -2000-03-01 Sandra Wambold <wambold@xemacs.org> - - * xemacs-faq.texi: Added 6.4.1. XEmacs won't start on Windows - -2000-01-25 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs/xemacs.texi: Detailed menu update. - -2000-01-28 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs/help.texi: Synch with FSF 20.5. Update. - -2000-02-21 Yoshiki Hayashi <yoshiki@xemacs.org> - - * lispref/minibuf.texi: Add default argument documentation. - -2000-02-27 Martin Buchholz <martin@xemacs.org> - - * internals/internals.texi (lrecords): Update docs for new lisp - object representation. - -2000-02-25 Martin Buchholz <martin@xemacs.org> - - * 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 <turnbull@sk.tsukuba.ac.jp> - - * 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 <turnbull@sk.tsukuba.ac.jp> - - * 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 <turnbull@sk.tsukuba.ac.jp> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.31 is released. - -2000-02-21 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.30 is released. - -2000-02-21 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * internals/internals.texi: Made texinfmt-friendly. - -2000-01-20 Mark Thomas <mthomas@jprc.com> - - * lispref/backups.texi (Numbered Backups): - * xemacs/files.texi (Backup Deletion): - Change trim-versions-without-asking to delete-old-versions. - -2000-02-19 Martin Buchholz <martin@xemacs.org> - - * internals/internals.texi (Conversion to and from External Data): - Document TO_EXTERNAL_FORMAT and friends. - Doc bug fixes. - -2000-02-16 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.29 is released. - -2000-02-16 Martin Buchholz <martin@xemacs.org> - - * internals/internals.texi: Integrate Olivier's portable dumping docs. - -2000-02-09 Martin Buchholz <martin@xemacs.org> - - * lispref/symbols.texi (Object Plists): - Document `object-plist'. - Document `remprop'. - Rework all plist frobbing docs for accuracy. - -2000-02-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.28 is released. - -2000-02-07 Martin Buchholz <martin@xemacs.org> - - * cl.texi: Remove (or replace by `get') references to `get*'. - -2000-01-25 Yoshiki Hayashi <yoshiki@xemacs.org> - - * widget.texi: - * internals/internals.texi: - * lispref/commands.texi: - * lispref/consoles-devices.texi: - * lispref/customize.texi: - * lispref/dialog.texi: - * lispref/extents.texi: - * lispref/faces.texi: - * lispref/glyphs.texi: - * lispref/keymaps.texi: - * lispref/lists.texi: - * lispref/markers.texi: - * lispref/menus.texi: - * lispref/mule.texi: - * lispref/objects.texi: - * lispref/specifiers.texi: - * lispref/toolbar.texi: - * lispref/tooltalk.texi: - * lispref/x-windows.texi: - * new-users-guide/custom2.texi: - * new-users-guide/help.texi: - * new-users-guide/modes.texi: - * xemacs/abbrevs.texi: - * xemacs/buffers.texi: - * xemacs/custom.texi: - * xemacs/help.texi: - * xemacs/keystrokes.texi: - * xemacs/mini.texi: - * xemacs/new.texi: - * xemacs/packages.texi: - * xemacs/programs.texi: - * xemacs/sending.texi: - Change ' -- ' to '---' since Texinfo formats --- to --. - Untabify. TeX doesn't like TAB. - -2000-01-27 Sandra Wambold <wambold@xemacs.org> - - * xemacs-faq.texi (Q6.2.2): updated font instructions to include - 21.2.* - -2000-01-25 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs-faq.texi: Untabify. - -2000-01-22 Martin Buchholz <martin@xemacs.org> - - * internals/internals.texi (General Coding Rules): Document why we - #include <config.h> - -2000-01-21 Yoshiki Hayashi <yoshiki@xemacs.org> - - * xemacs-faq.texi: Change ' -- ' to '---'. - -2000-01-19 Yoshiki Hayashi <yoshiki@xemacs.org> - - * lispref/faces.texi (Face Properties): Document - remove-face-property. - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.27 is released. - -2000-01-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * xemacs/regs.texi: Synch with FSF 20.5. - -2000-01-14 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * info.texi: Change cross reference from emacs to xemacs. - -2000-01-14 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * xemacs/mini.texi: Synch with FSF 20.5. Update. - -2000-01-16 Martin Buchholz <martin@xemacs.org> - - * xemacs-faq.texi (Q2.1.15): Fix up @table formatting. - -2000-01-14 Martin Buchholz <martin@xemacs.org> - - * xemacs-faq.texi (Q2.1.15): Update dbx/gdb debugging info. - -2000-01-14 Sandra Wambold <wambold@xemacs.org> - - * xemacs-faq.texi: removed out-of-date XEmacs 19 questions. - -2000-01-14 Sandra Wambold <wambold@xemacs.org> - - * xemacs-faq.texi: Updated Macintosh information, - updated OS/2 info, changed turn-on-pending-delete answer. - -2000-01-08 Martin Buchholz <martin@xemacs.org> - - * xemacs-faq.texi (Q2.1.15): Make debugging info current. - -2000-01-08 Hrvoje Niksic <hniksic@iskon.hr> - - * lispref/control.texi (Signaling Errors): Document that `signal' - is continuable. - (Signaling Errors): Document `cerror', `signal-error', and - `check-argument-type'. - (Handling Errors): Mention `debug-on-signal'. - (Error Symbols): Document `define-error'. - (Processing of Errors): Document `display-error' and - `error-message-string'. - -2000-01-05 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * internals/internals.texi: Remove latin-1 char. - -2000-01-05 Didier Verna <didier@xemacs.org> - - * xemacs/custom.texi (Key bindings using strings): add missing - whitespace. - - * xemacs/xemacs.texi (Top): - * new-users-guide/new-users-guide.texi (Top): add missing `@top' - node. - -1999-12-24 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * lispref/minibuf.texi (Reading a Password): New section. - -1999-12-21 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * lispref/minibuf.texi: Remove documentation about - minibuffer-local-ns-map, read-no-blanks-input. - -1999-12-21 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * lispref/minibuf.texi: Partial Synch with FSF manual. - Add description about DEFAULT argument of reading functions. - -1999-12-31 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.26 is released. - -1999-12-26 Karl M. Hegbloom <karlheg@inetarena.com> - - * internals/internals.texi (garbage_collect_1): Xemacs -> XEmacs - -1999-12-24 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.25 is released. - -1999-12-21 Martin Buchholz <martin@xemacs.org> - - * lispref/text.texi (Near Point): Document `char-before'. - -1999-12-20 Adrian Aichner <adrian@xemacs.org> - - * widget.texi: Fix typos and possessive singular errors. Break - long sentences for readability. Remove some redundant commas. - -1999-12-18 Martin Buchholz <martin@xemacs.org> - - * lispref/functions.texi (Mapping Functions): - Warn about mapping functions modifying their sequences. - -1999-12-15 Sandra Wambold <wambold@xemacs.org> - - * xemacs-faq.texi: link to matlab.el added; misc. address changes - -1999-12-14 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.24 is released. - -1999-12-07 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * xemacs/startup.texi (Startup Paths): fix typo: EMACSPACKAGEPATH - instead of PACKAGEPATH - From Marcus Harnisch <harnisch@mikrom.de> - -1999-12-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.23 is released. - -1999-12-06 Sandra Wambold <wambold@pobox.com> - - * xemacs-faq.texi: Added MS-Windows questions; some other changes - -1999-11-29 Martin Buchholz <martin@xemacs.org> - - * info.texi (Top): - Remove @ifnottex, which gives old makeinfos indigestion. - * 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. - -1999-11-30 Sandra Wambold <wambold@cygnus.com> - - * xemacs-faq.texi: fixed and commented out bad URL links - -1999-11-29 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.21 is released. - -1999-11-26 Martin Buchholz <martin@xemacs.org> - - * internals.texi (Lstream Functions): - * internals.texi (Lstream Methods): - Types have changed to size_t and ssize_t. Document them. - -1999-08-12 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * xemacs-faq.texi (Q4.4.2): added FAQ about Sun Workshop on - XEmacs 21 - -1999-11-15 Martin Buchholz <martin@xemacs.org> - - * 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. - - Remove makeinfo-1.68 warning. (Usually only maintainer rebuilds info). - - Comment out unused macros: EMACS EMACSFLAGS - - Replace `-rm -f' with `rm -f', XPG4 guarantees exit code == 0. - - Get dependencies up to date. - - * internals/Makefile: - * xemacs/Makefile: - * lispref/Makefile: - * new-users-guide/Makefile: - * lispref/index.perm: - * lispref/index.unperm: - * lispref/permute-index: - * internals/index.perm: - * internals/index.unperm: - Remove these Makefiles. - Include all functionality in man/Makefile. - Support only non-permuted indexes for simplicity. - - * emodules.texi: - - TeX doesn't tolerate `_' in variable names; use `-' instead. - - * lispref/commands.texi: - * lispref/display.texi: - * lispref/faces.texi: - * lispref/functions.texi: - * lispref/keymaps.texi: - * lispref/lists.texi: - * lispref/modes.texi: - * lispref/objects.texi: - * lispref/os.texi: - * lispref/sequences.texi: - * lispref/strings.texi: - * lispref/text.texi: - * new-users-guide/custom1.texi: - * xemacs/custom.texi: - * xemacs/menus.texi: - - Make sources compatible with makeinfo 4.0 *and* 3.12. - - Replace @sc{ASCII} with @sc{ascii}, etc... - - Replace @var{(foo)} with (@var{foo}), etc... - - * info-stnd.texi: Remove. Who cares about the standalone info reader? - - * texinfo.tex: - * texinfo.texi: - * info.texi: - * standards.texi: - * make-stds.texi: - Import FSF-maintained files from texinfo-4.0. - -1999-11-10 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.20 is released - -1999-08-30 Robert Pluim <rpluim@bigfoot.com> - - * xemacs/packages.texi (Using Packages): Added description of - package-get-package-provider. - -1999-07-27 Charles G Waldman <cgw@fnal.gov> - - * xemacs-faq.texi (Q5.0.6): Describe `shell-multiple-shells' - -1999-08-01 Adrian Aichner <adrian@xemacs.org> - - * xemacs/programs.texi (Balanced Editing): Remove broken - line-break. - - * xemacs-faq.texi (Q1.0.6): Provide correct location in XEmacs - menus. - (Q1.4.1): ditto. - (Q1.4.3): ditto. - (Q2.0.5): Hyphenate words. - - * info.texi (Add): Fix one typo. - -1999-08-23 Stephane Epardaud <stephane@lunatech.com> - - * internals/internals.texi (Garbage Collection - Step by Step): - just added some dots to shut up compile warnings. - -1999-08-19 Matthias Neubauer <neubauer@informatik.uni-tuebingen.de> - - * internals/internals.texi (Garbage Collection - Step by Step): - new section in chapter Allocation of Objects in XEmacs Lisp. - -1999-07-28 Andy Piper <andy@xemacs.org> - - * internals.texi (Glyphs): add some glyph documentation. - -1999-07-30 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.19 is released - -1999-07-10 Adrian Aichner <adrian@xemacs.org> - - * emodules.texi: Use @set emacs and @value{emacs} instead of - @macro (unsupported by texinfo package). Remove stray @code. - * custom.texi: Add info extension to @setfilename. - * texinfo.texi: Ditto. - * widget.texi: Ditto. - * packages.texi: Reword a sentence, fixing @item Decide where to - install ... - -1999-07-19 Didier Verna <didier@xemacs.org> - - * custom.texi (Wishlist): removed the Custom Comments wishlist - entry. They are implemented. - -1999-07-13 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.18 is released - -1999-06-22 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.17 is released - -1999-06-11 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.16 is released - -1999-06-04 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.15 is released - -1999-05-30 Albert Chin-A-Young <china@thewrittenword.com> - - * custom.texi, external-widget.texi: Minor - fix to get info DIR entry correct. - -1999-05-22 Vin Shelton <acs@xemacs.org> - - * xemacs/cmdargs.texi: - Document -private. - -1999-05-16 Mike McEwan <mike@lotusland.demon.co.uk> - - * Makefile: Added `emodules.info' to info targets. - -1999-05-20 Karl M. Hegbloom <karlheg@debian.org> - - * internals/internals.texi (The XEmacs Object System - (Abstractly Speaking)): typo. - -1999-05-16 Hrvoje Niksic <hniksic@srce.hr> - - * lispref/text.texi (Substitution): Document improvements in - `translate-region'. - 1999-05-14 XEmacs Build Bot <builds@cvs.xemacs.org> * XEmacs 21.2.14 is released @@ -651,7 +54,7 @@ * XEmacs 21.2.9 is released -1999-01-14 Adrian Aichner <adrian@xemacs.org> +1999-01-14 Adrian Aichner <aichner@ecf.teradyne.com> * internals\internals.texi (Techniques for XEmacs Developers): Fixing documentation. @@ -778,7 +181,7 @@ 1998-09-03 Darryl Okahata <darrylo@sr.hp.com> * xemacs/packages.texi: Correct and update package documentation. - Updated the package installation section to mention the visual + Updated the package installation section to mention the visual package browser/installer. 1998-08-31 Hrvoje Niksic <hniksic@srce.hr> @@ -790,7 +193,7 @@ * lispref/files.texi (User Name Completion): new section. -1998-07-23 Adrian Aichner <adrian@xemacs.org> +1998-07-23 Adrian Aichner <aichner@ecf.teradyne.com> * xemacs/packages.texi (Packages): Changing @itemize @emph to @itemize @bullet (this is what all other files included in @@ -800,7 +203,7 @@ * xemacs/startup.texi: Small fixes, suggested by Hrvoje. - * xemacs/xemacs.texi: + * xemacs/xemacs.texi: * xemacs/packages.texi: More packages documentation. 1998-07-19 SL Baur <steve@altair.xemacs.org> @@ -839,7 +242,7 @@ * standards.texi (Preface): Revert previous change to @node because it doesn't pass makeinfo. -1998-06-27 Adrian Aichner <adrian@xemacs.org> +1998-06-27 Adrian Aichner <aichner@ecf.teradyne.com> * cl.texi: See ALL. * info-stnd.texi: Fixed @setfilename. @@ -867,18 +270,18 @@ 1998-06-20 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - * xemacs/abbrevs.texi: - * xemacs/basic.texi: - * xemacs/buildings.texi: - * xemacs/cmdargs.texi: - * xemacs/files.texi: + * xemacs/abbrevs.texi: + * xemacs/basic.texi: + * xemacs/buildings.texi: + * xemacs/cmdargs.texi: + * xemacs/files.texi: * xemacs/adjustments.texi: Adjustments to integrate startup.texi and packages.texi stuff. - * xemacs/startup.texi: + * xemacs/startup.texi: * xemacs/packages.texi: Created. -1998-06-10 Adrian Aichner <adrian@xemacs.org> +1998-06-10 Adrian Aichner <aichner@ecf.teradyne.com> * texinfo.texi: added ../info/ to @setfilename, broke line after @noindent. Changed @var{arg-not-used-by-@TeX{}} to @@ -891,12 +294,12 @@ 1998-06-13 Greg Klanderman <greg@alphatech.com> - * lispref/windows.texi (Resizing Windows): document third optional + * lispref/windows.texi (Resizing Windows): document third optional WINDOW argument to enlarge-window and shrink-window. (Selecting Windows): document select-window optional norecord - argument. + argument. (Size of Window): document window-text-area-pixel-height and - window-text-area-pixel-width. + window-text-area-pixel-width. (Size of Window): document window-displayed-text-pixel-height. (Position of Window): document window-text-area-pixel-edges. @@ -938,7 +341,7 @@ * lispref/dragndrop.texi: naming changed to Drag and Drop added some docu about the drop procedure -1998-06-09 Adrian Aichner <adrian@xemacs.org> +1998-06-09 Adrian Aichner <aichner@ecf.teradyne.com> * info-stnd.texi: added ../info/ to @setfilename. * info.texi: added ../info/ to @setfilename. @@ -987,7 +390,7 @@ 1998-05-13 Greg Klanderman <greg@alphatech.com> * lispref/frames.texi (Input Focus): cleanup select-frame - documentation. + documentation. 1998-05-10 Oliver Graf <ograf@fga.de> @@ -1003,7 +406,7 @@ 1998-05-04 Martin Buchholz <martin@xemacs.org> - * internals.texi (Techniques for XEmacs Developers): Add some more + * internals.texi (Techniques for XEmacs Developers): Add some more comments on adding new files, inspired by Olivier Galibert. 1998-05-02 Hrvoje Niksic <hniksic@srce.hr> @@ -1011,7 +414,7 @@ * lispref/windows.texi (Vertical Scrolling): Fixup docstring for scroll-conservatively. - * lispref/loading.texi (Named Features): Document advanced args to + * lispref/loading.texi (Named Features): Document advanced args to `feature'. * lispref/files.texi (File Name Expansion): Document that @@ -1027,7 +430,7 @@ * lispref/os.texi (Time Conversion): Document that TIME may be omitted from format-time-string. - * lispref/strings.texi (String Conversion): Document BASE argument + * lispref/strings.texi (String Conversion): Document BASE argument to `string-to-number'. * lispref/searching.texi (Syntax of Regexps): Fix up Perl @@ -1043,7 +446,7 @@ stuff, including `display-message', `lmessage', `clear-message', (Warnings): Document warning stuff. - * lispref/commands.texi (Working With Events): Update `make-event' + * lispref/commands.texi (Working With Events): Update `make-event' for misc-user events. (Using Interactive): Document `function-interactive'. @@ -1057,7 +460,7 @@ 1998-05-02 Hrvoje Niksic <hniksic@srce.hr> - * lispref/numbers.texi (Comparison of Numbers): Document multi-arg + * lispref/numbers.texi (Comparison of Numbers): Document multi-arg comparison functions. 1998-04-30 Greg Klanderman <greg@alphatech.com> @@ -1103,7 +506,7 @@ setting of x-emacs-application-class. * lispref/x-windows.texi (Resources): update doc for - x-emacs-application-class. + x-emacs-application-class. 1998-02-20 Karl M. Hegbloom <karlheg@bittersweet.inetarena.com> @@ -1129,7 +532,7 @@ * xemacs/custom.texi (Init Syntax): document #b, #o, and #x reader syntax for integers. - From Adrian Aichner <adrian@xemacs.org> + From Adrian Aichner <aichner@ecf.teradyne.com> * cl.texi (Porting Common Lisp): ' ' * lispref/numbers.texi (Numbers): ' ' @@ -1472,3 +875,4 @@ * emacs.tex: Update information for obtaining TeX distribution from the University of Washington. + diff -r 12e008d41344 -r 697ef44129c6 man/Makefile --- a/man/Makefile Mon Aug 13 11:19:22 2007 +0200 +++ b/man/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -19,18 +19,23 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -SHELL = /bin/sh +# Avoid trouble on systems where the "SHELL" variable might be +# inherited from the environment. +SHELL = /bin/sh + +EMACS = ../src/xemacs +EMACSFLAGS = -batch -q -no-site-file + +# NOTE: You *must* have makeinfo-1.68 or later to rebuild the +# info tree. MAKEINFO = makeinfo TEXI2DVI = texi2dvi -RM = rm -f .SUFFIXES: .SUFFIXES: .info .texi .dvi RECURSIVE_MAKE = $(MAKE) $(MFLAGS) MAKEINFO='$(MAKEINFO)' TEXI2DVI='$(TEXI2DVI)' -all : info - # Ughhh! The things we do to have portable makefiles... INFODIR = ../info @@ -38,264 +43,114 @@ info_files = \ $(INFODIR)/cl.info \ $(INFODIR)/custom.info \ - $(INFODIR)/emodules.info \ $(INFODIR)/external-widget.info \ $(INFODIR)/info.info \ - $(INFODIR)/lispref.info \ - $(INFODIR)/internals.info \ - $(INFODIR)/new-users-guide.info \ $(INFODIR)/standards.info \ $(INFODIR)/term.info \ $(INFODIR)/termcap.info \ $(INFODIR)/texinfo.info \ $(INFODIR)/widget.info \ - $(INFODIR)/xemacs.info \ $(INFODIR)/xemacs-faq.info dvi_files = \ cl.dvi \ custom.dvi \ - emodules.dvi \ external-widget.dvi \ info.dvi \ - lispref.dvi \ - internals.dvi \ - new-users-guide.dvi \ standards.dvi \ term.dvi \ termcap.dvi \ texinfo.dvi \ widget.dvi \ - xemacs.dvi \ xemacs-faq.dvi -xemacs-srcs = \ - xemacs/abbrevs.texi \ - xemacs/basic.texi \ - xemacs/buffers.texi \ - xemacs/building.texi \ - xemacs/calendar.texi \ - xemacs/cmdargs.texi \ - xemacs/custom.texi \ - xemacs/display.texi \ - xemacs/entering.texi \ - xemacs/files.texi \ - xemacs/fixit.texi \ - xemacs/frame.texi \ - xemacs/glossary.texi \ - xemacs/gnu.texi \ - xemacs/help.texi \ - xemacs/indent.texi \ - xemacs/keystrokes.texi \ - xemacs/killing.texi \ - xemacs/m-x.texi \ - xemacs/major.texi \ - xemacs/mark.texi \ - xemacs/menus.texi \ - xemacs/mini.texi \ - xemacs/misc.texi \ - xemacs/mouse.texi \ - xemacs/mule.texi \ - xemacs/new.texi \ - xemacs/packages.texi \ - xemacs/picture.texi \ - xemacs/programs.texi \ - xemacs/reading.texi \ - xemacs/regs.texi \ - xemacs/search.texi \ - xemacs/sending.texi \ - xemacs/startup.texi \ - xemacs/text.texi \ - xemacs/trouble.texi \ - xemacs/undo.texi \ - xemacs/windows.texi \ - xemacs/xemacs.texi +../info/cl.info : cl.texi + -$(MAKEINFO) cl.texi -o ../info/cl.info + +../info/custom.info : custom.texi + -$(MAKEINFO) custom.texi -o ../info/custom.info + +../info/external-widget.info : external-widget.texi + -$(MAKEINFO) external-widget.texi -o ../info/external-widget.info + +../info/info.info : info.texi + -$(MAKEINFO) info.texi -o ../info/info.info + +../info/standards.info : standards.texi + -$(MAKEINFO) standards.texi -o ../info/standards.info + +../info/term.info : term.texi + -$(MAKEINFO) term.texi -o ../info/term.info -lispref-srcs = \ - lispref/abbrevs.texi \ - lispref/annotations.texi \ - lispref/back.texi \ - lispref/backups.texi \ - lispref/buffers.texi \ - lispref/building.texi \ - lispref/commands.texi \ - lispref/compile.texi \ - lispref/consoles-devices.texi \ - lispref/control.texi \ - lispref/customize.texi \ - lispref/databases.texi \ - lispref/debugging.texi \ - lispref/dialog.texi \ - lispref/display.texi \ - lispref/dragndrop.texi \ - lispref/edebug-inc.texi \ - lispref/edebug.texi \ - lispref/errors.texi \ - lispref/eval.texi \ - lispref/extents.texi \ - lispref/faces.texi \ - lispref/files.texi \ - lispref/frames.texi \ - lispref/functions.texi \ - lispref/glyphs.texi \ - lispref/hash-tables.texi \ - lispref/help.texi \ - lispref/hooks.texi \ - lispref/index.texi \ - lispref/internationalization.texi \ - lispref/intro.texi \ - lispref/keymaps.texi \ - lispref/ldap.texi \ - lispref/lispref.texi \ - lispref/lists.texi \ - lispref/loading.texi \ - lispref/locals.texi \ - lispref/macros.texi \ - lispref/maps.texi \ - lispref/markers.texi \ - lispref/menus.texi \ - lispref/minibuf.texi \ - lispref/modes.texi \ - lispref/mouse.texi \ - lispref/mule.texi \ - lispref/numbers.texi \ - lispref/objects.texi \ - lispref/os.texi \ - lispref/positions.texi \ - lispref/processes.texi \ - lispref/range-tables.texi \ - lispref/scrollbars.texi \ - lispref/searching.texi \ - lispref/sequences.texi \ - lispref/specifiers.texi \ - lispref/streams.texi \ - lispref/strings.texi \ - lispref/symbols.texi \ - lispref/syntax.texi \ - lispref/text.texi \ - lispref/tips.texi \ - lispref/toolbar.texi \ - lispref/tooltalk.texi \ - lispref/variables.texi \ - lispref/windows.texi \ - lispref/x-windows.texi +../info/termcap.info : termcap.texi + -$(MAKEINFO) termcap.texi -o ../info/termcap.info + +../info/texinfo.info : texinfo.texi + -$(MAKEINFO) texinfo.texi -o ../info/texinfo.info + +../info/widget.info : widget.texi + -$(MAKEINFO) widget.texi -o ../info/widget.info -internals-srcs = \ - internals/internals.texi - -new-users-guide-srcs = \ - new-users-guide/custom1.texi \ - new-users-guide/custom2.texi \ - new-users-guide/edit.texi \ - new-users-guide/enter.texi \ - new-users-guide/files.texi \ - new-users-guide/help.texi \ - new-users-guide/modes.texi \ - new-users-guide/new-users-guide.texi \ - new-users-guide/region.texi \ - new-users-guide/search.texi \ - new-users-guide/xmenu.texi +../info/xemacs-faq.info : xemacs-faq.texi + -$(MAKEINFO) xemacs-faq.texi -o ../info/xemacs-faq.info -$(INFODIR)/cl.info : cl.texi - $(MAKEINFO) -o $(INFODIR)/cl.info cl.texi - -$(INFODIR)/custom.info : custom.texi - $(MAKEINFO) -o $(INFODIR)/custom.info custom.texi - -$(INFODIR)/emodules.info : emodules.texi - $(MAKEINFO) -o $(INFODIR)/emodules.info emodules.texi - -$(INFODIR)/external-widget.info : external-widget.texi - $(MAKEINFO) -o $(INFODIR)/external-widget.info external-widget.texi - -$(INFODIR)/info.info : info.texi - $(MAKEINFO) -o $(INFODIR)/info.info info.texi - -$(INFODIR)/standards.info : standards.texi - $(MAKEINFO) -o $(INFODIR)/standards.info standards.texi -$(INFODIR)/term.info : term.texi - $(MAKEINFO) -o $(INFODIR)/term.info term.texi - -$(INFODIR)/termcap.info : termcap.texi - $(MAKEINFO) -o $(INFODIR)/termcap.info termcap.texi - -$(INFODIR)/texinfo.info : texinfo.texi - $(MAKEINFO) -o $(INFODIR)/texinfo.info texinfo.texi - -$(INFODIR)/widget.info : widget.texi - $(MAKEINFO) -o $(INFODIR)/widget.info widget.texi - -$(INFODIR)/xemacs-faq.info : xemacs-faq.texi - $(MAKEINFO) -o $(INFODIR)/xemacs-faq.info xemacs-faq.texi +# ../info/w3.info : w3.texi +# -$(MAKEINFO) w3.texi -o ../info/w3.info -# Manuals with their own subdirectory -$(INFODIR)/xemacs.info : $(xemacs-srcs) - $(MAKEINFO) -P xemacs -o $(INFODIR)/xemacs.info xemacs/xemacs.texi - -$(INFODIR)/lispref.info : $(lispref-srcs) - $(MAKEINFO) -P lispref -o $(INFODIR)/lispref.info lispref/lispref.texi - -$(INFODIR)/internals.info : $(internals-srcs) - $(MAKEINFO) -P internals -o $(INFODIR)/internals.info internals/internals.texi - -$(INFODIR)/new-users-guide.info : $(new-users-guide-srcs) - $(MAKEINFO) -P new-users-guide -o $(INFODIR)/new-users-guide.info new-users-guide/new-users-guide.texi - -# $(INFODIR)/w3.info : w3.texi -# $(MAKEINFO) -o $(INFODIR)/w3.info w3.texi - -# EMACS = ../src/xemacs -# EMACSFLAGS = -batch -q -no-site-file - -# $(INFODIR)/vm.info : vm.texi +# ../info/vm.info : vm.texi # -$(EMACS) $(EMACSFLAGS) -insert vm.texi -l texinfmt \ # -f texinfo-format-buffer -f save-buffer -# -mv vm.info* $(INFODIR)/. +# -mv vm.info* ../info -# special = # $(INFODIR)/vm.info $(INFODIR)/texinfo.info +# special = # ../info/w3.info ../info/vm.info ../info/texinfo.info -xemacs : $(INFODIR)/xemacs.info -lispref : $(INFODIR)/lispref.info -internals : $(INFODIR)/internals.info -new-users-guide.info : $(INFODIR)/new-users-guide.info +all: info -.PHONY : xemacs lispref internals new-users-guide info dvi +# Subdirectories to make recursively. +SUBDIR = xemacs lispref new-users-guide internals +.PHONY: $(SUBDIR) info : $(info_files) - -# tm: FRC.tm -# cd ./tm && $(RECURSIVE_MAKE) -# gnats: FRC.gnats -# cd ./gnats && $(RECURSIVE_MAKE) -# FRC.xemacs FRC.lispref FRC.new-users-guide FRC.internals FRC.tm FRC.gnats: + -for d in $(SUBDIR) ; do (cd ./$$d && $(RECURSIVE_MAKE) $@) ; done .PHONY: info dvi -.texi.dvi: - -$(TEXI2DVI) $< - -xemacs.dvi : $(xemacs-srcs) - $(TEXI2DVI) -I xemacs xemacs/xemacs.texi +xemacs: FRC.xemacs + -cd ./$@ && $(RECURSIVE_MAKE) +lispref: FRC.lispref + -cd ./$@ && $(RECURSIVE_MAKE) +new-users-guide: FRC.new-users-guide + -cd ./$@ && $(RECURSIVE_MAKE) +internals: FRC.internals + -cd ./$@ && $(RECURSIVE_MAKE) +# tm: FRC.tm +# -cd ./$@ && $(RECURSIVE_MAKE) +# gnats: FRC.gnats +# -cd ./$@ && $(RECURSIVE_MAKE) +# FRC.xemacs FRC.lispref FRC.new-users-guide FRC.internals FRC.tm FRC.gnats: +FRC.info FRC.dvi FRC.xemacs FRC.lispref FRC.new-users-guide FRC.internals: -lispref.dvi : $(lispref-srcs) - $(TEXI2DVI) -I lispref lispref/lispref.texi -internals.dvi : $(internals-srcs) - $(TEXI2DVI) -I internals internals/internals.texi - -new-users-guide.dvi : $(new-users-guide-srcs) - $(TEXI2DVI) -I new-users-guide new-users-guide/new-users-guide.texi +.texi.dvi: + $(TEXI2DVI) $< dvi : $(dvi_files) + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + .PHONY: mostlyclean clean distclean realclean extraclean mostlyclean: - $(RM) *.toc *.aux *.log *.op *.cp *.cps *.fn *.fns - $(RM) *.ky *.kys *.pg *.pgs *.tp *.tps *.vr *.vrs + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + rm -f *.toc *.aux *.log *.op \ + *.cp *.cps *.fn *.fns *.ky *.kys *.pg *.pgs *.vr *.vrs *.tp *.tps clean: mostlyclean - $(RM) core *.dvi + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + rm -f *.o core *.dvi distclean: clean + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done realclean: distclean + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done extraclean: distclean - $(RM) *~ \#* */*~ */\#* + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + -rm -f *~ \#* diff -r 12e008d41344 -r 697ef44129c6 man/cl.texi --- a/man/cl.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/cl.texi Mon Aug 13 11:20:41 2007 +0200 @@ -295,10 +295,10 @@ @example defun* defsubst* defmacro* function* -member* assoc* rassoc* remove* -delete* mapcar* sort* floor* -ceiling* truncate* round* mod* -rem* random* +member* assoc* rassoc* get* +remove* delete* mapcar* sort* +floor* ceiling* truncate* round* +mod* rem* random* @end example Internal function and variable names in the package are prefixed @@ -1084,8 +1084,8 @@ nth rest first .. tenth aref elt nthcdr symbol-function symbol-value symbol-plist -get getf gethash -subseq +get get* getf +gethash subseq @end smallexample @noindent @@ -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:: `getf', `remf' +* Property Lists:: `get*', `remprop', `getf', `remf' * Creating Symbols:: `gensym', `gentemp' @end menu @@ -3306,9 +3306,31 @@ @noindent These functions augment the standard Emacs Lisp functions @code{get} -and @code{put} for operating on properties attached to objects. +and @code{put} for operating on properties attached to symbols. There are also functions for working with property lists as -first-class data structures not attached to particular objects. +first-class data structures not attached to particular symbols. + +@defun get* symbol property &optional default +This function is like @code{get}, except that if the property is +not found, the @var{default} argument provides the return value. +(The Emacs Lisp @code{get} function always uses @code{nil} as +the default; this package's @code{get*} is equivalent to Common +Lisp's @code{get}.) + +The @code{get*} function is @code{setf}-able; when used in this +fashion, the @var{default} argument is allowed but ignored. +@end defun + +@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 @defun getf place property &optional default This function scans the list @var{place} as if it were a property @@ -3335,11 +3357,11 @@ (put sym prop val) @equiv{} (setf (getf (symbol-plist sym) prop) val) @end example -The @code{get} function is also @code{setf}-able. The fact that -@code{default} is ignored can sometimes be useful: +The @code{get} and @code{get*} functions are also @code{setf}-able. +The fact that @code{default} is ignored can sometimes be useful: @example -(incf (get 'foo 'usage-count 0)) +(incf (get* 'foo 'usage-count 0)) @end example Here, symbol @code{foo}'s @code{usage-count} property is incremented @@ -4631,7 +4653,7 @@ does not already exist, a new entry is added to the table and the table is reallocated to a larger size if necessary. The @var{default} argument is allowed but ignored in this case. The situation is -exactly analogous to that of @code{get}; @pxref{Property Lists}. +exactly analogous to that of @code{get*}; @pxref{Property Lists}. @end defun @defun remhash key table @@ -5549,8 +5571,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 12e008d41344 -r 697ef44129c6 man/custom.texi --- a/man/custom.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/custom.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,7 @@ \input texinfo.tex @c %**start of header -@setfilename ../info/custom.info +@setfilename ../info/custom @settitle The Customization Library @iftex @afourpaper @@ -13,6 +13,7 @@ @dircategory XEmacs Editor @direntry * Customizations: (custom). Customization Library. +package. @end direntry @end ifinfo @@ -25,13 +26,13 @@ @file{cus-edit.el} which contains many declarations you can learn from. @menu -* Declaring Groups:: -* Declaring Variables:: -* Declaring Faces:: -* Usage for Package Authors:: -* Utilities:: -* The Init File:: -* Wishlist:: +* Declaring Groups:: +* Declaring Variables:: +* Declaring Faces:: +* Usage for Package Authors:: +* Utilities:: +* The Init File:: +* Wishlist:: @end menu All the customization declarations can be changes by keyword arguments. @@ -39,19 +40,19 @@ @table @code @item :group -@var{value} should be a customization group. -Add @var{symbol} to that group. +@var{value} should be a customization group. +Add @var{symbol} to that group. @item :link -@var{value} should be a widget type. +@var{value} should be a widget type. Add @var{value} to the external links for this customization option. Useful widget types include @code{custom-manual}, @code{info-link}, and -@code{url-link}. +@code{url-link}. @item :load Add @var{value} to the files that should be loaded before displaying this customization option. The value should be either a string, which should be a string which will be loaded with @code{load-library} unless present in @code{load-history}, or a symbol which will be loaded with -@code{require}. +@code{require}. @item :tag @var{Value} should be a short string used for identifying the option in customization menus and buffers. By default the tag will be @@ -62,10 +63,10 @@ @comment node-name, next, previous, up @section Declaring Groups -Use @code{defgroup} to declare new customization groups. +Use @code{defgroup} to declare new customization groups. @defun defgroup symbol members doc [keyword value]... -Declare @var{symbol} as a customization group containing @var{members}. +Declare @var{symbol} as a customization group containing @var{members}. @var{symbol} does not need to be quoted. @var{doc} is the group documentation. @@ -78,7 +79,7 @@ Internally, custom uses the symbol property @code{custom-group} to keep track of the group members, and @code{group-documentation} for the -documentation string. +documentation string. The following additional @var{keyword}'s are defined: @@ -106,7 +107,7 @@ The following additional @var{keyword}'s are defined: @table @code -@item :type +@item :type @var{value} should be a widget type. @item :options @@ -122,7 +123,7 @@ @item custom-initialize-set Use the @code{:set} method to initialize the variable. Do not initialize it if already bound. This is the default @code{:initialize} -method. +method. @item custom-initialize-default Always use @code{set-default} to initialize the variable, even if a @@ -135,10 +136,10 @@ @item custom-initialize-changed Like @code{custom-initialize-reset}, but use @code{set-default} to initialize the variable if it is not bound and has not been set -already. +already. @end table -@item :set +@item :set @var{value} should be a function to set the value of the symbol. It takes two arguments, the symbol to set and the value to give it. The default is @code{set-default}. @@ -151,7 +152,7 @@ @item :require @var{value} should be a feature symbol. Each feature will be required when the `defcustom' is evaluated, or when Emacs is started if the user -has saved this option. +has saved this option. @end table @@ -180,7 +181,7 @@ Faces are declared with @code{defface}. -@defun defface face spec doc [keyword value]... +@defun defface face spec doc [keyword value]... Declare @var{face} as a customizable face that defaults to @var{spec}. @var{face} does not need to be quoted. @@ -218,7 +219,7 @@ (what color is used for the background text)@* Should be one of @code{light} or @code{dark}. @end table - + Internally, custom uses the symbol property @code{face-defface-spec} for the program specified default face properties, @code{saved-face} for properties saved by the user, and @code{face-documentation} for the @@ -240,13 +241,13 @@ more of the standard customization groups. There exists a group for each @emph{finder} keyword. Press @kbd{C-h p} to see a list of finder keywords, and add you group to each of them, using the @code{:group} -keyword. +keyword. @node Utilities, The Init File, Usage for Package Authors, Top @comment node-name, next, previous, up @section Utilities -These utilities can come in handy when adding customization support. +These utilities can come in handy when adding customization support. @deffn Widget custom-manual Widget type for specifying the info manual entry for a customization @@ -269,7 +270,7 @@ @defun customize-menu-create symbol &optional name Create menu for customization group @var{symbol}. -If optional @var{name} is given, use that as the name of the menu. +If optional @var{name} is given, use that as the name of the menu. Otherwise the menu will be named `Customize'. The menu is in a format applicable to @code{easy-menu-define}. @end defun @@ -290,7 +291,7 @@ @section Wishlist @itemize @bullet -@item +@item Better support for keyboard operations in the customize buffer. @item @@ -301,7 +302,7 @@ @item Add an `examples' section, with explained examples of custom type -definitions. +definitions. @item Support selectable color themes. I.e., change many faces by setting one @@ -316,13 +317,13 @@ @item Ask whether set or modified variables should be saved in -@code{kill-buffer-hook}. +@code{kill-buffer-hook}. Ditto for @code{kill-emacs-query-functions}. @item Command to check if there are any customization options that -does not belong to an existing group. +does not belong to an existing group. @item Optionally disable the point-cursor and instead highlight the selected @@ -335,9 +336,13 @@ values. @item +Make it possible to include a comment/remark/annotation when saving an +option. + +@item Add some direct support for meta variables, i.e. make it possible to specify that this variable should be reset when that variable is -changed. +changed. @item Add tutorial. @@ -378,7 +383,7 @@ @item See if it is feasible to scan files for customization information -instead of loading them, +instead of loading them, @item Add hint message when user push a non-pushable tag. @@ -392,11 +397,11 @@ @item Add option to hide @samp{[hide]} for short options. Default, on. -@item +@item Add option to hide @samp{[state]} for options with their standard settings. -@item +@item There should be a way to specify site defaults for user options. @item diff -r 12e008d41344 -r 697ef44129c6 man/emodules.texi --- a/man/emodules.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/emodules.texi Mon Aug 13 11:20:41 2007 +0200 @@ -11,24 +11,30 @@ @c @ifset XEMACS -@set emacs XEmacs +@macro emacs +XEmacs +@end macro @clear EMACS -@set HAVE-EMACS +@set HAVE_EMACS @end ifset @ifset EMACS -@set emacs Emacs +@macro emacs +Emacs +@end macro @clear XEMACS -@set HAVE-EMACS +@set HAVE_EMACS @end ifset -@ifclear HAVE-EMACS +@ifclear HAVE_EMACS @set XEMACS -@set emacs XEmacs +@macro emacs +XEmacs +@end macro @end ifclear @ifinfo -This file documents the module loading technology of @value{emacs}. +This file documents the module loading technology of @emacs{}. Copyright @copyright{} 1998 J. Kean Johnston. @@ -78,7 +84,7 @@ @finalout @titlepage -@title Extending @value{emacs} using C and C++ +@title Extending @emacs{} using C and C++ @subtitle Version 1.0, September 1998 @author J. Kean Johnston @@ -113,7 +119,7 @@ @ifinfo @node Top, Introduction, (dir), (dir) -This Info file contains v1.0 of the @value{emacs} dynamic loadable module +This Info file contains v1.0 of the @emacs{} dynamic loadable module support documentation. @menu * Introduction:: Introducing Emacs Modules @@ -151,16 +157,16 @@ @node Introduction, Annatomy of a Module, Top, Top @chapter Introduction - @value{emacs} is a powerful, extensible editor. The traditional way of -extending the functionality of @value{emacs} is to use its built-in Lisp + @emacs{} is a powerful, extensible editor. The traditional way of +extending the functionality of @emacs{} is to use its built-in Lisp language (called Emacs Lisp, or Elisp for short). However, while Elisp -is a full programming language and capable of extending @value{emacs} in more +is a full programming language and capable of extending @emacs{} in more ways than you can imagine, it does have its short-comings. Firstly, Elisp is an interpreted language, and this has serious speed 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, +So although Elisp is a general purpose language, and very ligh level, there are times when it is desirable to descend to a lower level compiled language for speed purposes. @@ -174,16 +180,16 @@ @cindex DLL @cindex DSO @cindex shared object - This manual describes a new way of extending @value{emacs}, by using dynamic + This manual describes a new way of extending @emacs{}, by using dynamic loadable modules (also knows as dynamicaly loadable libraries (DLLs), dynamic shared objects (DSOs) or just simply shared objectcs), which can -be written in C or C++ and loaded into @value{emacs} at any time. I sometimes +be written in C or C++ and loaded into @emacs{} at any time. I sometimes refer to this technology as @dfn{CEmacs}, which is short for @dfn{C Extensible Emacs}. - @value{emacs} modules are configured into and installed with @value{emacs} by + @emacs{} modules are configured into and installed with @emacs{} by default on all systems that support loading of shared objects. From a -users perspective, the internals of @value{emacs} modules are irrelevant. +users perspective, the internals of @emacs{} modules are irrelevant. All a user will ever need to know about shared objects is the name of the shared object when they want to load a given module. From a developers perspective though, a lot more is provided. @@ -200,28 +206,28 @@ 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 -the location of @value{emacs} internal header files etc. The program will also +the location of @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}. +loaded into @emacs{}. @item @cindex header files - CEmacs also makes all of the relevant @value{emacs} internal header files + CEmacs also makes all of the relevant @emacs{} internal header files availible 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 +internals of @emacs{} are exposed. +@xref{Top,,,internals,@emacs{} Internals Manual}, for a +more complete discussion on how to extend and understand @emacs{}. All of the rules for C modules are discussed there. @item @cindex samples - Part of the @value{emacs} distribution is a set of sample modules. These are -not installed when @value{emacs} is, but remain in the @value{emacs} source tree. + Part of the @emacs{} distribution is a set of sample modules. These are +not installed when @emacs{} is, but remain in the @emacs{} source tree. These modules live in the directory @file{modules}, which is a -sub-directory of the main @value{emacs} source code directory. Please look at +sub-directory of the main @emacs{} source code directory. Please look at the samples carefully, and maybe even use them as a basis for making your own modules. Most of the concepts required for writing extension modules are covered in the samples. @@ -230,19 +236,19 @@ @cindex documentation @cindex help Last, but not least is this manual. This can be viewed from within -@value{emacs}, and it can be printed out as well. It is the intention of this +@emacs{}, and it can be printed out as well. It is the intention of this document that it will describe everything you need to know about -extending @value{emacs} in C. If you do not find this to be the case, please +extending @emacs{} in C. If you do not find this to be the case, please contact the author(s). @end itemize The rest of this document will discuss the actual mechanics of -@value{emacs} modules and work through several of the samples. Please be -sure that you have read the @value{emacs} Internals Manual and understand +@emacs{} modules and work through several of the samples. Please be +sure that you have read the @emacs{} Internals Manual and understand everything in it. The concepts there apply to all modules. This document may have some overlap, but it is the internals manual which should be considered the final authority. It will also help a great -deal to look at the actual @value{emacs} source code to see how things are +deal to look at the actual @emacs{} source code to see how things are done. @node Annatomy of a Module, Using ellcc, Introduction, Top @@ -253,12 +259,12 @@ @cindex module format @cindex format, module - Each dynamically loadable @value{emacs} extension (hereafter refered to as a + Each dynamically loadable @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 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. +@file{modules/simple/sample.c} in the main @emacs{} source code tree. @menu * Required Header File:: Always include <emodules.h> @@ -275,7 +281,7 @@ @cindex emodules.h @cindex config.h Every module must include the file @file{<emodules.h>}. This -will include several other @value{emacs} internal header files, and will set up +will include several other @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 @@ -284,9 +290,9 @@ familiarize yourself with the macros defined there. 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 +need to include one or more of the @emacs{} internal header files. When you @code{#include <emodules.h>}, you will get a few of the most important -@value{emacs} header files included automatically for you. The files included +@emacs{} header files included automatically for you. The files included are: @table @file @@ -302,7 +308,7 @@ @item window.h This header file defines the window structures and Lisp types, and -provides functions and macros for manipulating multiple @value{emacs} windows. +provides functions and macros for manipulating multiple @emacs{} windows. @item buffer.h All macros and function declarations for manipulating internal and user @@ -314,7 +320,7 @@ @item frame.h Provides the required structure, macro and function definitions for -manipulating @value{emacs} frames. +manipulating @emacs{} frames. @end table @node Required Functions, Required Variables, Required Header File, Annatomy of a Module @@ -326,8 +332,8 @@ 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 -@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 +@emacs{} Lisp reader. Each of these functions performs a very specific +task, and they are executed in the correct order by @emacs{}. All of these functions are @code{void} functions which take no arguments. Here, briefly, are the required module functions. Note that the actual function names do not end with the string @code{_module}, but rather @@ -350,12 +356,12 @@ @code{DEFVAR_LISP()}, @code{DEFVAR_BOOL()} etc, and its purpose is to declare and initialize all and any variables that your module defines. They syntax for declaring variables is identical to the syntax used for -all internal @value{emacs} source code. +all internal @emacs{} source code. @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 @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. @@ -385,14 +391,14 @@ @table @code @item emodules_compiler This is a variable of type @code{long}, and is used to indicate the -version of the @value{emacs} loading technology that was used to produce the +version of the @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 +the @emacs{} version number, as a given module may quite well work +regardless of the version of @emacs{} that was installed at the time the module was created. -The @value{emacs} modules version is used to differentiate between major -changes in the module loading technology, not versions of @value{emacs}. +The @emacs{} modules version is used to differentiate between major +changes in the module loading technology, not versions of @emacs{}. @item emodules_name This is a short (typically 10 characters or less) name for the module, @@ -436,11 +442,11 @@ However, if it does have dependnacies, it must call @code{emodules_load}: -@example +@example @code @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 @@ -478,12 +484,12 @@ Before discussing the anatomy of a module in greater detail, you should be aware of the steps required in order to correctly compile and link a -module for use within @value{emacs}. There is little difference between +module for use within @emacs{}. There is little difference between compiling normal C code and compiling a module. In fact, all that changes is the command used to compile the module, and a few extra arguments to the compiler. -@value{emacs} now ships with a new user utility, called @code{ellcc}. This +@emacs{} now ships with a new user utility, called @code{ellcc}. This is the @dfn{Emacs Loadable Library C Compiler}. This is a wrapper program that will invoke the real C compiler with the correct arguments to compile and link your module. With the exception of a few command @@ -519,7 +525,7 @@ to @code{ellcc}. In this mode, @code{ellcc} is simply a front-end to the same C compiler -that was used to create the @value{emacs} binary itself. All @code{ellcc} +that was used to create the @emacs{} binary itself. All @code{ellcc} does in this mode is insert a few extra command line arguments before the arguments you specify to @code{ellcc} itself. @code{ellcc} will then invoke the C compiler to compile your module, and will return the @@ -529,7 +535,7 @@ @file{Makefile} as you would for a normal program, and simply insert, at some appropriate place something similar to: -@example +@example @code @cartouche CC=ellcc --mode=compile @@ -549,18 +555,18 @@ @cindex initialization @cindex documentation -@value{emacs} uses a rather bizarre way of documenting variables and +@emacs{} uses a rather bizarre way of documenting variables and functions. Rather than have the documentation for compiled functions 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 @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 +compiled module, at any time after @emacs{} has been @dfn{dumped} is 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 @@ -607,7 +613,7 @@ to populate the @code{docs_of_module} function. Below is a sample @file{Makefile} fragment which indicates how all of this is used. -@example +@example @code @cartouche CC=ellcc --mode=compile LD=ellcc --mode=link @@ -645,11 +651,11 @@ The above @file{Makefile} is, in fact, complete, and would compile the sample module, and optionally install it. The @code{--mod-location} argument to @code{ellcc} will produce, on the standard output, the base -location of the @value{emacs} module directory. Each sub-directory of that +location of the @emacs{} module directory. Each sub-directory of that directory is automatically searched for for modules when they are loaded with @code{load-module}. An alternative location would be @file{/usr/local/lib/xemacs/site-modules}. That path can change -depending on the options the person who compiled @value{emacs} chose, so you +depending on the options the person who compiled @emacs{} chose, so you can always determine the correct site location using the @code{--mod-site-location} option. This directory is treated the same way as the main module directory. Each sub-directory within it is @@ -672,7 +678,7 @@ loadable module. The module has complete access to all symbols that were present in the -dumped @value{emacs}, so you do not need to link against libraries that were +dumped @emacs{}, so you do not need to link against libraries that were linked in with the main executable. If your library uses some other extra libraries, you will need to link with those. There is nothing particularly complicated about link mode. All you need to do is make @@ -738,10 +744,10 @@ @item --mod-archdir Prints the name of the root of the architecture-dependant directory that -@value{emacs} searches for architecture-dependant files. +@emacs{} searches for architecture-dependant 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 @emacs{} and @code{ellcc} were compiled. @end table @@ -750,7 +756,7 @@ @cindex environment variables During its normal operation, @code{ellcc} uses the compiler and linker -flags that were determined at the time @value{emacs} was configured. In +flags that were determined at the time @emacs{} was configured. In 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} @@ -792,8 +798,8 @@ @cindex @code{ELLMAKEDOC} Sets the name of the @file{make-docfile} program to use. Usually @code{ellcc} will use the version that was compiled and installed with -@value{emacs}, but this option allows you to specify an alternative path. -Used during the compile phase of @value{emacs} itself. +@emacs{}, but this option allows you to specify an alternative path. +Used during the compile phase of @emacs{} itself. @end table @node Defining Functions, Defining Variables, Using ellcc, Top @@ -807,7 +813,7 @@ 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 +Primitives,,,internals,@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 in modules. @@ -816,14 +822,14 @@ 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 -pointers to the start of each documentation entry in the dumped @value{emacs}. +pointers to the start of each documentation entry in the dumped @emacs{}. This, of course, will not work for dynamic modules, as they are loaded -long after @value{emacs} has been dumped. For this reason, we require a +long after @emacs{} has been dumped. For this reason, we require a special means for adding documentation for new subrs. This is what the macro @code{CDOCSUBR} is used for, and this is used extensively during @code{ellcc} initialization mode. - When using @code{DEFUN} in normal @value{emacs} C code, the sixth + When using @code{DEFUN} in normal @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 @@ -844,12 +850,12 @@ @cindex functions, defining Although the full syntax of a function declaration is discussed in the -@value{emacs} internals manual in greater depth, what follows is a brief +@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 example: -@example +@example @code @cartouche DEFUN ("my-function", Fmy_function, 1, 1, "FFile name: ", /* Sample Emacs primitive function. @@ -880,7 +886,7 @@ arguments are passed to the function. Next is the @code{interactive} definition. If this function is meant to be run by a user interactively, then you need to specify the argument types and prompts -in this string. Please consult the @value{emacs} Lisp manual for more +in this string. Please consult the @emacs{} Lisp manual for more details. Next comes a C comment that is the documentation for this function. This comment @strong{must} exist. Last comes the list of function argument names, if any. @@ -902,13 +908,13 @@ @code{DEFUN}. Using the example function above, you would insert the following code in the @code{syms_of_module} function: -@example +@example @code @cartouche DEFSUBR(Fmy_function); @end cartouche @end example -This call will instruct @value{emacs} to make the function visible to the Lisp +This call will instruct @emacs{} to make the function visible to the Lisp reader and will prepare for the insertion of the documentation into the right place. Once this is done, the user can call the Lisp function @code{my-function}, if it was defined as an interactive @@ -916,7 +922,7 @@ Thats all there is to defining and announcing new functions. The rules for what goes inside the functions, and how to write good modules, is -beyond the scope of this document. Please consult the @value{emacs} +beyond the scope of this document. Please consult the @emacs{} internals manual for more details. @node Defining Variables, Index, Defining Functions, Top @@ -935,7 +941,7 @@ common to also provide variables which can be used to control the behaviour 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 +and internal @emacs{} primitives, and the declaration of the variables is identical. @xref{Adding Global Lisp Variables,,,internals,XEmacs Internals Manual}, @@ -943,27 +949,27 @@ 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} +@code{vars_of_module} initialization function using special @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 source code, or read the internals manual. - One @emph{very} important difference between @value{emacs} variables and + One @emph{very} important difference between @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 +@strong{never} use pure space in @emacs{} modules. The pure space storage is of a limited size, and is initialized propperly 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 +dumping of @emacs{}. Because variables are being added dynamically to +an already running @emacs{} when you load a module, you cannot use pure space. Be warned: @strong{do not use pure space in modules. Repeat, do not use pure space in modules.} Once again, to remove all doubts: @strong{DO NOT USE PURE SPACE IN MODULES!!!} Below is a small example which declares and initializes two variables. You will note that this code takes into account the fact -that this module may very well be compiled into @value{emacs} itself. This +that this module may very well be compiled into @emacs{} itself. This is a prudent thing to do. -@example +@example @code @cartouche Lisp_Object Vsample_string; int sample_boolean; diff -r 12e008d41344 -r 697ef44129c6 man/external-widget.texi --- a/man/external-widget.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/external-widget.texi Mon Aug 13 11:20:41 2007 +0200 @@ -5,6 +5,7 @@ @dircategory XEmacs Editor @direntry * External Widget: (external-widget) External Client Widget. +package. @end direntry @end ifinfo diff -r 12e008d41344 -r 697ef44129c6 man/info-stnd.texi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/info-stnd.texi Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,1373 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header +@setfilename ../info/info-stnd.info +@settitle GNU Info +@set InfoProgVer 2.11 +@paragraphindent none +@footnotestyle end +@synindex vr cp +@synindex fn cp +@synindex ky cp +@comment %**end of header +@comment $Id: info-stnd.texi,v 1.3 1998/06/30 06:35:28 steve Exp $ + +@dircategory Texinfo documentation system +@direntry +* info program: (info-stnd). Standalone Info-reading program. +@end direntry + +@ifinfo +This file documents GNU Info, a program for viewing the on-line formatted +versions of Texinfo files. This documentation is different from the +documentation for the Info reader that is part of GNU Emacs. If you do +not know how to use Info, but have a working Info reader, you should +read that documentation first. + +Copyright @copyright{} 1992, 93, 96, 97 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries a copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). +@end ignore + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +sections entitled ``Copying'' and ``GNU General Public License'' are +included exactly as in the original, and provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation +approved by the Free Software Foundation. +@end ifinfo + +@titlepage +@title GNU Info User's Guide +@subtitle For GNU Info version @value{InfoProgVer} +@author Brian J. Fox (bfox@@ai.mit.edu) +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1992, 1993, 1997 Free Software Foundation + +Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +sections entitled ``Copying'' and ``GNU General Public License'' are +included exactly as in the original, and provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation +approved by the Free Software Foundation. +@end titlepage + +@ifinfo +@node Top, What is Info, , (dir) +@top The GNU Info Program + +This file documents GNU Info, a program for viewing the on-line +formatted versions of Texinfo files, version @value{InfoProgVer}. This +documentation is different from the documentation for the Info reader +that is part of GNU Emacs. +@end ifinfo + +@menu +* What is Info:: +* Options:: Options you can pass on the command line. +* Cursor Commands:: Commands which move the cursor within a node. +* Scrolling Commands:: Commands for moving the node around + in a window. +* Node Commands:: Commands for selecting a new node. +* Searching Commands:: Commands for searching an Info file. +* Xref Commands:: Commands for selecting cross references. +* Window Commands:: Commands which manipulate multiple windows. +* Printing Nodes:: How to print out the contents of a node. +* Miscellaneous Commands:: A few commands that defy categories. +* Variables:: How to change the default behavior of Info. +* GNU Info Global Index:: Global index containing keystrokes, + command names, variable names, + and general concepts. +@end menu + +@node What is Info, Options, Top, Top +@chapter What is Info? + +@iftex +This file documents GNU Info, a program for viewing the on-line formatted +versions of Texinfo files, version @value{InfoProgVer}. +@end iftex + +@dfn{Info} is a program which is used to view Info files on an ASCII +terminal. @dfn{Info files} are the result of processing Texinfo files +with the program @code{makeinfo} or with one of the Emacs commands, such +as @code{M-x texinfo-format-buffer}. Texinfo itself is a documentation +system that uses a single source file to produce both on-line +information and printed output. You can typeset and print the +files that you read in Info.@refill + +@node Options, Cursor Commands, What is Info, Top +@chapter Command Line Options +@cindex command line options +@cindex arguments, command line + +GNU Info accepts several options to control the initial node being +viewed, and to specify which directories to search for Info files. Here +is a template showing an invocation of GNU Info from the shell: + +@example +info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{} +@end example + +The following @var{option-names} are available when invoking Info from +the shell: + +@table @code +@cindex directory path +@item --directory @var{directory-path} +@itemx -d @var{directory-path} +Add @var{directory-path} to the list of directory paths searched when +Info needs to find a file. You may issue @code{--directory} multiple +times; once for each directory which contains Info files. +Alternatively, you may specify a value for the environment variable +@code{INFOPATH}; if @code{--directory} is not given, the value of +@code{INFOPATH} is used. The value of @code{INFOPATH} is a colon +separated list of directory names. If you do not supply @code{INFOPATH} +or @code{--directory-path}, Info uses a default path. + +@item --file @var{filename} +@itemx -f @var{filename} +@cindex Info file, selecting +Specify a particular Info file to visit. By default, Info visits +the file @code{dir}; if you use this option, Info will start with +@code{(@var{filename})Top} as the first file and node. + +@item --index-search @var{string} +@cindex index search, selecting +@cindex online help, using Info as +Go to the index entry @var{string} in the Info file specified with +@samp{--file}. If no such entry, print @samp{no entries found} and exit +with nonzero status. This can used from another program as a way to +provide online help. + +@item --node @var{nodename} +@itemx -n @var{nodename} +@cindex node, selecting +Specify a particular node to visit in the initial file that Info +loads. This is especially useful in conjunction with +@code{--file}@footnote{Of course, you can specify both the file and node +in a @code{--node} command; but don't forget to escape the open and +close parentheses from the shell as in: @code{info --node +"(emacs)Buffers"}}. You may specify @code{--node} multiple times; for +an interactive Info, each @var{nodename} is visited in its own window, +for a non-interactive Info (such as when @code{--output} is given) each +@var{nodename} is processed sequentially. + +@item --output @var{filename} +@itemx -o @var{filename} +@cindex file, outputting to +@cindex outputting to a file +Specify @var{filename} as the name of a file to which to direct output. +Each node that Info visits will be output to @var{filename} instead of +interactively viewed. A value of @code{-} for @var{filename} specifies +the standard output. + +@item --subnodes +@cindex @code{--subnodes}, command line option +This option only has meaning when given in conjunction with +@code{--output}. It means to recursively output the nodes appearing in +the menus of each node being output. Menu items which resolve to +external Info files are not output, and neither are menu items which are +members of an index. Each node is only output once. + +@item --help +@itemx -h +Produces a relatively brief description of the available Info options. + +@item --version +@cindex version information +Prints the version information of Info and exits. + +@item @var{menu-item} +@cindex menu, following +Info treats its remaining arguments as the names of menu items. The +first argument is a menu item in the initial node visited, while +the second argument is a menu item in the first argument's node. +You can easily move to the node of your choice by specifying the menu +names which describe the path to that node. For example, + +@example +info emacs buffers +@end example + +@noindent +first selects the menu item @samp{Emacs} in the node @samp{(dir)Top}, +and then selects the menu item @samp{Buffers} in the node +@samp{(emacs)Top}. +@end table + +@node Cursor Commands, Scrolling Commands, Options, Top +@chapter Moving the Cursor +@cindex cursor, moving + +Many people find that reading screens of text page by page is made +easier when one is able to indicate particular pieces of text with some +kind of pointing device. Since this is the case, GNU Info (both the +Emacs and standalone versions) have several commands which allow you to +move the cursor about the screen. The notation used in this manual to +describe keystrokes is identical to the notation used within the Emacs +manual, and the GNU Readline manual. @xref{Characters, , Character +Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the +notation. + +The following table lists the basic cursor movement commands in Info. +Each entry consists of the key sequence you should type to execute the +cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it +invokes @code{execute-extended-command}. @xref{M-x, , Executing an +extended command, emacs, the GNU Emacs Manual}, for more detailed +information.} command name (displayed in parentheses), and a short +description of what the command does. All of the cursor motion commands +can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands, +@code{universal-argument}}), to find out how to supply them. With a +numeric argument, the motion commands are simply executed that +many times; for example, a numeric argument of 4 given to +@code{next-line} causes the cursor to move down 4 lines. With a +negative numeric argument, the motion is reversed; an argument of -4 +given to the @code{next-line} command would cause the cursor to move +@emph{up} 4 lines. + +@table @asis +@item @code{C-n} (@code{next-line}) +@kindex C-n +@findex next-line +Move the cursor down to the next line. + +@item @code{C-p} (@code{prev-line}) +@kindex C-p +@findex prev-line +Move the cursor up to the previous line. + +@item @code{C-a} (@code{beginning-of-line}) +@kindex C-a, in Info windows +@findex beginning-of-line +Move the cursor to the start of the current line. + +@item @code{C-e} (@code{end-of-line}) +@kindex C-e, in Info windows +@findex end-of-line +Move the cursor to the end of the current line. + +@item @code{C-f} (@code{forward-char}) +@kindex C-f, in Info windows +@findex forward-char +Move the cursor forward a character. + +@item @code{C-b} (@code{backward-char}) +@kindex C-b, in Info windows +@findex backward-char +Move the cursor backward a character. + +@item @code{M-f} (@code{forward-word}) +@kindex M-f, in Info windows +@findex forward-word +Move the cursor forward a word. + +@item @code{M-b} (@code{backward-word}) +@kindex M-b, in Info windows +@findex backward-word +Move the cursor backward a word. + +@item @code{M-<} (@code{beginning-of-node}) +@itemx @code{b} +@kindex b, in Info windows +@kindex M-< +@findex beginning-of-node +Move the cursor to the start of the current node. + +@item @code{M->} (@code{end-of-node}) +@kindex M-> +@findex end-of-node +Move the cursor to the end of the current node. + +@item @code{M-r} (@code{move-to-window-line}) +@kindex M-r +@findex move-to-window-line +Move the cursor to a specific line of the window. Without a numeric +argument, @code{M-r} moves the cursor to the start of the line in the +center of the window. With a numeric argument of @var{n}, @code{M-r} +moves the cursor to the start of the @var{n}th line in the window. +@end table + +@node Scrolling Commands, Node Commands, Cursor Commands, Top +@chapter Moving Text Within a Window +@cindex scrolling + +Sometimes you are looking at a screenful of text, and only part of the +current paragraph you are reading is visible on the screen. The +commands detailed in this section are used to shift which part of the +current node is visible on the screen. + +@table @asis +@item @code{SPC} (@code{scroll-forward}) +@itemx @code{C-v} +@kindex SPC, in Info windows +@kindex C-v +@findex scroll-forward +Shift the text in this window up. That is, show more of the node which +is currently below the bottom of the window. With a numeric argument, +show that many more lines at the bottom of the window; a numeric +argument of 4 would shift all of the text in the window up 4 lines +(discarding the top 4 lines), and show you four new lines at the bottom +of the window. Without a numeric argument, @key{SPC} takes the bottom +two lines of the window and places them at the top of the window, +redisplaying almost a completely new screenful of lines. + +@item @code{DEL} (@code{scroll-backward}) +@itemx @code{M-v} +@kindex DEL, in Info windows +@kindex M-v +@findex scroll-backward +Shift the text in this window down. The inverse of +@code{scroll-forward}. +@end table + +@cindex scrolling through node structure +The @code{scroll-forward} and @code{scroll-backward} commands can also +move forward and backward through the node structure of the file. If +you press @key{SPC} while viewing the end of a node, or @key{DEL} while +viewing the beginning of a node, what happens is controlled by the +variable @code{scroll-behavior}. @xref{Variables, +@code{scroll-behavior}}, for more information. + +@table @asis +@item @code{C-l} (@code{redraw-display}) +@kindex C-l +@findex redraw-display +Redraw the display from scratch, or shift the line containing the cursor +to a specified location. With no numeric argument, @samp{C-l} clears +the screen, and then redraws its entire contents. Given a numeric +argument of @var{n}, the line containing the cursor is shifted so that +it is on the @var{n}th line of the window. + +@item @code{C-x w} (@code{toggle-wrap}) +@kindex C-w +@findex toggle-wrap +Toggles the state of line wrapping in the current window. Normally, +lines which are longer than the screen width @dfn{wrap}, i.e., they are +continued on the next line. Lines which wrap have a @samp{\} appearing +in the rightmost column of the screen. You can cause such lines to be +terminated at the rightmost column by changing the state of line +wrapping in the window with @code{C-x w}. When a line which needs more +space than one screen width to display is displayed, a @samp{$} appears +in the rightmost column of the screen, and the remainder of the line is +invisible. +@end table + +@node Node Commands, Searching Commands, Scrolling Commands, Top +@chapter Selecting a New Node +@cindex nodes, selection of + +This section details the numerous Info commands which select a new node +to view in the current window. + +The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and +@samp{l}. + +When you are viewing a node, the top line of the node contains some Info +@dfn{pointers} which describe where the next, previous, and up nodes +are. Info uses this line to move about the node structure of the file +when you use the following commands: + +@table @asis +@item @code{n} (@code{next-node}) +@kindex n +@findex next-node +Select the `Next' node. + +@item @code{p} (@code{prev-node}) +@kindex p +@findex prev-node +Select the `Prev' node. + +@item @code{u} (@code{up-node}) +@kindex u +@findex up-node +Select the `Up' node. +@end table + +You can easily select a node that you have already viewed in this window +by using the @samp{l} command -- this name stands for "last", and +actually moves through the list of already visited nodes for this +window. @samp{l} with a negative numeric argument moves forward through +the history of nodes for this window, so you can quickly step between +two adjacent (in viewing history) nodes. + +@table @asis +@item @code{l} (@code{history-node}) +@kindex l +@findex history-node +Select the most recently selected node in this window. +@end table + +Two additional commands make it easy to select the most commonly +selected nodes; they are @samp{t} and @samp{d}. + +@table @asis +@item @code{t} (@code{top-node}) +@kindex t +@findex top-node +Select the node @samp{Top} in the current Info file. + +@item @code{d} (@code{dir-node}) +@kindex d +@findex dir-node +Select the directory node (i.e., the node @samp{(dir)}). +@end table + +Here are some other commands which immediately result in the selection +of a different node in the current window: + +@table @asis +@item @code{<} (@code{first-node}) +@kindex < +@findex first-node +Selects the first node which appears in this file. This node is most +often @samp{Top}, but it does not have to be. + +@item @code{>} (@code{last-node}) +@kindex > +@findex last-node +Select the last node which appears in this file. + +@item @code{]} (@code{global-next-node}) +@kindex ] +@findex global-next-node +Move forward or down through node structure. If the node that you are +currently viewing has a @samp{Next} pointer, that node is selected. +Otherwise, if this node has a menu, the first menu item is selected. If +there is no @samp{Next} and no menu, the same process is tried with the +@samp{Up} node of this node. + +@item @code{[} (@code{global-prev-node}) +@kindex [ +@findex global-prev-node +Move backward or up through node structure. If the node that you are +currently viewing has a @samp{Prev} pointer, that node is selected. +Otherwise, if the node has an @samp{Up} pointer, that node is selected, +and if it has a menu, the last item in the menu is selected. +@end table + +You can get the same behavior as @code{global-next-node} and +@code{global-prev-node} while simply scrolling through the file with +@key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behavior}}, for +more information. + +@table @asis +@item @code{g} (@code{goto-node}) +@kindex g +@findex goto-node +Read the name of a node and select it. No completion is done while +reading the node name, since the desired node may reside in a separate +file. The node must be typed exactly as it appears in the Info file. A +file name may be included as with any node specification, for example + +@example +@code{g(emacs)Buffers} +@end example + +finds the node @samp{Buffers} in the Info file @file{emacs}. + +@item @code{C-x k} (@code{kill-node}) +@kindex C-x k +@findex kill-node +Kill a node. The node name is prompted for in the echo area, with a +default of the current node. @dfn{Killing} a node means that Info tries +hard to forget about it, removing it from the list of history nodes kept +for the window where that node is found. Another node is selected in +the window which contained the killed node. + +@item @code{C-x C-f} (@code{view-file}) +@kindex C-x C-f +@findex view-file +Read the name of a file and selects the entire file. The command +@example +@code{C-x C-f @var{filename}} +@end example +is equivalent to typing +@example +@code{g(@var{filename})*} +@end example + +@item @code{C-x C-b} (@code{list-visited-nodes}) +@kindex C-x C-b +@findex list-visited-nodes +Make a window containing a menu of all of the currently visited nodes. +This window becomes the selected window, and you may use the standard +Info commands within it. + +@item @code{C-x b} (@code{select-visited-node}) +@kindex C-x b +@findex select-visited-node +Select a node which has been previously visited in a visible window. +This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is +created. +@end table + +@node Searching Commands, Xref Commands, Node Commands, Top +@chapter Searching an Info File +@cindex searching + +GNU Info allows you to search for a sequence of characters throughout an +entire Info file, search through the indices of an Info file, or find +areas within an Info file which discuss a particular topic. + +@table @asis +@item @code{s} (@code{search}) +@kindex s +@findex search +Read a string in the echo area and search for it. + +@item @code{C-s} (@code{isearch-forward}) +@kindex C-s +@findex isearch-forward +Interactively search forward through the Info file for a string as you +type it. + +@item @code{C-r} (@code{isearch-backward}) +@kindex C-r +@findex isearch-backward +Interactively search backward through the Info file for a string as +you type it. + +@item @code{i} (@code{index-search}) +@kindex i +@findex index-search +Look up a string in the indices for this Info file, and select a node +where the found index entry points to. + +@item @code{,} (@code{next-index-match}) +@kindex , +@findex next-index-match +Move to the node containing the next matching index item from the last +@samp{i} command. +@end table + +The most basic searching command is @samp{s} (@code{search}). The +@samp{s} command prompts you for a string in the echo area, and then +searches the remainder of the Info file for an occurrence of that string. +If the string is found, the node containing it is selected, and the +cursor is left positioned at the start of the found string. Subsequent +@samp{s} commands show you the default search string within @samp{[} and +@samp{]}; pressing @key{RET} instead of typing a new string will use the +default search string. + +@dfn{Incremental searching} is similar to basic searching, but the +string is looked up while you are typing it, instead of waiting until +the entire search string has been specified. + +@node Xref Commands, Window Commands, Searching Commands, Top +@chapter Selecting Cross References + +We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up} +pointers which appear at the top of a node. In addition to these +pointers, a node may contain other pointers which refer you to a +different node, perhaps in another Info file. Such pointers are called +@dfn{cross references}, or @dfn{xrefs} for short. + +@menu +* Parts of an Xref:: What a cross reference is made of. +* Selecting Xrefs:: Commands for selecting menu or note items. +@end menu + +@node Parts of an Xref, Selecting Xrefs, , Xref Commands +@section Parts of an Xref + +Cross references have two major parts: the first part is called the +@dfn{label}; it is the name that you can use to refer to the cross +reference, and the second is the @dfn{target}; it is the full name of +the node that the cross reference points to. + +The target is separated from the label by a colon @samp{:}; first the +label appears, and then the target. For example, in the sample menu +cross reference below, the single colon separates the label from the +target. + +@example +* Foo Label: Foo Target. More information about Foo. +@end example + +Note the @samp{.} which ends the name of the target. The @samp{.} is +not part of the target; it serves only to let Info know where the target +name ends. + +A shorthand way of specifying references allows two adjacent colons to +stand for a target name which is the same as the label name: + +@example +* Foo Commands:: Commands pertaining to Foo. +@end example + +In the above example, the name of the target is the same as the name of +the label, in this case @code{Foo Commands}. + +You will normally see two types of cross reference while viewing nodes: +@dfn{menu} references, and @dfn{note} references. Menu references +appear within a node's menu; they begin with a @samp{*} at the beginning +of a line, and continue with a label, a target, and a comment which +describes what the contents of the node pointed to contains. + +Note references appear within the body of the node text; they begin with +@code{*Note}, and continue with a label and a target. + +Like @samp{Next}, @samp{Prev}, and @samp{Up} pointers, cross references +can point to any valid node. They are used to refer you to a place +where more detailed information can be found on a particular subject. +Here is a cross reference which points to a node within the Texinfo +documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo +Manual}, for more information on creating your own texinfo cross +references. + +@node Selecting Xrefs, , Parts of an Xref, Xref Commands +@section Selecting Xrefs + +The following table lists the Info commands which operate on menu items. + +@table @asis +@item @code{1} (@code{menu-digit}) +@itemx @code{2} @dots{} @code{9} +@cindex 1 @dots{} 9, in Info windows +@kindex 1 @dots{} 9, in Info windows +@findex menu-digit +Within an Info window, pressing a single digit, (such as @samp{1}), +selects that menu item, and places its node in the current window. +For convenience, there is one exception; pressing @samp{0} selects the +@emph{last} item in the node's menu. + +@item @code{0} (@code{last-menu-item}) +@kindex 0, in Info windows +@findex last-menu-item +Select the last item in the current node's menu. + +@item @code{m} (@code{menu-item}) +@kindex m +@findex menu-item +Reads the name of a menu item in the echo area and selects its node. +Completion is available while reading the menu label. + +@item @code{M-x find-menu} +@findex find-menu +Move the cursor to the start of this node's menu. +@end table + +This table lists the Info commands which operate on note cross references. + +@table @asis +@item @code{f} (@code{xref-item}) +@itemx @code{r} +@kindex f +@kindex r +@findex xref-item +Reads the name of a note cross reference in the echo area and selects +its node. Completion is available while reading the cross reference +label. +@end table + +Finally, the next few commands operate on menu or note references alike: + +@table @asis +@item @code{TAB} (@code{move-to-next-xref}) +@kindex TAB, in Info windows +@findex move-to-next-xref +Move the cursor to the start of the next nearest menu item or note +reference in this node. You can then use @key{RET} +(@code{select-reference-this-line}) to select the menu or note reference. + +@item @code{M-TAB} (@code{move-to-prev-xref}) +@kindex M-TAB, in Info windows +@findex move-to-prev-xref +Move the cursor the start of the nearest previous menu item or note +reference in this node. + +@item @code{RET} (@code{select-reference-this-line}) +@kindex RET, in Info windows +@findex select-reference-this-line +Select the menu item or note reference appearing on this line. +@end table + +@node Window Commands, Printing Nodes, Xref Commands, Top +@chapter Manipulating Multiple Windows +@cindex windows, manipulating + +A @dfn{window} is a place to show the text of a node. Windows have a +view area where the text of the node is displayed, and an associated +@dfn{mode line}, which briefly describes the node being viewed. + +GNU Info supports multiple windows appearing in a single screen; each +window is separated from the next by its modeline. At any time, there +is only one @dfn{active} window, that is, the window in which the cursor +appears. There are commands available for creating windows, changing +the size of windows, selecting which window is active, and for deleting +windows. + +@menu +* The Mode Line:: What appears in the mode line? +* Basic Windows:: Manipulating windows in Info. +* The Echo Area:: Used for displaying errors and reading input. +@end menu + +@node The Mode Line, Basic Windows, , Window Commands +@section The Mode Line + +A @dfn{mode line} is a line of inverse video which appears at the bottom +of an Info window. It describes the contents of the window just above +it; this information includes the name of the file and node appearing in +that window, the number of screen lines it takes to display the node, +and the percentage of text that is above the top of the window. It can +also tell you if the indirect tags table for this Info file needs to be +updated, and whether or not the Info file was compressed when stored on +disk. + +Here is a sample mode line for a window containing an uncompressed file +named @file{dir}, showing the node @samp{Top}. + +@example +@group +-----Info: (dir)Top, 40 lines --Top--------------------------------------- + ^^ ^ ^^^ ^^ + (file)Node #lines where +@end group +@end example + +When a node comes from a file which is compressed on disk, this is +indicated in the mode line with two small @samp{z}'s. In addition, if +the Info file containing the node has been split into subfiles, the name +of the subfile containing the node appears in the modeline as well: + +@example +--zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z--------------- +@end example + +When Info makes a node internally, such that there is no corresponding +info file on disk, the name of the node is surrounded by asterisks +(@samp{*}). The name itself tells you what the contents of the window +are; the sample mode line below shows an internally constructed node +showing possible completions: + +@example +-----Info: *Completions*, 7 lines --All----------------------------------- +@end example + +@node Basic Windows, The Echo Area, The Mode Line, Window Commands +@section Window Commands + +It can be convenient to view more than one node at a time. To allow +this, Info can display more than one @dfn{window}. Each window has its +own mode line (@pxref{The Mode Line}) and history of nodes viewed in that +window (@pxref{Node Commands, , @code{history-node}}). + +@table @asis +@item @code{C-x o} (@code{next-window}) +@cindex windows, selecting +@kindex C-x o +@findex next-window +Select the next window on the screen. Note that the echo area can only be +selected if it is already in use, and you have left it temporarily. +Normally, @samp{C-x o} simply moves the cursor into the next window on +the screen, or if you are already within the last window, into the first +window on the screen. Given a numeric argument, @samp{C-x o} moves over +that many windows. A negative argument causes @samp{C-x o} to select +the previous window on the screen. + +@item @code{M-x prev-window} +@findex prev-window +Select the previous window on the screen. This is identical to +@samp{C-x o} with a negative argument. + +@item @code{C-x 2} (@code{split-window}) +@cindex windows, creating +@kindex C-x 2 +@findex split-window +Split the current window into two windows, both showing the same node. +Each window is one half the size of the original window, and the cursor +remains in the original window. The variable @code{automatic-tiling} +can cause all of the windows on the screen to be resized for you +automatically, please @pxref{Variables, , automatic-tiling} for more +information. + +@item @code{C-x 0} (@code{delete-window}) +@cindex windows, deleting +@kindex C-x 0 +@findex delete-window +Delete the current window from the screen. If you have made too many +windows and your screen appears cluttered, this is the way to get rid of +some of them. + +@item @code{C-x 1} (@code{keep-one-window}) +@kindex C-x 1 +@findex keep-one-window +Delete all of the windows excepting the current one. + +@item @code{ESC C-v} (@code{scroll-other-window}) +@kindex ESC C-v, in Info windows +@findex scroll-other-window +Scroll the other window, in the same fashion that @samp{C-v} might +scroll the current window. Given a negative argument, scroll the +"other" window backward. + +@item @code{C-x ^} (@code{grow-window}) +@kindex C-x ^ +@findex grow-window +Grow (or shrink) the current window. Given a numeric argument, grow +the current window that many lines; with a negative numeric argument, +shrink the window instead. + +@item @code{C-x t} (@code{tile-windows}) +@cindex tiling +@kindex C-x t +@findex tile-windows +Divide the available screen space among all of the visible windows. +Each window is given an equal portion of the screen in which to display +its contents. The variable @code{automatic-tiling} can cause +@code{tile-windows} to be called when a window is created or deleted. +@xref{Variables, , @code{automatic-tiling}}. +@end table + +@node The Echo Area, , Basic Windows, Window Commands +@section The Echo Area +@cindex echo area + +The @dfn{echo area} is a one line window which appears at the bottom of +the screen. It is used to display informative or error messages, and to +read lines of input from you when that is necessary. Almost all of the +commands available in the echo area are identical to their Emacs +counterparts, so please refer to that documentation for greater depth of +discussion on the concepts of editing a line of text. The following +table briefly lists the commands that are available while input is being +read in the echo area: + +@table @asis +@item @code{C-f} (@code{echo-area-forward}) +@kindex C-f, in the echo area +@findex echo-area-forward +Move forward a character. + +@item @code{C-b} (@code{echo-area-backward}) +@kindex C-b, in the echo area +@findex echo-area-backward +Move backward a character. + +@item @code{C-a} (@code{echo-area-beg-of-line}) +@kindex C-a, in the echo area +@findex echo-area-beg-of-line +Move to the start of the input line. + +@item @code{C-e} (@code{echo-area-end-of-line}) +@kindex C-e, in the echo area +@findex echo-area-end-of-line +Move to the end of the input line. + +@item @code{M-f} (@code{echo-area-forward-word}) +@kindex M-f, in the echo area +@findex echo-area-forward-word +Move forward a word. + +@item @code{M-b} (@code{echo-area-backward-word}) +@kindex M-b, in the echo area +@findex echo-area-backward-word +Move backward a word. + +@item @code{C-d} (@code{echo-area-delete}) +@kindex C-d, in the echo area +@findex echo-area-delete +Delete the character under the cursor. + +@item @code{DEL} (@code{echo-area-rubout}) +@kindex DEL, in the echo area +@findex echo-area-rubout +Delete the character behind the cursor. + +@item @code{C-g} (@code{echo-area-abort}) +@kindex C-g, in the echo area +@findex echo-area-abort +Cancel or quit the current operation. If completion is being read, +@samp{C-g} discards the text of the input line which does not match any +completion. If the input line is empty, @samp{C-g} aborts the calling +function. + +@item @code{RET} (@code{echo-area-newline}) +@kindex RET, in the echo area +@findex echo-area-newline +Accept (or forces completion of) the current input line. + +@item @code{C-q} (@code{echo-area-quoted-insert}) +@kindex C-q, in the echo area +@findex echo-area-quoted-insert +Insert the next character verbatim. This is how you can insert control +characters into a search string, for example. + +@item @var{printing character} (@code{echo-area-insert}) +@kindex printing characters, in the echo area +@findex echo-area-insert +Insert the character. + +@item @code{M-TAB} (@code{echo-area-tab-insert}) +@kindex M-TAB, in the echo area +@findex echo-area-tab-insert +Insert a TAB character. + +@item @code{C-t} (@code{echo-area-transpose-chars}) +@kindex C-t, in the echo area +@findex echo-area-transpose-chars +Transpose the characters at the cursor. +@end table + +The next group of commands deal with @dfn{killing}, and @dfn{yanking} +text. For an in depth discussion of killing and yanking, +@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual} + +@table @asis +@item @code{M-d} (@code{echo-area-kill-word}) +@kindex M-d, in the echo area +@findex echo-area-kill-word +Kill the word following the cursor. + +@item @code{M-DEL} (@code{echo-area-backward-kill-word}) +@kindex M-DEL, in the echo area +@findex echo-area-backward-kill-word +Kill the word preceding the cursor. + +@item @code{C-k} (@code{echo-area-kill-line}) +@kindex C-k, in the echo area +@findex echo-area-kill-line +Kill the text from the cursor to the end of the line. + +@item @code{C-x DEL} (@code{echo-area-backward-kill-line}) +@kindex C-x DEL, in the echo area +@findex echo-area-backward-kill-line +Kill the text from the cursor to the beginning of the line. + +@item @code{C-y} (@code{echo-area-yank}) +@kindex C-y, in the echo area +@findex echo-area-yank +Yank back the contents of the last kill. + +@item @code{M-y} (@code{echo-area-yank-pop}) +@kindex M-y, in the echo area +@findex echo-area-yank-pop +Yank back a previous kill, removing the last yanked text first. +@end table + +Sometimes when reading input in the echo area, the command that needed +input will only accept one of a list of several choices. The choices +represent the @dfn{possible completions}, and you must respond with one +of them. Since there are a limited number of responses you can make, +Info allows you to abbreviate what you type, only typing as much of the +response as is necessary to uniquely identify it. In addition, you can +request Info to fill in as much of the response as is possible; this +is called @dfn{completion}. + +The following commands are available when completing in the echo area: + +@table @asis +@item @code{TAB} (@code{echo-area-complete}) +@itemx @code{SPC} +@kindex TAB, in the echo area +@kindex SPC, in the echo area +@findex echo-area-complete +Insert as much of a completion as is possible. + +@item @code{?} (@code{echo-area-possible-completions}) +@kindex ?, in the echo area +@findex echo-area-possible-completions +Display a window containing a list of the possible completions of what +you have typed so far. For example, if the available choices are: + +@example +@group +bar +foliate +food +forget +@end group +@end example + +@noindent +and you have typed an @samp{f}, followed by @samp{?}, the possible +completions would contain: + +@example +@group +foliate +food +forget +@end group +@end example + +@noindent +i.e., all of the choices which begin with @samp{f}. Pressing @key{SPC} +or @key{TAB} would result in @samp{fo} appearing in the echo area, since +all of the choices which begin with @samp{f} continue with @samp{o}. +Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate} +appearing in the echo area, since that is the only choice which begins +with @samp{fol}. + +@item @code{ESC C-v} (@code{echo-area-scroll-completions-window}) +@kindex ESC C-v, in the echo area +@findex echo-area-scroll-completions-window +Scroll the completions window, if that is visible, or the "other" +window if not. +@end table + +@node Printing Nodes, Miscellaneous Commands, Window Commands, Top +@chapter Printing Out Nodes +@cindex printing + +You may wish to print out the contents of a node as a quick reference +document for later use. Info provides you with a command for doing +this. In general, we recommend that you use @TeX{} to format the +document and print sections of it, by running @code{tex} on the Texinfo +source file. + +@table @asis +@item @code{M-x print-node} +@findex print-node +@cindex INFO_PRINT_COMMAND, environment variable +Pipe the contents of the current node through the command in the +environment variable @code{INFO_PRINT_COMMAND}. If the variable does not +exist, the node is simply piped to @code{lpr}. +@end table + +@node Miscellaneous Commands, Variables, Printing Nodes, Top +@chapter Miscellaneous Commands + +GNU Info contains several commands which self-document GNU Info: + +@table @asis +@item @code{M-x describe-command} +@cindex functions, describing +@cindex commands, describing +@findex describe-command +Read the name of an Info command in the echo area and then display a +brief description of what that command does. + +@item @code{M-x describe-key} +@cindex keys, describing +@findex describe-key +Read a key sequence in the echo area, and then display the name and +documentation of the Info command that the key sequence invokes. + +@item @code{M-x describe-variable} +Read the name of a variable in the echo area and then display a brief +description of what the variable affects. + +@item @code{M-x where-is} +@findex where-is +Read the name of an Info command in the echo area, and then display +a key sequence which can be typed in order to invoke that command. + +@item @code{C-h} (@code{get-help-window}) +@itemx @code{?} +@kindex C-h +@kindex ?, in Info windows +@findex get-help-window +Create (or Move into) the window displaying @code{*Help*}, and place +a node containing a quick reference card into it. This window displays +the most concise information about GNU Info available. + +@item @code{h} (@code{get-info-help-node}) +@kindex h +@findex get-info-help-node +Try hard to visit the node @code{(info)Help}. The Info file +@file{info.texi} distributed with GNU Info contains this node. Of +course, the file must first be processed with @code{makeinfo}, and then +placed into the location of your Info directory. +@end table + +Here are the commands for creating a numeric argument: + +@table @asis +@item @code{C-u} (@code{universal-argument}) +@cindex numeric arguments +@kindex C-u +@findex universal-argument +Start (or multiply by 4) the current numeric argument. @samp{C-u} is +a good way to give a small numeric argument to cursor movement or +scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while +@samp{C-u C-u C-n} moves the cursor down 16 lines. + +@item @code{M-1} (@code{add-digit-to-numeric-arg}) +@itemx @code{M-2} @dots{} @code{M-9} +@kindex M-1 @dots{} M-9 +@findex add-digit-to-numeric-arg +Add the digit value of the invoking key to the current numeric +argument. Once Info is reading a numeric argument, you may just type +the digits of the argument, without the Meta prefix. For example, you +might give @samp{C-l} a numeric argument of 32 by typing: + +@example +@kbd{C-u 3 2 C-l} +@end example + +@noindent +or + +@example +@kbd{M-3 2 C-l} +@end example +@end table + +@samp{C-g} is used to abort the reading of a multi-character key +sequence, to cancel lengthy operations (such as multi-file searches) and +to cancel reading input in the echo area. + +@table @asis +@item @code{C-g} (@code{abort-key}) +@cindex cancelling typeahead +@cindex cancelling the current operation +@kindex C-g, in Info windows +@findex abort-key +Cancel current operation. +@end table + +The @samp{q} command of Info simply quits running Info. + +@table @asis +@item @code{q} (@code{quit}) +@cindex quitting +@kindex q +@findex quit +Exit GNU Info. +@end table + +If the operating system tells GNU Info that the screen is 60 lines tall, +and it is actually only 40 lines tall, here is a way to tell Info that +the operating system is correct. + +@table @asis +@item @code{M-x set-screen-height} +@findex set-screen-height +@cindex screen, changing the height of +Read a height value in the echo area and set the height of the +displayed screen to that value. +@end table + +Finally, Info provides a convenient way to display footnotes which might +be associated with the current node that you are viewing: + +@table @asis +@item @code{ESC C-f} (@code{show-footnotes}) +@kindex ESC C-f +@findex show-footnotes +@cindex footnotes, displaying +Show the footnotes (if any) associated with the current node in another +window. You can have Info automatically display the footnotes +associated with a node when the node is selected by setting the variable +@code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}. +@end table + +@node Variables, GNU Info Global Index, Miscellaneous Commands, Top +@chapter Manipulating Variables + +GNU Info contains several @dfn{variables} whose values are looked at by +various Info commands. You can change the values of these variables, +and thus change the behavior of Info to more closely match your +environment and Info file reading manner. + +@table @asis +@item @code{M-x set-variable} +@cindex variables, setting +@findex set-variable +Read the name of a variable, and the value for it, in the echo area and +then set the variable to that value. Completion is available when +reading the variable name; often, completion is available when reading +the value to give to the variable, but that depends on the variable +itself. If a variable does @emph{not} supply multiple choices to +complete over, it expects a numeric value. + +@item @code{M-x describe-variable} +@cindex variables, describing +@findex describe-variable +Read the name of a variable in the echo area and then display a brief +description of what the variable affects. +@end table + +Here is a list of the variables that you can set in Info. + +@table @code +@item automatic-footnotes +@vindex automatic-footnotes +When set to @code{On}, footnotes appear and disappear automatically. +This variable is @code{On} by default. When a node is selected, a +window containing the footnotes which appear in that node is created, +and the footnotes are displayed within the new window. The window that +Info creates to contain the footnotes is called @samp{*Footnotes*}. If +a node is selected which contains no footnotes, and a @samp{*Footnotes*} +window is on the screen, the @samp{*Footnotes*} window is deleted. +Footnote windows created in this fashion are not automatically tiled so +that they can use as little of the display as is possible. + +@item automatic-tiling +@vindex automatic-tiling +When set to @code{On}, creating or deleting a window resizes other +windows. This variable is @code{Off} by default. Normally, typing +@samp{C-x 2} divides the current window into two equal parts. When +@code{automatic-tiling} is set to @code{On}, all of the windows are +resized automatically, keeping an equal number of lines visible in each +window. There are exceptions to the automatic tiling; specifically, the +windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not} +resized through automatic tiling; they remain their original size. + +@item visible-bell +@vindex visible-bell +When set to @code{On}, GNU Info attempts to flash the screen instead of +ringing the bell. This variable is @code{Off} by default. Of course, +Info can only flash the screen if the terminal allows it; in the case +that the terminal does not allow it, the setting of this variable has no +effect. However, you can make Info perform quietly by setting the +@code{errors-ring-bell} variable to @code{Off}. + +@item errors-ring-bell +@vindex errors-ring-bell +When set to @code{On}, errors cause the bell to ring. The default +setting of this variable is @code{On}. + +@item gc-compressed-files +@vindex gc-compressed-files +When set to @code{On}, Info garbage collects files which had to be +uncompressed. The default value of this variable is @code{Off}. +Whenever a node is visited in Info, the Info file containing that node +is read into core, and Info reads information about the tags and nodes +contained in that file. Once the tags information is read by Info, it +is never forgotten. However, the actual text of the nodes does not need +to remain in core unless a particular Info window needs it. For +non-compressed files, the text of the nodes does not remain in core when +it is no longer in use. But de-compressing a file can be a time +consuming operation, and so Info tries hard not to do it twice. +@code{gc-compressed-files} tells Info it is okay to garbage collect the +text of the nodes of a file which was compressed on disk. + +@item show-index-match +@vindex show-index-match +When set to @code{On}, the portion of the matched search string is +highlighted in the message which explains where the matched search +string was found. The default value of this variable is @code{On}. +When Info displays the location where an index match was found, +(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the +string that you had typed is highlighted by displaying it in the inverse +case from its surrounding characters. + +@item scroll-behavior +@vindex scroll-behavior +Control what happens when forward scrolling is requested at the end of +a node, or when backward scrolling is requested at the beginning of a +node. The default value for this variable is @code{Continuous}. There +are three possible values for this variable: + +@table @code +@item Continuous +Try to get the first item in this node's menu, or failing that, the +@samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}. +This behavior is identical to using the @samp{]} +(@code{global-next-node}) and @samp{[} (@code{global-prev-node}) +commands. + +@item Next Only +Only try to get the @samp{Next} node. + +@item Page Only +Simply give up, changing nothing. If @code{scroll-behavior} is +@code{Page Only}, no scrolling command can change the node that is being +viewed. +@end table + +@item scroll-step +@vindex scroll-step +The number of lines to scroll when the cursor moves out of the window. +Scrolling happens automatically if the cursor has moved out of the +visible portion of the node text when it is time to display. Usually +the scrolling is done so as to put the cursor on the center line of the +current window. However, if the variable @code{scroll-step} has a +nonzero value, Info attempts to scroll the node text by that many lines; +if that is enough to bring the cursor back into the window, that is what +is done. The default value of this variable is 0, thus placing the +cursor (and the text it is attached to) in the center of the window. +Setting this variable to 1 causes a kind of "smooth scrolling" which +some people prefer. + +@item ISO-Latin +@cindex ISO Latin characters +@vindex ISO-Latin +When set to @code{On}, Info accepts and displays ISO Latin characters. +By default, Info assumes an ASCII character set. @code{ISO-Latin} tells +Info that it is running in an environment where the European standard +character set is in use, and allows you to input such characters to +Info, as well as display them. +@end table + + + +@c the following is incomplete +@ignore +@c node Info for Sys Admins +@c chapter Info for System Administrators + +This text describes some common ways of setting up an Info hierarchy +from scratch, and details the various options that are available when +installing Info. This text is designed for the person who is installing +GNU Info on the system; although users may find the information present +in this section interesting, none of it is vital to understanding how to +use GNU Info. + +@menu +* Setting the INFOPATH:: Where are my Info files kept? +* Editing the DIR node:: What goes in `DIR', and why? +* Storing Info files:: Alternate formats allow flexibility in setups. +* Using `localdir':: Building DIR on the fly. +* Example setups:: Some common ways to organize Info files. +@end menu + +@c node Setting the INFOPATH +@c section Setting the INFOPATH + +Where are my Info files kept? + +@c node Editing the DIR node +@c section Editing the DIR node + +What goes in `DIR', and why? + +@c node Storing Info files +@c section Storing Info files + +Alternate formats allow flexibility in setups. + +@c node Using `localdir' +@c section Using `localdir' + +Building DIR on the fly. + +@c node Example setups +@c section Example setups + +Some common ways to organize Info files. +@end ignore + +@node GNU Info Global Index, , Variables, Top +@appendix Global Index + +@printindex cp + +@contents +@bye diff -r 12e008d41344 -r 697ef44129c6 man/info.texi --- a/man/info.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/info.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,9 @@ \input texinfo @c -*-texinfo-*- -@comment %**start of header +@comment %**start of header @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 $ +@settitle Info 1.0 +@comment %**end of header +@comment $Id: info.texi,v 1.4 1998/06/30 06:35:28 steve Exp $ @dircategory Texinfo documentation system @direntry @@ -11,10 +11,10 @@ @end direntry @ifinfo -This file describes how to use Info, the on-line, menu-driven GNU -documentation system. +This file describes how to use Info, +the on-line, menu-driven GNU documentation system. -Copyright (C) 1989, 92, 96, 97, 98, 99 Free Software Foundation, Inc. +Copyright (C) 1989, 92, 96, 97 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -44,9 +44,10 @@ @author Brian Fox @page @vskip 0pt plus 1filll -Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99 Free Software +Copyright @copyright{} 1989, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. @sp 2 + Published by the Free Software Foundation @* 59 Temple Place - Suite 330 @* Boston, MA 02111-1307, USA. @@ -66,19 +67,31 @@ by the Free Software Foundation. @end titlepage -@node Top +@ifinfo +@node Top, Getting Started, , (dir) @top Info: An Introduction -Info is a program for reading documentation, which you might be using -now to read this. +Info is a program for reading documentation, which you are using now. + +To learn how to use Info, type the command @kbd{h}. It brings you +to a programmed instruction sequence. -To learn how to use Info, type the command @kbd{h} while using the Info -program. It brings you to a programmed instruction sequence. +@c Need to make sure that `Info-help' goes to the right node, +@c which is the first node of the first chapter. (It should.) +@c (Info-find-node "info" +@c (if (< (window-height) 23) +@c "Help-Small-Screen" +@c "Help"))) + +To learn advanced Info commands, type @kbd{n} twice. This brings you to +@cite{Info for Experts}, skipping over the `Getting Started' chapter. +@end ifinfo @menu * Getting Started:: Getting started using an Info reader. * Advanced Info:: Advanced commands within Info. -* Creating an Info File:: How to make your own Info file. +* Create an Info File:: How to make your own Info file. +* The Standalone Info Program: (info-stnd.info). @end menu @node Getting Started, Advanced Info, Top, Top @@ -88,7 +101,7 @@ This first part of the Info manual describes how to get around inside of Info. The second part of the manual describes various advanced Info commands, and how to write an Info as distinct from a Texinfo -file. The third part is about how to generate Info files from +file. The third part is about how to generate Info files from Texinfo files. @iftex @@ -97,7 +110,7 @@ effective, since you must take it on faith that the commands described really do what the manual says. By all means go through this manual now that you have it; but please try going through the on-line version as -well. +well. There are two ways of looking at the online version of this manual: @@ -327,7 +340,7 @@ by a line which starts with @samp{* Menu:}. A node contains a menu if and only if it has a line in it which starts that way. The only menu you can use at any moment is the one in the node you are in. To use a -menu in any other node, you must move to that node first. +menu in any other node, you must move to that node first. After the start of the menu, each line that starts with a @samp{*} identifies one subtopic. The line usually contains a brief name @@ -414,14 +427,16 @@ not need to type the argument: you just type a Return, and it stands for the subtopic of the line you are on. -Here is a menu to give you a chance to practice. This menu gives you -three ways of going to one place, Help-FOO: +Here is a menu to give you a chance to practice. + +* Menu: The menu starts here. -@menu -* Foo: Help-FOO. A node you can visit for fun. -* Bar: Help-FOO. Strange! two ways to get to the same place. -* Help-FOO:: And yet another! -@end menu +This menu gives you three ways of going to one place, Help-FOO. + +* Foo: Help-FOO. A node you can visit for fun.@* +* Bar: Help-FOO. Strange! two ways to get to the same place.@* +* Help-FOO:: And yet another!@* + >> Now type just an @kbd{m} and see what happens: @@ -544,16 +559,17 @@ @c It is an accident of the menu updating command. @node Help-Cross, , , Help-Adv -@subsection The node reached by the cross reference in Info +@comment node-name, next, previous, up +@unnumberedsubsec The node reached by the cross reference in Info This is the node reached by the cross reference named @samp{Cross}. While this node is specifically intended to be reached by a cross -reference, most cross references lead to nodes that ``belong'' someplace -else far away in the structure of Info. So you cannot expect the -footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing -back to where you came from. In general, the @kbd{l} (el) command is -the only way to get back there. +reference, most cross references lead to nodes that ``belong'' +someplace else far away in the structure of Info. So you cannot expect +the footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing back to +where you came from. In general, the @kbd{l} (el) command is the only +way to get back there. >> Type @kbd{l} to return to the node where the cross reference was. @@ -574,15 +590,15 @@ @samp{mInfo} and Return, to get to the node about Info and see what other help is available. - -@node Advanced Info +@node Advanced Info, Create an Info File, Getting Started, Top +@comment node-name, next, previous, up @chapter Info for Experts This chapter describes various advanced Info commands, and how to write an Info as distinct from a Texinfo file. (However, in most cases, writing a Texinfo file is better, since you can use it @emph{both} to generate an Info file and to make a printed manual. @xref{Top,, Overview of -Texinfo, texinfo, Texinfo}.) +Texinfo, texinfo, Texinfo: The GNU Documentation Format}.) @menu * Expert:: Advanced Info commands: g, s, e, and 1 - 5. @@ -623,12 +639,12 @@ @key{RET}. To search for the same string again, just @kbd{s} followed by @key{RET} will do. The file's nodes are scanned in the order they are in in the file, which has no necessary relationship to the -order that they may be in in the tree structure of menus and @samp{next} -pointers. But normally the two orders are not very different. In any -case, you can always do a @kbd{b} to find out what node you have -reached, if the header is not visible (this can happen, because @kbd{s} -puts your cursor at the occurrence of the string, not at the beginning -of the node). +order that they may be in in the tree structure of menus and @samp{next} pointers. +But normally the two orders are not very different. In any case, +you can always do a @kbd{b} to find out what node you have reached, if +the header is not visible (this can happen, because @kbd{s} puts your +cursor at the occurrence of the string, not at the beginning of the +node). If you grudge the system each character of type-in it requires, you might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ... @@ -636,9 +652,9 @@ argument. @kbd{1} goes through the first item in the current node's menu; @kbd{2} goes through the second item, etc. -If your display supports multiple fonts, and you are using Emacs' Info +If you display supports multiple fonts, and you are using Emacs' Info mode to read Info files, the @samp{*} for the fifth menu item is -underlined, and so is the @samp{*} for the ninth item; these underlines +underlines, and so is the @samp{*} for the ninth item; these underlines make it easy to see at a glance which number to use for an item. On ordinary terminals, you won't have underlining. If you need to @@ -662,12 +678,12 @@ Put that topic in the menu in the directory. @xref{Menus, Menu}. @end enumerate -Usually, the way to create the nodes is with Texinfo (@pxref{Top,, -Overview of Texinfo, texinfo, Texinfo}); this has the advantage that you -can also make a printed manual from them. However, if you want to edit -an Info file, here is how. +Usually, the way to create the nodes is with Texinfo @pxref{Top,, Overview of +Texinfo, texinfo, Texinfo: The GNU Documentation Format}); this has the +advantage that you can also make a printed manual from them. However, +if hyou want to edit an Info file, here is how. -The new node can live in an existing documentation file, or in a new + The new node can live in an existing documentation file, or in a new one. It must have a @key{^_} character before it (invisible to the user; this node has one but you cannot see it), and it ends with either a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a @@ -677,12 +693,12 @@ is to put a @key{^L} @emph{right after} the @key{^_}. The @key{^_} starting a node must be followed by a newline or a -@key{^L} newline, after which comes the node's header line. The header -line must give the node's name (by which Info finds it), and state the -names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if there -are any). As you can see, this node's @samp{Up} node is the node -@samp{Top}, which points at all the documentation for Info. The -@samp{Next} node is @samp{Menus}. +@key{^L} newline, after which comes the node's header line. The +header line must give the node's name (by which Info finds it), +and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if +there are any). As you can see, this node's @samp{Up} node is the node +@samp{Top}, which points at all the documentation for Info. The @samp{Next} +node is @samp{Menus}. The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next}, may appear in any order, anywhere in the header line, but the @@ -712,10 +728,10 @@ unstructured files into nodes of the tree. The @samp{Node:} name, in which a node states its own name, must not -contain a filename, since Info when searching for a node does not expect -one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names -may contain them. In this node, since the @samp{Up} node is in the same -file, it was not necessary to use one. +contain a filename, since Info when searching for a node does not +expect one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names may +contain them. In this node, since the @samp{Up} node is in the same file, +it was not necessary to use one. Note that the nodes in this file have a file name in the header line. The file names are ignored by Info, but they serve as comments @@ -725,7 +741,7 @@ @comment node-name, next, previous, up @section How to Create Menus - Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes. + Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes. The @kbd{m} command searches the current node's menu for the topic which it reads from the terminal. @@ -750,11 +766,11 @@ the beginning of each item name which is the minimum acceptable abbreviation for it (a long menu is more than 5 or so entries). - The nodes listed in a node's menu are called its ``subnodes'', and it -is their ``superior''. They should each have an @samp{Up:} pointing at -the superior. It is often useful to arrange all or most of the subnodes -in a sequence of @samp{Next} and @samp{Previous} pointers so that -someone who wants to see them all need not keep revisiting the Menu. + The nodes listed in a node's menu are called its ``subnodes'', and +it is their ``superior''. They should each have an @samp{Up:} pointing at +the superior. It is often useful to arrange all or most of the +subnodes in a sequence of @samp{Next} and @samp{Previous} pointers so that someone who +wants to see them all need not keep revisiting the Menu. The Info Directory is simply the menu of the node @samp{(dir)Top}---that is, node @samp{Top} in file @file{.../info/dir}. You can put new entries @@ -800,7 +816,7 @@ You can speed up the access to nodes of a large Info file by giving it a tag table. Unlike the tag table for a program, the tag table for -an Info file lives inside the file itself and is used +an Info file lives inside the file itself and is used automatically whenever Info reads in the file. To make a tag table, go to a node in the file using Emacs Info mode and type @@ -831,34 +847,33 @@ a Delete character, and the character position in the file of the beginning of the node. - @node Checking, Emacs Info Variables, Tags, Advanced Info +@comment node-name, next, previous, up @section Checking an Info File -When creating an Info file, it is easy to forget the name of a node when -you are making a pointer to it from another node. If you put in the -wrong name for a node, this is not detected until someone tries to go -through the pointer using Info. Verification of the Info file is an -automatic process which checks all pointers to nodes and reports any -pointers which are invalid. Every @samp{Next}, @samp{Previous}, and + When creating an Info file, it is easy to forget the name of a node +when you are making a pointer to it from another node. If you put in +the wrong name for a node, this is not detected until someone +tries to go through the pointer using Info. Verification of the Info +file is an automatic process which checks all pointers to nodes and +reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and @samp{Up} is checked, as is every menu item and every cross reference. In -addition, any @samp{Next} which does not have a @samp{Previous} pointing -back is reported. Only pointers within the file are checked, because -checking pointers to other files would be terribly slow. But those are -usually few. +addition, any @samp{Next} which does not have a @samp{Previous} pointing back is +reported. Only pointers within the file are checked, because checking +pointers to other files would be terribly slow. But those are usually +few. -To check an Info file, do @kbd{M-x Info-validate} while looking at any -node of the file with Emacs Info mode. + To check an Info file, do @kbd{M-x Info-validate} while looking at +any node of the file with Emacs Info mode. @node Emacs Info Variables, , Checking, Advanced Info @section Emacs Info-mode Variables The following variables may modify the behaviour 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 -User's Manual}. - +in your @file{~/.emacs} init file. @xref{Examining, Examining and Setting +Variables, Examining and Setting Variables, emacs, The GNU Emacs +Manual}. @vtable @code @item Info-enable-edit @@ -879,17 +894,18 @@ function @code{Info-directory} is called. @end vtable - -@node Creating an Info File -@chapter Creating an Info File +@node Create an Info File, , Advanced Info, Top +@comment node-name, next, previous, up +@chapter Creating an Info File from a Makeinfo file -@xref{Top,, Overview of Texinfo, texinfo, Texinfo}, to learn how to -write a Texinfo file. +@code{makeinfo} is a utility that converts a Texinfo file into an Info +file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are +GNU Emacs functions that do the same. -@xref{Creating an Info File,,, texinfo, Texinfo}, to learn how to create -an Info file from a Texinfo file. +@xref{Create an Info File, , Creating an Info File, texinfo, the Texinfo +Manual}, to learn how to create an Info file from a Texinfo file. -@xref{Installing an Info File,,, texinfo, Texinfo}, to learn how to -install an Info file after you have created one. +@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation +Format}, to learn how to write a Texinfo file. @bye diff -r 12e008d41344 -r 697ef44129c6 man/internals/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/internals/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,70 @@ +# Makefile for the XEmacs Internals Manual. + +# 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. + +VERSION=1.0 +NAME=internals +manual = xemacs-internals-manual-19-$(VERSION) + +TEXI2DVI = texi2dvi +MAKEINFO = makeinfo + +# Uncomment this line for permuted index. +# permuted_index = 1 + +# List of all the texinfo files in the manual: + +srcs = internals.texi index.unperm index.perm + +all : info +info : ../../info/$(NAME).info + +../../info/$(NAME).info: $(srcs) index.texi + @echo "Expect a coredump if you are not using makeinfo 1.68 (or later)" + $(MAKEINFO) $(NAME).texi + @rm -f core + +dvi : $(NAME).dvi + +$(NAME).dvi: $(srcs) index.texi + # Avoid losing old contents of aux file entirely. + -mv $(NAME).aux $(NAME).oaux + # First shot to define xrefs: + $(TEX) $(NAME).texi + if [ a${permuted_index} != a ]; \ + then ./permute-index && mv permuted.fns $(NAME).fns; \ + else texindex $(NAME).??; \ + fi + $(TEX) $(NAME).texi + +index.texi: + if [ a${permuted_index} != a ]; \ + then ln -s index.perm index.texi; \ + else ln -s index.unperm index.texi; \ + fi + +.PHONY: mostlyclean clean distclean realclean extraclean +mostlyclean: + rm -f *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \ + *.vr *.vrs *.pg *.pgs *.ky *.kys +clean: mostlyclean + rm -f *.dvi *.ps make.out core index.texi +distclean: clean +realclean: clean +extraclean: clean + -rm -f *~ \#* diff -r 12e008d41344 -r 697ef44129c6 man/internals/index.perm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/internals/index.perm Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,37 @@ +@c -*-texinfo-*- +@setfilename ../../info/index.info + +@c Indexing guidelines + +@c I assume that all indexes will be combined. +@c Therefore, if a generated findex and permutations +@c cover the ways an index user would look up the entry, +@c then no cindex is added. +@c Concept index (cindex) entries will also be permuted. Therefore, they +@c have no commas and few irrelevant connectives in them. + +@c I tried to include words in a cindex that give the context of the entry, +@c particularly if there is more than one entry for the same concept. +@c For example, "nil in keymap" +@c Similarly for explicit findex and vindex entries, e.g. "print example". + +@c Error codes are given cindex entries, e.g. "end-of-file error". + +@c pindex is used for .el files and Unix programs + +@node Index, , Interface to X Windows, Top +@unnumbered Index + + +All variables, functions, keys, programs, files, and concepts are +in this one index. + +All names and concepts are permuted, so they appear several times, one +for each permutation of the parts of the name. For example, +@code{function-name} would appear as @b{function-name} and @b{name, +function-}. Key entries are not permuted, however. + + +@c Print the indices + +@printindex fn diff -r 12e008d41344 -r 697ef44129c6 man/internals/index.texi --- a/man/internals/index.texi Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -@c -*-texinfo-*- -@setfilename ../../info/index.info - -@c Indexing guidelines - -@c I assume that all indexes will be combined. -@c Therefore, if a generated findex and permutations -@c cover the ways an index user would look up the entry, -@c then no cindex is added. -@c Concept index (cindex) entries will also be permuted. Therefore, they -@c have no commas and few irrelevant connectives in them. - -@c I tried to include words in a cindex that give the context of the entry, -@c particularly if there is more than one entry for the same concept. -@c For example, "nil in keymap" -@c Similarly for explicit findex and vindex entries, e.g. "print example". - -@c Error codes are given cindex entries, e.g. "end-of-file error". - -@c pindex is used for .el files and Unix programs - -@node Index, , Interface to X Windows, Top -@unnumbered Index - -@ignore -All variables, functions, keys, programs, files, and concepts are -in this one index. - -All names and concepts are permuted, so they appear several times, one -for each permutation of the parts of the name. For example, -@code{function-name} would appear as @b{function-name} and @b{name, -function-}. Key entries are not permuted, however. -@end ignore - -@c Print the indices - -@printindex fn diff -r 12e008d41344 -r 697ef44129c6 man/internals/index.unperm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/internals/index.unperm Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,37 @@ +@c -*-texinfo-*- +@setfilename ../../info/index.info + +@c Indexing guidelines + +@c I assume that all indexes will be combined. +@c Therefore, if a generated findex and permutations +@c cover the ways an index user would look up the entry, +@c then no cindex is added. +@c Concept index (cindex) entries will also be permuted. Therefore, they +@c have no commas and few irrelevant connectives in them. + +@c I tried to include words in a cindex that give the context of the entry, +@c particularly if there is more than one entry for the same concept. +@c For example, "nil in keymap" +@c Similarly for explicit findex and vindex entries, e.g. "print example". + +@c Error codes are given cindex entries, e.g. "end-of-file error". + +@c pindex is used for .el files and Unix programs + +@node Index, , Interface to X Windows, Top +@unnumbered Index + +@ignore +All variables, functions, keys, programs, files, and concepts are +in this one index. + +All names and concepts are permuted, so they appear several times, one +for each permutation of the parts of the name. For example, +@code{function-name} would appear as @b{function-name} and @b{name, +function-}. Key entries are not permuted, however. +@end ignore + +@c Print the indices + +@printindex fn diff -r 12e008d41344 -r 697ef44129c6 man/internals/internals.texi --- a/man/internals/internals.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/internals/internals.texi Mon Aug 13 11:20:41 2007 +0200 @@ -7,7 +7,7 @@ @ifinfo @dircategory XEmacs Editor @direntry -* Internals: (internals). XEmacs Internals Manual. +* Internals: (internals). XEmacs Internals Manual. @end direntry Copyright @copyright{} 1992 - 1996 Ben Wing. @@ -63,13 +63,11 @@ @titlepage @title XEmacs Internals Manual -@subtitle Version 1.3, August 1999 +@subtitle Version 1.2, October 1998 @author Ben Wing @author Martin Buchholz @author Hrvoje Niksic -@author Matthias Neubauer -@author Olivier Galibert @page @vskip 0pt plus 1fill @@ -80,8 +78,8 @@ Copyright @copyright{} 1994, 1995 Board of Trustees, University of Illinois. @sp 2 -Version 1.3 @* -August 1999.@* +Version 1.2 @* +October 1998.@* Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -119,7 +117,6 @@ * 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:: @@ -130,24 +127,24 @@ * Consoles; Devices; Frames; Windows:: * The Redisplay Mechanism:: * Extents:: -* Faces:: -* Glyphs:: +* Faces and Glyphs:: * Specifiers:: * Menus:: * Subprocesses:: * Interface to X Windows:: -* Index:: - -@detailmenu - ---- The Detailed Node Listing --- +* 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: 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 @@ -155,17 +152,8 @@ * 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:: @@ -186,11 +174,11 @@ * Introduction to Allocation:: * Garbage Collection:: * GCPROing:: -* Garbage Collection - Step by Step:: * Integers and Characters:: * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: +* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -199,32 +187,6 @@ * 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:: @@ -263,7 +225,6 @@ * Character Sets:: * Encodings:: * Internal Mule Encodings:: -* CCL:: Encodings @@ -275,25 +236,20 @@ * 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 @@ -301,10 +257,19 @@ * 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 detailmenu +Faces and Glyphs + +Specifiers + +Menus + +Subprocesses + +Interface to X Windows + @end menu @node A History of Emacs, XEmacs From the Outside, Top, Top @@ -345,7 +310,7 @@ * XEmacs:: The continuation of Lucid Emacs. @end menu -@node Through Version 18, Lucid Emacs, A History of Emacs, A History of Emacs +@node Through Version 18 @section Through Version 18 @cindex Gosling, James @cindex Great Usenet Renaming @@ -458,7 +423,7 @@ version 18.59 released October 31, 1992. @end itemize -@node Lucid Emacs, GNU Emacs 19, Through Version 18, A History of Emacs +@node Lucid Emacs @section Lucid Emacs @cindex Lucid Emacs @cindex Lucid Inc. @@ -546,7 +511,7 @@ version 20.4 released February 28, 1998. @end itemize -@node GNU Emacs 19, GNU Emacs 20, Lucid Emacs, A History of Emacs +@node GNU Emacs 19 @section GNU Emacs 19 @cindex GNU Emacs 19 @cindex FSF Emacs @@ -623,7 +588,7 @@ working on and using GNU Emacs for a long time (back as far as version 16 or 17). -@node GNU Emacs 20, XEmacs, GNU Emacs 19, A History of Emacs +@node GNU Emacs 20 @section GNU Emacs 20 @cindex GNU Emacs 20 @cindex FSF Emacs @@ -642,7 +607,7 @@ version 20.3 released August 19, 1998. @end itemize -@node XEmacs, , GNU Emacs 20, A History of Emacs +@node XEmacs @section XEmacs @cindex XEmacs @@ -730,7 +695,7 @@ displayable representations, and XEmacs provides a function @code{redisplay()} that ensures that the display of all such objects matches their internal state. Most of the time, a standard Lisp -environment is in a @dfn{read-eval-print} loop---i.e. ``read some Lisp +environment is in a @dfn{read-eval-print} loop -- i.e. ``read some Lisp code, execute it, and print the results''. XEmacs has a similar loop: @itemize @bullet @@ -905,7 +870,7 @@ executed; this prints out the error and continues.) Routines can also specify cleanup code (called an @dfn{unwind-protect}) that will be called when control exits from a block of code, no matter how that exit -occurs---i.e. even if a function deeply nested below it causes a +occurs -- i.e. even if a function deeply nested below it causes a non-local exit back to the top level. Note that this facility has appeared in some recent vintages of C, in @@ -919,7 +884,7 @@ you declared. This is actually considered a bug in Emacs Lisp and in all other early dialects of Lisp, and was corrected in Common Lisp. (In Common Lisp, you can still declare dynamically scoped variables if you -want to---they are sometimes useful---but variables by default are +want to -- they are sometimes useful -- but variables by default are @dfn{lexically scoped} as in C.) @end enumerate @@ -967,7 +932,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 foreseeable future, +makes programming more tedious and less fun. For the forseeable 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 @@ -1277,9 +1242,9 @@ An object representing a single character of text; chars behave like integers in many ways but are logically considered text rather than numbers and have a different read syntax. (the read syntax for a char -contains the char itself or some textual encoding of it---for example, +contains the char itself or some textual encoding of it -- for example, a Japanese Kanji character might be encoded as @samp{^[$(B#&^[(B} using the -ISO-2022 encoding standard---rather than the numerical representation +ISO-2022 encoding standard -- rather than the numerical representation of the char; this way, if the mapping between chars and integers changes, which is quite possible for Kanji characters and other extended characters, the same character will still be created. Note that some @@ -1497,7 +1462,7 @@ 1.983e-4 @end example -converts to a float whose value is 1.983e-4, or .0001983. +converts to a float whose value is 1983.23e-4, or .0001983. @example ?b @@ -1620,17 +1585,25 @@ [ 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. 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. + <---> ^ <------------------------------------------------------> + 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.) 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 @@ -1641,56 +1614,133 @@ 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. 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 +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 +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 -where an incorrect type is being dereferenced---this typically results +where an incorrect type is being dereferenced -- this typically results in a pointer being dereferenced as the wrong type of structure, with unpredictable (and sometimes not easily traceable) results. 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 the correct type before using the @code{X@var{TYPE}} +Lisp_Object is 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 @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. +it's better to crash immediately, so sprinkle ``unreachable'' +@code{abort()}s liberally about the source code. @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 @@ -1710,7 +1760,7 @@ * Techniques for XEmacs Developers:: @end menu -@node General Coding Rules, Writing Lisp Primitives, Rules When Writing New C Code, Rules When Writing New C Code +@node General Coding Rules @section General Coding Rules The C code is actually written in a dialect of C called @dfn{Clean C}, @@ -1743,16 +1793,6 @@ system header files) to ensure that certain tricks played by various @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 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 ``declare with initializer'' form for these variables, such as @code{int @@ -1761,8 +1801,9 @@ 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 during the -@file{temacs} phase. +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. @cindex copy-on-write @strong{Please note:} This kludge only works on a few systems nowadays, @@ -1796,10 +1837,10 @@ macro style is: @example -#define FOO(var, value) do @{ \ - Lisp_Object FOO_value = (value); \ - ... /* compute using FOO_value */ \ - (var) = bar; \ +#define FOO(var, value) do @{ \ + Lisp_Object FOO_value = (value); \ + ... /* compute using FOO_value */ \ + (var) = bar; \ @} while (0) @end example @@ -1825,7 +1866,7 @@ @code{LIST_LOOP_DELETE_IF} delete elements from a lisp list satisfying some predicate. -@node Writing Lisp Primitives, Adding Global Lisp Variables, General Coding Rules, Rules When Writing New C Code +@node Writing Lisp Primitives @section Writing Lisp Primitives Lisp primitives are Lisp functions implemented in C. The details of @@ -2069,7 +2110,7 @@ @file{lisp.h} contains the definitions for important macros and functions. -@node Adding Global Lisp Variables, Coding for Mule, Writing Lisp Primitives, Rules When Writing New C Code +@node Adding Global Lisp Variables @section Adding Global Lisp Variables Global variables whose names begin with @samp{Q} are constants whose @@ -2131,7 +2172,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, Techniques for XEmacs Developers, Adding Global Lisp Variables, Rules When Writing New C Code +@node Coding for Mule @section Coding for Mule @cindex Coding for Mule @@ -2154,7 +2195,7 @@ * An Example of Mule-Aware Code:: @end menu -@node Character-Related Data Types, Working With Character and Byte Positions, Coding for Mule, Coding for Mule +@node Character-Related Data Types @subsection Character-Related Data Types First, let's review the basic character-related datatypes used by @@ -2181,22 +2222,19 @@ The data representing the text in a buffer or string is logically a set of @code{Bufbyte}s. -XEmacs does not work with the same character formats all the time; when -reading characters from the outside, it decodes them to an internal -format, and likewise encodes them when writing. @code{Bufbyte} (in fact +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 @code{unsigned char}) is the basic unit of XEmacs internal buffers and -strings format. A @code{Bufbyte *} is the type that points at text -encoded in the variable-width internal encoding. +strings format. One character can correspond to one or more @code{Bufbyte}s. In the -current Mule implementation, an ASCII character is represented by the -same @code{Bufbyte}, and other characters are represented by a sequence -of two or more @code{Bufbyte}s. - -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. +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}. @item Bufpos @itemx Charcount @@ -2206,8 +2244,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{EMACS_INT}, we use them in preference to @code{EMACS_INT} to make -it clear what sort of position is being used. +@code{int}, we use them in preference to @code{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. @@ -2217,7 +2255,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}. @@ -2231,7 +2269,7 @@ and Extcounts are not all that frequent in XEmacs code. @end table -@node Working With Character and Byte Positions, Conversion to and from External Data, Character-Related Data Types, Coding for Mule +@node Working With Character and Byte Positions @subsection Working With Character and Byte Positions Now that we have defined the basic character-related types, we can look @@ -2244,10 +2282,10 @@ @table @code @item MAX_EMCHAR_LEN @cindex MAX_EMCHAR_LEN -This preprocessor constant is the maximum number of buffer bytes to -represent an Emacs character in the variable width internal encoding. -It is useful when allocating temporary strings to keep a known number of -characters. For instance: +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: @example @group @@ -2355,7 +2393,7 @@ @end example @end table -@node Conversion to and from External Data, General Guidelines for Writing Mule-Aware Code, Working With Character and Byte Positions, Coding for Mule +@node Conversion to and from External Data @subsection Conversion to and from External Data When an external function, such as a C library function, returns a @@ -2368,136 +2406,108 @@ The interface to conversion between the internal and external representations of text are the numerous conversion macros defined in -@file{buffer.h}. There used to be a fixed set of external formats -supported by these macros, but now any coding system can be used with -these macros. The coding system alias mechanism is used to create the -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). +@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 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: +@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 (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. +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 `~'. +characters are converted into `X'. @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 +@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. -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 + +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. This is a real coding system, -unlike Qfile_name, which is user-definable. +no-lock-shift ISO2022 coding system. @end table -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: +The macros to convert between these formats and the internal format, and +vice versa, follow. @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 +@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. @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 +@node General Guidelines for Writing Mule-Aware Code @subsection General Guidelines for Writing Mule-Aware Code This section contains some general guidance on how to write Mule-aware @@ -2524,23 +2534,10 @@ buffers literally. This means that when a system function, such as @code{readdir}, returns -a string, you may need to convert it using one of the conversion macros +a string, you need to convert it using one of the conversion macros described in the previous chapter, before passing it further to Lisp. - -Actually, most of the basic system functions that accept '\0'-terminated -string arguments, like @code{stat()} and @code{open()}, have been -@strong{encapsulated} so that they are they @code{always} do internal to -external conversion themselves. This means you must pass internally -encoded data, typically the @code{XSTRING_DATA} of a Lisp_String to -these functions. This is actually a design bug, since it unexpectedly -changes the semantics of the system functions. A better design would be -to provide separate versions of these system functions that accepted -Lisp_Objects which were lisp strings in place of their current -@code{char *} arguments. - -@example -int stat_lisp (Lisp_Object path, struct stat *buf); /* Implement me */ -@end example +In the case of @code{readdir}, you would use the +@code{GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA} macro. Also note that many internal functions, such as @code{make_string}, accept Bufbytes, which removes the need for them to convert the data @@ -2549,12 +2546,13 @@ passed around in internal format. @end table -@node An Example of Mule-Aware Code, , General Guidelines for Writing Mule-Aware Code, Coding for Mule +@node An Example of Mule-Aware Code @subsection An Example of Mule-Aware Code -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}: +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}: @example @group @@ -2599,22 +2597,16 @@ understood this section of the manual and studied the examples, you can proceed writing new Mule-aware code. -@node Techniques for XEmacs Developers, , Coding for Mule, Rules When Writing New C Code +@node Techniques for XEmacs Developers @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 (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 +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...}}. 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 @@ -2653,116 +2645,14 @@ 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. See the section in the -XEmacs FAQ on How to Debug an XEmacs problem with a debugger. +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}. After making source code changes, run @code{make check} to ensure that -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 +you haven't introduced any regressions. If you're feeling ambitious, +you can try to improve the test suite in @file{tests/automated}. Here are things to know when you create a new source file: @@ -2775,7 +2665,7 @@ Generated header files should be included using the @code{#include <...>} syntax, not the @code{#include "..."} syntax. The generated headers are: -@file{config.h sheap-adjust.h paths.h Emacs.ad.h} +@file{config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h} The basic rule is that you should assume builds using @code{--srcdir} and the @code{#include <...>} syntax needs to be used when the @@ -2789,32 +2679,25 @@ @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 @@ -2836,7 +2719,7 @@ * Modules for Internationalization:: @end menu -@node Low-Level Modules, Basic Lisp Modules, A Summary of the Various XEmacs Modules, A Summary of the Various XEmacs Modules +@node Low-Level Modules @section Low-Level Modules @example @@ -3060,7 +2943,7 @@ -@node Basic Lisp Modules, Modules for Standard Editing Operations, Low-Level Modules, A Summary of the Various XEmacs Modules +@node Basic Lisp Modules @section Basic Lisp Modules @example @@ -3095,7 +2978,7 @@ typedefs section as necessary. @file{lrecord.h} contains the basic structures and macros that implement -all record-type Lisp objects---i.e. all objects whose type is a field +all record-type Lisp objects -- i.e. all objects whose type is a field in their C structure, which includes all objects except the few most basic ones. @@ -3113,6 +2996,8 @@ @example alloc.c +pure.c +puresize.h @end example The large module @file{alloc.c} implements all of the basic allocation and @@ -3129,7 +3014,7 @@ type-specific methods. This scheme is a fundamental principle of object-oriented programming and is heavily used throughout XEmacs. The great advantage of this is that it allows for a clean separation of -functionality into different modules---new classes of Lisp objects, new +functionality into different modules -- new classes of Lisp objects, new event interfaces, new device types, new stream interfaces, etc. can be added transparently without affecting code anywhere else in XEmacs. Because the different subsystems are divided into general and specific @@ -3138,6 +3023,35 @@ 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 @@ -3191,7 +3105,7 @@ @file{symbols.c} implements the handling of symbols, obarrays, and retrieving the values of symbols. Much of the code is devoted to handling the special @dfn{symbol-value-magic} objects that define -special types of variables---this includes buffer-local variables, +special types of variables -- this includes buffer-local variables, variable aliases, variables that forward into C variables, etc. This module is initialized extremely early (right after @file{alloc.c}), because it is here that the basic symbols @code{t} and @code{nil} are @@ -3235,7 +3149,7 @@ -@node Modules for Standard Editing Operations, Editor-Level Control Flow Modules, Basic Lisp Modules, A Summary of the Various XEmacs Modules +@node Modules for Standard Editing Operations @section Modules for Standard Editing Operations @example @@ -3405,7 +3319,7 @@ -@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 +@node Editor-Level Control Flow Modules @section Editor-Level Control Flow Modules @example @@ -3470,7 +3384,7 @@ @end example @file{keyboard.c} contains functions that implement the actual editor -command loop---i.e. the event loop that cyclically retrieves and +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}. @@ -3503,7 +3417,7 @@ -@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 +@node Modules for the Basic Displayable Lisp Objects @section Modules for the Basic Displayable Lisp Objects @example @@ -3577,7 +3491,7 @@ -@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 +@node Modules for other Display-Related Lisp Objects @section Modules for other Display-Related Lisp Objects @example @@ -3638,7 +3552,7 @@ font-lock.c @end example -This file provides C support for syntax highlighting---i.e. +This file provides C support for syntax highlighting -- i.e. highlighting different syntactic constructs of a source file in different colors, for easy reading. The C support is provided so that this is fast. @@ -3656,7 +3570,7 @@ -@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 +@node Modules for the Redisplay Mechanism @section Modules for the Redisplay Mechanism @example @@ -3728,7 +3642,7 @@ -@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 +@node Modules for Interfacing with the File System @section Modules for Interfacing with the File System @example @@ -3829,7 +3743,7 @@ -@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 +@node Modules for Other Aspects of the Lisp Interpreter and Object System @section Modules for Other Aspects of the Lisp Interpreter and Object System @example @@ -3943,7 +3857,7 @@ with them, in case the block of memory contains other Lisp objects that need to be marked for garbage-collection purposes. (If you need other object methods, such as a finalize method, you should just go ahead and -create a new Lisp object type---it's not hard.) +create a new Lisp object type -- it's not hard.) @@ -3991,7 +3905,7 @@ -@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 +@node Modules for Interfacing with the Operating System @section Modules for Interfacing with the Operating System @example @@ -4230,7 +4144,7 @@ -@node Modules for Interfacing with X Windows, Modules for Internationalization, Modules for Interfacing with the Operating System, A Summary of the Various XEmacs Modules +@node Modules for Interfacing with X Windows @section Modules for Interfacing with X Windows @example @@ -4372,7 +4286,7 @@ -@node Modules for Internationalization, , Modules for Interfacing with X Windows, A Summary of the Various XEmacs Modules +@node Modules for Internationalization @section Modules for Internationalization @example @@ -4449,18 +4363,18 @@ -@node Allocation of Objects in XEmacs Lisp, Dumping, A Summary of the Various XEmacs Modules, Top +@node Allocation of Objects in XEmacs Lisp, Events and the Event Loop, A Summary of the Various XEmacs Modules, Top @chapter Allocation of Objects in XEmacs Lisp @menu * Introduction to Allocation:: * Garbage Collection:: * GCPROing:: -* Garbage Collection - Step by Step:: * Integers and Characters:: * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: +* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -4470,7 +4384,7 @@ * Compiled Function:: @end menu -@node Introduction to Allocation, Garbage Collection, Allocation of Objects in XEmacs Lisp, Allocation of Objects in XEmacs Lisp +@node Introduction to Allocation @section Introduction to Allocation Emacs Lisp, like all Lisps, has garbage collection. This means that @@ -4491,10 +4405,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 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: + 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: @itemize @bullet @item @@ -4505,28 +4419,54 @@ @code{GCPRO}ed. @end itemize + In the remaining three categories, the value is a pointer to a +structure. + +@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_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. +(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 -(b) Those lrecords that are allocated in frob blocks (see above). This +(c) Those lrecords that are allocated in frob blocks (see above). This includes the objects that are most common and relatively small, and -includes conses, strings, subrs, floats, compiled functions, symbols, +includes floats, compiled functions, symbols (when not in category (b)), 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 (c) (esp. if the +it's a bit trickier than adding an object type to type (d) (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 -(c) Those lrecords that are individually @code{malloc()}ed. These are +(d) 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 @@ -4535,13 +4475,19 @@ @end itemize Note that bit vectors are a bit of a special case. They are -simple lrecords as in category (b), but are individually @code{malloc()}ed +simple lrecords as in category (c), 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. - -@node Garbage Collection, GCPROing, Introduction to Allocation, Allocation of Objects in XEmacs Lisp + 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 @section Garbage Collection @cindex garbage collection @@ -4559,13 +4505,63 @@ all vectors (which are chained in one big list), and all lcrecords (which are likewise chained). - 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 + 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 @section @code{GCPRO}ing @code{GCPRO}ing is one of the ugliest and trickiest parts of Emacs @@ -4576,17 +4572,14 @@ @enumerate @item -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. +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.) Note that @code{obarray} is one of the @code{staticpro()}d things. Therefore, all functions and variables get marked through this. @@ -4630,7 +4623,7 @@ in the next enclosing stack frame. Each @code{GCPRO}ed thing is an lvalue, and the @code{struct gcpro} local variable contains a pointer to this lvalue. This is why things will mess up badly if you don't pair up -the @code{GCPRO}s and @code{UNGCPRO}s---you will end up with +the @code{GCPRO}s and @code{UNGCPRO}s -- you will end up with @code{gcprolist}s containing pointers to @code{struct gcpro}s or local @code{Lisp_Object} variables in no-longer-active stack frames. @@ -4721,503 +4714,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, Integers and Characters, GCPROing, Allocation of Objects in XEmacs Lisp -@section Garbage Collection - Step by Step -@cindex garbage collection step by step - -@menu -* Invocation:: -* garbage_collect_1:: -* mark_object:: -* gc_sweep:: -* sweep_lcrecords_1:: -* compact_string_chars:: -* sweep_strings:: -* sweep_bit_vectors_1:: -@end menu - -@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 -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: - -The entry point of any process of garbage collection is an invocation -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 -situations: -@enumerate -@item -In function @code{main_1} in file @code{emacs.c}. This function is called -at each startup of xemacs. The garbage collection is invoked after all -initial creations are completed, but only if a special internal error -checking-constant @code{ERROR_CHECK_GC} is defined. -@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 -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 -starting a garbage collection. The function is only used while building -xemacs. -@item -In function @code{Feval / eval} in file @code{eval.c}. Each time the -well known and often used function eval is called to evaluate a form, -one of the first things that could happen, is a potential call of -@code{garbage_collect_1}. There exist three global variables, -@code{consing_since_gc} (counts the created cons-cells since the last -garbage collection), @code{gc_cons_threshold} (a specified threshold -after which a garbage collection occurs) and @code{always_gc}. If -@code{always_gc} is set or if the threshold is exceeded, the garbage -collection will start. -@item -In function @code{Ffuncall / funcall} in file @code{eval.c}. This -function evaluates calls of elisp functions and works according to -@code{Feval}. -@end enumerate - -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{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} - -We can now describe exactly what happens after the invocation takes -place. -@enumerate -@item -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 -(@code{in_display}) or when we are preparing for the armageddon of the -whole system (@code{preparing_for_armageddon}). -@item -Next the correct frame in which to put -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_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}. -@item -If we are concurrently running an interactive xemacs session, the next step -is simply to show the garbage collector's cursor/message. -@item -The following steps are the intrinsic steps of the garbage collector, -therefore @code{gc_in_progress} is set. -@item -For debugging purposes, it is possible to copy the current C stack -frame. However, this seems to be a currently unused feature. -@item -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}). -@item -Now the mark phase begins and marks all accessible elements. In order to -start from -all slots that serve as roots of accessibility, the function -@code{mark_object} is called for each root individually to go out from -there to mark all reachable objects. All roots that are traversed are -shown in their processed order: -@itemize @bullet -@item -all constant symbols and static variables that are registered via -@code{staticpro}@ in the array @code{staticvec}. -@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 -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 -called @code{specpdl}. -@xref{Dynamic Binding; The specbinding Stack; Unwind-Protects}. -@item -all catch blocks that the Lisp engine encounters during the evaluation -cause the creation of structs @code{catchtag} inserted in the list -@code{catchlist}. Their tag (@code{tag}) and value (@code{val} fields -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 -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 -are marked by a special function called @code{mark_redisplay} (in -@code{redisplay.c}). -@item -all objects created for profiling purposes are allocated by C functions -instead of using the lisp allocation mechanisms. In order to receive the -right ones during the sweep phase, they also have to be marked -manually. That is done by the function @code{mark_profiling_info} -@end itemize -@item -Hash tables in XEmacs belong to a kind of special objects that -make use of a concept often called 'weak pointers'. -To make a long story short, these kind of pointers are not followed -during the estimation of the live objects during garbage collection. -Any object referenced only by weak pointers is collected -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 -be found in the documentation to the function @code{make-hash-table}. - -Because there are complicated dependency rules about when and what to -mark while processing weak hash tables, the standard @code{marker} -method is only active if it is marking non-weak hash tables. As soon as -a weak component is in the table, the hash table entries are ignored -while marking. Instead their marking is done each separately by the -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. -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 -acting as a @code{HASH_TABLE_VALUE_WEAK} and the value component is -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 -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} -and the car of the value components is already marked, again both the -@code{key} and the @code{value} components get marked. - -Again, there are lists with comparable properties called weak -lists. There exist different peculiarities of their types called -@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}, -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 -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 -@code{WEAK_LIST_ASSOC} and not a pair or a pair with both marked car and -cdr, we mark the @code{cons} and the @code{elem}. If it is a -@code{WEAK_LIST_KEY_ASSOC} and not a pair or a pair with a marked car of -the elem, we mark the @code{cons} and the @code{elem}. Finally, if it is -a @code{WEAK_LIST_VALUE_ASSOC} and not a pair or a pair with a marked -cdr of the elem, we mark both the @code{cons} and the @code{elem}. - -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 -yet unmarked objects get freshly marked. - -@item -After completing the special marking for the weak hash tables and for the weak -lists, all entries that point to objects that are going to be swept in -the further process are useless, and therefore have to be removed from -the table or the list. - -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 -the components @code{key} and @code{value} is unmarked. - -The same idea applies to the weak lists. It is accomplished by -@code{prune_weak_lists}: An unmarked list is pruned from -@code{Vall_weak_lists} immediately. A marked list is treated more -carefully by going over it and removing just the unmarked pairs. - -@item -The function @code{prune_specifiers} checks all listed specifiers held -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 -through it and unlinks the tables that are unmarked. - -@item -Next, we will attack the complete sweeping - the function -@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 -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 -removed again. -@item -The state of @code{gc_inhibit} is restored to the former value by -unwinding the stack. -@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. -@end enumerate - -@node mark_object, gc_sweep, garbage_collect_1, Garbage Collection - Step by Step -@subsection @code{mark_object} -@cindex @code{mark_object} - -The first thing that is checked while marking an object is whether the -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. -@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 -dealing with a pointer to a Lisp object. But, there exist also three -possibilities, that prevent us from doing anything while marking: The -object is read only which prevents it from being garbage collected, -i.e. marked (@code{C_READONLY_RECORD_HEADER}). The object in question is -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 -@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 -marker methods should not call @code{mark_object} recursively, but -instead should return the next object from where further marking has to -be performed. - -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, 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 -we know, there are different types of objects implemented and managed, and -consequently different ways to free them from memory. -@xref{Introduction to Allocation}. - -We start with all objects stored through @code{lcrecords}. All -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 -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, -ldap, hash-table, command-builder, extent-auxiliary, extent-info, face, -coding-system, frame, image-instance, glyph, popup-data, gui-item, -keymap, charset, color_instance, font_instance, opaque, opaque-list, -process, range-table, specifier, symbol-value-buffer-local, -symbol-value-lisp-magic, symbol-value-varalias, toolbar-button, -tooltalk-message, tooltalk-pattern, window, and window-configuration. We -take care of them in the fist place -in order to be able to handle and to finalize items stored in them more -easily. The function @code{sweep_lcrecords_1} as described below is -doing the whole job for us. -For a description about the internals: @xref{lrecords}. - -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 -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 -compression of holes is made, i.e. all strings are relocated together. -@xref{String}. This compacting phase is performed by the function -@code{compact_string_chars}, the actual sweeping by the function -@code{sweep_strings} is described below. - -After that, the other types are swept step by step using functions -@code{sweep_conses}, @code{sweep_bit_vectors_1}, -@code{sweep_compiled_functions}, @code{sweep_floats}, -@code{sweep_symbols}, @code{sweep_extents}, @code{sweep_markers} and -@code{sweep_extents}. They are the fixed-size types cons, floats, -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 -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} -described later. - -At first, we need some brief information about how -these fixed-size types are managed in general, in order to understand -how the sweeping is done. They have all a fixed size, and are therefore -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 -(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 -(@code{current_..._block_index}), and a pointer to the free list that -will be created. Also a macro @code{FIXED_TYPE_FROM_BLOCK} plus some -related macros exists that are used to obtain a new object, either from -the free list @code{ALLOCATE_FIXED_TYPE_1} if there is an unused object -of that type stored or by allocating a completely new block using -@code{ALLOCATE_FIXED_TYPE_FROM_BLOCK}. - -The rest works as follows: all of them define a -macro @code{UNMARK_...} that is used to unmark the object. They define a -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 -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 -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 -(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, 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 -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 -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, sweep_strings, sweep_lcrecords_1, Garbage Collection - Step by Step -@subsection @code{compact_string_chars} -@cindex @code{compact_string_chars} - -The purpose of this function is to compact all the data parts of the -strings that are held in so-called @code{string_chars_block}, i.e. the -strings that do not exceed a certain maximal length. - -The procedure with which this is done is as follows. We are keeping two -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. - -While going over all chained @code{string_char_block}s and their held -strings, staring at @code{first_string_chars_block}, both pointers -are advanced and eventually a string is copied from @code{from_sb} to -@code{to_sb}, depending on the status of the pointed at strings. - -More precisely, we can distinguish between the following actions. -@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 -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. -@item -Also, if a string object itself is unmarked, nothing has to be -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 -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 -from and to positions are different, we perform the -actual copying using the library function @code{memmove}. -@end itemize - -After compacting, the pointer to the current -@code{string_chars_block}, sitting in @code{current_string_chars_block}, -is reset on the last block to which we moved a string, -i.e. @code{to_block}, and all remaining blocks (we know that they just -carry garbage) are explicitly @code{xfree}d. - -@node sweep_strings, sweep_bit_vectors_1, compact_string_chars, Garbage Collection - Step by Step -@subsection @code{sweep_strings} -@cindex @code{sweep_strings} - -The sweeping for the fixed sized string objects is essentially exactly -the same as it is for all other fixed size types. As before, the freeing -into the suitable free list is done by using the macro -@code{SWEEP_FIXED_SIZE_BLOCK} after defining the right macros -@code{UNMARK_string} and @code{ADDITIONAL_FREE_string}. These two -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 -used for updating the bookkeeping information. - -For strings, @code{ADDITIONAL_FREE_string} has to do something in -addition: in case, the string was not allocated in a -@code{string_chars_block} because it exceeded the maximal length, and -therefore it was @code{malloc}ed separately, we know also @code{xfree} -it explicitly. - -@node sweep_bit_vectors_1, , sweep_strings, Garbage Collection - Step by Step -@subsection @code{sweep_bit_vectors_1} -@cindex @code{sweep_bit_vectors_1} - -Bit vectors are also one of the rare types that are @code{malloc}ed -individually. Consequently, while sweeping, all further needless -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 -them become unmarked. -In addition, the bookkeeping information used for garbage -collector's output purposes is updated. - -@node Integers and Characters, Allocation from Frob Blocks, Garbage Collection - Step by Step, Allocation of Objects in XEmacs Lisp +@node Integers and Characters @section Integers and Characters Integer and character Lisp objects are created from integers using the @@ -5231,7 +4728,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, lrecords, Integers and Characters, Allocation of Objects in XEmacs Lisp +@node Allocation from Frob Blocks @section Allocation from Frob Blocks The uninitialized memory required by a @code{Lisp_Object} of a particular type @@ -5258,23 +4755,31 @@ 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, Low-level allocation, Allocation from Frob Blocks, Allocation of Objects in XEmacs Lisp +@node lrecords @section lrecords [see @file{lrecord.h}] All lrecords have at the beginning of their structure 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_header}. This just contains a pointer 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. - - Simple lrecords (of type (b) above) just have a @code{struct +@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 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 @@ -5302,21 +4807,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 @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. +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. The difference between @code{DEFINE_LRECORD_IMPLEMENTATION()} and @code{DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()} is that the former is @@ -5330,20 +4835,21 @@ 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 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}. +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. Note that for every type defined with a @code{DEFINE_LRECORD_*()} macro, there needs to be a @code{DECLARE_LRECORD_IMPLEMENTATION()} @@ -5488,7 +4994,7 @@ For an example, see the methods for window configurations and opaques. @end enumerate -@node Low-level allocation, Cons, lrecords, Allocation of Objects in XEmacs Lisp +@node Low-level allocation @section Low-level allocation Memory that you want to allocate directly should be allocated using @@ -5549,17 +5055,23 @@ (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 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 +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 @section Cons Conses are allocated in standard frob blocks. The only thing to @@ -5573,7 +5085,7 @@ If you mess this up, you will get BADLY BURNED, and it has happened before. -@node Vector, Bit Vector, Cons, Allocation of Objects in XEmacs Lisp +@node Vector @section Vector As mentioned above, each vector is @code{malloc()}ed individually, and @@ -5584,7 +5096,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, Symbol, Vector, Allocation of Objects in XEmacs Lisp +@node Bit Vector @section Bit Vector Bit vectors work exactly like vectors, except for more complicated @@ -5594,16 +5106,21 @@ tag field in bit vector Lisp words is ``lrecord'' rather than ``vector''.) -@node Symbol, Marker, Bit Vector, Allocation of Objects in XEmacs Lisp +@node Symbol @section Symbol - Symbols are also allocated in frob blocks. Symbols in the awful -horrible obarray structure are chained through their @code{next} field. + 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. Remember that @code{intern} looks up a symbol in an obarray, creating one if necessary. -@node Marker, String, Symbol, Allocation of Objects in XEmacs Lisp +@node Marker @section Marker Markers are allocated in frob blocks, as usual. They are kept @@ -5614,7 +5131,7 @@ markers from a buffer.) Markers are removed from a buffer in the finalize stage, in @code{ADDITIONAL_FREE_marker()}. -@node String, Compiled Function, Marker, Allocation of Objects in XEmacs Lisp +@node String @section String As mentioned above, strings are a special case. A string is logically @@ -5648,8 +5165,8 @@ strings}, are all @code{malloc()}ed as their own block. (#### Although it would make more sense for the threshold for big strings to be somewhat lower, e.g. 1/2 or 1/4 the size of a string-chars block. It seems that -this was indeed the case formerly---indeed, the threshold was set at -1/8---but Mly forgot about this when rewriting things for 19.8.) +this was indeed the case formerly -- indeed, the threshold was set at +1/8 -- but Mly forgot about this when rewriting things for 19.8.) Note also that the string data in string-chars blocks is padded as necessary so that proper alignment constraints on the @code{struct @@ -5675,379 +5192,12 @@ The string compactor recognizes this special 0xFFFFFFFF marker and handles it correctly. -@node Compiled Function, , String, Allocation of Objects in XEmacs Lisp +@node Compiled Function @section Compiled Function Not yet documented. - -@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 +@node Events and the Event Loop, Evaluation; Stack Frames; Bindings, Allocation of Objects in XEmacs Lisp, Top @chapter Events and the Event Loop @menu @@ -6061,7 +5211,7 @@ * Dispatching Events; The Command Builder:: @end menu -@node Introduction to Events, Main Loop, Events and the Event Loop, Events and the Event Loop +@node Introduction to Events @section Introduction to Events An event is an object that encapsulates information about an @@ -6095,12 +5245,12 @@ nature of the most basic events that are received. Part of the complex nature of the XEmacs event collection process involves converting from the operating-system events into the proper -Emacs events---there may not be a one-to-one correspondence. +Emacs events -- there may not be a one-to-one correspondence. Emacs events are documented in @file{events.h}; I'll discuss them later. -@node Main Loop, Specifics of the Event Gathering Mechanism, Introduction to Events, Events and the Event Loop +@node Main Loop @section Main Loop The @dfn{command loop} is the top-level loop that the editor is always @@ -6120,7 +5270,7 @@ This is documented elsewhere. The guts of the command loop are in @code{command_loop_1()}. This -function doesn't catch errors, though---that's the job of +function doesn't catch errors, though -- that's the job of @code{command_loop_2()}, which is a condition-case (i.e. error-trapping) wrapper around @code{command_loop_1()}. @code{command_loop_1()} never returns, but may get thrown out of. @@ -6167,7 +5317,7 @@ invoking @code{top_level_1()}, just like when it invokes @code{command_loop_2()}. -@node Specifics of the Event Gathering Mechanism, Specifics About the Emacs Event, Main Loop, Events and the Event Loop +@node Specifics of the Event Gathering Mechanism @section Specifics of the Event Gathering Mechanism Here is an approximate diagram of the collection processes @@ -6406,13 +5556,13 @@ using `dispatch-event' @end example -@node Specifics About the Emacs Event, The Event Stream Callback Routines, Specifics of the Event Gathering Mechanism, Events and the Event Loop +@node Specifics About the Emacs Event @section Specifics About the Emacs Event -@node The Event Stream Callback Routines, Other Event Loop Functions, Specifics About the Emacs Event, Events and the Event Loop +@node The Event Stream Callback Routines @section The Event Stream Callback Routines -@node Other Event Loop Functions, Converting Events, The Event Stream Callback Routines, Events and the Event Loop +@node Other Event Loop Functions @section Other Event Loop Functions @code{detect_input_pending()} and @code{input-pending-p} look for @@ -6434,7 +5584,7 @@ the right kind of input method support, it is possible for (read-char) to return a Kanji character. -@node Converting Events, Dispatching Events; The Command Builder, Other Event Loop Functions, Events and the Event Loop +@node Converting Events @section Converting Events @code{character_to_event()}, @code{event_to_character()}, @@ -6445,7 +5595,7 @@ between character representation and the split-up event representation (keysym plus mod keys). -@node Dispatching Events; The Command Builder, , Converting Events, Events and the Event Loop +@node Dispatching Events; The Command Builder @section Dispatching Events; The Command Builder Not yet documented. @@ -6460,7 +5610,7 @@ * Catch and Throw:: @end menu -@node Evaluation, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings, Evaluation; Stack Frames; Bindings +@node Evaluation @section Evaluation @code{Feval()} evaluates the form (a Lisp object) that is passed to @@ -6529,13 +5679,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 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 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{execute_optimized_program()} can really fly. Here are some of the optimizations performed by the internal byte-code @@ -6550,7 +5700,7 @@ @code{nil}, or @code{keywordp}) symbols, so that the byte interpreter doesn't have to. @item -The maximum number of variable bindings in the byte-code is +The maxiumum 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 @@ -6590,7 +5740,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, Simple Special Forms, Evaluation, Evaluation; Stack Frames; Bindings +@node Dynamic Binding; The specbinding Stack; Unwind-Protects @section Dynamic Binding; The specbinding Stack; Unwind-Protects @example @@ -6644,7 +5794,7 @@ the symbol's value). @end enumerate -@node Simple Special Forms, Catch and Throw, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings +@node Simple Special Forms @section Simple Special Forms @code{or}, @code{and}, @code{if}, @code{cond}, @code{progn}, @@ -6656,12 +5806,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 exception of @code{Fprogn}, these functions are +Note that, with the exeption 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, , Simple Special Forms, Evaluation; Stack Frames; Bindings +@node Catch and Throw @section Catch and Throw @example @@ -6729,7 +5879,7 @@ * Symbol Values:: @end menu -@node Introduction to Symbols, Obarrays, Symbols and Variables, Symbols and Variables +@node Introduction to Symbols @section Introduction to Symbols A symbol is basically just an object with four fields: a name (a @@ -6746,7 +5896,7 @@ additional values with particular names, and once again the namespace is independent of the function and variable namespaces. -@node Obarrays, Symbol Values, Introduction to Symbols, Symbols and Variables +@node Obarrays @section Obarrays The identity of symbols with their names is accomplished through a @@ -6813,7 +5963,7 @@ into any obarray.) Finally, @code{mapatoms} maps over all of the symbols in an obarray. -@node Symbol Values, , Obarrays, Symbols and Variables +@node Symbol Values @section Symbol Values The value field of a symbol normally contains a Lisp object. However, @@ -6868,7 +6018,7 @@ * The Buffer Object:: The Lisp object corresponding to a buffer. @end menu -@node Introduction to Buffers, The Text in a Buffer, Buffers and Textual Representation, Buffers and Textual Representation +@node Introduction to Buffers @section Introduction to Buffers A buffer is logically just a Lisp object that holds some text. @@ -6921,7 +6071,7 @@ window. (This latter distinction is explained in detail in the section on windows.) -@node The Text in a Buffer, Buffer Lists, Introduction to Buffers, Buffers and Textual Representation +@node The Text in a Buffer @section The Text in a Buffer The text in a buffer consists of a sequence of zero or more @@ -7061,7 +6211,7 @@ number of possible alternative representations (e.g. EUC-encoded text, etc.). -@node Buffer Lists, Markers and Extents, The Text in a Buffer, Buffers and Textual Representation +@node Buffer Lists @section Buffer Lists Recall earlier that buffers are @dfn{permanent} objects, i.e. that @@ -7097,7 +6247,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, Bufbytes and Emchars, Buffer Lists, Buffers and Textual Representation +@node Markers and Extents @section Markers and Extents Among the things associated with a buffer are things that are @@ -7123,7 +6273,7 @@ buffer positions in them as integers, and every time text is inserted or deleted, these positions must be updated. In order to minimize the amount of shuffling that needs to be done, the positions in markers and -extents (there's one per marker, two per extent) are stored in Meminds. +extents (there's one per marker, two per extent) and 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 @@ -7137,12 +6287,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, The Buffer Object, Markers and Extents, Buffers and Textual Representation +@node Bufbytes and Emchars @section Bufbytes and Emchars Not yet documented. -@node The Buffer Object, , Bufbytes and Emchars, Buffers and Textual Representation +@node The Buffer Object @section The Buffer Object Buffers contain fields not directly accessible by the Lisp programmer. @@ -7261,7 +6411,7 @@ * CCL:: @end menu -@node Character Sets, Encodings, MULE Character Sets and Encodings, MULE Character Sets and Encodings +@node Character Sets @section Character Sets A character set (or @dfn{charset}) is an ordered set of characters. A @@ -7342,7 +6492,7 @@ This is a bit ad-hoc but gets the job done. -@node Encodings, Internal Mule Encodings, Character Sets, MULE Character Sets and Encodings +@node Encodings @section Encodings An @dfn{encoding} is a way of numerically representing characters from @@ -7369,7 +6519,7 @@ * JIS7:: @end menu -@node Japanese EUC (Extended Unix Code), JIS7, Encodings, Encodings +@node Japanese EUC (Extended Unix Code) @subsection Japanese EUC (Extended Unix Code) This encompasses the character sets Printing-ASCII, Japanese-JISX0201, @@ -7391,7 +6541,7 @@ @end example -@node JIS7, , Japanese EUC (Extended Unix Code), Encodings +@node JIS7 @subsection JIS7 This encompasses the character sets Printing-ASCII, @@ -7426,7 +6576,7 @@ Initially, Printing-ASCII is invoked. -@node Internal Mule Encodings, CCL, Encodings, MULE Character Sets and Encodings +@node Internal Mule Encodings @section Internal Mule Encodings In XEmacs/Mule, each character set is assigned a unique number, called a @@ -7472,7 +6622,7 @@ * Internal Character Encoding:: @end menu -@node Internal String Encoding, Internal Character Encoding, Internal Mule Encodings, Internal Mule Encodings +@node Internal String Encoding @subsection Internal String Encoding ASCII characters are encoded using their position code directly. Other @@ -7522,7 +6672,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, , Internal String Encoding, Internal Mule Encodings +@node Internal Character Encoding @subsection Internal Character Encoding One 19-bit word represents a single character. The word is @@ -7557,7 +6707,7 @@ Note that character codes 0 - 255 are the same as the ``binary encoding'' described above. -@node CCL, , Internal Mule Encodings, MULE Character Sets and Encodings +@node CCL @section CCL @example @@ -7611,7 +6761,7 @@ other encoded/decoded data has been written out. This is not used for charset CCL programs. -REGISTER: 0..7 -- referred by RRR or rrr +REGISTER: 0..7 -- refered by RRR or rrr OPERATOR BIT FIELD (27-bit): XXXXXXXXXXXXXXX RRR TTTTT TTTTT (5-bit): operator type @@ -7748,7 +6898,7 @@ * Lstream Methods:: Creating new lstream types. @end menu -@node Creating an Lstream, Lstream Types, Lstreams, Lstreams +@node Creating an Lstream @section Creating an Lstream Lstreams come in different types, depending on what is being interfaced @@ -7779,7 +6929,7 @@ Open for writing, but never writes partial MULE characters. @end table -@node Lstream Types, Lstream Functions, Creating an Lstream, Lstreams +@node Lstream Types @section Lstream Types @table @asis @@ -7804,10 +6954,10 @@ @item encoding @end table -@node Lstream Functions, Lstream Methods, Lstream Types, Lstreams +@node Lstream Functions @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 @@ -7840,8 +6990,8 @@ @deftypefn Macro void Lstream_ungetc (Lstream *@var{stream}, int @var{c}) Push one byte back onto the input queue. This will be the next byte read from the stream. Any number of bytes can be pushed back and will -be read in the reverse order they were pushed back---most recent -first. (This is necessary for consistency---if there are a number of +be read in the reverse order they were pushed back -- most recent +first. (This is necessary for consistency -- if there are a number of bytes that have been unread and I read and unread a byte, it needs to be the first to be read again.) This is a macro and so it is very efficient. The @var{c} argument is only evaluated once but the @var{stream} @@ -7854,18 +7004,18 @@ Function equivalents of the above macros. @end deftypefun -@deftypefun ssize_t Lstream_read (Lstream *@var{stream}, void *@var{data}, size_t @var{size}) +@deftypefun int Lstream_read (Lstream *@var{stream}, void *@var{data}, int @var{size}) Read @var{size} bytes of @var{data} from the stream. Return the number of bytes read. 0 means EOF. -1 means an error occurred and no bytes were read. @end deftypefun -@deftypefun ssize_t Lstream_write (Lstream *@var{stream}, void *@var{data}, size_t @var{size}) +@deftypefun int Lstream_write (Lstream *@var{stream}, void *@var{data}, int @var{size}) Write @var{size} bytes of @var{data} to the stream. Return the number of bytes written. -1 means an error occurred and no bytes were written. @end deftypefun -@deftypefun void Lstream_unread (Lstream *@var{stream}, void *@var{data}, size_t @var{size}) +@deftypefun void Lstream_unread (Lstream *@var{stream}, void *@var{data}, int @var{size}) Push back @var{size} bytes of @var{data} onto the input queue. The next call to @code{Lstream_read()} with the same size will read the same bytes back. Note that this will be the case even if there is other @@ -7879,7 +7029,7 @@ @deftypefun void Lstream_reopen (Lstream *@var{stream}) Reopen a closed stream. This enables I/O on it again. This is not meant to be called except from a wrapper routine that reinitializes -variables and such---the close routine may well have freed some +variables and such -- the close routine may well have freed some necessary storage structures, for example. @end deftypefun @@ -7887,10 +7037,10 @@ Rewind the stream to the beginning. @end deftypefun -@node Lstream Methods, , Lstream Functions, Lstreams +@node Lstream Methods @section Lstream Methods -@deftypefn {Lstream Method} ssize_t reader (Lstream *@var{stream}, unsigned char *@var{data}, size_t @var{size}) +@deftypefn {Lstream Method} int reader (Lstream *@var{stream}, unsigned char *@var{data}, int @var{size}) Read some data from the stream's end and store it into @var{data}, which can hold @var{size} bytes. Return the number of bytes read. A return value of 0 means no bytes can be read at this time. This may be because @@ -7907,7 +7057,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} int writer (Lstream *@var{stream}, CONST unsigned char *@var{data}, int @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 @@ -7925,7 +7075,7 @@ @end deftypefn @deftypefn {Lstream Method} int seekable_p (Lstream *@var{stream}) -Indicate whether this stream is seekable---i.e. it can be rewound. +Indicate whether this stream is seekable -- i.e. it can be rewound. This method is ignored if the stream does not have a rewind method. If this method is not present, the result is determined by whether a rewind method is present. @@ -7962,7 +7112,7 @@ * The Window Object:: @end menu -@node Introduction to Consoles; Devices; Frames; Windows, Point, Consoles; Devices; Frames; Windows, Consoles; Devices; Frames; Windows +@node Introduction to Consoles; Devices; Frames; Windows @section Introduction to Consoles; Devices; Frames; Windows A window-system window that you see on the screen is called a @@ -7997,14 +7147,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 remembers the ``selected'' object +Note that every containing object rememembers 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, Window Hierarchy, Introduction to Consoles; Devices; Frames; Windows, Consoles; Devices; Frames; Windows +@node Point @section Point Recall that every buffer has a current insertion position, called @@ -8025,7 +7175,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, The Window Object, Point, Consoles; Devices; Frames; Windows +@node Window Hierarchy @section Window Hierarchy @cindex window hierarchy @cindex hierarchy of windows @@ -8094,7 +7244,7 @@ @item Leaf windows also have markers in their @code{start} (the first buffer position displayed in the window) and @code{pointm} -(the window's stashed value of @code{point}---see above) fields, +(the window's stashed value of @code{point} -- see above) fields, while combination windows have nil in these fields. @item @@ -8110,7 +7260,7 @@ GC purposes. @item -Most frames actually have two top-level windows---one for the +Most frames actually have two top-level windows -- one for the minibuffer and one (the @dfn{root}) for everything else. The modeline (if present) separates these two. The @code{next} field of the root points to the minibuffer, and the @code{prev} field of the minibuffer @@ -8123,7 +7273,7 @@ artifact that should be fixed.) @end enumerate -@node The Window Object, , Window Hierarchy, Consoles; Devices; Frames; Windows +@node The Window Object @section The Window Object Windows have the following accessible fields: @@ -8252,10 +7402,9 @@ @menu * Critical Redisplay Sections:: * Line Start Cache:: -* Redisplay Piece by Piece:: @end menu -@node Critical Redisplay Sections, Line Start Cache, The Redisplay Mechanism, The Redisplay Mechanism +@node Critical Redisplay Sections @section Critical Redisplay Sections @cindex critical redisplay sections @@ -8287,7 +7436,7 @@ #### If a frame-size change does occur we should probably actually be preempting redisplay. -@node Line Start Cache, Redisplay Piece by Piece, Critical Redisplay Sections, The Redisplay Mechanism +@node Line Start Cache @section Line Start Cache @cindex line start cache @@ -8331,7 +7480,7 @@ is sufficient to always provide the needed information. The second thing we can do is be smart about invalidating the cache. - TODO---Be smart about invalidating the cache. Potential places: + TODO -- Be smart about invalidating the cache. Potential places: @itemize @bullet @item @@ -8348,58 +7497,7 @@ In case you're wondering, the Second Golden Rule of Redisplay is not applicable. -@node Redisplay Piece by Piece, , Line Start Cache, The Redisplay Mechanism -@section Redisplay Piece by Piece -@cindex Redisplay Piece by Piece - -As you can begin to see redisplay is complex and also not well -documented. Chuck no longer works on XEmacs so this section is my take -on the workings of redisplay. - -Redisplay happens in three phases: - -@enumerate -@item -Determine desired display in area that needs redisplay. -Implemented by @code{redisplay.c} -@item -Compare desired display with current display -Implemented by @code{redisplay-output.c} -@item -Output changes Implemented by @code{redisplay-output.c}, -@code{redisplay-x.c}, @code{redisplay-msw.c} and @code{redisplay-tty.c} -@end enumerate - -Steps 1 and 2 are device-independent and relatively complex. Step 3 is -mostly device-dependent. - -Determining the desired display - -Display attributes are stored in @code{display_line} structures. Each -@code{display_line} consists of a set of @code{display_block}'s and each -@code{display_block} contains a number of @code{rune}'s. Generally -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 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 -display code has many bugs that the standard redisplay code does not. - -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. - -Gutter redisplay is different. Because the data to display is stored in -a string we cannot use @code{create_text_block}. Instead we use -@code{create_text_string_block} which performs the same function as -@code{create_text_block} but for strings. Many of the complexities of -@code{create_text_block} to do with cursor handling and selective -display have been removed. - -@node Extents, Faces, The Redisplay Mechanism, Top +@node Extents, Faces and Glyphs, The Redisplay Mechanism, Top @chapter Extents @menu @@ -8407,11 +7505,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, Extent Ordering, Extents, Extents +@node Introduction to Extents @section Introduction to Extents Extents are regions over a buffer, with a start and an end position @@ -8433,7 +7531,7 @@ however, and just ended up complexifying and buggifying all the rest of the code.) -@node Extent Ordering, Format of the Extent Info, Introduction to Extents, Extents +@node Extent Ordering @section Extent Ordering Extents are compared using memory indices. There are two orderings @@ -8467,13 +7565,13 @@ 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, Zero-Length Extents, Extent Ordering, Extents +@node Format of the Extent Info @section Format of the Extent Info An extent-info structure consists of a list of the buffer or string's extents and a @dfn{stack of extents} that lists all of the extents over a particular position. The stack-of-extents info is used for -optimization purposes---it basically caches some info that might +optimization purposes -- it basically caches some info that might be expensive to compute. Certain otherwise hard computations are easy given the stack of extents over a particular position, and if the stack of extents over a nearby position is known (because it was @@ -8501,7 +7599,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, Mathematics of Extent Ordering, Format of the Extent Info, Extents +@node Zero-Length Extents @section Zero-Length Extents Extents can be zero-length, and will end up that way if their endpoints @@ -8530,7 +7628,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, Extent Fragments, Zero-Length Extents, Extents +@node Mathematics of Extent Ordering @section Mathematics of Extent Ordering @cindex extent mathematics @cindex mathematics of extents @@ -8665,7 +7763,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, , Mathematics of Extent Ordering, Extents +@node Extent Fragments @section Extent Fragments @cindex extent fragment @@ -8675,7 +7773,7 @@ An extent fragment is a structure that holds data about the run that contains a particular buffer position (if the buffer position is at the -junction of two runs, the run after the position is used)---the +junction of two runs, the run after the position is used) -- the beginning and end of the run, a list of all of the extents in that run, the @dfn{merged face} that results from merging all of the faces corresponding to those extents, the begin and end glyphs at the @@ -8687,74 +7785,12 @@ stack-of-extents code, which does the heavy-duty algorithmic work of determining which extents overly a particular position. -@node Faces, Glyphs, Extents, Top -@chapter Faces +@node Faces and Glyphs, Specifiers, Extents, Top +@chapter Faces and Glyphs Not yet documented. -@node Glyphs, Specifiers, Faces, Top -@chapter Glyphs - -Glyphs are graphical elements that can be displayed in XEmacs buffers or -gutters. We use the term graphical element here in the broadest possible -sense since glyphs can be as mundane as text to as arcane as a native -tab widget. - -In XEmacs, glyphs represent the uninstantiated state of graphical -elements, i.e. they hold all the information necessary to produce an -image on-screen but the image does not exist at this stage. - -Glyphs are lazily instantiated by calling one of the glyph -functions. This usually occurs within redisplay when -@code{Fglyph_height} is called. Instantiation causes an image-instance -to be created and cached. This cache is on a device basis for all glyphs -except glyph-widgets, and on a window basis for glyph widgets. The -caching is done by @code{image_instantiate} and is necessary because it -is generally possible to display an image-instance in multiple -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 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 -because widget-glyph image-instances on screen are toolkit windows, and -thus cannot be reused in multiple XEmacs domains. Thus widget-glyphs are -cached on a window basis. - -Any action on a glyph first consults the cache before actually -instantiating a widget. - -@section Widget-Glyphs in the MS-Windows Environment - -To Do - -@section Widget-Glyphs in the X Environment - -Widget-glyphs under X make heavy use of lwlib for manipulating the -native toolkit objects. This is primarily so that different toolkits can -be supported for widget-glyphs, just as they are supported for features -such as menubars etc. - -Lwlib is extremely poorly documented and quite hairy so here is my -understanding of what goes on. - -Lwlib maintains a set of widget_instances which mirror the hierarchical -state of Xt widgets. I think this is so that widgets can be updated and -manipulated generically by the lwlib library. For instance -update_one_widget_instance can cope with multiple types of widget and -multiple types of toolkit. Each element in the widget hierarchy is updated -from its corresponding widget_instance by walking the widget_instance -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 -without having to know what the widget is or what toolkit it is from. -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. - -@node Specifiers, Menus, Glyphs, Top +@node Specifiers, Menus, Faces and Glyphs, Top @chapter Specifiers Not yet documented. @@ -8884,7 +7920,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. @@ -8897,3 +7933,4 @@ @c That's all @bye + diff -r 12e008d41344 -r 697ef44129c6 man/lispref/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,80 @@ +# Makefile for the XEmacs Lisp Programmer's Manual. + +# 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. + +VERSION=2.4 +NAME=lispref +manual = elisp-manual-19-$(VERSION) + +TEXI2DVI = texi2dvi +MAKEINFO = makeinfo + +# Uncomment this line for permuted index. +# permuted_index = 1 + +# List of all the texinfo files in the manual: + +srcs = abbrevs.texi annotations.texi back.texi backups.texi buffers.texi \ + building.texi commands.texi compile.texi consoles-devices.texi control.texi \ + databases.texi debugging.texi dialog.texi display.texi edebug-inc.texi \ + edebug.texi errors.texi eval.texi extents.texi faces.texi files.texi \ + frames.texi functions.texi glyphs.texi hash-tables.texi help.texi \ + hooks.texi index.texi internationalization.texi intro.texi \ + keymaps.texi ldap.texi lispref.texi lists.texi loading.texi locals.texi \ + macros.texi maps.texi markers.texi menus.texi minibuf.texi modes.texi \ + mouse.texi mule.texi numbers.texi objects.texi os.texi positions.texi \ + processes.texi range-tables.texi scrollbars.texi searching.texi \ + sequences.texi specifiers.texi streams.texi strings.texi symbols.texi \ + syntax.texi text.texi tips.texi toolbar.texi tooltalk.texi variables.texi \ + windows.texi x-windows.texi index.unperm index.perm + +all : info +info : ../../info/$(NAME).info + +../../info/$(NAME).info: $(srcs) index.texi + $(MAKEINFO) -o $@ $(NAME).texi + +dvi: $(NAME).dvi + +$(NAME).dvi: $(srcs) index.texi + # Avoid losing old contents of aux file entirely. + -mv $(NAME).aux $(NAME).oaux + # First shot to define xrefs: + $(TEX) $(NAME).texi + if [ a${permuted_index} != a ]; \ + then ./permute-index && mv permuted.fns $(NAME).fns; \ + else texindex $(NAME).??; \ + fi + $(TEX) $(NAME).texi + +index.texi: + if [ a${permuted_index} != a ]; \ + then ln -s index.perm index.texi; \ + else ln -s index.unperm index.texi; \ + fi + +.PHONY: mostlyclean clean distclean realclean extraclean +mostlyclean: + rm -f *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \ + *.vr *.vrs *.pg *.pgs *.ky *.kys +clean: mostlyclean + rm -f *.dvi *.ps make.out core index.texi +distclean: clean +realclean: distclean +extraclean: distclean + -rm -f *~ \#* diff -r 12e008d41344 -r 697ef44129c6 man/lispref/backups.texi --- a/man/lispref/backups.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/backups.texi Mon Aug 13 11:20:41 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 delete-old-versions +@defopt trim-versions-without-asking 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 12e008d41344 -r 697ef44129c6 man/lispref/commands.texi --- a/man/lispref/commands.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/commands.texi Mon Aug 13 11:20:41 2007 +0200 @@ -874,7 +874,7 @@ @item channel @item timestamp @item key - Which key was pressed. This is an integer (in the printing @sc{ascii} + Which key was pressed. This is an integer (in the printing @sc{ASCII} range: >32 and <127) or a symbol such as @code{left} or @code{right}. Note that many physical keys are actually treated as two separate keys, depending on whether the shift key is pressed; for example, the ``a'' @@ -1252,7 +1252,7 @@ @defun event-key event This function returns the Keysym of the given key-press event. -This will be the @sc{ascii} code of a printing character, or a symbol. +This will be the @sc{ASCII} code of a printing character, or a symbol. @end defun @defun event-button event @@ -1450,13 +1450,13 @@ XEmacs provides some auxiliary functions for converting between events and other ways of representing keys. These are useful when working with -@sc{ascii} strings and with keymaps. +@sc{ASCII} strings and with keymaps. @defun character-to-event ch &optional event device -This function converts a numeric @sc{ascii} value to an event structure, +This function converts a numeric @sc{ASCII} value to an event structure, replete with modifier bits. @var{ch} is the character to convert, and @var{event} is the event object to fill in. This function contains -knowledge about what the codes ``mean''---for example, the number 9 is +knowledge about what the codes ``mean'' -- for example, the number 9 is converted to the character @key{Tab}, not the distinct character @key{Control-I}. @@ -1474,19 +1474,19 @@ Beware that @code{character-to-event} and @code{event-to-character} are not strictly inverse functions, since events contain much more -information than the @sc{ascii} character set can encode. +information than the @sc{ASCII} character set can encode. @end defun @defun event-to-character event &optional allow-extra-modifiers allow-meta allow-non-ascii -This function returns the closest @sc{ascii} approximation to +This function returns the closest @sc{ASCII} approximation to @var{event}. If the event isn't a keypress, this returns @code{nil}. If @var{allow-extra-modifiers} is non-@code{nil}, then this is lenient in its translation; it will ignore modifier keys other than @key{control} and @key{meta}, and will ignore the @key{shift} modifier -on those characters which have no shifted @sc{ascii} equivalent +on those characters which have no shifted @sc{ASCII} equivalent (@key{Control-Shift-A} for example, will be mapped to the same -@sc{ascii} code as @key{Control-A}). +@sc{ASCII} code as @key{Control-A}). If @var{allow-meta} is non-@code{nil}, then the @key{Meta} modifier will be represented by turning on the high bit of the byte returned; @@ -1497,7 +1497,7 @@ present in the prevailing character set (@pxref{Keymaps, variable @code{character-set-property}}) will be returned as their code in that character set, instead of the return value being restricted to -@sc{ascii}. +@sc{ASCII}. Note that specifying both @var{allow-meta} and @var{allow-non-ascii} is ambiguous, as both use the high bit; @key{M-x} and @key{oslash} will be @@ -1506,7 +1506,7 @@ @defun events-to-keys events &optional no-mice Given a vector of event objects, this function returns a vector of key -descriptors, or a string (if they all fit in the @sc{ascii} range). +descriptors, or a string (if they all fit in the @sc{ASCII} range). Optional arg @var{no-mice} means that button events are not allowed. @end defun @@ -1632,13 +1632,13 @@ @lisp @group - (while (progn - (next-event event) - (not (or (key-press-event-p event) - (button-press-event-p event) - (button-release-event-p event) - (menu-event-p event)))) - (dispatch-event event)) + (while (progn + (next-event event) + (not (or (key-press-event-p event) + (button-press-event-p event) + (button-release-event-p event) + (menu-event-p event)))) + (dispatch-event event)) @end group @end lisp @@ -1656,7 +1656,7 @@ @defun read-char This function reads and returns a character of command input. If a mouse click is detected, an error is signalled. The character typed is -returned as an @sc{ascii} value. This function is retained for +returned as an @sc{ASCII} value. This function is retained for compatibility with Emacs 18, and is most likely the wrong thing for you to be using: consider using @code{next-command-event} instead. @end defun @@ -1803,8 +1803,8 @@ @defvar last-input-char If the value of @code{last-input-event} is a keyboard event, then this -is the nearest @sc{ascii} equivalent to it. Remember that there is -@emph{not} a 1:1 mapping between keyboard events and @sc{ascii} +is the nearest @sc{ASCII} equivalent to it. Remember that there is +@emph{not} a 1:1 mapping between keyboard events and @sc{ASCII} characters: the set of keyboard events is much larger, so writing code that examines this variable to determine what key has been typed is bad practice, unless you are certain that it will be one of a small set of diff -r 12e008d41344 -r 697ef44129c6 man/lispref/compile.texi --- a/man/lispref/compile.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/compile.texi Mon Aug 13 11:20:41 2007 +0200 @@ -235,7 +235,7 @@ will not, of course, produce any compiled code.) @example -% xemacs -batch -f batch-byte-compile *.el +% emacs -batch -f batch-byte-compile *.el @end example @end defun diff -r 12e008d41344 -r 697ef44129c6 man/lispref/consoles-devices.texi --- a/man/lispref/consoles-devices.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/consoles-devices.texi Mon Aug 13 11:20:41 2007 +0200 @@ -11,7 +11,7 @@ A @dfn{console} is an object representing a single input connection to XEmacs, such as an X display or a TTY connection. It is possible for XEmacs to have frames on multiple consoles at once (even on -heterogeneous types---you can simultaneously have a frame on an +heterogeneous types -- you can simultaneously have a frame on an X display and a TTY connection). Normally, there is only one console in existence. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/control.texi --- a/man/lispref/control.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/control.texi Mon Aug 13 11:20:41 2007 +0200 @@ -662,7 +662,7 @@ which you call for other purposes, such as if you try to take the @sc{car} of an integer or move forward a character at the end of the buffer; you can also signal errors explicitly with the functions -@code{error}, @code{signal}, and others. +@code{error} and @code{signal}. Quitting, which happens when the user types @kbd{C-g}, is not considered an error, but it is handled almost like an error. @@ -673,11 +673,6 @@ applying @code{format} (@pxref{String Conversion}) to @var{format-string} and @var{args}. -This error is not continuable: you cannot continue execution after the -error using the debugger @kbd{r} or @kbd{c} commands. If you wish the -user to be able to continue execution, use @code{cerror} or -@code{signal} instead. - These examples show typical uses of @code{error}: @example @@ -696,8 +691,7 @@ @code{error} works by calling @code{signal} with two arguments: the error symbol @code{error}, and a list containing the string returned by -@code{format}. This is repeated in an endless loop, to ensure that -@code{error} never returns. +@code{format}. If you want to use your own string as an error message verbatim, don't just write @code{(error @var{string})}. If @var{string} contains @@ -705,16 +699,10 @@ results. Instead, use @code{(error "%s" @var{string})}. @end defun -@defun cerror format-string &rest args -This function behaves like @code{error}, except that the error it -signals is continuable. That means that debugger commands @kbd{c} and -@kbd{r} can resume execution. -@end defun - @defun signal error-symbol data -This function signals a continuable error named by @var{error-symbol}. -The argument @var{data} is a list of additional Lisp objects relevant to -the circumstances of the error. +This function signals an error named by @var{error-symbol}. The +argument @var{data} is a list of additional Lisp objects relevant to the +circumstances of the error. The argument @var{error-symbol} must be an @dfn{error symbol}---a symbol bearing a property @code{error-conditions} whose value is a list of @@ -722,9 +710,9 @@ errors. The number and significance of the objects in @var{data} depends on -@var{error-symbol}. For example, with a @code{wrong-type-argument} -error, there are two objects in the list: a predicate that describes the -type that was expected, and the object that failed to fit that type. +@var{error-symbol}. For example, with a @code{wrong-type-arg} error, +there are two objects in the list: a predicate that describes the type +that was expected, and the object that failed to fit that type. @xref{Error Symbols}, for a description of error symbols. Both @var{error-symbol} and @var{data} are available to any error @@ -733,10 +721,8 @@ @var{data})} (@pxref{Handling Errors}). If the error is not handled, these two values are used in printing the error message. -The function @code{signal} can return, if the debugger is invoked and -the user invokes the ``return from signal'' option. If you want the -error not to be continuable, use @code{signal-error} instead. Note that -in FSF Emacs @code{signal} never returns. +The function @code{signal} never returns (though in older Emacs versions +it could sometimes return). @smallexample @group @@ -745,42 +731,17 @@ @end group @group -(signal 'no-such-error '("My unknown error condition")) - @error{} Peculiar error (no-such-error "My unknown error condition") +(signal 'no-such-error '("My unknown error condition.")) + @error{} peculiar error: "My unknown error condition." @end group @end smallexample @end defun -@defun signal-error error-symbol data -This function behaves like @code{signal}, except that the error it -signals is not continuable. -@end defun - -@defmac check-argument-type predicate argument -This macro checks that @var{argument} satisfies @var{predicate}. If -that is not the case, it signals a continuable -@code{wrong-type-argument} error until the returned value satisfies -@var{predicate}, and assigns the returned value to @var{argument}. In -other words, execution of the program will not continue until -@var{predicate} is met. - -@var{argument} is not evaluated, and should be a symbol. -@var{predicate} is evaluated, and should name a function. - -As shown in the following example, @code{check-argument-type} is useful -in low-level code that attempts to ensure the sanity of its data before -proceeding. - -@example -@group -(defun cache-object-internal (object wlist) - ;; @r{Before doing anything, make sure that @var{wlist} is indeed} - ;; @r{a weak list, which is what we expect.} - (check-argument-type 'weak-list-p wlist) - @dots{}) -@end group -@end example -@end defmac +@cindex CL note---no continuable errors +@quotation +@b{Common Lisp note:} XEmacs Lisp has nothing like the Common Lisp +concept of continuable errors. +@end quotation @node Processing of Errors @subsubsection How XEmacs Processes Errors @@ -800,27 +761,6 @@ command loop's handler uses the error symbol and associated data to print an error message. -Errors in command loop are processed using the @code{command-error} -function, which takes care of some necessary cleanup, and prints a -formatted error message to the echo area. The functions that do the -formatting are explained below. - -@defun display-error error-object stream -This function displays @var{error-object} on @var{stream}. -@var{error-object} is a cons of error type, a symbol, and error -arguments, a list. If the error type symbol of one of its error -condition superclasses has an @code{display-error} property, that -function is invoked for printing the actual error message. Otherwise, -the error is printed as @samp{Error: arg1, arg2, ...}. -@end defun - -@defun error-message-string error-object -This function converts @var{error-object} to an error message string, -and returns it. The message is equivalent to the one that would be -printed by @code{display-error}, except that it is conveniently returned -in string form. -@end defun - @cindex @code{debug-on-error} use An error that has no explicit handler may call the Lisp debugger. The debugger is enabled if the variable @code{debug-on-error} (@pxref{Error @@ -894,13 +834,6 @@ totally unpredictable, such as when the program evaluates an expression read from the user. -@cindex @code{debug-on-signal} use - Even when an error is handled, the debugger may still be called if the -variable @code{debug-on-signal} (@pxref{Error Debugging}) is -non-@code{nil}. Note that this may yield unpredictable results with -code that traps expected errors as normal part of its operation. Do not -set @code{debug-on-signal} unless you know what you are doing. - Error signaling and handling have some resemblance to @code{throw} and @code{catch}, but they are entirely separate facilities. An error cannot be caught by a @code{catch}, and a @code{throw} cannot be handled @@ -984,9 +917,7 @@ @end smallexample @noindent -The handler specifies condition name @code{arith-error} so that it will -handle only division-by-zero errors. Other kinds of errors will not be -handled, at least not by this @code{condition-case}. Thus, +The handler specifies condition name @code{arith-error} so that it will handle only division-by-zero errors. Other kinds of errors will not be handled, at least not by this @code{condition-case}. Thus, @smallexample @group @@ -1041,49 +972,43 @@ is distinct from @code{error}, and perhaps some intermediate classifications. - In other words, each error condition @dfn{inherits} from another error -condition, with @code{error} sitting at the top of the inheritance -hierarchy. - -@defun define-error error-symbol error-message &optional inherits-from - This function defines a new error, denoted by @var{error-symbol}. -@var{error-message} is an informative message explaining the error, and -will be printed out when an unhandled error occurs. @var{error-symbol} -is a sub-error of @var{inherits-from} (which defaults to @code{error}). + In order for a symbol to be an error symbol, it must have an +@code{error-conditions} property which gives a list of condition names. +This list defines the conditions that this kind of error belongs to. +(The error symbol itself, and the symbol @code{error}, should always be +members of this list.) Thus, the hierarchy of condition names is +defined by the @code{error-conditions} properties of the error symbols. - @code{define-error} internally works by putting on @var{error-symbol} -an @code{error-message} property whose value is @var{error-message}, and -an @code{error-conditions} property that is a list of @var{error-symbol} -followed by each of its super-errors, up to and including @code{error}. -You will sometimes see code that sets this up directly rather than -calling @code{define-error}, but you should @emph{not} do this yourself, -unless you wish to maintain compatibility with FSF Emacs, which does not -provide @code{define-error}. -@end defun + In addition to the @code{error-conditions} list, the error symbol +should have an @code{error-message} property whose value is a string to +be printed when that error is signaled but not handled. If the +@code{error-message} property exists, but is not a string, the error +message @samp{peculiar error} is used. +@cindex peculiar error - Here is how we define a new error symbol, @code{new-error}, that -belongs to a range of errors called @code{my-own-errors}: + Here is how we define a new error symbol, @code{new-error}: @example @group -(define-error 'my-own-errors "A whole range of errors" 'error) -(define-error 'new-error "A new error" 'my-own-errors) +(put 'new-error + 'error-conditions + '(error my-own-errors new-error)) +@result{} (error my-own-errors new-error) +@end group +@group +(put 'new-error 'error-message "A new error") +@result{} "A new error" @end group @end example @noindent -@code{new-error} has three condition names: @code{new-error}, the -narrowest classification; @code{my-own-errors}, which we imagine is a -wider classification; and @code{error}, which is the widest of all. - - Note that it is not legal to try to define an error unless its -super-error is also defined. For instance, attempting to define -@code{new-error} before @code{my-own-errors} are defined will signal an -error. +This error has three condition names: @code{new-error}, the narrowest +classification; @code{my-own-errors}, which we imagine is a wider +classification; and @code{error}, which is the widest of all. The error string should start with a capital letter but it should not end with a period. This is for consistency with the rest of Emacs. - + Naturally, XEmacs will never signal @code{new-error} on its own; only an explicit call to @code{signal} (@pxref{Signaling Errors}) in your code can do this: @@ -1119,8 +1044,6 @@ when you write an error handler. Using error symbols alone would eliminate all but the narrowest level of classification. - - @xref{Standard Errors}, for a list of all the standard error symbols and their conditions. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/customize.texi --- a/man/lispref/customize.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/customize.texi Mon Aug 13 11:20:41 2007 +0200 @@ -262,7 +262,7 @@ (defcustom show-paren-mode nil "Toggle Show Paren mode@enddots{}" :set (lambda (symbol value) - (show-paren-mode (or value 0))) + (show-paren-mode (or value 0))) :initialize 'custom-initialize-default :type 'boolean :group 'paren-showing diff -r 12e008d41344 -r 697ef44129c6 man/lispref/databases.texi --- a/man/lispref/databases.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/databases.texi Mon Aug 13 11:20:41 2007 +0200 @@ -31,7 +31,7 @@ support both of these types.) For a @var{type} of @code{'dbm}, there are no subtypes, so -@var{subtype} should be @code{nil}. +@var{subtype} should by @code{nil}. For a @var{type} of @code{'berkeley_db}, the following subtypes are available: @code{'hash}, @code{'btree}, and @code{'recno}. See the diff -r 12e008d41344 -r 697ef44129c6 man/lispref/debugging.texi --- a/man/lispref/debugging.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/debugging.texi Mon Aug 13 11:20:41 2007 +0200 @@ -95,12 +95,6 @@ errors also can invoke the debugger. @xref{Processes}. @end defopt -@defopt debug-on-signal -This variable is similar to @code{debug-on-error} but breaks -whenever an error is signalled, regardless of whether it would be -handled. -@end defopt - @defopt debug-ignored-errors This variable specifies certain kinds of errors that should not enter the debugger. Its value is a list of error condition symbols and/or @@ -130,6 +124,12 @@ '(lambda () (setq debug-on-error t))) @end example +@defopt debug-on-signal +This variable is similar to @code{debug-on-error} but breaks +whenever an error is signalled, regardless of whether it would be +handled. +@end defopt + @node Infinite Loops @subsection Debugging Infinite Loops @cindex infinite loops diff -r 12e008d41344 -r 697ef44129c6 man/lispref/dialog.texi --- a/man/lispref/dialog.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/dialog.texi Mon Aug 13 11:20:41 2007 +0200 @@ -44,15 +44,15 @@ The syntax, more precisely: @example - form := <something to pass to `eval'> - command := <a symbol or string, to pass to `call-interactively'> - callback := command | form - active-p := <t, nil, or a form to evaluate to decide whether this - button should be selectable> - name := <string> - partition := 'nil' - button := '[' name callback active-p ']' - dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')' + form := <something to pass to `eval'> + command := <a symbol or string, to pass to `call-interactively'> + callback := command | form + active-p := <t, nil, or a form to evaluate to decide whether this + button should be selectable> + name := <string> + partition := 'nil' + button := '[' name callback active-p ']' + dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')' @end example @node Dialog Box Functions diff -r 12e008d41344 -r 697ef44129c6 man/lispref/display.texi --- a/man/lispref/display.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/display.texi Mon Aug 13 11:20:41 2007 +0200 @@ -874,13 +874,13 @@ All other codes in the range 0 through 31, and code 127, display in one of two ways according to the value of @code{ctl-arrow}. If it is non-@code{nil}, these codes map to sequences of two glyphs, where the -first glyph is the @sc{ascii} code for @samp{^}. (A display table can +first glyph is the @sc{ASCII} code for @samp{^}. (A display table can specify a glyph to use instead of @samp{^}.) Otherwise, these codes map just like the codes in the range 128 to 255. @item Character codes 128 through 255 map to sequences of four glyphs, where -the first glyph is the @sc{ascii} code for @samp{\}, and the others are +the first glyph is the @sc{ASCII} code for @samp{\}, and the others are digit characters representing the code in octal. (A display table can specify a glyph to use instead of @samp{\}.) @end itemize @@ -921,7 +921,7 @@ @cindex display table You can use the @dfn{display table} feature to control how all 256 possible character codes display on the screen. This is useful for -displaying European languages that have letters not in the @sc{ascii} +displaying European languages that have letters not in the @sc{ASCII} character set. The display table maps each character code into a sequence of @@ -996,71 +996,6 @@ 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}. @@ -1105,9 +1040,9 @@ @end example If you are editing buffers written in the ISO Latin 1 character set and -your terminal doesn't handle anything but @sc{ascii}, you can load the +your terminal doesn't handle anything but @sc{ASCII}, you can load the file @file{iso-ascii} to set up a display table that displays the other -ISO characters as explanatory sequences of @sc{ascii} characters. For +ISO characters as explanatory sequences of @sc{ASCII} characters. For example, the character ``o with umlaut'' displays as @samp{@{"o@}}. Some European countries have terminals that don't support ISO Latin 1 diff -r 12e008d41344 -r 697ef44129c6 man/lispref/extents.texi --- a/man/lispref/extents.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/extents.texi Mon Aug 13 11:20:41 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 is +@dfn{detached} (i.e. no longer in the buffer) when all its text its deleted. Otherwise, it will simply shrink down to zero-length and -sit in the same place in the buffer. By default, the @code{detachable} +sit it 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 @@ -286,7 +286,7 @@ The following low-level functions are provided for explicitly traversing the extents in a buffer according to the display order. -These functions are mostly intended for debugging---in normal +These functions are mostly intended for debugging -- in normal operation, you should probably use @code{mapcar-extents} or @code{map-extents}, or loop using the @var{before} argument to @code{extent-at}, rather than creating a loop using @code{next-extent}. @@ -778,7 +778,7 @@ It is possible for an extent's parent to itself have a parent, and so on. Through this, a whole tree of extents can be created, all deriving their properties from one root extent. Note, however, -that you cannot create an inheritance loop---this is explicitly +that you cannot create an inheritance loop -- this is explicitly disallowed. Parent extents are used to implement the extents over the modeline. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/faces.texi --- a/man/lispref/faces.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/faces.texi Mon Aug 13 11:20:41 2007 +0200 @@ -248,21 +248,6 @@ specifier. @end defun -@defun remove-face-property face property &optional local tag-set exact-p -This function removes a property of a @var{face}. - -For built-in properties, this is analogous to @code{remove-specifier}. -For more information, @xref{Other Specification Functions}. - -When @var{property} is not a built-in property, this function will just -remove its value if @var{locale} is @code{nil} or @code{all}. However, -if @var{locale} is other than that, this function will attempt to remove -@var{value} as the instantiator for the given @var{locale} with -@code{remove-specifier}. If the value of the property is not a -specifier, it will be converted into a @code{generic} specifier -automatically. -@end defun - @defun face-property face property &optional locale This function returns @var{face}'s value of the given @var{property}. @@ -476,33 +461,6 @@ @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 @@ -661,63 +619,6 @@ 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 @@ -771,7 +672,7 @@ @end defun @defun color-rgb-components color &optional domain -This function returns the @sc{rgb} components of the @var{color} in the +This function returns the @sc{RGB} components of the @var{color} in the specified @var{domain}, if any. @var{color} should be a color specifier object and @var{domain} is normally a window and defaults to the selected window if omitted. This is equivalent to using diff -r 12e008d41344 -r 697ef44129c6 man/lispref/frames.texi --- a/man/lispref/frames.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/frames.texi Mon Aug 13 11:20:41 2007 +0200 @@ -9,19 +9,9 @@ @cindex frame A @var{frame} is a rectangle on the screen that contains one or more -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.) +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. @cindex terminal frame @cindex X window frame diff -r 12e008d41344 -r 697ef44129c6 man/lispref/functions.texi --- a/man/lispref/functions.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/functions.texi Mon Aug 13 11:20:41 2007 +0200 @@ -680,21 +680,18 @@ @cindex mapping functions A @dfn{mapping function} applies a given function to each element of a -list or other collection. XEmacs Lisp has several such functions; +list or other collection. XEmacs Lisp has three such functions; @code{mapcar} and @code{mapconcat}, which scan a list, are described -here. @xref{Creating Symbols}, for the function @code{mapatoms} which -maps over the symbols in an obarray. - -Mapping functions should never modify the sequence being mapped over. -The results are unpredictable. +here. For the third mapping function, @code{mapatoms}, see +@ref{Creating Symbols}. @defun mapcar function sequence @code{mapcar} applies @var{function} to each element of @var{sequence} in turn, and returns a list of the results. -The argument @var{sequence} can be any kind of sequence; that is, a -list, a vector, a bit vector, or a string. The result is always a list. -The length of the result is the same as the length of @var{sequence}. +The argument @var{sequence} may be a list, a vector, or a string. The +result is always a list. The length of the result is the same as the +length of @var{sequence}. @smallexample @group @@ -719,7 +716,7 @@ Return the list of results." ;; @r{If no list is exhausted,} (if (not (memq 'nil args)) - ;; @r{apply function to @sc{car}s.} + ;; @r{apply function to @sc{CAR}s.} (cons (apply f (mapcar 'car args)) (apply 'mapcar* f ;; @r{Recurse for rest of elements.} @@ -741,8 +738,7 @@ other suitable punctuation. The argument @var{function} must be a function that can take one -argument and return a string. The argument @var{sequence} can be any -kind of sequence; that is, a list, a vector, a bit vector, or a string. +argument and return a string. @smallexample @group diff -r 12e008d41344 -r 697ef44129c6 man/lispref/glyphs.texi --- a/man/lispref/glyphs.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/glyphs.texi Mon Aug 13 11:20:41 2007 +0200 @@ -7,15 +7,15 @@ @chapter Glyphs @cindex glyphs - 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.) + 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.) The actual image that is displayed (as opposed to its position or clipping) is defined by an @dfn{image specifier} object contained @@ -71,179 +71,6 @@ 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 @@ -251,25 +78,13 @@ @end defun @defun make-pointer-glyph &optional spec-list - -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}. +This function is equivalent to calling @code{make-glyph} with a +@var{type} of @code{pointer}. @end defun @defun make-icon-glyph &optional spec-list - -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}. +This function is equivalent to calling @code{make-glyph} with a +@var{type} of @code{icon}. @end defun @node Glyph Properties @@ -605,27 +420,16 @@ @end defun @defun make-image-specifier spec-list -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. +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}. @end defun Image instantiators come in many formats: @code{xbm}, @code{xpm}, @code{gif}, @code{jpeg}, etc. This describes the format of the data describing the image. The resulting image instances also come in many -types---@code{mono-pixmap}, @code{color-pixmap}, @code{text}, +types -- @code{mono-pixmap}, @code{color-pixmap}, @code{text}, @code{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 @@ -658,105 +462,65 @@ @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. +(A TIFF-format image; only if TIFF support was compiled into this XEmacs. +Not currently implemented.) @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{<X11/cursorfont.h>}] 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. -@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}. +instanced as @code{pointer}, although this should probably be fixed.) @item subwindow -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}. +(An embedded X window; not currently implemented.) @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 @@ -764,107 +528,68 @@ 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. -@item inherit -Inherit from the background-pixmap property of a face. Can only be -instanced as @code{mono-pixmap}. +the image will always be displayed as text.) @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. -@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. +used to generate the alist.) @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 @@ -1046,14 +771,10 @@ 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 domain dest-types no-error +@defun make-image-instance data &optional device dest-types no-error This function creates a new image-instance object. @var{data} is an image instantiator, which describes the image @@ -1069,47 +790,14 @@ 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). 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. +@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. 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 @@ -1131,17 +819,6 @@ 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 12e008d41344 -r 697ef44129c6 man/lispref/gutter.texi --- a/man/lispref/gutter.texi Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,460 +0,0 @@ -@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 12e008d41344 -r 697ef44129c6 man/lispref/hash-tables.texi --- a/man/lispref/hash-tables.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/hash-tables.texi Mon Aug 13 11:20:41 2007 +0200 @@ -72,25 +72,19 @@ (without the @code{:} character), as well as the additional keyword @code{data}, which specifies the initial hash table contents. -@defun make-hash-table &key @code{test} @code{size} @code{rehash-size} @code{rehash-threshold} @code{weakness} +@defun make-hash-table &key @code{:size} @code{:test} @code{:type} @code{:rehash-size} @code{:rehash-threshold} This function returns a new empty hash table object. +Keyword @code{:size} specifies the number of keys likely to be inserted. +This number of entries can be inserted without enlarging the hash table. + Keyword @code{:test} can be @code{eq}, @code{eql} (default) or @code{equal}. Comparison between keys is done using this function. If speed is important, consider using @code{eq}. When storing strings in the hash table, you will likely need to use @code{equal}. -Keyword @code{:size} specifies the number of keys likely to be inserted. -This number of entries can be inserted without enlarging the hash table. - -Keyword @code{:rehash-size} must be a float greater than 1.0, and specifies -the factor by which to increase the size of the hash table when enlarging. - -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}. +Keyword @code{:type} can be @code{non-weak} (default), @code{weak}, +@code{key-weak} or @code{value-weak}. 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 @@ -110,6 +104,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. + +Keyword @code{:rehash-size} must be a float greater than 1.0, and specifies +the factor by which to increase the size of the hash table when enlarging. + +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. @end defun @defun copy-hash-table hash-table @@ -122,16 +122,22 @@ This function returns the number of entries in @var{hash-table}. @end defun +@defun hash-table-size hash-table +This function returns the current number of slots in @var{hash-table}, +whether occupied or not. +@end defun + +@defun hash-table-type hash-table +This function returns the type of @var{hash-table}. +This can be one of @code{non-weak}, @code{weak}, @code{key-weak} or +@code{value-weak}. +@end defun + @defun hash-table-test hash-table This function returns the test function of @var{hash-table}. This can be one of @code{eq}, @code{eql} or @code{equal}. @end defun -@defun hash-table-size hash-table -This function returns the current number of slots in @var{hash-table}, -whether occupied or not. -@end defun - @defun hash-table-rehash-size hash-table This function returns the current rehash size of @var{hash-table}. This is a float greater than 1.0; the factor by which @var{hash-table} @@ -144,11 +150,6 @@ @var{hash-table}, beyond which the @var{hash-table} is enlarged by rehashing. @end defun -@defun hash-table-weakness hash-table -This function returns the weakness of @var{hash-table}. -This can be one of @code{nil}, @code{t}, @code{key} or @code{value}. -@end defun - @node Working With Hash Tables @section Working With Hash Tables @@ -180,7 +181,6 @@ processed by @var{function}. @end defun - @node Weak Hash Tables @section Weak Hash Tables @cindex hash table, weak @@ -220,5 +220,5 @@ Also see @ref{Weak Lists}. -Weak hash tables are created by specifying the @code{:weakness} keyword to +Weak hash tables are created by specifying the @code{:type} keyword to @code{make-hash-table}. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/index.perm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/index.perm Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,37 @@ +@c -*-texinfo-*- +@setfilename ../../info/index.info + +@c Indexing guidelines + +@c I assume that all indexes will be combined. +@c Therefore, if a generated findex and permutations +@c cover the ways an index user would look up the entry, +@c then no cindex is added. +@c Concept index (cindex) entries will also be permuted. Therefore, they +@c have no commas and few irrelevant connectives in them. + +@c I tried to include words in a cindex that give the context of the entry, +@c particularly if there is more than one entry for the same concept. +@c For example, "nil in keymap" +@c Similarly for explicit findex and vindex entries, e.g. "print example". + +@c Error codes are given cindex entries, e.g. "end-of-file error". + +@c pindex is used for .el files and Unix programs + +@node Index, , Standard Hooks, Top +@unnumbered Index + + +All variables, functions, keys, programs, files, and concepts are +in this one index. + +All names and concepts are permuted, so they appear several times, one +for each permutation of the parts of the name. For example, +@code{function-name} would appear as @b{function-name} and @b{name, +function-}. Key entries are not permuted, however. + + +@c Print the indices + +@printindex fn diff -r 12e008d41344 -r 697ef44129c6 man/lispref/index.texi --- a/man/lispref/index.texi Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -@c -*-texinfo-*- -@setfilename ../../info/index.info - -@c Indexing guidelines - -@c I assume that all indexes will be combined. -@c Therefore, if a generated findex and permutations -@c cover the ways an index user would look up the entry, -@c then no cindex is added. -@c Concept index (cindex) entries will also be permuted. Therefore, they -@c have no commas and few irrelevant connectives in them. - -@c I tried to include words in a cindex that give the context of the entry, -@c particularly if there is more than one entry for the same concept. -@c For example, "nil in keymap" -@c Similarly for explicit findex and vindex entries, e.g. "print example". - -@c Error codes are given cindex entries, e.g. "end-of-file error". - -@c pindex is used for .el files and Unix programs - -@node Index, , Standard Hooks, Top -@unnumbered Index - -@ignore -All variables, functions, keys, programs, files, and concepts are -in this one index. - -All names and concepts are permuted, so they appear several times, one -for each permutation of the parts of the name. For example, -@code{function-name} would appear as @b{function-name} and @b{name, -function-}. Key entries are not permuted, however. -@end ignore - -@c Print the indices - -@printindex fn diff -r 12e008d41344 -r 697ef44129c6 man/lispref/index.unperm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/index.unperm Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,37 @@ +@c -*-texinfo-*- +@setfilename ../../info/index.info + +@c Indexing guidelines + +@c I assume that all indexes will be combined. +@c Therefore, if a generated findex and permutations +@c cover the ways an index user would look up the entry, +@c then no cindex is added. +@c Concept index (cindex) entries will also be permuted. Therefore, they +@c have no commas and few irrelevant connectives in them. + +@c I tried to include words in a cindex that give the context of the entry, +@c particularly if there is more than one entry for the same concept. +@c For example, "nil in keymap" +@c Similarly for explicit findex and vindex entries, e.g. "print example". + +@c Error codes are given cindex entries, e.g. "end-of-file error". + +@c pindex is used for .el files and Unix programs + +@node Index, , Standard Hooks, Top +@unnumbered Index + +@ignore +All variables, functions, keys, programs, files, and concepts are +in this one index. + +All names and concepts are permuted, so they appear several times, one +for each permutation of the parts of the name. For example, +@code{function-name} would appear as @b{function-name} and @b{name, +function-}. Key entries are not permuted, however. +@end ignore + +@c Print the indices + +@printindex fn diff -r 12e008d41344 -r 697ef44129c6 man/lispref/internationalization.texi --- a/man/lispref/internationalization.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/internationalization.texi Mon Aug 13 11:20:41 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, PostgreSQL Support, top +@node Internationalization, MULE, LDAP Support, top @chapter Internationalization @menu diff -r 12e008d41344 -r 697ef44129c6 man/lispref/intro.texi --- a/man/lispref/intro.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/intro.texi Mon Aug 13 11:20:41 2007 +0200 @@ -471,7 +471,7 @@ @end ifinfo This manual was originally written for FSF Emacs 19 and was updated by -Ben Wing (ben@@xemacs.org) for Lucid Emacs 19.10 and later for XEmacs +Ben Wing (wing@@666.com) for Lucid Emacs 19.10 and later for XEmacs 19.12, 19.13, 19.14, and 20.0. It was further updated by the XEmacs Development Team for 19.15 and 20.1. Please send comments and corrections relating to XEmacs-specific portions of this manual to diff -r 12e008d41344 -r 697ef44129c6 man/lispref/keymaps.texi --- a/man/lispref/keymaps.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/keymaps.texi Mon Aug 13 11:20:41 2007 +0200 @@ -235,7 +235,7 @@ @section Key Sequences @cindex key sequences - Contrary to popular belief, the world is not @sc{ascii}. When running + Contrary to popular belief, the world is not @sc{ASCII}. When running under a window manager, XEmacs can tell the difference between, for example, the keystrokes @kbd{control-h}, @kbd{control-shift-h}, and @kbd{backspace}. You can, in fact, bind different commands to each of @@ -246,8 +246,8 @@ A @dfn{keysym} is what is printed on the keys on your keyboard. A keysym may be represented by a symbol, or (if and only if it is -equivalent to an @sc{ascii} character in the range 32 - 255) by a -character or its equivalent @sc{ascii} code. The @kbd{A} key may be +equivalent to an @sc{ASCII} character in the range 32 - 255) by a +character or its equivalent @sc{ASCII} code. The @kbd{A} key may be represented by the symbol @code{A}, the character @code{?A}, or by the number 65. The @kbd{break} key may be represented only by the symbol @code{break}. @@ -262,12 +262,12 @@ @code{next-command-event} and @code{read-key-sequence} functions. Note that in this context, the keystroke @kbd{control-b} is @emph{not} -represented by the number 2 (the @sc{ascii} code for @samp{^B}) or the +represented by the number 2 (the @sc{ASCII} code for @samp{^B}) or the character @code{?\^B}. See below. The @key{SHIFT} modifier is somewhat of a special case. You should not (and cannot) use @code{(meta shift a)} to mean @code{(meta A)}, -since for characters that have @sc{ascii} equivalents, the state of the +since for characters that have @sc{ASCII} equivalents, the state of the shift key is implicit in the keysym (@samp{a} vs. @samp{A}). You also cannot say @code{(shift =)} to mean @code{+}, as that sort of thing varies from keyboard to keyboard. The @key{SHIFT} modifier is for use @@ -279,23 +279,23 @@ That is, the @kbd{A} keystroke is represented by all of these forms: @example - A ?A 65 (A) (?A) (65) - [A] [?A] [65] [(A)] [(?A)] [(65)] + A ?A 65 (A) (?A) (65) + [A] [?A] [65] [(A)] [(?A)] [(65)] @end example - + the @kbd{control-a} keystroke is represented by these forms: @example - (control A) (control ?A) (control 65) - [(control A)] [(control ?A)] [(control 65)] + (control A) (control ?A) (control 65) + [(control A)] [(control ?A)] [(control 65)] @end example the key sequence @kbd{control-c control-a} is represented by these forms: @example - [(control c) (control a)] [(control ?c) (control ?a)] - [(control 99) (control 65)] etc. + [(control c) (control a)] [(control ?c) (control ?a)] + [(control 99) (control 65)] etc. @end example Mouse button clicks work just like keypresses: @code{(control @@ -311,38 +311,38 @@ For backward compatibility, a key sequence may also be represented by a string. In this case, it represents the key sequence(s) that would -produce that sequence of @sc{ascii} characters in a purely @sc{ascii} -world. For example, a string containing the @sc{ascii} backspace +produce that sequence of @sc{ASCII} characters in a purely @sc{ASCII} +world. For example, a string containing the @sc{ASCII} backspace character, @code{"\^H"}, would represent two key sequences: @code{(control h)} and @code{backspace}. Binding a command to this will actually bind both of those key sequences. Likewise for the following pairs: @example - control h backspace - control i tab - control m return - control j linefeed - control [ escape - control @@ control space + control h backspace + control i tab + control m return + control j linefeed + control [ escape + control @@ control space @end example After binding a command to two key sequences with a form like @example - (define-key global-map "\^X\^I" 'command-1) + (define-key global-map "\^X\^I" 'command-1) @end example @noindent it is possible to redefine only one of those sequences like so: @example - (define-key global-map [(control x) (control i)] 'command-2) - (define-key global-map [(control x) tab] 'command-3) + (define-key global-map [(control x) (control i)] 'command-2) + (define-key global-map [(control x) tab] 'command-3) @end example Of course, all of this applies only when running under a window -system. If you're talking to XEmacs through a @sc{tty} connection, you +system. If you're talking to XEmacs through a @sc{TTY} connection, you don't get any of these features. @defun event-matches-key-specifier-p event key-specifier @@ -614,22 +614,22 @@ @result{} #<keymap lisp-interaction-mode-map 5 entries 0x558> (describe-bindings-internal (current-local-map)) @result{} ; @r{Inserted into the buffer:} -backspace backward-delete-char-untabify -linefeed eval-print-last-sexp -delete delete-char -C-j eval-print-last-sexp -C-x << Prefix Command >> -M-tab lisp-complete-symbol -M-; lisp-indent-for-comment -M-C-i lisp-complete-symbol -M-C-q indent-sexp -M-C-x eval-defun -Alt-backspace backward-kill-sexp -Alt-delete kill-sexp +backspace backward-delete-char-untabify +linefeed eval-print-last-sexp +delete delete-char +C-j eval-print-last-sexp +C-x << Prefix Command >> +M-tab lisp-complete-symbol +M-; lisp-indent-for-comment +M-C-i lisp-complete-symbol +M-C-q indent-sexp +M-C-x eval-defun +Alt-backspace backward-kill-sexp +Alt-delete kill-sexp @end group @group -C-x x edebug-defun +C-x x edebug-defun @end group @end example @end defun @@ -973,14 +973,14 @@ translating a two-character sequence to a meta character so it can be looked up in a keymap. For useful results, the value should be a prefix event (@pxref{Prefix Keys}). The default value is @code{?\^[} (integer -27), which is the @sc{ascii} character usually produced by the @key{ESC} +27), which is the @sc{ASCII} character usually produced by the @key{ESC} key. As long as the value of @code{meta-prefix-char} remains @code{?\^[}, key lookup translates @kbd{@key{ESC} b} into @kbd{M-b}, which is normally defined as the @code{backward-word} command. However, if you set @code{meta-prefix-char} to @code{?\^X} (i.e. the keystroke -@kbd{C-x}) or its equivalent @sc{ascii} code @code{24}, then XEmacs will +@kbd{C-x}) or its equivalent @sc{ASCII} code @code{24}, then XEmacs will translate @kbd{C-x b} (whose standard binding is the @code{switch-to-buffer} command) into @kbd{M-b}. @@ -1503,7 +1503,7 @@ string representing the first key sequence found, rather than a list of all possible key sequences. If @var{firstonly} is @code{t}, then the value is the first key sequence, except that key sequences consisting -entirely of @sc{ascii} characters (or meta variants of @sc{ascii} +entirely of @sc{ASCII} characters (or meta variants of @sc{ASCII} characters) are preferred to all other key sequences. @end ignore @@ -1546,13 +1546,13 @@ If @var{prefix} is non-@code{nil}, it should be a prefix key; then the listing includes only keys that start with @var{prefix}. -When several characters with consecutive @sc{ascii} codes have the +When several characters with consecutive @sc{ASCII} codes have the same definition, they are shown together, as @samp{@var{firstchar}..@var{lastchar}}. In this instance, you need to -know the @sc{ascii} codes to understand which characters this means. +know the @sc{ASCII} codes to understand which characters this means. For example, in the default global map, the characters @samp{@key{SPC} -..@: ~} are described by a single line. @key{SPC} is @sc{ascii} 32, -@kbd{~} is @sc{ascii} 126, and the characters between them include all +..@: ~} are described by a single line. @key{SPC} is @sc{ASCII} 32, +@kbd{~} is @sc{ASCII} 126, and the characters between them include all the normal printing characters, (e.g., letters, digits, punctuation, etc.@:); all these characters are bound to @code{self-insert-command}. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/ldap.texi --- a/man/lispref/ldap.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/ldap.texi Mon Aug 13 11:20:41 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, PostgreSQL Support, ToolTalk Support, top +@node LDAP Support, Internationalization, ToolTalk Support, top @chapter LDAP Support @cindex LDAP @@ -25,7 +25,7 @@ successfully built and tested with @itemize @bullet -@item OpenLDAP 1.2 (@url{http://www.openldap.org/}) +@item OpenLDAP 1.0.3 (@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 auto-detects an installed LDAP +The standard XEmacs configure script autodetects 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,18 +49,13 @@ higher-level layer which provides more convenient primitives to effectively use LDAP. -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). +As of XEmacs 21.0, only interfaces to basic LDAP search functions are +provided, broader support is planned in future versions. @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 @@ -82,7 +77,7 @@ @defvar ldap-default-base Default base for LDAP searches. This is a string using the syntax of RFC 1779. -For instance, "o=ACME, c=US" limits the search to the +For instance, "o¬ME, cÿ" limits the search to the Acme organization in the United States. @end defvar @@ -97,7 +92,7 @@ @table @code @item binddn The distinguished name of the user to bind as. This may look like -@samp{cn=Babs Jensen,o=ACME,c=US}, see RFC 1779 for details. +@samp{cÿ, o¬me, cnÿnny Bugs}, see RFC 1779 for details. @item passwd The password to use for authentication. @item auth @@ -132,99 +127,41 @@ @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 -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}. +As of this writing the high-level Lisp LDAP API only provides for LDAP +searches. Further support is planned in the future. -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. +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} -@defun ldap-search-entries filter &optional host attributes attrsonly withdn +@defun ldap-search filter &optional host attributes attrsonly 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 - -@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 +@node The Low-Level LDAP API, , 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:: -* Low-level Operations on a LDAP Server:: +* Searching on a LDAP Server (Low-level):: @end menu @node The LDAP Lisp Object, Opening and Closing a LDAP Connection, The Low-Level LDAP API, The Low-Level LDAP API @@ -247,7 +184,7 @@ @end defun -@node Opening and Closing a LDAP Connection, Low-level Operations on a LDAP Server, The LDAP Lisp Object, The Low-Level LDAP API +@node Opening and Closing a LDAP Connection, Searching on a LDAP Server (Low-level), The LDAP Lisp Object, The Low-Level LDAP API @comment node-name, next, previous, up @subsubsection Opening and Closing a LDAP Connection @@ -265,7 +202,7 @@ @code{krbv41} and @code{krbv42}. @item binddn The distinguished name of the user to bind as. This may look like -@samp{c=com, o=Acme, cn=Babs Jensen}, see RFC 1779 for details. +@samp{cÿ, o¬me, cnÿnny Bugs}, see RFC 1779 for details. @item passwd The password to use for authentication. @item deref @@ -295,17 +232,18 @@ @end defun -@node Low-level Operations on a LDAP Server, , Opening and Closing a LDAP Connection, The Low-Level LDAP API +@node Searching on a LDAP Server (Low-level), , Opening and Closing a LDAP Connection, The Low-Level LDAP API @comment node-name, next, previous, up -@subsubsection Low-level Operations on a LDAP Server +@subsubsection Searching on a LDAP Server (Low-level) -@code{ldap-search-basic} is the low-level primitive to perform a +@code{ldap-search-internal} 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-basic ldap filter base scope attrs attrsonly + +@defun ldap-search-internal 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. @@ -317,138 +255,12 @@ 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 -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 +The function returns a list of matching entries. Each entry being itself +an alist of attribute/values. @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 @@ -487,3 +299,6 @@ 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 12e008d41344 -r 697ef44129c6 man/lispref/lispref.texi --- a/man/lispref/lispref.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/lispref.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -\input texinfo @c -*-texinfo-*- +\input ../texinfo @c -*-texinfo-*- @c %**start of header @setfilename ../../info/lispref.info @c @smallbook @@ -159,7 +159,6 @@ * 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. @@ -205,7 +204,6 @@ * 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. @@ -289,7 +287,7 @@ * Buffer Type:: The basic object of editing. * Window Type:: What makes buffers visible. -* Window Configuration Type:: Save what the screen looks like. +* Window Configuration Type::Save what the screen looks like. * Marker Type:: A position in a buffer. * Process Type:: A process running on the underlying OS. * Stream Type:: Receive or send characters. @@ -310,7 +308,7 @@ Strings and Characters -* String Basics:: Basic properties of strings and characters. +* Basics: String Basics. Basic properties of strings and characters. * Predicates for Strings:: Testing whether an object is a string or char. * Creating Strings:: Functions to allocate new strings. * Predicates for Characters:: Testing whether an object is a character. @@ -625,8 +623,6 @@ * Specifying the Toolbar:: Setting a toolbar. * Other Toolbar Variables:: Controlling the size of toolbars. -Gutter - Scrollbars Major and Minor Modes @@ -1099,18 +1095,12 @@ * 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:: -* Low-level Operations on a LDAP Server:: - -LDAP Internationalization - -* LDAP Internationalization Variables:: -* Encoder/Decoder Functions:: +* Searching on a LDAP Server (Low-level):: Internationalization @@ -1173,7 +1163,6 @@ @include menus.texi @include dialog.texi @include toolbar.texi -@include gutter.texi @include scrollbars.texi @include dragndrop.texi @include modes.texi @@ -1210,7 +1199,6 @@ @include x-windows.texi @include tooltalk.texi @include ldap.texi -@include postgresql.texi @include internationalization.texi @include mule.texi diff -r 12e008d41344 -r 697ef44129c6 man/lispref/lists.texi --- a/man/lispref/lists.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/lists.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1448,7 +1448,7 @@ @defun remassoc key alist This function deletes by side effect any associations with key @var{key} -in @var{alist}---i.e. it removes any elements from @var{alist} whose +in @var{alist} -- i.e. it removes any elements from @var{alist} whose @code{car} is @code{equal} to @var{key}. The modified @var{alist} is returned. @@ -1460,7 +1460,7 @@ @defun remassq key alist This function deletes by side effect any associations with key @var{key} -in @var{alist}---i.e. it removes any elements from @var{alist} whose +in @var{alist} -- i.e. it removes any elements from @var{alist} whose @code{car} is @code{eq} to @var{key}. The modified @var{alist} is returned. @@ -1471,7 +1471,7 @@ @defun remrassoc value alist This function deletes by side effect any associations with value @var{value} -in @var{alist}---i.e. it removes any elements from @var{alist} whose +in @var{alist} -- i.e. it removes any elements from @var{alist} whose @code{cdr} is @code{equal} to @var{value}. The modified @var{alist} is returned. @@ -1488,7 +1488,7 @@ @defun remrassq value alist This function deletes by side effect any associations with value @var{value} -in @var{alist}---i.e. it removes any elements from @var{alist} whose +in @var{alist} -- i.e. it removes any elements from @var{alist} whose @code{cdr} is @code{eq} to @var{value}. The modified @var{alist} is returned. @@ -1628,7 +1628,7 @@ In the following functions, if optional arg @var{nil-means-not-present} is non-@code{nil}, then a property with a @code{nil} value is ignored or removed. This feature is a virus that has infected old Lisp -implementations (and thus E-Lisp, due to @sc{rms}'s enamorment with old +implementations (and thus E-Lisp, due to @sc{RMS}'s enamorment with old Lisps), but should not be used except for backward compatibility. @defun plists-eq a b &optional nil-means-not-present @@ -1682,7 +1682,7 @@ In the following functions, if optional arg @var{nil-means-not-present} is non-@code{nil}, then a property with a @code{nil} value is ignored or removed. This feature is a virus that has infected old Lisp -implementations (and thus E-Lisp, due to @sc{rms}'s enamorment with old +implementations (and thus E-Lisp, due to @sc{RMS}'s enamorment with old Lisps), but should not be used except for backward compatibility. @defun lax-plists-eq a b &optional nil-means-not-present @@ -1771,7 +1771,7 @@ done with the elements, they will automatically disappear from the list. Weak lists are used internally, for example, to manage the list holding -the children of an extent---an extent that is unused but has a parent +the children of an extent -- an extent that is unused but has a parent will still be reclaimed, and will automatically be removed from its parent's list of children. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/loading.texi --- a/man/lispref/loading.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/loading.texi Mon Aug 13 11:20:41 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|writable|readable), +access @var{mode} (0|1|2|4 = exists|executable|writeable|readable), default readable. @code{locate-file} keeps hash tables of the directories it searches diff -r 12e008d41344 -r 697ef44129c6 man/lispref/markers.texi --- a/man/lispref/markers.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/markers.texi Mon Aug 13 11:20:41 2007 +0200 @@ -667,7 +667,7 @@ When @code{zmacs-regions} is non-@code{nil} (this is the default), the concept of an @dfn{active region} exists. The region is active when the corresponding mark is active. Note that only one active region at a -time can exist---i.e. only one buffer's region is active at a time. +time can exist -- i.e. only one buffer's region is active at a time. @xref{The Mark}, for more information about active regions. @defopt zmacs-regions diff -r 12e008d41344 -r 697ef44129c6 man/lispref/menus.texi --- a/man/lispref/menus.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/menus.texi Mon Aug 13 11:20:41 2007 +0200 @@ -9,14 +9,14 @@ @cindex menu @menu -* Menu Format:: Format of a menu description. -* Menubar Format:: How to specify a menubar. -* Menubar:: Functions for controlling the menubar. -* Modifying Menus:: Modifying a menu description. -* Pop-Up Menus:: Functions for specifying pop-up menus. -* Menu Filters:: Filter functions for the default menubar. -* Menu Accelerators:: Using and controlling menu accelerator keys -* Buffers Menu:: The menu that displays the list of buffers. +* Menu Format:: Format of a menu description. +* Menubar Format:: How to specify a menubar. +* Menubar:: Functions for controlling the menubar. +* Modifying Menus:: Modifying a menu description. +* Pop-Up Menus:: Functions for specifying pop-up menus. +* Menu Filters:: Filter functions for the default menubar. +* Menu Accelerators:: Using and controlling menu accelerator keys +* Buffers Menu:: The menu that displays the list of buffers. @end menu @node Menu Format @@ -241,9 +241,9 @@ @example ("File" - :filter file-menu-filter ; file-menu-filter is a function that takes - ; one argument (a list of menu items) and - ; returns a list of menu items + :filter file-menu-filter ; file-menu-filter is a function that takes + ; one argument (a list of menu items) and + ; returns a list of menu items [ "Save As..." write-file] [ "Revert Buffer" revert-buffer :active (buffer-modified-p) ] [ "Read Only" toggle-read-only :style toggle :selected buffer-read-only ] @@ -600,10 +600,10 @@ activate that item. @menu -* Creating Menu Accelerators:: How to add accelerator keys to a menu. -* Keyboard Menu Traversal:: How to use and modify the keys which are used - to traverse the menu structure. -* Menu Accelerator Functions:: Functions for working with menu accelerators. +* Creating Menu Accelerators:: How to add accelerator keys to a menu. +* Keyboard Menu Traversal:: How to use and modify the keys which are used + to traverse the menu structure. +* Menu Accelerator Functions:: Functions for working with menu accelerators. @end menu @node Creating Menu Accelerators @@ -620,9 +620,9 @@ @example (add-submenu nil '("%_Test" - ["One" (insert "1") :accelerator ?1 :active t] - ["%_Two" (insert "2")] - ["%_3" (insert "3")])) + ["One" (insert "1") :accelerator ?1 :active t] + ["%_Two" (insert "2")] + ["%_3" (insert "3")])) @end example will add a new menu to the top level menubar. The new menu can be reached @@ -708,9 +708,9 @@ (setq menu-accelerator-modifiers '(meta control)) (setq menu-accelerator-enabled 'menu-force) (add-submenu nil '("%_Test" - ["One" (insert "1") :accelerator ?1 :active t] - ["%_Two" (insert "2")] - ["%_3" (insert "3")])) + ["One" (insert "1") :accelerator ?1 :active t] + ["%_Two" (insert "2")] + ["%_3" (insert "3")])) @end example will add the menu "Test" to the top level menubar. Pressing C-x followed by diff -r 12e008d41344 -r 697ef44129c6 man/lispref/minibuf.texi --- a/man/lispref/minibuf.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/minibuf.texi Mon Aug 13 11:20:41 2007 +0200 @@ -25,7 +25,6 @@ * Completion:: How to invoke and customize completion. * Yes-or-No Queries:: Asking a question with a simple answer. * Multiple Queries:: Asking a series of similar questions. -* Reading a Password:: Reading a password from the terminal. * Minibuffer Misc:: Various customization hooks and variables. @end menu @@ -38,7 +37,7 @@ to minibuffers. The name of a minibuffer always has the form @w{@samp{ *Minibuf-@var{number}}}, and it cannot be changed. Minibuffers are displayed only in special windows used only for minibuffers; these -windows always appear at the bottom of a frame. (Sometimes frames have +windows always appear at the bottom of a frame. (Sometime frames have no minibuffer window, and sometimes a special kind of frame contains nothing but a minibuffer window; see @ref{Minibuffers and Frames}.) @@ -68,6 +67,10 @@ @code{minibuffer-local-map} is for ordinary input (no completion). @item +@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits +just like @key{RET}. This is used mainly for Mocklisp compatibility. + +@item @code{minibuffer-local-completion-map} is for permissive completion. @item @@ -88,7 +91,7 @@ reading the arguments for a command, in the @code{interactive} spec. @xref{Defining Commands}. -@defun read-from-minibuffer prompt-string &optional initial-contents keymap read hist abbrev-table default +@defun read-from-minibuffer prompt-string &optional initial-contents keymap read hist This function is the most general way to get input through the minibuffer. By default, it accepts arbitrary text and returns it as a string; however, if @var{read} is non-@code{nil}, then it uses @@ -109,25 +112,12 @@ @var{string} in the minibuffer but put point @var{position} characters from the beginning, rather than at the end. -When the user types a command to exit the minibuffer, -@code{read-from-minibuffer} constructs the return value from the text in -the minibuffer. Normally it returns a string containing that text. -However, if @var{read} is non-@code{nil}, @code{read-from-minibuffer} -reads the text and returns the resulting Lisp object, unevaluated. -(@xref{Input Functions}, for information about reading.) - -The argument @var{default} specifies a default value to make available -through the history commands. It should be a string, or @code{nil}. - If @var{keymap} is non-@code{nil}, that keymap is the local keymap to use in the minibuffer. If @var{keymap} is omitted or @code{nil}, the value of @code{minibuffer-local-map} is used as the keymap. Specifying a keymap is the most important way to customize the minibuffer for various applications such as completion. -The argument @var{abbrev-table} specifies @code{local-abbrev-table} in -the minibuffer (@pxref{Standard Abbrev Tables}). - The argument @var{hist} specifies which history list variable to use for saving the input and for history commands used in the minibuffer. It defaults to @code{minibuffer-history}. @xref{Minibuffer History}. @@ -139,37 +129,22 @@ @code{read-from-minibuffer} reads the text and returns the resulting Lisp object, unevaluated. (@xref{Input Functions}, for information about reading.) - -@strong{Usage note:} The @var{initial-contents} argument and the -@var{default} argument are two alternative features for more or less the -same job. It does not make sense to use both features in a single call -to @code{read-from-minibuffer}. In general, we recommend using -@var{default}, since this permits the user to insert the default value -when it is wanted, but does not burden the user with deleting it from -the minibuffer on other occasions. However, if user is supposed to edit -default value, @var{initial-contents} may be preferred. @end defun -@defun read-string prompt &optional initial history default-value +@defun read-string prompt &optional initial 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. 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 +This is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-string @var{prompt} @var{initial} @var{history} @var{default}) +(read-string @var{prompt} @var{initial}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil nil - @var{history} nil @var{default}))) +(read-from-minibuffer @var{prompt} @var{initial} nil nil nil) @end group @end smallexample @end defun @@ -179,7 +154,7 @@ default, it makes the following bindings: @table @asis -@item @kbd{C-j} +@item @key{LFD} @code{exit-minibuffer} @item @key{RET} @@ -202,31 +177,68 @@ @end table @end defvar +@c In version 18, initial is required +@c Emacs 19 feature +@defun read-no-blanks-input prompt &optional initial +This function reads a string from the minibuffer, but does not allow +whitespace characters as part of the input: instead, those characters +terminate the input. The arguments @var{prompt} and @var{initial} are +used as in @code{read-from-minibuffer}. + +This is a simplified interface to the @code{read-from-minibuffer} +function, and passes the value of the @code{minibuffer-local-ns-map} +keymap as the @var{keymap} argument for that function. Since the keymap +@code{minibuffer-local-ns-map} does not rebind @kbd{C-q}, it @emph{is} +possible to put a space into the string, by quoting it. + +@smallexample +@group +(read-no-blanks-input @var{prompt} @var{initial}) +@equiv{} +(read-from-minibuffer @var{prompt} @var{initial} minibuffer-local-ns-map) +@end group +@end smallexample +@end defun + +@defvar minibuffer-local-ns-map +This built-in variable is the keymap used as the minibuffer local keymap +in the function @code{read-no-blanks-input}. By default, it makes the +following bindings, in addition to those of @code{minibuffer-local-map}: + +@table @asis +@item @key{SPC} +@cindex @key{SPC} in minibuffer +@code{exit-minibuffer} + +@item @key{TAB} +@cindex @key{TAB} in minibuffer +@code{exit-minibuffer} + +@item @kbd{?} +@cindex @kbd{?} in minibuffer +@code{self-insert-and-exit} +@end table +@end defvar + @node Object from Minibuffer @section Reading Lisp Objects with the Minibuffer This section describes functions for reading Lisp objects with the minibuffer. -@defun read-expression prompt &optional initial history default-value -This function reads a Lisp object using the minibuffer, and returns it +@defun read-minibuffer prompt &optional initial +This function reads a Lisp object in 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-expression @var{prompt} @var{initial} @var{history} @var{default-value}) +(read-minibuffer @var{prompt} @var{initial}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil t - @var{history} nil @var{default-value}) +(read-from-minibuffer @var{prompt} @var{initial} nil t) @end group @end smallexample @@ -235,7 +247,7 @@ @smallexample @group -(read-expression +(read-minibuffer "Enter an expression: " (format "%s" '(testing))) ;; @r{Here is how the minibuffer is displayed:} @@ -253,38 +265,27 @@ default, or can edit the input. @end defun -@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. +@defun eval-minibuffer prompt &optional initial +This function reads a Lisp expression in the minibuffer, evaluates it, +then returns the result. The arguments @var{prompt} and @var{initial} +are used as in @code{read-from-minibuffer}. This function simply evaluates the result of a call to -@code{read-expression}: +@code{read-minibuffer}: @smallexample @group (eval-minibuffer @var{prompt} @var{initial}) @equiv{} -(eval (read-expression @var{prompt} @var{initial})) +(eval (read-minibuffer @var{prompt} @var{initial})) @end group @end smallexample @end defun -@defun edit-and-eval-command prompt command &optional history +@defun edit-and-eval-command prompt form 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{command} is not +@code{eval-minibuffer} is that here the initial @var{form} 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{"}) @@ -292,7 +293,7 @@ The first thing @code{edit-and-eval-command} does is to activate the minibuffer with @var{prompt} as the prompt. Then it inserts the printed -representation of @var{form} in the minibuffer, and lets the user edit it. +representation of @var{form} in the minibuffer, and lets the user edit. When the user exits the minibuffer, the edited text is read with @code{read} and then evaluated. The resulting value becomes the value of @code{edit-and-eval-command}. @@ -365,8 +366,6 @@ name to the input functions when you wish. But it is safe to modify the list by hand when the minibuffer input functions are not using it. - Here are some of the standard minibuffer history list variables: - @defvar minibuffer-history The default history list for minibuffer history input. @end defvar @@ -552,7 +551,7 @@ @defun all-completions string collection &optional predicate nospace This function returns a list of all possible completions of -@var{string}. The arguments to this function are the same as those of +@var{string}. The parameters to this function are the same as to @code{try-completion}. If @var{collection} is a function, it is called with three arguments: @@ -593,7 +592,7 @@ This section describes the basic interface for reading from the minibuffer with completion. -@defun completing-read prompt collection &optional predicate require-match initial hist default +@defun completing-read prompt collection &optional predicate require-match initial hist This function reads a string in the minibuffer, assisting the user by providing completion. It activates the minibuffer with prompt @var{prompt}, which must be a string. If @var{initial} is @@ -612,20 +611,14 @@ @var{collection}. If @var{require-match} is @code{nil}, the exit commands work regardless of the input in the minibuffer. -However, empty input is always permitted, regardless of the value of -@var{require-match}; in that case, @code{completing-read} returns -@var{default}. The value of @var{default} (if non-@code{nil}) is also -available to the user through the history commands. - The user can exit with null input by typing @key{RET} with an empty -minibuffer. Then @code{completing-read} returns @code{""}. This is how -the user requests whatever default the command uses for the value being -read. The user can return using @key{RET} in this way regardless of the -value of @var{require-match}, and regardless of whether the empty string -is included in @var{collection}. +minibuffer. Then @code{completing-read} returns @code{nil}. This is +how the user requests whatever default the command uses for the value +being read. The user can return using @key{RET} in this way regardless +of the value of @var{require-match}. The function @code{completing-read} works by calling -@code{read-expression}. It uses @code{minibuffer-local-completion-map} +@code{read-minibuffer}. 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}. @@ -714,7 +707,7 @@ @item @key{TAB} @code{minibuffer-complete} -@item @kbd{C-j} +@item @key{LFD} @code{minibuffer-complete-and-exit} @item @key{RET} @@ -752,7 +745,7 @@ @deffn Command minibuffer-complete-and-exit This function completes the minibuffer contents, and exits if confirmation is not required, i.e., if -@code{minibuffer-completion-confirm} is @code{nil}. If confirmation +@code{minibuffer-completion-confirm} is non-@code{nil}. If confirmation @emph{is} required, it is given by repeating this command immediately---the command is programmed to work without confirmation when run twice in succession. @@ -775,7 +768,7 @@ @samp{*Completions*}. @end deffn -@defun display-completion-list completions &rest cl-keys +@defun display-completion-list completions 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 @@ -852,19 +845,13 @@ @end example @end defun -@defun read-command prompt &optinal default-value +@defun read-command prompt 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? ") @@ -900,16 +887,10 @@ @end example @end defun -@defun read-variable prompt &optional default-value +@defun read-variable prompt 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? ") @@ -952,7 +933,7 @@ file name. It provides special features including automatic insertion of the default directory. -@defun read-file-name prompt &optional directory default existing initial history +@defun read-file-name prompt &optional directory default existing initial 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 @@ -975,7 +956,7 @@ @c Emacs 19 feature If you specify @var{initial}, that is an initial file name to insert in -the buffer (after @var{directory}, if that is inserted). In this +the buffer (after with @var{directory}, if that is inserted). In this case, point goes at the beginning of @var{initial}. The default for @var{initial} is @code{nil}---don't insert any file name. To see what @var{initial} does, try the command @kbd{C-x C-v}. @@ -1090,12 +1071,8 @@ @item @code{nil} specifies @code{try-completion}. The completion function should return the completion of the specified string, or @code{t} if the -string is a unique and exact match already, or @code{nil} if the string -matches no possibility. - -If the string is an exact match for one possibility, but also matches -other longer possibilities, the function should return the string, not -@code{t}. +string is an exact match already, or @code{nil} if the string matches no +possibility. @item @code{t} specifies @code{all-completions}. The completion function @@ -1366,40 +1343,6 @@ The return value of @code{map-y-or-n-p} is the number of objects acted on. @end defun -@node Reading a Password -@section Reading a Password -@cindex passwords, reading - - To read a password to pass to another program, you can use the -function @code{read-passwd}. - -@defun read-passwd prompt &optional confirm default -This function reads a password, prompting with @var{prompt}. It does -not echo the password as the user types it; instead, it echoes @samp{.} -for each character in the password. - -The optional argument @var{confirm}, if non-@code{nil}, says to read the -password twice and insist it must be the same both times. If it isn't -the same, the user has to type it over and over until the last two -times match. - -The optional argument @var{default} specifies the default password to -return if the user enters empty input. It is translated to @samp{.} -and inserted in the minibuffer. If @var{default} is @code{nil}, then -@code{read-passwd} returns the null string in that case. -@end defun - -@defopt passwd-invert-frame-when-keyboard-grabbed -If non-nil swap the foreground and background colors of all faces while -reading a password. Default values is @code{t} unless feature -@code{infodock} is provided. -@end defopt - -@defopt passwd-echo -This specifies the character echoed when typing a password. When nil, -nothing is echoed. -@end defopt - @node Minibuffer Misc @section Minibuffer Miscellany @@ -1509,8 +1452,8 @@ @defopt enable-recursive-minibuffers If this variable is non-@code{nil}, you can invoke commands (such as -@code{find-file}) that use minibuffers even while the minibuffer window -is active. Such invocation produces a recursive editing level for a new +@code{find-file}) that use minibuffers even while in the minibuffer +window. Such invocation produces a recursive editing level for a new minibuffer. The outer-level minibuffer is invisible while you are editing the inner one. @@ -1533,4 +1476,4 @@ in this fashion, just use an evaluated interactive spec and bind @code{enable-recursive-minibuffers} while reading from the minibuffer. See the definition of @code{next-matching-history-element} in -@file{lisp/minibuf.el}. +@file{lisp/prim/minibuf.el}. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/modes.texi --- a/man/lispref/modes.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/modes.texi Mon Aug 13 11:20:41 2007 +0200 @@ -330,7 +330,7 @@ @group ;; @r{Set syntax of chars up to 0 to class of chars that are} ;; @r{part of symbol names but not words.} - ;; @r{(The number 0 is @code{48} in the @sc{ascii} character set.)} + ;; @r{(The number 0 is @code{48} in the @sc{ASCII} character set.)} (while (< i ?0) (modify-syntax-entry i "_ " emacs-lisp-mode-syntax-table) (setq i (1+ i))) @@ -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{modeline-format}. The data structure is called a @dfn{modeline +@code{mode-line-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 string, symbol, glyph, generic -specifier, list or cons cell. + 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. @table @code @cindex percent symbol in modeline @@ -956,22 +956,13 @@ @item @var{symbol} A symbol as a modeline construct stands for its value. The value of -@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. +@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. 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 @@ -996,19 +987,6 @@ 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 @@ -1224,10 +1202,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 @@ -1248,9 +1226,6 @@ @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 12e008d41344 -r 697ef44129c6 man/lispref/mule.texi --- a/man/lispref/mule.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/mule.texi Mon Aug 13 11:20:41 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 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}. +``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}. @menu * Internationalization Terminology:: @@ -20,45 +20,30 @@ * 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, Charsets, , MULE +@node Internationalization Terminology @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 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.) +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. In some cases, the differences will be significant enough that it is actually possible to identify two or more distinct shapes that both represent the same character. For example, the lowercase letters -@samp{a} and @samp{g} each have two distinct possible shapes---the +@samp{a} and @samp{g} each have two distinct possible shapes -- the @samp{a} can optionally have a curved tail projecting off the top, and the @samp{g} can be formed either of two loops, or of one loop and a tail hanging off the bottom. Such distinct possible shapes of a @@ -66,128 +51,93 @@ glyphs making up the same character is that the choice between one or the other is purely stylistic and has no linguistic effect on a word (this is the reason why a capital @samp{A} and lowercase @samp{a} -are different characters rather than different glyphs---e.g. +are different characters rather than different glyphs -- e.g. @samp{Aspen} is a city while @samp{aspen} is a kind of tree). Note that @dfn{character} and @dfn{glyph} are used differently here than elsewhere in XEmacs. - A @dfn{character set} is essentially a set of related characters. ASCII, + A @dfn{character set} is simply 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), -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), +JISX0201 (ASCII, more or less, plus half-width Katakana), JISX0208 +(Japanese Kanji), JISX0212 (a second set of less-used Japanese Kanji), GB2312 (Mainland Chinese Hanzi), 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.) + 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. - 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. + 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.) An @dfn{encoding} is a way of numerically representing characters from one or more character sets into a stream of like-sized numerical values called @dfn{words}; typically these are 8-bit, 16-bit, or 32-bit quantities. If an encoding encompasses only one character set, then the position codes for the characters in that character set could be used -directly. (This is the case with the trivial cipher used by children, -assigning 1 to `A', 2 to `B', and so on.) However, even with ASCII, -other considerations intrude. For example, why are the upper- and -lowercase alphabets separated by 8 characters? Why do the digits start -with `0' being assigned the code 48? In both cases because semantically -interesting operations (case conversion and numerical value extraction) -become convenient masking operations. Other artificial aspects (the -control characters being assigned to codes 0--31 and 127) are historical -accidents. (The use of 127 for @samp{DEL} is an artifact of the "punch -once" nature of paper tape, for example.) - - 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. +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.) 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 JIS X 0208, rather than as ASCII. This effect is cancelled +codes for JISX0208, 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 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.) +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.) - 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 JIS X 0208 are encoded by setting -the high bit of the position codes, and characters in JIS X 0212 are +non-modal encoding. Characters in JISX0208 are encoded by setting +the high bit of the position codes, and characters in JISX0212 are encoded by doing the same but also prefixing the character with the byte 0x8F. @@ -198,11 +148,10 @@ 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 JIS X 0208 character, or one of the -two position codes in a JIS X 0212 character. Determining exactly which +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 is meant could be difficult and time-consuming if the previous -bytes in the string have not already been processed, or impossible if -they are drawn from an external stream that cannot be rewound. +bytes in the string have not already been processed. Non-modal encodings are further divided into @dfn{fixed-width} and @dfn{variable-width} formats. A fixed-width encoding always uses @@ -214,18 +163,14 @@ 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 -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.) +for compatibility with existing 8-bit encodings such as ASCII. - 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. + 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. -@node Charsets, MULE Characters, Internationalization Terminology, MULE +@node Charsets @section Charsets A @dfn{charset} in MULE is an object that encapsulates a @@ -244,7 +189,7 @@ * Predefined Charsets:: Predefined charset objects. @end menu -@node Charset Properties, Basic Charset Functions, , Charsets +@node Charset Properties @subsection Charset Properties Charsets have the following properties: @@ -316,7 +261,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, @@ -327,11 +272,10 @@ from a Big5 font. @end table - Most of the above properties can only be set when the charset is -initialized, and cannot be changed later. -@xref{Charset Property Functions}. +Most of the above properties can only be changed when the charset +is created. @xref{Charset Property Functions}. -@node Basic Charset Functions, Charset Property Functions, Charset Properties, Charsets +@node Basic Charset Functions @subsection Basic Charset Functions @defun find-charset charset-or-name @@ -354,7 +298,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 @@ -382,17 +326,17 @@ displayed in the opposite direction. @end defun -@node Charset Property Functions, Predefined Charsets, Basic Charset Functions, Charsets +@node Charset Property Functions @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 @@ -422,7 +366,7 @@ @end defun @defun charset-direction charset -This function returns the display direction of @var{charset}---either +This function returns the display direction of @var{charset} -- either @code{l2r} or @code{r2l}. @end defun @@ -442,7 +386,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 @@ -450,10 +394,10 @@ @var{ccl-program}. @end defun -@node Predefined Charsets, , Charset Property Functions, Charsets +@node Predefined 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 @@ -484,7 +428,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 @@ -508,11 +452,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, Composite Characters, Charsets, MULE +@node MULE Characters @section MULE Characters @defun make-char charset arg1 &optional arg2 @@ -539,10 +483,10 @@ This function returns a list of the charsets in @var{string}. @end defun -@node Composite Characters, Coding Systems, MULE Characters, MULE +@node Composite Characters @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 @@ -570,24 +514,238 @@ left as-is. @var{buffer} defaults to the current buffer if omitted. @end defun -@node Coding Systems, CCL, Composite Characters, MULE +@node ISO 2022 +@section ISO 2022 + +This section briefly describes the ISO 2022 encoding standard. For more +thorough understanding, please refer to the original document of ISO +2022. + +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. + +@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 +@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. + +Note: @dfn{ECMA} = European Computer Manufacturers Association + +There are four @dfn{registers of charsets}, called G0 thru G3. +You can designate (or assign) any charset to one of these +registers. + +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. + +@example +@group + C0: 0x00 - 0x1F + GL: 0x20 - 0x7F + C1: 0x80 - 0x9F + GR: 0xA0 - 0xFF +@end group +@end example + +Usually, in the initial state, G0 is invoked into GL, and G1 +is invoked into GR. + +ISO 2022 distinguishes 7-bit environments and 8-bit environments. In +7-bit environments, only C0 and GL are used. + +Charset designation is done by escape sequences 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. + +The meaning of intermediate characters are: + +@example +@group + $ [0x24]: indicate charset of dimension 2 (94x94 or 96x96). + ( [0x28]: designate to G0 a 94-charset whose final byte is @var{F}. + ) [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}. + - [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. + +@example + , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}. +@end example + +Here are examples of designations: + +@example +@group + ESC ( B : designate to G0 ASCII + ESC - A : designate to G1 Latin-1 + ESC $ ( A or ESC $ A : designate to G0 GB2312 + ESC $ ( B or ESC $ B : designate to G0 JISX0208 + ESC $ ) C : designate to G1 KSC5601 +@end group +@end example + +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: + +@example + LS0 or SI (0x0F): invoke G0 into GL + LS1 or SO (0x0E): invoke G1 into GL + LS2: invoke G2 into GL + LS3: invoke G3 into GL + LS1R: invoke G1 into GR + LS2R: invoke G2 into GR + LS3R: invoke G3 into GR +@end example + +Single Shift is done as follows: + +@example +@group + SS2 or ESC N: invoke G2 into GL + SS3 or ESC O: invoke G3 into GL +@end group +@end example + +(#### 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. + +In Mule, we characterize ISO 2022 by the following attributes: + +@enumerate +@item +Initial designation to G0 thru G3. +@item +Allow designation of short form for Japanese and Chinese. +@item +Should we designate ASCII to G0 before control characters? +@item +Should we designate ASCII to G0 at the end of line? +@item +7-bit environment or 8-bit environment. +@item +Use Locking Shift or not. +@item +Use ASCII or JIS0201-1976-Roman. +@item +Use JISX0208-1983 or JISX0208-1976. +@end enumerate + +(The last two are only for Japanese.) + +By specifying these attributes, you can create any variant +of ISO 2022. + +Here are several examples: + +@example +@group +junet -- Coding system used in JUNET. + 1. G0 <- ASCII, G1..3 <- never used + 2. Yes. + 3. Yes. + 4. Yes. + 5. 7-bit environment + 6. No. + 7. Use ASCII + 8. Use JISX0208-1983 +@end group + +@group +ctext -- Compound Text + 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used + 2. No. + 3. No. + 4. Yes. + 5. 8-bit environment + 6. No. + 7. Use ASCII + 8. Use JISX0208-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 + 2. No. + 3. Yes. + 4. Yes. + 5. 8-bit environment + 6. No. + 7. Use ASCII + 8. Use JISX0208-1983 +@end group + +@group +korean-mail -- Coding system used in Korean network. + 1. G0 <- ASCII, G1 <- KSC5601, G2,3 <- never used + 2. No. + 3. Yes. + 4. Yes. + 5. 7-bit environment + 6. Yes. + 7. No. + 8. No. +@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 +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 +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 +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.) @@ -597,8 +755,6 @@ @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. @@ -608,72 +764,34 @@ * 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 -@node Coding System Types, ISO 2022, , Coding Systems +@node Coding System Types @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.) - - 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 nil +@itemx autodetect +Automatic conversion. XEmacs attempts to detect the coding system used +in the file. @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.) +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 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 +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 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). +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 @@ -685,303 +803,7 @@ normal circumstances you should never use @code{internal} conversion. @end table -@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). - - 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). - - 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 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. - - 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. - - 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. - - 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. - - 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 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: - -@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 - $ [0x24]: indicate charset of dimension 2 (94x94 or 96x96). - ( [0x28]: designate to G0 a 94-charset whose final byte is @var{F}. - ) [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 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.) - - Here are examples of designations: - -@example -@group - ESC ( B : designate to G0 ASCII - ESC - A : designate to G1 Latin-1 - ESC $ ( A or ESC $ A : designate to G0 GB2312 - ESC $ ( B or ESC $ B : designate to G0 JISX0208 - ESC $ ) C : designate to G1 KSC5601 -@end group -@end example - -(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: - -@example - LS0 or SI (0x0F): invoke G0 into GL - LS1 or SO (0x0E): invoke G1 into GL - LS2: invoke G2 into GL - LS3: invoke G3 into GL - LS1R: invoke G1 into GR - LS2R: invoke G2 into GR - LS3R: invoke G3 into GR -@end example - - Single Shift is done as follows: - -@example -@group - SS2 or ESC N: invoke G2 into GL - SS3 or ESC O: invoke G3 into GL -@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.) - - 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 a version of ISO 2022 by the following -attributes: - -@enumerate -@item -The character sets initially designated to G0 thru G3. -@item -Whether short form designations are allowed for Japanese and Chinese. -@item -Whether ASCII should be designated to G0 before control characters. -@item -Whether ASCII should be designated to G0 at the end of line. -@item -7-bit environment or 8-bit environment. -@item -Whether Locking Shifts are used or not. -@item -Whether to use ASCII or the variant JIS X 0201-1976-Roman. -@item -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 -of ISO 2022. - - Here are several examples: - -@example -@group -ISO-2022-JP -- Coding system used in Japanese email (RFC 1463 #### check). - 1. G0 <- ASCII, G1..3 <- never used - 2. Yes. - 3. Yes. - 4. Yes. - 5. 7-bit environment - 6. No. - 7. Use ASCII - 8. Use JIS X 0208-1983 -@end group - -@group -ctext -- X11 Compound Text - 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used. - 2. No. - 3. No. - 4. Yes. - 5. 8-bit environment. - 6. No. - 7. Use ASCII. - 8. Use JIS X 0208-1983. -@end group - -@group -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. - 6. No. - 7. Use ASCII. - 8. Use JIS X 0208-1983. -@end group - -@group -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. - 6. Yes. - 7. Use ASCII. - 8. Use JIS X 0208-1983. -@end group -@end example - -MULE creates all of these coding systems by default. - -@node EOL Conversion, Coding System Properties, ISO 2022, Coding Systems +@node EOL Conversion @subsection EOL Conversion @table @code @@ -1008,7 +830,7 @@ internally, and @code{coding-system-property} will return @code{nil}.) @end table -@node Coding System Properties, Basic Coding System Functions, EOL Conversion, Coding Systems +@node Coding System Properties @subsection Coding System Properties @table @code @@ -1020,18 +842,6 @@ 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 @@ -1043,7 +853,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 @@ -1121,7 +931,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 @@ -1132,16 +942,13 @@ CCL program used for encoding (converting to external format). @end table - 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 +@node Basic Coding System Functions @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. @@ -1161,11 +968,6 @@ 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. @@ -1190,7 +992,7 @@ @var{coding-system} with eol type @var{eol-type}. @end defun -@node Coding System Property Functions, Encoding and Decoding Text, Basic Coding System Functions, Coding Systems +@node Coding System Property Functions @subsection Coding System Property Functions @defun coding-system-doc-string coding-system @@ -1205,7 +1007,7 @@ This function returns the @var{prop} property of @var{coding-system}. @end defun -@node Encoding and Decoding Text, Detection of Textual Encoding, Coding System Property Functions, Coding Systems +@node Encoding and Decoding Text @subsection Encoding and Decoding Text @defun decode-coding-region start end coding-system &optional buffer @@ -1226,7 +1028,7 @@ defaults to the current buffer if unspecified. @end defun -@node Detection of Textual Encoding, Big5 and Shift-JIS Functions, Encoding and Decoding Text, Coding Systems +@node Detection of Textual Encoding @subsection Detection of Textual Encoding @defun coding-category-list @@ -1262,20 +1064,20 @@ defaults to the current buffer. @end defun -@node Big5 and Shift-JIS Functions, Predefined Coding Systems, Detection of Textual Encoding, Coding Systems +@node Big5 and Shift-JIS Functions @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 JIS X 0208 character of Shift-JIS coding-system. +This function decodes a JISX0208 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 JIS X 0208 character @var{ch} to SHIFT-JIS +This function encodes a JISX0208 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 @@ -1291,379 +1093,10 @@ 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 @@ -1674,7 +1107,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 @@ -1683,14 +1116,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 @@ -1698,7 +1131,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 @@ -1706,7 +1139,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 @@ -1721,11 +1154,11 @@ * CCL Examples:: The encoding functions for Big5 and KOI-8. @end menu -@node CCL Syntax, CCL Statements, , CCL +@node CCL Syntax, CCL Statements, CCL, 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 := @@ -1784,13 +1217,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 @@ -1803,10 +1236,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 @@ -1820,13 +1253,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 @@ -1835,7 +1268,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 @@ -1843,7 +1276,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 @@ -1851,16 +1284,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. @@ -1876,11 +1309,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. @@ -1888,13 +1321,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 @@ -1928,7 +1361,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 @@ -1937,11 +1370,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 @@ -1978,7 +1411,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 @@ -1988,7 +1421,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 @@ -2003,18 +1436,18 @@ 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 A category table is a type of char table used for keeping track of categories. Categories are used for classifying characters for use in -regexps---you can refer to a category rather than having to use a +regexps -- you can refer to a category rather than having to use a complicated [] expression (and category lookups are significantly faster). diff -r 12e008d41344 -r 697ef44129c6 man/lispref/objects.texi --- a/man/lispref/objects.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/objects.texi Mon Aug 13 11:20:41 2007 +0200 @@ -343,7 +343,7 @@ @node Character Type @subsection Character Type -@cindex @sc{ascii} character codes +@cindex @sc{ASCII} character codes @cindex char-int confoundance disease In XEmacs version 19, and in all versions of FSF GNU Emacs, a @@ -352,7 +352,7 @@ 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}, +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 @@ -363,28 +363,28 @@ 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 +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 +@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} +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 +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 +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. +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 @@ -506,15 +506,15 @@ syntax in your programs. It is a holdover of yet another confoundance disease from earlier Emacsen. (This was used to represent keyboard input with the @key{META} key set, thus the @samp{M}; however, it conflicts -with the legitimate @sc{iso}-8859-1 interpretation of the character code. +with the legitimate @sc{ISO}-8859-1 interpretation of the character code. For example, character code 193 is a lowercase @samp{a} with an acute -accent, in @sc{iso}-8859-1.) +accent, in @sc{ISO}-8859-1.) @ignore @c None of this crap applies to XEmacs. For use in strings and buffers, you are limited to the control -characters that exist in @sc{ascii}, but for keyboard input purposes, +characters that exist in @sc{ASCII}, but for keyboard input purposes, you can turn any character into a control character with @samp{C-}. The -character codes for these non-@sc{ascii} control characters include the +character codes for these non-@sc{ASCII} control characters include the @iftex $2^{26}$ @end iftex @@ -617,9 +617,9 @@ followed by a backslash and the character code in octal (up to three octal digits); thus, @samp{?\101} for the character @kbd{A}, @samp{?\001} for the character @kbd{C-a}, and @code{?\002} for the -character @kbd{C-b}. Although this syntax can represent any @sc{ascii} +character @kbd{C-b}. Although this syntax can represent any @sc{ASCII} character, it is preferred only when the precise octal value is more -important than the @sc{ascii} representation. +important than the @sc{ASCII} representation. @example @group @@ -1521,7 +1521,7 @@ than one if XEmacs is being run on a multi-headed display (e.g. an X server with attached color and mono screens) or if XEmacs is simultaneously driving frames attached to different consoles, e.g. -an X display and a @sc{tty} connection. +an X display and a @sc{TTY} connection. Devices do not have a read syntax. They print in hash notation, giving the device's type, connection name, and a unique number assigned @@ -1544,13 +1544,13 @@ (i.e. displays on which frames exist) are connected. Normally, there is only one console object, but there may be more than one if XEmacs is simultaneously driving frames attached to different X servers and/or -@sc{tty} connections. (XEmacs is capable of driving multiple X and -@sc{tty} connections at the same time, and provides a robust mechanism +@sc{TTY} connections. (XEmacs is capable of driving multiple X and +@sc{TTY} connections at the same time, and provides a robust mechanism for handling the differing display capabilities of such heterogeneous environments. A buffer with embedded glyphs and multiple fonts and colors, for example, will display reasonably if it simultaneously appears on a frame on a color X display, a frame on a mono X display, -and a frame on a @sc{tty} connection.) +and a frame on a @sc{TTY} connection.) Consoles do not have a read syntax. They print in hash notation, giving the console's type, connection name, and a unique number assigned diff -r 12e008d41344 -r 697ef44129c6 man/lispref/os.texi --- a/man/lispref/os.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/os.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1602,7 +1602,7 @@ @code{C-s} and @kbd{C-q} for flow control. Therefore, the choice of @kbd{C-s} and @kbd{C-q} as command characters was uncontroversial. XEmacs, for economy of keystrokes and portability, used nearly all the -@sc{ascii} control characters, with mnemonic meanings when possible; +@sc{ASCII} control characters, with mnemonic meanings when possible; thus, @kbd{C-s} for search and @kbd{C-q} for quote. Later, some terminals were introduced which required these characters diff -r 12e008d41344 -r 697ef44129c6 man/lispref/permute-index --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/lispref/permute-index Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,102 @@ +#!/bin/csh -f +# Generate a permuted index of all names. +# The result is a file called index.fns. + +# You will need to modify this for your needs. + + +set TEXINDEX=texindex # path to texindex command +#set EMACS=xemacs # your emacs command +#set TEX=tex # your tex command + +set MANUAL=lispref # the base name of the manual + +# goto 3 + +1: +echo "Extract raw index from texinfo fn index." +# Let texindex combine duplicate entries, later. +# But it wants to protect non-alphanumerics thus confusing ptx. +# Also change `\ ' to just a ` ', since texindex will fail. This is produced +# by `@findex two words' in an example environment (no doubt among others). +# delete wrapper parens +# change dots {} to dots{} +# change {-} to char form, so ptx wont ignore it. +# delete leading \entry { +# change '\ ' to ' ' +# change lines with = < > since they mess up field extraction. +# separate into fields delimited by " +cat ${MANUAL}.fn | \ + sed \ + -e 's/(\([^)]*\))/\1/' \ + -e 's/\\dots {}/(\\dots{})/' \ + -e "s/{-}/{{\\tt\\char'055}}/" \ + -e 's,^[^ ]* {,,' \ + -e 's, },},' \ + -e 's,\\ , ,g' \ + -e 's/{\\tt\\char61}/=/' \ + -e 's/{\\tt\\gtr}/>/' \ + -e 's/{\\tt\\less}/</' \ + -e 's/}{/"/g' \ + | awk -F\" '{print $2, $1}' >! permuted.raw + +2: +# Build break file for ptx. +cat <<EOF > permuted.break +- +: +EOF +# Build the ignore file for ptx. +# We would like to ignore "and", "or", and "for", +# but ptx ignores ignore words even if they stand alone. +cat <<EOF > permuted.ignore +the +in +to +as +a +an +of +on +them +how +from +by +EOF + +echo "Make troff permuted index." +ptx -i permuted.ignore -b permuted.break -f -r -w 144 \ + < permuted.raw >! permuted.t + +3: +echo "Extract the desired fields." +awk -F\" '{printf "%s\"%s\"%s\n", $4,$6,$9}' permuted.t >! permuted.fields + +4: +echo "Format for texindex." +# delete lines that start with "and ", "for " +sed < permuted.fields \ + -e 's/=/{\\tt\\char61}/' \ + -e 's/>/{\\tt\\gtr}/' \ + -e 's/</{\\tt\\less}/' \ + -e '/"and /d' \ + -e '/"for /d' \ + | awk -F\" 'NF>0 {if ($1=="") {\ + print "\entry {" $2 "}{" 0+$3 "}{" $2 "}" }\ + else {\ + print "\entry {" $2 ", " $1 "}{" 0+$3 "}{" $2 ", " $1 "}"} }'\ + > permuted.fn + +5: +echo "Sort with texindex." +${TEXINDEX} permuted.fn +#mv permuted.fns ${MANUAL}.fns + +# The resulting permuted.fns will be read when we run TeX +# on the manual the second time. Or you can use permuted.texinfo here. +#${TEX} permuted.texinfo + +6: +echo "Clean up." +rm -f permuted.fields permuted.t permuted.raw +rm -f permuted.break permuted.ignore permuted.fn diff -r 12e008d41344 -r 697ef44129c6 man/lispref/postgresql.texi --- a/man/lispref/postgresql.texi Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1257 +0,0 @@ -@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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -@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{} #<PGresult PGRES_COMMAND_OK - CREATE> -@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{} #<PGresult PGRES_COMMAND_OK[3] - DELETE 3> -@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{} #<PGresult DEAD> -@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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} <A fatal error is signaled in the echo area> -(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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} #<PGresult PGRES_TUPLES_OK[5] - SELECT> -(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{} #<PGresult PGRES_COMMAND_OK[1] - INSERT 542086 1> -(pq-cmd-status R) - @result{} "INSERT 542086 1" -(setq R (pq-exec P "UPDATE xemacs_test SET rank='retired' - WHERE shikona='Wakanohana';")) - @result{} #<PGresult PGRES_COMMAND_OK[1] - UPDATE 1> -(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{} #<PGresult PGRES_COMMAND_OK[1] - INSERT 38688 1> -(pq-cmd-tuples R) - @result{} "1" -(setq R (pq-exec P "SELECT * from xemacs_test;")) - @result{} #<PGresult PGRES_TUPLES_OK[7] - SELECT> -(pq-cmd-tuples R) - @result{} "" -(setq R (pq-exec P "DELETE FROM xemacs_test - WHERE shikona LIKE '%hana';")) - @result{} #<PGresult PGRES_COMMAND_OK[2] - DELETE 2> -(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{} #<PGresult PGRES_COMMAND_OK[1] - INSERT 542089 1> -(pq-oid-value R) - @result{} 542089 -(setq R (pq-exec P "SELECT shikona FROM xemacs_test - WHERE rank='Maegashira';")) - @result{} #<PGresult PGRES_TUPLES_OK[2] - SELECT> -(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{} #<PGconn localhost:25432 steve/japanese> -@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 - #<PGconn BAD> -@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{} #<PGconn DEAD> -@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{} #<PGresult PGRES_COMMAND_OK[1] - DELETE 1> -@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{} #<PGconn localhost:25432 steve/steve> -@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{} #<PGconn localhost:25432 steve/steve> -@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{} (#<PGresult PGRES_TUPLES_OK - SELECT>) -@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{} (#<PGresult PGRES_TUPLES_OK - SELECT> #<PGresult PGRES_TUPLES_OK - SELECT> #<PGresult PGRES_TUPLES_OK - SELECT>) -@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{} #<PGresult PGRES_TUPLES_OK - SELECT> -(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{} #<PGresult PGRES_COMMAND_OK - COMMIT> -@end example diff -r 12e008d41344 -r 697ef44129c6 man/lispref/scrollbars.texi --- a/man/lispref/scrollbars.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/scrollbars.texi Mon Aug 13 11:20:41 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, Gutter, top -@chapter Scrollbars +@node Scrollbars, Drag and Drop, Toolbar, top +@chapter scrollbars @cindex scrollbars Not yet documented. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/sequences.texi --- a/man/lispref/sequences.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/sequences.texi Mon Aug 13 11:20:41 2007 +0200 @@ -264,7 +264,7 @@ @item They usually occupy one-fourth the space of a vector of the same elements. (This is one-eighth the space for 64-bit machines such as the -DEC Alpha, and may also be different when @sc{mule} support is compiled +DEC Alpha, and may also be different when @sc{MULE} support is compiled into XEmacs.) @item diff -r 12e008d41344 -r 697ef44129c6 man/lispref/specifiers.texi --- a/man/lispref/specifiers.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/specifiers.texi Mon Aug 13 11:20:41 2007 +0200 @@ -22,27 +22,27 @@ @end defun @menu -* Introduction to Specifiers:: Specifiers provide a clean way for - display and other properties to vary - (under user control) in a wide variety - of contexts. -* Specifiers In-Depth:: Gory details about specifier innards. -* Specifier Instancing:: Instancing means obtaining the ``value'' of - a specifier in a particular context. -* Specifier Types:: Specifiers come in different flavors. -* Adding Specifications:: Specifications control a specifier's ``value'' - by giving conditions under which a - particular value is valid. -* Retrieving Specifications:: Querying a specifier's specifications. -* Specifier Tag Functions:: Working with specifier tags. +* Introduction to Specifiers:: Specifiers provide a clean way for + display and other properties to vary + (under user control) in a wide variety + of contexts. +* Specifiers In-Depth:: Gory details about specifier innards. +* Specifier Instancing:: Instancing means obtaining the ``value'' of + a specifier in a particular context. +* Specifier Types:: Specifiers come in different flavors. +* Adding Specifications:: Specifications control a specifier's ``value'' + by giving conditions under which a + particular value is valid. +* Retrieving Specifications:: Querying a specifier's specifications. +* Specifier Tag Functions:: Working with specifier tags. * Specifier Instancing Functions:: - Functions to instance a specifier. -* Specifier Example:: Making all this stuff clearer. -* Creating Specifiers:: Creating specifiers for your own use. + Functions to instance a specifier. +* Specifier Example:: Making all this stuff clearer. +* Creating Specifiers:: Creating specifiers for your own use. * Specifier Validation Functions:: - Validating the components of a specifier. + Validating the components of a specifier. * Other Specification Functions:: - Other ways of working with specifications. + Other ways of working with specifications. @end menu @node Introduction to Specifiers @@ -169,7 +169,7 @@ User-defined tags may be defined, with an optional predicate specified. An application can create its own tag, use it to mark all its instantiators, and be fairly confident that it will not interfere with -other applications that modify the same specifier---Functions that add +other applications that modify the same specifier -- Functions that add a specification to a specifier usually only overwrite existing inst-pairs with the same tag set as was given, and a particular tag or tag set can be specified when removing instantiators. @@ -196,7 +196,7 @@ different font names, with possibly different foundries, widths, etc., on different devices), the extra properties of that font on that device, etc. Furthermore, this conversion (called @dfn{instantiation}) -might fail---a font or color might not exist on a particular device, +might fail -- a font or color might not exist on a particular device, for example. @node Specifier Instancing @@ -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 or more specifier tags, +A specifier tag set consists of a list of zero of 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 @@ -861,9 +861,9 @@ @result{} ((#<buffer "device.c"> (nil . "forest green")) (#<window on "Makefile" 0x8a2b> (nil . "hot pink")) (#<x-frame "emacs" 0x4ac> (nil . "puke orange") - (nil . "moccasin")) + (nil . "moccasin")) (#<x-frame "VM" 0x4ac> (nil . "magenta")) - (global ((tty) . "cyan") (nil . "white")) + (global ((tty) . "cyan") (nil . "white")) ) @end example @@ -890,7 +890,7 @@ @enumerate @item First, we look for a specification matching the buffer displayed in the -window, i.e. @samp{*scratch*}. There are none, so we proceed. +window, i.e. @samp{*scratch}. There are none, so we proceed. @item Then, we look for a specification matching the window itself. Again, there are none. @@ -934,11 +934,11 @@ @code{face-boolean}, or @code{toolbar}. For more information on particular types of specifiers, see the -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}. +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}. @end defun @defun make-specifier-and-init type spec-list &optional dont-canonicalize @@ -954,59 +954,6 @@ 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 12e008d41344 -r 697ef44129c6 man/lispref/strings.texi --- a/man/lispref/strings.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/strings.texi Mon Aug 13 11:20:41 2007 +0200 @@ -18,7 +18,7 @@ Lisp programs use strings more often than individual characters. @menu -* String Basics:: Basic properties of strings and characters. +* Basics: String Basics. Basic properties of strings and characters. * Predicates for Strings:: Testing whether an object is a string or char. * Creating Strings:: Functions to allocate new strings. * Predicates for Characters:: Testing whether an object is a character. @@ -45,8 +45,8 @@ The length of a string (like any array) is fixed and independent of the string contents, and cannot be altered. Strings in Lisp are @emph{not} terminated by a distinguished character code. (By contrast, -strings in C are terminated by a character with @sc{ascii} code 0.) -This means that any character, including the null character (@sc{ascii} +strings in C are terminated by a character with @sc{ASCII} code 0.) +This means that any character, including the null character (@sc{ASCII} code 0), is a valid element of a string.@refill Since strings are considered arrays, you can operate on them with the @@ -321,15 +321,15 @@ @item 0 - 31 Control set 0 @item 32 - 127 -@sc{ascii} +@sc{ASCII} @item 128 - 159 Control set 1 @item 160 - 255 Right half of ISO-8859-1 @end table -If support for @sc{mule} does not exist, these are the only valid -character values. When @sc{mule} support exists, the values assigned to +If support for @sc{MULE} does not exist, these are the only valid +character values. When @sc{MULE} support exists, the values assigned to other characters may vary depending on the particular version of XEmacs, the order in which character sets were loaded, etc., and you should not depend on them. @@ -427,9 +427,9 @@ @var{string2}, then @var{string1} is greater, and this function returns @code{nil}. If the two strings match entirely, the value is @code{nil}. -Pairs of characters are compared by their @sc{ascii} codes. Keep in +Pairs of characters are compared by their @sc{ASCII} codes. Keep in mind that lower case letters have higher numeric values in the -@sc{ascii} character set than their upper case counterparts; numbers and +@sc{ASCII} character set than their upper case counterparts; numbers and many punctuation characters have a lower numeric value than upper case letters. @@ -515,7 +515,7 @@ This function returns the first character in @var{string}. If the string is empty, the function returns 0. (Under XEmacs 19, the value is also 0 when the first character of @var{string} is the null character, -@sc{ascii} code 0.) +@sc{ASCII} code 0.) @example (string-to-char "ABC") @@ -610,14 +610,14 @@ @cindex string properties @cindex properties of strings -Just as with symbols, extents, faces, and glyphs, you can attach +Similar to 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-plist} to retrieve a list of +a property from a string and @code{object-props} to retrieve a list of all the properties in a string. @node Formatting Strings @@ -910,7 +910,7 @@ modify the strings that are passed to them as arguments. The examples below use the characters @samp{X} and @samp{x} which have -@sc{ascii} codes 88 and 120 respectively. +@sc{ASCII} codes 88 and 120 respectively. @defun downcase string-or-char This function converts a character or a string to lower case. @@ -995,7 +995,7 @@ case letters. It affects both the string and character case conversion functions (see the previous section) and those that apply to text in the buffer (@pxref{Case Changes}). You need a case table if you are using a -language which has letters other than the standard @sc{ascii} letters. +language which has letters other than the standard @sc{ASCII} letters. A case table is a list of this form: @@ -1022,7 +1022,7 @@ The element @var{equivalences} is a map that cyclicly permutes each equivalence class (of characters with the same canonical equivalent). -(For ordinary @sc{ascii}, this would map @samp{a} into @samp{A} and +(For ordinary @sc{ASCII}, this would map @samp{a} into @samp{A} and @samp{A} into @samp{a}, and likewise for each set of equivalent characters.) @@ -1063,7 +1063,7 @@ @end defun The following three functions are convenient subroutines for packages -that define non-@sc{ascii} character sets. They modify a string +that define non-@sc{ASCII} character sets. They modify a string @var{downcase-table} provided as an argument; this should be a string to be used as the @var{downcase} part of a case table. They also modify the standard syntax table. @xref{Syntax Tables}. @@ -1109,7 +1109,7 @@ this section, exist only in XEmacs 20. In XEmacs 19, char tables are generally implemented using a vector of 256 elements. -When @sc{mule} support exists, the types of ranges that can be assigned +When @sc{MULE} support exists, the types of ranges that can be assigned values are @itemize @bullet @@ -1123,7 +1123,7 @@ a single character @end itemize -When @sc{mule} support is not present, the types of ranges that can be +When @sc{MULE} support is not present, the types of ranges that can be assigned values are @itemize @bullet @@ -1154,7 +1154,7 @@ that a character is in. The valid values are @code{nil} or a bit vector of 95 elements. Higher-level Lisp functions are provided for working with category tables. Currently categories -and category tables only exist when @sc{mule} support is present. +and category tables only exist when @sc{MULE} support is present. @item char A generalized char table, for mapping from one character to another. Used for case tables, syntax matching tables, @@ -1203,10 +1203,10 @@ @item @code{t} (all characters are affected) @item -A charset (only allowed when @sc{mule} support is present) +A charset (only allowed when @sc{MULE} support is present) @item A vector of two elements: a two-octet charset and a row number -(only allowed when @sc{mule} support is present) +(only allowed when @sc{MULE} support is present) @item A single character @end itemize diff -r 12e008d41344 -r 697ef44129c6 man/lispref/symbols.texi --- a/man/lispref/symbols.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/symbols.texi Mon Aug 13 11:20:41 2007 +0200 @@ -378,14 +378,14 @@ @cindex plist, symbol A @dfn{property list} (@dfn{plist} for short) is a list of paired -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 +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 where it was defined, or perhaps even the grammatical class of the symbol (representing a word) in a language-understanding system. - Some objects which are not symbols also have property lists associated + Many objects other than symbols can 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. -* Object Plists:: Functions to access objects' property lists. +* Symbol Plists:: Functions to access symbols' property lists. * Other Plists:: Accessing property lists stored elsewhere. @end menu @@ -441,22 +441,13 @@ are pushed on the front of the list and later discarded; this is not possible with a property list. -@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. +@node Symbol Plists +@subsection Property List Functions for Symbols @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 @@ -472,24 +463,23 @@ 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}). But generally, its use is discouraged. Use -@code{put} instead. @code{setplist} can only be used with symbols, not -other object types. +(@pxref{Abbrevs}). @end defun -@defun get object property &optional default +@defun get symbol property This function finds the value of the property named @var{property} in -@var{object}'s property list. If there is no such property, -@code{default} (which itself defaults to @code{nil}) is returned. +@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{property} is compared with the existing properties using @code{eq}, -so any object is a legitimate property. +The name @var{property} is compared with the existing property names +using @code{eq}, so any object is a legitimate property. See @code{put} for an example. @end defun -@defun put object property value -This function puts @var{value} onto @var{object}'s property list under +@defun put symbol property value +This function puts @var{value} onto @var{symbol}'s property list under the property name @var{property}, replacing any previous property value. The @code{put} function returns @var{value}. @@ -500,24 +490,13 @@ @result{} (a buzzing little bug) (get 'fly 'verb) @result{} transitive -(object-plist 'fly) +(symbol-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 Not Associated with Objects +@subsection Property Lists Outside Symbols These functions are useful for manipulating property lists that are stored in places other than symbols: diff -r 12e008d41344 -r 697ef44129c6 man/lispref/text.texi --- a/man/lispref/text.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/text.texi Mon Aug 13 11:20:41 2007 +0200 @@ -70,13 +70,12 @@ and always operated on the current buffer.) -@defun char-after &optional position buffer +@defun char-after position &optional buffer This function returns the character in the buffer at (i.e., immediately after) position @var{position}. If @var{position} is out of range for this purpose, either before the beginning of the buffer, or at -or beyond the end, then the value is @code{nil}. The default for -@var{position} is point. If optional argument @var{buffer} is -@code{nil}, the current buffer is assumed. +or beyond the end, then the value is @code{nil}. If optional argument +@var{buffer} is @code{nil}, the current buffer is assumed. In the following example, assume that the first character in the buffer is @samp{@@}: @@ -89,15 +88,6 @@ @end example @end defun -@defun char-before &optional position buffer -This function returns the character in the current buffer immediately -before position @var{position}. If @var{position} is out of range for -this purpose, either at or before the beginning of the buffer, or beyond -the end, then the value is @code{nil}. The default for -@var{position} is point. If optional argument @var{buffer} is -@code{nil}, the current buffer is assumed. -@end defun - @defun following-char &optional buffer This function returns the character following point in the buffer. This is similar to @code{(char-after (point))}. However, if point is at @@ -1488,7 +1478,7 @@ and so on. If a mismatch is found, it means that the sort keys are unequal; the sort key whose character is less at the point of first mismatch is the lesser sort key. The individual characters are compared -according to their numerical values. Since Emacs uses the @sc{ascii} +according to their numerical values. Since Emacs uses the @sc{ASCII} character set, the ordering in that set determines alphabetical order. @c version 19 change @@ -2474,59 +2464,18 @@ @defun translate-region start end table This function applies a translation table to the characters in the -buffer between positions @var{start} and @var{end}. The translation -table @var{table} can be either a string, a vector, or a char-table. - -If @var{table} is a string, its @var{n}th element is the mapping for the -character with code @var{n}. - -If @var{table} is a vector, its @var{n}th element is the mapping for -character with code @var{n}. Legal mappings are characters, strings, or -@code{nil} (meaning don't replace.) - -If @var{table} is a char-table, its elements describe the mapping -between characters and their replacements. The char-table should be of -type @code{char} or @code{generic}. - -When the @var{table} is a string or vector and its length is less than -the total number of characters (256 without Mule), any characters with -codes larger than the length of @var{table} are not altered by the -translation. +buffer between positions @var{start} and @var{end}. + +The translation table @var{table} is a string; @code{(aref @var{table} +@var{ochar})} gives the translated character corresponding to +@var{ochar}. If the length of @var{table} is less than 256, any +characters with codes larger than the length of @var{table} are not +altered by the translation. The return value of @code{translate-region} is the number of characters that were actually changed by the translation. This does not count characters that were mapped into themselves in the translation table. - -@strong{NOTE}: Prior to XEmacs 21.2, the @var{table} argument was -allowed only to be a string. This is still the case in FSF Emacs. - -The following example creates a char-table that is passed to -@code{translate-region}, which translates character @samp{a} to -@samp{the letter a}, removes character @samp{b}, and translates -character @samp{c} to newline. - -@example -@group ----------- Buffer: foo ---------- -Here is a sentence in the buffer. ----------- Buffer: foo ---------- -@end group - -@group -(let ((table (make-char-table 'generic))) - (put-char-table ?a "the letter a" table) - (put-char-table ?b "" table) - (put-char-table ?c ?\n table) - (translate-region (point-min) (point-max) table)) - @result{} 3 - ----------- Buffer: foo ---------- -Here is the letter a senten -e in the uffer. ----------- Buffer: foo ---------- -@end group -@end example @end defun @node Registers diff -r 12e008d41344 -r 697ef44129c6 man/lispref/toolbar.texi --- a/man/lispref/toolbar.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/toolbar.texi Mon Aug 13 11:20:41 2007 +0200 @@ -3,15 +3,13 @@ @c Copyright (C) 1995, 1996 Ben Wing. @c See the file lispref.texi for copying conditions. @setfilename ../../info/toolbar.info -@node Toolbar, Gutter, Dialog Boxes, top +@node Toolbar, Scrollbars, Dialog Boxes, top @chapter Toolbar @cindex toolbar @menu * Toolbar Intro:: An introduction. -* Creating Toolbar:: How to create a toolbar. -* Toolbar Descriptor Format:: Accessing and modifying a toolbar's - properties. +* Toolbar Descriptor Format:: How to create a toolbar. * Specifying the Toolbar:: Setting a toolbar's contents. * Other Toolbar Variables:: Controlling the size of toolbars. @end menu @@ -20,7 +18,7 @@ @section Toolbar Intro A @dfn{toolbar} is a bar of icons displayed along one edge of a frame. -You can view a toolbar as a series of menu shortcuts---the most +You can view a toolbar as a series of menu shortcuts -- the most common menu options can be accessed with a single click rather than a series of clicks and/or drags to select the option from a menu. Consistent with this, a help string (called the @dfn{help-echo}) @@ -59,27 +57,6 @@ 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 @@ -369,7 +346,7 @@ buffer does not specify a left toolbar or has a nil value specified for @code{left-toolbar-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 toolbar but the +87 characters -- the frame is sized for a 68-pixel left toolbar but the selected window specifies that the left toolbar is not visible, so it is expanded to take up the slack. diff -r 12e008d41344 -r 697ef44129c6 man/lispref/tooltalk.texi --- a/man/lispref/tooltalk.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/tooltalk.texi Mon Aug 13 11:20:41 2007 +0200 @@ -138,7 +138,7 @@ Send a reply to this message. The second argument can be @code{reply}, @code{reject} or @code{fail}; the default is @code{reply}. Before sending a reply, all message arguments whose mode is @code{TT_INOUT} or -@code{TT_OUT} should have been filled in---see +@code{TT_OUT} should have been filled in -- see @code{set-tooltalk-message-attribute}. @refill @end defun diff -r 12e008d41344 -r 697ef44129c6 man/lispref/x-windows.texi --- a/man/lispref/x-windows.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/lispref/x-windows.texi Mon Aug 13 11:20:41 2007 +0200 @@ -18,9 +18,9 @@ generalize well, and they are covered specially here. @menu -* X Selections:: Transferring text to and from other X clients. -* X Server:: Information about the X server connected to - a particular device. +* X Selections:: Transferring text to and from other X clients. +* X Server:: Information about the X server connected to + a particular device. * X Miscellaneous:: Other X-specific functions and variables. @end menu @@ -86,9 +86,9 @@ the X server XEmacs is using. @menu -* Resources:: Getting resource values from the server. -* Server Data:: Getting info about the X server. -* Grabs:: Restricting access to the server by other apps. +* Resources:: Getting resource values from the server. +* Server Data:: Getting info about the X server. +* Grabs:: Restricting access to the server by other apps. @end menu @node Resources @@ -161,8 +161,8 @@ @example @code{XrmGetResource (db, "xemacs.buffer.@var{buffer-name}.foreground", - "Emacs.EmacsLocaleType.EmacsBuffer.Foreground", - "String");} + "Emacs.EmacsLocaleType.EmacsBuffer.Foreground", + "String");} @end example @item @@ -176,8 +176,8 @@ @example @code{XrmGetResource (db, "xemacs.frame.@var{frame-name}.foreground", - "Emacs.EmacsLocaleType.EmacsFrame.Foreground", - "String");} + "Emacs.EmacsLocaleType.EmacsFrame.Foreground", + "String");} @end example @item @@ -191,8 +191,8 @@ @example @code{XrmGetResource (db, "xemacs.device.@var{device-name}.foreground", - "Emacs.EmacsLocaleType.EmacsDevice.Foreground", - "String");} + "Emacs.EmacsLocaleType.EmacsDevice.Foreground", + "String");} @end example @item @@ -206,8 +206,8 @@ @example @code{XrmGetResource (db, "xemacs.foreground", - "Emacs.Foreground", - "String");} + "Emacs.Foreground", + "String");} @end example @end enumerate @@ -278,7 +278,7 @@ @defun x-grab-keyboard &optional device This function grabs the keyboard on the given device (defaulting to the selected one). So long as the keyboard is grabbed, all keyboard events -will be delivered to XEmacs---it is not possible for other X clients to +will be delivered to XEmacs -- it is not possible for other X clients to eavesdrop on them. Ungrab the keyboard with @code{x-ungrab-keyboard} (use an @code{unwind-protect}). Returns @code{t} if the grab was successful; @code{nil} otherwise. diff -r 12e008d41344 -r 697ef44129c6 man/make-stds.texi --- a/man/make-stds.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/make-stds.texi Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,6 @@ @end ifclear @end iftex describes conventions for writing the Makefiles for GNU programs. -Using Automake will help you write a Makefile that follows these -conventions. @menu * Makefile Basics:: General Conventions for Makefiles @@ -30,8 +28,6 @@ * Command Variables:: Variables for Specifying Commands * Directory Variables:: Variables for Installation Directories * Standard Targets:: Standard Targets for Users -* Install Command Categories:: Three categories of commands in the `install' - rule: normal, pre-install and post-install. @end menu @node Makefile Basics @@ -69,10 +65,9 @@ of the source code. Without one of these prefixes, the current search path is used. -The distinction between @file{./} (the @dfn{build directory}) and -@file{$(srcdir)/} (the @dfn{source directory}) is important because -users can build in a separate directory using the @samp{--srcdir} option -to @file{configure}. A rule of the form: +The distinction between @file{./} and @file{$(srcdir)/} is important +when using the @samp{--srcdir} option to @file{configure}. A rule of +the form: @smallexample foo.1 : foo.man sedscript @@ -80,8 +75,9 @@ @end smallexample @noindent -will fail when the build directory is not the source directory, because -@file{foo.man} and @file{sedscript} are in the the source directory. +will fail when the current directory is not the source directory, +because @file{foo.man} and @file{sedscript} are not in the current +directory. When using GNU @code{make}, relying on @samp{VPATH} to find the source file will work in the case where there is a single dependency file, @@ -113,18 +109,6 @@ sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@ @end smallexample -GNU distributions usually contain some files which are not source -files---for example, Info files, and the output from Autoconf, Automake, -Bison or Flex. Since these files normally appear in the source -directory, they should always appear in the source directory, not in the -build directory. So Makefile rules to update them should put the -updated files in the source directory. - -However, if a file does not appear in the distribution, then the -Makefile should not put it in the source directory, because building a -program in ordinary circumstances should not modify the source directory -in any way. - Try to make the build and installation targets, at least (and all their subtargets) work correctly with a parallel @code{make}. @@ -138,17 +122,11 @@ The @code{configure} script and the Makefile rules for building and installation should not use any utilities directly except these: -@c dd find -@c gunzip gzip md5sum -@c mkfifo mknod tee uname - @example -cat cmp cp diff echo egrep expr false grep install-info -ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true +cat cmp cp echo egrep expr false grep +ln mkdir mv pwd rm rmdir sed test touch true @end example -The compression program @code{gzip} can be used in the @code{dist} rule. - Stick to the generally supported options for these programs. For example, don't use @samp{mkdir -p}, convenient as it may be, because most systems don't support it. @@ -162,33 +140,26 @@ mean: @example -ar bison cc flex install ld ldconfig lex +ar bison cc flex install ld lex make makeinfo ranlib texi2dvi yacc @end example -Use the following @code{make} variables to run those programs: +Use the following @code{make} variables: @example -$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX) +$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) @end example -When you use @code{ranlib} or @code{ldconfig}, you should make sure -nothing bad happens if the system does not have the program in question. -Arrange to ignore an error from that command, and print a message before -the command to tell the user that failure of this command does not mean -a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with -this.) +When you use @code{ranlib}, you should make sure nothing bad happens if +the system does not have @code{ranlib}. Arrange to ignore an error +from that command, and print a message before the command to tell the +user that failure of the @code{ranlib} command does not mean a problem. +(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.) If you use symbolic links, you should implement a fallback for systems that don't have symbolic links. -Additional utilities that can be used via Make variables are: - -@example -chgrp chmod chown mknod -@end example - It is ok to use other utilities in Makefile portions (or scripts) intended only for particular systems where you know those utilities exist. @@ -211,12 +182,11 @@ Each program-name variable should come with an options variable that is used to supply options to the program. Append @samp{FLAGS} to the program-name variable name to get the options variable name---for -example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C -compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are -exceptions to this rule, but we keep them because they are standard.) -Use @code{CPPFLAGS} in any compilation command that runs the -preprocessor, and use @code{LDFLAGS} in any compilation command that -does linking as well as in any direct use of @code{ld}. +example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to +this rule, but we keep it because it is standard.) Use @code{CPPFLAGS} +in any compilation command that runs the preprocessor, and use +@code{LDFLAGS} in any compilation command that does linking as well as +in any direct use of @code{ld}. If there are C compiler options that @emph{must} be used for proper compilation of certain files, do not include them in @code{CFLAGS}. @@ -242,9 +212,6 @@ containing compiler options, so the user can use @code{CFLAGS} to override the others. -@code{CFLAGS} should be used in every invocation of the C compiler, -both those which do compilation and those which do linking. - Every Makefile should define the variable @code{INSTALL}, which is the basic command for installing a file into the system. @@ -259,18 +226,6 @@ $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a @end example -Optionally, you may prepend the value of @code{DESTDIR} to the target -filename. Doing this allows the installer to create a snapshot of the -installation to be copied onto the real target filesystem later. Do not -set the value of @code{DESTDIR} in your Makefile, and do not include it -in any installed files. With support for @code{DESTDIR}, the above -examples become: - -@example -$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo -$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a -@end example - @noindent Always use a file name, not a directory name, as the second argument of the installation commands. Use a separate command for each file to be @@ -297,10 +252,6 @@ @file{/usr} will be a symbolic link to @file{/}. (If you are using Autoconf, write it as @samp{@@prefix@@}.) -Running @samp{make install} with a different value of @code{prefix} -from the one used to build the program should @var{not} recompile -the program. - @item exec_prefix A prefix used in constructing the default values of some of the variables listed below. The default value of @code{exec_prefix} should @@ -310,10 +261,6 @@ Generally, @code{$(exec_prefix)} is used for directories that contain machine-specific files (such as executables and subroutine libraries), while @code{$(prefix)} is used directly for other directories. - -Running @samp{make install} with a different value of @code{exec_prefix} -from the one used to build the program should @var{not} recompile the -program. @end table Executable programs are installed in one of the following directories. @@ -381,11 +328,14 @@ write it as @file{$(prefix)/etc}. (If you are using Autoconf, write it as @samp{@@sysconfdir@@}.) -Do not install executables here in this directory (they probably belong -in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install -files that are modified in the normal course of their use (programs -whose purpose is to change the configuration of the system excluded). -Those probably belong in @file{$(localstatedir)}. +@c rewritten to avoid overfull hbox --tower +Do not install executables +@c here +in this directory (they probably +belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not +install files that are modified in the normal course of their use +(programs whose purpose is to change the configuration of the system +excluded). Those probably belong in @file{$(localstatedir)}. @item sharedstatedir The directory for installing architecture-independent data files which @@ -416,20 +366,6 @@ as @file{$(prefix)/info}. (If you are using Autoconf, write it as @samp{@@infodir@@}.) -@item lispdir -The directory for installing any Emacs Lisp files in this package. By -default, it should be @file{/usr/local/share/emacs/site-lisp}, but it -should be written as @file{$(prefix)/share/emacs/site-lisp}. - -If you are using Autoconf, write the default as @samp{@@lispdir@@}. -In order to make @samp{@@lispdir@@} work, you need the following lines -in your @file{configure.in} file: - -@example -lispdir='$@{datadir@}/emacs/site-lisp' -AC_SUBST(lispdir) -@end example - @item includedir @c rewritten to avoid overfull hbox --roland The directory for installing header files to be included by user @@ -438,7 +374,7 @@ @file{$(prefix)/include}. (If you are using Autoconf, write it as @samp{@@includedir@@}.) -Most compilers other than GCC do not look for header files in directory +Most compilers other than GCC do not look for header files in @file{/usr/local/include}. So installing the header files this way is only useful with GCC. Sometimes this is not a problem because some libraries are only really intended to work with GCC. But some libraries @@ -507,7 +443,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 Autoconf, use @samp{srcdir = @@srcdir@@}.) +(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.) @end table For example: @@ -590,12 +526,11 @@ @comment This example has been carefully formatted for the Make manual. @comment Please do not reformat it without talking to roland@gnu.ai.mit.edu. @smallexample -$(DESTDIR)$(infodir)/foo.info: foo.info - $(POST_INSTALL) +$(infodir)/foo.info: foo.info # There may be a newer info file in . than in srcdir. -if test -f foo.info; then d=.; \ else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \ + $(INSTALL_DATA) $$d/foo.info $@@; \ # Run install-info only if it exists. # Use `if' instead of just prepending `-' to the # line so we notice real errors from install-info. @@ -603,29 +538,22 @@ # fail gracefully when there is an unknown command. if $(SHELL) -c 'install-info --version' \ >/dev/null 2>&1; then \ - install-info --dir-file=$(DESTDIR)$(infodir)/dir \ - $(DESTDIR)$(infodir)/foo.info; \ + install-info --dir-file=$(infodir)/dir \ + $(infodir)/foo.info; \ else true; fi @end smallexample -When writing the @code{install} target, you must classify all the -commands into three categories: normal ones, @dfn{pre-installation} -commands and @dfn{post-installation} commands. @xref{Install Command -Categories}. - @item uninstall -Delete all the installed files---the copies that the @samp{install} -target creates. +Delete all the installed files that the @samp{install} target would +create (but not the noninstalled files such as @samp{make all} would +create). This rule should not modify the directories where compilation is done, only the directories where files are installed. -The uninstallation commands are divided into three categories, just like -the installation commands. @xref{Install Command Categories}. - @item install-strip Like @code{install}, but strip the executable files while installing -them. In many cases, the definition of this target can be very simple: +them. The definition of this target can be very simple: @smallexample install-strip: @@ -710,12 +638,6 @@ run the @code{makeinfo} program, which is part of the Texinfo distribution. -Normally a GNU distribution comes with Info files, and that means the -Info files are present in the source directory. Therefore, the Make -rule for an info file should update it in the source directory. When -users build the package, ordinarily Make will not update the Info files -because they will already be up to date. - @item dvi Generate DVI files for all Texinfo documentation. For example: @@ -747,7 +669,7 @@ named, use @code{ln} or @code{cp} to install the proper files in it, and then @code{tar} that subdirectory. -Compress the tar file file with @code{gzip}. For example, the actual +Compress the tar file with @code{gzip}. For example, the actual distribution file for GCC version 1.40 is called @file{gcc-1.40.tar.gz}. The @code{dist} target should explicitly depend on all non-source files @@ -798,119 +720,3 @@ This rule should not modify the directories where compilation is done. It should do nothing but create installation directories. @end table - -@node Install Command Categories -@section Install Command Categories - -@cindex pre-installation commands -@cindex post-installation commands -When writing the @code{install} target, you must classify all the -commands into three categories: normal ones, @dfn{pre-installation} -commands and @dfn{post-installation} commands. - -Normal commands move files into their proper places, and set their -modes. They may not alter any files except the ones that come entirely -from the package they belong to. - -Pre-installation and post-installation commands may alter other files; -in particular, they can edit global configuration files or data bases. - -Pre-installation commands are typically executed before the normal -commands, and post-installation commands are typically run after the -normal commands. - -The most common use for a post-installation command is to run -@code{install-info}. This cannot be done with a normal command, since -it alters a file (the Info directory) which does not come entirely and -solely from the package being installed. It is a post-installation -command because it needs to be done after the normal command which -installs the package's Info files. - -Most programs don't need any pre-installation commands, but we have the -feature just in case it is needed. - -To classify the commands in the @code{install} rule into these three -categories, insert @dfn{category lines} among them. A category line -specifies the category for the commands that follow. - -A category line consists of a tab and a reference to a special Make -variable, plus an optional comment at the end. There are three -variables you can use, one for each category; the variable name -specifies the category. Category lines are no-ops in ordinary execution -because these three Make variables are normally undefined (and you -@emph{should not} define them in the makefile). - -Here are the three possible category lines, each with a comment that -explains what it means: - -@smallexample - $(PRE_INSTALL) # @r{Pre-install commands follow.} - $(POST_INSTALL) # @r{Post-install commands follow.} - $(NORMAL_INSTALL) # @r{Normal commands follow.} -@end smallexample - -If you don't use a category line at the beginning of the @code{install} -rule, all the commands are classified as normal until the first category -line. If you don't use any category lines, all the commands are -classified as normal. - -These are the category lines for @code{uninstall}: - -@smallexample - $(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.} - $(POST_UNINSTALL) # @r{Post-uninstall commands follow.} - $(NORMAL_UNINSTALL) # @r{Normal commands follow.} -@end smallexample - -Typically, a pre-uninstall command would be used for deleting entries -from the Info directory. - -If the @code{install} or @code{uninstall} target has any dependencies -which act as subroutines of installation, then you should start -@emph{each} dependency's commands with a category line, and start the -main target's commands with a category line also. This way, you can -ensure that each command is placed in the right category regardless of -which of the dependencies actually run. - -Pre-installation and post-installation commands should not run any -programs except for these: - -@example -[ basename bash cat chgrp chmod chown cmp cp dd diff echo -egrep expand expr false fgrep find getopt grep gunzip gzip -hostname install install-info kill ldconfig ln ls md5sum -mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee -test touch true uname xargs yes -@end example - -@cindex binary packages -The reason for distinguishing the commands in this way is for the sake -of making binary packages. Typically a binary package contains all the -executables and other files that need to be installed, and has its own -method of installing them---so it does not need to run the normal -installation commands. But installing the binary package does need to -execute the pre-installation and post-installation commands. - -Programs to build binary packages work by extracting the -pre-installation and post-installation commands. Here is one way of -extracting the pre-installation commands: - -@smallexample -make -n install -o all \ - PRE_INSTALL=pre-install \ - POST_INSTALL=post-install \ - NORMAL_INSTALL=normal-install \ - | gawk -f pre-install.awk -@end smallexample - -@noindent -where the file @file{pre-install.awk} could contain this: - -@smallexample -$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@} -on @{print $0@} -$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@} -@end smallexample - -The resulting file of pre-installation commands is executed as a shell -script as part of installing the binary package. diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/new-users-guide/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,51 @@ +# Makefile for the XEmacs New Users Guide + +# 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. + +NAME=new-users-guide + +SHELL = /bin/sh +TEXI2DVI = texi2dvi +MAKEINFO = makeinfo + +# List of all the texinfo files in the manual: + +srcs = new-users-guide.texi custom1.texi files.texi region.texi \ + custom2.texi help.texi search.texi edit.texi modes.texi \ + xmenu.texi enter.texi + +all : info +info : ../../info/$(NAME).info + +../../info/$(NAME).info: $(srcs) + $(MAKEINFO) -o $@ $(NAME).texi + +dvi : $(NAME).dvi +.texi.dvi : + $(TEXI2DVI) $< + +.PHONY: mostlyclean clean distclean realclean extraclean +mostlyclean: + rm -f *.toc *.aux *.oaux *.log *.cp *.cps *.fn *.fns *.tp *.tps \ + *.vr *.vrs *.pg *.pgs *.ky *.kys +clean: mostlyclean + rm -f *.dvi *.ps make.out core +distclean: clean +realclean: clean +extraclean: clean + -rm -f *~ \#* diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/custom1.texi --- a/man/new-users-guide/custom1.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/custom1.texi Mon Aug 13 11:20:41 2007 +0200 @@ -168,8 +168,8 @@ @enumerate @item -add-menu-item: (@var{menu-name} @var{item-name} @var{function} @var{enabled-p} -&optional @var{before}) +add-menu-item: @var{(menu-name item-name function enabled-p +&optional before)} This function will add a menu item to a menu, creating the menu first if necessary. If the named item already exists, the menu will remain @@ -260,7 +260,7 @@ @findex delete-menu-item @cindex deleting menu items @item -delete-menu-item: (@var{menu-path}) +delete-menu-item: @var{(menu-path)} This function will remove the menu item defined by @var{menu-name} from the menu hierarchy. Look at the following examples and the comments just above them which specify what the examples do. @@ -286,7 +286,7 @@ @findex disable-menu-item @cindex disabling menu items @item -disable-menu-item: (@var{menu-name}) +disable-menu-item: @var{(menu-name)} Disables the specified menu item. The following example @example @@ -301,7 +301,7 @@ @findex enable-menu-item @cindex enabling menu items @item -enable-menu-item: (@var{menu-name}) +enable-menu-item: @var{(menu-name)} Enables the specified previously disabled menu item. @example @@ -315,7 +315,7 @@ @findex relabel-menu-items @cindex relabelling menu items @item -relabel-menu-item: (@var{menu-name} @var{new-name}) +relabel-menu-item: @var{(menu-name new-name)} Change the string of the menu item specified by @var{menu-name} to @var{new-name}. diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/custom2.texi --- a/man/new-users-guide/custom2.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/custom2.texi Mon Aug 13 11:20:41 2007 +0200 @@ -46,7 +46,7 @@ (add-hook 'texinfo-mode-hook 'turn-on-font-lock) ;;; enables the font-lock mode in C Mode -(add-hook 'c-mode-hook 'turn-on-font-lock) +(add-hook 'c-mode-hook 'turn-on-font-lock) @end example To turn on the font-lock mode in other Major Modes like emacs-lisp, just diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/edit.texi --- a/man/new-users-guide/edit.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/edit.texi Mon Aug 13 11:20:41 2007 +0200 @@ -137,7 +137,7 @@ Move the cursor forward one word (@code{forward-word}). @item M-b @findex backward-word -Move the cursor backward one word (@code{backward-word}). +Move the cursor backword one word (@code{backward-word}). @item M-< Move the cursor to the top of the buffer (@code{beginning-of-buffer}). @item M-> diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/help.texi --- a/man/new-users-guide/help.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/help.texi Mon Aug 13 11:20:41 2007 +0200 @@ -98,13 +98,13 @@ of your list will contain: @example -C-c C-c n texinfo-insert-@@node -C-c C-c o texinfo-insert-@@noindent -C-c C-c s texinfo-insert-@@samp -C-c C-c t texinfo-insert-@@table -C-c C-c v texinfo-insert-@@var -C-c C-c x texinfo-insert-@@example -C-c C-c @{ texinfo-insert-braces +C-c C-c n texinfo-insert-@@node +C-c C-c o texinfo-insert-@@noindent +C-c C-c s texinfo-insert-@@samp +C-c C-c t texinfo-insert-@@table +C-c C-c v texinfo-insert-@@var +C-c C-c x texinfo-insert-@@example +C-c C-c @{ texinfo-insert-braces @end example @noindent These keybindings apply only to "Texinfo" mode. @xref{Modes}, for more diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/modes.texi --- a/man/new-users-guide/modes.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/modes.texi Mon Aug 13 11:20:41 2007 +0200 @@ -175,7 +175,7 @@ the major mode is c-mode. @example -(add-hook 'c-mode-hook 'turn-on-font-lock) +(add-hook 'c-mode-hook 'turn-on-font-lock) @end example @noindent @@ -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 continuously in the mode line. +present will be displayed continously in the mode line. @item blink-paren @cindex blink-paren diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/new-users-guide.texi --- a/man/new-users-guide/new-users-guide.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/new-users-guide.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -\input texinfo @c -*-texinfo-*- +\input ../texinfo @c -*-texinfo-*- @setfilename ../../info/new-users-guide.info @comment node-name, next, previous, up @@ -60,8 +60,9 @@ @page @ifinfo @node Top, Intro, (dir), (dir) -@top The Emacs Editor +The Emacs Editor +**************** Emacs is the extensible, customizable, self-documenting real-time display editor. This Info file will help you get started on using diff -r 12e008d41344 -r 697ef44129c6 man/new-users-guide/region.texi --- a/man/new-users-guide/region.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/new-users-guide/region.texi Mon Aug 13 11:20:41 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 buffer name which you want to be copied +command will prompt you for a buffername 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 12e008d41344 -r 697ef44129c6 man/standards.texi --- a/man/standards.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/standards.texi Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,8 @@ @c %**start of header @setfilename ../info/standards.info @settitle GNU Coding Standards -@c This date is automagically updated when you save this file: -@set lastupdate June 24, 1999 +@c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES! +@set lastupdate 17 May 1996 @c %**end of header @ifinfo @@ -28,7 +28,7 @@ @ifinfo GNU Coding Standards -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -59,7 +59,7 @@ @page @vskip 0pt plus 1filll -Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +Copyright @copyright{} 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -84,14 +84,13 @@ @end ifinfo @menu -* Preface:: About the GNU Coding Standards -* Legal Issues:: Keeping Free Software Free -* Design Advice:: General Program Design -* Program Behavior:: Program Behavior for All Programs -* Writing C:: Making The Best Use of C -* Documentation:: Documenting Programs -* Managing Releases:: The Release Process -* References:: References to Non-Free Software or Documentation +* Preface:: About the GNU Coding Standards +* Intellectual Property:: Keeping Free Software Free +* Design Advice:: General Program Design +* Program Behavior:: Program Behavior for All Programs +* Writing C:: Making The Best Use of C +* Documentation:: Documenting Programs +* Managing Releases:: The Release Process @end menu @node Preface @@ -105,8 +104,8 @@ even if you write in another programming language. The rules often state reasons for writing in a certain way. -Corrections or suggestions for this document should be sent to -@email{gnu@@gnu.org}. If you make a suggestion, please include a +Corrections or suggestions regarding this document should be sent to +@code{gnu@@prep.ai.mit.edu}. If you make a suggestion, please include a suggested new wording for it; our time is limited. We prefer a context diff to the @file{standards.texi} or @file{make-stds.texi} files, but if you don't have those files, please mail your suggestion anyway. @@ -114,15 +113,15 @@ This release of the GNU Coding Standards was last updated @value{lastupdate}. -@node Legal Issues +@node Intellectual Property @chapter Keeping Free Software Free This @value{CHAPTER} discusses how you can make sure that GNU software remains unencumbered. @menu -* Reading Non-Free Code:: Referring to Proprietary Programs -* Contributions:: Accepting Contributions +* Reading Non-Free Code:: Referring to Proprietary Programs +* Contributions:: Accepting Contributions @end menu @node Reading Non-Free Code @@ -162,47 +161,37 @@ @node Contributions @section Accepting Contributions -If the program you are working on is copyrighted by the Free Software -Foundation, then when someone else sends you a piece of code to add to -the program, we need legal papers to use it---just as we asked you to -sign papers initially. @emph{Each} person who makes a nontrivial -contribution to a program must sign some sort of legal papers in order -for us to have clear title to the program; the main author alone is not +If someone else sends you a piece of code to add to the program you are +working on, we need legal papers to use it---the same sort of legal +papers we will need to get from you. @emph{Each} significant +contributor to a program must sign some sort of legal papers in order +for us to have clear title to the program. The main author alone is not enough. -So, before adding in any contributions from other people, please tell -us, so we can arrange to get the papers. Then wait until we tell you +So, before adding in any contributions from other people, tell us +so we can arrange to get the papers. Then wait until we tell you that we have received the signed papers, before you actually use the contribution. This applies both before you release the program and afterward. If you receive diffs to fix a bug, and they make significant changes, we -need legal papers for that change. - -This also applies to comments and documentation files. For copyright -law, comments and code are just text. Copyright applies to all kinds of -text, so we need legal papers for all kinds. - -We know it is frustrating to ask for legal papers; it's frustrating for -us as well. But if you don't wait, you are going out on a limb---for -example, what if the contributor's employer won't sign a disclaimer? -You might have to take that code out again! +need legal papers for it. You don't need papers for changes of a few lines here or there, since they are not significant for copyright purposes. Also, you don't need papers if all you get from the suggestion is some ideas, not actual code -which you use. For example, if someone send you one implementation, but -you write a different implementation of the same idea, you don't need to -get papers. +which you use. For example, if you write a different solution to the +problem, you don't need to get papers. + +We know this is frustrating; it's frustrating for us as well. But if +you don't wait, you are going out on a limb---for example, what if the +contributor's employer won't sign a disclaimer? You might have to take +that code out again! The very worst thing is if you forget to tell us about the other contributor. We could be very embarrassed in court some day as a result. -We have more detailed advice for maintainers of programs; if you have -reached the stage of actually maintaining a program for GNU (whether -released or not), please ask us for a copy. - @node Design Advice @chapter General Program Design @@ -210,10 +199,10 @@ account when designing your program. @menu -* Compatibility:: Compatibility with other implementations -* Using Extensions:: Using non-standard features +* Compatibility:: Compatibility with other implementations +* Using Extensions:: Using non-standard features * ANSI C:: Using ANSI C features -* Source Language:: Using languages other than C +* Source Language:: Using languages other than C @end menu @node Compatibility @@ -222,20 +211,20 @@ With occasional exceptions, utility programs and libraries for GNU should be upward compatible with those in Berkeley Unix, and upward compatible with @sc{ansi} C if @sc{ansi} C specifies their behavior, and -upward compatible with @sc{posix} if @sc{posix} specifies their +upward compatible with @sc{POSIX} if @sc{POSIX} specifies their behavior. When these standards conflict, it is useful to offer compatibility modes for each of them. -@sc{ansi} C and @sc{posix} prohibit many kinds of extensions. Feel free +@sc{ansi} C and @sc{POSIX} prohibit many kinds of extensions. Feel free to make the extensions anyway, and include a @samp{--ansi}, @samp{--posix}, or @samp{--compatible} option to turn them off. However, if the extension has a significant chance of breaking any real programs or scripts, then it is not really upward compatible. Try to redesign its interface. -Many GNU programs suppress extensions that conflict with @sc{posix} if the +Many GNU programs suppress extensions that conflict with POSIX if the environment variable @code{POSIXLY_CORRECT} is defined (even if it is defined with a null value). Please make your program recognize this variable if appropriate. @@ -247,6 +236,9 @@ feature as well. (There is a free @code{vi} clone, so we offer it.) Additional useful features not in Berkeley Unix are welcome. +Additional programs with no counterpart in Unix may be useful, +but our first priority is usually to duplicate what Unix already +has. @node Using Extensions @section Using Non-standard Features @@ -290,16 +282,9 @@ @sc{ansi} C, there's no need to convert it to support non-@sc{ansi} compilers. -If you don't know non-@sc{ansi} C, there's no need to learn it; just -write in @sc{ansi} C. - However, it is easy to support non-@sc{ansi} compilers in most programs, -so you might still consider doing so when you write a program. And if a -program you are maintaining has such support, you should try to keep it -working. - -To support pre-@sc{ansi} C, instead of writing function definitions in -@sc{ansi} prototype form, +so you might still consider doing so when you write a program. Instead +of writing function definitions in @sc{ansi} prototype form, @example int @@ -326,22 +311,11 @@ You need such a declaration anyway, in a header file, to get the benefit of @sc{ansi} C prototypes in all the files where the function is called. -And once you have the declaration, you normally lose nothing by writing -the function definition in the pre-@sc{ansi} style. - -This technique does not work for integer types narrower than @code{int}. -If you think of an argument as being of a type narrower than @code{int}, -declare it as @code{int} instead. - -There are a few special cases where this technique is hard to use. For -example, if a function argument needs to hold the system type -@code{dev_t}, you run into trouble, because @code{dev_t} is shorter than -@code{int} on some machines; but you cannot use @code{int} instead, -because @code{dev_t} is wider than @code{int} on some machines. There -is no type you can safely use on all machines in a non-@sc{ansi} -definition. The only way to support non-@sc{ansi} C and pass such an -argument is to check the width of @code{dev_t} using Autoconf and choose -the argument type accordingly. This may not be worth the trouble. +And once you have it, you lose nothing by writing the function +definition in the pre-@sc{ansi} style. + +If you don't know non-@sc{ansi} C, there's no need to learn it; just +write in @sc{ansi} C. @node Source Language @section Using Languages Other Than C @@ -349,16 +323,13 @@ Using a language other than C is like using a non-standard feature: it will cause trouble for users. Even if GCC supports the other language, users may find it inconvenient to have to install the compiler for that -other language in order to build your program. For example, if you -write your program in C++, people will have to install the C++ compiler -in order to compile your program. Thus, it is better if you write in C. - -But there are three situations when there is no disadvantage in using -some other language: +other language in order to build your program. So please write in C. + +There are three exceptions for this rule: @itemize @bullet @item -It is okay to use another language if your program contains an +It is okay to use a special language if the same program contains an interpreter for that language. For example, if your program links with GUILE, it is ok to write part of @@ -372,14 +343,10 @@ those who have installed the other language anyway. @item -If an application is of interest to a narrow community, then perhaps +If an application is not of extremely widespread interest, then perhaps it's not important if the application is inconvenient to install. @end itemize -C has one other advantage over C++ and other compiled languages: more -people know C, so more people will find it easy to read and modify the -program if it is written in C. - @node Program Behavior @chapter Program Behavior for All Programs @@ -388,11 +355,10 @@ and how libraries should behave. @menu -* Semantics:: Writing robust programs -* Libraries:: Library behavior -* Errors:: Formatting error messages -* User Interfaces:: Standards for command line interfaces -* Option Table:: Table of long options. +* Semantics:: Writing robust programs +* Libraries:: Library behavior +* Errors:: Formatting error messages +* User Interfaces:: Standards for command line interfaces * Memory Usage:: When and how to care about memory needs @end menu @@ -405,13 +371,9 @@ are silently truncated''. This is not acceptable in a GNU utility. Utilities reading files should not drop NUL characters, or any other -nonprinting characters @emph{including those with codes above 0177}. -The only sensible exceptions would be utilities specifically intended -for interface to certain types of terminals or printers -that can't handle those characters. -Whenever possible, try to make programs work properly with -sequences of bytes that represent multibyte characters, using encodings -such as UTF-8 and others. +nonprinting characters @emph{including those with codes above 0177}. The +only sensible exceptions would be utilities specifically intended for +interface to certain types of printers that can't handle those characters. Check every system call for an error return, unless you know you wish to ignore errors. Include the system error text (from @code{perror} or @@ -453,18 +415,11 @@ as file directories, utmp, or the layout of kernel memory), since these are less likely to work compatibly. If you need to find all the files in a directory, use @code{readdir} or some other high-level interface. -These are supported compatibly by GNU. - -The preferred signal handling facilities are the BSD variant of -@code{signal}, and the @sc{posix} @code{sigaction} function; the -alternative USG @code{signal} interface is an inferior design. - -Nowadays, using the @sc{posix} signal functions may be the easiest way -to make a program portable. If you use @code{signal}, then on GNU/Linux -systems running GNU libc version 1, you should include -@file{bsd/signal.h} instead of @file{signal.h}, so as to get BSD -behavior. It is up to you whether to support systems where -@code{signal} has only the USG behavior, or give up on them. +These will be supported compatibly by GNU. + +By default, the GNU system will provide the signal handling functions of +@sc{BSD} and of @sc{POSIX}. So GNU software should be written to use +these. In error checks that detect ``impossible'' conditions, just abort. There is usually no point in printing any message. These checks @@ -522,20 +477,6 @@ @var{source-file-name}:@var{lineno}: @var{message} @end example -@noindent -If you want to mention the column number, use this format: - -@example -@var{source-file-name}:@var{lineno}:@var{column}: @var{message} -@end example - -@noindent -Line numbers should start from 1 at the beginning of the file, and -column numbers should start from 1 at the beginning of the line. (Both -of these conventions are chosen for compatibility.) Calculate column -numbers assuming that space and all ASCII printing characters have -equal width, and assuming tab stops every 8 columns. - Error messages from other noninteractive programs should look like this: @example @@ -552,12 +493,6 @@ @noindent when there is no relevant source file. -If you want to mention the column number, use this format: - -@example -@var{program}:@var{source-file-name}:@var{lineno}:@var{column}: @var{message} -@end example - In an interactive program (one that is reading commands from a terminal), it is better not to include the program name in an error message. The place to indicate which program is running is in the @@ -585,10 +520,8 @@ Likewise, please don't make the behavior of the program depend on the type of output device it is used with. Device independence is an -important principle of the system's design; do not compromise it merely -to save someone from typing an option now and then. (Variation in error -message syntax when using a terminal is ok, because that is a side issue -that people do not depend on.) +important principle of the system's design; do not compromise it +merely to save someone from typing an option now and then. If you think one behavior is most useful when the output is to a terminal, and another is most useful when the output is a file or a @@ -604,11 +537,11 @@ like @code{ls} except that its default output format is always multi-column format. -It is a good idea to follow the @sc{posix} guidelines for the +It is a good idea to follow the @sc{POSIX} guidelines for the command-line options of a program. The easiest way to do this is to use @code{getopt} to parse them. Note that the GNU version of @code{getopt} will normally permit options anywhere among the arguments unless the -special argument @samp{--} is used. This is not what @sc{posix} +special argument @samp{--} is used. This is not what @sc{POSIX} specifies; it is a GNU extension. Please define long-named options that are equivalent to the @@ -621,119 +554,26 @@ to expect the ``verbose'' option of any GNU program which has one, to be spelled precisely @samp{--verbose}. To achieve this uniformity, look at the table of common long-option names when you choose the option names -for your program (@pxref{Option Table}). - -It is usually a good idea for file names given as ordinary arguments to -be input files only; any output files would be specified using options -(preferably @samp{-o} or @samp{--output}). Even if you allow an output -file name as an ordinary argument for compatibility, try to provide an -option as another way to specify it. This will lead to more consistency -among GNU utilities, and fewer idiosyncracies for users to remember. - -All programs should support two standard options: @samp{--version} -and @samp{--help}. - -@table @code -@item --version -This option should direct the program to print information about its name, -version, origin and legal status, all on standard output, and then exit -successfully. Other options and arguments should be ignored once this -is seen, and the program should not perform its normal function. - -The first line is meant to be easy for a program to parse; the version -number proper starts after the last space. In addition, it contains -the canonical name for this program, in this format: - -@example -GNU Emacs 19.30 -@end example - -@noindent -The program's name should be a constant string; @emph{don't} compute it -from @code{argv[0]}. The idea is to state the standard or canonical -name for the program, not its file name. There are other ways to find -out the precise file name where a command is found in @code{PATH}. - -If the program is a subsidiary part of a larger package, mention the -package name in parentheses, like this: - -@example -emacsserver (GNU Emacs) 19.30 -@end example - -@noindent -If the package has a version number which is different from this -program's version number, you can mention the package version number -just before the close-parenthesis. - -If you @strong{need} to mention the version numbers of libraries which -are distributed separately from the package which contains this program, -you can do so by printing an additional line of version info for each -library you want to mention. Use the same format for these lines as for -the first line. - -Please do not mention all of the libraries that the program uses ``just -for completeness''---that would produce a lot of unhelpful clutter. -Please mention library version numbers only if you find in practice that -they are very important to you in debugging. - -The following line, after the version number line or lines, should be a -copyright notice. If more than one copyright notice is called for, put -each on a separate line. - -Next should follow a brief statement that the program is free software, -and that users are free to copy and change it on certain conditions. If -the program is covered by the GNU GPL, say so here. Also mention that -there is no warranty, to the extent permitted by law. - -It is ok to finish the output with a list of the major authors of the -program, as a way of giving credit. - -Here's an example of output that follows these rules: - -@smallexample -GNU Emacs 19.34.5 -Copyright (C) 1996 Free Software Foundation, Inc. -GNU Emacs comes with NO WARRANTY, -to the extent permitted by law. -You may redistribute copies of GNU Emacs -under the terms of the GNU General Public License. -For more information about these matters, -see the files named COPYING. -@end smallexample - -You should adapt this to your program, of course, filling in the proper -year, copyright holder, name of program, and the references to -distribution terms, and changing the rest of the wording as necessary. - -This copyright notice only needs to mention the most recent year in -which changes were made---there's no need to list the years for previous -versions' changes. You don't have to mention the name of the program in -these notices, if that is inconvenient, since it appeared in the first -line. - -@item --help -This option should output brief documentation for how to invoke the -program, on standard output, then exit successfully. Other options and -arguments should be ignored once this is seen, and the program should -not perform its normal function. - -Near the end of the @samp{--help} option's output there should be a line -that says where to mail bug reports. It should have this format: - -@example -Report bugs to @var{mailing-address}. -@end example -@end table - -@node Option Table -@section Table of Long Options - -Here is a table of long options used by GNU programs. It is surely -incomplete, but we aim to list all the options that a new program might -want to be compatible with. If you use names not already in the table, -please send @email{gnu@@gnu.org} a list of them, with their -meanings, so we can update the table. +for your program. The table appears below. + +If you use names not already in the table, please send +@samp{gnu@@prep.ai.mit.edu} a list of them, with their meanings, so we +can update the table. + +It is usually a good idea for file names given as ordinary arguments +to be input files only; any output files would be specified using +options (preferably @samp{-o}). Even if you allow an output file name +as an ordinary argument for compatibility, try to provide a suitable +option as well. This will lead to more consistency among GNU +utilities, so that there are fewer idiosyncracies for users to +remember. + +Programs should support an option @samp{--version} which prints the +program's version number on standard output and exits successfully, and +an option @samp{--help} which prints option usage information on +standard output and exits successfully. These options should inhibit +the normal function of the command; they should do nothing except print +the requested information. @c Please leave newlines between items in this table; it's much easier @c to update when it isn't completely squashed together and unreadable. @@ -741,7 +581,10 @@ @c a semicolon between the lists of the programs that use them, not a @c period. --friedman +Here is the table of long options used by GNU programs. + @table @samp + @item after-date @samp{-N} in @code{tar}. @@ -792,9 +635,6 @@ @item avoid-wraps @samp{-n} in @code{wdiff}. -@item background -For server programs, run in the background. - @item backward-search @samp{-B} in @code{ctags}. @@ -919,9 +759,6 @@ @item dereference-args @samp{-D} in @code{du}. -@item device -Specify an I/O device (special file name). - @item diacritics @samp{-d} in @code{recode}. @@ -1054,11 +891,6 @@ @item force-prefix @samp{-F} in @code{shar}. -@item foreground -For server programs, run in the foreground; -in other words, don't do anything special to run the server -in the background. - @item format Used in @code{ls}, @code{time}, and @code{ptx}. @@ -1238,7 +1070,7 @@ @item machine No listing of which programs already use this; someone should check to -see if any actually do, and tell @email{gnu@@gnu.org}. +see if any actually do and tell @code{gnu@@prep.ai.mit.edu}. @item macro-name @samp{-M} in @code{ptx}. @@ -1363,9 +1195,6 @@ @item no-validate Used in @code{makeinfo}. -@item no-wait -Used in @code{emacsclient}. - @item no-warn Used in various programs to inhibit warnings. @@ -1417,10 +1246,6 @@ @item only-time @samp{-F} in @code{gprof}. -@item options -@samp{-o} in @code{getopt}, @code{fdlist}, @code{fdmount}, -@code{fdmountd}, and @code{fdumount}. - @item output In various programs, specify the output file name. @@ -1505,9 +1330,6 @@ @item prompt @samp{-p} in @code{ed}. -@item proxy -Specify an HTTP proxy. - @item query-user @samp{-X} in @code{shar}. @@ -1515,9 +1337,9 @@ @samp{-q} in Make. @item quiet -Used in many programs to inhibit the usual output. @strong{Note:} every -program accepting @samp{--quiet} should accept @samp{--silent} as a -synonym. +Used in many programs to inhibit the usual output. @strong{Please +note:} every program accepting @samp{--quiet} should accept +@samp{--silent} as a synonym. @item quiet-unshar @samp{-Q} in @code{shar} @@ -1630,18 +1452,12 @@ @item silent Used in many programs to inhibit the usual output. -@strong{Note:} every program accepting +@strong{Please note:} every program accepting @samp{--silent} should accept @samp{--quiet} as a synonym. @item size @samp{-s} in @code{ls}. -@item socket -Specify a file descriptor for a network server to use for its socket, -instead of opening and binding a new socket. This provides a way to -run, in a nonpriveledged process, a server that normally needs a -reserved port number. - @item sort Used in @code{ls}. @@ -1740,9 +1556,6 @@ @item time Used in @code{ls} and @code{touch}. -@item timeout -Specify how long to wait before giving up on some operation. - @item to-stdout @samp{-O} in @code{tar}. @@ -1859,15 +1672,14 @@ when writing GNU software. @menu -* Formatting:: Formatting Your Source Code -* Comments:: Commenting Your Work -* Syntactic Conventions:: Clean Use of C Constructs -* Names:: Naming Variables and Functions -* System Portability:: Portability between different operating systems +* Formatting:: Formatting Your Source Code +* Comments:: Commenting Your Work +* Syntactic Conventions:: Clean Use of C Constructs +* Names:: Naming Variables and Functions +* System Portability:: Portability between different operating systems * CPU Portability:: Supporting the range of CPU types * System Functions:: Portability and ``standard'' library functions * Internationalization:: Techniques for internationalization -* Mmap:: How you can safely use @code{mmap}. @end menu @node Formatting @@ -1996,13 +1808,6 @@ Every program should start with a comment saying briefly what it is for. Example: @samp{fmt - filter for simple filling of text}. -Please write the comments in a GNU program in English, because English -is the one language that nearly all programmers in all countries can -read. If you do not write English well, please write comments in -English as well as you can, then ask other people to help rewrite them. -If you can't write comments in English, please find someone to work with -you and translate your comments into English. - Please put a comment on each function saying what the function does, what sorts of arguments it gets, and what the possible values of arguments mean and are used for. It is not necessary to duplicate in @@ -2057,11 +1862,6 @@ @dots{} #endif /* not foo */ @end group -@group -#ifdef foo - @dots{} -#endif /* foo */ -@end group @end example @noindent @@ -2075,13 +1875,9 @@ @dots{} #endif /* foo */ @end group -@group -#ifndef foo - @dots{} -#endif /* not foo */ -@end group @end example + @node Syntactic Conventions @section Clean Use of C Constructs @@ -2209,22 +2005,9 @@ casts to @code{void}. Zero without a cast is perfectly fine as a null pointer constant, except when calling a varargs function. -@node Names +@node Names @section Naming Variables and Functions -The names of global variables and functions in a program serve as -comments of a sort. So don't choose terse names---instead, look for -names that give useful information about the meaning of the variable or -function. In a GNU program, names should be English, like other -comments. - -Local variable names can be shorter, because they are used only within -one context, where (presumably) comments explain their purpose. - -Try to limit your use of abbreviations in symbol names. It is ok to -make a few abbreviations, explain what they mean, and then use them -frequently, but don't use lots of obscure abbreviations. - Please use underscores to separate words in a name, so that the Emacs word commands can be useful within them. Stick to lower case; reserve upper case for macros and @code{enum} constants, and for name-prefixes @@ -2250,10 +2033,10 @@ constants. Use file names of 14 characters or less, to avoid creating gratuitous -problems on older System V systems. You can use the program -@code{doschk} to test for this. @code{doschk} also tests for potential -name conflicts if the files were loaded onto an MS-DOS file -system---something you may or may not care about. +problems on older System V systems. You can use the program @code{doschk} to test for +this. @code{doschk} also tests for potential name conflicts if the +files were loaded onto an MS-DOS file system---something you may or may +not care about. @node System Portability @section Portability between System Types @@ -2283,10 +2066,14 @@ when there is a higher-level alternative (@code{readdir}). As for systems that are not like Unix, such as MSDOS, Windows, the -Macintosh, VMS, and MVS, supporting them is often a lot of work. When -that is the case, it is better to spend your time adding features that -will be useful on GNU and GNU/Linux, rather than on supporting other -incompatible systems. +Macintosh, VMS, and MVS, supporting them is usually so much work that it +is better if you don't. + +The planned GNU kernel is not finished yet, but you can tell which +facilities it will provide by looking at the GNU C Library Manual. The +GNU kernel is based on Mach, so the features of Mach will also be +available. However, if you use Mach features, you'll probably have +trouble debugging your program today. @node CPU Portability @section Portability between @sc{cpu}s @@ -2324,7 +2111,7 @@ @example error (s, a1, a2, a3) char *s; - char *a1, *a2, *a3; + int a1, a2, a3; @{ fprintf (stderr, "error: "); fprintf (stderr, s, a1, a2, a3); @@ -2332,18 +2119,16 @@ @end example @noindent -In practice, this works on all machines, since a pointer is generally -the widest possible kind of argument, and it is much simpler than any -``correct'' alternative. Be sure @emph{not} to use a prototype for such -functions. +In practice, this works on all machines, and it is much simpler than any +``correct'' alternative. Be sure @emph{not} to use a prototype +for such functions. However, avoid casting pointers to integers unless you really need to. -Outside of special situations, such casts greatly reduce portability, -and in most programs they are easy to avoid. In the cases where casting -pointers to integers is essential---such as, a Lisp interpreter which -stores type information as well as an address in one word---it is ok to -do it, but you'll have to make explicit provisions to handle different -word sizes. +These assumptions really reduce portability, and in most programs they +are easy to avoid. In the cases where casting pointers to integers is +essential---such as, a Lisp interpreter which stores type information as +well as an address in one word---it is ok to do so, but you'll have to +make explicit provisions to handle different word sizes. @node System Functions @section Calling System Functions @@ -2360,11 +2145,6 @@ characters written on some systems, but not on all systems. @item -@code{main} should be declared to return type @code{int}. It should -terminate either by calling @code{exit} or by returning the integer -status code; make sure it cannot ever return an undefined value. - -@item Don't declare system functions explicitly. Almost any declaration for a system function is wrong on some system. @@ -2495,18 +2275,13 @@ Normally, the text domain name should be the same as the name of the package---for example, @samp{fileutils} for the GNU file utilities. -To enable gettext to work well, avoid writing code that makes -assumptions about the structure of words or sentences. When you want -the precise text of a sentence to vary depending on the data, use two or -more alternative string constants each containing a complete sentences, -rather than inserting conditionalized words or phrases into a single -sentence framework. - -Here is an example of what not to do: +To enable gettext to work, avoid writing code that makes assumptions +about the structure of words. Don't construct words from parts. Here +is an example of what not to do: @example -printf ("%d file%s processed", nfiles, - nfiles != 1 ? "s" : ""); +prinf ("%d file%s processed", nfiles, + nfiles > 1 ? "s" : ""); @end example @noindent @@ -2514,8 +2289,8 @@ by adding `s'. If you apply gettext to the format string, like this, @example -printf (gettext ("%d file%s processed"), nfiles, - nfiles != 1 ? "s" : ""); +prinf (gettext ("%d file%s processed"), nfiles, + nfiles > 1 ? "s" : ""); @end example @noindent @@ -2523,9 +2298,9 @@ `s' for the plural. Here is a better way: @example -printf ((nfiles != 1 ? "%d files processed" - : "%d file processed"), - nfiles); +prinf ((nfiles > 1 ? "%d files processed" + : "%d file processed"), + nfiles); @end example @noindent @@ -2533,52 +2308,14 @@ independently: @example -printf ((nfiles != 1 ? gettext ("%d files processed") - : gettext ("%d file processed")), - nfiles); -@end example - -@noindent -This can be any method of forming the plural of the word for ``file'', and -also handles languages that require agreement in the word for -``processed''. - -A similar problem appears at the level of sentence structure with this -code: - -@example -printf ("# Implicit rule search has%s been done.\n", - f->tried_implicit ? "" : " not"); +prinf ((nfiles > 1 ? gettext ("%d files processed") + : gettext ("%d file processed")), + nfiles); @end example @noindent -Adding @code{gettext} calls to this code cannot give correct results for -all languages, because negation in some languages requires adding words -at more than one place in the sentence. By contrast, adding -@code{gettext} calls does the job straightfowardly if the code starts -out like this: - -@example -printf (f->tried_implicit - ? "# Implicit rule search has been done.\n", - : "# Implicit rule search has not been done.\n"); -@end example - -@node Mmap -@section Mmap - -Don't assume that @code{mmap} either works on all files or fails -for all files. It may work on some files and fail on others. - -The proper way to use @code{mmap} is to try it on the specific file for -which you want to use it---and if @code{mmap} doesn't work, fall back on -doing the job in another way using @code{read} and @code{write}. - -The reason this precaution is needed is that the GNU kernel (the HURD) -provides a user-extensible file system, in which there can be many -different kinds of ``ordinary files.'' Many of them support -@code{mmap}, but some do not. It is important to make programs handle -all these kinds of files. +This can handle any language, no matter how it forms the plural of the +word for ``file.'' @node Documentation @chapter Documenting Programs @@ -2586,9 +2323,8 @@ @menu * GNU Manuals:: Writing proper manuals. * Manual Structure Details:: Specific structure conventions. -* License for Manuals:: Writing the distribution terms for a manual. * NEWS File:: NEWS files supplement manuals. -* Change Logs:: Recording Changes +* Change Logs:: Recording Changes * Man Pages:: Man pages are secondary. * Reading other Manuals:: How far you can go in learning from other manuals. @@ -2598,54 +2334,21 @@ @section GNU Manuals The preferred way to document part of the GNU system is to write a -manual in the Texinfo formatting language. This makes it possible to -produce a good quality formatted book, using @TeX{}, and to generate an -Info file. It is also possible to generate HTML output from Texinfo -source. See the Texinfo manual, either the hardcopy, or the on-line -version available through @code{info} or the Emacs Info subsystem -(@kbd{C-h i}). - -Programmers often find it most natural to structure the documentation -following the structure of the implementation, which they know. But -this structure is not necessarily good for explaining how to use the -program; it may be irrelevant and confusing for a user. - -At every level, from the sentences in a paragraph to the grouping of -topics into separate manuals, the right way to structure documentation -is according to the concepts and questions that a user will have in mind -when reading it. Sometimes this structure of ideas matches the -structure of the implementation of the software being documented---but -often they are different. Often the most important part of learning to -write good documentation is learning to notice when you are structuring -the documentation like the implementation, and think about better -alternatives. - -For example, each program in the GNU system probably ought to be -documented in one manual; but this does not mean each program should -have its own manual. That would be following the structure of the -implementation, rather than the structure that helps the user -understand. - -Instead, each manual should cover a coherent @emph{topic}. For example, -instead of a manual for @code{diff} and a manual for @code{diff3}, we -have one manual for ``comparison of files'' which covers both of those -programs, as well as @code{cmp}. By documenting these programs -together, we can make the whole subject clearer. - -The manual which discusses a program should document all of the -program's command-line options and all of its commands. It should give -examples of their use. But don't organize the manual as a list of -features. Instead, organize it logically, by subtopics. Address the -questions that a user will ask when thinking about the job that the -program does. +manual in the Texinfo formatting language. See the Texinfo manual, +either the hardcopy, or the on-line version available through +@code{info} or the Emacs Info subsystem (@kbd{C-h i}). + +The manual should document all of the program's command-line options and +all of its commands. It should give examples of their use. But don't +organize the manual as a list of features. Instead, organize it +logically, by subtopics. Address the goals that a user will have in +mind, and explain how to accomplish them. In general, a GNU manual should serve both as tutorial and reference. It should be set up for convenient access to each topic through Info, and for reading straight through (appendixes aside). A GNU manual should give a good introduction to a beginner reading through from the start, and should also provide all the details that hackers want. -The Bison manual is a good example of this---please take a look at it -to see what we mean. That is not as hard as it first sounds. Arrange each chapter as a logical breakdown of its topic, but order the sections, and write their @@ -2660,38 +2363,29 @@ Bison manual provides a good example of how to do this. Don't use Unix man pages as a model for how to write GNU documentation; -most of them are terse, badly structured, and give inadequate -explanation of the underlying concepts. (There are, of course -exceptions.) Also Unix man pages use a particular format which is -different from what we use in GNU manuals. - -Please include an email address in the manual for where to report -bugs @emph{in the manual}. +they are a bad example to follow. Please do not use the term ``pathname'' that is used in Unix documentation; use ``file name'' (two words) instead. We use the term -``path'' only for search paths, which are lists of directory names. - -Please do not use the term ``illegal'' to refer to erroneous input to a -computer program. Please use ``invalid'' for this, and reserve the term -``illegal'' for violations of law. +``path'' only for search paths, which are lists of file names. @node Manual Structure Details @section Manual Structure Details -The title page of the manual should state the version of the programs or -packages documented in the manual. The Top node of the manual should -also contain this information. If the manual is changing more -frequently than or independent of the program, also state a version -number for the manual in both of these places. - -Each program documented in the manual should have a node named -@samp{@var{program} Invocation} or @samp{Invoking @var{program}}. This -node (together with its subnodes, if any) should describe the program's -command line arguments and how to run it (the sort of information people -would look in a man page for). Start with an @samp{@@example} -containing a template for all the options and arguments that the program -uses. +The title page of the manual should state the version of the program +to which the manual applies. The Top node of the manual should also +contain this information. If the manual is changing more frequently +than or independent of the program, also state a version number for +the manual in both of these places. + +The manual should have a node named @samp{@var{program} Invocation} or +@samp{Invoking @var{program}}, where @var{program} stands for the name +of the program being described, as you would type it in the shell to run +the program. This node (together with its subnodes, if any) should +describe the program's command line arguments and how to run it (the +sort of information people would look in a man page for). Start with an +@samp{@@example} containing a template for all the options and arguments +that the program uses. Alternatively, put a menu item in some menu whose item name fits one of the above patterns. This identifies the node which that item points to @@ -2703,18 +2397,6 @@ If one manual describes several programs, it should have such a node for each program described. -@node License for Manuals -@section License for Manuals - -If the manual contains a copy of the GNU GPL or GNU LGPL, or if it -contains chapters that make political or personal statements, please -copy the distribution terms of the GNU Emacs Manual, and adapt it by -modifying appropriately the list of special chapters that may not be -modified or deleted. - -If the manual does not contain any such chapters, then imitate the -simpler distribution terms of the Texinfo manual. - @node NEWS File @section The NEWS File @@ -2736,46 +2418,18 @@ files. The purpose of this is so that people investigating bugs in the future will know about the changes that might have introduced the bug. Often a new bug can be found by looking at what was recently changed. -More importantly, change logs can help you eliminate conceptual -inconsistencies between different parts of a program, by giving you a -history of how the conflicting concepts arose and who they came from. - -@menu -* Change Log Concepts:: -* Style of Change Logs:: -* Simple Changes:: -* Conditional Changes:: -@end menu - -@node Change Log Concepts -@subsection Change Log Concepts - -You can think of the change log as a conceptual ``undo list'' which -explains how earlier versions were different from the current version. -People can see the current version; they don't need the change log -to tell them what is in it. What they want from a change log is a -clear explanation of how the earlier version differed. - -The change log file is normally called @file{ChangeLog} and covers an +More importantly, change logs can help eliminate conceptual +inconsistencies between different parts of a program; they can give you +a history of how the conflicting concepts arose. + +A change log file is normally called @file{ChangeLog} and covers an entire directory. Each directory can have its own change log, or a directory can use the change log of its parent directory--it's up to you. Another alternative is to record change log information with a version control system such as RCS or CVS. This can be converted automatically -to a @file{ChangeLog} file using @code{rcs2log}; in Emacs, the command -@kbd{C-x v a} (@code{vc-update-change-log}) does the job. - -There's no need to describe the full purpose of the changes or how they -work together. If you think that a change calls for explanation, you're -probably right. Please do explain it---but please put the explanation -in comments in the code, where people will see it whenever they see the -code. For example, ``New function'' is enough for the change log when -you add a function, because there should be a comment before the -function definition to explain what it does. - -However, sometimes it is useful to write one line to describe the -overall purpose of a batch of changes. +to a @file{ChangeLog} file. The easiest way to add an entry to @file{ChangeLog} is with the Emacs command @kbd{M-x add-change-log-entry}. An entry should have an @@ -2783,10 +2437,12 @@ of the changed functions, variables or whatever, followed by a colon. Then describe the changes you made to that function or variable. -@node Style of Change Logs -@subsection Style of Change Logs - -Here are some examples of change log entries: +Separate unrelated entries with blank lines. When two entries +represent parts of the same change, so that they work together, then +don't put blank lines between them. Then you can omit the file name +and the asterisk when successive entries are in the same file. + +Here are some examples: @example * register.el (insert-register): Return nil. @@ -2805,87 +2461,44 @@ It's important to name the changed function or variable in full. Don't abbreviate function or variable names, and don't combine them. -Subsequent maintainers will often search for a function name to find all -the change log entries that pertain to it; if you abbreviate the name, -they won't find it when they search. - -For example, some people are tempted to abbreviate groups of function -names by writing @samp{* register.el (@{insert,jump-to@}-register)}; -this is not a good idea, since searching for @code{jump-to-register} or -@code{insert-register} would not find that entry. - -Separate unrelated change log entries with blank lines. When two -entries represent parts of the same change, so that they work together, -then don't put blank lines between them. Then you can omit the file -name and the asterisk when successive entries are in the same file. - -@node Simple Changes -@subsection Simple Changes - -Certain simple kinds of changes don't need much detail in the change -log. - -When you change the calling sequence of a function in a simple fashion, -and you change all the callers of the function, there is no need to make -individual entries for all the callers that you changed. Just write in +Subsequent maintainers will often +search for a function name to find all the change log entries that +pertain to it; if you abbreviate the name, they won't find it when they +search. For example, some people are tempted to abbreviate groups of +function names by writing @samp{* register.el +(@{insert,jump-to@}-register)}; this is not a good idea, since searching +for @code{jump-to-register} or @code{insert-register} would not find the +entry. + +There's no need to describe the full purpose of the changes or how they +work together. It is better to put such explanations in comments in the +code. That's why just ``New function'' is enough; there is a comment +with the function in the source to explain what it does. + +However, sometimes it is useful to write one line to describe the +overall purpose of a large batch of changes. + +You can think of the change log as a conceptual ``undo list'' which +explains how earlier versions were different from the current version. +People can see the current version; they don't need the change log +to tell them what is in it. What they want from a change log is a +clear explanation of how the earlier version differed. + +When you change the calling sequence of a function in a simple +fashion, and you change all the callers of the function, there is no +need to make individual entries for all the callers. Just write in the entry for the function being called, ``All callers changed.'' -@example -* keyboard.c (Fcommand_execute): New arg SPECIAL. -All callers changed. -@end example - When you change just comments or doc strings, it is enough to write an -entry for the file, without mentioning the functions. Just ``Doc -fixes'' is enough for the change log. +entry for the file, without mentioning the functions. Write just, +``Doc fix.'' There's no need to make change log entries for documentation files. This is because documentation is not susceptible to bugs that are hard to fix. Documentation does not consist of parts that must interact in a precisely engineered fashion. To correct an error, you need not know -the history of the erroneous passage; it is enough to compare what the -documentation says with the way the program actually works. - -@node Conditional Changes -@subsection Conditional Changes - -C programs often contain compile-time @code{#if} conditionals. Many -changes are conditional; sometimes you add a new definition which is -entirely contained in a conditional. It is very useful to indicate in -the change log the conditions for which the change applies. - -Our convention for indicating conditional changes is to use square -brackets around the name of the condition. - -Here is a simple example, describing a change which is conditional but -does not have a function or entity name associated with it: - -@example -* xterm.c [SOLARIS2]: Include string.h. -@end example - -Here is an entry describing a new definition which is entirely -conditional. This new definition for the macro @code{FRAME_WINDOW_P} is -used only when @code{HAVE_X_WINDOWS} is defined: - -@example -* frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined. -@end example - -Here is an entry for a change within the function @code{init_display}, -whose definition as a whole is unconditional, but the changes themselves -are contained in a @samp{#ifdef HAVE_LIBNCURSES} conditional: - -@example -* dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent. -@end example - -Here is an entry for a change that takes affect only when -a certain macro is @emph{not} defined: - -@example -(gethostname) [!HAVE_SOCKETS]: Replace with winsock version. -@end example +the history of the erroneous passage; it is enough to compare the +passage with the way the program actually works. @node Man Pages @section Man Pages @@ -2945,9 +2558,9 @@ all GNU software. @menu -* Configuration:: How Configuration Should Work +* Configuration:: How Configuration Should Work * Makefile Conventions:: Makefile Conventions -* Releases:: Making Releases +* Releases:: Making Releases @end menu @node Configuration @@ -3020,7 +2633,7 @@ alternatives for how to describe a machine. Thus, @samp{sun3-sunos4.1} would be a valid alias. For many programs, @samp{vax-dec-ultrix} would be an alias for @samp{vax-dec-bsd}, simply because the differences -between Ultrix and BSD are rarely noticeable, but a few programs +between Ultrix and @sc{BSD} are rarely noticeable, but a few programs might need to distinguish them. @c Real 4.4BSD now runs on some Suns. @@ -3052,12 +2665,9 @@ @c Giving an optional @var{parameter} of @c @samp{no} should omit @var{package}, if it is used by default. -Possible values of @var{package} include -@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, -@samp{gdb}, -@samp{x}, -and -@samp{x-toolkit}. +Possible values of @var{package} include @samp{x}, @samp{x-toolkit}, +@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, and +@samp{gdb}. Do not use a @samp{--with} option to specify the file name to use to find certain files. That is outside the scope of what @samp{--with} @@ -3124,9 +2734,9 @@ @node Releases @section Making Releases -Package the distribution of @code{Foo version 69.96} up in a gzipped tar -file with the name @file{foo-69.96.tar.gz}. It should unpack into a -subdirectory named @file{foo-69.96}. +Package the distribution of Foo version 69.96 in a gzipped tar file +named @file{foo-69.96.tar.gz}. It should unpack into a subdirectory +named @file{foo-69.96}. Building and installing the program should never modify any of the files contained in the distribution. This means that all the files that form @@ -3135,21 +2745,6 @@ and never changed automatically; non-source files are produced from source files by programs under the control of the Makefile. -The distribution should contain a file named @file{README} which gives -the name of the package, and a general description of what it does. It -is also good to explain the purpose of each of the first-level -subdirectories in the package, if there are any. The @file{README} file -should either state the version number of the package, or refer to where -in the package it can be found. - -The @file{README} file should refer to the file @file{INSTALL}, which -should contain an explanation of the installation procedure. - -The @file{README} file should also refer to the file which contains the -copying conditions. The GNU GPL, if used, should be in a file called -@file{COPYING}. If the GNU LGPL is used, it should be in a file called -@file{COPYING.LIB}. - Naturally, all the source files must be in the distribution. It is okay to include non-source files in the distribution, provided they are up-to-date and machine-independent, so that building the distribution @@ -3174,7 +2769,7 @@ Make sure that no file name in the distribution is more than 14 characters long. Likewise, no file created by building the program should have a name longer than 14 characters. The reason for this is -that some systems adhere to a foolish interpretation of the @sc{posix} +that some systems adhere to a foolish interpretation of the POSIX standard, and refuse to open a longer name, rather than truncating as they did in the past. @@ -3202,31 +2797,6 @@ the expense of possible inconvenience to a user who doesn't know what other files to get. -@node References -@chapter References to Non-Free Software and Documentation - -A GNU program should not recommend use of any non-free program. We -can't stop some people from writing proprietary programs, or stop other -people from using them. But we can and should avoid helping to -advertise them to new customers. - -Sometimes it is important to mention how to build your package on top of -some non-free operating system or other non-free base package. In such -cases, please mention the name of the non-free package or system in the -briefest possible way. Don't include any references for where to find -more information about the proprietary program. The goal should be that -people already using the proprietary program will get the advice they -need about how to use your free program, while people who don't already -use the proprietary program will not see anything to encourage them to -take an interest in it. - -Likewise, a GNU package should not refer the user to any non-free -documentation for free software. The need for free documentation to go -with free software is now a major focus of the GNU project; to show that -we are serious about the need for free documentation, we must not -undermine our position by recommending use of documentation that isn't -free. - @contents @bye diff -r 12e008d41344 -r 697ef44129c6 man/texinfo.tex --- a/man/texinfo.tex Mon Aug 13 11:19:22 2007 +0200 +++ b/man/texinfo.tex Mon Aug 13 11:20:41 2007 +0200 @@ -1,11 +1,7 @@ % texinfo.tex -- TeX macros to handle Texinfo files. +% $Id: texinfo.tex,v 1.5 1998/06/13 04:28:12 steve Exp $ % -% Load plain if necessary, i.e., if running under initex. -\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi -% -\def\texinfoversion{1999-09-25.10} -% -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 % Free Software Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or @@ -29,44 +25,36 @@ % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% ftp://ftp.gnu.org/gnu/texinfo.tex -% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) -% ftp://texinfo.org/tex/texinfo.tex -% ftp://us.ctan.org/macros/texinfo/texinfo.tex -% (and all CTAN mirrors, finger ctan@us.ctan.org for a list). -% /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% The texinfo.tex in any given Texinfo distribution could well be out -% of date, so if that's what you're using, please check. -% Texinfo has a small home page at http://texinfo.org/. -% -% Send bug reports to bug-texinfo@gnu.org. Please include including a -% complete document in each bug report with which we can reproduce the -% problem. Patches are, of course, greatly appreciated. -% -% To process a Texinfo manual with TeX, it's most reliable to use the -% texi2dvi shell script that comes with the distribution. For a simple -% manual foo.texi, however, you can get away with this: -% tex foo.texi -% texindex foo.?? -% tex foo.texi -% tex foo.texi -% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. -% The extra runs of TeX get the cross-reference information correct. -% Sometimes one run after texindex suffices, and sometimes you need more -% than two; texi2dvi does it as many times as necessary. -% -% It is possible to adapt texinfo.tex for other languages. You can get -% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/. - -\message{Loading texinfo [version \texinfoversion]:} +% ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex +% /home/gd/gnu/doc/texinfo.tex on the GNU machines. +% +% Send bug reports to bug-texinfo@gnu.org. +% Please include a precise test case in each bug report, +% including a complete document with which we can reproduce the problem. +% +% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You +% have to run makeinfo -E to expand macros first; the texi2dvi script +% does this. + + +% Make it possible to create a .fmt file just by loading this file: +% if the underlying format is not loaded, start by loading it now. +% Added by gildea November 1993. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi + +% This automatically updates the version number based on RCS. +\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} +\deftexinfoversion$Revision: 1.5 $ +\message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. -\everyjob{\message{[Texinfo version \texinfoversion]}% +\everyjob{\message{[Texinfo version \texinfoversion]}\message{} \catcode`+=\active \catcode`\_=\active} % Save some parts of plain tex whose names we will redefine. + \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c @@ -82,9 +70,18 @@ \let\ptexstar=\* \let\ptext=\t -% We never want plain's outer \+ definition in Texinfo. -% For @tex, we can use \tabalign. -\let\+ = \relax +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + \message{Basics,} \chardef\other=12 @@ -93,47 +90,18 @@ % starts a new line in the output. \newlinechar = `^^J -% Set up fixed words for English if not already set. -\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi -\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi -\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi -\ifx\putwordin\undefined \gdef\putwordin{in}\fi -\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi -\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi -\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi -\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi -\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi -\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi -\ifx\putwordof\undefined \gdef\putwordof{of}\fi -\ifx\putwordon\undefined \gdef\putwordon{on}\fi -\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi -\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi -\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi -\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi -\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi -\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi -\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi -% -\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi -\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi -\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi -\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi -\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi -\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi -\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi -\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi -\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi -\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi -\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi -\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi -% -\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi -\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi -\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi -\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi -\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi -\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi +% Set up fixed words for English. +\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% +\def\putwordInfo{Info}% +\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% +\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% +\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% +\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% +\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% +\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% +\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% +\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% +\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% % Ignore a token. % @@ -154,35 +122,30 @@ % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% -\else -\def\loggingall{\tracingcommands3 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \tracingscantokens1 \tracingassigns1 \tracingifs1 - \tracinggroups1 \tracingnesting2 - \showboxbreadth\maxdimen\showboxdepth\maxdimen -}% -\fi % For @cropmarks command. % Do @cropmarks to get crop marks. -% +% \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % -\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines -\newdimen\cornerlong \cornerlong=1pc -\newdimen\cornerthick \cornerthick=.3pt -\newdimen\topandbottommargin \topandbottommargin=.75in +\newdimen\cornerlong \newdimen\cornerthick +\newdimen\topandbottommargin +\newdimen\outerhsize \newdimen\outervsize +\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks +\outerhsize=7in +%\outervsize=9.5in +% Alternative @smallbook page size is 9.25in +\outervsize=9.25in +\topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 @@ -216,16 +179,13 @@ \shipout\vbox{% \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize - \vskip-\topandbottommargin - \vtop to0pt{% - \line{\ewtop\hfil\ewtop}% - \nointerlineskip - \line{% - \vbox{\moveleft\cornerthick\nstop}% - \hfill - \vbox{\moveright\cornerthick\nstop}% - }% - \vss}% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. @@ -243,22 +203,18 @@ \unvbox\footlinebox \fi % - \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi - % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick - \vbox to0pt{\vss - \line{% - \vbox{\moveleft\cornerthick\nsbot}% - \hfill - \vbox{\moveright\cornerthick\nsbot}% - }% - \nointerlineskip - \line{\ewbot\hfil\ewbot}% + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox @@ -374,11 +330,11 @@ %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% -\ifENV\errmessage{Still within an environment; press RETURN to continue} +\ifENV\errmessage{Still within an environment. Type Return to continue.} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Press RETURN to continue.} +\newhelp\EMsimple{Type <Return> to continue.} \outer\def\begin{\parsearg\beginxxx} @@ -437,7 +393,7 @@ % @@ prints an @ % Kludge this until the fonts are right (grr). -\def\@{{\tt\char64}} +\def\@{{\tt \char '100}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. @@ -447,8 +403,8 @@ %\def\'{{'}} % Used to generate quoted braces. -\def\mylbrace {{\tt\char123}} -\def\myrbrace {{\tt\char125}} +\def\mylbrace {{\tt \char '173}} +\def\myrbrace {{\tt \char '175}} \let\{=\mylbrace \let\}=\myrbrace \begingroup @@ -485,18 +441,6 @@ \fi\fi } -% Be sure we're in horizontal mode when doing a tie, since we make space -% equivalent to this in @example-like environments. Otherwise, a space -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - % Avoid using \@M directly, because that causes trouble - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - \gdef\tie{\leavevmode\penalty\tiepenalty\ } -} - % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } @@ -594,47 +538,41 @@ %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 %\prevdepth=-1000pt %}} \def\needx#1{% - % Ensure vertical mode, so we don't make a big box in the middle of a + % Go into vertical mode, so we don't make a big box in the middle of a % paragraph. \par % - % If the @need value is less than one line space, it's useless. - \dimen0 = #1\mil - \dimen2 = \ht\strutbox - \advance\dimen2 by \dp\strutbox - \ifdim\dimen0 > \dimen2 - % - % Do a \strut just to make the height of this box be normal, so the - % normal leading is inserted relative to the preceding line. - % And a page break here is fine. - \vtop to #1\mil{\strut\vfil}% - % - % TeX does not even consider page breaks if a penalty added to the - % main vertical list is 10000 or more. But in order to see if the - % empty box we just added fits on the page, we must make it consider - % page breaks. On the other hand, we don't want to actually break the - % page after the empty box. So we use a penalty of 9999. - % - % There is an extremely small chance that TeX will actually break the - % page at this \penalty, if there are no other feasible breakpoints in - % sight. (If the user is using lots of big @group commands, which - % almost-but-not-quite fill up a page, TeX will have a hard time doing - % good page breaking, for example.) However, I could not construct an - % example where a page broke at this \penalty; if it happens in a real - % document, then we can reconsider our strategy. - \penalty9999 - % - % Back up by the size of the box, whether we did a page break or not. - \kern -#1\mil - % - % Do not allow a page break right after this kern. - \nobreak - \fi + % Don't add any leading before our big empty box, but allow a page + % break, since the best break might be right here. + \allowbreak + \nointerlineskip + \vtop to #1\mil{\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak } % @br forces paragraph break @@ -645,19 +583,15 @@ % We do .5em per period so that it has the same spacing in a typewriter % font as three actual period characters. % -\def\dots{% - \leavevmode - \hbox to 1.5em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% -} +\def\dots{\hbox to 1.5em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil +}} % @enddots{} is an end-of-sentence ellipsis. -% +% \def\enddots{% - \leavevmode \hbox to 2em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.\hss.% @@ -668,7 +602,7 @@ % @page forces the start of a new page -% + \def\page{\par\vfill\supereject} % @exdent text.... @@ -735,50 +669,332 @@ % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment -\def\comment{\begingroup \catcode`\^^M=\other% -\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% -\commentxxx} -{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% +\parsearg \commentxxx} + +\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } \let\c=\comment -% @paragraphindent NCHARS -% We'll use ems for NCHARS, close enough. -% We cannot implement @paragraphindent asis, though. -% -\def\asisword{asis} % no translation, these are keywords -\def\noneword{none} +% @paragraphindent is defined for the Info formatting commands only. +\let\paragraphindent=\comment + +% Prevent errors for section commands. +% Used in @ignore and in failing conditionals. +\def\ignoresections{% +\let\chapter=\relax +\let\unnumbered=\relax +\let\top=\relax +\let\unnumberedsec=\relax +\let\unnumberedsection=\relax +\let\unnumberedsubsec=\relax +\let\unnumberedsubsection=\relax +\let\unnumberedsubsubsec=\relax +\let\unnumberedsubsubsection=\relax +\let\section=\relax +\let\subsec=\relax +\let\subsubsec=\relax +\let\subsection=\relax +\let\subsubsection=\relax +\let\appendix=\relax +\let\appendixsec=\relax +\let\appendixsection=\relax +\let\appendixsubsec=\relax +\let\appendixsubsection=\relax +\let\appendixsubsubsec=\relax +\let\appendixsubsubsection=\relax +\let\contents=\relax +\let\smallbook=\relax +\let\titlepage=\relax +} + +% Used in nested conditionals, where we have to parse the Texinfo source +% and so want to turn off most commands, in case they are used +% incorrectly. +% +\def\ignoremorecommands{% + \let\defcodeindex = \relax + \let\defcv = \relax + \let\deffn = \relax + \let\deffnx = \relax + \let\defindex = \relax + \let\defivar = \relax + \let\defmac = \relax + \let\defmethod = \relax + \let\defop = \relax + \let\defopt = \relax + \let\defspec = \relax + \let\deftp = \relax + \let\deftypefn = \relax + \let\deftypefun = \relax + \let\deftypevar = \relax + \let\deftypevr = \relax + \let\defun = \relax + \let\defvar = \relax + \let\defvr = \relax + \let\ref = \relax + \let\xref = \relax + \let\printindex = \relax + \let\pxref = \relax + \let\settitle = \relax + \let\setchapternewpage = \relax + \let\setchapterstyle = \relax + \let\everyheading = \relax + \let\evenheading = \relax + \let\oddheading = \relax + \let\everyfooting = \relax + \let\evenfooting = \relax + \let\oddfooting = \relax + \let\headings = \relax + \let\include = \relax + \let\lowersections = \relax + \let\down = \relax + \let\raisesections = \relax + \let\up = \relax + \let\set = \relax + \let\clear = \relax + \let\item = \relax +} + +% Ignore @ignore ... @end ignore. +% +\def\ignore{\doignore{ignore}} + +% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. +% +\def\ifinfo{\doignore{ifinfo}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifnottex{\doignore{ifnottex}} +\def\html{\doignore{html}} +\def\menu{\doignore{menu}} +\def\direntry{\doignore{direntry}} + +% Also ignore @macro ... @end macro. The user must run texi2dvi, +% which runs makeinfo to do macro expansion. Ignore @unmacro, too. +\def\macro{\doignore{macro}} +\let\unmacro = \comment + + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory = \comment + +% Ignore text until a line `@end #1'. % -\def\paragraphindent{\parsearg\doparagraphindent} -\def\doparagraphindent#1{% - \def\temp{#1}% - \ifx\temp\asisword - \else - \ifx\temp\noneword - \defaultparindent = 0pt - \else - \defaultparindent = #1em +\def\doignore#1{\begingroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define a command to swallow text until we reach `@end #1'. + \long\def\doignoretext##1\end #1{\enddoignore}% + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \catcode32 = 10 + % + % Ignore braces, too, so mismatched braces don't cause trouble. + \catcode`\{ = 9 + \catcode`\} = 9 + % + % And now expand that command. + \doignoretext +} + +% What we do to finish off ignored text. +% +\def\enddoignore{\endgroup\ignorespaces}% + +\newif\ifwarnedobs\warnedobsfalse +\def\obstexwarn{% + \ifwarnedobs\relax\else + % We need to warn folks that they may have trouble with TeX 3.0. + % This uses \immediate\write16 rather than \message to get newlines. + \immediate\write16{} + \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} + \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} + \immediate\write16{If you are running another version of TeX, relax.} + \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} + \immediate\write16{ Then upgrade your TeX installation if you can.} + \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} + \immediate\write16{If you are stuck with version 3.0, run the} + \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} + \immediate\write16{ to use a workaround.} + \immediate\write16{} + \global\warnedobstrue \fi +} + +% **In TeX 3.0, setting text in \nullfont hangs tex. For a +% workaround (which requires the file ``dummy.tfm'' to be installed), +% uncomment the following line: +%%%%%\font\nullfont=dummy\let\obstexwarn=\relax + +% Ignore text, except that we keep track of conditional commands for +% purposes of nesting, up to an `@end #1' command. +% +\def\nestedignore#1{% + \obstexwarn + % We must actually expand the ignored text to look for the @end + % command, so that nested ignore constructs work. Thus, we put the + % text into a \vbox and then do nothing with the result. To minimize + % the change of memory overflow, we follow the approach outlined on + % page 401 of the TeXbook: make the current font be a dummy font. + % + \setbox0 = \vbox\bgroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define `@end #1' to end the box, which will in turn undefine the + % @end command again. + \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% + % + % We are going to be parsing Texinfo commands. Most cause no + % trouble when they are used incorrectly, but some commands do + % complicated argument parsing or otherwise get confused, so we + % undefine them. + % + % We can't do anything about stray @-signs, unfortunately; + % they'll produce `undefined control sequence' errors. + \ignoremorecommands + % + % Set the current font to be \nullfont, a TeX primitive, and define + % all the font commands to also use \nullfont. We don't use + % dummy.tfm, as suggested in the TeXbook, because not all sites + % might have that installed. Therefore, math mode will still + % produce output, but that should be an extremely small amount of + % stuff compared to the main input. + % + \nullfont + \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont + \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont + \let\tensf = \nullfont + % Similarly for index fonts (mostly for their use in + % smallexample) + \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont + \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont + \let\indsf = \nullfont + % + % Don't complain when characters are missing from the fonts. + \tracinglostchars = 0 + % + % Don't bother to do space factor calculations. + \frenchspacing + % + % Don't report underfull hboxes. + \hbadness = 10000 + % + % Do minimal line-breaking. + \pretolerance = 10000 + % + % Do not execute instructions in @tex + \def\tex{\doignore{tex}}% +} + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. Make sure the catcode of space is correct to avoid +% losing inside @example, for instance. +% +\def\set{\begingroup\catcode` =10 + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \parsearg\setxxx} +\def\setxxx#1{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + \def\temp{#2}% + \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty + \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. \fi - \parindent = \defaultparindent + \endgroup } - -% @exampleindent NCHARS -% We'll use ems for NCHARS like @paragraphindent. -% It seems @exampleindent asis isn't necessary, but -% I preserve it to make it similar to @paragraphindent. -\def\exampleindent{\parsearg\doexampleindent} -\def\doexampleindent#1{% - \def\temp{#1}% - \ifx\temp\asisword +% Can't use \xdef to pre-expand #2 and save some time, since \temp or +% \next or other control sequences that we've defined might get us into +% an infinite loop. Consider `@set foo @cite{bar}'. +\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\def\clear{\parsearg\clearxxx} +\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} + +% @value{foo} gets the text saved in variable foo. +% +\def\value{\begingroup + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \valuexxx} +\def\valuexxx#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {\{No value for ``#1''\}}% \else - \ifx\temp\noneword - \lispnarrowing = 0pt - \else - \lispnarrowing = #1em - \fi + \csname SET#1\endcsname + \fi +\endgroup} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +\def\ifset{\parsearg\ifsetxxx} +\def\ifsetxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifsetfail + \else + \expandafter\ifsetsucceed \fi } +\def\ifsetsucceed{\conditionalsucceed{ifset}} +\def\ifsetfail{\nestedignore{ifset}} +\defineunmatchedend{ifset} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +\def\ifclear{\parsearg\ifclearxxx} +\def\ifclearxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifclearsucceed + \else + \expandafter\ifclearfail + \fi +} +\def\ifclearsucceed{\conditionalsucceed{ifclear}} +\def\ifclearfail{\nestedignore{ifclear}} +\defineunmatchedend{ifclear} + +% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text +% following, through the first @end iftex (etc.). Make `@end iftex' +% (etc.) valid only after an @iftex. +% +\def\iftex{\conditionalsucceed{iftex}} +\def\ifnothtml{\conditionalsucceed{ifnothtml}} +\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} +\defineunmatchedend{iftex} +\defineunmatchedend{ifnothtml} +\defineunmatchedend{ifnotinfo} + +% We can't just want to start a group at @iftex (for example) and end it +% at @end iftex, since then @set commands inside the conditional have no +% effect (they'd get reverted at the end of the group). So we must +% define \Eiftex to redefine itself to be its previous value. (We can't +% just define it to fail again with an ``unmatched end'' error, since +% the @ifset might be nested.) +% +\def\conditionalsucceed#1{% + \edef\temp{% + % Remember the current value of \E#1. + \let\nece{prevE#1} = \nece{E#1}% + % + % At the `@end #1', redefine \E#1 to be its previous value. + \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% + }% + \temp +} + +% We need to expand lots of \csname's, but we don't want to expand the +% control sequences after we've constructed them. +% +\def\nece#1{\expandafter\noexpand\csname#1\endcsname} % @asis just yields its argument. Used with @table, for example. % @@ -801,23 +1017,33 @@ \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} +\def\node{\ENVcheck\parsearg\nodezzz} +\def\nodezzz#1{\nodexxx [#1,]} +\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\let\nwnode=\node +\let\lastnode=\relax + +\def\donoderef{\ifx\lastnode\relax\else +\expandafter\expandafter\expandafter\setref{\lastnode}\fi +\global\let\lastnode=\relax} + +\def\unnumbnoderef{\ifx\lastnode\relax\else +\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi +\global\let\lastnode=\relax} + +\def\appendixnoderef{\ifx\lastnode\relax\else +\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi +\global\let\lastnode=\relax} + % @refill is a no-op. \let\refill=\relax -% If working on a large document in chapters, it is convenient to -% be able to disable indexing, cross-referencing, and contents, for test runs. -% This is done with @novalidate (before @setfilename). -% -\newif\iflinks \linkstrue % by default we want the aux files. -\let\novalidate = \linksfalse - % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% - \iflinks - \readauxfile - \fi % \openindices needs to do some work in any case. + \readauxfile + \opencontents \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. @@ -833,197 +1059,30 @@ \comment % Ignore the actual filename. } -% Called from \setfilename. -% -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - -\message{pdf,} -% adobe `portable' document format -\newcount\tempnum -\newcount\lnkcount -\newtoks\filename -\newcount\filenamelength -\newcount\pgn -\newtoks\toksA -\newtoks\toksB -\newtoks\toksC -\newtoks\toksD -\newbox\boxA -\newcount\countA -\newif\ifpdf -\newif\ifpdfmakepagedest - -\ifx\pdfoutput\undefined - \pdffalse - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\linkcolor = \relax - \let\pdfmakeoutlines = \relax -\else - \pdftrue - \pdfoutput = 1 - \input pdfcolor - \def\dopdfimage#1#2#3{% - \def\imagewidth{#2}% - \def\imageheight{#3}% - \ifnum\pdftexversion < 14 - \pdfimage - \else - \pdfximage - \fi - \ifx\empty\imagewidth\else width \imagewidth \fi - \ifx\empty\imageheight\else height \imageheight \fi - {#1.pdf}% - \ifnum\pdftexversion < 14 \else - \pdfrefximage \pdflastximage - \fi} - \def\pdfmkdest#1{\pdfdest name{#1@} xyz} - \def\pdfmkpgn#1{#1@} - \let\linkcolor = \Cyan - \def\endlink{\Black\pdfendlink} - % Adding outlines to PDF; macros for calculating structure of outlines - % come from Petr Olsak - \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% - \else \csname#1\endcsname \fi} - \def\advancenumber#1{\tempnum=\expnumber{#1}\relax - \advance\tempnum by1 - \expandafter\xdef\csname#1\endcsname{\the\tempnum}} - \def\pdfmakeoutlines{{% - \openin 1 \jobname.toc - \ifeof 1\else\bgroup - \closein 1 - \indexnofonts - \def\tt{} - % thanh's hack / proper braces in bookmarks - \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace - \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace - % - \def\chapentry ##1##2##3{} - \def\unnumbchapentry ##1##2{} - \def\secentry ##1##2##3##4{\advancenumber{chap##2}} - \def\unnumbsecentry ##1##2{} - \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} - \def\unnumbsubsecentry ##1##2{} - \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} - \def\unnumbsubsubsecentry ##1##2{} - \input \jobname.toc - \def\chapentry ##1##2##3{% - \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} - \def\unnumbchapentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\secentry ##1##2##3##4{% - \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} - \def\unnumbsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\subsecentry ##1##2##3##4##5{% - \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} - \def\unnumbsubsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\subsubsecentry ##1##2##3##4##5##6{% - \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} - \def\unnumbsubsubsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \input \jobname.toc - \egroup\fi - }} - \def\makelinks #1,{% - \def\params{#1}\def\E{END}% - \ifx\params\E - \let\nextmakelinks=\relax - \else - \let\nextmakelinks=\makelinks - \ifnum\lnkcount>0,\fi - \picknum{#1}% - \startlink attr{/Border [0 0 0]} - goto name{\pdfmkpgn{\the\pgn}}% - \linkcolor #1% - \advance\lnkcount by 1% - \endlink - \fi - \nextmakelinks - } - \def\picknum#1{\expandafter\pn#1} - \def\pn#1{% - \def\p{#1}% - \ifx\p\lbrace - \let\nextpn=\ppn - \else - \let\nextpn=\ppnn - \def\first{#1} - \fi - \nextpn - } - \def\ppn#1{\pgn=#1\gobble} - \def\ppnn{\pgn=\first} - \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} - \def\skipspaces#1{\def\PP{#1}\def\D{|}% - \ifx\PP\D\let\nextsp\relax - \else\let\nextsp\skipspaces - \ifx\p\space\else\addtokens{\filename}{\PP}% - \advance\filenamelength by 1 - \fi - \fi - \nextsp} - \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} - \ifnum\pdftexversion < 14 - \let \startlink \pdfannotlink - \else - \let \startlink \pdfstartlink - \fi - \def\pdfurl#1{% - \begingroup - \normalturnoffactive\def\@{@}% - \leavevmode\Red - \startlink attr{/Border [0 0 0]}% - user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - % #1 - \endgroup} - \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} - \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} - \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} - \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS| - \ifx\first0\adn0 - \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 - \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 - \else - \ifnum0=\countA\else\makelink\fi - \ifx\first.\let\next=\done\else - \let\next=\maketoks - \addtokens{\toksB}{\the\toksD} - \ifx\first,\addtokens{\toksB}{\space}\fi - \fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next} - \def\makelink{\addtokens{\toksB}% - {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} - \def\pdflink#1{% - \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}} - \linkcolor #1\endlink} - \def\mkpgn#1{#1@} - \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % \ifx\pdfoutput +% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} +% \def\macroxxx#1#2 \end macro{% +% \expandafter\gdef\macrotemp#1{#2}% +% \endgroup} + +%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} +%\def\linemacroxxx#1#2 \end linemacro{% +%\let\parsearg=\relax +%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% +%\expandafter\xdef\macrotemp{\parsearg\macrotempx}% +%\expandafter\gdef\macrotempx#1{#2}% +%\endgroup} + +%\def\butfirst#1{} \message{fonts,} + % Font-change commands. -% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% Texinfo supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} @@ -1089,17 +1148,22 @@ \setfont\deftt\ttshape{10}{\magstep1} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} -% Fonts for indices, footnotes, small examples (9pt). -\setfont\smallrm\rmshape{9}{1000} -\setfont\smalltt\ttshape{9}{1000} -\setfont\smallbf\bfshape{10}{900} -\setfont\smallit\itshape{9}{1000} -\setfont\smallsl\slshape{9}{1000} -\setfont\smallsf\sfshape{9}{1000} -\setfont\smallsc\scshape{10}{900} -\setfont\smallttsl\ttslshape{10}{900} -\font\smalli=cmmi9 -\font\smallsy=cmsy9 +% Fonts for indices and small examples (9pt). +% We actually use the slanted font rather than the italic, +% because texinfo normally uses the slanted fonts for that. +% Do not make many font distinctions in general in the index, since they +% aren't very useful. +\setfont\ninett\ttshape{9}{1000} +\setfont\indrm\rmshape{9}{1000} +\setfont\indit\slshape{9}{1000} +\let\indsl=\indit +\let\indtt=\ninett +\let\indttsl=\ninett +\let\indsf=\indrm +\let\indbf=\indrm +\setfont\indsc\scshape{10}{900} +\font\indi=cmmi9 +\font\indsy=cmsy9 % Fonts for title page: \setfont\titlerm\rmbshape{12}{\magstep3} @@ -1213,12 +1277,11 @@ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? -\def\smallfonts{% - \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl - \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc - \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy - \let\tenttsl=\smallttsl - \resetmathfonts \setleading{11pt}} +\def\indexfonts{% + \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl + \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc + \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl + \resetmathfonts \setleading{12pt}} % Set up the default fonts, so we can use them for creating boxes. % @@ -1242,14 +1305,13 @@ % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} -\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} \let\i=\smartitalic -\let\var=\smartslanted -\let\dfn=\smartslanted +\let\var=\smartitalic +\let\dfn=\smartitalic \let\emph=\smartitalic -\let\cite=\smartslanted +\let\cite=\smartitalic \def\b#1{{\bf #1}} \let\strong=\b @@ -1267,9 +1329,9 @@ } \let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} -\setfont\keyrm\rmshape{8}{1000} -\font\keysy=cmsy9 -\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +\setfont\smallrm\rmshape{8}{1000} +\font\smallsy=cmsy9 +\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% @@ -1279,9 +1341,7 @@ %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} -% @file, @option are the same as @samp. \let\file=\samp -\let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. @@ -1316,18 +1376,20 @@ % and arrange explicitly to hyphenate at a dash. % -- rms. { - \catcode`\-=\active - \catcode`\_=\active - % - \global\def\code{\begingroup - \catcode`\-=\active \let-\codedash - \catcode`\_=\active \let_\codeunder - \codex - } - % - % If we end up with any active - characters when handling the index, - % just treat them as a normal -. - \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} +\catcode`\-=\active +\catcode`\_=\active +\catcode`\|=\active +\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} +% The following is used by \doprintindex to insure that long function names +% wrap around. It is necessary for - and _ to be active before the index is +% read from the file, as \entry parses the arguments long before \code is +% ever called. -- mycroft +% _ is always active; and it shouldn't be \let = to an _ that is a +% subscript character anyway. Then, @cindex @samp{_} (for example) +% fails. --karl +\global\def\indexbreaks{% + \catcode`\-=\active \let-\realdash +} } \def\realdash{-} @@ -1368,55 +1430,27 @@ \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} -% For @url, @env, @command quotes seem unnecessary, so use \code. +% @url. Quotes do not seem necessary, so use \code. \let\url=\code -\let\env=\code -\let\command=\code - -% @uref (abbreviation for `urlref') takes an optional (comma-separated) -% second argument specifying the text to display and an optional third -% arg as text to display instead of (rather than in addition to) the url -% itself. First (mandatory) arg is the url. Perhaps eventually put in -% a hypertex \special here. -% -\def\uref#1{\douref #1,,,\finish} -\def\douref#1,#2,#3,#4\finish{\begingroup - \unsepspaces - \pdfurl{#1}% - \setbox0 = \hbox{\ignorespaces #3}% + +% @uref (abbreviation for `urlref') takes an optional second argument +% specifying the text to display. First (mandatory) arg is the url. +% Perhaps eventually put in a hypertex \special here. +% +\def\uref#1{\urefxxx #1,,\finish} +\def\urefxxx#1,#2,#3\finish{% + \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt - \unhbox0 % third arg given, show only that + \unhbox0\ (\code{#1})% \else - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \ifpdf - \unhbox0 % PDF: 2nd arg given, show only it - \else - \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url - \fi - \else - \code{#1}% only url given, so show it - \fi + \code{#1}% \fi - \endlink -\endgroup} - -% rms does not like angle brackets --karl, 17may97. -% So now @email is just like @uref, unless we are pdf. -% +} + +% rms does not like the angle brackets --karl, 17may97. +% So now @email is just like @uref. %\def\email#1{\angleleft{\tt #1}\angleright} -\ifpdf - \def\email#1{\doemail#1,,\finish} - \def\doemail#1,#2,#3\finish{\begingroup - \unsepspaces - \pdfurl{mailto:#1}% - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi - \endlink - \endgroup} -\else - \let\email=\uref -\fi +\let\email=\uref % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and @@ -1426,7 +1460,8 @@ \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% argument is to make the input look right: @dmn{pt} instead of +% @dmn{}pt. % \def\dmn#1{\thinspace #1} @@ -1437,14 +1472,11 @@ % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} -% Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font +% Use of \lowercase was suggested. \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font -% @acronym downcases the argument and prints in smallcaps. -\def\acronym#1{{\smallcaps \lowercase{#1}}} - % @pounds{} is a sterling sign. \def\pounds{{\it\$}} @@ -1458,20 +1490,15 @@ \newif\ifseenauthor \newif\iffinishedtitlepage -% Do an implicit @contents or @shortcontents after @end titlepage if the -% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. -% -\newif\ifsetcontentsaftertitlepage - \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue -\newif\ifsetshortcontentsaftertitlepage - \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue - \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm +% I deinstalled the following change because \cmr12 is undefined. +% This change was not in the ChangeLog anyway. --rms. +% \let\subtitlerm=\cmr12 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% @@ -1520,23 +1547,6 @@ % after the title page, which we certainly don't want. \oldpage \endgroup - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi - % - \ifpdf \pdfmakepagedesttrue \fi - % \HEADINGSon } @@ -1550,10 +1560,10 @@ \let\thispage=\folio -\newtoks\evenheadline % headline on even pages -\newtoks\oddheadline % headline on odd pages -\newtoks\evenfootline % footline on even pages -\newtoks\oddfootline % footline on odd pages +\newtoks \evenheadline % Token sequence for heading line of even pages +\newtoks \oddheadline % Token sequence for heading line of odd pages +\newtoks \evenfootline % Token sequence for footing line of even pages +\newtoks \oddfootline % Token sequence for footing line of odd pages % Now make Tex use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline @@ -1671,23 +1681,39 @@ % Subroutines used in generating headings % Produces Day Month Year style of output. -\def\today{% - \number\day\space - \ifcase\month - \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr - \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug - \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec - \fi - \space\number\year} - -% @settitle line... specifies the title of the document, for headings. -% It generates no output of its own. -\def\thistitle{\putwordNoTitle} +\def\today{\number\day\space +\ifcase\month\or +January\or February\or March\or April\or May\or June\or +July\or August\or September\or October\or November\or December\fi +\space\number\year} + +% Use this if you want the Month Day, Year style of output. +%\def\today{\ifcase\month\or +%January\or February\or March\or April\or May\or June\or +%July\or August\or September\or October\or November\or December\fi +%\space\number\day, \number\year} + +% @settitle line... specifies the title of the document, for headings +% It generates no output of its own + +\def\thistitle{No Title} \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} \message{tables,} + +% @tabs -- simple alignment + +% These don't work. For one thing, \+ is defined as outer. +% So these macros cannot even be defined. + +%\def\tabs{\parsearg\tabszzz} +%\def\tabszzz #1{\settabs\+#1\cr} +%\def\tabline{\parsearg\tablinezzz} +%\def\tablinezzz #1{\+#1\cr} +%\def\&{&} + % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text @@ -1731,6 +1757,11 @@ \itemindex{#1}% \nobreak % This prevents a break before @itemx. % + % Be sure we are not still in the middle of a paragraph. + %{\parskip = 0in + %\par + %}% + % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next @@ -1759,17 +1790,13 @@ \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. + % following text (if any) will end up on the same line. Since that + % text will be indented by \tableindent, we make the item text be in + % a zero-width box. \noindent - % Do this with kerns and \unhbox so that if there is a footnote in - % the item text, it can migrate to the main vertical list and - % eventually be printed. - \nobreak\kern-\tableindent - \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 - \unhbox0 - \nobreak\kern\dimen0 - \endgroup - \itemxneedsnegativevskiptrue + \rlap{\hskip -\tableindent\box0}\ignorespaces% + \endgroup% + \itemxneedsnegativevskiptrue% \fi } @@ -1780,10 +1807,9 @@ \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} -% Contains a kludge to get @end[description] to work. +%% Contains a kludge to get @end[description] to work \def\description{\tablez{\dontindex}{1}{}{}{}{}} -% @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% @@ -1843,7 +1869,7 @@ \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% - \begingroup % ended by the @end itemize + \begingroup % ended by the @end itemsize \itemizey {#1}{\Eitemize} } @@ -2056,60 +2082,46 @@ \multitablelinespace=0pt % Macros used to set up halign preamble: -% +% \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -% #1 is the part of the @columnfraction before the decimal point, which -% is presumably either 0 or the empty string (but we don't check, we -% just throw it away). #2 is the decimal part, which we use as the -% percent of \hsize for this column. -\def\pickupwholefraction#1.#2 {% - \global\advance\colcount by 1 - \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% - \setuptable -} +% 2/1/96, to allow fractions to be given with more than one digit. +\def\pickupwholefraction#1 {\global\advance\colcount by1 % +\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% +\setuptable} \newcount\colcount -\def\setuptable#1{% - \def\firstarg{#1}% - \ifx\firstarg\xendsetuptable - \let\go = \relax +\def\setuptable#1{\def\firstarg{#1}% +\ifx\firstarg\xendsetuptable\let\go\relax% +\else + \ifx\firstarg\xcolumnfractions\global\setpercenttrue% \else - \ifx\firstarg\xcolumnfractions - \global\setpercenttrue + \ifsetpercent + \let\go\pickupwholefraction % In this case arg of setuptable + % is the decimal point before the + % number given in percent of hsize. + % We don't need this so we don't use it. \else - \ifsetpercent - \let\go\pickupwholefraction - \else - \global\advance\colcount by 1 - \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; - % typically that is always in the input, anyway. - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi - \fi - \ifx\go\pickupwholefraction - % Put the argument back for the \pickupwholefraction call, so - % we'll always have a period there to be parsed. - \def\go{\pickupwholefraction#1}% - \else - \let\go = \setuptable + \global\advance\colcount by1 + \setbox0=\hbox{#1 }% Add a normal word space as a separator; + % typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi% - \fi - \go -} - -% This used to have \hskip1sp. But then the space in a template line is -% not enough. That is bad. So let's go back to just & until we -% encounter the problem it was intended to solve again. -% --karl, nathan@acm.org, 20apr99. -\def\tab{&} + \fi% +\ifx\go\pickupwholefraction\else\let\go\setuptable\fi% +\fi\go} + +% multitable syntax +\def\tab{&\hskip1sp\relax} % 2/2/96 + % tiny skip here makes sure this column space is + % maintained, even if it is never used. % @multitable ... @end multitable definitions: -% + \def\multitable{\parsearg\dotable} \def\dotable#1{\bgroup \vskip\parskip @@ -2148,15 +2160,15 @@ % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. - % + % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. - % + % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. - % + % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 @@ -2187,18 +2199,15 @@ % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt -\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip -\global\advance\multitablelinespace by-\ht0 %% strut to put in table in case some entry doesn't have descenders, %% to keep lines equally spaced \let\multistrut = \strut -\else -%% FIXME: what is \box0 supposed to be? -\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 -width0pt\relax} \fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. +\else +\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 +width0pt\relax} \fi \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller @@ -2211,356 +2220,6 @@ \fi} -\message{conditionals,} -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% - \let\chapter=\relax - \let\unnumbered=\relax - \let\top=\relax - \let\unnumberedsec=\relax - \let\unnumberedsection=\relax - \let\unnumberedsubsec=\relax - \let\unnumberedsubsection=\relax - \let\unnumberedsubsubsec=\relax - \let\unnumberedsubsubsection=\relax - \let\section=\relax - \let\subsec=\relax - \let\subsubsec=\relax - \let\subsection=\relax - \let\subsubsection=\relax - \let\appendix=\relax - \let\appendixsec=\relax - \let\appendixsection=\relax - \let\appendixsubsec=\relax - \let\appendixsubsection=\relax - \let\appendixsubsubsec=\relax - \let\appendixsubsubsection=\relax - \let\contents=\relax - \let\smallbook=\relax - \let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -\def\ignoremorecommands{% - \let\defcodeindex = \relax - \let\defcv = \relax - \let\deffn = \relax - \let\deffnx = \relax - \let\defindex = \relax - \let\defivar = \relax - \let\defmac = \relax - \let\defmethod = \relax - \let\defop = \relax - \let\defopt = \relax - \let\defspec = \relax - \let\deftp = \relax - \let\deftypefn = \relax - \let\deftypefun = \relax - \let\deftypeivar = \relax - \let\deftypeop = \relax - \let\deftypevar = \relax - \let\deftypevr = \relax - \let\defun = \relax - \let\defvar = \relax - \let\defvr = \relax - \let\ref = \relax - \let\xref = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\settitle = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\everyheading = \relax - \let\evenheading = \relax - \let\oddheading = \relax - \let\everyfooting = \relax - \let\evenfooting = \relax - \let\oddfooting = \relax - \let\headings = \relax - \let\include = \relax - \let\lowersections = \relax - \let\down = \relax - \let\raisesections = \relax - \let\up = \relax - \let\set = \relax - \let\clear = \relax - \let\item = \relax -} - -% Ignore @ignore ... @end ignore. -% -\def\ignore{\doignore{ignore}} - -% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. -% -\def\ifinfo{\doignore{ifinfo}} -\def\ifhtml{\doignore{ifhtml}} -\def\ifnottex{\doignore{ifnottex}} -\def\html{\doignore{html}} -\def\menu{\doignore{menu}} -\def\direntry{\doignore{direntry}} - -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory = \comment - -% Ignore text until a line `@end #1'. -% -\def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - % This @ is a catcode 12 token (that is the normal catcode of @ in - % this texinfo.tex file). We change the catcode of @ below to match. - \long\def\doignoretext##1@end #1{\enddoignore}% - % - % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode32 = 10 - % - % Ignore braces, too, so mismatched braces don't cause trouble. - \catcode`\{ = 9 - \catcode`\} = 9 - % - % We must not have @c interpreted as a control sequence. - \catcode`\@ = 12 - % - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 - % - % And now expand that command. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{WARNING: for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi -} - -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the change of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook: make the current font be a dummy font. - % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because not all sites - % might have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont - \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont - \let\tensf=\nullfont - % Similarly for index fonts (mostly for their use in smallexample). - \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont - \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont - \let\smallsf=\nullfont - % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex - \def\tex{\doignore{tex}}% - % Do not execute macro definitions. - % `c' is a comment character, so the word `macro' will get cut off. - \def\macro{\doignore{ma}}% -} - -% @set VAR sets the variable VAR to an empty value. -% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. -% -% Since we want to separate VAR from REST-OF-LINE (which might be -% empty), we can't just use \parsearg; we have to insert a space of our -% own to delimit the rest of the line, and then take it out again if we -% didn't need it. Make sure the catcode of space is correct to avoid -% losing inside @example, for instance. -% -\def\set{\begingroup\catcode` =10 - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} -\def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - \endgroup -} -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} - -% @clear VAR clears (i.e., unsets) the variable VAR. -% -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} - -% @value{foo} gets the text saved in variable foo. -{ - \catcode`\_ = \active - % - % We might end up with active _ or - characters in the argument if - % we're called from @code, as @code{@value{foo-bar_}}. So \let any - % such active characters to their normal equivalents. - \gdef\value{\begingroup - \catcode`\-=12 \catcode`\_=12 - \indexbreaks \let_\normalunderscore - \valuexxx} -} -\def\valuexxx#1{\expandablevalue{#1}\endgroup} - -% We have this subroutine so that we can handle at least some @value's -% properly in indexes (we \let\value to this in \indexdummies). Ones -% whose names contain - or _ still won't work, but we can't do anything -% about that. The command has to be fully expandable, since the result -% winds up in the index file. This means that if the variable's value -% contains other Texinfo commands, it's almost certain it will fail -% (although perhaps we could fix that with sufficient work to do a -% one-level expansion on the result, instead of complete). -% -\def\expandablevalue#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - {[No value for ``#1'']}% - \else - \csname SET#1\endcsname - \fi -} - -% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined -% with @set. -% -\def\ifset{\parsearg\ifsetxxx} -\def\ifsetxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifsetfail - \else - \expandafter\ifsetsucceed - \fi -} -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} - -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been -% defined with @set, or has been undefined with @clear. -% -\def\ifclear{\parsearg\ifclearxxx} -\def\ifclearxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifclearsucceed - \else - \expandafter\ifclearfail - \fi -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text -% following, through the first @end iftex (etc.). Make `@end iftex' -% (etc.) valid only after an @iftex. -% -\def\iftex{\conditionalsucceed{iftex}} -\def\ifnothtml{\conditionalsucceed{ifnothtml}} -\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} -\defineunmatchedend{iftex} -\defineunmatchedend{ifnothtml} -\defineunmatchedend{ifnotinfo} - -% We can't just want to start a group at @iftex (for example) and end it -% at @end iftex, since then @set commands inside the conditional have no -% effect (they'd get reverted at the end of the group). So we must -% define \Eiftex to redefine itself to be its previous value. (We can't -% just define it to fail again with an ``unmatched end'' error, since -% the @ifset might be nested.) -% -\def\conditionalsucceed#1{% - \edef\temp{% - % Remember the current value of \E#1. - \let\nece{prevE#1} = \nece{E#1}% - % - % At the `@end #1', redefine \E#1 to be its previous value. - \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% - }% - \temp -} - -% We need to expand lots of \csname's, but we don't want to expand the -% control sequences after we've constructed them. -% -\def\nece#1{\expandafter\noexpand\csname#1\endcsname} - -% @defininfoenclose. -\let\definfoenclose=\comment - - \message{indexing,} % Index generation facilities @@ -2576,14 +2235,12 @@ % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. -% -\def\newindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - \fi - \expandafter\xdef\csname#1index\endcsname{% % Define @#1index - \noexpand\doindex{#1}} + +\def\newindex #1{ +\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\doindex {#1}} } % @defindex foo == \newindex{foo} @@ -2592,37 +2249,31 @@ % Define @defcodeindex, like @defindex except put all entries in @code. -\def\newcodeindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 - \fi - \expandafter\xdef\csname#1index\endcsname{% - \noexpand\docodeindex{#1}} +\def\newcodeindex #1{ +\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\docodeindex {#1}} } \def\defcodeindex{\parsearg\newcodeindex} % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -% The \closeout helps reduce unnecessary open files; the limit on the -% Acorn RISC OS is a mere 16 files. -\def\synindex#1 #2 {% - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\closeout\csname#1indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - \expandafter\xdef\csname#1index\endcsname{% define \xxxindex - \noexpand\doindex{#2}}% +\def\synindex #1 #2 {% +\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname +\expandafter\let\csname#1indfile\endcsname=\synindexfoo +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\doindex {#2}}% } % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -\def\syncodeindex#1 #2 {% - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\closeout\csname#1indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - \expandafter\xdef\csname#1index\endcsname{% define \xxxindex - \noexpand\docodeindex{#2}}% +\def\syncodeindex #1 #2 {% +\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname +\expandafter\let\csname#1indfile\endcsname=\synindexfoo +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\docodeindex {#2}}% } % Define \doindex, the driver for all \fooindex macros. @@ -2643,7 +2294,6 @@ \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\indexdummies{% -\def\ { }% % Take care of the plain tex accent commands. \def\"{\realbackslash "}% \def\`{\realbackslash `}% @@ -2673,11 +2323,8 @@ % (Must be a way to avoid doing expansion at all, and thus not have to % laboriously list every single command here.) \def\@{@}% will be @@ when we switch to @ as escape char. -% Need these in case \tex is in effect and \{ is a \delimiter again. -% But can't use \lbracecmd and \rbracecmd because texindex assumes -% braces and backslashes are used only as delimiters. -\let\{ = \mylbrace -\let\} = \myrbrace +%\let\{ = \lbracecmd +%\let\} = \rbracecmd \def\_{{\realbackslash _}}% \def\w{\realbackslash w }% \def\bf{\realbackslash bf }% @@ -2688,6 +2335,7 @@ \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% +%\def\char{\realbackslash char}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% \def\result{\realbackslash result}% @@ -2699,11 +2347,6 @@ \def\copyright{\realbackslash copyright}% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% -\def\uref##1{\realbackslash uref {##1}}% -\def\url##1{\realbackslash url {##1}}% -\def\env##1{\realbackslash env {##1}}% -\def\command##1{\realbackslash command {##1}}% -\def\option##1{\realbackslash option {##1}}% \def\dotless##1{\realbackslash dotless {##1}}% \def\samp##1{\realbackslash samp {##1}}% \def\,##1{\realbackslash ,{##1}}% @@ -2719,16 +2362,8 @@ \def\kbd##1{\realbackslash kbd {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\emph##1{\realbackslash emph {##1}}% -\def\acronym##1{\realbackslash acronym {##1}}% -% -% Handle some cases of @value -- where the variable name does not -% contain - or _, and the value does not contain any -% (non-fully-expandable) commands. -\let\value = \expandablevalue -% +\def\value##1{\realbackslash value {##1}}% \unsepspaces -% Turn off macro expansion -\turnoffmacros } % If an index command is used in an @example environment, any spaces @@ -2785,12 +2420,6 @@ %\let\tt=\indexdummyfont \let\tclose=\indexdummyfont \let\code=\indexdummyfont -\let\url=\indexdummyfont -\let\uref=\indexdummyfont -\let\env=\indexdummyfont -\let\acronym=\indexdummyfont -\let\command=\indexdummyfont -\let\option=\indexdummyfont \let\file=\indexdummyfont \let\samp=\indexdummyfont \let\kbd=\indexdummyfont @@ -2806,24 +2435,14 @@ % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other - @gdef@realbackslash{\}} +@gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. -\let\SETmarginindex=\relax % put index entries in margin (undocumented)? - -% For \ifx comparisons. -\def\emptymacro{\empty} - -% Most index entries go through here, but \dosubind is the general case. -% -\def\doind#1#2{\dosubind{#1}{#2}\empty} - -% Workhorse for all \fooindexes. -% #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% \empty if called from \doind, as we usually are. The main exception -% is with defuns, which call us directly. -% -\def\dosubind#1#2#3{% + +\let\SETmarginindex=\relax %initialize! +% workhorse for all \fooindexes +% #1 is name of index, #2 is stuff to put there +\def\doind #1#2{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% @@ -2834,75 +2453,48 @@ \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% - \let\folio = 0% We will expand all macros now EXCEPT \folio. + \let\folio=0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % - \def\thirdarg{#3}% - % - % If third arg is present, precede it with space in sort key. - \ifx\thirdarg\emptymacro - \let\subentry = \empty - \else - \def\subentry{ #3}% - \fi - % - % First process the index entry with all font commands turned - % off to get the string to sort by. - {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% + % First process the index-string with all font commands turned off + % to get the string to sort by. + {\indexnofonts \xdef\indexsorttmp{#2}}% % - % Now the real index entry with the fonts. + % Now produce the complete index entry, with both the sort key and the + % original text, including any font commands. \toks0 = {#2}% - % - % If third (subentry) arg is present, add it to the index - % string. And include a space. - \ifx\thirdarg\emptymacro \else - \toks0 = \expandafter{\the\toks0 \space #3}% - \fi - % - % Set up the complete index entry, with both the sort key - % and the original text, including any font commands. We write - % three arguments to \entry to the .?? file, texindex reduces to - % two when writing the .??s sorted result. \edef\temp{% \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% - % - % If a skip is the last thing on the list now, preserve it - % by backing up by \lastskip, doing the \write, then inserting - % the skip again. Otherwise, the whatsit generated by the - % \write will make \lastskip zero. The result is that sequences - % like this: - % @end defun - % @tindex whatever - % @defun ... - % will have extra space inserted, because the \medbreak in the - % start of the @defun won't see the skip inserted by the @end of - % the previous defun. - % - % But don't do any of this if we're not in vertical mode. We - % don't want to do a \vskip and prematurely end a paragraph. - % - % Avoid page breaks due to these extra skips, too. - % - \iflinks - \ifvmode - \skip0 = \lastskip - \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi - \fi - % - \temp % do the write - % - % - \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi - \fi + \temp }% }% \penalty\count255 }% } +\def\dosubind #1#2#3{% +{\count10=\lastpenalty % +{\indexdummies % Must do this here, since \bf, etc expand at this stage +\escapechar=`\\% +{\let\folio=0% +\def\rawbackslashxx{\indexbackslash}% +% +% Now process the index-string once, with all font commands turned off, +% to get the string to sort the index by. +{\indexnofonts +\xdef\temp1{#2 #3}% +}% +% Now produce the complete index entry. We process the index-string again, +% this time with font commands expanded, to get what to print in the index. +\edef\temp{% +\write \csname#1indfile\endcsname{% +\realbackslash entry {\temp1}{\folio}{#2}{#3}}}% +\temp }% +}\penalty\count10}} + % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or @@ -2942,7 +2534,7 @@ \def\doprintindex#1{\begingroup \dobreak \chapheadingskip{10000}% % - \smallfonts \rm + \indexfonts \rm \tolerance = 9500 \indexbreaks % @@ -2958,7 +2550,7 @@ % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. - \putwordIndexNonexistent + (Index is nonexistent) \else % % If the index file exists but is empty, then \openin leaves \ifeof @@ -2966,7 +2558,7 @@ % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 - \putwordIndexIsEmpty + (Index is empty) \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change @@ -2985,35 +2577,21 @@ % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -\def\initial#1{{% - % Some minor font changes for the special characters. - \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt - % - % Remove any glue we may have, we'll be inserting our own. - \removelastskip - % - % We like breaks before the index initials, so insert a bonus. - \penalty -300 - % - % Typeset the initial. Making this add up to a whole number of - % baselineskips increases the chance of the dots lining up from column - % to column. It still won't often be perfect, because of the stretch - % we need before each entry, but it's better. - % - % No shrink because it confuses \balancecolumns. - \vskip 1.67\baselineskip plus .5\baselineskip - \leftline{\secbf #1}% - \vskip .33\baselineskip plus .1\baselineskip - % - % Do our best not to break after the initial. - \nobreak -}} +% Same as \bigskipamount except no shrink. +% \balancecolumns gets confused if there is any shrink. +\newskip\initialskipamount \initialskipamount 12pt plus4pt + +\def\initial #1{% +{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt +\ifdim\lastskip<\initialskipamount +\removelastskip \penalty-200 \vskip \initialskipamount\fi +\line{\secbf#1\hfill}\kern 2pt\penalty10000}} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % -\def\entry#1#2{\begingroup +\def\entry #1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. @@ -3036,15 +2614,12 @@ % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. - \hangindent = 2em + \hangindent=2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % - % A bit of stretch before each entry for the benefit of balancing columns. - \vskip 0pt plus1pt - % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent @@ -3069,11 +2644,7 @@ % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. - \else - \ #2% The page number ends the paragraph. - \fi + \ #2% The page number ends the paragraph. \fi% \par \endgroup} @@ -3102,26 +2673,24 @@ \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. - \output = {% - % + \output = {\global\setbox\partialpage = \vbox{% + % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In - % that case we just ship out what is in \partialpage with the normal - % output routine. Generally, \partialpage will be empty when this - % runs and this will be a no-op. See the indexspread.tex test case. - \ifvoid\partialpage \else - \onepageout{\pagecontents\partialpage}% - \fi + % that case, we must prevent the second \partialpage from + % simply overwriting the first, causing us to lose the page. + % This will preserve it until a real output routine can ship it + % out. Generally, \partialpage will be empty when this runs and + % this will be a no-op. + \unvbox\partialpage % - \global\setbox\partialpage = \vbox{% - % Unvbox the main output page. - \unvbox\PAGE - \kern-\topskip \kern\baselineskip - }% - }% - \eject % run that output routine to set \partialpage + % Unvbox the main output page. + \unvbox255 + \kern-\topskip \kern\baselineskip + }}% + \eject % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% @@ -3149,21 +2718,14 @@ % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) - \advance\vsize by -\ht\partialpage \vsize = 2\vsize } - -% The double-column output routine for all double-column pages except -% the last. -% \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. - \dimen@ = \vsize - \divide\dimen@ by 2 - % + \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar @@ -3172,67 +2734,42 @@ } \def\pagesofar{% % Re-output the contents of the output page -- any previous material, - % followed by the two boxes we just split, in box0 and box2. + % followed by the two boxes we just split. \unvbox\partialpage - % \hsize = \doublecolumnhsize - \wd0=\hsize \wd2=\hsize - \hbox to\pagewidth{\box0\hfil\box2}% + \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } \def\enddoublecolumns{% - \output = {% - % Split the last of the double-column material. Leave it on the - % current page, no automatic page break. - \balancecolumns - % - % If we end up splitting too much material for the current page, - % though, there will be another page break right after this \output - % invocation ends. Having called \balancecolumns once, we do not - % want to call it again. Therefore, reset \output to its normal - % definition right away. (We hope \balancecolumns will never be - % called on to balance too much material, but if it is, this makes - % the output somewhat more palatable.) - \global\output = {\onepageout{\pagecontents\PAGE}}% - }% - \eject + \output = {\balancecolumns}\eject % split what we have \endgroup % started in \begindoublecolumns % - % \pagegoal was set to the doubled \vsize above, since we restarted - % the current page. We're now back to normal single-column - % typesetting, so reset \pagegoal to the normal \vsize (after the - % \endgroup where \vsize got restored). + % Back to normal single-column typesetting, but take account of the + % fact that we just accumulated some stuff on the output page. \pagegoal = \vsize } \def\balancecolumns{% % Called at the end of the double column material. - \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \setbox0 = \vbox{\unvbox255}% \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 % target to split to - %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \divide\dimen@ by 2 \splittopskip = \topskip % Loop until we get a decent breakpoint. - {% - \vbadness = 10000 - \loop - \global\setbox3 = \copy0 - \global\setbox1 = \vsplit3 to \dimen@ - \ifdim\ht3>\dimen@ - \global\advance\dimen@ by 1pt - \repeat - }% - %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + {\vbadness=10000 \loop + \global\setbox3=\copy0 + \global\setbox1=\vsplit3 to\dimen@ + \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt + \repeat}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% - % \pagesofar } \catcode`\@ = \other \message{sectioning,} -% Chapters, sections, etc. +% Define chapters, sections, etc. \newcount\chapno \newcount\secno \secno=0 @@ -3241,48 +2778,58 @@ % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ -% \def\appendixletter{\char\the\appendixno} -% We do the following for the sake of pdftex, which needs the actual -% letter in the expansion, not just typeset. -\def\appendixletter{% - \ifnum\appendixno=`A A% - \else\ifnum\appendixno=`B B% - \else\ifnum\appendixno=`C C% - \else\ifnum\appendixno=`D D% - \else\ifnum\appendixno=`E E% - \else\ifnum\appendixno=`F F% - \else\ifnum\appendixno=`G G% - \else\ifnum\appendixno=`H H% - \else\ifnum\appendixno=`I I% - \else\ifnum\appendixno=`J J% - \else\ifnum\appendixno=`K K% - \else\ifnum\appendixno=`L L% - \else\ifnum\appendixno=`M M% - \else\ifnum\appendixno=`N N% - \else\ifnum\appendixno=`O O% - \else\ifnum\appendixno=`P P% - \else\ifnum\appendixno=`Q Q% - \else\ifnum\appendixno=`R R% - \else\ifnum\appendixno=`S S% - \else\ifnum\appendixno=`T T% - \else\ifnum\appendixno=`U U% - \else\ifnum\appendixno=`V V% - \else\ifnum\appendixno=`W W% - \else\ifnum\appendixno=`X X% - \else\ifnum\appendixno=`Y Y% - \else\ifnum\appendixno=`Z Z% - % The \the is necessary, despite appearances, because \appendixletter is - % expanded while writing the .toc file. \char\appendixno is not - % expandable, thus it is written literally, thus all appendixes come out - % with the same letter (or @) in the toc without it. - \else\char\the\appendixno - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} +\def\appendixletter{\char\the\appendixno} + +\newwrite\contentsfile +% This is called from \setfilename. +\def\opencontents{\openout\contentsfile = \jobname.toc } % Each @chapter defines this as the name of the chapter. -% page headings and footings can use it. @section does likewise. -\def\thischapter{} -\def\thissection{} +% page headings and footings can use it. @section does likewise + +\def\thischapter{} \def\thissection{} +\def\seccheck#1{\ifnum \pageno<0 + \errmessage{@#1 not allowed after generating table of contents}% +\fi} + +\def\chapternofonts{% + \let\rawbackslash=\relax + \let\frenchspacing=\relax + \def\result{\realbackslash result}% + \def\equiv{\realbackslash equiv}% + \def\expansion{\realbackslash expansion}% + \def\print{\realbackslash print}% + \def\TeX{\realbackslash TeX}% + \def\dots{\realbackslash dots}% + \def\result{\realbackslash result}% + \def\equiv{\realbackslash equiv}% + \def\expansion{\realbackslash expansion}% + \def\print{\realbackslash print}% + \def\error{\realbackslash error}% + \def\point{\realbackslash point}% + \def\copyright{\realbackslash copyright}% + \def\tt{\realbackslash tt}% + \def\bf{\realbackslash bf}% + \def\w{\realbackslash w}% + \def\less{\realbackslash less}% + \def\gtr{\realbackslash gtr}% + \def\hat{\realbackslash hat}% + \def\char{\realbackslash char}% + \def\tclose##1{\realbackslash tclose{##1}}% + \def\code##1{\realbackslash code{##1}}% + \def\samp##1{\realbackslash samp{##1}}% + \def\r##1{\realbackslash r{##1}}% + \def\b##1{\realbackslash b{##1}}% + \def\key##1{\realbackslash key{##1}}% + \def\file##1{\realbackslash file{##1}}% + \def\kbd##1{\realbackslash kbd{##1}}% + % These are redefined because @smartitalic wouldn't work inside xdef. + \def\i##1{\realbackslash i{##1}}% + \def\cite##1{\realbackslash cite{##1}}% + \def\var##1{\realbackslash var{##1}}% + \def\emph##1{\realbackslash emph{##1}}% + \def\dfn##1{\realbackslash dfn{##1}}% +} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count @@ -3354,59 +2901,59 @@ \fi } -% @chapter, @appendix, @unnumbered. + \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{% +\def\chapterzzz #1{\seccheck{chapter}% \secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% +\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% - {\the\chapno}}}% -\temp -\donoderef +\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec -} +}} \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{% +\def\appendixzzz #1{\seccheck{appendix}% \secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 -\message{\putwordAppendix\space \appendixletter}% +\global\advance \appendixno by 1 \message{Appendix \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% - {\putwordAppendix{} \appendixletter}}}% -\temp -\appendixnoderef +\edef\temp{{\realbackslash chapentry{\the\toks0}% + {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec -} +}} % @centerchap is like @unnumbered, but the heading is centered. \outer\def\centerchap{\parsearg\centerchapyyy} \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} -% @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} - \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{% +\def\unnumberedzzz #1{\seccheck{unnumbered}% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the @@ -3418,139 +2965,155 @@ % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the<toks register> to achieve this: TeX expands \the<toks> only once, -% simply yielding the contents of <toks register>. (We also do this for -% the toc entries.) +% simply yielding the contents of the <toks register>. \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% -\temp -\unnumbnoderef +\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec -} - -% Sections. +}} + \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{% +\def\seczzz #1{\seccheck{section}% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% - {\the\chapno}{\the\secno}}}% -\temp -\donoderef -\nobreak -} +\edef\temp{{\realbackslash secentry % +{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\penalty 10000 % +}} \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{% +\def\appendixsectionzzz #1{\seccheck{appendixsection}% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% - {\appendixletter}{\the\secno}}}% -\temp -\appendixnoderef -\nobreak -} +\edef\temp{{\realbackslash secentry % +{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\penalty 10000 % +}} \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{% +\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% \plainsecheading {#1}\gdef\thissection{#1}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% -\temp -\unnumbnoderef -\nobreak -} - -% Subsections. +\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\penalty 10000 % +}} + \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{% +\def\numberedsubseczzz #1{\seccheck{subsection}% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% - {\the\chapno}{\the\secno}{\the\subsecno}}}% -\temp -\donoderef -\nobreak -} +\edef\temp{{\realbackslash subsecentry % +{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\penalty 10000 % +}} \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{% +\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% - {\appendixletter}{\the\secno}{\the\subsecno}}}% -\temp -\appendixnoderef -\nobreak -} +\edef\temp{{\realbackslash subsecentry % +{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\penalty 10000 % +}} \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{% +\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% \plainsubsecheading {#1}\gdef\thissection{#1}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% - {\the\toks0}}}% -\temp -\unnumbnoderef -\nobreak -} - -% Subsubsections. +\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\penalty 10000 % +}} + \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{% +\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% -\temp -\donoderef -\nobreak -} +\edef\temp{{\realbackslash subsubsecentry{\the\toks0} + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} + {\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\penalty 10000 % +}} \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{% +\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% -\temp -\appendixnoderef -\nobreak -} +\edef\temp{{\realbackslash subsubsecentry{\the\toks0}% + {\appendixletter} + {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\penalty 10000 % +}} \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{% +\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% \plainsubsubsecheading {#1}\gdef\thissection{#1}% +{\chapternofonts% \toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% - {\the\toks0}}}% -\temp -\unnumbnoderef -\nobreak -} +\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\penalty 10000 % +}} % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. @@ -3579,7 +3142,8 @@ % Define @majorheading, @heading and @subheading -% NOTE on use of \vbox for chapter headings, section headings, and such: +% NOTE on use of \vbox for chapter headings, section headings, and +% such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a @@ -3626,12 +3190,12 @@ \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} -\def\CHAPPAGoff{% +\def\CHAPPAGoff{ \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} -\def\CHAPPAGon{% +\def\CHAPPAGon{ \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager @@ -3685,7 +3249,7 @@ \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\nobreak + \rm #1\hfill}}\bigskip \par\penalty 10000 % } \def\chfopen #1#2{\chapoddpage {\chapfonts @@ -3696,7 +3260,7 @@ \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt - \hfill {\rm #1}\hfill}}\bigskip \par\nobreak + \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % } \def\CHAPFopen{ @@ -3749,45 +3313,24 @@ } -\message{toc,} -% Table of contents. -\newwrite\tocfile - -% Write an entry to the toc file, opening it if necessary. -% Called from @chapter, etc. We supply {\folio} at the end of the -% argument, which will end up as the last argument to the \...entry macro. -% -% We open the .toc file here instead of at @setfilename or any other -% given time so that @contents can be put in the document anywhere. -% -\newif\iftocfileopened -\def\writetocentry#1{% - \iftocfileopened\else - \immediate\openout\tocfile = \jobname.toc - \global\tocfileopenedtrue - \fi - \iflinks \write\tocfile{#1{\folio}}\fi -} +\message{toc printing,} +% Finish up the main text and prepare to read what we've written +% to \contentsfile. \newskip\contentsrightmargin \contentsrightmargin=1in -\newcount\savepageno -\newcount\lastnegativepageno \lastnegativepageno = -1 - -% Finish up the main text and prepare to read what we've written -% to \tocfile. -% \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund <tege@matematik.su.se> \contentsalignmacro - \immediate\closeout\tocfile - % + \immediate\closeout \contentsfile + \ifnum \pageno>0 + \pageno = -1 % Request roman numbered pages. + \fi % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% - \savepageno = \pageno \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 % We can't do this, because then an actual ^ in a section @@ -3795,31 +3338,20 @@ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. - % - % Roman numerals for page numbers. - \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. -\def\contents{% - \startcontents{\putwordTOC}% - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \pdfmakeoutlines +\outer\def\contents{% + \startcontents{\putwordTableofContents}% + \input \jobname.toc \endgroup - \lastnegativepageno = \pageno - \pageno = \savepageno + \vfill \eject } % And just the chapters. -\def\summarycontents{% - \startcontents{\putwordShortTOC}% +\outer\def\summarycontents{% + \startcontents{\putwordShortContents}% % \let\chapentry = \shortchapentry \let\unnumbchapentry = \shortunnumberedentry @@ -3835,23 +3367,12 @@ \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2{} - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect + \input \jobname.toc \endgroup - \lastnegativepageno = \pageno - \pageno = \savepageno + \vfill \eject } \let\shortcontents = \summarycontents -\ifpdf - \pdfcatalog{/PageMode /UseOutlines}% -\fi - % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. @@ -3862,7 +3383,7 @@ % See comments in \dochapentry re vbox and related settings \def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% } % Typeset the label for a chapter or appendix for the short contents. @@ -3870,14 +3391,10 @@ % We could simplify the code here by writing out an \appendixentry % command in the toc file for appendices, instead of using \chapentry % for both, but it doesn't seem worth it. -% -\newdimen\shortappendixwidth -% +\setbox0 = \hbox{\shortcontrm \putwordAppendix } +\newdimen\shortappendixwidth \shortappendixwidth = \wd0 + \def\shortchaplabel#1{% - % Compute width of word "Appendix", may change with language. - \setbox0 = \hbox{\shortcontrm \putwordAppendix}% - \shortappendixwidth = \wd0 - % % We typeset #1 in a box of constant width, regardless of the text of % #1, so the chapter titles will come out aligned. \setbox0 = \hbox{#1}% @@ -3892,7 +3409,7 @@ } \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} -\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} +\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} % Sections. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} @@ -3919,24 +3436,24 @@ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{\dopageno{#2}}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{\dopageno{#2}}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{\dopageno{#2}}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{\dopageno{#2}}% \endgroup} % Final typesetting of a toc entry; we use the same \entry macro as for @@ -3964,7 +3481,6 @@ \message{environments,} -% @foo ... @end foo. % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. @@ -4037,7 +3553,6 @@ \let\!=\ptexexclam \let\i=\ptexi \let\{=\ptexlbrace - \let\+=\tabalign \let\}=\ptexrbrace \let\*=\ptexstar \let\t=\ptext @@ -4089,8 +3604,8 @@ % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax -% @cartouche ... @end cartouche: draw rectangle w/rounded corners around -% environment contents. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \cartouche: draw rectangle w/rounded corners around argument \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner @@ -4117,9 +3632,9 @@ \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either + \advance\cartouter by 18pt % allow for 3pt kerns on either % side, and for 6pt waste from -% each corner char, and rule thickness +% each corner char \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment @@ -4173,52 +3688,49 @@ \fi } -% Define the \E... control sequence only if we are inside the particular -% environment, so the error checking in \end will work. +% To ending an @example-like environment, we first end the paragraph +% (via \afterenvbreak's vertical glue), and then the group. That way we +% keep the zero \parskip that the environments set -- \parskip glue +% will be inserted at the beginning of the next paragraph in the +% document, after the environment. % -% To end an @example-like environment, we first end the paragraph (via -% \afterenvbreak's vertical glue), and then the group. That way we keep -% the zero \parskip that the environments set -- \parskip glue will be -% inserted at the beginning of the next paragraph in the document, after -% the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup} - -% @lisp: indented, narrowed, typewriter font. +\def\nonfillfinish{\afterenvbreak\endgroup}% + \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt - \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. - \gobble % eat return + % Make @kbd do something special, if requested. + \let\kbdfont\kbdexamplefont + \rawbackslash % have \ input char produce \ char from current font + \gobble } -% @example: Same as @lisp. -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} - -% @small... is usually equivalent to the non-small (@smallbook -% redefines). We must call \example (or whatever) last in the -% definition, since it reads the return following the @example (or -% whatever) command. +% Define the \E... control sequence only if we are inside the +% environment, so the error checking in \end will work. % -% This actually allows (for example) @end display inside an -% @smalldisplay. Too bad, but makeinfo will catch the error anyway. +% We must call \lisp last in the definition, since it reads the +% return following the @example (or whatever) command. % -\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} -\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} -\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} - -% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. -% Originally contributed by Pavel@xerox. +\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} +\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} +\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} + +% @smallexample and @smalllisp. This is not used unless the @smallbook +% command is given. Originally contributed by Pavel@xerox. +% \def\smalllispx{\begingroup - \def\Esmalllisp{\nonfillfinish\endgroup}% - \def\Esmallexample{\nonfillfinish\endgroup}% - \smallfonts - \lisp + \nonfillstart + \let\Esmalllisp = \nonfillfinish + \let\Esmallexample = \nonfillfinish + % + % Smaller fonts for small examples. + \indexfonts \tt + \rawbackslash % make \ output the \ character from the current font (tt) + \gobble } -% @display: same as @lisp except keep current font. +% This is @display; same as @lisp except use roman font. % \def\display{\begingroup \nonfillstart @@ -4226,15 +3738,7 @@ \gobble } -% @smalldisplay (when @smallbook): @display plus smaller fonts. -% -\def\smalldisplayx{\begingroup - \def\Esmalldisplay{\nonfillfinish\endgroup}% - \smallfonts \rm - \display -} - -% @format: same as @display except don't narrow margins. +% This is @format; same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t @@ -4243,27 +3747,20 @@ \gobble } -% @smallformat (when @smallbook): @format plus smaller fonts. +% @flushleft (same as @format) and @flushright. % -\def\smallformatx{\begingroup - \def\Esmallformat{\nonfillfinish\endgroup}% - \smallfonts \rm - \format +\def\flushleft{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eflushleft = \nonfillfinish + \gobble } - -% @flushleft (same as @format). -% -\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} - -% @flushright. -% \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill - \gobble -} + \gobble} % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. @@ -4286,11 +3783,9 @@ \fi } - \message{defuns,} -% @defun etc. - -% Allow user to change definition object font (\df) internally +% Define formatter for defuns +% First, allow user to change definition object font (\df) internally \def\setdeffont #1 {\csname DEF#1\endcsname} \newskip\defbodyindent \defbodyindent=.4in @@ -4344,16 +3839,10 @@ %% contained text. This is especially needed for [ and ] \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } -\let\ampnr = \& +\def\ampnr{\&} \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} -% Active &'s sneak into the index arguments, so make sure it's defined. -{ - \catcode`& = 13 - \global\let& = \ampnr -} - % First, defname, which formats the header line itself. % #1 should be the function name. % #2 should be the type of definition, such as "Function". @@ -4363,18 +3852,20 @@ % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent -\noindent +\dimen3=\rightskip +\advance\dimen3 by -\defbodyindent +\noindent % \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 +\parshape 2 0in \dimen0 \defargsindent \dimen1 % % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. -\advance \hsize by -\dimen2 -\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% +\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 +\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent @@ -4395,62 +3886,23 @@ \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \parindent=0in -\advance\leftskip by \defbodyindent +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % 61 is `=' \obeylines\activeparens\spacesplit#3} -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by the space, is the class name. -% -\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % +\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \parindent=0in -\advance\leftskip by \defbodyindent +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} -% Used for @deftypemethod and @deftypeivar. -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by a space, is the class name. -% #5 is the method's return type. -% -\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} - -% Used for @deftypeop. The change from \deftypemethparsebody is an -% extra argument at the beginning which is the `category', instead of it -% being the hardwired string `Method' or `Instance Variable'. We have -% to account for this both in the \...x definition and in parsing the -% input at hand. Thus also need a control sequence (passed as #5) for -% the \E... definition to assign the category name to. -% -\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 ##2 ##3 {% - \def#4{##1}% - \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} - \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies @@ -4459,7 +3911,7 @@ \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \parindent=0in -\advance\leftskip by \defbodyindent +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} @@ -4474,7 +3926,7 @@ \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\spacesplit#3}% \parindent=0in -\advance\leftskip by \defbodyindent +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % @@ -4491,7 +3943,7 @@ \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \parindent=0in - \advance\leftskip by \defbodyindent + \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines } @@ -4536,7 +3988,7 @@ \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \parindent=0in -\advance\leftskip by \defbodyindent +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\spacesplit{#3{#5}}} @@ -4560,17 +4012,16 @@ % First, define the processing that is wanted for arguments of \defun % Use this to expand the args and terminate the paragraph they make up -\def\defunargs#1{\functionparens \sl +\def\defunargs #1{\functionparens \sl % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. -% Set the font temporarily and use \font in case \setfont made \tensl a macro. -{\tensl\hyphenchar\font=0}% +\hyphenchar\tensl=0 #1% -{\tensl\hyphenchar\font=45}% +\hyphenchar\tensl=45 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil -\endgraf\nobreak\vskip -\parskip\nobreak +\endgraf\penalty 10000\vskip -\parskip\penalty 10000% } \def\deftypefunargs #1{% @@ -4581,7 +4032,7 @@ \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil -\endgraf\nobreak\vskip -\parskip\nobreak +\endgraf\penalty 10000\vskip -\parskip\penalty 10000% } % Do complete processing of one @defun or @defunx line already parsed. @@ -4600,7 +4051,7 @@ \def\defun{\defparsebody\Edefun\defunx\defunheader} \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDeffunc}% +\begingroup\defname {#1}{Function}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } @@ -4614,7 +4065,7 @@ % #1 is the data type, #2 the name, #3 the args. \def\deftypefunheaderx #1#2 #3\relax{% \doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}% +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% \deftypefunargs {#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } @@ -4645,7 +4096,7 @@ \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefmac}% +\begingroup\defname {#1}{Macro}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } @@ -4655,77 +4106,53 @@ \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefspec}% +\begingroup\defname {#1}{Special Form}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } -% @defop CATEGORY CLASS OPERATION ARG... -% +% This definition is run if you use @defunx +% anywhere other than immediately after a @defun or @defunx. + +\def\deffnx #1 {\errmessage{@deffnx in invalid context}} +\def\defunx #1 {\errmessage{@defunx in invalid context}} +\def\defmacx #1 {\errmessage{@defmacx in invalid context}} +\def\defspecx #1 {\errmessage{@defspecx in invalid context}} +\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} +\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} +\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} + +% @defmethod, and so on + +% @defop {Funny Method} foo-class frobnicate argument + \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} -% -\def\defopheader#1#2#3{% -\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index -\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% + +\def\defopheader #1#2#3{% +\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index +\begingroup\defname {#2}{\defoptype{} on #1}% \defunargs {#3}\endgroup % } -% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... -% -\def\deftypeop #1 {\def\deftypeopcategory{#1}% - \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader - \deftypeopcategory} -% -% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. -\def\deftypeopheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$$$#3} - {\deftypeopcategory\ \putwordon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup -} - -% @deftypemethod CLASS TYPE METHOD ARG... +% @deftypemethod foo-class return-type foo-method args % \def\deftypemethod{% - \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} + \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} % % #1 is the class name, #2 the data type, #3 the method name, #4 the args. \def\deftypemethodheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup -} - -% @deftypeivar CLASS TYPE VARNAME -% -\def\deftypeivar{% - \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} -% -% #1 is the class name, #2 the data type, #3 the variable name. -\def\deftypeivarheader#1#2#3{% - \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index - \begingroup - \defname{#3}{\putwordInstanceVariableof\ \code{#1}}% - \defvarargs{#3}% - \endgroup + \deftypefnheaderx{Method on #1}{#2}#3 #4\relax } % @defmethod == @defop Method -% + \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} -% -% #1 is the class name, #2 the method name, #3 the args. -\def\defmethodheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{#2}{\putwordMethodon\ \code{#1}}% - \defunargs{#3}% - \endgroup + +\def\defmethodheader #1#2#3{% +\dosubind {fn}{\code{#2}}{on #1}% entry in function index +\begingroup\defname {#2}{Method on #1}% +\defunargs {#3}\endgroup % } % @defcv {Class Option} foo-class foo-flag @@ -4734,30 +4161,37 @@ \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} \def\defcvarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index -\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% +\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index +\begingroup\defname {#2}{\defcvtype{} of #1}% \defvarargs {#3}\endgroup % } -% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME -% +% @defivar == @defcv {Instance Variable} + \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} -% -\def\defivarheader#1#2#3{% - \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index - \begingroup - \defname{#2}{\putwordInstanceVariableof\ #1}% - \defvarargs{#3}% - \endgroup + +\def\defivarheader #1#2#3{% +\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index +\begingroup\defname {#2}{Instance Variable of #1}% +\defvarargs {#3}\endgroup % } -% @defvar +% These definitions are run if you use @defmethodx, etc., +% anywhere other than immediately after a @defmethod, etc. + +\def\defopx #1 {\errmessage{@defopx in invalid context}} +\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} +\def\defcvx #1 {\errmessage{@defcvx in invalid context}} +\def\defivarx #1 {\errmessage{@defivarx in invalid context}} + +% Now @defvar + % First, define the processing that is wanted for arguments of @defvar. % This is actually simple: just print them in roman. % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak} +\endgraf\penalty 10000\vskip -\parskip\penalty 10000} % @defvr Counter foo-count @@ -4771,7 +4205,7 @@ \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefvar}% +\begingroup\defname {#1}{Variable}% \defvarargs {#2}\endgroup % } @@ -4780,7 +4214,7 @@ \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefopt}% +\begingroup\defname {#1}{User Option}% \defvarargs {#2}\endgroup % } @@ -4792,9 +4226,9 @@ % is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% \dovarind#2 \relax% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}% +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak +\endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} @@ -4805,9 +4239,18 @@ \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak +\endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} +% This definition is run if you use @defvarx +% anywhere other than immediately after a @defvar or @defvarx. + +\def\defvrx #1 {\errmessage{@defvrx in invalid context}} +\def\defvarx #1 {\errmessage{@defvarx in invalid context}} +\def\defoptx #1 {\errmessage{@defoptx in invalid context}} +\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} +\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} + % Now define @deftp % Args are printed in bold, a slight difference from @defvar. @@ -4820,394 +4263,51 @@ \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} -% These definitions are used if you use @defunx (etc.) -% anywhere other than immediately after a @defun or @defunx. -% -\def\defcvx#1 {\errmessage{@defcvx in invalid context}} -\def\deffnx#1 {\errmessage{@deffnx in invalid context}} -\def\defivarx#1 {\errmessage{@defivarx in invalid context}} -\def\defmacx#1 {\errmessage{@defmacx in invalid context}} -\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\defopx#1 {\errmessage{@defopx in invalid context}} -\def\defspecx#1 {\errmessage{@defspecx in invalid context}} -\def\deftpx#1 {\errmessage{@deftpx in invalid context}} -\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} -\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} -\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} -\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} -\def\defunx#1 {\errmessage{@defunx in invalid context}} -\def\defvarx#1 {\errmessage{@defvarx in invalid context}} -\def\defvrx#1 {\errmessage{@defvrx in invalid context}} - - -\message{macros,} -% @macro. - -% To do this right we need a feature of e-TeX, \scantokens, -% which we arrange to emulate with a temporary file in ordinary TeX. -\ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scanmacro#1{% - \begingroup \newlinechar`\^^M - % Undo catcode changes of \startcontents and \doprintindex - \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ - % Append \endinput to make sure that TeX does not see the ending newline. - \toks0={#1\endinput}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{\the\toks0}% - \immediate\closeout\macscribble - \let\xeatspaces\eatspaces - \input \jobname.tmp - \endgroup -} -\else -\def\scanmacro#1{% -\begingroup \newlinechar`\^^M -% Undo catcode changes of \startcontents and \doprintindex -\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ -\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} -\fi - -\newcount\paramno % Count of parameters -\newtoks\macname % Macro name -\newif\ifrecursive % Is it recursive? -\def\macrolist{} % List of all defined macros in the form - % \do\macro1\do\macro2... - -% Utility routines. -% Thisdoes \let #1 = #2, except with \csnames. -\def\cslet#1#2{% -\expandafter\expandafter -\expandafter\let -\expandafter\expandafter -\csname#1\endcsname -\csname#2\endcsname} - -% Trim leading and trailing spaces off a string. -% Concepts from aro-bend problem 15 (see CTAN). -{\catcode`\@=11 -\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} -\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} -\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} -\def\unbrace#1{#1} -\unbrace{\gdef\trim@@@ #1 } #2@{#1} -} - -% Trim a single trailing ^^M off a string. -{\catcode`\^^M=12\catcode`\Q=3% -\gdef\eatcr #1{\eatcra #1Q^^MQ}% -\gdef\eatcra#1^^MQ{\eatcrb#1Q}% -\gdef\eatcrb#1Q#2Q{#1}% -} - -% Macro bodies are absorbed as an argument in a context where -% all characters are catcode 10, 11 or 12, except \ which is active -% (as in normal texinfo). It is necessary to change the definition of \. - -% It's necessary to have hard CRs when the macro is executed. This is -% done by making ^^M (\endlinechar) catcode 12 when reading the macro -% body, and then making it the \newlinechar in \scanmacro. - -\def\macrobodyctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\{=12 - \catcode`\}=12 - \catcode`\@=12 - \catcode`\^^M=12 - \usembodybackslash} - -\def\macroargctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\@=12 - \catcode`\\=12} - -% \mbodybackslash is the definition of \ in @macro bodies. -% It maps \foo\ => \csname macarg.foo\endcsname => #N -% where N is the macro parameter number. -% We define \csname macarg.\endcsname to be \realbackslash, so -% \\ in macro replacement text gets you a backslash. - -{\catcode`@=0 @catcode`@\=@active - @gdef@usembodybackslash{@let\=@mbodybackslash} - @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} -} -\expandafter\def\csname macarg.\endcsname{\realbackslash} - -\def\macro{\recursivefalse\parsearg\macroxxx} -\def\rmacro{\recursivetrue\parsearg\macroxxx} - -\def\macroxxx#1{% - \getargs{#1}% now \macname is the macname and \argl the arglist - \ifx\argl\empty % no arguments - \paramno=0% - \else - \expandafter\parsemargdef \argl;% - \fi - \if1\csname ismacro.\the\macname\endcsname - \message{Warning: redefining \the\macname}% - \else - \expandafter\ifx\csname \the\macname\endcsname \relax - \else \errmessage{The name \the\macname\space is reserved}\fi - \global\cslet{macsave.\the\macname}{\the\macname}% - \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% - % Add the macroname to \macrolist - \toks0 = \expandafter{\macrolist\do}% - \xdef\macrolist{\the\toks0 - \expandafter\noexpand\csname\the\macname\endcsname}% - \fi - \begingroup \macrobodyctxt - \ifrecursive \expandafter\parsermacbody - \else \expandafter\parsemacbody - \fi} - -\def\unmacro{\parsearg\unmacroxxx} -\def\unmacroxxx#1{% - \if1\csname ismacro.#1\endcsname - \global\cslet{#1}{macsave.#1}% - \global\expandafter\let \csname ismacro.#1\endcsname=0% - % Remove the macro name from \macrolist - \begingroup - \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% - \def\do##1{% - \def\tempb{##1}% - \ifx\tempa\tempb - % remove this - \else - \toks0 = \expandafter{\newmacrolist\do}% - \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% - \fi}% - \def\newmacrolist{}% - % Execute macro list to define \newmacrolist - \macrolist - \global\let\macrolist\newmacrolist - \endgroup - \else - \errmessage{Macro #1 not defined}% - \fi -} - -% This makes use of the obscure feature that if the last token of a -% <parameter list> is #, then the preceding argument is delimited by -% an opening brace, and that opening brace is not consumed. -\def\getargs#1{\getargsxxx#1{}} -\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} -\def\getmacname #1 #2\relax{\macname={#1}} -\def\getmacargs#1{\def\argl{#1}} - -% Parse the optional {params} list. Set up \paramno and \paramlist -% so \defmacro knows what to do. Define \macarg.blah for each blah -% in the params list, to be ##N where N is the position in that list. -% That gets used by \mbodybackslash (above). - -% We need to get `macro parameter char #' into several definitions. -% The technique used is stolen from LaTeX: let \hash be something -% unexpandable, insert that wherever you need a #, and then redefine -% it to # just before using the token list produced. -% -% The same technique is used to protect \eatspaces till just before -% the macro is used. - -\def\parsemargdef#1;{\paramno=0\def\paramlist{}% - \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} -\def\parsemargdefxxx#1,{% - \if#1;\let\next=\relax - \else \let\next=\parsemargdefxxx - \advance\paramno by 1% - \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname - {\xeatspaces{\hash\the\paramno}}% - \edef\paramlist{\paramlist\hash\the\paramno,}% - \fi\next} - -% These two commands read recursive and nonrecursive macro bodies. -% (They're different since rec and nonrec macros end differently.) - -\long\def\parsemacbody#1@end macro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\long\def\parsermacbody#1@end rmacro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% - -% This defines the macro itself. There are six cases: recursive and -% nonrecursive macros of zero, one, and many arguments. -% Much magic with \expandafter here. -% \xdef is used so that macro definitions will survive the file -% they're defined in; @include reads the file inside a group. -\def\defmacro{% - \let\hash=##% convert placeholders to macro parameter chars - \ifrecursive - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\scanmacro{\temp}}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup\noexpand\scanmacro{\temp}}% - \else % many - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{\egroup\noexpand\scanmacro{\temp}}% - \fi - \else - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \else % many - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \expandafter\noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \fi - \fi} - -\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} - -% \braceorline decides whether the next nonwhitespace character is a -% {. If so it reads up to the closing }, if not, it reads the whole -% line. Whatever was read is then fed to the next control sequence -% as an argument (by \parsebrace or \parsearg) -\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} -\def\braceorlinexxx{% - \ifx\nchar\bgroup\else - \expandafter\parsearg - \fi \next} - -% We mant to disable all macros during \shipout so that they are not -% expanded by \write. -\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% - \edef\next{\macrolist}\expandafter\endgroup\next} - - -% @alias. -% We need some trickery to remove the optional spaces around the equal -% sign. Just make them active and then expand them all to nothing. -\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} -\def\aliasxxx #1{\aliasyyy#1\relax} -\def\aliasyyy #1=#2\relax{\ignoreactivespaces -\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% - \expandafter\noexpand\csname#2\endcsname}% -\expandafter\endgroup\next} - - -\message{cross references,} -% @xref etc. - -\newwrite\auxfile - -\newif\ifhavexrefs % True if xref values are known. +% This definition is run if you use @deftpx, etc +% anywhere other than immediately after a @deftp, etc. + +\def\deftpx #1 {\errmessage{@deftpx in invalid context}} + + +\message{cross reference,} +% Define cross-reference macros +\newwrite \auxfile + +\newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. -% @inforef is relatively simple. +% @inforef is simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} -% @node's job is to define \lastnode. -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} -\let\nwnode=\node -\let\lastnode=\relax - -% The sectioning commands (@chapter, etc.) call these. -\def\donoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Ysectionnumberandtype}% - \global\let\lastnode=\relax - \fi -} -\def\unnumbnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% - \global\let\lastnode=\relax - \fi -} -\def\appendixnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Yappendixletterandtype}% - \global\let\lastnode=\relax - \fi -} - - -% @anchor{NAME} -- define xref target at arbitrary point. -% -\newcount\savesfregister -\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} -\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} -\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} - -% \setref{NAME}{SNT} defines a cross-reference point NAME, namely -% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have -% to set \indexdummies so commands such as @code in a section title -% aren't expanded. It would be nicer not to expand the titles in the -% first place, but there's so many layers that that is hard to do. -% -\def\setref#1#2{{% - \indexdummies - \pdfmkdest{#1}% - \dosetq{#1-title}{Ytitle}% - \dosetq{#1-pg}{Ypagenumber}% - \dosetq{#1-snt}{#2}% -}} - -% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is -% the node name, #2 the name of the Info cross-reference, #3 the printed -% node name, #4 the name of the Info file, #5 the name of the printed -% manual. All but the node name can be omitted. +% \setref{foo} defines a cross-reference point named foo. + +\def\setref#1{% +\dosetq{#1-title}{Ytitle}% +\dosetq{#1-pg}{Ypagenumber}% +\dosetq{#1-snt}{Ysectionnumberandtype}} + +\def\unnumbsetref#1{% +\dosetq{#1-title}{Ytitle}% +\dosetq{#1-pg}{Ypagenumber}% +\dosetq{#1-snt}{Ynothing}} + +\def\appendixsetref#1{% +\dosetq{#1-title}{Ytitle}% +\dosetq{#1-pg}{Ypagenumber}% +\dosetq{#1-snt}{Yappendixletterandtype}} + +% \xref, \pxref, and \ref generate cross-references to specified points. +% For \xrefX, #1 is the node name, #2 the name of the Info +% cross-reference, #3 the printed node name, #4 the name of the Info +% file, #5 the name of the printed manual. All but the node name can be +% omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup - \unsepspaces \def\printedmanual{\ignorespaces #5}% \def\printednodename{\ignorespaces #3}% \setbox1=\hbox{\printedmanual}% @@ -5220,7 +4320,7 @@ \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. - \ifdim \wd1 > 0pt + \ifdim \wd1>0pt% % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else @@ -5241,54 +4341,27 @@ % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. - \ifpdf - \leavevmode - \getfilename{#4}% - \ifnum\filenamelength>0 - \startlink attr{/Border [0 0 0]}% - goto file{\the\filename.pdf} name{#1@}% - \else - \startlink attr{/Border [0 0 0]}% - goto name{#1@}% - \fi - \linkcolor - \fi - % \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% + \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. - {\normalturnoffactive - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% - % [mynode], - [\printednodename],\space - % page 3 + {\turnoffactive \refx{#1-snt}{}}% + \space [\printednodename],\space \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi - \endlink \endgroup} % \dosetq is the interface for calls from other macros -% Use \normalturnoffactive so that punctuation chars such as underscore -% and backslash work in node names. (\turnoffactive doesn't do \.) -\def\dosetq#1#2{% - {\let\folio=0% - \normalturnoffactive - \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% - \iflinks - \next - \fi - }% -} +% Use \turnoffactive so that punctuation chars such as underscore +% work in node names. +\def\dosetq #1#2{{\let\folio=0 \turnoffactive +\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% +\next}} % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} @@ -5340,14 +4413,12 @@ \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright - \iflinks - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% - \fi + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \else @@ -5358,7 +4429,7 @@ } % This is the macro invoked by entries in the aux file. -% +% \def\xrdef#1{\begingroup % Reenable \ as an escape while reading the second argument. \catcode`\\ = 0 @@ -5421,7 +4492,8 @@ \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other - \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % `\+ does not work, so use 43. + \catcode43=\other % Make the characters 128-255 be printing characters {% \count 1=128 @@ -5510,8 +4582,6 @@ \xspaceskip\z@skip \parindent\defaultparindent % - \smallfonts \rm - % % Hang the footnote text off the number. \hang \textindent{\thisfootno}% @@ -5526,7 +4596,7 @@ \else\let\next\f@t\fi \next} \def\f@@t{\bgroup\aftergroup\@foot\let\next} \def\f@t#1{#1\@foot} -\def\@foot{\strut\par\egroup} +\def\@foot{\strut\egroup} }%end \catcode `\@=11 @@ -5585,25 +4655,23 @@ % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. -% +% % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else \closein 1 - % Do not bother showing banner with post-v2.7 epsf.tex (available in - % doc/epsf.tex until it shows up on ctan). - \def\epsfannounce{\toks0 = }% + \def\epsfannounce{\toks0 = }% do not bother showing banner \input epsf.tex \fi % -% We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get - it from ftp://tug.org/tex/epsf.tex.} + it from ftp://ftp.tug.org/tex/epsf.tex.} % +% Only complain once about lack of epsf.tex. \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else @@ -5621,79 +4689,42 @@ % #2 is (optional) width, #3 is (optional) height. % #4 is just the usual extra ignored arg for parsing this stuff. \def\imagexxx#1,#2,#3,#4\finish{% - \ifpdf - \centerline{\dopdfimage{#1}{#2}{#3}}% - \else - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \begingroup - \catcode`\^^M = 5 % in case we're inside an example - % If the image is by itself, center it. - \ifvmode - \nobreak\bigskip - % Usually we'll have text after the image which will insert - % \parskip glue, so insert it here too to equalize the space - % above and below. - \nobreak\vskip\parskip - \nobreak - \centerline{\epsfbox{#1.eps}}% - \bigbreak - \else - % In the middle of a paragraph, no extra space. - \epsfbox{#1.eps}% - \fi - \endgroup - \fi + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% } - -\message{localization,} -% and i18n. - -% @documentlanguage is usually given very early, just after -% @setfilename. If done too late, it may not override everything -% properly. Single argument is the language abbreviation. -% It would be nice if we could set up a hyphenation file here. -% -\def\documentlanguage{\parsearg\dodocumentlanguage} -\def\dodocumentlanguage#1{% - \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. - \openin 1 txi-#1.tex - \ifeof1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% - \let\temp = \relax - \else - \def\temp{\input txi-#1.tex }% - \fi - \temp - \endgroup +% End of control word definitions. + + +\message{and turning on texinfo input format.} + +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% } -\newhelp\nolanghelp{The given language definition file cannot be found or -is empty. Maybe you need to install it? In the current directory -should work if nowhere else does.} - - -% @documentencoding should change something in TeX eventually, most -% likely, but for now just recognize it. -\let\documentencoding = \comment - - -% Page size parameters. -% + +% Set some numeric style parameters, for 8.5 x 11 format. + +\hsize = 6in +\hoffset = .25in \newdimen\defaultparindent \defaultparindent = 15pt +\parindent = \defaultparindent +\parskip 3pt plus 2pt minus 1pt +\setleading{13.2pt} +\advance\topskip by 1.2cm \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. -\vbadness = 10000 - -% Don't be so finicky about underfull hboxes, either. -\hbadness = 2000 +\vbadness=10000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 @@ -5702,125 +4733,101 @@ % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on -% \hsize. We call this whenever the paper size is set. -% -\def\setemergencystretch{% - \ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% - \else - \emergencystretch = .15\hsize - \fi -} - -% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; -% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can -% set \parskip and call \setleading for \baselineskip. +% \hsize. This makes it come to about 9pt for the 8.5x11 format. % -\def\internalpagesizes#1#2#3#4#5#6{% - \voffset = #3\relax - \topskip = #6\relax - \splittopskip = \topskip - % - \vsize = #1\relax - \advance\vsize by \topskip - \outervsize = \vsize - \advance\outervsize by 2\topandbottommargin - \pageheight = \vsize - % - \hsize = #2\relax - \outerhsize = \hsize - \advance\outerhsize by 0.5in - \pagewidth = \hsize +\ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% +\else + \emergencystretch = \hsize + \divide\emergencystretch by 45 +\fi + +% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) +\def\smallbook{ + \global\chapheadingskip = 15pt plus 4pt minus 2pt + \global\secheadingskip = 12pt plus 3pt minus 2pt + \global\subsecheadingskip = 9pt plus 2pt minus 2pt % - \normaloffset = #4\relax - \bindingoffset = #5\relax - % - \parindent = \defaultparindent - \setemergencystretch -} - -% @letterpaper (the default). -\def\letterpaper{{\globaldefs = 1 - \parskip = 3pt plus 2pt minus 1pt - \setleading{13.2pt}% + \global\lispnarrowing = 0.3in + \setleading{12pt} + \advance\topskip by -1cm + \global\parskip 2pt plus 1pt + \global\hsize = 5in + \global\vsize=7.5in + \global\tolerance=700 + \global\hfuzz=1pt + \global\contentsrightmargin=0pt + \global\deftypemargin=0pt + \global\defbodyindent=.5cm % - % If page is nothing but text, make it come out even. - \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% -}} - -% Use @smallbook to reset parameters for 7x9.5 (or so) format. -\def\smallbook{{\globaldefs = 1 - \parskip = 2pt plus 1pt - \setleading{12pt}% - % - \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + \global\pagewidth=\hsize + \global\pageheight=\vsize % - \lispnarrowing = 0.3in - \tolerance = 700 - \hfuzz = 1pt - \contentsrightmargin = 0pt - \deftypemargin = 0pt - \defbodyindent = .5cm - % - \let\smalldisplay = \smalldisplayx - \let\smallexample = \smalllispx - \let\smallformat = \smallformatx - \let\smalllisp = \smalllispx -}} + \global\let\smalllisp=\smalllispx + \global\let\smallexample=\smalllispx + \global\def\Esmallexample{\Esmalllisp} +} % Use @afourpaper to print on European A4 paper. -\def\afourpaper{{\globaldefs = 1 - \setleading{12pt}% - \parskip = 3pt plus 2pt minus 1pt - % - \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% - % - \tolerance = 700 - \hfuzz = 1pt -}} +\def\afourpaper{ +\global\tolerance=700 +\global\hfuzz=1pt +\setleading{12pt} +\global\parskip 15pt plus 1pt + +\global\vsize= 53\baselineskip +\advance\vsize by \topskip +%\global\hsize= 5.85in % A4 wide 10pt +\global\hsize= 6.5in +\global\outerhsize=\hsize +\global\advance\outerhsize by 0.5in +\global\outervsize=\vsize +\global\advance\outervsize by 0.6in + +\global\pagewidth=\hsize +\global\pageheight=\vsize +} + +\bindingoffset=0pt +\normaloffset=\hoffset +\pagewidth=\hsize +\pageheight=\vsize + +% Allow control of the text dimensions. Parameters in order: textheight; +% textwidth; voffset; hoffset; binding offset; topskip. +% All require a dimension; +% header is additional; added length extends the bottom of the page. + +\def\changepagesizes#1#2#3#4#5#6{ + \global\vsize= #1 + \global\topskip= #6 + \advance\vsize by \topskip + \global\voffset= #3 + \global\hsize= #2 + \global\outerhsize=\hsize + \global\advance\outerhsize by 0.5in + \global\outervsize=\vsize + \global\advance\outervsize by 0.6in + \global\pagewidth=\hsize + \global\pageheight=\vsize + \global\normaloffset= #4 + \global\bindingoffset= #5} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. -\def\afourlatex{{\globaldefs = 1 - \setleading{13.6pt}% - % - \afourpaper - \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% - % - \globaldefs = 0 -}} +\def\afourlatex + {\global\tolerance=700 + \global\hfuzz=1pt + \setleading{12pt} + \global\parskip 15pt plus 1pt + \advance\baselineskip by 1.6pt + \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} + } % Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{% - \afourpaper - \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% - % - \globaldefs = 0 -} - -% @pagesizes TEXTHEIGHT[,TEXTWIDTH] -% Perhaps we should allow setting the margins, \topskip, \parskip, -% and/or leading, also. Or perhaps we should compute them somehow. -% -\def\pagesizes{\parsearg\pagesizesxxx} -\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} -\def\pagesizesyyy#1,#2,#3\finish{{% - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi - \globaldefs = 1 - % - \parskip = 3pt plus 2pt minus 1pt - \setleading{13.2pt}% - % - \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% -}} - -% Set default to letter. -% -\letterpaper - - -\message{and turning on texinfo input format.} +\def\afourwide{\afourpaper +\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other @@ -5831,7 +4838,6 @@ \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other -\catcode`\$=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} @@ -5840,7 +4846,6 @@ \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} -\def\normaldollar{$} % This macro is used to make a character print one way in ttfont % where it can probably just be output, and another way in other fonts, @@ -5851,13 +4856,7 @@ % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % -\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} - -% Same as above, but check for italic font. Actually this also catches -% non-italic slanted fonts since it is impossible to distinguish them from -% italic fonts. But since this is only used by $ and it uses \sl anyway -% this is not a problem. -\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} +\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). @@ -5865,10 +4864,10 @@ % use math or other variants that look better in normal text. \catcode`\"=\active -\def\activedoublequote{{\tt\char34}} +\def\activedoublequote{{\tt \char '042}} \let"=\activedoublequote \catcode`\~=\active -\def~{{\tt\char126}} +\def~{{\tt \char '176}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} @@ -5879,7 +4878,7 @@ \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active -\def|{{\tt\char124}} +\def|{{\tt \char '174}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} @@ -5888,8 +4887,6 @@ \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} -\catcode`\$=\active -\def${\ifusingit{{\sl\$}}\normaldollar} %\catcode 27=\active %\def^^[{$\diamondsuit$} @@ -5920,6 +4917,9 @@ % \normalbackslash outputs one backslash in fixed width font. \def\normalbackslash{{\tt\rawbackslashxx}} +% Say @foo, not \foo, in error messages. +\escapechar=`\@ + % \catcode 17=0 % Define control-q \catcode`\\=\active @@ -5933,8 +4933,7 @@ @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater -@let+=@normalplus -@let$=@normaldollar} +@let+=@normalplus} @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash @@ -5944,8 +4943,7 @@ @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater -@let+=@normalplus -@let$=@normaldollar} +@let+=@normalplus} % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @@ -5964,29 +4962,16 @@ % Also back turn on active characters that might appear in the input % file name, in case not using a pre-dumped format. % -@gdef@fixbackslash{% - @ifx\@eatinput @let\ = @normalbackslash @fi - @catcode`+=@active - @catcode`@_=@active -} - -% Say @foo, not \foo, in error messages. -@escapechar = `@@ - -% These look ok in all fonts, so just make them not special. -@catcode`@& = @other -@catcode`@# = @other -@catcode`@% = @other - -@c Set initial fonts. +@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active @catcode`@_=@active} + +%% These look ok in all fonts, so just make them not special. The @rm below +%% makes sure that the current font starts out as the newly loaded cmr10 +@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other + @textfonts @rm - @c Local variables: -@c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" -@c time-stamp-start: "def\\\\texinfoversion{" -@c time-stamp-format: "%:y-%02m-%02d.%02H" -@c time-stamp-end: "}" @c End: diff -r 12e008d41344 -r 697ef44129c6 man/texinfo.texi --- a/man/texinfo.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/texinfo.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,9 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: texinfo.texi,v 1.8.2.4 1999/12/05 19:02:24 martinb Exp $ +@c $Id: texinfo.texi,v 1.8.2.1 1999/03/04 15:48:24 steveb Exp $ @c %**start of header @c All text is ignored before the setfilename. -@setfilename ../info/texinfo.info +@setfilename ../info/texinfo @settitle Texinfo @value{edition} @c Edition number is now the same as the Texinfo distribution version number. @@ -7448,6 +7448,13 @@ @tex % Remove extra vskip; this is a kludge to counter the effect of display \vskip-3\baselineskip +{\ninett +\dots{} to make sure that you have the freedom to +distribute copies of free software (and charge for +this service if you wish), that you receive source +code or can get it if you want it, that you can +change the software or use pieces of it in new free +programs; and that you know you can do these things.} @end tex @end display @end ifclear @@ -14199,7 +14206,7 @@ (thousandths of an inch) remain on the current page. @xref{need, , @code{@@need}}.@refill -@item @@node @var{name}, @var{next}, @var{previous}, @var{up} +@item @@node @var{name, next, previous, up} Define the beginning of a new node in Info, and serve as a locator for references for @TeX{}. @xref{node, , @code{@@node}}.@refill diff -r 12e008d41344 -r 697ef44129c6 man/widget.texi --- a/man/widget.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/widget.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,7 @@ \input texinfo.tex @c %**start of header -@setfilename ../info/widget.info +@setfilename ../info/widget @settitle The Emacs Widget Library @iftex @afourpaper @@ -12,7 +12,7 @@ @ifinfo @dircategory XEmacs Editor @direntry -* Widgets: (widget). The Emacs Widget Library. +* Widgets: (widget). The Emacs Widget Library. @end direntry @end ifinfo @@ -298,69 +298,69 @@ (make-local-variable 'widget-example-repeat) (widget-insert "Here is some documentation.\n\nName: ") (widget-create 'editable-field - :size 13 - "My Name") + :size 13 + "My Name") (widget-create 'menu-choice - :tag "Choose" - :value "This" - :help-echo "Choose me, please!" - :notify (lambda (widget &rest ignore) - (message "%s is a good choice!" - (widget-value widget))) - '(item :tag "This option" :value "This") - '(choice-item "That option") - '(editable-field :menu-tag "No option" "Thus option")) + :tag "Choose" + :value "This" + :help-echo "Choose me, please!" + :notify (lambda (widget &rest ignore) + (message "%s is a good choice!" + (widget-value widget))) + '(item :tag "This option" :value "This") + '(choice-item "That option") + '(editable-field :menu-tag "No option" "Thus option")) (widget-insert "Address: ") (widget-create 'editable-field - "Some Place\nIn some City\nSome country.") + "Some Place\nIn some City\nSome country.") (widget-insert "\nSee also ") (widget-create 'link - :notify (lambda (&rest ignore) - (widget-value-set widget-example-repeat - '("En" "To" "Tre")) - (widget-setup)) - "other work") + :notify (lambda (&rest ignore) + (widget-value-set widget-example-repeat + '("En" "To" "Tre")) + (widget-setup)) + "other work") (widget-insert " for more information.\n\nNumbers: count to three below\n") (setq widget-example-repeat - (widget-create 'editable-list - :entry-format "%i %d %v" - :notify (lambda (widget &rest ignore) - (let ((old (widget-get widget - ':example-length)) - (new (length (widget-value widget)))) - (unless (eq old new) - (widget-put widget ':example-length new) - (message "You can count to %d." new)))) - :value '("One" "Eh, two?" "Five!") - '(editable-field :value "three"))) + (widget-create 'editable-list + :entry-format "%i %d %v" + :notify (lambda (widget &rest ignore) + (let ((old (widget-get widget + ':example-length)) + (new (length (widget-value widget)))) + (unless (eq old new) + (widget-put widget ':example-length new) + (message "You can count to %d." new)))) + :value '("One" "Eh, two?" "Five!") + '(editable-field :value "three"))) (widget-insert "\n\nSelect multiple:\n\n") (widget-create 'checkbox t) (widget-insert " This\n") (widget-create 'checkbox nil) (widget-insert " That\n") (widget-create 'checkbox - :notify (lambda (&rest ignore) (message "Tickle")) - t) + :notify (lambda (&rest ignore) (message "Tickle")) + t) (widget-insert " Thus\n\nSelect one:\n\n") (widget-create 'radio-button-choice - :value "One" - :notify (lambda (widget &rest ignore) - (message "You selected %s" - (widget-value widget))) - '(item "One") '(item "Another One.") '(item "A Final One.")) + :value "One" + :notify (lambda (widget &rest ignore) + (message "You selected %s" + (widget-value widget))) + '(item "One") '(item "Another One.") '(item "A Final One.")) (widget-insert "\n") (widget-create 'push-button - :notify (lambda (&rest ignore) - (if (= (length (widget-value widget-example-repeat)) - 3) - (message "Congratulation!") - (error "Three was the count!"))) - "Apply Form") + :notify (lambda (&rest ignore) + (if (= (length (widget-value widget-example-repeat)) + 3) + (message "Congratulation!") + (error "Three was the count!"))) + "Apply Form") (widget-insert " ") (widget-create 'push-button - :notify (lambda (&rest ignore) - (widget-example)) - "Reset Form") + :notify (lambda (&rest ignore) + (widget-example)) + "Reset Form") (widget-insert "\n") (use-local-map widget-keymap) (widget-setup)) @@ -462,11 +462,11 @@ @item %@{ @itemx %@} -The text inside will be displayed in the face specified by -@code{:sample-face}. +The text inside will be displayed with the face specified by +@code{:sample-face}. @item %v -This will be replaced with the buffer representation of the widget's +This will be replaces with the buffer representation of the widgets value. What this is depends on the widget type. @item %d @@ -560,8 +560,8 @@ @item :validate A function which takes a widget as an argument, and return nil if the -widget's current value is valid for the widget. Otherwise it should -return the widget containing the invalid data, and set that widget's +widgets current value is valid for the widget. Otherwise, it should +return the widget containing the invalid data, and set that widgets @code{:error} property to a string explaining the error. The following predefined function can be used: @@ -764,10 +764,10 @@ TYPE ::= (menu-choice [KEYWORD ARGUMENT]... TYPE ... ) @end example -The @var{type} argument represents each possible choice. The widget's -value will be that of the chosen @var{type} argument. This widget will -match any value matching at least one of the specified @var{type} -arguments. +The @var{type} arguments represents each possible choice. The widgets +value of will be the value of the chosen @var{type} argument. This +widget will match any value that matches at least one of the specified +@var{type} arguments. @table @code @item :void @@ -799,10 +799,10 @@ TYPE ::= (radio-button-choice [KEYWORD ARGUMENT]... TYPE ... ) @end example -The @var{type} argument represents each possible choice. The widget's -value will be that of the chosen @var{type} argument. This widget will -match any value matching at least one of the specified @var{type} -arguments. +The @var{type} arguments represents each possible choice. The widgets +value of will be the value of the chosen @var{type} argument. This +widget will match any value that matches at least one of the specified +@var{type} arguments. The following extra properties are recognized. @@ -889,8 +889,8 @@ TYPE ::= (toggle [KEYWORD ARGUMENT]...) @end example -The widget has two possible states, `on' and `off', which correspond to -a @code{t} or @code{nil} value respectively. +The widget has two possible states, `on' and `off', which corresponds to +a @code{t} or @code{nil} value. The following extra properties are recognized. @@ -930,10 +930,10 @@ TYPE ::= (checklist [KEYWORD ARGUMENT]... TYPE ... ) @end example -The @var{type} arguments represents each checklist item. The widget's -value will be a list containing the values of all ticked @var{type} -arguments. The checklist widget will match a list whose elements all -match at least one of the specified @var{type} arguments. +The @var{type} arguments represents each checklist item. The widgets +value of will be a list containing the value of each ticked @var{type} +argument. The checklist widget will match a list whose elements all +matches at least one of the specified @var{type} arguments. The following extra properties are recognized. @@ -951,11 +951,11 @@ @end table @item :greedy -Usually a checklist will only match if the items are in the exact +Usually, a checklist will only match if the items are in the exact sequence given in the specification. By setting @code{:greedy} to -non-nil, it will allow the items to appear in any sequence. However, if -you extract the values they will be in the sequence given in the -checklist. I.e. the original sequence is forgotten. +non-nil, it will allow the items to come in any sequence. However, if +you extract the value they will be in the sequence given in the +checklist. I.e. the original sequence is forgotten. @item button-args A list of keywords to pass to the checkboxes. Useful for setting @@ -1236,13 +1236,13 @@ @samp{(file t)} or @code{(file string string)}. This concept of inline is probably hard to understand. It was certainly -hard to implement so instead of confusing you more by trying to explain -it here, I'll just suggest you meditate over it for a while. +hard to implement so instead of confuse you more by trying to explain it +here, I'll just suggest you meditate over it for a while. @deffn Widget choice -Allows you to edit a sexp which may have one of a fixed set of types. -It is currently implemented with the @code{choice-menu} basic widget, -and has a similar syntax. +Allows you to edit a sexp which may have one of fixed set of types. It +is currently implemented with the @code{choice-menu} basic widget, and +has a similar syntax. @end deffn @deffn Widget set @@ -1326,9 +1326,9 @@ (widget-apply @var{widget} :activate) @end lisp -A widget is inactive if itself or any of its ancestors (found by +A widget is inactive if itself, or any of its ancestors (found by following the @code{:parent} link) have been deactivated. To make sure -a widget is really active, you must therefore activate both itself and +a widget is really active, you must therefore activate both itself, and all its ancestors. @lisp @@ -1338,12 +1338,12 @@ @end lisp You can check if a widget has been made inactive by examining the value -of the @code{:inactive} keyword. If this is non-nil, the widget itself -has been deactivated. This is different from using the @code{:active} -keyword, in that the latter tells you if the widget @strong{or} any of -its ancestors have been deactivated. Do not attempt to set the +of @code{:inactive} keyword. If this is non-nil, the widget itself has +been deactivated. This is different from using the @code{:active} +keyword, in that the later tell you if the widget @strong{or} any of its +ancestors have been deactivated. Do not attempt to set the @code{:inactive} keyword directly. Use the @code{:activate} -@code{:deactivate} keywords instead. +@code{:deactivated} keywords instead. @node Defining New Widgets, Widget Browser, Widget Properties, Top @@ -1351,9 +1351,9 @@ @section Defining New Widgets You can define specialized widgets with @code{define-widget}. It allows -you to create a shorthand for more complex widgets. This includes -specifying component widgets and new default values for the keyword -arguments. +you to create a shorthand for more complex widgets, including specifying +component widgets and default new default values for the keyword +arguments. @defun widget-define name class doc &rest args Define a new widget type named @var{name} from @code{class}. @@ -1363,7 +1363,7 @@ The third argument @var{DOC} is a documentation string for the widget. -After the new widget has been defined the following two calls will +After the new widget has been defined, the following two calls will create identical widgets: @itemize @bullet @@ -1380,8 +1380,8 @@ @end defun -Using @code{widget-define} just stores the definition of the widget type -in the @code{widget-type} property of @var{name}, which is what +Using @code{widget-define} does just store the definition of the widget +type in the @code{widget-type} property of @var{name}, which is what @code{widget-create} uses. If you just want to specify defaults for keywords with no complex @@ -1394,7 +1394,7 @@ Function to convert a widget type before creating a widget of that type. It takes a widget type as an argument, and returns the converted widget type. When a widget is created, this function is called for the -widget type and all the widget's parent types, most derived first. +widget type and all the widgets parent types, most derived first. The following predefined functions can be used here: @@ -1408,7 +1408,7 @@ @item :value-to-internal Function to convert the value to the internal format. The function -takes two arguments, a widget and an external value. It returns the +takes two arguments, a widget and an external value, and returns the internal value. The function is called on the present @code{:value} when the widget is created, and on any value set later with @code{widget-value-set}. @@ -1422,8 +1422,8 @@ @item :create Function to create a widget from scratch. The function takes one -argument, a widget type, and creates a widget of that type, inserts it -in the buffer, and returns a widget object. +argument, a widget type, and create a widget of that type, insert it in +the buffer, and return a widget object. @item :delete Function to delete a widget. The function takes one argument, a widget, @@ -1431,14 +1431,14 @@ @item :value-create Function to expand the @samp{%v} escape in the format string. It will -be called with the widget as its argument and should insert a -representation of the widget's value in the buffer. +be called with the widget as its argument. Should +insert a representation of the widgets value in the buffer. @item :value-delete -Should remove the representation of the widget's value from the buffer. +Should remove the representation of the widgets value from the buffer. It will be called with the widget as its argument. It doesn't have to remove the text, but it should release markers and delete nested widgets -if such have been used. +if such has been used. The following predefined function can be used here: @@ -1462,8 +1462,8 @@ You can set this to allow your widget to handle non-standard escapes. You should end up calling @code{widget-default-format-handler} to handle -unknown escape sequences. It will handle the @samp{%h} and any future -escape sequences as well as give an error for unknown escapes. +unknown escape sequences, which will handle the @samp{%h} and any future +escape sequences, as well as give an error for unknown escapes. @item :action Function to handle user initiated events. By default, @code{:notify} @@ -1481,9 +1481,9 @@ take four arguments, @var{widget}, @var{prompt}, @var{value}, and @var{unbound} and should return a value for widget entered by the user. @var{prompt} is the prompt to use. @var{value} is the default value to -use, unless @var{unbound} is non-nil. In this case there is no default +use, unless @var{unbound} is non-nil in which case there are no default value. The function should read the value using the method most natural -for this widget and does not have to check whether it matches. +for this widget, and does not have to check that it matches. @end table If you want to define a new widget from scratch, use the @code{default} diff -r 12e008d41344 -r 697ef44129c6 man/xemacs-faq.texi --- a/man/xemacs-faq.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs-faq.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -\input texinfo.tex @c -*- mode: texinfo; coding: iso-2022-8 -*- +\input texinfo.tex @c -*-texinfo-*- @c %**start of header @setfilename ../info/xemacs-faq.info @settitle Frequently asked questions about XEmacs @@ -7,22 +7,21 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/07/08 09:14:11 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 1999/05/13 12:26:40 $ @sp 1 -@author Tony Rossini <rossini@@biostat.washington.edu> -@author Ben Wing <ben@@xemacs.org> +@author Tony Rossini <arossini@@stat.sc.edu> +@author Ben Wing <wing@@666.com> @author Chuck Thompson <cthomp@@xemacs.org> @author Steve Baur <steve@@xemacs.org> @author Andreas Kaempf <andreas@@sccon.com> @author Christian Nyb@o{} <chr@@mediascience.no> -@author Sandra Wambold <wambold@@xemacs.org> @page @end titlepage @ifinfo @dircategory XEmacs Editor @direntry -* FAQ: (xemacs-faq). XEmacs FAQ. +* FAQ: (xemacs-faq). XEmacs FAQ. @end direntry @end ifinfo @@ -89,7 +88,6 @@ * Customization:: Customization and Options. * Subsystems:: Major Subsystems. * Miscellaneous:: The Miscellaneous Stuff. -* MS Windows:: XEmacs on Microsoft Windows. * Current Events:: What the Future Holds. @detailmenu @@ -139,6 +137,7 @@ * Q1.4.4:: May I see an example of a useful XEmacs Lisp function? * Q1.4.5:: And how do I bind it to a key? * Q1.4.6:: What's the difference between a macro and a function? +* Q1.4.7:: Why options saved with 19.13 don't work with 19.14 or later? Installation and Trouble Shooting @@ -154,6 +153,8 @@ * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. * Q2.0.12:: Why can't I strip XEmacs? +* Q2.0.13:: Can't link XEmacs on Solaris with Gcc. +* Q2.0.14:: Make on HP/UX 9 fails after linking temacs Trouble Shooting: * Q2.1.1:: XEmacs just crashed on me! @@ -173,13 +174,12 @@ * Q2.1.15:: How to debug an XEmacs problem with a debugger. * Q2.1.16:: XEmacs crashes in @code{strcat} on HP/UX 10. * Q2.1.17:: @samp{Marker does not point anywhere}. -* Q2.1.18:: [This question intentionally left blank] +* Q2.1.18:: 19.14 hangs on HP/UX 10.10. * Q2.1.19:: XEmacs does not follow the local timezone. * Q2.1.20:: @samp{Symbol's function definition is void: hkey-help-show.} -* Q2.1.21:: [This question intentionally left blank] +* Q2.1.21:: Every so often the XEmacs frame freezes. * Q2.1.22:: XEmacs seems to take a really long time to do some things. * Q2.1.23:: Movemail on Linux does not work for XEmacs 19.15 and later. -* Q2.1.24:: XEmacs won't start without network. (NEW) Customization and Options @@ -196,8 +196,8 @@ X Window System & Resources: * Q3.1.1:: Where is a list of X resources? * Q3.1.2:: How can I detect a color display? -* Q3.1.3:: [This question intentionally left blank] -* Q3.1.4:: [This question intentionally left blank] +* Q3.1.3:: @code{(set-screen-width)} worked in 19.6, but not in 19.13? +* Q3.1.4:: Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15? * Q3.1.5:: How can I get the icon to just say @samp{XEmacs}? * Q3.1.6:: How can I have the window title area display the full path? * Q3.1.7:: @samp{xemacs -name junk} doesn't work? @@ -305,7 +305,6 @@ Sparcworks, EOS, and WorkShop: * Q4.4.1:: What is SPARCworks, EOS, and WorkShop -* Q4.4.2:: How do I start the Sun Workshop support in XEmacs 21? Energize: * Q4.5.1:: What is/was Energize? @@ -316,7 +315,7 @@ Other Unbundled Packages: * Q4.7.1:: What is AUC TeX? Where do you get it? * Q4.7.2:: Are there any Emacs Lisp Spreadsheets? -* Q4.7.3:: [This question intentionally left blank] +* Q4.7.3:: Byte compiling AUC TeX on XEmacs 19.14 * Q4.7.4:: Problems installing AUC TeX * Q4.7.5:: Is there a reason for an Emacs package not to be included in XEmacs? * Q4.7.6:: Is there a MatLab mode? @@ -333,14 +332,14 @@ * Q5.0.8:: Why does edt emulation not work? * Q5.0.9:: How can I emulate VI and use it as my default mode? * Q5.0.10:: [This question intentionally left blank] -* Q5.0.11:: How do I turn on filladapt for all buffers? +* Q5.0.11:: Filladapt doesn't work in 19.15? * Q5.0.12:: How do I disable gnuserv from opening a new frame? * Q5.0.13:: How do I start gnuserv so that each subsequent XEmacs is a client? * Q5.0.14:: Strange things are happening in Shell Mode. * Q5.0.15:: Where do I get the latest CC Mode? * Q5.0.16:: I find auto-show-mode disconcerting. How do I turn it off? * Q5.0.17:: How can I get two instances of info? -* Q5.0.18:: [This question intentionally left blank] +* Q5.0.18:: I upgraded to XEmacs 19.14 and gnuserv stopped working * Q5.0.19:: Is there something better than LaTeX mode? * Q5.0.20:: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient? @@ -377,41 +376,12 @@ * Q5.3.11:: How do I add new Info directories? * Q5.3.12:: What do I need to change to make printing work? -XEmacs on MS Windows - -General Info: -* Q6.0.1:: What is the status of the XEmacs port to Windows? -* Q6.0.2:: What flavors of MS Windows are supported? -* Q6.0.3:: Are binary kits available? -* Q6.0.4:: Does XEmacs on MS Windows require an X server to run? - -Building XEmacs on MS Windows: -* Q6.1.1:: I decided to run with X. Where do I get an X server? -* Q6.1.2:: What compiler do I need to compile XEmacs? -* Q6.1.3:: How do I compile for the native port? -* Q6.1.4:: How do I compile for the X port? -* Q6.1.5:: How do I compile for Cygnus' Cygwin? -* Q6.1.6:: What do I need for Cygwin? - -Customization and User Interface: -* Q6.2.1:: How will the port cope with differences in the Windows user interface? -* Q6.2.2:: How do I change fonts in XEmacs on MS Windows? -* Q6.2.3:: Where do I put my @file{.emacs} file? - -Miscellaneous: -* Q6.3.1:: Will XEmacs rename all the win32-* symbols to w32-*? -* 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? -* Q7.0.2:: What is new in 20.3? -* Q7.0.3:: What is new in 20.4? -* Q7.0.4:: Procedural changes in XEmacs development. +What the Future Holds + +* Q6.0.1:: What is new in 20.2? +* Q6.0.2:: What is new in 20.3? +* Q6.0.3:: What is new in 20.4? +* Q6.0.4:: Procedural changes in XEmacs development. @end detailmenu @end menu @@ -425,24 +395,26 @@ wondering what to do next. It is also useful as a reference to available resources. -The previous maintainer of the FAQ was @email{rossini@@biostat.washington.edu, +The previous maintainer of the FAQ was @email{rossini@@stat.sc.edu, Anthony Rossini}, who started it, after getting tired of hearing JWZ complain about repeatedly having to answer questions. -@email{ben@@xemacs.org, Ben Wing} and @email{cthomp@@xemacs.org, Chuck +@email{ben@@666.com, Ben Wing} and @email{cthomp@@xemacs.org, Chuck Thompson}, the principal authors of XEmacs, then took over and Ben did a massive update reorganizing the whole thing. At which point Anthony took back over, but then had to give it up again. Some of the other contributors to this FAQ are listed later in this document. The previous version was converted to hypertext format, and edited by -@email{steve@@xemacs.org, Steven L. Baur}. It was converted back to -texinfo by @email{hniksic@@xemacs.org, Hrvoje Niksic}. The FAQ was then -maintained by @email{andreas@@sccon.com, Andreas Kaempf}, who passed it -on to ChristianNyb@o{}. +@email{steve@@altair.xemacs.org, Steven L. Baur}. It was converted back to +texinfo by @email{hniksic@@srce.hr, Hrvoje Niksic}. + +The FAQ was then maintained by @email{andreas@@sccon.com, Andreas +Kaempf}, who passed it on to @email{faq@@xemacs.org, Christian +Nyb@o{}}, the current FAQ maintainer. If you notice any errors or items which should be added or amended to -this FAQ please send email to @email{faq@@xemacs.org, Sandra -Wambold}. Include @samp{XEmacs FAQ} on the Subject: line. +this FAQ please send email to @email{faq@@xemacs.org, Christian +Nyb@o{}}. Include @samp{XEmacs FAQ} on the Subject: line. @menu Introduction: @@ -487,6 +459,7 @@ * Q1.4.4:: May I see an example of a useful XEmacs Lisp function? * Q1.4.5:: And how do I bind it to a key? * Q1.4.6:: What's the difference between a macro and a function? +* Q1.4.7:: Why options saved with 19.13 don't work with 19.14 or later? @end menu @node Q1.0.1, Q1.0.2, Introduction, Introduction @@ -503,8 +476,6 @@ @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. @@ -514,7 +485,7 @@ @node Q1.0.3, Q1.0.4, Q1.0.2, Introduction @unnumberedsubsec Q1.0.3: Where can I find it? -The canonical source and binaries can be found via anonymous FTP at: +The canonical source and binaries is found via anonymous FTP at: @example @uref{ftp://ftp.xemacs.org/pub/xemacs/} @@ -526,7 +497,7 @@ For a detailed description of the differences between GNU Emacs and XEmacs and a detailed history of XEmacs, check out the @example -@uref{http://www.xemacs.org/About/XEmacsVsGNUemacs.html, NEWS file} +@uref{http://www.xemacs.org/NEWS.html, NEWS file} @end example However, here is a list of some of the reasons why we think you might @@ -608,37 +579,44 @@ @node Q1.0.6, Q1.0.7, Q1.0.5, Introduction @unnumberedsubsec Q1.0.6: Where can I get help? -Probably the easiest way, if everything is installed, is to use Info, by -pressing @kbd{C-h i}, or selecting @code{Manuals->Info} from the -Help Menu. @kbd{M-x apropos} can be used to look for particular commands. - -For items not found in the manual, try reading this FAQ -@comment , examining the regular GNU Emacs FAQ (which can be -@comment found with the Emacs 19 distribution) as well as at -@comment @uref{http://www.eecs.nwu.edu/emacs/faq/} -and reading the Usenet group comp.emacs.xemacs. - -If you choose to post to a newsgroup, @strong{please use -comp.emacs.xemacs}. Please do not post XEmacs related questions to -gnu.emacs.help. +Probably the easiest way, if everything is installed, is to use info, by +pressing @kbd{C-h i}, or selecting @code{Emacs Info} from the Help Menu. + +Also, @kbd{M-x apropos} will look for commands for you. + +Try reading this FAQ, examining the regular GNU Emacs FAQ (which can be +found with the Emacs 19 distribution) as well as at +@uref{http://www.eecs.nwu.edu/emacs/faq/} and reading the Usenet group +comp.emacs.xemacs. + +If that does not help, try posting your question to comp.emacs.xemacs. +Please @strong{do not} post XEmacs related questions to gnu.emacs.help. If you cannot post or read Usenet news, there is a corresponding mailing list which is available. It can be subscribed to by sending a message -to @email{xemacs-request@@xemacs.org} with @samp{subscribe} in the -body of the message. Send to the list at @email{xemacs@@xemacs.org}. -list. To cancel a subscription, you @strong{must} use the -xemacs-request address. Send a message with a subject of -@samp{unsubscribe} to be removed. +with a subject of @samp{subscribe} to @email{xemacs-request@@xemacs.org} +for subscription information and @email{xemacs@@xemacs.org} to send messages +to the list. + +To cancel a subscription, you @strong{must} use the xemacs-request +address. Send a message with a subject of @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? -The archives can be found at @uref{http://www.xemacs.org/Lists/Archive} +The mailing list was archived in the directory +@example +@uref{ftp://ftp.xemacs.org/pub/mlists/}. +@end example + +However, this archive is out of date. The current mailing list server +supports an @code{archive} feature, which may be utilized. @node Q1.0.8, Q1.0.9, Q1.0.7, Introduction @unnumberedsubsec Q1.0.8: How do you pronounce XEmacs? -The most common pronounciation is @samp{Eks eemax}. +I pronounce it @samp{Eks eemax}. @node Q1.0.9, Q1.0.10, Q1.0.8, Introduction @unnumberedsubsec Q1.0.9: What does XEmacs look like? @@ -651,57 +629,51 @@ @node Q1.0.10, Q1.0.11, Q1.0.9, Introduction @unnumberedsubsec Q1.0.10: Is there a port of XEmacs to Microsoft ('95 or NT)? -Yes, @xref{MS Windows}. - -@comment Thanks to efforts of many people, coordinated by -@comment @email{davidh@@wr.com.au, David Hobley} and @email{marcpa@@cam.org, Marc -@comment Paquette}, beta versions of XEmacs now run on 32-bit Windows platforms -@comment (NT and 95). The current betas require having an X server to run -@comment XEmacs; however, a native NT/95 port is in alpha, thanks to -@comment @email{jhar@@tardis.ed.ac.uk, Jonathan Harris}. -@comment -@comment Although some features are still unimplemented, XEmacs 21.0 will support -@comment MS-Windows. -@comment -@comment The NT development is now coordinated by a mailing list at -@comment @email{xemacs-nt@@xemacs.org}. -@comment -@comment If you are willing to contribute or want to follow the progress, mail to -@comment @iftex -@comment @* -@comment @end iftex -@comment @email{xemacs-nt-request@@xemacs.org} to subscribe. -@comment -@comment Furthermore, Altrasoft is seeking corporate and government sponsors to -@comment help fund a fully native port of XEmacs to Windows 95 and NT using -@comment full-time, senior-level staff working under a professionally managed -@comment project structure. See @uref{http://www.altrasoft.com/, the Altrasoft -@comment web site} for more details -@comment or contact Altrasoft directly at 1-888-ALTSOFT. -@comment -@comment -@comment The closest existing port is @dfn{Win-Emacs}, which is based on Lucid -@comment Emacs 19.6. Available from @uref{http://www.pearlsoft.com/}. -@comment -@comment There's a port of GNU Emacs (not XEmacs) at -@comment @example -@comment @uref{http://www.cs.washington.edu/homes/voelker/ntemacs.html}. -@comment @end example +Thanks to efforts of many people, coordinated by +@email{davidh@@wr.com.au, David Hobley} and @email{marcpa@@cam.org, Marc +Paquette}, beta versions of XEmacs now run on 32-bit Windows platforms +(NT and 95). The current betas require having an X server to run +XEmacs; however, a native NT/95 port is in alpha, thanks to +@email{jhar@@tardis.ed.ac.uk, Jonathan Harris}. + +Although some features are still unimplemented, XEmacs 21.0 will support +MS-Windows. + +The NT development is now coordinated by a mailing list at +@email{xemacs-nt@@xemacs.org}. + +If you are willing to contribute or want to follow the progress, mail to +@iftex +@* +@end iftex +@email{xemacs-nt-request@@xemacs.org} to subscribe. + +Furthermore, Altrasoft is seeking corporate and government sponsors to +help fund a fully native port of XEmacs to Windows 95 and NT using +full-time, senior-level staff working under a professionally managed +project structure. See @uref{http://www.altrasoft.com/, the Altrasoft +web site} for more details +or contact Altrasoft directly at 1-888-ALTSOFT. + + +The closest existing port is @dfn{Win-Emacs}, which is based on Lucid +Emacs 19.6. Available from @uref{http://www.pearlsoft.com/}. + +There's a port of GNU Emacs (not XEmacs) at +@example +@uref{http://www.cs.washington.edu/homes/voelker/ntemacs.html}. +@end example @node Q1.0.11, Q1.0.12, Q1.0.10, Introduction @unnumberedsubsec Q1.0.11: Is there a port of XEmacs to the Macintosh? @c changed -@c There has been a port to the MachTen environment of XEmacs 19.13, but no -@c patches have been submitted to the maintainers to get this in the -@c mainstream distribution. -@c -@c For the MacOS, there is a port of -@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 @email{pjarvis@@ispchannel.com, Pitts Jarvis}. It's available -at @uref{http://my.ispchannel.com/~pjarvis/xemacs.html}. +There has been a port to the MachTen environment of XEmacs 19.13, but no +patches have been submitted to the maintainers to get this in the +mainstream distribution. + +For the MacOS, there is a port of +@uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}. @node Q1.0.12, Q1.0.13, Q1.0.11, Introduction @unnumberedsubsec Q1.0.12: Is there a port of XEmacs to NextStep? @@ -713,31 +685,44 @@ @node Q1.0.13, Q1.0.14, Q1.0.12, Introduction @unnumberedsubsec Q1.0.13: Is there a port of XEmacs to OS/2? -No, but Alexander Nikolaev <avn_1251@@mail.ru> is working on it. +No, and there is no news of anyone working on it. @node Q1.0.14, Q1.1.1, Q1.0.13, Introduction @unnumberedsubsec Q1.0.14: Where can I obtain a printed copy of the XEmacs users manual? -Pre-printed manuals are not available. If you are familiar with -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. - +Altrasoft Associates, a firm specializing in Emacs-related support and +development, will be maintaining the XEmacs user manual. The firm plans +to begin publishing printed copies of the manual soon. +@c This used to say `March 1997'! + +@example + Web: @uref{http://www.xemacs.com} + E-mail: @email{info@@xemacs.com} + Tel: +1 408 243 3300 +@end example @node Q1.1.1, Q1.1.2, Q1.0.14, Introduction @unnumberedsec 1.1: Policies @unnumberedsubsec Q1.1.1: What is the FAQ editorial policy? The FAQ is actively maintained and modified regularly. All links should -be up to date. Unfortunately, some of the information is out of date -- -a situation which the FAQ maintainer is working on. All submissions are -welcome, please e-mail submissions to @email{faq@@xemacs.org, XEmacs FAQ -maintainers}. +be up to date. + +Changes are displayed on a monthly basis. @dfn{Months}, for this +purpose are defined as the 5th of the month through the 5th of the +month. Preexisting questions that have been changed are marked as such. +Brand new questions are tagged. + +All submissions are welcome. E-mail submissions +to +@iftex +@* +@end iftex +@email{faq@@xemacs.org, Christian Nyb@o{}}. Please make sure that @samp{XEmacs FAQ} appears on the Subject: line. If you think you have a better way of answering a question, or think a -question should be included, we'd like to hear about it. Questions and +question should be included, I'd like to hear about it. Questions and 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 @@ -748,8 +733,8 @@ @node Q1.1.2, Q1.1.3, Q1.1.1, Introduction @unnumberedsubsec Q1.1.2: How do I become a Beta Tester? -Send an email message to @email{xemacs-beta-request@@xemacs.org} with -the line @samp{subscribe} in the body of the message. +Send an email message to @email{xemacs-beta-request@@xemacs.org} with a +subject line of @samp{subscribe}. Be prepared to get your hands dirty, as beta testers are expected to identify problems as best they can. @@ -757,7 +742,7 @@ @node Q1.1.3, Q1.2.1, Q1.1.2, Introduction @unnumberedsubsec Q1.1.3: How do I contribute to XEmacs itself? -Ben Wing @email{ben@@xemacs.org} writes: +Ben Wing @email{ben@@666.com} writes: @quotation BTW if you have a wish list of things that you want added, you have to @@ -800,14 +785,14 @@ @end ifhtml -@item @email{steve@@xemacs.org, Steve Baur} +@item @email{steve@@altair.xemacs.org, Steve Baur} @ifhtml <br><img src="steve.gif" alt="Portrait of Steve Baur"><br> @end ifhtml -@item @email{hniksic@@xemacs.org, Hrvoje Niksic} +@item @email{hniksic@@srce.hr, Hrvoje Niksic} @ifhtml <br><img src="hniksic.jpeg" alt="Portrait of Hrvoje Niksic"><br> @@ -826,7 +811,7 @@ Chuck was Mr. XEmacs from 19.11 through 19.14, and is responsible for XEmacs becoming a widely distributed program over the Internet. -@item @email{ben@@xemacs.org, Ben Wing} +@item @email{ben@@666.com, Ben Wing} @ifhtml <br><img src="wing.gif" alt="Portrait of Ben Wing"><br> @end ifhtml @@ -835,7 +820,7 @@ @itemize @bullet -@item @email{jwz@@jwz.org, Jamie Zawinski} +@item @email{jwz@@netscape.com, Jamie Zawinski} @ifhtml <br><img src="jwz.gif" alt="Portrait of Jamie Zawinski"><br> @end ifhtml @@ -859,7 +844,7 @@ @itemize @bullet @item @email{steve@@xemacs.org, SL Baur} -@item @email{hniksic@@xemacs.org, Hrvoje Niksic} +@item @email{hniksic@@srce.hr, Hrvoje Niksic} @item @email{Aki.Vehtari@@hut.fi, Aki Vehtari} @@ -874,20 +859,14 @@ @itemize @bullet @item @email{binge@@aloft.att.com, Curtis.N.Bingham} -@item @email{bruncott@@dormeur.inria.fr, Georges Brun-Cottan} - @item @email{rjc@@cogsci.ed.ac.uk, Richard Caley} @item @email{cognot@@ensg.u-nancy.fr, Richard Cognot} -@item @email{daku@@nortel.ca, Mark Daku} - @item @email{wgd@@martigny.ai.mit.edu, William G. Dubuque} @item @email{eeide@@cs.utah.edu, Eric Eide} -@item @email{af@@biomath.jussieu.fr, Alain Fauconnet} - @item @email{cflatter@@nrao.edu, Chris Flatters} @item @email{ginsparg@@adra.com, Evelyn Ginsparg} @@ -944,7 +923,7 @@ 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}, +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 @@ -955,28 +934,28 @@ 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 +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 +@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} +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 +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 +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. +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 @@ -986,12 +965,14 @@ @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. - -If you would like to help, you may want to join the -@email{xemacs-mule@@xemacs.org} mailing list. Especially needed are -people who speak/write languages other than English, who are willing to -use XEmacs/MULE regularly, and have some experience with Elisp. +The MULE support works OK but still needs a fair amount of work before +it's really solid. We could definitely use some help here, esp. people +who speak Japanese and will use XEmacs/MULE to work with Japanese and +have some experience with E-Lisp. + +As the fundings on Mule have stopped, the Mule part of XEmacs is currently +looking for a full-time maintainer. If you can provide help here, or +are willing to fund the work, please mail to @email{xemacs-beta@@xemacs.org}. @xref{Q1.1.2}. @@ -1009,9 +990,9 @@ 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 oeffnen +Emacs*XlwMenu.resourceLabels: True +Emacs*XlwMenu.file.labelString: Fichier +Emacs*XlwMenu.openInOtherWindow.labelString: In anderem Fenster offnen @end example The name of the resource is derived from the non-localized entry by @@ -1106,12 +1087,12 @@ (cond ((boundp 'MULE) ;; for original Mule ) - ((string-match "XEmacs" emacs-version) - ;; for XEmacs with Mule - ) - (t - ;; for next version of Emacs - )) + ((string-match "XEmacs" emacs-version) + ;; for XEmacs with Mule + ) + (t + ;; for next version of Emacs + )) ;; for old emacs variants ) @end lisp @@ -1180,23 +1161,23 @@ @node Q1.4.3, Q1.4.4, Q1.4.2, Introduction @unnumberedsubsec Q1.4.3: Any good tutorials around? -There's the XEmacs tutorial available from the Help Menu under -@samp{Basics->Tutorials}, or by typing @kbd{C-h t}. To check whether -it's available in a non-english language, type @kbd{C-u C-h t TAB}, type -the first letters of your preferred language, then type @key{RET}. - -@comment There's an Emacs Lisp tutorial at -@comment -@comment @example -@comment @uref{ftp://prep.ai.mit.edu/pub/gnu/emacs-lisp-intro-1.04.tar.gz}. -@comment @end example -@comment -@comment @email{erik@@petaxp.rug.ac.be, Erik Sundermann} has made a tutorial web -@comment page at -@comment @iftex -@comment @* -@comment @end iftex -@comment @uref{http://petaxp.rug.ac.be/~erik/xemacs/}. +There's the XEmacs tutorial available from the Help Menu, or by typing +@kbd{C-h t}. To check whether it's available in a non-english language, +type @kbd{C-u C-h t TAB}, type the first letters of your preferred +language, then type @key{RET}. + +There's an Emacs Lisp tutorial at + +@example +@uref{ftp://prep.ai.mit.edu/pub/gnu/emacs-lisp-intro-1.04.tar.gz}. +@end example + +@email{erik@@petaxp.rug.ac.be, Erik Sundermann} has made a tutorial web +page at +@iftex +@* +@end iftex +@uref{http://petaxp.rug.ac.be/~erik/xemacs/}. @node Q1.4.4, Q1.4.5, Q1.4.3, Introduction @unnumberedsubsec Q1.4.4: May I see an example of a useful XEmacs Lisp function? @@ -1244,7 +1225,7 @@ Or interactively, @kbd{M-x global-set-key} and follow the prompts. -@node Q1.4.6, , Q1.4.5, Introduction +@node Q1.4.6, Q1.4.7, Q1.4.5, Introduction @unnumberedsubsec Q1.4.6: What's the difference between a macro and a function? Quoting from the Lisp Reference (a.k.a @dfn{Lispref}) Manual: @@ -1264,6 +1245,36 @@ another matter, entirely. A keyboard macro is a key bound to several other keys. Refer to manual for details. +@node Q1.4.7, , Q1.4.6, Introduction +@unnumberedsubsec Q1.4.7: How come options saved with 19.13 don't work with 19.14 or later? + +There's a problem with options of the form: + +@lisp +(add-spec-list-to-specifier (face-property 'searchm-field 'font) + '((global (nil)))) +@end lisp + +saved by a 19.13 XEmacs that causes a 19.14 XEmacs grief. You must +delete these options. XEmacs 19.14 and later no longer write the +options directly to @file{.emacs} which should allow us to deal with +version incompatibilities better in the future. + +Options saved under XEmacs 19.13 are protected by code that specifically +requires a version 19 XEmacs. This won't be a problem unless you're +using XEmacs v20. You should consider changing the code to read: + +@lisp +(cond + ((and (string-match "XEmacs" emacs-version) + (boundp 'emacs-major-version) + (or (and (= emacs-major-version 19) + (>= emacs-minor-version 12)) + (>= emacs-major-version 20))) + ... + )) +@end lisp + @node Installation, Customization, Introduction, Top @unnumbered 2 Installation and Trouble Shooting @@ -1284,6 +1295,8 @@ * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. * Q2.0.12:: Why can't I strip XEmacs? +* Q2.0.13:: Can't link XEmacs on Solaris with Gcc. +* Q2.0.14:: Make on HP/UX 9 fails after linking temacs Trouble Shooting: * Q2.1.1:: XEmacs just crashed on me! @@ -1303,13 +1316,12 @@ * Q2.1.15:: How to debug an XEmacs problem with a debugger. * Q2.1.16:: XEmacs crashes in @code{strcat} on HP/UX 10. * Q2.1.17:: @samp{Marker does not point anywhere}. -* Q2.1.18:: [This question intentionally left blank] +* Q2.1.18:: 19.14 hangs on HP/UX 10.10. * Q2.1.19:: XEmacs does not follow the local timezone. * Q2.1.20:: @samp{Symbol's function definition is void: hkey-help-show.} -* Q2.1.21:: [This question intentionally left blank] +* Q2.1.21:: Every so often the XEmacs frame freezes. * Q2.1.22:: XEmacs seems to take a really long time to do some things. * Q2.1.23:: Movemail on Linux does not work for XEmacs 19.15 and later. -* Q2.1.24:: XEmacs won't start without network. (NEW) @end menu @node Q2.0.1, Q2.0.2, Installation, Installation @@ -1340,7 +1352,7 @@ Although this entry has been written for XEmacs 19.13, most of it still stands true. -@email{steve@@xemacs.org, Steve Baur} writes: +@email{steve@@altair.xemacs.org, Steve Baur} writes: @quotation The 45MB of space required by the installation directories can be @@ -1356,11 +1368,11 @@ 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 +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 @@ -1368,15 +1380,15 @@ 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 +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 @@ -1384,50 +1396,50 @@ 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 +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 These are all Emacs Lisp source code and bytecompiled object code. You @@ -1453,14 +1465,14 @@ certain packages can be removed from them if you do not use them. @example -1972 /usr/local/lib/xemacs-19.13/info +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 +20778 /usr/local/lib/xemacs-19.13 @end example The 20MB achieved is less than half of what the full distribution takes up, @@ -1556,7 +1568,7 @@ Terminal type `xterm' undefined (or can't access database?) @end example -@email{ben@@xemacs.org, Ben Wing} writes: +@email{ben@@666.com, Ben Wing} writes: @quotation Your ncurses configuration is messed up. Your /usr/lib/terminfo is a @@ -1568,7 +1580,7 @@ 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 +19.14 XEmacs has full color support on a color capable character terminal. @node Q2.0.6, Q2.0.7, Q2.0.5, Installation @@ -1610,11 +1622,11 @@ suffice. If you don't understand how to do this, don't do it. @item -Rebuild XEmacs yourself---any working ELF version of libc should be +Rebuild XEmacs yourself -- any working ELF version of libc should be O.K. @end enumerate -@email{hniksic@@xemacs.org, Hrvoje Niksic} writes: +@email{hniksic@@srce.hr, Hrvoje Niksic} writes: @quotation Why not use a Perl one-liner for No. 2? @@ -1735,7 +1747,7 @@ to link against the DNS resolver library code. @end quotation -@node Q2.0.12, Q2.1.1, Q2.0.11, Installation +@node Q2.0.12, Q2.0.13, Q2.0.11, Installation @unnumberedsubsec Q2.0.12: Why can't I strip XEmacs? @email{cognot@@fronsac.ensg.u-nancy.fr, Richard Cognot} writes: @@ -1790,7 +1802,46 @@ @end enumerate @end quotation -@node Q2.1.1, Q2.1.2, Q2.0.12, Installation +@node Q2.0.13, Q2.0.14, Q2.0.12, Installation +@unnumberedsubsec Q2.0.13: Problems linking with Gcc on Solaris + +There are known difficulties linking with Gnu ld on Solaris. A typical +error message might look like: + +@example +unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs: +fatal: relocation error: +symbol not found: main: referenced in ../dynodump/dynodump.so +@end example + +@email{martin@@xemacs.org, Martin Buchholz} writes: + +@quotation +You need to specify @samp{-fno-gnu-linker} as part of your flags to pass +to ld. Future releases of XEmacs will try to do this automatically. +@end quotation + +@node Q2.0.14, Q2.1.1, Q2.0.13, Installation +@unnumberedsubsec Q2.0.14: Make on HP/UX 9 fails after linking temacs + +Problem when building xemacs-19.16 on hpux 9: + +@email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes: + +@quotation +make on hpux fails after linking temacs with a message: + +@example +"make: don't know how to make .y." +@end example + +Solution: This is a problem with HP make revision 70.X. Either use GNU +make, or install PHCO_6552, which will bring make to revision +72.24.1.17. +@end quotation + + +@node Q2.1.1, Q2.1.2, Q2.0.14, Installation @unnumberedsec 2.1: Trouble Shooting @unnumberedsubsec Q2.1.1: Help! XEmacs just crashed on me! @@ -2007,10 +2058,10 @@ like: @example -*Foreground: Black ;everything will be of black on grey95, -*Background: Grey95 ;unless otherwise specified. -*cursorColor: Red3 ;red3 cursor with grey95 border. -*pointerColor: Red3 ;red3 pointer with grey95 border. +*Foreground: Black ;everything will be of black on grey95, +*Background: Grey95 ;unless otherwise specified. +*cursorColor: Red3 ;red3 cursor with grey95 border. +*pointerColor: Red3 ;red3 pointer with grey95 border. @end example @end quotation @@ -2159,7 +2210,7 @@ @node Q2.1.14, Q2.1.15, Q2.1.13, Installation @unnumberedsubsec Q2.1.14: @kbd{C-g} doesn't work for me. Is it broken? -@email{ben@@xemacs.org, Ben Wing} writes: +@email{ben@@666.com, Ben Wing} writes: @quotation @kbd{C-g} does work for most people in most circumstances. If it @@ -2254,55 +2305,17 @@ all you've got is a core dump, all is not lost. If you're using GDB, there are some macros in the file -@file{src/.gdbinit} in the XEmacs source distribution that should make -it easier for you to decode Lisp objects. This file is automatically -read by gdb if gdb is run in the directory where xemacs was built, and -contains these useful macros to inspect the state of xemacs: - -@table @code -@item pobj -Usage: pobj lisp_object @* -Print the internal C representation of a lisp object. - -@item xtype -Usage: xtype lisp_object @* -Print the Lisp type of a lisp object. - -@item lbt -Usage: lbt @* -Print the current Lisp stack trace. -Requires a running xemacs process. - -@item ldp -Usage: ldp lisp_object @* -Print a Lisp Object value using the Lisp printer. -Requires a running xemacs process. - -@item run-temacs -Usage: run-temacs @* -Run temacs interactively, like xemacs. -Use this with debugging tools (like purify) that cannot deal with dumping, -or when temacs builds successfully, but xemacs does not. - -@item dump-temacs -Usage: dump-temacs @* -Run the dumping part of the build procedure. -Use when debugging temacs, not xemacs! -Use this when temacs builds successfully, but xemacs does not. - -@item check-xemacs -Usage: check-xemacs @* -Run the test suite. Equivalent to 'make check'. - -@item check-temacs -Usage: check-temacs @* -Run the test suite on temacs. Equivalent to 'make check-temacs'. -Use this with debugging tools (like purify) that cannot deal with dumping, -or when temacs builds successfully, but xemacs does not. -@end table +@file{src/gdbinit} in the XEmacs source distribution that should make it +easier for you to decode Lisp objects. Copy this file to +@file{~/.gdbinit}, or @code{source} it from @file{~/.gdbinit}, and use +the macros defined therein. In particular, use the @code{pobj} macro to +print the internal C representation of a lisp object. This will work +with a core file or not-yet-run executable. The aliases @code{ldp} and +@code{lbt} are provided for conveniently calling @code{debug_print} and +@code{debug_backtrace}. If you are using Sun's @file{dbx} debugger, there is an equivalent file -@file{src/.dbxrc}, which defines the same commands for dbx. +@file{src/dbxrc} to copy to or source from @file{~/.dbxrc}. @item If you're using a debugger to get a C stack backtrace and you're seeing @@ -2353,21 +2366,22 @@ @item If you compile with the newer gcc variants gcc-2.8 or egcs, you will -also need gdb 4.17 or above. Earlier releases of gdb can't handle the -debug information generated by the newer compilers. +also need gdb 4.17. Earlier releases of gdb can't handle the debug +information generated by the newer compilers. @item -In versions of XEmacs before 21.2.27, @file{src/.gdbinit} was named -@file{src/gdbinit}. This had the disadvantage of not being sourced -automatically by gdb, so you had to set that up yourself. +The above information on using @file{src/gdbinit} works for XEmacs-21.0 +and above. For older versions of XEmacs, there are different +@file{gdbinit} files provided in the @file{src} directory. Use the one +corresponding to the configure options used when building XEmacs. @end itemize @node Q2.1.16, Q2.1.17, Q2.1.15, Installation @unnumberedsubsec Q2.1.16: XEmacs crashes in @code{strcat} on HP/UX 10 -From the problems database (through -the former address http://support.mayfield.hp.com/): +>From the problems database (through +@uref{http://support.mayfield.hp.com/}): @example Problem Report: 5003302299 @@ -2405,7 +2419,58 @@ @end enumerate @node Q2.1.18, Q2.1.19, Q2.1.17, Installation -@unnumberedsubsec Q2.1.18: removed +@unnumberedsubsec Q2.1.18: 19.14 hangs on HP/UX 10.10. + +@email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes: + +@quotation +For the record, compiling on hpux 10.10 leads to a hang in Gnus when +compiled with optimization on. + +I've just discovered that my hpux 10.01 binary was working less well +than expected. In fact, on a 10.10 system, @code{(while t)} was not +interrupted by @kbd{C-g}. I defined @code{BROKEN_SIGIO} and recompiled on +10.10, and... the hang is now gone. + +As far as configure goes, this will be a bit tricky: @code{BROKEN_SIGIO} +is needed on 10.10, but @strong{not} on 10.01: if I run my 10.01 binary +on a 10.01 machine, without @code{BROKEN_SIGIO} being defined, @kbd{C-g} +works as expected. +@end quotation + +@email{cognot@@ensg.u-nancy.fr, Richard Cognot} adds: + +@quotation +Apparently somebody has found the reason why there is this +@iftex +@* +@end iftex +@samp{poll: +interrupted...} message for each event. For some reason, libcurses +reimplements a @code{select()} system call, in a highly broken fashion. +The fix is to add a -lc to the link line @emph{before} the +-lxcurses. XEmacs will then use the right version of @code{select()}. +@end quotation + + +@email{af@@biomath.jussieu.fr, Alain Fauconnet} writes: + +@quotation +The @emph{real} solution is to @emph{not} link -lcurses in! I just +changed -lcurses to -ltermcap in the Makefile and it fixed: + +@enumerate +@item +The @samp{poll: interrupted system call} message. + +@item +A more serious problem I had discovered in the meantime, that is the +fact that subprocess handling was seriously broken: subprocesses +e.g. started by AUC TeX for TeX compilation of a buffer would +@emph{hang}. Actually they would wait forever for emacs to read the +socket which connects stdout... +@end enumerate +@end quotation @node Q2.1.19, Q2.1.20, Q2.1.18, Installation @unnumberedsubsec Q2.1.19: XEmacs does not follow the local timezone. @@ -2433,7 +2498,10 @@ where you load hyperbole and the problem should go away. @node Q2.1.21, Q2.1.22, Q2.1.20, Installation -@unnumberedsubsec Q2.1.21: [This question intentionally left blank] +@unnumberedsubsec Q2.1.21: Every so often the XEmacs frame freezes + +This problem has been fixed in 19.15, and was due to a not easily +reproducible race condition. @node Q2.1.22, Q2.1.23, Q2.1.21, Installation @unnumberedsubsec Q2.1.22: XEmacs seems to take a really long time to do some things @@ -2470,7 +2538,7 @@ some other strange cases. @end quotation -@node Q2.1.23, Q2.1.24, Q2.1.22, Installation +@node Q2.1.23, , Q2.1.22, Installation @unnumberedsubsec Q2.1.23: Movemail on Linux does not work for XEmacs 19.15 and later. Movemail used to work fine in 19.14 but has stopped working in 19.15 @@ -2489,19 +2557,6 @@ @end example @end quotation -@node Q2.1.24, , Q2.1.23, Installation -@unnumberedsubsec Q2.1.24: XEmacs won't start without network. (NEW) - -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 -@file{/etc/hosts} file. The file should contain an entry like: - -@example -127.0.0.1 localhost -@end example - -Add that line, and XEmacs will be happy. - @node Customization, Subsystems, Installation, Top @unnumbered 3 Customization and Options @@ -2523,8 +2578,8 @@ X Window System & Resources: * Q3.1.1:: Where is a list of X resources? * Q3.1.2:: How can I detect a color display? -* Q3.1.3:: [This question intentionally left blank] -* Q3.1.4:: [This question intentionally left blank] +* Q3.1.3:: @code{(set-screen-width)} worked in 19.6, but not in 19.13? +* Q3.1.4:: Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15? * Q3.1.5:: How can I get the icon to just say @samp{XEmacs}? * Q3.1.6:: How can I have the window title area display the full path? * Q3.1.7:: @samp{xemacs -name junk} doesn't work? @@ -2737,14 +2792,14 @@ (setq default-minibuffer-frame (make-frame '(minibuffer only - width 86 - height 1 - menubar-visible-p nil - default-toolbar-visible-p nil - name "minibuffer" - top -2 - left -2 - has-modeline-p nil))) + width 86 + height 1 + menubar-visible-p nil + default-toolbar-visible-p nil + name "minibuffer" + top -2 + left -2 + has-modeline-p nil))) (frame-notice-user-settings) @end lisp @@ -2796,10 +2851,38 @@ @end lisp @node Q3.1.3, Q3.1.4, Q3.1.2, Customization -@unnumberedsubsec Q3.1.3: [This question intentionally left blank] +@unnumberedsubsec Q3.1.3: @code{(set-screen-width)} worked in 19.6, but not in 19.13? + +In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and +@code{(set-screen-height @var{lines})} in my @file{.emacs} instead of +specifying @code{Emacs*EmacsScreen.geometry} in my +@iftex +@* +@end iftex +@file{.Xdefaults} but +this does not work in XEmacs 19.13. + +These two functions now take frame arguments: + +@lisp +(set-frame-width (selected-frame) @var{characters}) +(set-frame-height (selected-frame) @var{lines}) +@end lisp @node Q3.1.4, Q3.1.5, Q3.1.3, Customization -@unnumberedsubsec Q3.1.4: [This question intentionally left blank] +@unnumberedsubsec Q3.1.4: Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15? + +In XEmacs 19.11 I specified @code{Emacs*EmacsScreen.geometry} in +my @file{.emacs} but this does not work in XEmacs 19.15. + +We have switched from using the term @dfn{screen} to using the term +@dfn{frame}. + +The correct entry for your @file{.Xdefaults} is now: + +@example +Emacs*EmacsFrame.geometry +@end example @node Q3.1.5, Q3.1.6, Q3.1.4, Customization @unnumberedsubsec Q3.1.5: How can I get the icon to just say @samp{XEmacs}? @@ -2830,7 +2913,7 @@ @lisp (setq frame-title-format '("%S: " (buffer-file-name "%f" - (dired-directory dired-directory "%b")))) + (dired-directory dired-directory "%b")))) @end lisp That is, use the file name, or the dired-directory, or the buffer name. @@ -2893,7 +2976,7 @@ Using @samp{-unmapped} on the command line, and setting the @code{initiallyUnmapped} X Resource don't seem to help much either... -@email{ben@@xemacs.org, Ben Wing} writes: +@email{ben@@666.com, Ben Wing} writes: @quotation Ugh, this stuff is such an incredible mess that I've about given up @@ -2914,24 +2997,24 @@ (set-face-background 'default "bisque") ; frame background (set-face-foreground 'default "black") ; normal text (set-face-background 'zmacs-region "red") ; When selecting w/ - ; mouse + ; mouse (set-face-foreground 'zmacs-region "yellow") (set-face-font 'default "*courier-bold-r*120-100-100*") (set-face-background 'highlight "blue") ; Ie when selecting - ; buffers + ; buffers (set-face-foreground 'highlight "yellow") (set-face-background 'modeline "blue") ; Line at bottom - ; of buffer + ; of buffer (set-face-foreground 'modeline "white") (set-face-font 'modeline "*bold-r-normal*140-100-100*") (set-face-background 'isearch "yellow") ; When highlighting - ; while searching + ; while searching (set-face-foreground 'isearch "red") (setq x-pointer-foreground-color "black") ; Adds to bg color, - ; so keep black + ; so keep black (setq x-pointer-background-color "blue") ; This is color - ; you really - ; want ptr/crsr + ; you really + ; want ptr/crsr @end lisp @node Q3.2.2, Q3.2.3, Q3.2.1, Customization @@ -3036,8 +3119,8 @@ @end quotation +@unnumberedsec 3.3: The Modeline @node Q3.3.1, Q3.3.2, Q3.2.6, Customization -@unnumberedsec 3.3: The Modeline @unnumberedsubsec Q3.3.1: How can I make the modeline go away? @lisp @@ -3107,7 +3190,7 @@ @lisp (add-hook 'TeX-mode-hook - '(lambda () (setq fume-display-in-modeline-p nil))) + '(lambda () (setq fume-display-in-modeline-p nil))) @end lisp @email{dhughes@@origin-at.co.uk, David Hughes} writes: @@ -3222,8 +3305,8 @@ @lisp (global-set-key [(control ?.)] (lambda () (interactive) (scroll-up 1))) -(global-set-key [(control ?;)] - (lambda () (interactive) (scroll-up -1))) +(global-set-key [(control ? ;)] + (lambda () (interactive) (scroll-up -1))) @end lisp This is fine if you only need a few functions within the lambda body. @@ -3257,7 +3340,7 @@ (scroll-down 1)) (global-set-key [(control ?.)] 'scroll-up-one-line) ; C-. -(global-set-key [(control ?;)] 'scroll-down-one-line) ; C-; +(global-set-key [(control ? ;)] 'scroll-down-one-line) ; C-; @end lisp The key point is that you can only bind simple functions to keys; you @@ -3374,7 +3457,7 @@ @c hey, show some respect, willya -- there's xkeycaps, isn't there? -- @c chr ;) @example - xmodmap -e 'keycode 0xff20 = Multi_key' + xmodmap -e 'keycode 0xff20 = Multi_key' @end example You will need to pick an appropriate keycode. Use xev to find out the @@ -3385,9 +3468,9 @@ Once you have Multi_key defined, you can use e.g. @example - Multi a ' => á - Multi e " => ë - Multi c , => ç + Multi a ' => á + Multi e " => ë + Multi c , => ç @end example etc. @@ -3395,9 +3478,9 @@ Also, recent versions of XFree86 define various AltGr-<key> combinations as dead keys, i.e. @example - AltGr [ => dead_diaeresis - AltGr ] => dead_tilde - AltGr ; => dead_acute + AltGr [ => dead_diaeresis + AltGr ] => dead_tilde + AltGr ; => dead_acute @end example etc. @@ -3457,7 +3540,7 @@ character typed come out in upper case. This will affect all the other modifier keys like Control and Meta as well. -@email{ben@@xemacs.org, Ben Wing} writes: +@email{ben@@666.com, Ben Wing} writes: @quotation One thing about the sticky modifiers is that if you move the mouse out @@ -3517,7 +3600,7 @@ You can use a color to make it stand out better: @example -Emacs*cursorColor: Red +Emacs*cursorColor: Red @end example @node Q3.6.2, Q3.6.3, Q3.6.1, Customization @@ -3891,19 +3974,13 @@ and you press a key to replace the selected region by the key you typed. Usually backspace kills the selected region. -To get this behavior, add the following lines to your @file{.emacs}: +To get this behavior, add the following line to your @file{.emacs}: @lisp -(cond - ((fboundp 'turn-on-pending-delete) - (turn-on-pending-delete)) - ((fboundp 'pending-delete-on) - (pending-delete-on t))) +(turn-on-pending-delete) @end lisp -Note that this will work with both Backspace and Delete. This code is a -tad more complicated than it has to be for XEmacs in order to make it -more portable. +Note that this will work with both Backspace and Delete. @node Q3.10.3, Q3.10.4, Q3.10.2, Customization @unnumberedsubsec Q3.10.3: Can I turn off the highlight during isearch? @@ -3950,18 +4027,18 @@ (interactive "_P") (let ((zmacs-region-stays t)) (if (interactive-p) - (condition-case nil - ad-do-it - (end-of-buffer (goto-char (point-max)))) + (condition-case nil + ad-do-it + (end-of-buffer (goto-char (point-max)))) ad-do-it))) (defadvice scroll-down (around scroll-down freeze) (interactive "_P") (let ((zmacs-region-stays t)) (if (interactive-p) - (condition-case nil - ad-do-it - (beginning-of-buffer (goto-char (point-min)))) + (condition-case nil + ad-do-it + (beginning-of-buffer (goto-char (point-min)))) ad-do-it))) @end lisp @@ -4009,7 +4086,6 @@ Sparcworks, EOS, and WorkShop: * Q4.4.1:: What is SPARCworks, EOS, and WorkShop -* Q4.4.2:: How do I start the Sun Workshop support in XEmacs 21? Energize: * Q4.5.1:: What is/was Energize? @@ -4020,7 +4096,7 @@ Other Unbundled Packages: * Q4.7.1:: What is AUC TeX? Where do you get it? * Q4.7.2:: Are there any Emacs Lisp Spreadsheets? -* Q4.7.3:: [This question intentionally left blank] +* Q4.7.3:: Byte compiling AUC TeX on XEmacs 19.14 * Q4.7.4:: Problems installing AUC TeX * Q4.7.5:: Is there a reason for an Emacs package not to be included in XEmacs? * Q4.7.6:: Is there a MatLab mode? @@ -4089,7 +4165,7 @@ @lisp (setq vm-reply-ignored-addresses '("wing@@nuspl@@nvwls.cc.purdue.edu,netcom[0-9]*.netcom.com" - "wing@@netcom.com" "wing@@xemacs.org")) + "wing@@netcom.com" "wing@@666.com")) @end lisp Note that each string is a regular expression. @@ -4196,7 +4272,7 @@ @quotation @lisp - ; Don't use multiple frames + ; Don't use multiple frames (setq vm-frame-per-composition nil) (setq vm-frame-per-folder nil) (setq vm-frame-per-edit nil) @@ -4211,7 +4287,7 @@ @lisp (add-hook 'mh-show-mode-hook '(lambda () - (smiley-region (point-min) + (smiley-region (point-min) (point-max)))) @end lisp @@ -4393,11 +4469,12 @@ tm is available from following anonymous ftp sites: @itemize @bullet -@comment @item @uref{ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime/} (Japan). -@comment @item @uref{ftp://ftp.nis.co.jp/pub/gnu/emacs-lisp/tm/} (Japan). -@comment @c The host above is unknown. -@comment @item @uref{ftp://ftp.nisiq.net/pub/gnu/emacs-lisp/tm/} (US). -@comment @item @uref{ftp://ftp.miranova.com/pub/gnus/jaist.ac.jp/} (US). +@item @uref{ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime/} (Japan). +@item @uref{ftp://ftp.nis.co.jp/pub/gnu/emacs-lisp/tm/} (Japan). +@c The host above is unknown. + +@item @uref{ftp://ftp.nisiq.net/pub/gnu/emacs-lisp/tm/} (US). +@item @uref{ftp://ftp.miranova.com/pub/gnus/jaist.ac.jp/} (US). @item @uref{ftp://ftp.unicamp.br/pub/mail/mime/tm/} (Brasil). @item @uref{ftp://ftp.th-darmstadt.de/pub/editors/GNU-Emacs/lisp/mime/} (Germany). @item @uref{ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib/} (Germany). @@ -4410,7 +4487,7 @@ @node Q4.3.3, Q4.3.4, Q4.3.2, Subsystems @unnumberedsubsec Q4.3.3: Why isn't this @code{movemail} program working? -Ben Wing @email{ben@@xemacs.org} writes: +Ben Wing @email{ben@@666.com} writes: @quotation It wasn't chown'ed/chmod'd correctly. @@ -4419,14 +4496,14 @@ @node Q4.3.4, Q4.3.5, Q4.3.3, Subsystems @unnumberedsubsec Q4.3.4: Movemail is also distributed by Netscape? Can that cause problems? -@email{steve@@xemacs.org, Steve Baur} writes: +@email{steve@@altair.xemacs.org, Steve Baur} writes: @quotation Yes. Always use the movemail installed with your XEmacs. Failure to do so can result in lost mail. @end quotation -Please refer to @email{jwz@@jwz.org, Jamie Zawinski's} notes at +Please refer to @email{jwz@@netscape.com, Jamie Zawinski's} notes at @iftex @* @end iftex @@ -4462,7 +4539,7 @@ @end iftex @uref{ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/}. -@node Q4.4.1, Q4.4.2, Q4.3.5, Subsystems +@node Q4.4.1, Q4.5.1, Q4.3.5, Subsystems @unnumberedsec 4.4: Sparcworks, EOS, and WorkShop @unnumberedsubsec Q4.4.1: What is SPARCworks, EOS, and WorkShop? @@ -4503,48 +4580,10 @@ @iftex @* @end iftex -@uref{http://www.sun.com/software/Products/Developer-products}. +@uref{http://www.sun.com/software/Products/Developer-products/programs.html}. @end quotation -@node Q4.4.2, Q4.5.1, Q4.4.1, Subsystems -@unnumberedsubsec Q4.4.2: How do I start the Sun Workshop support in XEmacs 21? - -Add the switch ---with-workshop to the configure command when building -XEmacs and put the following in one of your startup files -(e.g. site-start.el or .emacs): - -@lisp -(when (featurep 'tooltalk) - (load "tooltalk-macros") - (load "tooltalk-util") - (load "tooltalk-init")) -(when (featurep 'sparcworks) - (load "sunpro-init") - (load "ring") - (load "comint") - (load "annotations") - (sunpro-startup)) -@end lisp - -If you are not using the latest Workshop (5.0) you have to apply the -following patch: - -@format ---- /opt/SUNWspro/lib/eserve.el.ORIG Fri May 14 15:23:26 1999 -+++ /opt/SUNWspro/lib/eserve.el Fri May 14 15:24:54 1999 -@@@@ -42,7 +42,7 @@@@ - (defvar running-xemacs nil "t if we're running XEmacs") - (defvar running-emacs nil "t if we're running GNU Emacs 19") - --(if (string-match "^\\(19\\|20\\)\..*\\(XEmacs\\|Lucid\\)" emacs-version) -+(if (string-match "\\(XEmacs\\|Lucid\\)" emacs-version) - (setq running-xemacs t) - (setq running-emacs t)) -@end format - - - -@node Q4.5.1, Q4.6.1, Q4.4.2, Subsystems +@node Q4.5.1, Q4.6.1, Q4.4.1, Subsystems @unnumberedsec 4.5: Energize @unnumberedsubsec Q4.5.1: What is/was Energize? @@ -4757,7 +4796,17 @@ @uref{ftp://cs.nyu.edu/pub/local/fox/dismal/}. @node Q4.7.3, Q4.7.4, Q4.7.2, Subsystems -@unnumberedsubsec Q4.7.3: [This question intentionally left blank] +@unnumberedsubsec Q4.7.3: Byte compiling AUC TeX on XEmacs 19.14. + +@email{bruncott@@dormeur.inria.fr, Georges Brun-Cottan} writes: + +@quotation +When byte compiling auctex-9.4g, you must use the command: + +@example +xemacs -batch -l lpath.el +@end example +@end quotation @node Q4.7.4, Q4.7.5, Q4.7.3, Subsystems @unnumberedsubsec Q4.7.4: Problems installing AUC TeX. @@ -4813,7 +4862,7 @@ Each package bundled with XEmacs means more work for the maintainers, whether they want it or not. If you are ready to take over the maintenance responsibilities for the package you port, be sure to say -so---we will more likely include it. +so -- we will more likely include it. @item The package simply hasn't been noted by the XEmacs development. If @@ -4829,12 +4878,23 @@ @node Q4.7.6, , Q4.7.5, Subsystems @unnumberedsubsec Q4.7.5: Is there a MatLab mode? - -Yes, a matlab mode and other items are available at the -@uref{ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons, -MathWorks' emacs_add_ons ftp directory}. - -@node Miscellaneous, MS Windows, Subsystems, Top +@c New +Is there any way I can get syntax highlighting for MatLab .m files? +Can I "teach" emacs what words are MatLab commands, comments, etc. ? + +@email{elsner@@mathematik.tu-chemnitz.de, Ulrich Elsner} writes: +@quotation +One way to do this (and much more) is by using the +@iftex +@* +@end iftex +@uref{ftp://ftp.mathworks.com/pub/contrib/v5/tools/matlab.el, matlab mode}. + +Instructions on how to install this mode are included in this file. +@end quotation + + +@node Miscellaneous, Current Events, Subsystems, Top @unnumbered 5 The Miscellaneous Stuff This is part 5 of the XEmacs Frequently Asked Questions list. This @@ -4853,14 +4913,14 @@ * Q5.0.8:: Why does edt emulation not work? * Q5.0.9:: How can I emulate VI and use it as my default mode? * Q5.0.10:: [This question intentionally left blank] -* Q5.0.11:: How do I turn on filladapt for all buffers? +* Q5.0.11:: Filladapt doesn't work in 19.15? * Q5.0.12:: How do I disable gnuserv from opening a new frame? * Q5.0.13:: How do I start gnuserv so that each subsequent XEmacs is a client? * Q5.0.14:: Strange things are happening in Shell Mode. * Q5.0.15:: Where do I get the latest CC Mode? * Q5.0.16:: I find auto-show-mode disconcerting. How do I turn it off? * Q5.0.17:: How can I get two instances of info? -* Q5.0.18:: [This question intentionally left blank] +* Q5.0.18:: I upgraded to XEmacs 19.14 and gnuserv stopped working * Q5.0.19:: Is there something better than LaTeX mode? * Q5.0.20:: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient? @@ -4907,8 +4967,8 @@ automatically start it by adding lines like: @lisp -(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) -(add-hook 'dired-mode-hook 'turn-on-font-lock) +(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) +(add-hook 'dired-mode-hook 'turn-on-font-lock) @end lisp to your @file{.emacs}. See the file @file{etc/sample.emacs} for more @@ -5052,10 +5112,6 @@ rename-uniquely} to rename the @code{*shell*} buffer instead of @kbd{M-x rename-buffer}. -Alternately, you can set the variable @code{shell-multiple-shells}. -If the value of this variable is non-nil, each time shell mode is invoked, -a new shell is made - @node Q5.0.7, Q5.0.8, Q5.0.6, Miscellaneous @unnumberedsubsec Q5.0.7: Telnet from shell filters too much @@ -5109,11 +5165,11 @@ Obsolete question, left blank to avoid renumbering @node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous -@unnumberedsubsec Q5.0.11: How do I turn on filladapt for all buffers? - -Filladapt is a minor mode and minor modes are traditionally off by -default. The following added to your @file{.emacs} will turn it on for -all buffers: +@unnumberedsubsec Q5.0.11: Filladapt doesn't work in 19.15 + +Filladapt 2.x is included in 19.15. In it filladapt is now a minor +mode and minor modes are traditionally off by default. The following +added to your @file{.emacs} will turn it on for all buffers: @lisp (setq-default filladapt-mode t) @@ -5199,7 +5255,7 @@ @email{bwarsaw@@cnri.reston.va.us, Barry A. Warsaw} writes: @quotation -This can be had from @uref{http://www.python.org/emacs/}. +This can be had from @uref{http://www.python.org/ftp/emacs/}. @end quotation @node Q5.0.16, Q5.0.17, Q5.0.15, Miscellaneous @@ -5221,7 +5277,19 @@ You can't. The @code{info} package does not provide for multiple info buffers. @node Q5.0.18, Q5.0.19, Q5.0.17, Miscellaneous -@unnumberedsubsec Q5.0.18: [This question intentionally left blank] +@unnumberedsubsec Q5.0.18: I upgraded to XEmacs 19.14 and gnuserv stopped working. + +@email{daku@@nortel.ca, Mark Daku} writes: + +@quotation +It turns out I was using an older version of gnuserv. The installation +didn't put the binary into the public bin directory. It put it in +@iftex +@* +@end iftex +@file{lib/xemacs-19.14/hppa1.1-hp-hpux9.05/gnuserv}. Shouldn't it have +been put in @file{bin/hppa1.1-hp-hpux9.0}? +@end quotation @node Q5.0.19, Q5.0.20, Q5.0.18, Miscellaneous @unnumberedsubsec Q5.0.19: Is there something better than LaTeX mode? @@ -5432,7 +5500,7 @@ @lisp (let ((case-fold-search nil)) - ... ; code with searches that must be case-sensitive + ... ; code with searches that must be case-sensitive ...) @end lisp @@ -5497,7 +5565,7 @@ @lisp (defun my-function (whatever) - (let (a) ; default initialization is to nil + (let (a) ; default initialization is to nil ... build a large list ... ... and exit, unbinding `a' in the process ...) @end lisp @@ -5510,11 +5578,11 @@ The reason for the warning is the following: @lisp -(defun flurgoze nil) ; ok, global internal variable +(defun flurgoze nil) ; ok, global internal variable ... -(setq flurghoze t) ; ops! a typo, but semantically correct. - ; however, the byte-compiler warns. +(setq flurghoze t) ; ops! a typo, but semantically correct. + ; however, the byte-compiler warns. While compiling toplevel forms: ** assignment to free variable flurghoze @@ -5636,7 +5704,7 @@ an easy way to find out where it spends time? @c New -z@email{hniksic@@xemacs.org, Hrvoje Niksic} writes: +z@email{hniksic@@srce.hr, Hrvoje Niksic} writes: @quotation Under XEmacs 20.4 and later you can use @kbd{M-x profile-key-sequence}, press a key (say @key{RET} in the Gnus Group buffer), and get the results using @@ -5654,7 +5722,7 @@ (setq sound-alist nil) @end lisp -That will make your XEmacs totally silent---even the default ding sound +That will make your XEmacs totally silent -- even the default ding sound (TTY beep on TTY-s) will be gone. Starting with XEmacs-20.2 you can also change these with Customize. @@ -5751,7 +5819,7 @@ like: @lisp -(add-hook 'postscript-mode-hook 'turn-on-font-lock) +(add-hook 'postscript-mode-hook 'turn-on-font-lock) @end lisp Take it out, restart XEmacs, and it won't try to fontify your postscript @@ -5968,9 +6036,8 @@ It might also be helpful to use @email{stig@@hackvan.com, Stig's} script (included in the compface distribution at XEmacs.org) to do the -conversion. -@comment For convenience xbm2xface is available for anonymous FTP at -@comment @uref{ftp://ftp.miranova.com/pub/xemacs/xbm2xface.pl}. +conversion. For convenience xbm2xface is available for anonymous FTP at +@uref{ftp://ftp.miranova.com/pub/xemacs/xbm2xface.pl}. Contributors for this item: @@ -5990,8 +6057,8 @@ @lisp (setq Info-directory-list (cons - (expand-file-name "~/info") - Info-default-directory-list)) + (expand-file-name "~/info") + Info-default-directory-list)) @end lisp @email{davidm@@prism.kla.com, David Masterson} writes: @@ -6071,466 +6138,25 @@ printing (the @code{Pretty Print Buffer} menu item) @strong{requires} a window system environment. It cannot be used outside of X11. -@node MS Windows, Current Events, Miscellaneous, Top -@unnumbered 6 XEmacs on MS Windows - -This is part 6 of the XEmacs Frequently Asked Questions list, written by -Hrvoje Niksic and others. This section is devoted to the MS Windows -port of XEmacs. - -@menu - -General Info -* Q6.0.1:: What is the status of the XEmacs port to Windows? -* Q6.0.2:: What flavors of MS Windows are supported? -* Q6.0.3:: Where are the XEmacs on MS Windows binaries? -* Q6.0.4:: Does XEmacs on MS Windows require an X server to run? - -Building XEmacs on MS Windows -* Q6.1.1:: I decided to run with X. Where do I get an X server? -* Q6.1.2:: What compiler do I need to compile XEmacs? -* Q6.1.3:: How do I compile for the native port? -* Q6.1.4:: How do I compile for the X port? -* Q6.1.5:: How do I compile for Cygnus' Cygwin? -* Q6.1.6:: What do I need for Cygwin? - -Customization and User Interface -* Q6.2.1:: How will the port cope with differences in the Windows user interface? -* Q6.2.2:: How do I change fonts in XEmacs on MS Windows? -* Q6.2.3:: Where do I put my @file{.emacs} file? - -Miscellaneous -* Q6.3.1:: Will XEmacs rename all the win32-* symbols to w32-*? -* 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 -@unnumberedsec 6.0: General Info -@unnumberedsubsec Q6.0.1: What is the status of the XEmacs port to Windows? - -Is XEmacs really getting ported to MS Windows? What is the status of the port? - -Yes, a group of volunteers actively works on making XEmacs code base -cleanly compile and run on MS Windows operating systems. The mailing -list at @email{xemacs-nt@@xemacs.org} is dedicated to that effort (please use -the -request address to subscribe). - -At this time, XEmacs on MS Windows is usable, but lacks some of the -features of XEmacs on UNIX and UNIX-like systems. Notably, -internationalization does not work. - -@node Q6.0.2, Q6.0.3, Q6.0.1, MS Windows -@unnumberedsubsec Q6.0.2: What flavors of MS Windows are supported? The list name implies NT only. - -The list name is misleading, as XEmacs will support both Windows 95, -Windows 98 and Windows NT. The MS Windows-specific code is based on -Microsoft Win32 API, and will not work on MS Windows 3.x or on MS-DOS. - - -@node Q6.0.3, Q6.0.4, Q6.0.2, MS Windows -@unnumberedsubsec Q6.0.3: Are binary kits available? - -Binary kits are available at -@uref{ftp://ftp.xemacs.org/pub/xemacs/binary-kits/win32/} for the -"plain" MS Windows version. - -@node Q6.0.4, Q6.1.1, Q6.0.3, MS Windows -@unnumberedsubsec Q6.0.4: Does XEmacs on MS Windows require an X server to run? - -Short answer: No. - -Long answer: XEmacs can be built in several ways in the MS Windows -environment, some of them requiring an X server and some not. - -One is what we call the "X" port---it requires X libraries to build -and an X server to run. Internally it uses the Xt event loop and -makes use of X toolkits. Its look is quite un-Windowsy, but it works -reliably and supports all of the graphical features of Unix XEmacs. - -The other is what we call the "native" port. It uses the Win32 API -and does not require X libraries to build, nor does it require an X to -run. In fact, it has no connection with X whatsoever. At this time, -the native port obsoletes the X port, providing almost all of its -features, including support for menus, scrollbars, toolbars, embedded -images and background pixmaps, frame pointers, etc. Most of the -future work will be based on the native port. - -There is also a third special case, the Cygwin port. It takes -advantage of Cygnus emulation library under Win32, which enables it to -reuse much of the Unix XEmacs code base, such as processes and network -support, or internal select() mechanisms. - -Cygwin port supports all display types---TTY, X & MS gui, and can be -built with support for all three. If you build with ms gui support -then the Cygwin version uses the majority of the msw code, which is -mostly related to display. If you want to build with X support you -need X libraries. If you want to build with tty support you need -ncurses. MS gui requires no additional libraries. - -Some of the advantages of the Cygwin version are that it: - -@itemize @bullet - -@item integrates well with Cygwin environment for existing Cygwin users; -@item uses configure so building with different features is very easy; -@item has process support in X & tty. - -@end itemize - -The disadvantage is that it requires several Unix utilities and the -whole Cygwin environment, whereas the native port requires only a -suitable MS Windows compiler. Also, it follows the Unix filesystem and -process model very closely (some will undoubtedly view this as an -advantage). - -@node Q6.1.1, Q6.1.2, Q6.0.4, MS Windows -@unnumberedsec 6.1: Building XEmacs on MS Windows -@unnumberedsubsec Q6.1.1: I decided to run with X. Where do I get an X server? - -Pointers to X servers can be found at -@iftex -@* -@end iftex -@uref{http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/}; - -look for "Where to get an X server". Also note that, although the above -page talks about Cygnus gnu-win32 (Cygwin), the information on X servers -is Cygwin-independent. You don't have to be running/using Cygwin to use -these X servers, and you don't have to compile XEmacs under Cygwin to -use XEmacs with these X servers. An "X port" XEmacs compiled under -Visual C++ will work with these X servers (as will XEmacs running on a -Unix box, redirected to the server running on your PC). - - -@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, 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 -@unnumberedsubsec Q6.1.3: How do I compile for the native port? - -Please read the file @file{nt/README} in the XEmacs distribution, which -contains the full description. - - -@node Q6.1.4, Q6.1.5, Q6.1.3, MS Windows -@unnumberedsubsec Q6.1.4: How do I compile for the X port? - -Again, it is described in @file{nt/README} in some detail. Basically, you -need to get X11 libraries from ftp.x.org, and compile them. If the -precompiled versions are available somewhere, I don't know of it. - - -@node Q6.1.5, Q6.1.6, Q6.1.4, MS Windows -@unnumberedsubsec Q6.1.5: How do I compile for Cygnus' Cygwin? - -Similar as on Unix; use the usual `configure' and `make' process. -Some problems to watch out for: - -@itemize @bullet -@item -make sure HOME is set. This controls where you @file{.emacs} file comes -from; - -@item -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; - -@item -static heap too small, adjust src/sheap-adjust.h to a more positive -number; - -@item -The Cygwin version doesn't understand @file{//machine/path} type paths so you -will need to manually mount a directory of this form under a unix style -directory for a build to work on the directory. - -@end itemize - -@node Q6.1.6, Q6.2.1, Q6.1.5, MS Windows -@unnumberedsubsec Q6.1.6: What do I need for Cygwin? - -You can find the Cygwin tools and compiler at: - -@uref{http://sourceware.cygnus.com/cygwin/} - -You will need version b19 or later. -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, and may in fact be native-compiled. - - -@node Q6.2.1, Q6.2.2, Q6.1.6, MS Windows -@unnumberedsec 6.2: Customization and User Interface -@unnumberedsubsec Q6.2.1: How will the port cope with differences in the Windows user interface? - -XEmacs (and Emacs in general) UI is pretty -different from what is expected of a typical MS Windows program. How will -the MS Windows port cope with it? - -Fortunately, Emacs is also one of the most configurable editor beasts -in the world. The MS Windows "look and feel" (mark via shift-arrow, -self-inserting deletes region, etc.) can be easily configured via -various packages distributed with XEmacs. The `pending-delete' -package is an example of such a utility. - -In future versions, some of these packages might be turned on by -default in the MS Windows environment. - - -@node Q6.2.2, Q6.2.3, Q6.2.1, MS Windows -@unnumberedsubsec Q6.2.2: How do I change fonts in XEmacs on MS Windows? - -In 21.2.*, use the font menu. In 21.1.*, you can change font -manually. For example: - -@display - (set-face-font 'default "Lucida Console:Regular:10") - (set-face-font 'modeline "MS Sans Serif:Regular:10") -@end display - - -@node Q6.2.3, Q6.3.1, Q6.2.2, MS Windows -@unnumberedsubsec Q6.2.3: Where do I put my @file{.emacs} file? - -If the HOME environment variable is set, @file{.emacs} will be looked for -there. Else the directory defaults to `c:\'. - -@node Q6.3.1, Q6.3.2, Q6.2.3, MS Windows -@unnumberedsec 6.3: Miscellaneous -@unnumberedsubsec Q6.3.1: Will XEmacs rename all the win32-* symbols to w32-*? - -In his flavor of Emacs 20, Richard Stallman has renamed all the win32-* -symbols to w32-*. Will XEmacs do the same? - -We consider such a move counter-productive, thus we will not use the -`w32' prefix. However, we do recognize that Win32 name is little more -than a marketing buzzword (will it be Win64 in the next release?), so -we decided not to use it. Using `windows-' would be wrong because the -term is too generic, which is why we settled on a compromise -`mswindows' term. - -Thus all the XEmacs variables and functions directly related to Win32 -are prefixed `mswindows-'. The user-variables shared with NT Emacs -will be provided as compatibility aliases. - -Architectural note: We believe that there should be a very small -number of window-systems-specific variables, and will try to provide -generic interfaces whenever possible. - - -@node Q6.3.2, Q6.3.3, Q6.3.1, MS Windows -@unnumberedsubsec Q6.3.2: What are the differences between the various MS Windows emacsen? - -XEmacs, Win-Emacs, DOS Emacs, NT Emacs, this is all very confusing. -Could you briefly explain the differences between them? - -Here is a recount of various Emacs versions running on MS Windows: - -@itemize @bullet - -@item -Win-Emacs - -@itemize @minus - -@item -Win-Emacs is a port of Lucid Emacs 19.6 to MS Windows using X -compatibility libraries. Win-Emacs has been written by Ben Wing. The -MS Windows code has not made it back to Lucid Emacs, which left Win-Emacs -pretty much dead for our purposes. Win-Emacs used to be available at -Pearlsoft, but not anymore, since Pearlsoft went out of business. -@end itemize - -@item -GNU Emacs for DOS - -@itemize @minus - -@item -GNU Emacs features support for MS-DOS and DJGPP (D.J. Delorie's DOS -port of Gcc). Such an Emacs is heavily underfeatured, because it does -not supports long file names, lacks proper subprocesses support, and -is far too big compared to typical DOS editors. -@end itemize - -@item -GNU Emacs compiled with Win32 - -@itemize @minus - -@item -Starting with version 19.30, it has been possible to compile GNU Emacs -under MS Windows using the DJGPP compiler and X libraries. The result -is is very similar to GNU Emacs compiled under MS DOS, only it -supports longer file names, etc. This "port" is similar to the "X" -flavor of XEmacs on MS Windows. -@end itemize - -@item -NT Emacs - -@itemize @minus - -@item -NT Emacs is a version of GNU Emacs modified to compile and run under -MS MS Windows 95 and NT using the native Win32 API. As such, it is close -in spirit to the XEmacs "native" port. - -@item -NT Emacs has been written by Geoff Voelker, and more information can be -found at -@iftex -@* -@end iftex -@uref{http://www.cs.washington.edu/homes/voelker/ntemacs.html}. - -@end itemize - -@item -XEmacs - -@itemize @minus - -@item -Beginning with XEmacs 19.12, XEmacs' architecture has been redesigned -in such a way to allow clean support of multiple window systems. At -this time the TTY support was added, making X and TTY the first two -"window systems" XEmacs supported. The 19.12 design is the basis for -the current native MS Windows code. - -@item -Some time during 1997, David Hobley (soon joined by Marc Paquette) -imported some of the NT-specific portions of GNU Emacs, making XEmacs -with X support compile under Windows NT, and creating the "X" port. - -@item -Several months later, Jonathan Harris sent out initial patches to use -the Win32 API, thus creating the native port. Since then, various -people have contributed, including Kirill M. Katsnelson (contributed -support for menubars, subprocesses and network, as well as loads of -other code), Andy Piper (ported XEmacs to Cygwin environment, -contributed Windows unexec, Windows-specific glyphs and toolbars code, -and more), Jeff Sparkes (contributed scrollbars support) and many -others. - -@end itemize - -@end itemize - - -@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 - -This is part 7 of the XEmacs Frequently Asked Questions list. This +@node Current Events, , Miscellaneous, Top +@unnumbered 6 What the Future Holds + +This is part 6 of the XEmacs Frequently Asked Questions list. This section will change monthly, and contains any interesting items that have transpired over the previous month. If you are reading this from the XEmacs distribution, please see the version on the Web or archived at the various FAQ FTP sites, as this file is surely out of date. @menu -* Q7.0.1:: What is new in 20.2? -* Q7.0.2:: What is new in 20.3? -* Q7.0.3:: What is new in 20.4? -* Q7.0.4:: Procedural changes in XEmacs development. +* Q6.0.1:: What is new in 20.2? +* Q6.0.2:: What is new in 20.3? +* Q6.0.3:: What is new in 20.4? +* Q6.0.4:: Procedural changes in XEmacs development. @end menu -@node Q7.0.1, Q7.0.2, Current Events, Current Events -@unnumberedsec 7.0: Changes -@unnumberedsubsec Q7.0.1: What is new in 20.2? +@node Q6.0.1, Q6.0.2, Current Events, Current Events +@unnumberedsec 6.0: Changes +@unnumberedsubsec Q6.0.1: What is new in 20.2? The biggest changes in 20.2 include integration of EFS (the next generation of ange-ftp) and AUC Tex (the Emacs subsystem that includes a @@ -6542,8 +6168,8 @@ XEmacs 20.2 is the development release (20.0 was beta), and is no longer considered unstable. -@node Q7.0.2, Q7.0.3, Q7.0.1, Current Events -@unnumberedsubsec Q7.0.2: What is new in 20.3? +@node Q6.0.2, Q6.0.3, Q6.0.1, Current Events +@unnumberedsubsec Q6.0.2: What is new in 20.3? XEmacs 20.3 was released in November 1997. It contains many bugfixes, and a number of new features, including Autoconf 2 based configuration, @@ -6555,22 +6181,22 @@ The XEmacs/Mule support has been only seriously tested in a Japanese locale, and no doubt many problems still remain. The support for ISO-Latin-1 and Japanese is fairly strong. MULE support comes at a -price---about a 30% slowdown from 19.16. We're making progress on +price -- about a 30% slowdown from 19.16. We're making progress on improving performance and XEmacs 20.3 compiled without Mule (which is the default) is definitely faster than XEmacs 19.16. XEmacs 20.3 is the first non-beta v20 release, and will be the basis for all further development. -@node Q7.0.3, Q7.0.4, Q7.0.2, Current Events -@unnumberedsubsec Q7.0.3: What's new in XEmacs 20.4? +@node Q6.0.3, Q6.0.4, Q6.0.2, Current Events +@unnumberedsubsec Q6.0.3: What's new in XEmacs 20.4? XEmacs 20.4 is a bugfix release with no user-visible changes. @c Filled in from NEWS file of 20.5-b33 -@node Q7.0.4, , Q7.0.3, Current Events -@unnumberedsubsec Q7.0.4: Procedural changes in XEmacs development. +@node Q6.0.4, , Q6.0.3, Current Events +@unnumberedsubsec Q6.0.4: Procedural changes in XEmacs development. @enumerate @item @@ -6599,7 +6225,7 @@ the collected bugfixes. @item -As of December 1996, @email{steve@@xemacs.org, Steve Baur} has become +As of December 1996, @email{steve@@altair.xemacs.org, Steve Baur} has become the lead maintainer of XEmacs. @end enumerate diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/xemacs/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,56 @@ +# Makefile for the XEmacs Reference Manual. + +# 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. + +# Modified by Ben Wing, February 1994 + +NAME=xemacs + +MAKEINFO = makeinfo +TEXI2DVI = texi2dvi + +# List of all the texinfo files in the manual: + +srcs = xemacs.texi abbrevs.texi basic.texi buffers.texi building.texi \ + calendar.texi cmdargs.texi custom.texi display.texi entering.texi \ + files.texi fixit.texi glossary.texi gnu.texi help.texi indent.texi \ + keystrokes.texi killing.texi xemacs.texi m-x.texi major.texi mark.texi \ + menus.texi mini.texi misc.texi mouse.texi new.texi picture.texi \ + programs.texi reading.texi regs.texi frame.texi search.texi sending.texi \ + text.texi trouble.texi undo.texi windows.texi + +all : info +info : ../../info/$(NAME).info + +dvi: $(NAME).dvi +.texi.dvi : + $(TEXI2DVI) $< + +../../info/$(NAME).info: $(srcs) + $(MAKEINFO) -o $@ $(NAME).texi + +.PHONY: mostlyclean clean distclean realclean extraclean +mostlyclean: + rm -f *.toc *.aux *.oaux *.log *.cp *.cps *.fn *.fns *.tp *.tps \ + *.vr *.vrs *.pg *.pgs *.ky *.kys +clean: mostlyclean + rm -f *.dvi *.ps make.out core +distclean: clean +realclean: distclean +extraclean: distclean + -rm -f *~ \#* diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/abbrevs.texi --- a/man/xemacs/abbrevs.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/abbrevs.texi Mon Aug 13 11:20:41 2007 +0200 @@ -186,9 +186,9 @@ @example (lisp-mode-abbrev-table) -"dk" 0 "define-key" +"dk" 0 "define-key" (global-abbrev-table) -"dfn" 0 "definition" +"dfn" 0 "definition" @end example @noindent @@ -257,10 +257,9 @@ 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 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"}. +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"}. @vindex save-abbrevs Emacs offers to save abbrevs automatically if you have changed any of diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/basic.texi --- a/man/xemacs/basic.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/basic.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,4 @@ -@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 @@ -9,34 +7,8 @@ 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 -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 +do this, type @kbd{Control-h t} (@code{help-with-tutorial}). -* 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 @@ -44,92 +16,74 @@ @cindex cursor @cindex graphic characters To insert printing characters into the text you are editing, just type -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}. +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}. -@kindex BS +@kindex DEL @cindex deletion - 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. + 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. @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 deletes the preceding newline, thus joining -the line with the preceding line. +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. - 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}. +@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. @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. (This character's name is normally written -@kbd{C-q} for short.) There are two ways to use @kbd{C-q}: + 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 @itemize @bullet @item -@kbd{C-q} followed by any non-graphic character (even @kbd{C-g}) +@kbd{Control-q} followed by any non-graphic character (even @kbd{C-g}) inserts that character. - @item -@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.) +@kbd{Control-q} followed by three octal digits inserts the character +with the specified character code. @end itemize @noindent A numeric argument to @kbd{C-q} specifies how many copies of the quoted character should be inserted (@pxref{Arguments}). -@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. + 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}. -@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}). The simplest way to do this is with arrow keys, or by -clicking the left mouse button where you want to move to. +(@pxref{Point}). Here are a few of the available commands. 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. @@ -195,10 +149,7 @@ 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}). @@ -212,16 +163,14 @@ 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, 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). +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). @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 @@ -231,46 +180,35 @@ @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 point to buffer position @var{n}. +Read a number @var{n} and move the cursor to character number @var{n}. Position 1 is the beginning of the buffer. @item M-g -Read a number @var{n} and move point to line number @var{n} +Read a number @var{n} and move cursor to line number @var{n} (@code{goto-line}). Line 1 is the beginning of the buffer. -@c @item C-x C-n -@item M-x set-goal-column +@item C-x C-n @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. -@c @item C-u C-x C-n -@item C-u M-x set-goal-column +@item C-u C-x C-n 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, -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}. +@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}. -@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 or after point -(@code{backward-or-forward-delete-char}). You can customize -this behavior by setting the variable @code{delete-key-deletes-forward}. +Delete the character before the cursor (@code{delete-backward-char}). @item C-d -Delete the character after point (@code{delete-char}). +Delete the character after the cursor (@code{delete-char}). @item C-k Kill to the end of the line (@code{kill-line}). @item M-d @@ -280,34 +218,30 @@ (@code{backward-kill-word}). @end table -@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. + 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. - 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. + 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. @xref{Killing}, for more flexible ways of killing text. -@node Basic Files, Basic Help, Erasing, Basic @section Files @cindex files - 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. + 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. Consider a file named @file{/usr/rms/foo.c}. To begin editing this file from Emacs, type: @@ -317,51 +251,54 @@ @end example @noindent -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}). +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 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: 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. + 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 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. 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 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. - To learn more about using files, @xref{Files}. + To learn more about using files, @pxref{Files}. -@node Basic Help, Blank Lines, Basic Files, Basic @section Help -@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} + 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} 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} twice to get -a description of all the help facilities. @xref{Help}. +@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 -@node Blank Lines, Continuation Lines, Basic Help, Basic +@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 @section Blank Lines -@cindex inserting blank lines -@cindex deleting blank lines - Here are special commands and techniques for putting in and taking out + Here are special commands and techniques for entering and removing blank lines. @c widecommands @@ -378,65 +315,55 @@ @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 -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. + 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. - 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}. + 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. - 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. + 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. @node Continuation Lines, Position Info, Blank Lines, Basic @section Continuation Lines @cindex continuation line -@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}. + 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. - 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. Right arrow in the last column (instead of the -curved arrow) inform you that truncation is in effect. +temporarily invisible. Three diagonal dots in the last column (instead of +the curved arrow inform you that truncation is in effect. - 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. + 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 @node Position Info, Arguments, Continuation Lines, Basic @section Cursor Position Information @@ -453,12 +380,9 @@ 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}). @xref{Mark}, for information about the -region. +Print number of lines and characters in the current region +(@code{count-lines-region}). @item C-x = Print character code of character after point, character position of point, and column of point (@code{what-cursor-position}). @@ -472,7 +396,6 @@ @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 @@ -484,28 +407,26 @@ 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}). @xref{Pages}, for the command @kbd{C-x l} which -counts the lines in the +@kbd{M-=} (@code{count-lines-region}) prints the number of lines in +the region (@pxref{Mark}). @end itemize @kindex C-x = @findex what-cursor-position - 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: + 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: @example -Char: c (0143, 99, 0x63) point=18862 of 24800(76%) column 53 +Char: x (0170) point=65986 of 563027(12%) column 44 @end example @noindent -(In fact, this is the output produced when point is before @samp{column -53} in the example.) +(In fact, this is the output produced when point is before @samp{column 44} +in the example.) - 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. + The two values after @samp{Char:} describe the character following point, +first by showing it and second by giving its octal character code. @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 @@ -513,8 +434,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 @@ -522,7 +443,7 @@ might say: @smallexample -Char: c (0143, 99, 0x63) point=19674 of 24575(80%) <19591 - 19703> column 69 +Char: x (0170) point=65986 of 563025(12%) <65102 - 68533> column 44 @end smallexample @noindent @@ -542,15 +463,12 @@ @section Numeric Arguments @cindex numeric arguments - 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. + 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. @kindex M-1 @kindex M-@t{-} @@ -564,21 +482,18 @@ M-5 C-n @end example @noindent -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. +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. @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 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. +(@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. @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 @@ -588,7 +503,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). +lines).@refill 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 @@ -604,47 +519,32 @@ 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}.) +@kbd{C-k}.)@refill 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 are -described when they come up; they are always for reasons of convenience -of use of the individual command. +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. - 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. - +@c section Autoarg Mode @ignore -@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. +@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. - 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. + To use Autoarg mode, set the variable Autoarg Mode nonzero. +@xref{Variables}. - 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. - + 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. @end ignore diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/buffers.texi --- a/man/xemacs/buffers.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/buffers.texi Mon Aug 13 11:20:41 2007 +0200 @@ -117,14 +117,14 @@ MR Buffer Size Mode File -- ------ ---- ---- ---- .* emacs.tex 383402 Texinfo /u2/emacs/man/emacs.tex - *Help* 1287 Fundamental + *Help* 1287 Fundamental files.el 23076 Emacs-Lisp /u2/emacs/lisp/files.el % RMAIL 64042 RMAIL /u/rms/RMAIL - *% man 747 Dired /u2/emacs/man/ + *% man 747 Dired /u2/emacs/man/ net.emacs 343885 Fundamental /u/rms/net.emacs fileio.c 27691 C /u2/emacs/src/fileio.c NEWS 67340 Text /u2/emacs/etc/NEWS - *scratch* 0 Lisp Interaction + *scratch* 0 Lisp Interaction @end smallexample @noindent @@ -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} before the buffer name on a line +Request to save the buffer. An @samp{S} befor 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 12e008d41344 -r 697ef44129c6 man/xemacs/building.texi --- a/man/xemacs/building.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/building.texi Mon Aug 13 11:20:41 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 explicitly exit the debugger when you don't want to use it any +buffer and explictly 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 12e008d41344 -r 697ef44129c6 man/xemacs/calendar.texi --- a/man/xemacs/calendar.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/calendar.texi Mon Aug 13 11:20:41 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 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}. +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}. @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 init file, this + If you put @code{(diary)} in your @file{.emacs} file, this automatically displays a window with the day's diary entries, when you -enter Emacs. @xref{Init File}. The mode line of the displayed window -shows the date and any holidays that fall on that date. +enter Emacs. 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 init file:@refill +your @file{.emacs} file:@refill @example (setq view-diary-entries-initially t) @@ -1411,8 +1411,7 @@ @end example @noindent -this displays both the calendar and diary windows whenever you start -Emacs. @xref{Init File}. +this displays both the calendar and diary windows whenever you start Emacs. @vindex view-calendar-holidays-initially Similarly, if you set the variable @@ -1586,14 +1585,12 @@ 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 init file: +to your @file{.emacs} 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). @@ -2064,15 +2061,13 @@ @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 init file: +time of day. Add this line to your @file{.emacs} 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 12e008d41344 -r 697ef44129c6 man/xemacs/cmdargs.texi --- a/man/xemacs/cmdargs.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/cmdargs.texi Mon Aug 13 11:20:41 2007 +0200 @@ -139,7 +139,7 @@ @item -no-init-file @itemx -q -Do not load your Emacs init file. @xref{Init File}. +Do not load your Emacs init file @file{~/.emacs}. @item -no-site-file Do not load the site-specific init file @file{lisp/site-start.el}. @@ -155,20 +155,11 @@ @item -vanilla 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{~/.xemacs/init.el}/@file{~/.emacs}. - -@item -user-init-directory @var{directory} -Use @var{directory} as the location of your early package hierarchies -and the various user-specific initialization files. - @item -user @var{user} @itemx -u @var{user} -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}. +Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of +your own. + @end table @@ -233,9 +224,6 @@ @item -cr @var{color} Use @var{color} as the text-cursor foreground color. - -@item -private -Install a private colormap for XEmacs. @end table In addition, XEmacs allows you to use a number of standard Xt diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/custom.texi --- a/man/xemacs/custom.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/custom.texi Mon Aug 13 11:20:41 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 init 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 @file{.emacs} 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,12 +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 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 +* 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. +* X Resources:: X resources controlling various aspects of the behavior of XEmacs. @end menu @@ -386,10 +385,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 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. +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. You can also restore the option to its standard value by invoking @samp{[State]} and selecting the @samp{Reset} operation. There are @@ -749,7 +748,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 file to turn it on (when appropriate) for you alone +@file{.emacs} 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. @@ -762,16 +761,16 @@ mode and variable settings should be. For example, these are all legal: @example - ;;; -*- mode: emacs-lisp -*- - ;;; -*- mode: postscript; version-control: never -*- - ;;; -*- tags-file-name: "/foo/bar/TAGS" -*- + ;;; -*- mode: emacs-lisp -*- + ;;; -*- mode: postscript; version-control: never -*- + ;;; -*- tags-file-name: "/foo/bar/TAGS" -*- @end example For historical reasons, the syntax @code{`-*- modename -*-'} is allowed as well; for example, you can use: @example - ;;; -*- emacs-lisp -*- + ;;; -*- emacs-lisp -*- @end example @vindex enable-local-variables @@ -911,7 +910,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 -(@pxref{Init File}), then the macro will be defined each +@file{~/.emacs} (@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 @@ -1094,9 +1093,9 @@ local map, which affects all buffers using the same major mode. @menu -* Interactive Rebinding:: Changing Key Bindings Interactively -* Programmatic Rebinding:: Changing Key Bindings Programmatically -* Key Bindings Using Strings:: Using Strings for Changing Key Bindings +* Interactive Rebinding:: Changing Key Bindings Interactively +* Programmatic Rebinding:: Changing Key Bindings Programmatically +* Key Bindings Using Strings::Using Strings for Changing Key Bindings @end menu @node Interactive Rebinding @@ -1154,7 +1153,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 init file). +@code{define-key}, used in Lisp code (such as your @file{.emacs} 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 @@ -1233,13 +1232,13 @@ @example ;;; Bind @code{my-command} to @key{f1} -(global-set-key 'f1 'my-command) +(global-set-key 'f1 'my-command) ;;; Bind @code{my-command} to @kbd{Shift-f1} (global-set-key '(shift f1) 'my-command) ;;; Bind @code{my-command} to @kbd{C-c Shift-f1} -(global-set-key '[(control c) (shift f1)] 'my-command) +(global-set-key '[(control c) (shift f1)] 'my-command) ;;; Bind @code{my-command} to the middle mouse button. (global-set-key 'button2 'my-command) @@ -1289,14 +1288,14 @@ After binding a command to two key sequences with a form like: @example - (define-key global-map "\^X\^I" 'command-1) + (define-key global-map "\^X\^I" 'command-1) @end example it is possible to redefine only one of those sequences like so: @example - (define-key global-map [(control x) (control i)] 'command-2) - (define-key global-map [(control x) tab] 'command-3) + (define-key global-map [(control x) (control i)] 'command-2) + (define-key global-map [(control x) tab] 'command-3) @end example This applies only when running under a window system. If you are @@ -1326,15 +1325,13 @@ 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 init file with +properties are normally set by the user's @file{.emacs} 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: @@ -1345,9 +1342,9 @@ @findex disable-command @findex enable-command - You can disable a command either by editing the init file + You can disable a command either by editing the @file{.emacs} file directly or with the command @kbd{M-x disable-command}, which edits the -init file for you. @xref{Init File}. +@file{.emacs} 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 @@ -1356,7 +1353,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 init file. You can use @kbd{M-x enable-command} at any +your @file{.emacs} 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 @@ -1533,23 +1530,27 @@ and some English to explain that string if necessary. @node Init File -@section The Init File +@section The Init File, .emacs @cindex init file @cindex Emacs initialization file @cindex key rebinding, permanent @cindex rebinding keys, permanently - 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. + 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 switches @samp{-q} and @samp{-u} to tell Emacs whether to load an +init file (@pxref{Entering Emacs}). + +@vindex init-file-user +When the @file{.emacs} file is read, the variable @code{init-file-user} +says which user's init file it is. The value may be the null string or a +string containing a user's name. If the value is a null string, it means +that the init file was taken from the user that originally logged in. + +In all cases, @code{(concat "~" init-file-user "/")} evaluates to the +directory name of the directory where the @file{.emacs} file was looked +for. 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 @@ -1559,8 +1560,10 @@ 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 init file, you should -byte-compile it to @file{~/.xemacs/init.elc} or @file{~/.emacs.elc}. + 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}. @menu * Init Syntax:: Syntax of constants in Emacs Lisp. @@ -1571,7 +1574,7 @@ @node Init Syntax @subsection Init File Syntax - The init file contains one or more Lisp function call + The @file{.emacs} 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 @@ -1579,7 +1582,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 the init file, constants are used most of the time. +expression. In @file{.emacs}, constants are used most of the time. They can be: @table @asis @@ -1813,16 +1816,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 init +variable @code{term-file-prefix} and the terminal type. Your @file{.emacs} file can prevent the loading of the terminal-specific library by setting -@code{term-file-prefix} to @code{nil}. @xref{Init File}. +@code{term-file-prefix} to @code{nil}. @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 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 +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 initializations for terminals that do not have a library.@refill @node Audible Bell @@ -1920,16 +1923,16 @@ @item undefined-key You type a key that is undefined -@item undefined-click +@item undefined-click You use an undefined mouse-click combination -@item no-completion +@item no-completion Completion was not possible -@item y-or-n-p +@item y-or-n-p You type something other than the required @code{y} or @code{n} -@item yes-or-no-p +@item yes-or-no-p You type something other than @code{yes} or @code{no} @end table @@ -2054,16 +2057,6 @@ @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 @@ -2078,7 +2071,7 @@ Starting with XEmacs 21, XEmacs uses the class @samp{XEmacs} if it finds any XEmacs resources in the resource database when the X connection is initialized. Otherwise, it will use the class @samp{Emacs} for -backwards compatibility. The variable @var{x-emacs-application-class} +backwards compatability. The variable @var{x-emacs-application-class} may be consulted to determine the application class being used. The examples in this section assume the application class is @samp{Emacs}. @@ -2110,11 +2103,11 @@ @menu * Geometry Resources:: Controlling the size and position of frames. -* Iconic Resources:: Controlling whether frames come up iconic. -* Resource List:: List of resources settable on a frame or device. -* Face Resources:: Controlling faces using resources. -* Widgets:: The widget hierarchy for XEmacs. -* Menubar Resources:: Specifying resources for the menubar. +* Iconic Resources:: Controlling whether frames come up iconic. +* Resource List:: List of resources settable on a frame or device. +* Face Resources:: Controlling faces using resources. +* Widgets:: The widget hierarchy for XEmacs. +* Menubar Resources:: Specifying resources for the menubar. @end menu @node Geometry Resources @@ -2371,8 +2364,8 @@ The foreground and background colors of this face. @item @code{attributeBackgroundPixmap} (class @code{AttributeBackgroundPixmap}): file-name -The name of an @sc{xbm} file (or @sc{xpm} file, if your version of Emacs -supports @sc{xpm}), to use as a background stipple. +The name of an @sc{XBM} file (or @sc{XPM} file, if your version of Emacs +supports @sc{XPM}), to use as a background stipple. @item @code{attributeUnderline} (class @code{AttributeUnderline}): boolean Whether text in this face should be underlined. @@ -2489,7 +2482,7 @@ @subsection Menubar Resources As the menubar is implemented as a widget which is not a part of XEmacs -proper, it does not use the face mechanism for specifying fonts and +proper, it does not use the fac" mechanism for specifying fonts and colors: It uses whatever resources are appropriate to the type of widget which is used to implement it. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/entering.texi --- a/man/xemacs/entering.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/entering.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,91 +1,53 @@ -@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. - 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. + 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. - 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. + 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. @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}.) - - 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. +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}. - 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. + 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. @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 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. +@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. @table @kbd @item C-z -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). +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). @item C-x C-c Kill Emacs (@code{save-buffers-kill-emacs}). @end table @@ -94,68 +56,45 @@ 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 iconified. +frame from which you used @kbd{C-z} is retained. The X windows +containing the other Emacs frames are closed. 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 XEmacs} item on the @b{File} +process, use @kbd{C-x C-c} or the @b{Exit Emacs} item on the @b{File} menu. @kindex C-z @findex suspend-emacs - 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. + 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. @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. Selecting -the @b{Exit XEmacs} 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. In +XEmacs, selecting the @b{Exit Emacs} 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 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. +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. - 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}. + 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}). - 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}). +@c ??? What about system V here? diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/files.texi --- a/man/xemacs/files.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/files.texi Mon Aug 13 11:20:41 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 delete-old-versions - If @code{delete-old-versions} is non-@code{nil}, excess +@vindex trim-versions-without-asking + If @code{trim-versions-without-asking} 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 12e008d41344 -r 697ef44129c6 man/xemacs/frame.texi --- a/man/xemacs/frame.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/frame.texi Mon Aug 13 11:20:41 2007 +0200 @@ -41,21 +41,9 @@ 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 a graphical windowing system, a +If you are running XEmacs under the X Window 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 12e008d41344 -r 697ef44129c6 man/xemacs/glossary.texi --- a/man/xemacs/glossary.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/glossary.texi Mon Aug 13 11:20:41 2007 +0200 @@ -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, toolbar, and/or gutter. +echo area, and (under X) possibly a menubar. @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 as Dired buffers. +has a special significance to Emacs, such asDired buffers. Visiting a file that is write-protected also makes a read-only buffer. @xref{Buffers}. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/gnu.texi --- a/man/xemacs/gnu.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/gnu.texi Mon Aug 13 11:20:41 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 -distribution arrangements. GNU does not eliminate all the world's problems, +distibution 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 12e008d41344 -r 697ef44129c6 man/xemacs/help.texi --- a/man/xemacs/help.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/help.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,28 +1,20 @@ @node Help, Mark, M-x, Top @chapter Help -@kindex Help @cindex help @cindex self-documentation -@findex help-command -@kindex C-h -@kindex F1 - XEmacs provides extensive help features accessible through a single + Emacs provides extensive help features which revolve around a single character, @kbd{C-h}. @kbd{C-h} is a prefix key that is used only for -documentation-printing commands. The characters that you can type after +documentation-printing commands. The characters you can type after @kbd{C-h} are called @dfn{help options}. One help option is @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}. +you use it to ask for help about using @kbd{C-h}. -@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: + @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: @smallexample -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: +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: @end smallexample @noindent @@ -31,109 +23,66 @@ 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{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 a @var{string} @key{RET} +Display a list of commands whose names contain @var{string} +(@code{command-@*apropos}).@refill @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}). 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} +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} Display documentation on the Lisp function named @var{function} -(@code{describe-function}). Since commands are Lisp functions, +(@code{describe-function}). Note that commands are Lisp functions, so a command name may be used. @item C-h i Run Info, the program for browsing documentation files (@code{info}). -The complete XEmacs manual is available online in Info. +The complete Emacs manual is available online in Info. @item C-h k @var{key} -Display the name and documentation of the command that @var{key} runs -(@code{describe-key}). +Display name and documentation of the command @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 -@itemx C-h C-n -Display documentation of XEmacs changes, most recent first +Display documentation of Emacs 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}). @xref{Syntax}. +what they mean (@code{describe-syntax}). @item C-h t -Enter the XEmacs interactive tutorial (@code{help-with-tutorial}). +Display the Emacs 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 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}). +@item M-x apropos @var{regexp} +Show all symbols whose names contain matches for @var{regexp}. @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 @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 +(@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 @samp{forward-char}. Since command names are chosen to describe what -the commands do, this is a good way to get a very brief description of -what @var{key} does. +the command does, using this option is a good way to get a somewhat cryptic +description of what @var{key} does.@refill @kindex C-h k @findex describe-key @@ -144,10 +93,6 @@ 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 @@ -171,238 +116,117 @@ @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 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. + @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. - 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 + +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 @samp{(make-vector (car x)}, the innermost list containing point is the -one that starts with @samp{(make-vector}, so the default is to describe the -function @code{make-vector}. +one starting 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 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. +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. @kindex C-h w @findex where-is - @kbd{C-h w @var{command} @key{RET}} (@code{where-is}) tells you what + @kbd{C-h w @var{command} @key{RET}} (@code{where-s}) 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. +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 @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}. +variable. @xref{Variables}.@refill -@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}). +(@code{command-apropos}).@refill @item M-x apropos @var{regexp} -Show all symbols whose names contain matches for @var{regexp}. +Show all symbols whose names comtain matches for @var{regexp}. @end table - 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. + 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 - 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, 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}). +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}). Here is a set of arguments to give to @kbd{C-h a} that covers many -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. +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. @quotation char, line, word, sentence, paragraph, region, page, sexp, list, defun, -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. +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. @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}. 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: +instead of @kbd{C-h a}. -@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 XEmacs manual +browsing through structured documentation files. The entire Emacs 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 in. If you see commands that you don't -know, you can use @kbd{C-h c} to find out what they do. +100 command characters you typed. If you see commands you don't +know, use @kbd{C-h c} to find out what they do. @kindex C-h m @findex describe-mode - XEmacs has several major modes. Each mode redefines a few keys and + Emacs 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. @@ -410,21 +234,13 @@ @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 XEmacs +(@code{describe-syntax}) present information about the current Emacs mode that is not covered by @kbd{C-h m}. @kbd{C-h b} displays a list of -all the key bindings currently in effect, with the local bindings of the -current major mode first, followed by the global bindings (@pxref{Key +all 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}). +explanations of each character's syntax (@pxref{Syntax}).@refill - 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 @@ -436,16 +252,14 @@ @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 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 frequentliy-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} +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} (@code{describe-distribution}) displays another file named -@file{xemacs/etc/DISTRIB}, which tells you how you can order a copy of -the latest version of XEmacs. +@file{emacs/etc/DISTRIB}, which tells you how you can order a copy of +the latest version of Emacs.@refill diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/keystrokes.texi --- a/man/xemacs/keystrokes.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/keystrokes.texi Mon Aug 13 11:20:41 2007 +0200 @@ -143,7 +143,7 @@ Release the middle mouse button, while pressing @key{CTRL} and @key{META}. @end table -@cindex shift modifier +@cindex shift modifer 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,15 +163,15 @@ schematic representation of a complete key sequence is as follows: @example - [(modifier .. modifier keysym) ... (modifier .. modifier keysym)] + [(modifier .. modifer keysym) ... (modifier .. modifier keysym)] @end example Here are some examples of complete key sequences: @table @kbd -@item [(control c) (control a)] +@item [(control c) (control a)] Typing @kbd{C-c} followed by @kbd{C-a} -@item [(control c) (control 65)] +@item [(control c) (control 65)] Typing @kbd{C-c} followed by @kbd{C-a}. (Using the ASCII code for the character `a')@refill @item [(control c) (break)] @@ -299,9 +299,9 @@ Create a file called @code{~/.xmodmap}. In this file, place the lines @example - remove Lock = Caps_Lock - keysym Caps_Lock = Super_L - add Mod2 = Super_L + remove Lock = Caps_Lock + keysym Caps_Lock = Super_L + add Mod2 = Super_L @end example The first line says that the key that is currently called @code{Caps_Lock} diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/menus.texi --- a/man/xemacs/menus.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/menus.texi Mon Aug 13 11:20:41 2007 +0200 @@ -345,19 +345,19 @@ alternate binding before the command executes. @item Syntax Highlighting -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 +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 @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 init file. @xref{Init File}. +menu to your @code{.emacs} file. @end table @node Buffers Menu @@ -430,18 +430,18 @@ The following functions are available: @table @kbd -@item add-menu: (@var{menu-path} @var{menu-name} @var{menu-items} &optional @var{before}) +@item add-menu: @var{(menu-path menu-name menu-items &optional before)} Add a menu to the menu bar or one of its submenus. -@item add-menu-item: (@var{menu-path} @var{item-name} @var{function} -@var{enabled-p} &optional @var{before}) +@item add-menu-item: @var{(menu-path item-name function enabled-p +&optional before)} Add a menu item to a menu, creating the menu first if necessary. -@item delete-menu-item: (@var{path}) +@item delete-menu-item: @var{(path)} Remove the menu item defined by @var{path} from the menu hierarchy. -@item disable-menu-item: (@var{path}) +@item disable-menu-item: @var{(path)} Disable the specified menu item. -@item enable-menu-item: (@var{path}) +@item enable-menu-item: @var{(path)} Enable the specified previously disabled menu item. -@item relabel-menu-item: (@var{path} @var{new-name}) +@item relabel-menu-item: @var{(path new-name)} Change the string of the menu item specified by @var{path} to @var{new-name}. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/mini.texi --- a/man/xemacs/mini.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/mini.texi Mon Aug 13 11:20:41 2007 +0200 @@ -3,19 +3,20 @@ @chapter The Minibuffer @cindex minibuffer - The @dfn{minibuffer} is the facility used by XEmacs commands to read -arguments more complicated than a single number. Minibuffer arguments -can be file names, buffer names, Lisp function names, XEmacs command -names, Lisp expressions, and many other things, depending on the command -reading the argument. You can use the usual XEmacs editing commands in -the minibuffer to edit the argument text. + Emacs commands use the @dfn{minibuffer} to read arguments more +complicated than a single number. Minibuffer arguments can be file +names, buffer names, Lisp function names, Emacs command names, Lisp +expressions, and many other things, depending on the command reading the +argument. To edit the argument in the minibuffer, you can use Emacs +editing commands. + @cindex prompt When the minibuffer is in use, it appears in the echo area, and the cursor moves there. The beginning of the minibuffer line displays a -@dfn{prompt} which says what kind of input you should supply and how it -will be used. Often this prompt is derived from the name of the command -that the argument is for. The prompt normally ends with a colon. +@dfn{prompt} indicating what kind of input you should supply and how it +will be used. The prompt is often derived from the name of the command +the argument is for. The prompt normally ends with a colon. @cindex default argument Sometimes a @dfn{default argument} appears in parentheses after the @@ -25,14 +26,14 @@ is the name of the buffer that will be used if you type just @key{RET}. @kindex C-g - The simplest way to enter a minibuffer argument is to type the text -you want, terminated by @key{RET} which exits the minibuffer. You can -cancel the command that wants the argument, and get out of the -minibuffer, by typing @kbd{C-g}. + The simplest way to give a minibuffer argument is to type the text you +want, terminated by @key{RET} to exit the minibuffer. To get out +of the minibuffer and cancel the command that it was for, type +@kbd{C-g}. Since the minibuffer uses the screen space of the echo area, it can -conflict with other ways XEmacs customarily uses the echo area. Here is -how XEmacs handles such conflicts: +conflict with other ways Emacs customarily uses the echo area. Here is how +Emacs handles such conflicts: @itemize @bullet @item @@ -43,9 +44,9 @@ anything. @item -If in the minibuffer you use a command whose purpose is to print a -message in the echo area, such as @kbd{C-x =}, the message is printed -normally, and the minibuffer is hidden for a while. It comes back +If you use a command in the minibuffer whose purpose is to print a +message in the echo area (for example @kbd{C-x =}) the message is +displayed normally, and the minibuffer is hidden for a while. It comes back after a few seconds, or as soon as you type anything. @item @@ -57,7 +58,6 @@ * File: Minibuffer File. Entering file names with the minibuffer. * Edit: Minibuffer Edit. How to edit in the minibuffer. * Completion:: An abbreviation facility for minibuffer input. -* Minibuffer History:: Reusing recent minibuffer arguments. * Repetition:: Re-executing commands that used the minibuffer. @end menu @@ -66,43 +66,37 @@ Sometimes the minibuffer starts out with text in it. For example, when you are supposed to give a file name, the minibuffer starts out containing -the @dfn{default directory}, which ends with a slash. This is to inform -you which directory the file will be found in if you do not specify a -directory. - - For example, the minibuffer might start out with these contents: +the @dfn{default directory}, which ends with a slash. This informs +you in which directory the file will be looked for if you do not specify +a different one. For example, the minibuffer might start out with: @example Find File: /u2/emacs/src/ @end example @noindent -where @samp{Find File:@: } is the prompt. Typing @kbd{buffer.c} -specifies the file @file{/u2/emacs/src/buffer.c}. To find files in -nearby directories, use @kbd{..}; thus, if you type -@kbd{../lisp/simple.el}, you will get the file named -@file{/u2/emacs/lisp/simple.el}. Alternatively, you can kill with -@kbd{M-@key{DEL}} the directory names you don't want (@pxref{Words}). +where @samp{Find File:@: } is the prompt. Typing @kbd{buffer.c} specifies +the file +@*@file{/u2/emacs/src/buffer.c}. To find files in nearby +directories, use @samp{..}; thus, if you type @kbd{../lisp/simple.el}, the +file that you visit will be the one named +@*@file{/u2/emacs/lisp/simple.el}. +Alternatively, you can use @kbd{M-@key{DEL}} to kill directory names you +don't want (@pxref{Words}).@refill - If you don't want any of the default, you can kill it with @kbd{C-a -C-k}. But you don't need to kill the default; you can simply ignore it. -Insert an absolute file name, one starting with a slash or a tilde, -after the default directory. For example, to specify the file -@file{/etc/termcap}, just insert that name, giving these minibuffer -contents: + You can also type an absolute file name, one starting with a slash or a +tilde, ignoring the default directory. For example, to find the file +@file{/etc/termcap}, just type the name, giving: @example Find File: /u2/emacs/src//etc/termcap @end example @noindent -@cindex // in file name -@cindex double slash in file name -@cindex slashes repeated in file name -XEmacs gives a special meaning to a double slash (which is not normally -a useful thing to write): it means, ``ignore everything before the -second slash in the pair.'' Thus, @samp{/u2/emacs/src/} is ignored in -the example above, and you get the file @file{/etc/termcap}. +Two slashes in a row are not normally meaningful in Unix file names, but +they are allowed in XEmacs. They mean, ``ignore everything before the +second slash in the pair.'' Thus, @samp{/u2/emacs/src/} is ignored, and +you get the file @file{/etc/termcap}. @vindex insert-default-directory If you set @code{insert-default-directory} to @code{nil}, the default @@ -113,144 +107,126 @@ @node Minibuffer Edit, Completion, Minibuffer File, Minibuffer @section Editing in the Minibuffer - The minibuffer is an XEmacs buffer (albeit a peculiar one), and the -usual XEmacs commands are available for editing the text of an argument -you are entering. + The minibuffer is an Emacs buffer (albeit a peculiar one), and the usual +Emacs commands are available for editing the text of an argument you are +entering. Since @key{RET} in the minibuffer is defined to exit the minibuffer, -you can't use it to insert a newline in the minibuffer. To do that, -type @kbd{C-o} or @kbd{C-q C-j}. (Recall that a newline is really the -character control-J.) +you must use @kbd{C-o} or @kbd{C-q @key{LFD}} to insert a newline into +the minibuffer. (Recall that a newline is really the @key{LFD} +character.) - The minibuffer has its own window which always has space on the screen -but acts as if it were not there when the minibuffer is not in use. -When the minibuffer is in use, its window is just like the others; you -can switch to another window with @kbd{C-x o}, edit text in other -windows and perhaps even visit more files, before returning to the -minibuffer to submit the argument. You can kill text in another window, -return to the minibuffer window, and then yank the text to use it in the -argument. @xref{Windows}. + The minibuffer has its own window, which always has space on the screen +but acts as if it were not there when the minibuffer is not in use. The +minibuffer window is just like the others; you can switch to another +window with @kbd{C-x o}, edit text in other windows, and perhaps even +visit more files before returning to the minibuffer to submit the +argument. You can kill text in another window, return to the minibuffer +window, and then yank the text to use it in the argument. @xref{Windows}. - There are some restrictions on the use of the minibuffer window, -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 ^}. 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}). + There are, however, some restrictions on the use of the minibuffer window. +You cannot switch buffers in it---the minibuffer and its window are +permanently attached. You also cannot split or kill the minibuffer +window, but you can make it taller with @kbd{C-x ^}. @kindex C-M-v - If while in the minibuffer you issue a command that displays help text -of any sort in another window, you can use the @kbd{C-M-v} command while -in the minibuffer to scroll the help text. This lasts until you exit -the minibuffer. This feature is especially useful if a completing -minibuffer gives you a list of possible completions. @xref{Other Window}. + If you are in the minibuffer and issue a command that displays help +text in another window, that window will be scrolled if you type +@kbd{M-C-v} while in the minibuffer until you exit the minibuffer. This +feature is helpful if a completing minibuffer gives you a long list of +possible completions. -@vindex minibuffer-confirm-incomplete If the variable @code{minibuffer-confirm-incomplete} is @code{t}, you are asked for confirmation if there is no known completion for the text you typed. For example, if you attempted to visit a non-existent file, the minibuffer might read: @example - Find File: chocolate_bar.c [no completions, confirm] + Find File:chocolate_bar.c [no completions, confirm] @end example If you press @kbd{Return} again, that confirms the filename. Otherwise, you can continue editing it. - XEmacs supports recursive use of the minibuffer. However, it is easy -to do this by accident (because of autorepeating keyboards, for example) -and get confused. Therefore, most XEmacs commands that use the -minibuffer refuse to operate if the minibuffer window is selected. If -the minibuffer is active but you have switched to a different window, -recursive use of the minibuffer is allowed---if you know enough to try -to do this, you probably will not get confused. + Emacs supports recursive use of the minibuffer. However, it is +easy to do this by accident (because of autorepeating keyboards, for +example) and get confused. Therefore, most Emacs commands that use the +minibuffer refuse to operate if the minibuffer window is selected. If the +minibuffer is active but you have switched to a different window, recursive +use of the minibuffer is allowed---if you know enough to try to do this, +you probably will not get confused. @vindex enable-recursive-minibuffers - If you set the variable @code{enable-recursive-minibuffers} to a + If you set the variable @code{enable-recursive-minibuffers} to be non-@code{nil}, recursive use of the minibuffer is always allowed. -@node Completion, Minibuffer History, Minibuffer Edit, Minibuffer +@node Completion, Repetition, Minibuffer Edit, Minibuffer @section Completion @cindex completion - For certain kinds of arguments, you can use @dfn{completion} to enter -the argument value. Completion means that you type part of the -argument, then XEmacs visibly fills in the rest, or as much as -can be determined from the part you have typed. + When appropriate, the minibuffer provides a @dfn{completion} facility. +You type the beginning of an argument and one of the completion keys, +and Emacs visibly fills in the rest, depending on what you have already +typed. When completion is available, certain keys---@key{TAB}, @key{RET}, and -@key{SPC}---are rebound to complete the text present in the +@key{SPC}---are redefined to complete an abbreviation present in the minibuffer into a longer string that it stands for, by matching it against a set of @dfn{completion alternatives} provided by the command reading the argument. @kbd{?} is defined to display a list of possible completions of what you have inserted. - For example, when @kbd{M-x} uses the minibuffer to read the name of a -command, it provides a list of all available XEmacs command names to -complete against. The completion keys match the text in the minibuffer -against all the command names, find any additional name characters -implied by the ones already present in the minibuffer, and add those -characters to the ones you have given. This is what makes it possible -to type @kbd{M-x inse @key{SPC} b @key{RET}} instead of @kbd{M-x -insert-buffer @key{RET}} (for example). + For example, when the minibuffer is being used by @kbd{Meta-x} to read +the name of a command, it is given a list of all available Emacs command +names to complete against. The completion keys match the text in the +minibuffer against all the command names, find any additional characters of +the name that are implied by the ones already present in the minibuffer, +and add those characters to the ones you have given. - Case is normally significant in completion because it is significant -in most of the names that you can complete (buffer names, file names and -command names). Thus, @samp{fo} does not complete to @samp{Foo}. When -you are completing a name in which case does not matter, case may be -ignored for completion's sake if specified by program. + Case is normally significant in completion because it is significant in +most of the names that you can complete (buffer names, file names, and +command names). Thus, @samp{fo} will not complete to @samp{Foo}. When you +are completing a name in which case does not matter, case may be ignored +for completion's sake if specified by program. When a completion list is displayed, the completions will highlight as you move the mouse over them. Clicking the middle mouse button on any highlighted completion will ``select'' it just as if you had typed it in and hit @key{RET}. -@menu -* Example: Completion Example. -* Commands: Completion Commands. -* Strict Completion:: -* Options: Completion Options. -@end menu - -@node Completion Example, Completion Commands, Completion, Completion -@subsection Completion Example +@subsection A Completion Example @kindex TAB @findex minibuffer-complete - A concrete example may help here. If you type @kbd{M-x au @key{TAB}}, -the @key{TAB} looks for alternatives (in this case, command names) that -start with @samp{au}. There are several, including -@code{auto-fill-mode} and @code{auto-save-mode}---but they are all the -same as far as @code{auto}, so the @samp{au} in the minibuffer changes -to @samp{auto}. + Consider the following example. If you type @kbd{Meta-x au @key{TAB}}, +@key{TAB} looks for alternatives (in this case, command names) that +start with @samp{au}. There are only two commands: @code{auto-fill-mode} and +@code{auto-save-mode}. They are the same as far as @code{auto-}, so the +@samp{au} in the minibuffer changes to @samp{auto-}.@refill - If you type @key{TAB} again immediately, there are multiple -possibilities for the very next character---it could be any of -@samp{c-}---so no more characters are added; instead, @key{TAB} -displays a list of all possible completions in another window. + If you type @key{TAB} again immediately, there are multiple possibilities +for the very next character---it could be @samp{s} or @samp{f}---so no more +characters are added; but a list of all possible completions is displayed +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 -@key{TAB} f @key{TAB}}. Note that @key{TAB} has this effect because in -the minibuffer it is bound to the command @code{minibuffer-complete} -when completion is available. +@code{auto-fill-mode}, so completion inserts the rest of that command. You +now have @samp{auto-fill-mode} in the minibuffer after typing just @kbd{au +@key{TAB} f @key{TAB}}. Note that @key{TAB} has this effect because in the +minibuffer it is bound to the function @code{minibuffer-complete} when +completion is supposed to be done.@refill -@node Completion Commands, Strict Completion, Completion Example, Completion @subsection Completion Commands - Here is a list of the completion commands defined in the minibuffer + Here is a list of all the completion commands defined in the minibuffer when completion is available. @table @kbd @item @key{TAB} -Complete the text in the minibuffer as much as possible +Complete the text in the minibuffer as much as possible @* (@code{minibuffer-complete}). @item @key{SPC} -Complete the minibuffer text, but don't go beyond one word -(@code{minibuffer-complete-word}). +Complete the text in the minibuffer but don't add or fill out more +than one word (@code{minibuffer-complete-word}). @item @key{RET} Submit the text in the minibuffer as the argument, possibly completing first as described below (@code{minibuffer-complete-and-exit}). @@ -268,60 +244,14 @@ @kindex SPC @findex minibuffer-complete-word - @key{SPC} completes much like @key{TAB}, but never goes beyond the -next hyphen or space. If you have @samp{auto-f} in the minibuffer and -type @key{SPC}, it finds that the completion is @samp{auto-fill-mode}, -but it stops completing after @samp{fill-}. This gives -@samp{auto-fill-}. Another @key{SPC} at this point completes all the -way to @samp{auto-fill-mode}. @key{SPC} in the minibuffer when -completion is available runs the command -@code{minibuffer-complete-word}. - - Here are some commands you can use to choose a completion from a -window that displays a list of completions: - -@table @kbd -@findex mouse-choose-completion -@item button2up -Clicking mouse button 2 on a completion in the list of possible -completions chooses that completion (@code{mouse-choose-completion}). -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 -completion that point is in or next to (@code{choose-completion}). To -use this command, you must first switch windows to the window that shows -the list of completions. - -@findex next-list-mode-item -@item @key{RIGHT} -@itemx @key{TAB} -@itemx C-f -Typing the right-arrow key @key{RIGHT}, @key{TAB} or @kbd{C-f} @emph{in -the completion list buffer} moves point to the following completion -(@code{next-list-mode-item}). - -@findex previous-list-mode-item -@item @key{LEFT} -@itemx C-b -Typing the left-arrow key @key{LEFT} or @kbd{C-b} @emph{in the -completion list buffer} moves point toward the beginning of the buffer, -to the previous completion (@code{previous-list-mode-item}). -@end table - -@node Strict Completion, Completion Options, Completion Commands, Completion -@subsection Strict Completion +@key{SPC} completes in a way that is similar to @key{TAB}, but it never +goes beyond the next hyphen or space. If you have @samp{auto-f} in the +minibuffer and type @key{SPC}, it finds that the completion is + @samp{auto-fill-mode}, but it stops completing after @samp{fill-}. +The result is @samp{auto-fill-}. Another @key{SPC} at this point +completes all the way to @samp{auto-fill-mode}. @key{SPC} in the +minibuffer runs the function @code{minibuffer-complete-word} when +completion is available.@refill There are three different ways that @key{RET} can work in completing minibuffers, depending on how the argument will be used. @@ -346,7 +276,7 @@ already exist. @item -@dfn{Permissive} completion is used when any string whatever is +@dfn{Permissive} completion is used when any string is meaningful, and the list of completion alternatives is just a guide. For example, when @kbd{C-x C-f} reads the name of a file to visit, any file name is allowed, in case you want to create a file. In @@ -354,26 +284,21 @@ exactly as given, without completing it. @end itemize - The completion commands display a list of all possible completions in -a window whenever there is more than one possibility for the very next -character. Also, typing @kbd{?} explicitly requests such a list. If -the list of completions is long, you can scroll it with @kbd{C-M-v} -(@pxref{Other Window}). - -@node Completion Options, , Strict Completion, Completion -@subsection Completion Options + The completion commands display a list of all possible completions in a +window whenever there is more than one possibility for the very next +character. Typing @kbd{?} explicitly requests such a list. The +list of completions counts as help text, so @kbd{C-M-v} typed in the +minibuffer scrolls the list. @vindex completion-ignored-extensions When completion is done on file names, certain file names are usually -ignored. The variable @code{completion-ignored-extensions} contains a -list of strings; a file whose name ends in any of those strings is -ignored as a possible completion. The standard value of this variable -has several elements including @code{".o"}, @code{".elc"}, @code{".dvi"} -and @code{"~"}. The effect is that, for example, @samp{foo} can -complete to @samp{foo.c} even though @samp{foo.o} exists as well. -However, if @emph{all} the possible completions end in ``ignored'' -strings, then they are not ignored. Ignored extensions do not apply to -lists of completions---those always mention all possible completions. +ignored. The variable @code{completion-ignored-extensions} contains a list +of strings; a file whose name ends in any of those strings is ignored as a +possible completion. The standard value of this variable has several +elements including @code{".o"}, @code{".elc"}, @code{".dvi"} and @code{"~"}. +The effect is that, for example, @samp{foo} completes to @samp{foo.c} +even though @samp{foo.o} exists as well. If the only possible completions +are files that end in ``ignored'' strings, they are not ignored.@refill @vindex completion-auto-help If a completion command finds the next character is undetermined, it @@ -387,141 +312,47 @@ 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 -@cindex history of minibuffer input - - Every argument that you enter with the minibuffer is saved on a -@dfn{minibuffer history list} so that you can use it again later in -another argument. Special commands load the text of an earlier argument -in the minibuffer. They discard the old minibuffer contents, so you can -think of them as moving through the history of previous arguments. - -@table @kbd -@item @key{UP} -@itemx M-p -Move to the next earlier argument string saved in the minibuffer history -(@code{previous-history-element}). -@item @key{DOWN} -@itemx M-n -Move to the next later argument string saved in the minibuffer history -(@code{next-history-element}). -@item M-r @var{regexp} @key{RET} -Move to an earlier saved argument in the minibuffer history that has a -match for @var{regexp} (@code{previous-matching-history-element}). -@item M-s @var{regexp} @key{RET} -Move to a later saved argument in the minibuffer history that has a -match for @var{regexp} (@code{next-matching-history-element}). -@end table - -@kindex M-p @r{(minibuffer history)} -@kindex M-n @r{(minibuffer history)} -@findex next-history-element -@findex previous-history-element - The simplest way to reuse the saved arguments in the history list is -to move through the history list one element at a time. While in the -minibuffer, use @kbd{M-p} or up-arrow (@code{previous-history-element}) -to ``move to'' the next earlier minibuffer input, and use @kbd{M-n} or -down-arrow (@code{next-history-element}) to ``move to'' the next later -input. - - The previous input that you fetch from the history entirely replaces -the contents of the minibuffer. To use it as the argument, exit the -minibuffer as usual with @key{RET}. You can also edit the text before -you reuse it; this does not change the history element that you -``moved'' to, but your new argument does go at the end of the history -list in its own right. - - For many minibuffer arguments there is a ``default'' value. In some -cases, the minibuffer history commands know the default value. Then you -can insert the default value into the minibuffer as text by using -@kbd{M-n} to move ``into the future'' in the history. - -@findex previous-matching-history-element -@findex next-matching-history-element -@kindex M-r @r{(minibuffer history)} -@kindex M-s @r{(minibuffer history)} - There are also commands to search forward or backward through the -history; they search for history elements that match a regular -expression that you specify with the minibuffer. @kbd{M-r} -(@code{previous-matching-history-element}) searches older elements in -the history, while @kbd{M-s} (@code{next-matching-history-element}) -searches newer elements. By special dispensation, these commands can -use the minibuffer to read their arguments even though you are already -in the minibuffer when you issue them. As with incremental searching, -an uppercase letter in the regular expression makes the search -case-sensitive (@pxref{Search Case}). - - All uses of the minibuffer record your input on a history list, but -there are separate history lists for different kinds of arguments. For -example, there is a list for file names, used by all the commands that -read file names. - - There are several other very specific history lists, including one for -command names read by @kbd{M-x}, one for buffer names, one for arguments -of commands like @code{query-replace}, and one for compilation commands -read by @code{compile}. Finally, there is one ``miscellaneous'' history -list that most minibuffer arguments use. - -@c Do wee need this? -@ignore -@vindex history-length - The variable @code{history-length} specifies the maximum length of a -minibuffer history list; once a list gets that long, the oldest element -is deleted each time an element is added. If the value of -@code{history-length} is @code{t}, though, there is no maximum length -and elements are never deleted. -@end ignore - -@node Repetition, , Minibuffer History, Minibuffer +@node Repetition,, Completion, Minibuffer @section Repeating Minibuffer Commands @cindex command history @cindex history of commands Every command that uses the minibuffer at least once is recorded on a -special history list, together with the values of its arguments, so that -you can repeat the entire command. In particular, every use of -@kbd{M-x} is recorded there, since @kbd{M-x} uses the minibuffer to read -the command name. +special history list, together with the values of the minibuffer arguments, +so that you can repeat the command easily. In particular, every +use of @kbd{Meta-x} is recorded, since @kbd{M-x} uses the minibuffer to +read the command name. @findex list-command-history @c widecommands @table @kbd -@item C-x @key{ESC} @key{ESC} -Re-execute a recent minibuffer command (@code{repeat-complex-command}). +@item C-x @key{ESC} +Re-execute a recent minibuffer command @*(@code{repeat-complex-command}). @item M-p -Within @kbd{C-x @key{ESC} @key{ESC}}, move to previous recorded command +Within @kbd{C-x @key{ESC}}, move to previous recorded command (@code{previous-history-element}). @item M-n -Within @kbd{C-x @key{ESC} @key{ESC}}, move to the next (more recent) -recorded command (@code{next-history-element}). +Within @kbd{C-x @key{ESC}}, move to the next (more recent) recorded +command (@code{next-history-element}).@refill @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. +@kbd{C-x @key{ESC}} can repeat, most recent first.@refill @end table -@kindex C-x ESC ESC +@kindex C-x ESC @findex repeat-complex-command - @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent -minibuffer-using command. With no argument, it repeats the last such -command. A numeric argument specifies which command to repeat; one -means the last one, and larger numbers specify earlier ones. + @kbd{C-x @key{ESC}} is used to re-execute a recent command that used +the minibuffer. With no argument, it repeats the last command. A numeric +argument specifies which command to repeat; 1 means the last one, and +larger numbers specify earlier commands. - @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command -into a Lisp expression and then entering a minibuffer initialized with -the text for that expression. If you type just @key{RET}, the command -is repeated as before. You can also change the command by editing the -Lisp expression. Whatever expression you finally submit is what will be -executed. The repeated command is added to the front of the command -history unless it is identical to the most recently executed command -already there. + @kbd{C-x @key{ESC}} works by turning the previous command into a Lisp +expression and then entering a minibuffer initialized with the text for +that expression. If you type just @key{RET}, the command is repeated as +before. You can also change the command by editing the Lisp expression. +The expression you finally submit will be executed. The repeated +command is added to the front of the command history unless it is +identical to the most recently executed command already there. Even if you don't understand Lisp syntax, it will probably be obvious which command is displayed for repetition. If you do not change the text, @@ -531,17 +362,17 @@ @kindex M-p @findex next-complex-command @findex previous-complex-command - If you are in the minibuffer for @kbd{C-x @key{ESC} @key{ESC}} and the -command shown to you is not the one you want to repeat, you can move -around the list of previous commands using @kbd{M-n} and @kbd{M-p}. -@kbd{M-p} replaces the contents of the minibuffer with the next earlier -recorded command, and @kbd{M-n} replaces it with the next later command. -After finding the desired previous command, you can edit its expression -and then resubmit it by typing @key{RET}. Any editing you have done on -the command to be repeated is lost if you use @kbd{M-n} or @kbd{M-p}. + If you are in the minibuffer for @kbd{C-x @key{ESC}} and the command shown +to you is not the one you want to repeat, you can move around the list of +previous commands using @kbd{M-n} and @kbd{M-p}. @kbd{M-p} replaces the +contents of the minibuffer with the next earlier recorded command, and +@kbd{M-n} replaces it with the next later command. After finding the +desired previous command, you can edit its expression and then +resubmit it by typing @key{RET}. Any editing you have done on the +command to be repeated is lost if you use @kbd{M-n} or @kbd{M-p}. -@kbd{M-n} and @kbd{M-p} are specially defined within @kbd{C-x @key{ESC} -@key{ESC}} to run the commands @code{previous-history-element} and +@kbd{M-n} and @kbd{M-p} are specially defined within @kbd{C-x @key{ESC}} +to run the commands @code{previous-history-element} and @code{next-history-element}. @vindex command-history diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/misc.texi --- a/man/xemacs/misc.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/misc.texi Mon Aug 13 11:20:41 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 init file. @xref{Init File}.@refill +default initializations in your @file{.emacs} 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 init file. @xref{Init File}. +in your @file{.emacs} file. Viper comes with a separate manual that is provided standard with the XEmacs distribution. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/new.texi --- a/man/xemacs/new.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/new.texi Mon Aug 13 11:20:41 2007 +0200 @@ -13,23 +13,21 @@ 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 init file: +line in your @file{.emacs} 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 init file: +this line in your @file{.emacs} file: @example (viper-mode) @end example -@xref{Init File}. @item Earlier versions of Emacs only allowed keybindings to ASCII character @@ -242,8 +240,8 @@ )) (cond ((and (string-match "XEmacs" emacs-version) - (or (> emacs-major-version 19) - (>= emacs-minor-version 12))) + (or (> emacs-major-version 19) + (>= emacs-minor-version 12))) ;; ;; Code which requires XEmacs version 19.12 or newer goes here ;; @@ -256,7 +254,7 @@ )) (cond ((and (not (string-match "Lucid" emacs-version)) - (= emacs-major-version 19)) + (= emacs-major-version 19)) ;; ;; Code specific to FSF Emacs 19 (not XEmacs) goes here ;; @@ -269,9 +267,7 @@ )) @end example -Alternatively, use @file{.xemacs/init.el} for an init file. @xref{Init File}. - -Of particular interest for use in files are: +Of particular interest for use in @file{.emacs} files are: @itemize @bullet @findex add-menu @@ -325,20 +321,20 @@ XEmacs has the following new default function keybindings: @table @kbd -@item @key{HELP} +@item @key{HELP} Same as @kbd{C-h}. -@item @key{UNDO} +@item @key{UNDO} Same as @kbd{M-x undo}. -@item @key{CUT} +@item @key{CUT} Same as the Cut menu item; that is, it copies the selected text to the X Clipboard selection. -@item @key{COPY} +@item @key{COPY} Same as the Copy menu item. -@item @key{PASTE} +@item @key{PASTE} Same as the Paste menu item. @item @key{PGUP} @@ -356,7 +352,7 @@ @item @key{LEFT-ARROW} Same as the function @code{backward-char}. -@item @key{RIGHT-ARROW} +@item @key{RIGHT-ARROW} Same as the function @code{forward-char}. @item @key{UP-ARROW} diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/packages.texi --- a/man/xemacs/packages.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/packages.texi Mon Aug 13 11:20:41 2007 +0200 @@ -6,8 +6,8 @@ The XEmacs 21 distribution comes only with a very basic set of built-in modes and packages. Most of the packages that were part of -the distribution of earlier versions of XEmacs are now available -separately. The installer as well as the user can choose which +the distribution of earlier versions of XEmacs are now separately +available. The installer as well as the user can choose which packages to install; the actual installation process is easy. This gives an installer the ability to tailor an XEmacs installation for local needs with safe removal of unnecessary code. @@ -91,7 +91,7 @@ also listed on the @code{Options} menu under: @example - Options->Customize->Emacs->Packages + Options->Customize->Emacs->Packages @end example However, don't select any of these menu picks unless you actually want @@ -103,7 +103,7 @@ access it via the menus: @example - Options->Manage Packages->List & Install + Options->Manage Packages->List & Install @end example Or, you can get to it via the keyboard: @@ -116,17 +116,6 @@ idea to install all packages and not interfere with the wishes of your users. -If you can't find which package provides the feature you require, try -using the @code{package-get-package-provider} function. Eg., if you know -that you need @code{thingatpt}, type: - -@example -M-x package-get-package-provider RET thingatpt -@end example - -which will return something like (fsf-compat "1.06"). You can the use -one of the methods above for installing the package you want. - @subsection XEmacs and Installing Packages Normally, packages are installed over the network, using EFS @@ -134,15 +123,13 @@ 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 init file: +like the following to your @file{.emacs} 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). @@ -151,7 +138,7 @@ add these directory names to @code{package-get-remote} using: @example - M-x pui-add-install-directory + M-x pui-add-install-directory @end example Note, however, that any directories added using this function are not @@ -167,11 +154,11 @@ browser and installer, using the menu pick: @example - Options->Manage Packages->List & Install + Options->Manage Packages->List & Install @end example or @example - Options->Manage Packages->Using Custom->Select-> ... + Options->Manage Packages->Using Custom->Select-> ... @end example You can also access it using the keyboard: @@ -238,17 +225,17 @@ customize menus, under: @example - Options->Customize->Emacs->Packages-> ... + Options->Customize->Emacs->Packages-> ... @end example or @example - Options->Manage Packages->Using Custom->Select-> ... + Options->Manage Packages->Using Custom->Select-> ... @end example Set their state to on, and then do: @example - Options->Manage Packages->Using Custom->Update Packages + Options->Manage Packages->Using Custom->Update Packages @end example This will automatically retrieve the packages you have selected from the @@ -271,18 +258,13 @@ @subsection Manual Binary Package Installation Pre-compiled, binary packages can be installed in either a system -package directory (this is determined when XEmacs is compiled), or in -one of the following -subdirectories of your @file{$HOME} directory: +package directory (this is determined when XEmacs is compiled), or in a +subdirectory of your @file{$HOME} directory: @example -~/.xemacs/mule-packages -~/.xemacs/xemacs-packages +~/.xemacs/packages @end example -Packages in the former directory will only be found by a Mule-enabled -XEmacs. - XEmacs does not have to be running to install binary packages, although XEmacs will not know about any newly-installed packages until you restart XEmacs. Note, however, that installing a newer version of a @@ -297,13 +279,11 @@ will typically be a gzip'd tarball. @item -Decide where to install the packages: in the system package -directory, or in @file{~/.xemacs/mule-packages} or -@file{~/.xemacs/xemacs-packages}, respectively. If you want to install -the packages in the system package directory, make sure you can write -into that directory. If you want to install in your @file{$HOME} -directory, create the directory, @file{~/.xemacs/mule-packages} or -@file{~/.xemacs/xemacs-packages}, respectively. +Decide where to install the packages: in the system package directory, +or in @file{~/.xemacs/packages}. If you want to install the +packages in the system package directory, make sure you can write into +that directory. If you want to install in your @file{$HOME} directory, +create the directory, @file{~/.xemacs/packages}. @item Next, @code{cd} to the directory under which you want to install the @@ -315,7 +295,7 @@ typically do this using the commands: @example - gunzip < package.tar.gz | tar xvf - + gunzip < package.tar.gz | tar xvf - @end example Above, replace @file{package.tar.gz} with the filename of the @@ -324,7 +304,7 @@ Of course, if you use GNU @code{tar}, you could also use: @example - tar xvzf package.tar.gz + tar xvzf package.tar.gz @end example @comment What about native MS Windows users??? diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/programs.texi --- a/man/xemacs/programs.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/programs.texi Mon Aug 13 11:20:41 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, filling and aligning comments. +* Comments:: Inserting, illing 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. @@ -508,7 +508,7 @@ until the end of the list. @end table -@node C Indent, , Lisp Indent, Grinding +@node C Indent,, Lisp Indent, Grinding @subsection Customizing C Indentation Two variables control which commands perform C indentation and when. @@ -884,7 +884,7 @@ @findex insert-parentheses @findex move-over-close-and-reindent The commands @kbd{M-(} (@code{insert-parentheses}) and @kbd{M-)} -(@code{move-over-close-and-reindent}) are designed to facilitate a style of +(@code{move-over-close-@*and-reindent}) are designed to facilitate a style of editing which keeps parentheses balanced at all times. @kbd{M-(} inserts a pair of parentheses, either together as in @samp{()}, or, if given an argument, around the next several sexps, and leaves point after the open @@ -1012,7 +1012,7 @@ names and positions of the functions (or other named subunits) in each file. Grouping the related files makes it possible to search or replace through all the files with one command. Recording the function names -and positions makes possible the @kbd{M-.} command which finds the +and positions makes possible the @kbd{M-.} command which finds the definition of a function by looking up which of the files it is in. Tags tables are stored in files called @dfn{tags table files}. The @@ -1029,16 +1029,15 @@ recorded is called a @dfn{tag}. @menu -* Tag Syntax:: Tag syntax for various types of code and text files. +* Tag Syntax:: Tag syntax for various types of code and text files. * Create Tags Table:: Creating a tags table with @code{etags}. -* Etags Regexps:: Create arbitrary tags using regular expressions. * Select Tags Table:: How to visit a tags table. -* Find Tag:: Commands to find the definition of a specific tag. +* Find Tag:: Commands to find the definition of a specific tag. * Tags Search:: Using a tags table for searching and replacing. * List Tags:: Listing and finding tags defined in a file. @end menu -@node Tag Syntax, Create Tags Table, Tags, Tags +@node Tag Syntax @subsection Source File Tag Syntax Here is how tag syntax is defined for the most popular languages: @@ -1046,28 +1045,25 @@ @itemize @bullet @item In C code, any C function or typedef is a tag, and so are definitions of -@code{struct}, @code{union} and @code{enum}. You can tag function -declarations and external variables in addition to function definitions -by giving the @samp{--declarations} option to @code{etags}. -@code{#define} macro definitions and @code{enum} constants are also -tags, unless you specify @samp{--no-defines} when making the tags table. -Similarly, global variables are tags, unless you specify -@samp{--no-globals}. Use of @samp{--no-globals} and @samp{--no-defines} -can make the tags table file much smaller. +@code{struct}, @code{union} and @code{enum}. @code{#define} macro +definitions and @code{enum} constants are also tags, unless you specify +@samp{--no-defines} when making the tags table. Similarly, global +variables are tags, unless you specify @samp{--no-globals}. Use of +@samp{--no-globals} and @samp{--no-defines} can make the tags table file +much smaller. @item In C++ code, in addition to all the tag constructs of C code, member functions are also recognized, and optionally member variables if you use the @samp{--members} option. Tags for variables and functions in classes are named @samp{@var{class}::@var{variable}} and -@samp{@var{class}::@var{function}}. @code{operator} functions tags are -named, for example @samp{operator+}. +@samp{@var{class}::@var{function}}. @item In Java code, tags include all the constructs recognized in C++, plus -the @code{interface}, @code{extends} and @code{implements} constructs. -Tags for variables and functions in classes are named -@samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. +the @code{extends} and @code{implements} constructs. Tags for variables +and functions in classes are named @samp{@var{class}.@var{variable}} and +@samp{@var{class}.@var{function}}. @item In La@TeX{} text, the argument of any of the commands @code{\chapter}, @@ -1079,7 +1075,7 @@ Other commands can make tags as well, if you specify them in the environment variable @code{TEXTAGS} before invoking @code{etags}. The value of this environment variable should be a colon-separated list of -command names. For example, +commands names. For example, @example TEXTAGS="def:newcommand:newenvironment" @@ -1105,12 +1101,6 @@ Several other languages are also supported: @itemize @bullet - -@item -In Ada code, functions, procedures, packages, tasks, and types are -tags. Use the @samp{--packages-only} option to create tags for packages -only. - @item In assembler code, labels appearing at the beginning of a line, followed by a colon, are tags. @@ -1121,44 +1111,39 @@ as C code. @item -In Cobol code, tags are paragraph names; that is, any word starting in -column 8 and followed by a period. +In Cobol code, paragraphs names are the tags, i.e. any word starting in +column 8 and followed by a full stop. @item In Erlang code, the tags are the functions, records, and macros defined in the file. @item -In Fortran code, functions, subroutines and blockdata are tags. +In Fortran code, functions and subroutines are tags. @item In Objective C code, tags include Objective C definitions for classes, -class categories, methods, and protocols. +class categories, methods and protocols. @item In Pascal code, the tags are the functions and procedures defined in the file. @item -In Perl code, the tags are the procedures defined by the @code{sub}, -@code{my} and @code{local} keywords. Use @samp{--globals} if you want -to tag global variables. +In Perl code, the tags are the procedures defined by the @code{sub} +keyword. @item In Postscript code, the tags are the functions. @item In Prolog code, a tag name appears at the left margin. - -@item -In Python code, @code{def} or @code{class} at the beginning of a line -generate a tag. @end itemize - You can also generate tags based on regexp matching -(@pxref{Etags Regexps}) to handle other formats and languages. + You can also generate tags based on regexp matching (@pxref{Create +Tags Table}) to handle other formats and languages. -@node Create Tags Table, Etags Regexps, Tag Syntax, Tags +@node Create Tags Table @subsection Creating Tags Tables @cindex @code{etags} program @@ -1177,18 +1162,10 @@ @end example @noindent -The @code{etags} program reads the specified files, and writes a tags -table named @file{TAGS} in the current working directory. You can -intermix compressed and plain text source file names. @code{etags} -knows about the most common compression formats, and does the right -thing. So you can compress all your source files and have @code{etags} -look for compressed versions of its file name arguments, if it does not -find uncompressed versions. Under MS-DOS, @code{etags} also looks for -file names like @samp{mycode.cgz} if it is given @samp{mycode.c} on the -command line and @samp{mycode.c} does not exist. - - @code{etags} recognizes the language used in an input file based on -its file name and contents. You can specify the language with the +The @code{etags} program reads the specified files, and writes a tags table +named @file{TAGS} in the current working directory. @code{etags} +recognizes the language used in an input file based on its file name and +contents. You can specify the language with the @samp{--language=@var{name}} option, described below. If the tags table data become outdated due to changes in the files @@ -1225,7 +1202,7 @@ the tags file will contain absolute file names. This way, the tags file will still refer to the same files even if you move it, as long as the source files remain in the same place. Absolute file names start with -@samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. +@samp{/}, or with @samp{@var{device}:/} on MS-DOS and Windows. When you want to make a tags table from a great number of files, you may have problems listing them on the command line, because some systems @@ -1233,9 +1210,9 @@ is to tell @code{etags} to read the file names from its standard input, by typing a dash in place of the file names, like this: -@smallexample +@example find . -name "*.[chCH]" -print | etags - -@end smallexample +@end example Use the option @samp{--language=@var{name}} to specify the language explicitly. You can intermix these options with file names; each one @@ -1243,25 +1220,18 @@ @samp{--language=auto} to tell @code{etags} to resume guessing the language from the file names and file contents. Specify @samp{--language=none} to turn off language-specific processing -entirely; then @code{etags} recognizes tags by regexp matching alone -(@pxref{Etags Regexps}). - - @samp{etags --help} prints the list of the languages @code{etags} -knows, and the file name rules for guessing the language. It also prints -a list of all the available @code{etags} options, together with a short -explanation. - -@node Etags Regexps, Select Tags Table, Create Tags Table, Tags -@subsection Etags Regexps +entirely; then @code{etags} recognizes tags by regexp matching alone. +@samp{etags --help} prints the list of the languages @code{etags} knows, +and the file name rules for guessing the language. The @samp{--regex} option provides a general way of recognizing tags based on regexp matching. You can freely intermix it with file names. Each @samp{--regex} option adds to the preceding ones, and applies only to the following files. The syntax is: -@smallexample +@example --regex=/@var{tagregexp}[/@var{nameregexp}]/ -@end smallexample +@end example @noindent where @var{tagregexp} is used to match the lines to tag. It is always @@ -1281,25 +1251,18 @@ You should not match more characters with @var{tagregexp} than that needed to recognize what you want to tag. If the match is such that -more characters than needed are unavoidably matched by @var{tagregexp} -(as will usually be the case), you should add a @var{nameregexp}, to -pick out just the tag. This will enable Emacs to find tags more -accurately and to do completion on tag names more reliably. You can -find some examples below. - - The option @samp{--ignore-case-regex} (or @samp{-c}) is like -@samp{--regex}, except that the regular expression provided will be -matched without regard to case, which is appropriate for various -programming languages. +more characters than needed are unavoidably matched by @var{tagregexp}, +you may find useful to add a @var{nameregexp}, in order to narrow the tag +scope. You can find some examples below. The @samp{-R} option deletes all the regexps defined with @samp{--regex} options. It applies to the file names following it, as you can see from the following example: -@smallexample +@example etags --regex=/@var{reg1}/ voo.doo --regex=/@var{reg2}/ \ bar.ber -R --lang=lisp los.er -@end smallexample +@end example @noindent Here @code{etags} chooses the parsing language for @file{voo.doo} and @@ -1309,90 +1272,38 @@ @file{bar.ber}. @code{etags} uses the Lisp tags rules, and no regexp matching, to recognize tags in @file{los.er}. - A regular expression can be bound to a given language, by prepending -it with @samp{@{lang@}}. When you do this, @code{etags} will use the -regular expression only for files of that language. @samp{etags --help} -prints the list of languages recognised by @code{etags}. The following -example tags the @code{DEFVAR} macros in the Emacs source files. -@code{etags} applies this regular expression to C files only: - -@smallexample ---regex='@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/' -@end smallexample - -@noindent -This feature is particularly useful when storing a list of regular -expressions in a file. The following option syntax instructs -@code{etags} to read two files of regular expressions. The regular -expressions contained in the second file are matched without regard to -case. - -@smallexample ---regex=@@first-file --ignore-case-regex=@@second-file -@end smallexample - -@noindent -A regex file contains one regular expressions per line. Empty lines, -and lines beginning with space or tab are ignored. When the first -character in a line is @samp{@@}, @code{etags} assumes that the rest of -the line is the name of a file of regular expressions. This means that -such files can be nested. All the other lines are taken to be regular -expressions. For example, one can create a file called -@samp{emacs.tags} with the following contents (the first line in the -file is a comment): - -@smallexample - -- This is for GNU Emacs source files -@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/\1/ -@end smallexample - -@noindent -and then use it like this: - -@smallexample -etags --regex=@@emacs.tags *.[ch] */*.[ch] -@end smallexample - Here are some more examples. The regexps are quoted to protect them from shell interpretation. -@itemize @bullet - -@item -Tag Octave files: +@noindent +Tag the @code{DEFVAR} macros in the emacs source files: -@smallexample -etags --language=none \ - --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \ - --regex='/###key \(.*\)/\1/' \ - --regex='/[ \t]*global[ \t].*/' \ - *.m -@end smallexample +@example +--regex='/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/' +@end example @noindent -Note that tags are not generated for scripts so that you have to add a -line by yourself of the form `###key <script-name>' if you want to jump -to it. - -@item -Tag Tcl files: +Tag VHDL files (this example is a single long line, broken here for +formatting reasons): -@smallexample -etags --language=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' *.tcl -@end smallexample - -@item -Tag VHDL files: - -@smallexample ---language=none \ ---regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' \ +@example +--language=none +--regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\ \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/' -@end smallexample -@end itemize +@end example + +@noindent +Tag TCL files (this last example shows the usage of a @var{nameregexp}): -@node Select Tags Table, Find Tag, Etags Regexps, Tags +@example +--lang=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' +@end example + + For a list of the other available @code{etags} options, execute +@code{etags --help}. + +@node Select Tags Table, Find Tag, Create Tags Table, Tags @subsection Selecting a Tags Table @vindex tag-table-alist @@ -1424,11 +1335,11 @@ @example (setq tag-table-alist - '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/") - ("\\.el$" . "/usr/local/emacs/src/") - ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/") - ("" . "/usr/local/emacs/src/") - )) + '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/") + ("\\.el$" . "/usr/local/emacs/src/") + ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/") + ("" . "/usr/local/emacs/src/") + )) @end example The example defines the tags table alist in the following way: @@ -1540,15 +1451,15 @@ @table @kbd @item tag-table-alist Controls which tables apply to which buffers. -@item tags-file-name +@item tags-file-name Stores a default tags table. -@item tags-build-completion-table +@item tags-build-completion-table Controls completion behavior. -@item buffer-tag-table +@item buffer-tag-table Specifies a buffer-local table. -@item make-tags-files-invisible +@item make-tags-files-invisible Sets whether tags tables should be very hidden. -@item tag-mark-stack-max +@item tag-mark-stack-max Specifies how many tags-based hops to remember. @end table @@ -1644,7 +1555,7 @@ Visit the next file in the selected tags table. @end table -@node List Tags, , Tags Search, Tags +@node List Tags,, Tags Search, Tags @subsection Tags Table Inquiries @table @kbd @@ -1829,7 +1740,7 @@ retain its meaning when reindented even if the conventions are not followed. -@node ForIndent Vars, , ForIndent Conv, Fortran Indent +@node ForIndent Vars,, ForIndent Conv, Fortran Indent @subsubsection Variables for Fortran Indentation @vindex fortran-do-indent @@ -1986,7 +1897,7 @@ columns wide. When you edit in this window, you can immediately see when a line gets too wide to be correct Fortran. -@node Fortran Abbrev, , Fortran Columns, Fortran +@node Fortran Abbrev,, Fortran Columns, Fortran @subsection Fortran Keyword Abbrevs Fortran mode provides many built-in abbrevs for common keywords and @@ -2006,7 +1917,7 @@ Type @samp{;?} or @samp{;C-h} to display a list of all built-in Fortran abbrevs and what they stand for. -@node Asm Mode, , Fortran, Programs +@node Asm Mode,, Fortran, Programs @section Asm Mode @cindex Asm mode diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/regs.texi --- a/man/xemacs/regs.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/regs.texi Mon Aug 13 11:20:41 2007 +0200 @@ -3,20 +3,22 @@ @chapter Registers @cindex registers - XEmacs @dfn{registers} are places in which you can save text or -positions for later use. Once you save text or a rectangle in a -register, you can copy it into the buffer once or many times; a position -saved in a register is used by moving point to that position. -Rectangles can also be copied into and out of registers -(@pxref{Rectangles}). + Emacs @dfn{registers} are places in which you can save text or +positions for later use. Text saved in a register can be copied into +the buffer once or many times; a position saved in a register is used by +moving point to that position. Rectangles can also be copied into and +out of registers (@pxref{Rectangles}). -@findex view-register - Each register has a name which is a single character. A register can -store a piece of text, a rectangle, a position, a window configuration, -or a file name, but only one thing at any given time. Whatever you -store in a register remains there until you store something else in that -register. To see what a register @var{r} contains, use @kbd{M-x -view-register}. + Each register has a name, which is a single character. A register can +store either a piece of text, a position, or a rectangle, but only one +thing at any given time. Whatever you store in a register remains +there until you store something else in that register. + +@menu +* RegPos:: Saving positions in registers. +* RegText:: Saving text in registers. +* RegRect:: Saving rectangles in registers. +@end menu @table @kbd @item M-x view-register @key{RET} @var{r} @@ -27,49 +29,34 @@ @kbd{M-x view-register} reads a register name as an argument and then displays the contents of the specified register. -@menu -* 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. -@end menu - @node RegPos, RegText, Registers, Registers @section Saving Positions in Registers - Saving a position records a place in a buffer so that you can move -back there later. Moving to a saved position switches to that buffer -and moves point to that place in it. + Saving a position records a spot in a buffer so you can move +back there later. Moving to a saved position re-selects the buffer +and moves point to the spot. @table @kbd -@item C-x r @key{SPC} @var{r} -Save position of point in register @var{r} (@code{point-to-register}). +@item C-x r SPC @var{r} +Save the location of point in register @var{r} (@code{point-to-register}). @item C-x r j @var{r} -Jump to the position saved in register @var{r} (@code{jump-to-register}). +Jump to the location saved in register @var{r} (@code{register-to-point}). @end table @kindex C-x r SPC @findex point-to-register - To save the current position of point in a register, choose a name -@var{r} and type @kbd{C-x r @key{SPC} @var{r}}. The register @var{r} -retains the position thus saved until you store something else in that -register. + To save the current location of point in a register, choose a name +@var{r} and type @kbd{C-x r SPC @var{r}}. The register @var{r} retains +the location thus saved until you store something else in that +register.@refill @kindex C-x r j -@findex jump-to-register - The command @kbd{C-x r j @var{r}} moves point to the position recorded +@findex register-to-point + The command @kbd{C-x r j @var{r}} moves point to the location recorded in register @var{r}. The register is not affected; it continues to record the same location. You can jump to the same position using the same register as often as you want. - If you use @kbd{C-x r j} to go to a saved position, but the buffer it -was saved from has been killed, @kbd{C-x r j} tries to create the buffer -again by visiting the same file. Of course, this works only for buffers -that were visiting files. - @node RegText, RegRect, RegPos, Registers @section Saving Text in Registers @@ -78,234 +65,46 @@ the piece of text further down on the ring. It becomes hard to keep track of the argument needed to retrieve the same text with @kbd{C-y}. An alternative is to store the text in a register with @kbd{C-x r s} -(@code{copy-to-register}) and then retrieve it with @kbd{C-x r i} +(@code{copy-to-register}) and then retrieve it with @kbd{C-x r g} (@code{insert-register}). @table @kbd @item C-x r s @var{r} Copy region into register @var{r} (@code{copy-to-register}). @item C-x r g @var{r} -@itemx C-x r i @var{r} Insert text contents of register @var{r} (@code{insert-register}). @end table @kindex C-x r s @kindex C-x r g -@kindex C-x r i @findex copy-to-register @findex insert-register @kbd{C-x r s @var{r}} stores a copy of the text of the region into the -register named @var{r}. Given a numeric argument, @kbd{C-x r s @var{r}} -deletes the text from the buffer as well. +register named @var{r}. Given a numeric argument, @kbd{C-x r s} deletes the +text from the buffer as well. - @kbd{C-x r i @var{r}} inserts the text from register @var{r} in the buffer. -By default it leaves point before the text and places the mark after -it. With a numeric argument (@kbd{C-u}), it puts point after the text -and the mark before it. + @kbd{C-x r g @var{r}} inserts the text from register @var{r} in the buffer. +By default it leaves point before the text and places the mark after it. +With a numeric argument, it puts point after the text and the mark +before it. -@node RegRect, RegConfig, RegText, Registers +@node RegRect,, RegText, Registers @section Saving Rectangles in Registers @cindex rectangle +@findex copy-region-to-rectangle A register can contain a rectangle instead of lines of text. The rectangle is represented as a list of strings. @xref{Rectangles}, for basic information on rectangles and how to specify rectangles in a buffer. @table @kbd -@findex copy-rectangle-to-register -@kindex C-x r r @item C-x r r @var{r} -Copy the region-rectangle into register @var{r} -(@code{copy-rectangle-to-register}). With a numeric argument, delete it -as well. +Copy the region-rectangle into register @var{r}(@code{copy-rectangle-to-register}). +With a numeric argument, delete it as well. @item C-x r g @var{r} -@itemx C-x r i @var{r} Insert the rectangle stored in register @var{r} (if it contains a rectangle) (@code{insert-register}). @end table - The @kbd{C-x r i @var{r}} command inserts linear text if the register - contains + The @kbd{C-x r g} command inserts linear text if the register contains that, or inserts a rectangle if the register contains one. - - See also the command @code{sort-columns}, which you can think of -as sorting a rectangle. @xref{Sorting}. - -@node RegConfig, RegNumbers, RegRect, Registers -@section Saving Window Configurations in Registers - -@findex window-configuration-to-register -@findex frame-configuration-to-register -@kindex C-x r w -@c @kindex C-x r f - You can save the window configuration of the selected frame in a -register, or even the configuration of all windows in all frames, and -restore the configuration later. - -@table @kbd -@item C-x r w @var{r} -Save the state of the selected frame's windows in register @var{r} -(@code{window-configuration-to-register}). -@c @item C-x r f @var{r} -@item M-x frame-configuration-to-register @key{RET} @var{r} -Save the state of all frames, including all their windows, in register -@var{r} (@code{frame-configuration-to-register}). -@end table - - Use @kbd{C-x r j @var{r}} to restore a window or frame configuration. -This is the same command used to restore a cursor position. When you -restore a frame configuration, any existing frames not included in the -configuration become invisible. If you wish to delete these frames -instead, use @kbd{C-u C-x r j @var{r}}. - -@node RegNumbers, RegFiles, RegConfig, Registers -@section Keeping Numbers in Registers - - There are commands to store a number in a register, to insert -the number in the buffer in decimal, and to increment it. These commands -can be useful in keyboard macros (@pxref{Keyboard Macros}). - -@table @kbd -@item C-u @var{number} C-x r n @var{reg} -@kindex C-x r n -@findex number-to-register -Store @var{number} into register @var{reg} (@code{number-to-register}). -@item C-u @var{number} C-x r + @var{reg} -@kindex C-x r + -@findex increment-register -Increment the number in register @var{reg} by @var{number} -(@code{increment-register}). -@item C-x r g @var{reg} -Insert the number from register @var{reg} into the buffer. -@end table - - @kbd{C-x r g} is the same command used to insert any other -sort of register contents into the buffer. - -@node RegFiles, Bookmarks, RegNumbers, Registers -@section Keeping File Names in Registers - - If you visit certain file names frequently, you can visit them more -conveniently if you put their names in registers. Here's the Lisp code -used to put a file name in a register: - -@smallexample -(set-register ?@var{r} '(file . @var{name})) -@end smallexample - -@need 3000 -@noindent -For example, - -@smallexample -(set-register ?z '(file . "/usr/src/xemacs/src/ChangeLog")) -@end smallexample - -@noindent -puts the file name shown in register @samp{z}. - - To visit the file whose name is in register @var{r}, type @kbd{C-x r j -@var{r}}. (This is the same command used to jump to a position or -restore a frame configuration.) - -@node Bookmarks, , RegFiles, Registers -@section Bookmarks -@cindex bookmarks - - @dfn{Bookmarks} are somewhat like registers in that they record -positions you can jump to. Unlike registers, they have long names, and -they persist automatically from one Emacs session to the next. The -prototypical use of bookmarks is to record ``where you were reading'' in -various files. - - Note: bookmark.el is distributed in edit-utils package. You need to -install that to use bookmark facility (@pxref{Packages}). - -@table @kbd -@item C-x r m @key{RET} -Set the bookmark for the visited file, at point. - -@item C-x r m @var{bookmark} @key{RET} -@findex bookmark-set -Set the bookmark named @var{bookmark} at point (@code{bookmark-set}). - -@item C-x r b @var{bookmark} @key{RET} -@findex bookmark-jump -Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}). - -@item C-x r l -@findex list-bookmarks -List all bookmarks (@code{list-bookmarks}). - -@item M-x bookmark-save -@findex bookmark-save -Save all the current bookmark values in the default bookmark file. -@end table - -@kindex C-x r m -@findex bookmark-set -@kindex C-x r b -@findex bookmark-jump - The prototypical use for bookmarks is to record one current position -in each of several files. So the command @kbd{C-x r m}, which sets a -bookmark, uses the visited file name as the default for the bookmark -name. If you name each bookmark after the file it points to, then you -can conveniently revisit any of those files with @kbd{C-x r b}, and move -to the position of the bookmark at the same time. - -@kindex C-x r l - To display a list of all your bookmarks in a separate buffer, type -@kbd{C-x r l} (@code{list-bookmarks}). If you switch to that buffer, -you can use it to edit your bookmark definitions or annotate the -bookmarks. Type @kbd{C-h m} in that buffer for more information about -its special editing commands. - - When you kill XEmacs, XEmacs offers to save your bookmark values in -your default bookmark file, @file{~/.emacs.bmk}, if you have changed any -bookmark values. You can also save the bookmarks at any time with the -@kbd{M-x bookmark-save} command. The bookmark commands load your -default bookmark file automatically. This saving and loading is how -bookmarks persist from one XEmacs session to the next. - -@vindex bookmark-save-flag - If you set the variable @code{bookmark-save-flag} to 1, then each -command that sets a bookmark will also save your bookmarks; this way, -you don't lose any bookmark values even if XEmacs crashes. (The value, -if a number, says how many bookmark modifications should go by between -saving.) - -@vindex bookmark-search-size - Bookmark position values are saved with surrounding context, so that -@code{bookmark-jump} can find the proper position even if the file is -modified slightly. The variable @code{bookmark-search-size} says how -many characters of context to record, on each side of the bookmark's -position. - - Here are some additional commands for working with bookmarks: - -@table @kbd -@item M-x bookmark-load @key{RET} @var{filename} @key{RET} -@findex bookmark-load -Load a file named @var{filename} that contains a list of bookmark -values. You can use this command, as well as @code{bookmark-write}, to -work with other files of bookmark values in addition to your default -bookmark file. - -@item M-x bookmark-write @key{RET} @var{filename} @key{RET} -@findex bookmark-write -Save all the current bookmark values in the file @var{filename}. - -@item M-x bookmark-delete @key{RET} @var{bookmark} @key{RET} -@findex bookmark-delete -Delete the bookmark named @var{bookmark}. - -@item M-x bookmark-insert-location @key{RET} @var{bookmark} @key{RET} -@findex bookmark-insert-location -Insert in the buffer the name of the file that bookmark @var{bookmark} -points to. - -@item M-x bookmark-insert @key{RET} @var{bookmark} @key{RET} -@findex bookmark-insert -Insert in the buffer the @emph{contents} of the file that bookmark -@var{bookmark} points to. -@end table diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/search.texi --- a/man/xemacs/search.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/search.texi Mon Aug 13 11:20:41 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 occurence of it. To move to the next occurrence +looking for a different occurance 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}. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/sending.texi --- a/man/xemacs/sending.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/sending.texi Mon Aug 13 11:20:41 2007 +0200 @@ -174,7 +174,7 @@ In this version of Emacs, what you see is what you get: in contrast to some other versions, no abbreviations are expanded after you have sent the mail. This means you don't suffer the annoyance of having the system do -things behind your back---if the system rewrites an address you typed, +things behind your back --- if the system rewrites an address you typed, you know it immediately, instead of after the mail has been sent and it's too late to do anything about it. For example, you will never again be in trouble because you forgot to delete an old alias from your @@ -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-separator-string +@vindex mail-alias-seperator-string If you want multiple addresses separated by a string other than @samp{,} -(a comma), then set the variable @code{mail-alias-separator-string} to +(a comma), then set the variable @code{mail-alias-seperator-string} to it. This has to be a comma bracketed by whitespace if you want any kind of reasonable behavior. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/startup.texi --- a/man/xemacs/startup.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/startup.texi Mon Aug 13 11:20:41 2007 +0200 @@ -63,9 +63,8 @@ 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 -subdirectory @file{.xemacs/xemacs-packages} of the user's home -directory. +By default, XEmacs expects an early package hierarchy in the a +subdirectory @file{.xemacs} of the user's home directory. Moreover, XEmacs expects late hierarchies in the subdirectories @file{site-packages}, @file{mule-packages}, and @file{xemacs-packages} @@ -78,7 +77,7 @@ 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 with the 20.4 package hierarchy as a last +possible to run XEmacs 21.0 with the 20.4 package hierarchy as a last hierarchy. It is possible to specify at configure-time the location of the various @@ -90,7 +89,7 @@ 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. +@code{PACKAGEPATH} 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 @@ -159,6 +158,16 @@ @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 12e008d41344 -r 697ef44129c6 man/xemacs/trouble.texi --- a/man/xemacs/trouble.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/trouble.texi Mon Aug 13 11:20:41 2007 +0200 @@ -332,13 +332,12 @@ it happen again, you can report at least that. Check whether any programs you have loaded into the Lisp world, including -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. +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. 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 @@ -379,15 +378,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 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 +@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 The newsgroup @samp{comp.emacs.xemacs} may be used for bug reports, other discussions and requests for assistance. diff -r 12e008d41344 -r 697ef44129c6 man/xemacs/xemacs.texi --- a/man/xemacs/xemacs.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/xemacs/xemacs.texi Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,5 @@ -\input texinfo @c -*-texinfo-*- + +\input ../texinfo @c -*-texinfo-*- @setfilename ../../info/xemacs.info @comment node-name, next, previous, up @@ -90,8 +91,9 @@ @page @ifinfo @node Top, License,, (dir) -@top The XEmacs Editor +The XEmacs Editor +***************** XEmacs is the extensible, customizable, self-documenting real-time display editor. This Info file describes how to edit with Emacs @@ -271,13 +273,9 @@ 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. +* RegPos:: Saving positions in registers. +* RegText:: Saving text in registers. +* RegRect:: Saving rectangles in registers. Controlling the Display @@ -551,7 +549,8 @@ 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 init file. +* Init File:: How to write common customizations in the @file{.emacs} + 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 @@ -585,7 +584,7 @@ * Entry: Syntax Entry. What the syntax table records for each character. * Change: Syntax Change. How to change the information. -The Init File +The Init File, @file{~/.emacs} * Init Syntax:: Syntax of constants in Emacs Lisp. * Init Examples:: How to do some things with an init file. diff -r 12e008d41344 -r 697ef44129c6 modules/base64/.cvsignore --- a/modules/base64/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -*.ell -*_i.c diff -r 12e008d41344 -r 697ef44129c6 modules/base64/Makefile --- a/modules/base64/Makefile Mon Aug 13 11:19:22 2007 +0200 +++ b/modules/base64/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,5 @@ # +# 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 @@ -7,8 +8,6 @@ # 'installed'. # -SHELL=/bin/sh -RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -26,10 +25,8 @@ all: $(MODNAME).ell -distclean: clean - clean: - $(RM) $(MODNAME).ell $(OBJS) base64_i.o base64_i.c + rm -f $(MODNAME).ell $(OBJS) base64_i.o base64_i.c $(MODNAME).ell: $(OBJS) base64_i.o $(LD) --mod-output=$@ $(OBJS) base64_i.o diff -r 12e008d41344 -r 697ef44129c6 modules/ldap/.cvsignore --- a/modules/ldap/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -*.ell -*_i.c diff -r 12e008d41344 -r 697ef44129c6 modules/ldap/Makefile --- a/modules/ldap/Makefile Mon Aug 13 11:19:22 2007 +0200 +++ b/modules/ldap/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,5 @@ # +# 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 @@ -7,8 +8,6 @@ # 'installed'. # -SHELL=/bin/sh -RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -26,10 +25,8 @@ all: $(MODNAME).ell -distclean: clean - clean: - $(RM) $(MODNAME).ell $(OBJS) eldap_i.o eldap_i.c + rm -f $(MODNAME).ell $(OBJS) eldap_i.o eldap_i.c $(MODNAME).ell: $(OBJS) eldap_i.o $(LD) --mod-output=$@ $(OBJS) eldap_i.o diff -r 12e008d41344 -r 697ef44129c6 modules/sample/.cvsignore --- a/modules/sample/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -*.ell -*_i.c diff -r 12e008d41344 -r 697ef44129c6 modules/sample/Makefile --- a/modules/sample/Makefile Mon Aug 13 11:19:22 2007 +0200 +++ b/modules/sample/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -8,8 +8,6 @@ # 'installed'. # -SHELL=/bin/sh -RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -27,10 +25,8 @@ all: $(MODNAME).ell -distclean: clean - clean: - $(RM) $(MODNAME).ell $(OBJS) sample_i.o sample_i.c + rm -f $(MODNAME).ell $(OBJS) sample_i.o sample_i.c $(MODNAME).ell: $(OBJS) sample_i.o $(LD) --mod-output=$@ $(OBJS) sample_i.o diff -r 12e008d41344 -r 697ef44129c6 modules/zlib/.cvsignore --- a/modules/zlib/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -*.ell -*_i.c \ No newline at end of file diff -r 12e008d41344 -r 697ef44129c6 modules/zlib/Makefile --- a/modules/zlib/Makefile Mon Aug 13 11:19:22 2007 +0200 +++ b/modules/zlib/Makefile Mon Aug 13 11:20:41 2007 +0200 @@ -8,8 +8,6 @@ # 'installed'. # -SHELL=/bin/sh -RM=rm -f CC=../../lib-src/ellcc CFLAGS=-I. -I../../src LD=$(CC) --mode=link @@ -27,10 +25,8 @@ all: $(MODNAME).ell -distclean: clean - clean: - $(RM) $(MODNAME).ell $(OBJS) zlib_i.o zlib_i.c + rm -f $(MODNAME).ell $(OBJS) zlib_i.o zlib_i.c $(MODNAME).ell: $(OBJS) zlib_i.o $(LD) --mod-output=$@ $(OBJS) zlib_i.o diff -r 12e008d41344 -r 697ef44129c6 nt/.cvsignore --- a/nt/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -config.inc -xemacs.ncb -xemacs.opt -xemacs.plg diff -r 12e008d41344 -r 697ef44129c6 nt/ChangeLog --- a/nt/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,439 +1,3 @@ -2000-07-19 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.35 is released. - -2000-07-14 IKEYAMA Tomonori <tomonori@suiyokai.org> - - * config.h: Import C++ compilation stuff from src/config.h. - -2000-07-05 Craig Lanning <lanning@scra.org> - - * xemacs.rc: Uppercase the id's so that windres will work. - -2000-07-05 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * xemacs.mak (TEMACS_LIBS): Added comdlg32.lib - -2000-06-12 Ben Wing <ben@xemacs.org> - - * config.h (ENCAPSULATE_STAT): - Always encapsulate stat/fstat. Also suggested by Mike Alexander - <mike.alexander@xemacs.org>. - -2000-06-10 Ben Wing <ben@xemacs.org> - - * 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 <ben@xemacs.org> - - * runemacs.c: Removed. No longer necessary. - - * Makefile.cygwin: Removed. - - * inc\*: Removed. At long-fucking-last! - -2000-05-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.34 is released. - -2000-05-12 Craig Lanning <CraigL@DyCon.com> - - * inc\sys\socket.h: Don't define timeval as ws_timeval for mingw32 - -2000-05-01 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.33 is released. - -2000-04-27 Ben Wing <ben@xemacs.org> - - * xemacs.mak: combine auto-autoloads.el and custom.el update into - one call to xemacs. - -2000-04-26 Ben Wing <ben@xemacs.org> - - * xemacs.mak: put in support for QUICK_BUILD. - - * config.inc.samp: put in an entry for QUICK_BUILD. - -2000-04-23 Ben Wing <ben@xemacs.org> - - * 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 <kkm@dtmx.com> - - * xemacs.mak: Build the i utility and use it to pipe windowed - [xt]emacs output to the build console. - -2000-03-25 Didier Verna <didier@xemacs.org> - - * config.h: handle the renaming of `foo_h_path' to `foo_h_file'. - -2000-03-22 Mike Alexander <mta@arbortext.com> - - * 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 <jhar@tardis.ed.ac.uk> - - * .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 <ben@xemacs.org> - - * README: Substantial rewrite. - * xemacs.mak: Pdump fix. (not working yet, though) - -2000-03-20 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.32 is released. - -2000-03-15 Mike Alexander <mta@arbortext.com> - - * xemacs.mak: Fix for generation of $(XEMACS)\Installation. - -2000-03-14 Adrian Aichner <adrain@xemacs.org> - - * xemacs.mak (LIB_SRC_TOOLS): LIB_SRC_TOOLS depend on - XEMACS_INCLUDES when we USE_PORTABLE_DUMPER. - -2000-03-13 Ben Wing <ben@xemacs.org> - - * xemacs.mak (TEMACS_ENTRYPOINT): - Fix for portable dumper. - -2000-03-12 Ben Wing <ben@xemacs.org> - - * 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 <andy@xemacs.org> - - * PROBLEMS: Doc fix from Reini Urban <rurban@x-ray.at>. - -2000-02-27 Mike Alexander <mta@arbortext.com> - - * 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 <jhar@tardis.ed.ac.uk> - - * xemacs.mak (TEMACS_LIBS): Add ole32.lib and uuid.lib. - (installation): Always regenerate installation report. - -2000-02-25 Craig Lanning <CraigL@DyCon.com> - - * inc\sys\time.h: MinGW defines struct timeval in <winsock.h>. - -2000-02-24 Martin Buchholz <martin@xemacs.org> - - * config.h (INLINE_HEADER): Define properly (?) for Windows. - -2000-02-23 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.31 is released. - -2000-02-22 Martin Buchholz <martin@xemacs.org> - - * config.h (gc_checking_assert): New. - -2000-02-21 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.30 is released. - -2000-02-21 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * README: Tidy up. - Document need for makeinfo program or texinfo package. - - * Xmd.patch: New file, previously in README. - -2000-02-17 Martin Buchholz <martin@xemacs.org> - - * config.h: Delete unused HAVE_LINUX_VERSION_H. - -2000-02-16 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.29 is released. - -2000-02-06 Mike Alexander <mta@arbortext.com> - - * xemacs.mak (install): Copy xemacs.dmp if using the portable - dumper. - -2000-02-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.28 is released. - -2000-02-03 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * Xpm.def: New file, required to build Xpm.dll. - - * Xpm.mak: Use DEBUG instead of DEBUG_XEMACS - this library is not - xemacs-specific. Initialize to DEBUG_XEMACS if specified for - compatibility. - Build DLL instead of static LIB when USE_CRTDLL=1 is given to - make. - - * xemacs.mak: Introduced USE_SYSTEM_MALLOC and USE_CRTDLL. - Do not build lastfile.lib when neither unexec not gmalloc are - used. - - * config.h: Deleted GNU_MALLOC and SYSTEM_MALLOC, as they are set - in makefile. - -2000-01-26 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * xemacs.mak (DOC_SRC9): Added tests.c ... - (TEMACS_DEBUG_OBJS): ... and tests.obj - ($(DOC)): Tweaked a bit, for `nmake docfile' unconditionally - rebuild the docfile. - -2000-01-22 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * xemacs.mak (docfile): Added shortcut target. - -2000-01-19 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * xemacs.mak (TEMACS_LIBS): Added winspool.lib - -2000-01-20 Martin Buchholz <martin@xemacs.org> - - * xemacs.mak (dump-xemacs): Remove redundant EMACSBOOTSTRAPMODULEPATH. - -2000-01-18 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * xemacs.mak: Patch of 01/13 got in corrupted, fixed. - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.27 is released. - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * minitar.c: Errno.h --> errno.h. Remove errno declaration. - -2000-01-13 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * xemacs.mak: Added USE_PORTABLE_DUMPER make command line macro. - (temacs:) Added dependency for lastfile.lib so that 'make temacs' - builds it first. - -1999-12-28 Scott Blachowicz <Scott.Blachowicz@seaslug.org> - - * minitar.mak: Add vars to allow building from main xemacs.mak. - - * xemacs.mak: Add rules to build & install minitar. - -2000-01-03 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * config.h: Fix stuff related to mail locking. - -1999-12-31 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.26 is released. - -1999-12-24 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.25 is released. - -1999-12-15 Scott Blachowicz <Scott.Blachowicz@seaslug.org> - - * minitar.c (main): Add explicit exit(0) to get successful return - code. - -1999-12-14 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.24 is released. - -1999-11-28 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak (depend): Only update `depend' if there were changes. - Use "perl ./make-src-depend" instead of "mkdepend". - -1999-12-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.23 is released. - -1999-11-27 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak (SRCDIR): Make path to xemacs absolute to - facilitate building info in man subdirs. Echo all cd commands, - not just some of them. - - (makeinfo-test): Test for availability of `texinfo' package to - build info. Recommend use of external `makeinfo' program for - building info docs faster. - - (info): cd into man subdirs to support use of external `makeinfo' - program. - -1999-11-17 Martin Buchholz <martin@xemacs.org> - - * xemacs.mak: Remove references to index.unperm, index.perm. - Fix dependencies. - Shouldn't .obj and .info be in SUFFIXES? - Remove extra `\'. - -1999-11-29 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.21 is released. - -1999-11-10 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.20 is released - -1999-10-07 Norbert Koch <n.koch@eai-delta.de> - - * xemacs.mak: Ignore return code of 'del' calls. Use a make - variable for 'del'. - -1999-09-26 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak (all): Update $(LISP)/auto-autoloads.elc? and - $(LISP)/custom-load.el using XEmacs itself, like xemacs-packages - do. - ($(LISP)\auto-autoloads.el): Add new rule. - ($(LISP)\custom-load.el): Ditto. - -1999-08-04 Andy Piper <andy@xemacs.org> - - * xemacs.mak (HAVE_WIDGETS): add define to appropriate places. - -1999-07-26 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak ($(MANDIR)\lispref\lispref.texi): Replace bad - dependency. - -1999-07-30 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.19 is released - -1999-07-10 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak (.SUFFIXES): Add .texi. - (check): Improve automated test section. - (info): Generate info files using XEmacs (no makeinfo.exe needed). - -1999-07-19 Andy Piper <andy@xemacs.org> - - * xemacs.mak (DOC_SRC3): add gutter.c - (TEMACS_OBJS): add gutter.obj. - -1999-07-13 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.18 is released - -1999-06-22 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.17 is released - -1999-06-13 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak (DOC_SRC8): Remove mule-coding.c. - (TEMACS_MULE_OBJS): Remove mule-coding.obj - (check): Implement according to src/Makefile. - (check-temacs): ditto. - -1999-06-05 Norbert Koch <n.koch@delta-ii.de> - - * xemacs.mak (mule): remove dependencies from mule-coding.c - -1999-06-11 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.16 is released - -1999-05-14 Adrian Aichner <adrian@xemacs.org> - - * xemacs.mak (GUNG_HO): Explicitly default to 0. - Fix some comment typos. - ($(XEMACS)\Installation): Create it in the toplevel-directory, - where it is expected by loadup.el - -1999-06-04 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.15 is released - -1999-05-31 Andy Piper <andy@xemacs.org> - - * xemacs.mak: add select & select-x targets. - 1999-05-14 XEmacs Build Bot <builds@cvs.xemacs.org> * XEmacs 21.2.14 is released @@ -448,7 +12,7 @@ * xemacs.mak ($(LISP)\Installation.el): Don't use `replace-in-string'. -1999-03-17 Adrian Aichner <adrian@xemacs.org> +1999-03-17 Adrian Aichner <aichner@ecf.teradyne.com> * xemacs.mak: Remove ESC macro -- no longer needed. Remove small configuration report. Remove simplified version of @@ -464,9 +28,9 @@ report" did. 1999-04-29 Andy Piper <andy@xemacs.org> - + * sys/file.h: conditionalise definition of X_OK. - + 1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org> * XEmacs 21.2.13 is released @@ -524,7 +88,7 @@ * XEmacs 21.2.9 is released -1999-01-14 Adrian Aichner <adrian@xemacs.org> +1999-01-14 Adrian Aichner <aichner@ecf.teradyne.com> * xemacs.mak (MODULES): Adding variable. (update-elc): Setting EMACSBOOTSTRAPMODULEPATH. @@ -555,7 +119,7 @@ 1998-12-13 Jonathan Harris <jhar@tardis.ed.ac.uk> * 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. @@ -575,7 +139,7 @@ * XEmacs 21.2.6 is released -1998-12-11 Adrian Aichner <adrian@xemacs.org> +1998-12-11 Adrian Aichner <aichner@ecf.teradyne.com> * xemacs.mak (DOC_SRC2): CLASH_DETECTION is not supported under native Windows NT. Therefore src\filelock.c is not to be @@ -594,10 +158,10 @@ 1998-12-07 Martin Buchholz <martin@xemacs.org> * xemacs.mak (TEMACS_OBJS): - (DOC_SRC4): + (DOC_SRC4): - Remove pure.c, pure.obj -1998-11-04 Adrian Aichner <adrian@xemacs.org> +1998-11-04 Adrian Aichner <aichner@ecf.teradyne.com> * xemacs.mak: Creating minimal versions of Installation, Installation.el, and config.values to make @@ -626,7 +190,7 @@ * XEmacs 21.2-beta2 is released. -1998-09-19 Adrian Aichner <adrian@xemacs.org> +1998-09-19 Adrian Aichner <aichner@ecf.teradyne.com> * tiff.mak: New file provided by Charles Wilson <cwilson@ee.gatech.edu> @@ -669,7 +233,7 @@ * xemacs.mak: change "copy" to "xcopy" in install target -1998-08-04 Jeff Sparkes <jsparkes@internetivity.com> +1998-08-04 Jeff Sparkes <jsparkes@internetivity.com> * xemacs.mak: Link in PNG, TIFF and JPEG in native build. @@ -716,7 +280,7 @@ * config.h: * xemacs.mak: NT native sound fixes - From Fabrice POPINEAU via Adrian Aichner <adrian@xemacs.org> + From Fabrice POPINEAU via Adrian Aichner <aichner@ecf.teradyne.com> 1998-06-21 Martin Buchholz <martin@xemacs.org> @@ -739,7 +303,7 @@ * xemacs.mak (distclean): Reorder when puresize-adjust.h gets deleted. - From Adrian Aichner <adrian@xemacs.org> + From Adrian Aichner <aichner@ecf.teradyne.com> 1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> @@ -777,9 +341,9 @@ 1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> - * 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 <kkm@kis.ru> @@ -853,7 +417,7 @@ 1998-04-10 Kirill M. Katsnelson <kkm@kis.ru> * config.h: Do not USE_ASSERTION when DEBUG_XEMACS is not - defined. + defined. * xemacs.mak: Added new file process-nt.c @@ -907,7 +471,7 @@ 1998-03-19 Kirill M. Katsnelson <kkm@kis.ru> - * 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. @@ -972,7 +536,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 @@ -990,14 +554,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 @@ -1006,7 +570,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 @@ -1016,7 +580,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 @@ -1042,7 +606,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 @@ -1055,7 +619,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. @@ -1096,7 +660,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 @@ -1123,11 +687,12 @@ @@ -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 12e008d41344 -r 697ef44129c6 nt/Makefile.cygwin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/Makefile.cygwin Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,15 @@ +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 12e008d41344 -r 697ef44129c6 nt/PROBLEMS --- a/nt/PROBLEMS Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/PROBLEMS Mon Aug 13 11:20:41 2007 +0200 @@ -87,9 +87,9 @@ Function XEmacs binding -------- -------------- Undo C-_ - Cut Sh-Del - Copy C-Insert - Paste Sh-Insert + Cut C-Insert + Copy C-Insert + Paste Sh-Del You can rebind keys to make XEmacs more Windows-compatible; for example, to bind C-z to undo: diff -r 12e008d41344 -r 697ef44129c6 nt/README --- a/nt/README Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/README Mon Aug 13 11:20:41 2007 +0200 @@ -1,93 +1,45 @@ -Building and Installing XEmacs on Windows 95/98/NT -*- mode:outline -*- + Building and Installing XEmacs on Windows NT David Hobley - Marc Paquette - Jonathan Harris - Ben Wing + Marc Paquette + Jonathan Harris -This is a port of XEmacs to Windows 95/98/NT. If you are looking for a port -of GNU Emacs, see http://www.cs.washington.edu/homes/voelker/ntemacs.html. - +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 -* 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. +To get it working you will need: - 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. - +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 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. -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 . - - 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 - - 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. 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". +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". -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 - -If you want support for X you will also need: - -1. An X server. MI/X is available on the Internet as trialware; it is - available from: http://www.microimages.com/www/html/mix/ - -2. Source for the MIT X11R6.3 libraries, available from: ftp.x.org +3. At this point you can select X or Win32 native GUI support. -3. You'll need to compile the MIT libraries without multi-thread support. - To do this, there is an example Win32.cf and site.def provided which set - the relevant flags. You will also need to apply the patch in nt/X11.patch - in the xc/lib/X11 directory which will fix the DLL definition file. - - Once compiled and installed, you will need to apply the patch in - nt/Xmd.patch. This is messy and better solutions would be appreciated. +If you want to build for native GUI: -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. +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. 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) 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: + 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: cd to the zlib directory, type 'copy msdos\makefile.w32 Makefile' and then type 'nmake'. @@ -96,161 +48,110 @@ 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) 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. + 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. 4. If you want JPEG support grab the latest version of jpegsrc (jpeg-6b at - time of writing) from ftp://ftp.xemacs.org/pub/xemacs/aux/ and read the - README for details on how to build it. + 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" -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'. +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. -* 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'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. +If you want support for X you will need: - -- 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" +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 - -- If you're building with GIF support, modify the appropriate lines in - config.inc as follows: - - HAVE_GIF=1 - - -- 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" +2. The MIT X11R6.3 libraries available from: ftp.x.org - -- 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: - - 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. +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. - -- 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" - - (By default, XEmacs will be installed in directories under the directory - "c:\Program Files\XEmacs\XEmacs-21.2".) +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 -2. 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. - -3. To build using MS Developer Studio, you can use the workspace file - `nt/xemacs.dsw'. This was prepared for Visual C++ 5.0; if you have - a different version and this file doesn't work, 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: - - Executable for debug session: ..\src\xemacs.exe +--- 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. - - 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: +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 @@ -259,6 +160,5 @@ Marc Paquette August Hill Jonathan Harris -Ben Wing and others. diff -r 12e008d41344 -r 697ef44129c6 nt/Todo --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/Todo Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,42 @@ +# 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 12e008d41344 -r 697ef44129c6 nt/Xmd.patch --- a/nt/Xmd.patch Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- 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 12e008d41344 -r 697ef44129c6 nt/Xpm.def --- a/nt/Xpm.def Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -; Export definition file for XPM port to Win32 -; Copyright (C) 2000 Kirill 'Big K' Katsnelson -; -; This file is part of XEmacs. -; -; XEmacs is free software; you can redistribute it and/or modify it -; under the terms of the GNU General Public License as published by the -; Free Software Foundation; either version 2, or (at your option) any -; later version. -; -; XEmacs is distributed in the hope that it will be useful, but WITHOUT -; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -; for more details. -; -; You should have received a copy of the GNU General Public License -; along with XEmacs; see the file COPYING. If not, write to -; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -; Boston, MA 02111-1307, USA. -; -; Synched up with: Not in FSF. -; - -LIBRARY Xpm.dll -EXPORTS - XpmCreateImageFromData - XpmCreateDataFromImage - XpmReadFileToImage - XpmWriteFileFromImage - XpmCreateImageFromBuffer - XpmReadFileToBuffer - XpmWriteFileFromBuffer - XpmReadFileToData - XpmWriteFileFromData - XpmAttributesSize - XpmFreeAttributes - XpmFreeExtensions - XpmFreeXpmImage - XpmFreeXpmInfo - XpmGetErrorString - XpmLibraryVersion - XpmReadFileToXpmImage - XpmWriteFileFromXpmImage - XpmCreateImageFromXpmImage - XpmCreateXpmImageFromImage - XpmCreateDataFromXpmImage - XpmCreateXpmImageFromData - XpmCreateXpmImageFromBuffer - XpmCreateBufferFromXpmImage - XpmFree diff -r 12e008d41344 -r 697ef44129c6 nt/config.h --- a/nt/config.h Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/config.h Mon Aug 13 11:20:41 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_ @@ -67,6 +67,12 @@ numbers. */ #undef LISP_FLOAT_TYPE +/* Define GNU_MALLOC if you want to use the *new* GNU memory allocator. */ +#define GNU_MALLOC + +/* Define USE_SYSTEM_MALLOC if you forcing the use of it. */ +#undef USE_SYSTEM_MALLOC + /* Define HAVE_TTY if you want TTY support compiled in. */ #undef HAVE_TTY @@ -154,10 +160,11 @@ #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 -#undef HAVE_SYS_TIME_H +#define HAVE_SYS_TIME_H #define HAVE_LOCALE_H #ifdef HAVE_X_WINDOWS #define HAVE_X11_LOCALE_H @@ -230,10 +237,7 @@ #undef HAVE_FREXP #undef HAVE_FTIME #undef HAVE_GETHOSTNAME - -#define HAVE_GETPAGESIZE -#define getpagesize() 4096 - +#undef HAVE_GETPAGESIZE #define HAVE_GETTIMEOFDAY #define HAVE_GETWD #undef HAVE_LOGB @@ -289,7 +293,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_FILE +#undef DB_H_PATH #if defined (HAVE_DBM) || defined (HAVE_BERKELEY_DB) # define HAVE_DATABASE @@ -298,8 +302,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_FILE -#undef TERM_H_FILE +#undef CURSES_H_PATH +#undef TERM_H_PATH #define LOWTAGS @@ -332,25 +336,6 @@ #endif /* DEBUG_XEMACS */ -/* Define convenient conditionally defined assertion macros. */ -#ifdef ERROR_CHECK_TYPECHECK -#define type_checking_assert(assertion) assert (assertion) -#else -#define type_checking_assert(assertion) -#endif - -#ifdef ERROR_CHECK_BUFPOS -#define bufpos_checking_assert(assertion) assert (assertion) -#else -#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. */ #undef MEMORY_USAGE_STATS @@ -427,6 +412,8 @@ 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. @@ -489,7 +476,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" @@ -539,7 +526,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. @@ -562,8 +549,10 @@ #define ENCAPSULATE_OPEN #define ENCAPSULATE_FOPEN #define ENCAPSULATE_MKDIR -#define ENCAPSULATE_STAT -#define ENCAPSULATE_FSTAT + +#if defined (WIN32) && defined (USE_IME) +#define HAVE_FEP +#endif #if defined (HAVE_SOCKS) && !defined (DO_NOT_SOCKSIFY) #define accept Raccept @@ -584,13 +573,11 @@ /* MSVC version >= 2.x without /Za supports __inline */ #if (_MSC_VER < 900) || defined(__STDC__) -# define inline +# define INLINE static #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. @@ -602,21 +589,6 @@ #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 @@ -639,8 +611,16 @@ /* Should movemail use hesiod for getting POP server host? */ #undef HESIOD /* Determine type of mail locking. */ -#undef MAIL_LOCK_LOCKF -#undef REAL_LOCK_FLOCK -#undef MAIL_LOCK_DOT +/* Play preprocessor games so that configure options override s&m files */ +#undef REAL_MAIL_USE_LOCKF +#undef REAL_MAIL_USE_FLOCK +#undef MAIL_USE_LOCKF +#undef MAIL_USE_FLOCK +#ifdef REAL_MAIL_USE_FLOCK +#define MAIL_USE_FLOCK +#endif +#ifdef REAL_MAIL_USE_LOCKF +#define MAIL_USE_LOCKF +#endif #endif /* _SRC_CONFIG_H_ */ diff -r 12e008d41344 -r 697ef44129c6 nt/config.inc.samp --- a/nt/config.inc.samp Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -# -*- 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 12e008d41344 -r 697ef44129c6 nt/inc/arpa/inet.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/arpa/inet.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,1 @@ +/* null version of <arpa/inet.h> - <sys/socket.h> has everything */ diff -r 12e008d41344 -r 697ef44129c6 nt/inc/netdb.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/netdb.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,1 @@ +/* null version of <netdb.h> - <sys/socket.h> has everything */ diff -r 12e008d41344 -r 697ef44129c6 nt/inc/netinet/in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/netinet/in.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,1 @@ +/* null version of <netinet/in.h> - <sys/socket.h> has everything */ diff -r 12e008d41344 -r 697ef44129c6 nt/inc/pwd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/pwd.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,18 @@ +#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 12e008d41344 -r 697ef44129c6 nt/inc/sys/dir.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/sys/dir.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,75 @@ +/* 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. */ + +/* + <dir.h> -- definitions for 4.2BSD-compatible directory access + + last edit: 09-Jul-1983 D A Gwyn +*/ + +#ifdef VMS +#ifndef FAB$C_BID +#include <fab.h> +#endif +#ifndef NAM$C_BID +#include <nam.h> +#endif +#ifndef RMS$_SUC +#include <rmsdef.h> +#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 12e008d41344 -r 697ef44129c6 nt/inc/sys/file.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/sys/file.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,11 @@ +/* + * 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 12e008d41344 -r 697ef44129c6 nt/inc/sys/ioctl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/sys/ioctl.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,5 @@ +/* + * 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 12e008d41344 -r 697ef44129c6 nt/inc/sys/param.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/sys/param.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,10 @@ +#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 12e008d41344 -r 697ef44129c6 nt/inc/sys/socket.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/sys/socket.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,86 @@ +/* Workable version of <sys/socket.h> 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 <winsock.h> + +#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 12e008d41344 -r 697ef44129c6 nt/inc/sys/time.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/sys/time.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,24 @@ +/* + * sys/time.h doesn't exist on NT + */ + +#include <time.h> + +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 12e008d41344 -r 697ef44129c6 nt/inc/unistd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/inc/unistd.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,1 @@ +/* Fake unistd.h: config.h already provides most of the relevant things. */ diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/README --- a/nt/installer/Wise/README Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -To use: - -You need to build and install the XEmacs distribution. Also you need -the xemacs packages in both source and installed versions. - -Edit "dirs.py" to reflect the locations of the above components. - -Edit "version.py" to reflect the current version, as well as the -welcome message. - -Run - python pre_wise.py > xemacs-XXX.wse - - (for XXX use a version or date code of your choosing) - -Run - cmd /c xemacs-XXX.wse - -to produce xemacs-XXX.exe - - -"pre_wise.py" is a preprocessor for the Wise installer maker. It -reads "xemacs.tmpl" which is a Wise input file, except that certain -portions are enclosed in triple angle brackets <<<like this>>> - -These portions are evaluated as Python expressions and replaced by the -string representations of the resulting value. This allows for -things to change from release to release without having to re-do the -Wise installation each time. Also it keeps you from having to -manually drag-n-drop all the package files, which is rather tedious! - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/dirs.py --- a/nt/installer/Wise/dirs.py Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#Configuration variables - -#where the source is: - -source = r"X:\XEmacs-21" -#where the installed distribution is: -installed = r"C:\Program Files\XEmacs\xemacs-21.0-b62" - -#where the (built and installed) packages are -packages = r"C:\Program Files\XEmacs\xemacs-packages" - -#where the package source is -pkg_src = r"X:\xemacs-packages" - -#Subdirs relative to the base installation directory -#Everything except packages goes here: -dst = "XEmacs-21.0-b62" -#packages go here: -pkg_dst = "xemacs-packages" - - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/display readme.dlg --- a/nt/installer/Wise/display readme.dlg Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -Document Type: DLG -item: Custom Dialog - Name=Display ReadMe - Display Variable=DISPLAY - item: Dialog - Title=Read Me File - Title French=Fichier Lisez-moi - Title German=Liesmich-Datei - Title Portuguese=Ficheiro Leia-me - Title Spanish=Archivo Léeme - Title Italian=File Leggimi - Title Danish=Vigtigt fil - Title Dutch=Leesmij-bestand - Title Norwegian=Informasjonsfil - Title Swedish=Läs mig-fil - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=I &Agree > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Slet - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Editbox - Rectangle=85 11 254 170 - Value=%TEMP%\%READMEFILE% - Help Context=16711681 - Create Flags=01010000101000000000100000000100 - end - end -end diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/el.reg --- a/nt/installer/Wise/el.reg Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ - -REGEDIT4 - -[HKEY_CLASSES_ROOT\.el] -@="elfile" -"Content Type"="text/plain" - -[HKEY_CLASSES_ROOT\elfile] -@="Emacs lisp" -"EditFlags"=hex:00,00,01,00 - -[HKEY_CLASSES_ROOT\elfile\Shell] -@="" - -[HKEY_CLASSES_ROOT\elfile\Shell\open] - -[HKEY_CLASSES_ROOT\elfile\Shell\open\command] -@="\"C:\\Program Files\\XEmacs\\XEmacs-21.0\\i386-pc-win32\\runemacs.exe\" \"%1\"" - -[HKEY_CLASSES_ROOT\elfile\Shell\open\ddeexec] -@="open(\"%1\")" - -[HKEY_CLASSES_ROOT\elfile\Shell\open\ddeexec\Application] -@="XEmacs" - -[HKEY_CLASSES_ROOT\elfile\Shell\open\ddeexec\topic] -@="System" - -[HKEY_CLASSES_ROOT\elfile\DefaultIcon] -@="C:\\Program Files\\XEmacs\\XEmacs-21.0\\i386-pc-win32\\runemacs.exe,2" - -[HKEY_CLASSES_ROOT\elfile\QuickView] -@="*" - - - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/filelist.py --- a/nt/installer/Wise/filelist.py Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -import os -import dirs -import string - -def listdir_recursive(basedir): - ret = [] - for f in os.listdir(basedir): - if os.path.isfile(basedir+"\\"+f): - ret.append(f) - elif os.path.isdir(basedir+"\\"+f): - for f1 in listdir_recursive(basedir+"\\"+f): - ret.append(f+"\\"+f1) - return ret - -all = [] - - - -for f in listdir_recursive(dirs.installed): - if string.find(f,'CVS')>=0: - continue - all.append((f, dirs.installed, dirs.dst)) - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/files.py --- a/nt/installer/Wise/files.py Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -import os -import dirs - -def listdir_recursive(basedir): - ret = [] - for f in os.listdir(basedir): - if os.path.isfile(basedir+"\\"+f): - ret.append(f) - elif os.path.isdir(basedir+"\\"+f): - for f1 in listdir_recursive(basedir+"\\"+f): - ret.append(f+"\\"+f1) - return ret - -install = [] - -for f in os.listdir(dirs.source+"\\lib-src"): - if f == "DOC" or f[-4:]==".exe": - install.append((f,dirs.source+"\\lib-src",dirs.bin_dst)) - - -for f in ['runemacs.exe', 'xemacs.exe']: - install.append((f,dirs.source+"\\src",dirs.bin_dst)) - -for f in listdir_recursive(dirs.source+"\\lisp"): - install.append((f,dirs.source+"\\lisp",dirs.lisp_dst)) - -for f in listdir_recursive(dirs.source+"\\etc"): - install.append((f,dirs.source+"\\etc",dirs.etc_dst)) - - -for f in os.listdir(dirs.source+"\\info"): - install.append((f,dirs.source+"\\info",dirs.info_dst)) - - - - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/gnu.bmp Binary file nt/installer/Wise/gnu.bmp has changed diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/libs.dlg --- a/nt/installer/Wise/libs.dlg Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -Document Type: DLG -item: Custom Dialog - Name=Select Components - Display Variable=DISPLAY - Flags=00000001 - item: Dialog - Title=Select Components - Title French=Sélectionner les éléments - Title German=Komponenten auswählen - Title Portuguese=Seleccionar Componentes - Title Spanish=Seleccione los Componentes - Title Italian=Seleziona Componenti - Title Danish=Vælg komponenter - Title Dutch=Selecteer onderdelen - Title Norwegian=Velg komponenter - Title Swedish=Välj komponenter - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=130 185 172 199 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=<&Retour - Text German=<&Zurück - Text Portuguese=<&Retornar - Text Spanish=<&Retroceder - Text Italian=< &Indietro - Text Danish=<&Tilbage - Text Dutch=<&Terug - Text Norwegian=<&Tilbake - Text Swedish=< &Tillbaka - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Annuller - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=205 156 253 166 - Variable=COMPONENTS - Value=MAINDIR - Create Flags=01010000000000000000000000000010 - end - item: Static - Rectangle=205 148 253 157 - Variable=COMPONENTS - Create Flags=01010000000000000000000000000010 - end - item: Static - Rectangle=95 147 184 158 - Create Flags=01010000000000000000000000000000 - Text=Disk Space Required: - Text French=Espace disque requis - Text German=Benötigter Festplattenspeicher: - Text Portuguese=Espaço de disco necessário: - Text Spanish=Espacio de Disco Requerido: - Text Italian=Spazio su disco richiesto: - Text Danish=Nødvendig diskplads: - Text Dutch=Vereiste hoeveelheid schijfruimte - Text Norwegian=Diskplass nødvendig: - Text Swedish=Erforderligt diskutrymme - end - item: Static - Rectangle=95 157 190 167 - Create Flags=01010000000000000000000000000000 - Text=Disk Space Remaining: - Text French=Espace disque disponible - Text German=Verbleibender Festplattenspeicher: - Text Portuguese=Espaço de disco restante: - Text Spanish=Espacio de Disco Remanente: - Text Italian=Spazio su disco rimanente: - Text Danish=Ledig diskplads: - Text Dutch=Resterende schijfruimte - Text Norwegian=Ledig diskplass: - Text Swedish=Återstående diskutrymme - end - item: Static - Rectangle=90 138 264 168 - Action=1 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=90 8 260 41 - Create Flags=01010000000000000000000000000000 - Text=In the options list below, select the checkboxes for the options that you would like to have installed. The disk space fields reflect the requirements of the options you have selected. - Text French=Dans la liste d'options suivante, veuillez sélectionner les cases des options que vous désirez installer. Le champ d'espace disque indique les conditions requises pour les options choisies - Text German=Wählen Sie in der Optionenliste unten die Kontrollkästchen für diejenigen Optionen, die Sie installieren möchten. Die Speicherfelder zeigen die benötigte Speicherkapazität für die gewählten Optionen an. - Text Portuguese=Na lista de opções abaixo, seleccione as caixas de verificação para as opções que gostaria de ter instalado. Os campos de espaço de disco reflectem os requerimentos das opções que seleccionou. - Text Spanish=En la lista de opciones que se ofrece a continuación, seleccione las casillas de comprobación para las opciones que desea instalar. Los campos del espacio en el disco reflejan los requerimientos de las opciones que ha seleccionado. - Text Italian=Nell’elenco delle opzioni sotto, marca le caselle di controllo delle opzioni che vuoi installare. I campi dello spazio sul disco riflettono i requisiti delle opzioni selezionate. - Text Danish=Marker afkrydsningsfelterne for de komponenter, der skal installeres, på listen herunder. Diskpladsfelterne angiver pladskravene for de valgte komponenter. - Text Dutch=Kruis in de onderstaande lijst het vakje aan naast de opties die u wilt installeren. Achter elke optie staat de benodigde schijfruimte vermeld. - Text Norwegian=I listen over alternativer nedenfor, klikk i kontrollrutene for de alternativene du ønsker å installere. Diskplassfeltene gjenspeiler kravene for de alternativene du har valgt. - Text Swedish=Kryssa för i rutorna nedan vilka alternativ du vill få installerade. I diskutrymmesfälten anges utrymmesbehoven för de alternativ du väljer. - end - item: Checkbox - Rectangle=91 41 126 56 - Variable=COMPONENTS LIBS - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000010000000000000011 - Flags=0000000000000010 - Text=Libraries - Text= - end - item: Checkbox - Rectangle=90 56 148 71 - Variable=COMPONENTS COMM - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000010000000000000011 - Flags=0000000000000010 - Text=Communications - Text= - end - end - item: Dialog - Title=Library Packages - Width=268 - Height=204 - Font Name=Helv - Font Size=8 - end - item: Dialog - Title=Library Packages - Width=268 - Height=204 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=219 170 254 185 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000010000000000000000 - Text=OK - end - end -end diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/packages.py --- a/nt/installer/Wise/packages.py Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -#configuration variables - -#package categories -category_names = ["libs", "comm", "oa", "os", "prog", "wp", "games"] - -category_descriptions = {"libs":"Libraries", - "comm":"Communication", - "oa": "Productivity", #??? - "os": "Operating System", - "prog": "Programming", - "wp": "Word Processing", - "games": "Games and Amusements"} - - -#packages to install by default -default=["xemacs-base","edit-utils","efs", - "text-modes","prog-modes", - "dired","apel", - "c-support","cc-mode", - "mail-lib","pc","sounds-wav"] - -def category_of_letter(x): - return category_names[ord(x)-ord('A')] - -def letter_of_category(cat): - return chr(ord('A')+category_names.index(cat)) - -def letter_of_package(x): - return chr(ord('A')+packages_of_category(category_of_package(x)).index(x)) - -import dirs, os -catpkg = {} -pkgcat = {} - -for cat in category_names: - pkgcat[cat]=[] - dd = os.path.join(dirs.pkg_src,cat) - for d in os.listdir(dd): - if d == "CVS": - continue - manifest = dirs.packages + "\\pkginfo\\MANIFEST." + d - if not os.path.exists(manifest): #it's not installed, skip it - continue - if os.path.isdir(os.path.join(dd,d)): - catpkg[d] = cat - pkgcat[cat].append(d) - -def category_of_package(p): - return catpkg[p] - -def packages_of_category(c): - return pkgcat[c] - -#Brief descriptions of the packages. -#This data is up-to-date as of 13 January 1998. -package_descriptions={ - "Sun":"Support for Sparcworks.", - "apel":"A Portable Emacs Library", - "edebug":"A Lisp debugger", - "dired":"The DIRectory EDitor", - "efs":"Access remote filesystems", - "mail-lib":"Fundamental email support", - "tooltalk":"Tooltalk", - "xemacs-base":"Fundamental XEmacs support", - "xemacs-devel":"Lisp developer support.", - "footnote":"Footnoting in mail messages", - "gnats":"XEmacs bug reports", - "gnus":"Newsreader and Mailreader", - "mailcrypt":"Message encryption with PGP.", - "mh-e":"Support for MH mailreader", - "net-utils":"Networking Utilities", - "ph":"CCSO/qi directory client", - "rmail":"An obsolete Emacs mailer", - "supercite":"Mail/News Citation tool", - "tm":"Emacs MIME support", - "vm":"An Emacs mailer", - "w3":"A Web browser", - "cookie":"Spook and Yow (Zippy quotes)", - "games":"Tetris, Sokoban, and Snake", - "mine":"Minehunt", - "misc-games":"Other amusements and diversions", - "egg-its":"Wnn(4.2 and 6)/SJ3 support", - "leim":"Quail", - "locale":"Localized menubars", - "mule-base":"Basic Mule support", - "skk":"Another Japanese Language Input Method", - "calendar":"Calendar and diary", - "edit-utils":"Various XEmacs goodies", - "forms":"Obsolete forms editing support", - "frame-icon":"Change icon based on mode", - "hm--html-menus":"HTML editing", - "ispell":"Spell-checking with ispell", - "pc":"PC style interface emulation", - "psgml":"Validated HTML/SGML editing", - "sgml":"SGML/Linuxdoc-SGML editing", - "slider":"User interface tool", - "speedbar":"??? Document me.", - "strokes":"Mouse enhancement utility", - "text-modes":"Packages for editing text files", - "time":"Display time and date", - "eterm":"Terminal emulator", - "igrep":"Enhanced Grep", - "ilisp":"Front-end for Inferior Lisp", - "os-utils":"Misc. OS utilities", - "view-process":"Unix process viewer", - "ada":"Ada language support", - "c-support":"Add-ons for editing C code", - "cc-mode":"C, C++ and Java language editing", - "debug": "GUD, gdb, dbx debugging support", - "ediff": "Compare files", - "emerge": "Merge files", - "pcl-cvs":"CVS frontend.", - "prog-modes":"Various programming languages", - "scheme":"Front-end for Inferior Scheme", - "sh-script":"Support for editing shell scripts", - "vc":"Version Control", - "vc-cc":"Broken", - "vhdl":"Support for VHDL", - "auctex":"Basic TeX/LaTeX support", - "crisp":"Crisp/Brief emulation", - "edt":"DEC EDIT/EDT emulation", - "texinfo":"XEmacs TeXinfo support.", - "textools":"TeX support", - "tpu":"DEC EDIT/TPU support", - "viper":"VI emulation", - "elib":"Portable elisp utility library", - "fsf-compat": "FSF Emacs compatibility files", - "sounds-wav": "XEmacs Microsoft sound files", - "bbdb": "The Big Brother Data Base", - "eudc": "Emacs Unified Directory Client", - "mew": "Messaging in an Emacs World", - "zenirc": "IRC client", - "calc": "Emacs calculator", - "jde": "Java development environment", - "reftex": "LaTeX cross-referencing and citations" -} - - - - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/pre_wise.py --- a/nt/installer/Wise/pre_wise.py Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -import string -import re -import os -import types - -infile=open("xemacs.tmpl","r") - -import version -import dirs -import filelist -import packages - -def letter(package): - index = packages.all.index(package) - if index>29: - raise "WISE error: too many components" - return chr(ord("A")+index) - -def letters(package_list): - ret = "" - for p in package_list: - ret = ret+letter(p) - return ret - -def describe(package): - if package in packages.descriptions.keys(): - return ": "+packages.descriptions[package] - else: return "" - -def ifblock(var,val): - return("item: If/While Statement\n Variable=%s\n Value=%s\n Flags=00001010\nend\n" % (var,val)) - -def endblock(): - return("item: End Block\nend\n") - -def setvar(var,val): - return("item: Set Variable\n Variable=%s\n Value=%s\n Flags=10000000\nend\n" % (string.upper(var), val)) - -def default_letters_of_category(cat): - val = "" - for p in packages.default: - if packages.category_of_package(p) == cat: - val = val + packages.letter_of_package(p) - return val - -def set_category_defaults(): - ret = "" - for c in packages.category_names: - ret = ret + setvar(c, default_letters_of_category(c)) - return ret - -def do_category(cat): - ret = ifblock("COMPONENTS", packages.letter_of_category(cat)) - for pkg in packages.packages_of_category(cat): - ret = ret + ifblock(string.upper(cat),packages.letter_of_package(pkg)) - for f in files_of_package(pkg): - ret = ret+install_pkg_file(f) - ret = ret + endblock() - ret = ret + endblock() - return ret - -def files_of_package(package): - manifest_file = dirs.packages + "\\pkginfo\\MANIFEST." + package - manifest = open(manifest_file,"r") - lines = manifest.readlines() - lines = map(lambda s:s[:-1], lines) - lines = map(lambda s:string.replace(s,'/','\\'), lines) - return lines - -def category_dialog(cat): - npkg = len(packages.packages_of_category(cat)) - ret="" - ret=ret+" item: Dialog\n Title="+packages.category_descriptions[cat]+" Packages\n" - ret=ret+" Width=210\n" - ret=ret+" Height=%d\n" % (45+npkg*10) - ret=ret+" Font Name=Helv\n" - ret=ret+" Font Size=8\n" - ret=ret+" item: Push Button\n" - ret=ret+" Rectangle=107 %d 147 %d\n" % (5+npkg*10+2, 5+npkg*10+17) - ret=ret+" Create Flags=01010000000000010000000000000001\n" - ret=ret+" Text=OK\n" - ret=ret+" end\n" - ret=ret+" item: Push Button\n" - ret=ret+" Rectangle=153 %d 193 %d\n" % (5+npkg*10+2, 5+npkg*10+17) - ret=ret+" Variable=%s\n" % string.upper(cat) - ret=ret+" Value=%%%s_SAVE%%\n" % string.upper(cat) - ret=ret+" Create Flags=01010000000000010000000000000000\n" - ret=ret+" Flags=0000000000000001\n" - ret=ret+" Text=Cancel\n" - ret=ret+" end\n" - ret=ret+" item: Checkbox\n" - ret=ret+" Rectangle=0 5 191 %d\n" % (10*npkg) - ret=ret+" Variable=%s\n"%string.upper(cat) - ret=ret+" Create Flags=01010000000000010000000000000011\n" - ret=ret+" Flags=0000000000000010\n" - for pkg in packages.packages_of_category(cat): - ret = ret+" Text=%s: %s\n"%( pkg, packages.package_descriptions[pkg]) - ret=ret+" Text=\n" - ret=ret+" end\n" - ret=ret+" end\n" - return ret - -def src_path(src,name): - return src + "\\" + name - -def dst_path(dst,name): - return "%MAINDIR%"+"\\"+dst+"\\" + name - -def install_file(name,src,dst): - return("item: Install File\n Source=%s\n Destination=%s\n Flags=0000000010000010\nend\n" % (src_path(src,name),dst_path(dst,name))) - -def install_pkg_file(name): - return install_file(name,dirs.packages,dirs.pkg_dst) - -def do_package(package): - return ifblock("COMPONENTS",letter(package)) + \ - string.join(map(install_pkg_file,files(package)),"")+ \ - endblock() - -for line in infile.readlines(): - left=string.find(line,"<<<") - if left>=0: - right=string.find(line,">>>") - expr=line[left+3:right] - val=eval(expr) - if type(val)==types.StringType: - print line[:left] + val + line[right+3:], - elif type(val)==types.ListType: - for v in val: - print line[:left] + v + line[right+3:], - else: print line, - - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/type.dlg --- a/nt/installer/Wise/type.dlg Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -Document Type: DLG -item: Custom Dialog - Name=type - item: Dialog - Title=type - Width=238 - Height=208 - Font Name=Helv - Font Size=8 - item: Radio Button - Rectangle=5 5 40 20 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000010000000000001001 - Text=minimal - Text= - end - item: Radio Button - Rectangle=5 25 40 40 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000010000000000001001 - Text=custom - Text= - end - item: Radio Button - Rectangle=5 45 40 60 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000010000000000001001 - Text=full - Text= - end - end -end diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/version.py --- a/nt/installer/Wise/version.py Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -title="XEmacs 21.0b62 EXPERIMENTAL" -welcome="Welcome to the %APPTITLE% setup program. Please note that this is an experimental release and some features may not work correctly, especially on machines running Windows 95. Please read the file PROBLEMS in the xemacs installation directory. Send comments or bug reports to xemacs-nt@xemacs.org. For more info see http://www.xemacs.org" - diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/welcome.dlg --- a/nt/installer/Wise/welcome.dlg Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -Document Type: DLG -item: Custom Dialog - Name=Welcome - Display Variable=DISPLAY - item: Dialog - Title=Welcome - Title French=Bienvenue - Title German=Willkommen - Title Portuguese=Bem-vindo - Title Spanish=Bienvenido - Title Italian=Benvenuto - Title Danish=Velkommen - Title Dutch=Welkom - Title Norwegian=Velkommen - Title Swedish=Välkommen - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Annuller - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=91 22 245 118 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000000000000000000000 - Text=Welcome to the %APPTITLE% setup program. Please note that this is an experimental release and some features may not work correctly. Send comments or bug reports to xemacs-nt@xemacs.org rather than one of the other XEmacs mailing lists. For more info see http://www.xemacs.org - end - end -end diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/xemacs-beta.bmp Binary file nt/installer/Wise/xemacs-beta.bmp has changed diff -r 12e008d41344 -r 697ef44129c6 nt/installer/Wise/xemacs.tmpl --- a/nt/installer/Wise/xemacs.tmpl Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1310 +0,0 @@ -Document Type: WSE -item: Global - Version=7.0 - Title=<<<version.title + " Installation">>> - Flags=00000100 - Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - Japanese Font Name=MS Gothic - Japanese Font Size=10 - Progress Bar DLL=%_WISE_%\Progress\WIZ%_EXE_OS_TYPE_%.DLL - Start Gradient=0 0 255 - End Gradient=0 0 0 - Windows Flags=00000100000000010010110000001000 - Log Pathname=%MAINDIR%\INSTALL.LOG - Message Font=MS Sans Serif - Font Size=8 - Disk Filename=SETUP - Patch Flags=0000000000000001 - Patch Threshold=85 - Patch Memory=4000 - FTP Cluster Size=20 - Dialogs Version=6 - Variable Name1=_SYS_ - Variable Default1=C:\WINDOWS\SYSTEM - Variable Flags1=00001000 - Variable Name2=_WISE_ - Variable Default2=C:\PROGRAM FILES\WISE INSTALLBUILDER - Variable Flags2=00001000 -end -item: Get Temporary Filename - Variable=READMEFILE -end -item: Install File - Source=<<<dirs.source>>>\nt\Wise\Copying.txt - Destination=%TEMP%\%READMEFILE% - Flags=0000000000100010 -end -item: Open/Close INSTALL.LOG - Flags=00000001 -end -item: Check if File/Dir Exists - Pathname=%SYS% - Flags=10000100 -end -item: Set Variable - Variable=SYS - Value=%WIN% -end -item: End Block -end -item: Set Variable - Variable=APPTITLE - Value=<<<version.title>>> - Flags=10000000 -end -item: Set Variable - Variable=GROUP - Value=XEmacs - Flags=10000000 -end -item: Set Variable - Variable=DISABLED - Value=! -end -item: Set Variable - Variable=MAINDIR - Value=XEmacs - Flags=10000000 -end -item: Check Configuration - Flags=10111011 -end -item: Get Registry Key Value - Variable=COMMON - Key=SOFTWARE\Microsoft\Windows\CurrentVersion - Default=C:\Program Files\Common Files - Value Name=CommonFilesDir - Flags=00000100 -end -item: Get Registry Key Value - Variable=PROGRAM_FILES - Key=SOFTWARE\Microsoft\Windows\CurrentVersion - Default=C:\Program Files - Value Name=ProgramFilesDir - Flags=00000100 -end -item: Set Variable - Variable=MAINDIR - Value=%PROGRAM_FILES%\%MAINDIR% - Flags=00001100 -end -item: Set Variable - Variable=EXPLORER - Value=1 -end -item: Else Statement -end -item: Set Variable - Variable=MAINDIR - Value=C:\%MAINDIR% - Flags=00001100 -end -item: End Block -end -item: Set Variable - Variable=BACKUP - Value=%MAINDIR%\BACKUP - Flags=10000000 -end -item: Set Variable - Variable=DOBACKUP - Value=B - Flags=10000000 -end -item: Set Variable - Variable=COMPONENTS - Value=ACE - Flags=10000000 -end -<<<set_category_defaults()>>> -item: Wizard Block - Direction Variable=DIRECTION - Display Variable=DISPLAY - Bitmap Pathname=<<<dirs.source>>>\nt\Wise\gnu.bmp - X Position=9 - Y Position=10 - Filler Color=8421440 - Dialog=Select Program Manager Group - Dialog=Select Backup Directory - Dialog=Display Registration Information - Dialog=Get Registration Information - Variable=EXPLORER - Variable=DOBACKUP - Variable=DOBRAND - Variable=DOBRAND - Value=1 - Value=A - Value=1 - Value=1 - Compare=0 - Compare=1 - Compare=0 - Compare=1 - Flags=00000011 -end -item: Custom Dialog Set - Name=Welcome - Display Variable=DISPLAY - item: Dialog - Title=Welcome - Title French=Bienvenue - Title German=Willkommen - Title Portuguese=Bem-vindo - Title Spanish=Bienvenido - Title Italian=Benvenuto - Title Danish=Velkommen - Title Dutch=Welkom - Title Norwegian=Velkommen - Title Swedish=Välkommen - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Annuller - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=91 22 245 118 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000000000000000000000 - Text=<<<version.welcome>>> - end - end -end -item: Custom Dialog Set - Name=Display ReadMe - Display Variable=DISPLAY - item: Dialog - Title=Read Me File - Title French=Fichier Lisez-moi - Title German=Liesmich-Datei - Title Portuguese=Ficheiro Leia-me - Title Spanish=Archivo Léeme - Title Italian=File Leggimi - Title Danish=Vigtigt fil - Title Dutch=Leesmij-bestand - Title Norwegian=Informasjonsfil - Title Swedish=Läs mig-fil - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=I &Agree > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Slet - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Editbox - Rectangle=85 11 254 170 - Value=%TEMP%\%READMEFILE% - Help Context=16711681 - Create Flags=01010000101000000000100000000100 - end - end -end -item: Custom Dialog Set - Name=Select Destination Directory - Display Variable=DISPLAY - item: Dialog - Title=Choose Destination Location - Title French=Choisissez la localisation de destination - Title German=Zielpfad wählen - Title Portuguese=Escolher Local de Destino - Title Spanish=Elegir una localización de destino - Title Italian=Scegli Posizione di Destinazione - Title Danish=Vælg destinationsmappe - Title Dutch=Kies doellocatie - Title Norwegian=Velg målplassering - Title Swedish=Välj ställe för installationen - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=130 185 172 199 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Flags=0000000000000001 - Text=< &Back - Text French=<&Retour - Text German=<&Zurück - Text Portuguese=<&Retornar - Text Spanish=<&Retroceder - Text Italian=< &Indietro - Text Danish=<&Tilbage - Text Dutch=<&Terug - Text Norwegian=<&Tilbake - Text Swedish=< &Tillbaka - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Annuller - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=90 10 260 122 - Create Flags=01010000000000000000000000000000 - Text=Setup will install %APPTITLE% in the following folder. - Text= - Text=To install into a different folder, click Browse, and select another folder. - Text= - Text=You can choose not to install %APPTITLE% by clicking Cancel to exit Setup. - Text French=%APPTITLE% va être installé dans le répertoire ci-dessous - Text French= - Text French=Pour l'installer dans un répertoire différent, cliquez sur Parcourir et sélectionnez un autre répertoire - Text French= - Text French=Vous pouvez choisir de ne pas installer %APPTITLE% en cliquant sur Annuler pour quitter l'Installation - Text German=Installation speichert %APPTITLE% im unten angegebenen Ordner: - Text German= - Text German=Zur Installation in einem anderen Ordner auf Blättern klicken und einen anderen Ordner wählen. - Text German= - Text German=Wenn Sie %APPTITLE% nicht installieren möchten, können Sie durch Klicken auf Abbrechen die Installation beenden. - Text Portuguese=Configuração instalará %APPTITLE% na seguinte pasta - Text Portuguese= - Text Portuguese=Para instalar numa pasta diferente, faça um clique sobre Procurar, e seleccione uma outra pasta. - Text Portuguese= - Text Portuguese=Pode escolher não instalar %APPTITLE% clicando no botão Cancelar para sair da Configuração - Text Spanish=El programa de Configuración instalará %APPTITLE% en la siguiente carpeta. - Text Spanish= - Text Spanish=Para instalar en una carpeta diferente, haga un clic en Visualizar, y seleccione otra carpeta. - Text Spanish= - Text Spanish=Puede elegir no instalar %APPTITLE% haciendo un clic en Cancelar para salir de Configuración. - Text Italian=Il programma di installazione installerà %APPTITLE% nella seguente cartella. - Text Italian= - Text Italian=Per effettuare l’installazione in una cartella diversa, fai clic su Sfoglia, e scegli un’altra cartella. - Text Italian= - Text Italian=Puoi scegliere di non installare %APPTITLE% facendo clic su Annulla per uscire dal programma di installazione - Text Danish=Installationsprogrammet installerer %APPTITLE% i denne mappe. - Text Danish= - Text Danish=Man installerer i en anden mappe ved at klikke på Browse og vælge en anden mappe. - Text Danish= - Text Danish=Man kan vælge ikke at installere %APPTITLE% ved at klikke på Slet og forlade installationsprogrammet. - Text Dutch=Het installatieprogramma installeert %APPTITLE% in de volgende directory. - Text Dutch= - Text Dutch=Als u het in een andere directory wilt installeren, klik dan op Bladeren en kies een andere locatie. - Text Dutch= - Text Dutch=U kunt ervoor kiezen om %APPTITLE% niet te installeren: klik op Annuleren om het installatieprogramma te verlaten. - Text Norwegian=Oppsett vil installere %APPTITLE% i følgende mappe. - Text Norwegian= - Text Norwegian=For å installere i en annen mappe, klikk Bla igjennom og velg en annen mappe. - Text Norwegian= - Text Norwegian=Du kan velge å ikke installere %APPTITLE% ved å velge Avbryt for å gå ut av Oppsett. - Text Swedish=Installationsprogrammet installerar %APPTITLE% i följande mapp. - Text Swedish= - Text Swedish=Om du vill att installationen ska göras i en annan mapp, klickar du på Bläddra och väljer en annan mapp. - Text Swedish= - Text Swedish=Du kan välja att inte installera %APPTITLE% genom att klicka på Avbryt för att lämna installationsprogrammet. - end - item: Static - Rectangle=90 134 260 162 - Action=1 - Create Flags=01010000000000000000000000000111 - Text=Destination Folder - Text French=Répertoire de destination - Text German=Zielordner - Text Portuguese=Pasta de Destino - Text Spanish=Carpeta de Destino - Text Italian=Cartella di destinazione - Text Danish=Destinationsmappe - Text Dutch=Doeldirectory - Text Norwegian=Målmappe - Text Swedish=Destinationsmapp - end - item: Push Button - Rectangle=213 143 255 157 - Variable=MAINDIR_SAVE - Value=%MAINDIR% - Destination Dialog=1 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=B&rowse... - Text French=P&arcourir - Text German=B&lättern... - Text Portuguese=P&rocurar - Text Spanish=V&isualizar... - Text Italian=Sfoglia... - Text Danish=&Gennemse... - Text Dutch=B&laderen... - Text Norwegian=Bla igjennom - Text Swedish=&Bläddra - end - item: Static - Rectangle=95 146 211 157 - Destination Dialog=2 - Create Flags=01010000000000000000000000000000 - Text=%MAINDIR% - Text French=%MAINDIR% - Text German=%MAINDIR% - Text Portuguese=%MAINDIR% - Text Spanish=%MAINDIR% - Text Italian=%MAINDIR% - Text Danish=%MAINDIR% - Text Dutch=%MAINDIR% - Text Norwegian=%MAINDIR% - Text Swedish=%MAINDIR% - end - end - item: Dialog - Title=Select Destination Directory - Title French=Choisissez le répertoire de destination - Title German=Zielverzeichnis wählen - Title Portuguese=Seleccionar Directório de Destino - Title Spanish=Seleccione el Directorio de Destino - Title Italian=Seleziona Directory di destinazione - Title Danish=Vælg Destinationsbibliotek - Title Dutch=Kies doeldirectory - Title Norwegian=Velg målkatalog - Title Swedish=Välj destinationskalatog - Width=221 - Height=173 - Font Name=Helv - Font Size=8 - item: Listbox - Rectangle=5 2 160 149 - Variable=MAINDIR - Create Flags=01010000100000010000000101000000 - Flags=0000110000100010 - Text=%MAINDIR% - Text French=%MAINDIR% - Text German=%MAINDIR% - Text Portuguese=%MAINDIR% - Text Spanish=%MAINDIR% - Text Italian=%MAINDIR% - Text Danish=%MAINDIR% - Text Dutch=%MAINDIR% - Text Norwegian=%MAINDIR% - Text Swedish=%MAINDIR% - end - item: Push Button - Rectangle=167 6 212 21 - Create Flags=01010000000000010000000000000001 - Text=OK - Text French=OK - Text German=OK - Text Portuguese=OK - Text Spanish=ACEPTAR - Text Italian=OK - Text Danish=OK - Text Dutch=OK - Text Norwegian=OK - Text Swedish=OK - end - item: Push Button - Rectangle=167 25 212 40 - Variable=MAINDIR - Value=%MAINDIR_SAVE% - Create Flags=01010000000000010000000000000000 - Flags=0000000000000001 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Slet - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - end -end -item: Custom Dialog Set - Name=Select Packages - Display Variable=DISPLAY - item: Dialog - Title=Select Packages - Width=271 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=150 187 195 202 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suite > - Text German=&Weiter > - Text Spanish=&Siguiente > - Text Italian=&Avanti > - end - item: Push Button - Rectangle=105 187 150 202 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=< &Retour - Text German=< &Zurück - Text Spanish=< &Atrás - Text Italian=< &Indietro - end - item: Push Button - Rectangle=211 187 256 202 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=&Cancel - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Static - Rectangle=8 180 256 181 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=86 8 258 28 - Create Flags=01010000000000000000000000000000 - Flags=0000000000000001 - Name=Times New Roman - Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 - Text=Select Packages - Text French=Sélectionner les composants - Text German=Komponenten auswählen - Text Spanish=Seleccione componentes - Text Italian=Selezionare i componenti - end - item: Checkbox - Rectangle=83 62 211 146 - Variable=COMPONENTS LIBS,COMM,OA,OS,PROG,WP,GAMES - Create Flags=01010000000000010000000000000011 - Flags=0000000000000110 - Text=Libraries - Text=Communication - Text=Productivity - Text=Operating System - Text=Programming - Text=Word Processing - Text=Games and Amusements - Text= - end - item: Static - Rectangle=194 162 242 172 - Variable=COMPONENTS, LIBS, COMM, OA, OS, PROG, WP, GAMES - Value=MAINDIR - Create Flags=01010000000000000000000000000010 - end - item: Static - Rectangle=194 153 242 162 - Variable=COMPONENTS, LIBS, COMM, OA, OS, PROG, WP, GAMES - Create Flags=01010000000000000000000000000010 - end - item: Static - Rectangle=107 153 196 164 - Create Flags=01010000000000000000000000000000 - Text=Disk Space Required: - Text French=Espace disque requis : - Text German=Notwendiger Speicherplatz: - Text Spanish=Espacio requerido en el disco: - Text Italian=Spazio su disco necessario: - end - item: Static - Rectangle=107 162 196 172 - Create Flags=01010000000000000000000000000000 - Text=Disk Space Remaining: - Text French=Espace disque disponible : - Text German=Verbleibender Speicherplatz: - Text Spanish=Espacio en disco disponible: - Text Italian=Spazio su disco disponibile: - end - item: Static - Rectangle=80 146 256 175 - Action=1 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=83 30 256 57 - Create Flags=01010000000000000000000000000000 - Text=Choose which package categories to install by checking the boxes below. Press the Options buttons to select individual packages. - Text French=Choisissez les composants que vous voulez installer en cochant les cases ci-dessous. - Text German=Wählen Sie die zu installierenden Komponenten, indem Sie in die entsprechenden Kästchen klicken. - Text Spanish=Elija los componentes que desee instalar marcando los cuadros de abajo. - Text Italian=Scegliere quali componenti installare selezionando le caselle sottostanti. - end - item: Push Button - Rectangle=230 62 254 72 - Variable=LIBS_SAVE - Value=%LIBS% - Destination Dialog=1 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Push Button - Rectangle=230 74 254 84 - Variable=COMM_SAVE - Value=%COMM% - Destination Dialog=2 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Push Button - Rectangle=230 86 254 96 - Variable=OA_SAVE - Value=%OA% - Destination Dialog=3 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Push Button - Rectangle=230 98 254 108 - Variable=OS_SAVE - Value=%OS% - Destination Dialog=4 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Push Button - Rectangle=230 110 254 120 - Variable=PROG_SAVE - Value=%PROG% - Destination Dialog=5 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Push Button - Rectangle=230 122 254 132 - Variable=WP_SAVE - Value=%WP% - Destination Dialog=6 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Push Button - Rectangle=230 134 254 144 - Variable=GAMES_SAVE - Value=%GAMES% - Destination Dialog=7 - Action=2 - Create Flags=01010000000000010000000000000000 - Text=Options - Text French=&Annuler - Text German=&Abbrechen - Text Spanish=&Cancelar - Text Italian=&Annulla - end - item: Set Variable - Variable=COMPONENTS - Value=X - Flags=00000001 - end - end -<<<string.join(map(category_dialog,packages.category_names),"")>>> -end -item: Custom Dialog Set - Name=Select Program Manager Group - Display Variable=DISPLAY - item: Dialog - Title=Select Program Manager Group - Title French=Sélectionnez le Groupe du Gestionnaire de Programmes - Title German=Programm-Managergruppe wählen - Title Portuguese=Seleccionar o Grupo Gestor de Programas - Title Spanish=Seleccione el Grupo del Administrador del Programa - Title Italian=Seleziona il gruppo Program Manager - Title Danish=Vælg Programstyringsgruppen - Title Dutch=Kies Programmabeheergroep. - Title Norwegian=Velg Programbehandlingsgruppen - Title Swedish=Välj grupp i Programhanteraren - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=130 185 172 199 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Flags=0000000000000001 - Text=< &Back - Text French=<&Retour - Text German=<&Zurück - Text Portuguese=<&Retornar - Text Spanish=<&Retroceder - Text Italian=< &Indietro - Text Danish=<&Back - Text Dutch=<&Terug - Text Norwegian=<&Tilbake - Text Swedish=< &Tillbaka - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Slet - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=90 10 260 38 - Create Flags=01010000000000000000000000000000 - Text=Enter the name of the Program Manager group to add %APPTITLE% icons to: - Text French=Entrez le nom du groupe du Gestionnaire de Programmes où placer les icônes %APPTITLE% à : - Text German=Den Namen der Programm-Managergruppe wählen, in der die %APPTITLE%-Symbole gespeichert werden sollen: - Text Portuguese=Introduzir o nome do Grupo Gestor de Programa para acrescentar os ícones %APPTITLE% para: - Text Spanish=Introduzca el nombre del grupo del Administrador del Programa para añadir los iconos %APPTITLE para: - Text Italian=Inserisci il nome del gruppo Program Manager per aggiungere le icone di %APPTITLE% a: - Text Danish=Indtast navnet på Programstyringsgruppen der skal tilføjes %APPTITLE% elementer: - Text Dutch=Breng de naam van de programmabeheergroep in waaraan u %APPTITLE%-pictogrammen wilt toevoegen. - Text Norwegian=Tast inn navnet på programbehandlingsgruppen for å legge %APPTITLE%-ikoner til: - Text Swedish=Skriv in namnet på den grupp i Programhanteraren där du vill ha ikonerna för %APPTITLE%: - end - item: Combobox - Rectangle=90 42 260 148 - Variable=GROUP - Create Flags=01010000001000010000001100000001 - Flags=0000000000000001 - Text=%GROUP% - Text= - Text French=%GROUP% - Text French= - Text German=%GROUP% - Text German= - Text Portuguese=%GROUP% - Text Portuguese= - Text Spanish=%GROUP% - Text Spanish= - Text Italian=%GROUP% - Text Italian= - Text Danish=%GROUP% - Text Danish= - Text Dutch=%GROUP% - Text Dutch= - Text Norwegian=%GROUP% - Text Norwegian= - Text Swedish=%GROUP% - Text Swedish= - end - end -end -item: Custom Dialog Set - Name=Start Installation - Display Variable=DISPLAY - item: Dialog - Title=Start Installation - Title French=Commencer l'installation - Title German=Installation beginnen - Title Portuguese=Iniciar Instalação - Title Spanish=Comenzar la Instalación - Title Italian=Avvia Installazione - Title Danish=Start installationen - Title Dutch=Start de installatie. - Title Norwegian=Start installeringen - Title Swedish=Starta installationen - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=172 185 214 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Next > - Text French=&Suivant> - Text German=&Weiter> - Text Portuguese=&Próximo> - Text Spanish=&Siguiente > - Text Italian=&Avanti > - Text Danish=&Næste> - Text Dutch=&Volgende> - Text Norwegian=&Neste> - Text Swedish=&Nästa > - end - item: Push Button - Rectangle=130 185 172 199 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=<&Retour - Text German=<&Zurück - Text Portuguese=<&Retornar - Text Spanish=<&Retroceder - Text Italian=< &Indietro - Text Danish=<&Tilbage - Text Dutch=<&Terug - Text Norwegian=<&Tilbake - Text Swedish=< &Tillbaka - end - item: Push Button - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Annuller - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=90 10 260 70 - Create Flags=01010000000000000000000000000000 - Text=You are now ready to install %APPTITLE%. - Text= - Text=Press the Next button to begin the installation or the Back button to reenter the installation information. - Text French=Vous êtes maintenant prêt à installer %APPTITLE% - Text French= - Text French=Cliquez sur Suivant pour commencer l'installation ou Retour pour entrer à nouveau les informations d'installation - Text German=Sie sind jetzt zur Installation von %APPTITLE% bereit. - Text German= - Text German=Auf die Schaltfläche Weiter klicken, um mit dem Start der Installation zu beginnen, oder auf die Schaltfläche Zurück, um die Installationsinformationen nochmals aufzurufen. - Text Portuguese=Está agora pronto para instalar %APPTITLE% - Text Portuguese= - Text Portuguese=Pressione o botão Próximo para começar a instalação ou o botão Retornar para introduzir novamente a informação sobre a instalação - Text Spanish=Ahora estará listo para instalar %APPTITLE%. - Text Spanish= - Text Spanish=Pulse el botón de Próximo para comenzar la instalación o el botón Retroceder para volver a introducir la información sobre la instalación. - Text Italian=Sei pronto ad installare %APPTITLE%. - Text Italian= - Text Italian=Premi il tasto Avanti per iniziare l’installazione o il tasto Indietro per rientrare nuovamente nei dati sull’installazione - Text Danish=Du er nu klar til at installere %APPTITLE%. - Text Danish= - Text Danish=Klik på Næste for at starte installationen eller på Tilbage for at ændre installationsoplysningerne. - Text Dutch=U bent nu klaar om %APPTITLE% te installeren. - Text Dutch= - Text Dutch=Druk op Volgende om met de installatie te beginnen of op Terug om de installatie-informatie opnieuw in te voeren. - Text Norwegian=Du er nå klar til å installere %APPTITLE% - Text Norwegian= - Text Norwegian=Trykk på Neste-tasten for å starte installeringen, eller Tilbake-tasten for å taste inn installasjonsinformasjonen på nytt. - Text Swedish=Du är nu redo att installera %APPTITLE%. - Text Swedish= - Text Swedish=Tryck på Nästa för att starta installationen eller på Tillbaka för att skriva in installationsinformationen på nytt. - end - end -end -item: If/While Statement - Variable=DISPLAY - Value=Select Destination Directory -end -item: Set Variable - Variable=BACKUP - Value=%MAINDIR%\BACKUP -end -item: End Block -end -item: End Block -end -item: If/While Statement - Variable=DOBACKUP - Value=A -end -item: Set Variable - Variable=BACKUPDIR - Value=%BACKUP% -end -item: End Block -end -item: Open/Close INSTALL.LOG -end -item: Check Disk Space - Component=COMPONENTS -end -item: Display Graphic - Pathname=<<<dirs.source>>>\nt\Wise\xemacs-beta.bmp - X Position=32784 - Y Position=16 -end -item: Include Script - Pathname=%_WISE_%\INCLUDE\uninstal.wse -end -<<<ifblock("COMPONENTS","X")>>> -<<<string.join(map(lambda x:install_file(x[0],x[1],x[2]),filelist.all),"")>>> -<<<endblock()>>> -<<<map(do_category,packages.category_names)>>> -item: Set Variable - Variable=COMMON - Value=%COMMON% - Flags=00010100 -end -item: Set Variable - Variable=MAINDIR - Value=%MAINDIR% - Flags=00010100 -end -item: Check Configuration - Flags=10111011 -end -item: Get Registry Key Value - Variable=STARTUPDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%WIN%\Start Menu\Programs\StartUp - Value Name=StartUp - Flags=00000010 -end -item: Get Registry Key Value - Variable=DESKTOPDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%WIN%\Desktop - Value Name=Desktop - Flags=00000010 -end -item: Get Registry Key Value - Variable=STARTMENUDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%WIN%\Start Menu - Value Name=Start Menu - Flags=00000010 -end -item: Get Registry Key Value - Variable=GROUPDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%WIN%\Start Menu\Programs - Value Name=Programs - Flags=00000010 -end -item: Get Registry Key Value - Variable=CSTARTUPDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%STARTUPDIR% - Value Name=Common Startup - Flags=00000100 -end -item: Get Registry Key Value - Variable=CDESKTOPDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%DESKTOPDIR% - Value Name=Common Desktop - Flags=00000100 -end -item: Get Registry Key Value - Variable=CSTARTMENUDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%STARTMENUDIR% - Value Name=Common Start Menu - Flags=00000100 -end -item: Get Registry Key Value - Variable=CGROUPDIR - Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders - Default=%GROUPDIR% - Value Name=Common Programs - Flags=00000100 -end -item: Set Variable - Variable=CGROUP_SAVE - Value=%GROUP% -end -item: Set Variable - Variable=GROUP - Value=%GROUPDIR%\%GROUP% -end -item: Create Shortcut - Source=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32\runemacs.exe - Destination=%GROUP%\XEmacs.lnk - Working Directory=\ - Icon Number=0 -end -item: Create Shortcut - Source=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32\runemacs.exe - Destination=%DESKTOPDIR%\XEmacs.lnk - Working Directory=\ - Icon Number=0 -end -item: Else Statement -end -item: Add ProgMan Icon - Group=%GROUP% - Icon Name=XEmacs - Command Line=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32\runemacs.exe - Default Directory=\ - Flags=01000000 -end -item: End Block -end -item: Edit Registry - Total Keys=16 - item: Key - Key=SOFTWARE\GNU\XEmacs - New Value=%MAINDIR% - Value Name=emacs_dir - Root=2 - end - item: Key - Key=SOFTWARE\GNU\XEmacs - New Value=%MAINDIR%\xemacs-packages - Value Name=EMACSPACKAGEPATH - Root=2 - end - item: Key - Key=SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\runemacs.exe - New Value=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32 - Value Name=Path - Root=2 - end - item: Key - Key=SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\xemacs.exe - New Value=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32 - Value Name=Path - Root=2 - end - item: Key - Key=.el - New Value=elfile - end - item: Key - Key=.el - New Value=text/plain - Value Name=Content Type - end - item: Key - Key=elfile - New Value=Emacs lisp - end - item: Key - Key=elfile - New Value=00 00 01 00 - Value Name=EditFlags - Data Type=4 - end - item: Key - Key=elfile\DefaultIcon - New Value=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32\runemacs.exe,2 - end - item: Key - Key=elfile\QuickView - New Value=* - end - item: Key - Key=elfile\Shell - New Value= - end - item: Key - Key=elfile\Shell\open - end - item: Key - Key=elfile\Shell\open\command - New Value=%MAINDIR%\<<<dirs.dst>>>\i386-pc-win32\runemacs.exe "%%1" - end - item: Key - Key=elfile\Shell\open\ddeexec - New Value=open("%%1") - end - item: Key - Key=elfile\Shell\open\ddeexec\Application - New Value=XEmacs - New Value= - end - item: Key - Key=elfile\Shell\open\ddeexec\topic - New Value=System - end -end -item: Wizard Block - Direction Variable=DIRECTION - Display Variable=DISPLAY - Bitmap Pathname=<<<dirs.source>>>\nt\Wise\gnu.bmp - X Position=9 - Y Position=10 - Filler Color=8421440 - Flags=00000011 -end -item: Custom Dialog Set - Name=Finished - Display Variable=DISPLAY - item: Dialog - Title=Installation Complete - Title French=Installation en cours - Title German=Installation abgeschlossen - Title Portuguese=Instalação Completa - Title Spanish=Se ha completado la Instalación - Title Italian=Installazione completata - Title Danish=Installation gennemført - Title Dutch=Installatie afgerond - Title Norwegian=Installasjonen er fullført - Title Swedish=Installationen klar - Width=280 - Height=224 - Font Name=Helv - Font Size=8 - item: Push Button - Rectangle=170 185 212 199 - Variable=DIRECTION - Value=N - Create Flags=01010000000000010000000000000001 - Text=&Finish > - Text French=&Terminer> - Text German=&Fertigstellen> - Text Portuguese=&Terminar > - Text Spanish=&Finalizar> - Text Italian=&Fine > - Text Danish=&Afslut > - Text Dutch=&Klaar> - Text Norwegian=&Avslutt> - Text Swedish=&Sluta> - end - item: Push Button - Control Name=CANCEL - Rectangle=222 185 264 199 - Action=3 - Create Flags=01010000000000010000000000000000 - Text=Cancel - Text French=Annuler - Text German=Abbrechen - Text Portuguese=Cancelar - Text Spanish=Cancelar - Text Italian=Annulla - Text Danish=Annuller - Text Dutch=Annuleren - Text Norwegian=Avbryt - Text Swedish=Avbryt - end - item: Static - Rectangle=9 177 263 178 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=90 10 260 63 - Enabled Color=00000000000000001111111111111111 - Create Flags=01010000000000000000000000000000 - Text=%APPTITLE% has been successfully installed. - Text= - Text= - Text=Press the Finish button to exit this installation. - Text= - Text French=L'installation de %APPTITLE% est réussie - Text French= - Text French= - Text French=Cliquez sur Terminer pour quitter cette installation - Text French= - Text German=%APPTITLE% wurde erfolgreich installiert. - Text German= - Text German= - Text German=Zum Beenden dieser Installation Fertigstellen anklicken. - Text German= - Text Portuguese=%APPTITLE% foi instalado com êxito - Text Portuguese= - Text Portuguese= - Text Portuguese=Pressionar o botão Terminar para sair desta instalação - Text Portuguese= - Text Spanish=%APPTITLE% se ha instalado con éxito. - Text Spanish= - Text Spanish= - Text Spanish=Pulse el botón de Finalizar para salir de esta instalación. - Text Spanish= - Text Italian=%APPTITLE% è stato installato. - Text Italian= - Text Italian= - Text Italian=Premi il pulsante Fine per uscire dal programma di installazione - Text Italian= - Text Danish=%APPTITLE% er nu installeret korrekt. - Text Danish= - Text Danish= - Text Danish=Klik på Afslut for at afslutte installationen. - Text Danish= - Text Dutch=%APPTITLE% is met succes geïnstalleerd. - Text Dutch= - Text Dutch= - Text Dutch=Druk op Klaar om deze installatie af te ronden. - Text Dutch= - Text Norwegian=Installasjonen av %APPTITLE% er suksessfull. - Text Norwegian= - Text Norwegian= - Text Norwegian=Trykk på Avslutt-tasten for å avslutte denne installasjonen. - Text Norwegian= - Text Swedish=Installationen av %APPTITLE% har lyckats. - Text Swedish= - Text Swedish= - Text Swedish=Tryck på Sluta för att gå ur installationsprogrammet. - Text Swedish= - end - item: Push Button - Control Name=BACK - Rectangle=128 185 170 199 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=<&Retour - Text German=<&Zurück - Text Portuguese=<&Retornar - Text Spanish=<&Retroceder - Text Italian=< &Indietro - Text Danish=<&Tilbage - Text Dutch=<&Terug - Text Norwegian=<&Tilbake - Text Swedish=< &Tillbaka - end - item: Set Control Attribute - Control Name=BACK - Operation=1 - end - item: Set Control Attribute - Control Name=CANCEL - Operation=1 - end - end -end -item: End Block -end -item: New Event - Name=Cancel -end -item: Include Script - Pathname=%_WISE_%\INCLUDE\rollback.wse -end diff -r 12e008d41344 -r 697ef44129c6 nt/minitar.c --- a/nt/minitar.c Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/minitar.c Mon Aug 13 11:20:41 2007 +0200 @@ -13,7 +13,7 @@ #include <stdio.h> -#include <errno.h> +#include <Errno.h> #include <zlib.h> @@ -43,6 +43,7 @@ { char tmp[MAXNAMELEN]; char *cp; + extern int errno; for (cp=path; cp; cp = (char*)strchr(cp+1,'/')){ if (!*cp) @@ -203,7 +204,6 @@ in_block = 0; } } - exit (0); } diff -r 12e008d41344 -r 697ef44129c6 nt/minitar.mak --- a/nt/minitar.mak Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/minitar.mak Mon Aug 13 11:20:41 2007 +0200 @@ -1,12 +1,10 @@ ZLIB=\path\to\zlib -LIB_SRC=. -NT=. -all: $(LIB_SRC)\minitar.exe +all: minitar.exe -$(LIB_SRC)\minitar.exe: $(LIB_SRC)\minitar.obj - cl -o $@ $(LIB_SRC)\minitar.obj $(ZLIB)\zlib.lib +minitar.exe: minitar.obj + cl -o minitar.exe minitar.obj $(ZLIB)\zlib.lib -$(LIB_SRC)\minitar.obj: $(NT)\minitar.c - cl -Fo$@ -c $(NT)\minitar.c -I $(ZLIB) +minitar.obj: minitar.c + cl -c minitar.c -I $(ZLIB) diff -r 12e008d41344 -r 697ef44129c6 nt/runemacs.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nt/runemacs.c Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,185 @@ +/* + 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 <windows.h> +#include <string.h> +#include <malloc.h> + +#if defined(__CYGWIN32__) +#include <sys/types.h> +#include <sys/stat.h> +#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 12e008d41344 -r 697ef44129c6 nt/xemacs.dsp --- a/nt/xemacs.dsp Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1392 +0,0 @@ -# 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 12e008d41344 -r 697ef44129c6 nt/xemacs.dsw --- a/nt/xemacs.dsw Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.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 12e008d41344 -r 697ef44129c6 nt/xemacs.mak --- a/nt/xemacs.mak Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/xemacs.mak Mon Aug 13 11:20:41 2007 +0200 @@ -24,28 +24,15 @@ # 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 "$(XEMACS)\version.sh" - -!include "config.inc" +!include "..\version.sh" !if !defined(INFODOCK) INFODOCK=0 @@ -56,8 +43,6 @@ 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) @@ -69,9 +54,7 @@ !endif PROGRAM_DEFINES= \ -DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\" \ - -DPATH_PROGNAME=\"xemacs\" \ - -DEMACS_VERSION=\"$(XEMACS_VERSION_STRING)\" \ - -DEMACS_PROGNAME=\"xemacs\" + -DPATH_PROGNAME=\"xemacs\" !endif # @@ -98,11 +81,11 @@ ! endif !endif PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)" -!if !defined(HAVE_MS_WINDOWS) -HAVE_MS_WINDOWS=1 +!if !defined(HAVE_MSW) +HAVE_MSW=1 !endif -!if !defined(HAVE_X_WINDOWS) -HAVE_X_WINDOWS=0 +!if !defined(HAVE_X) +HAVE_X=0 !endif !if !defined(HAVE_XPM) HAVE_XPM=0 @@ -134,43 +117,18 @@ !if !defined(HAVE_NATIVE_SOUND) HAVE_NATIVE_SOUND=1 !endif -!if !defined(HAVE_WIDGETS) -HAVE_WIDGETS=1 -!endif !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 -!if !defined(USE_MINITAR) -USE_MINITAR=1 -!endif !if !defined(USE_MINIMAL_TAGBITS) USE_MINIMAL_TAGBITS=0 !endif !if !defined(USE_INDEXED_LRECORD_IMPLEMENTATION) USE_INDEXED_LRECORD_IMPLEMENTATION=0 !endif -!if !defined(USE_PORTABLE_DUMPER) -USE_PORTABLE_DUMPER=0 -!endif -!if !defined(GUNG_HO) -GUNG_HO=0 -!endif - -# A little bit of adhockery. Default to use system malloc and -# DLL version of the C runtime library when using portable -# dumping. These are the optimal settings. -!if !defined(USE_SYSTEM_MALLOC) -USE_SYSTEM_MALLOC=$(USE_PORTABLE_DUMPER) -!endif -!if !defined(USE_CRTDLL) -USE_CRTDLL=$(USE_PORTABLE_DUMPER) -!endif # # System configuration @@ -198,80 +156,67 @@ !message Cannot build InfoDock without InfoDock sources CONFIG_ERROR=1 !endif -!if !$(USE_PORTABLE_DUMPER) && $(USE_SYSTEM_MALLOC) -!message Cannot use system allocator when dumping old way, use portable dumper. -CONFIG_ERROR=1 -!endif -!if !$(USE_PORTABLE_DUMPER) && $(USE_CRTDLL) -!message Cannot use C runtime DLL when dumping old way, use portable dumper. +!if !$(HAVE_MSW) && !$(HAVE_X) +!message Please specify at least one HAVE_MSW=1 and/or HAVE_X=1 CONFIG_ERROR=1 !endif -!if !$(USE_SYSTEM_MALLOC) && $(USE_CRTDLL) -!message GNU malloc currently cannot be used with CRT DLL. -!message [[[Developer note: If you want to fix it, read Q112297 first]]] #### -CONFIG_ERROR=1 -!endif -!if !$(HAVE_MS_WINDOWS) && !$(HAVE_X_WINDOWS) -!message Please specify at least one HAVE_MS_WINDOWS=1 and/or HAVE_X_WINDOWS=1 -CONFIG_ERROR=1 -!endif -!if $(HAVE_X_WINDOWS) && !defined(X11_DIR) +!if $(HAVE_X) && !defined(X11_DIR) !message Please specify root directory for your X11 installation: X11_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_X_WINDOWS) && defined(X11_DIR) && !exist("$(X11_DIR)\LIB\X11.LIB") +!if $(HAVE_X) && 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_MS_WINDOWS) && $(HAVE_XPM) && !defined(XPM_DIR) +!if $(HAVE_MSW) && $(HAVE_XPM) && !defined(XPM_DIR) !message Please specify root directory for your XPM installation: XPM_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_XPM) && defined(XPM_DIR) && !exist("$(XPM_DIR)\lib\Xpm.lib") +!if $(HAVE_MSW) && $(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_MS_WINDOWS) && $(HAVE_PNG) && !defined(PNG_DIR) +!if $(HAVE_MSW) && $(HAVE_PNG) && !defined(PNG_DIR) !message Please specify root directory for your PNG installation: PNG_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && defined(PNG_DIR) && !exist("$(PNG_DIR)\libpng.lib") +!if $(HAVE_MSW) && $(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_MS_WINDOWS) && $(HAVE_PNG) && !defined(ZLIB_DIR) +!if $(HAVE_MSW) && $(HAVE_PNG) && !defined(ZLIB_DIR) !message Please specify root directory for your ZLIB installation: ZLIB_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_PNG) && defined(ZLIB_DIR) && !exist("$(ZLIB_DIR)\zlib.lib") +!if $(HAVE_MSW) && $(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_MS_WINDOWS) && $(HAVE_TIFF) && !defined(TIFF_DIR) +!if $(HAVE_MSW) && $(HAVE_TIFF) && !defined(TIFF_DIR) !message Please specify root directory for your TIFF installation: TIFF_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_TIFF) && !exist("$(TIFF_DIR)\libtiff\libtiff.lib") +!if $(HAVE_MSW) && $(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_MS_WINDOWS) && $(HAVE_JPEG) && !defined(JPEG_DIR) +!if $(HAVE_MSW) && $(HAVE_JPEG) && !defined(JPEG_DIR) !message Please specify root directory for your JPEG installation: JPEG_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_JPEG) && !exist("$(JPEG_DIR)\libjpeg.lib") +!if $(HAVE_MSW) && $(HAVE_JPEG) && !exist("$(JPEG_DIR)\libjpeg.lib") !message Specified JPEG directory does not contain "$(JPEG_DIR)\libjpeg.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_XFACE) && !defined(COMPFACE_DIR) +!if $(HAVE_MSW) && $(HAVE_XFACE) && !defined(COMPFACE_DIR) !message Please specify root directory for your COMPFACE installation: COMPFACE_DIR=path CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_XFACE) && !exist("$(COMPFACE_DIR)\libcompface.lib") +!if $(HAVE_MSW) && $(HAVE_XFACE) && !exist("$(COMPFACE_DIR)\libcompface.lib") !message Specified COMPFACE directory does not contain "$(COMPFACE_DIR)\libcompface.lib" CONFIG_ERROR=1 !endif -!if $(HAVE_MS_WINDOWS) && $(HAVE_TOOLBARS) && !$(HAVE_XPM) +!if $(HAVE_MSW) && $(HAVE_TOOLBARS) && !$(HAVE_XPM) !message Toolbars require XPM support CONFIG_ERROR=1 !endif @@ -288,31 +233,7 @@ !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/^\x23ifdef (.+)/!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. +# Compiler command echo control. Define VERBOSECC=1 to get vebose compilation. # !if !defined(VERBOSECC) VERBOSECC=0 @@ -329,34 +250,21 @@ OPT=-O2 -G5 !endif -!if $(USE_CRTDLL) -!if $(DEBUG_XEMACS) -C_LIBFLAG=-MDd -LIBC_LIB=msvcrtd.lib -!else -C_LIBFLAG=-MD -LIBC_LIB=msvcrt.lib -!endif -!else -C_LIBFLAG=-ML -LIBC_LIB=libc.lib -!endif +CFLAGS=-nologo -W3 $(OPT) -CFLAGS=-nologo -W3 $(OPT) $(C_LIBFLAG) - -!if $(HAVE_X_WINDOWS) +!if $(HAVE_X) 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_MS_WINDOWS) +!if $(HAVE_MSW) 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=$(SRC)\dired-msw.c +MSW_C_DIRED_SRC=$(XEMACS)\src\dired-msw.c MSW_C_DIRED_OBJ=$(OUTDIR)\dired-msw.obj !endif !if $(HAVE_XPM) @@ -366,7 +274,7 @@ !endif !if $(HAVE_GIF) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_GIF -MSW_GIF_SRC=$(SRC)\dgif_lib.c $(SRC)\gif_io.c +MSW_GIF_SRC=$(XEMACS)\src\dgif_lib.c $(XEMACS)\src\gif_io.c MSW_GIF_OBJ=$(OUTDIR)\dgif_lib.obj $(OUTDIR)\gif_io.obj !endif !if $(HAVE_PNG) @@ -391,18 +299,15 @@ !endif !if $(HAVE_TOOLBARS) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_TOOLBARS -MSW_TOOLBAR_SRC=$(SRC)\toolbar.c $(SRC)\toolbar-msw.c +MSW_TOOLBAR_SRC=$(XEMACS)\src\toolbar.c $(XEMACS)\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=$(SRC)\dialog.c $(SRC)\dialog-msw.c +MSW_DIALOG_SRC=$(XEMACS)\src\dialog.c $(XEMACS)\src\dialog-msw.c MSW_DIALOG_OBJ=$(OUTDIR)\dialog.obj $(OUTDIR)\dialog-msw.obj !endif -!if $(HAVE_WIDGETS) -MSW_DEFINES=$(MSW_DEFINES) -DHAVE_WIDGETS -!endif !if $(HAVE_NATIVE_SOUND) MSW_DEFINES=$(MSW_DEFINES) -DHAVE_NATIVE_SOUND !endif @@ -417,10 +322,6 @@ DEBUG_FLAGS=-debug:full !endif -!if $(QUICK_BUILD) -QUICK_DEFINES=-DQUICK_BUILD -!endif - !if $(USE_MINIMAL_TAGBITS) TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS !endif @@ -431,16 +332,6 @@ UNION_DEFINES=-DUSE_UNION_TYPE !endif -!if $(USE_PORTABLE_DUMPER) -DUMPER_DEFINES=-DPDUMP -!endif - -!if $(USE_SYSTEM_MALLOC) -MALLOC_DEFINES=-DSYSTEM_MALLOC -!else -MALLOC_DEFINES=-DGNU_MALLOC -!endif - # Hard-coded paths !if $(INFODOCK) @@ -453,38 +344,40 @@ # Generic variables -INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(LWLIB_SRCDIR) +INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \ $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \ - $(DUMPER_DEFINES) $(MALLOC_DEFINES) $(QUICK_DEFINES) \ - -DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \ + -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \ -DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES) #------------------------------------------------------------------------------ +default: $(OUTDIR)\nul all + $(OUTDIR)\nul: -@mkdir $(OUTDIR) XEMACS_INCLUDES=\ - $(SRC)\config.h \ - $(SRC)\Emacs.ad.h \ - $(SRC)\paths.h + $(XEMACS)\src\config.h \ + $(XEMACS)\src\Emacs.ad.h \ + $(XEMACS)\src\paths.h -$(SRC)\config.h: config.h - copy config.h $(SRC) +$(XEMACS)\src\config.h: config.h + copy config.h $(XEMACS)\src -$(SRC)\Emacs.ad.h: Emacs.ad.h - copy Emacs.ad.h $(SRC) +$(XEMACS)\src\Emacs.ad.h: Emacs.ad.h + copy Emacs.ad.h $(XEMACS)\src -$(SRC)\paths.h: paths.h - copy paths.h $(SRC) +$(XEMACS)\src\paths.h: paths.h + copy paths.h $(XEMACS)\src #------------------------------------------------------------------------------ # lib-src programs -LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE +LIB_SRC = $(XEMACS)\lib-src +LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32 -DWINDOWSNT # # Creating config.values to be used by config.el @@ -512,61 +405,45 @@ # 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 setargv.obj - cd $(NT) + @cd $(LIB_SRC) + $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no + @cd $(NT) # Individual dependencies ETAGS_DEPS = $(LIB_SRC)/getopt.c $(LIB_SRC)/getopt1.c $(LIB_SRC)/../src/regex.c $(LIB_SRC)/etags.exe : $(LIB_SRC)/etags.c $(ETAGS_DEPS) $(LIB_SRC)/movemail.exe: $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS) - cd $(LIB_SRC) + @cd $(LIB_SRC) $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** wsock32.lib -link -incremental:no - cd $(NT) -$(LIB_SRC)/minitar.exe : $(NT)/minitar.mak $(NT)/minitar.c - nmake -nologo -f minitar.mak ZLIB="$(ZLIB_DIR)" NT="$(NT)" LIB_SRC="$(LIB_SRC)" + @cd $(NT) LIB_SRC_TOOLS = \ - $(LIB_SRC)/etags.exe \ + $(LIB_SRC)/make-docfile.exe \ $(LIB_SRC)/hexl.exe \ - $(LIB_SRC)/i.exe \ - $(LIB_SRC)/make-docfile.exe \ + $(LIB_SRC)/movemail.exe \ $(LIB_SRC)/mmencode.exe \ - $(LIB_SRC)/movemail.exe \ $(LIB_SRC)/sorted-doc.exe \ - $(LIB_SRC)/wakeup.exe -!if $(USE_MINITAR) -LIB_SRC_TOOLS = \ - $(LIB_SRC_TOOLS) \ - $(LIB_SRC)/minitar.exe -!endif -!if $(USE_PORTABLE_DUMPER) -LIB_SRC_TOOLS = \ - $(XEMACS_INCLUDES) \ - $(LIB_SRC)/make-dump-id.exe \ - $(LIB_SRC_TOOLS) -!endif - -# Shorthand target -minitar: $(LIB_SRC)/minitar.exe + $(LIB_SRC)/wakeup.exe \ + $(LIB_SRC)/etags.exe #------------------------------------------------------------------------------ -# dump-id.c file that contains the dump id +# runxemacs proglet + +RUNEMACS = $(XEMACS)\src\runxemacs.exe -$(SRC)\dump-id.c : $(LIB_SRC)/make-dump-id.exe - cd $(SRC) - $(LIB_SRC)\make-dump-id.exe - cd $(NT) +$(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$@ $** #------------------------------------------------------------------------------ # LASTFILE Library -!if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER) - LASTFILE=$(OUTDIR)\lastfile.lib -LASTFILE_SRC=$(SRC) +LASTFILE_SRC=$(XEMACS)\src LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c LASTFILE_OBJS= \ $(OUTDIR)\lastfile.obj @@ -577,15 +454,14 @@ $(OUTDIR)\lastfile.obj: $(LASTFILE_SRC)\lastfile.c $(CCV) $(LASTFILE_FLAGS) $** -!endif - #------------------------------------------------------------------------------ -!if $(HAVE_X_WINDOWS) +!if $(HAVE_X) # 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 \ @@ -602,25 +478,25 @@ $(LWLIB): $(LWLIB_OBJS) link.exe -lib -nologo -out:$@ $(LWLIB_OBJS) -$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRCDIR)\lwlib-config.c +$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRC)\lwlib-config.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRCDIR)\lwlib-utils.c +$(OUTDIR)\lwlib-utils.obj: $(LWLIB_SRC)\lwlib-utils.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRCDIR)\lwlib-Xaw.c +$(OUTDIR)\lwlib-Xaw.obj: $(LWLIB_SRC)\lwlib-Xaw.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRCDIR)\lwlib-Xlw.c +$(OUTDIR)\lwlib-Xlw.obj: $(LWLIB_SRC)\lwlib-Xlw.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\lwlib.obj: $(LWLIB_SRCDIR)\lwlib.c +$(OUTDIR)\lwlib.obj: $(LWLIB_SRC)\lwlib.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRCDIR)\xlwmenu.c +$(OUTDIR)\xlwmenu.obj: $(LWLIB_SRC)\xlwmenu.c $(CCV) $(LWLIB_FLAGS) $** -$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRCDIR)\xlwscrollbar.c +$(OUTDIR)\xlwscrollbar.obj: $(LWLIB_SRC)\xlwscrollbar.c $(CCV) $(LWLIB_FLAGS) $** !endif @@ -628,135 +504,138 @@ DOC=$(LIB_SRC)\DOC DOC_SRC1=\ - $(SRC)\abbrev.c \ - $(SRC)\alloc.c \ - $(SRC)\alloca.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 + $(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 DOC_SRC2=\ - $(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 + $(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 DOC_SRC3=\ - $(SRC)\font-lock.c \ - $(SRC)\frame.c \ - $(SRC)\general.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 + $(XEMACS)\src\font-lock.c \ + $(XEMACS)\src\frame.c \ + $(XEMACS)\src\free-hook.c \ + $(XEMACS)\src\general.c \ + $(XEMACS)\src\glyphs.c \ + $(XEMACS)\src\glyphs-eimage.c \ + $(XEMACS)\src\glyphs-widget.c \ + $(XEMACS)\src\gmalloc.c \ + $(XEMACS)\src\gui.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 DOC_SRC4=\ - $(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 + $(XEMACS)\src\md5.c \ + $(XEMACS)\src\menubar.c \ + $(XEMACS)\src\minibuf.c \ + $(XEMACS)\src\nt.c \ + $(XEMACS)\src\ntheap.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\signal.c \ + $(XEMACS)\src\sound.c DOC_SRC5=\ - $(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)\widget.c + $(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\unexnt.c \ + $(XEMACS)\src\vm-limit.c \ + $(XEMACS)\src\window.c \ + $(XEMACS)\src\widget.c -!if $(HAVE_X_WINDOWS) +!if $(HAVE_X) DOC_SRC6=\ - $(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 + $(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\xselect.c !endif -!if $(HAVE_MS_WINDOWS) +!if $(HAVE_MSW) DOC_SRC7=\ - $(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 \ + $(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 \ $(MSW_C_DIRED_SRC) \ $(MSW_TOOLBAR_SRC) \ $(MSW_DIALOG_SRC) \ @@ -765,34 +644,18 @@ !if $(HAVE_MULE) DOC_SRC8=\ - $(SRC)\mule.c \ - $(SRC)\mule-charset.c \ - $(SRC)\mule-ccl.c -! if $(HAVE_X_WINDOWS) - DOC_SRC8=$(DOC_SRC8) $(SRC)\input-method-xlib.c + $(XEMACS)\src\mule.c \ + $(XEMACS)\src\mule-charset.c \ + $(XEMACS)\src\mule-ccl.c \ + $(XEMACS)\src\mule-coding.c +! if $(HAVE_X) + DOC_SRC8=$(DOC_SRC8) $(XEMACS)\src\input-method-xlib.c ! endif !endif !if $(DEBUG_XEMACS) DOC_SRC9=\ - $(SRC)\debug.c \ - $(SRC)\tests.c -!endif - -!if !$(USE_SYSTEM_MALLOC) -DOC_SRC10=\ - $(SRC)\free-hook.c \ - $(SRC)\gmalloc.c \ - $(SRC)\ntheap.c \ - $(SRC)\vm-limit.c -!endif - -!if !$(USE_PORTABLE_DUMPER) -DOC_SRC11=\ - $(SRC)\unexnt.c -!else -DOC_SRC11=\ - $(SRC)\dumper.c + $(XEMACS)\src\debug.c !endif #------------------------------------------------------------------------------ @@ -804,33 +667,27 @@ EMACS_BETA_VERSION=-DEMACS_BETA_VERSION=$(emacs_beta_version) !ENDIF -!if !$(USE_PORTABLE_DUMPER) -TEMACS_ENTRYPOINT=-entry:_start -!else -TEMACS_ENTRYPOINT=-entry:mainCRTStartup -!endif - -TEMACS_DIR=$(SRC) +TEMACS_DIR=$(XEMACS)\src TEMACS=$(TEMACS_DIR)\temacs.exe TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc -TEMACS_SRC=$(SRC) +TEMACS_SRC=$(XEMACS)\src TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \ - oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib \ - shell32.lib wsock32.lib winmm.lib winspool.lib ole32.lib uuid.lib $(LIBC_LIB) + kernel32.lib user32.lib gdi32.lib advapi32.lib \ + shell32.lib wsock32.lib winmm.lib libc.lib TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\ - -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows\ + -stack:0x800000 -entry:_start -subsystem:console\ -pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \ - -heap:0x00100000 -nodefaultlib -incremental:no setargv.obj -TEMACS_CPP_FLAGS=-c \ + -heap:0x00100000 -out:$@ +TEMACS_CPP_FLAGS=-ML -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:&=and)\" \ + -DXEMACS_CODENAME=\"$(xemacs_codename)\" \ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" -!if $(HAVE_X_WINDOWS) +!if $(HAVE_X) TEMACS_X_OBJS=\ $(OUTDIR)\balloon-x.obj \ $(OUTDIR)\balloon_help.obj \ @@ -852,10 +709,10 @@ $(OUTDIR)\scrollbar-x.obj \ $(OUTDIR)\xgccache.obj \ $(OUTDIR)\xmu.obj \ - $(OUTDIR)\select-x.obj + $(OUTDIR)\xselect.obj !endif -!if $(HAVE_MS_WINDOWS) +!if $(HAVE_MSW) TEMACS_MSW_OBJS=\ $(OUTDIR)\console-msw.obj \ $(OUTDIR)\device-msw.obj \ @@ -878,8 +735,9 @@ TEMACS_MULE_OBJS=\ $(OUTDIR)\mule.obj \ $(OUTDIR)\mule-charset.obj \ - $(OUTDIR)\mule-ccl.obj -! if $(HAVE_X_WINDOWS) + $(OUTDIR)\mule-ccl.obj \ + $(OUTDIR)\mule-coding.obj +! if $(HAVE_X) TEMACS_MULE_OBJS=\ $(TEMACS_MULE_OBJS) $(OUTDIR)\input-method-xlib.obj ! endif @@ -887,24 +745,7 @@ !if $(DEBUG_XEMACS) TEMACS_DEBUG_OBJS=\ - $(OUTDIR)\debug.obj \ - $(OUTDIR)\tests.obj -!endif - -!if !$(USE_SYSTEM_MALLOC) -TEMACS_ALLOC_OBJS=\ - $(OUTDIR)\free-hook.obj \ - $(OUTDIR)\gmalloc.obj \ - $(OUTDIR)\ntheap.obj \ - $(OUTDIR)\vm-limit.obj -!endif - -!if !$(USE_PORTABLE_DUMPER) -TEMACS_DUMP_OBJS=\ - $(OUTDIR)\unexnt.obj -!else -TEMACS_DUMP_OBJS=\ - $(OUTDIR)\dumper.obj + $(OUTDIR)\debug.obj !endif TEMACS_OBJS= \ @@ -913,8 +754,6 @@ $(TEMACS_CODING_OBJS)\ $(TEMACS_MULE_OBJS)\ $(TEMACS_DEBUG_OBJS)\ - $(TEMACS_ALLOC_OBJS)\ - $(TEMACS_DUMP_OBJS)\ $(OUTDIR)\abbrev.obj \ $(OUTDIR)\alloc.obj \ $(OUTDIR)\alloca.obj \ @@ -952,12 +791,13 @@ $(OUTDIR)\fns.obj \ $(OUTDIR)\font-lock.obj \ $(OUTDIR)\frame.obj \ + $(OUTDIR)\free-hook.obj \ $(OUTDIR)\general.obj \ $(OUTDIR)\glyphs.obj \ $(OUTDIR)\glyphs-eimage.obj \ $(OUTDIR)\glyphs-widget.obj \ + $(OUTDIR)\gmalloc.obj \ $(OUTDIR)\gui.obj \ - $(OUTDIR)\gutter.obj \ $(OUTDIR)\hash.obj \ $(OUTDIR)\indent.obj \ $(OUTDIR)\imgproc.obj \ @@ -973,6 +813,7 @@ $(OUTDIR)\md5.obj \ $(OUTDIR)\minibuf.obj \ $(OUTDIR)\nt.obj \ + $(OUTDIR)\ntheap.obj \ $(OUTDIR)\ntplay.obj \ $(OUTDIR)\ntproc.obj \ $(OUTDIR)\objects.obj \ @@ -988,7 +829,6 @@ $(OUTDIR)\regex.obj \ $(OUTDIR)\scrollbar.obj \ $(OUTDIR)\search.obj \ - $(OUTDIR)\select.obj \ $(OUTDIR)\signal.obj \ $(OUTDIR)\sound.obj \ $(OUTDIR)\specifier.obj \ @@ -998,13 +838,16 @@ $(OUTDIR)\sysdep.obj \ $(OUTDIR)\tparam.obj \ $(OUTDIR)\undo.obj \ + $(OUTDIR)\unexnt.obj \ + $(OUTDIR)\vm-limit.obj \ $(OUTDIR)\widget.obj \ - $(OUTDIR)\window.obj + $(OUTDIR)\window.obj \ + $(OUTDIR)\xemacs.res # Rules .SUFFIXES: -.SUFFIXES: .c .obj .texi .info +.SUFFIXES: .c # nmake rule !if $(DEBUG_XEMACS) @@ -1015,8 +858,6 @@ $(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$@ @@ -1031,292 +872,28 @@ #$(TEMACS_SRC)\paths.h: $(TEMACS_SRC)\paths.h.in # !"cd $(TEMACS_SRC); cp paths.h.in paths.h" -$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) $(OUTDIR)\xemacs.res +$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS) !if $(DEBUG_XEMACS) @dir /b/s $(OUTDIR)\*.sbr > bscmake.tmp bscmake -nologo -o$(TEMACS_BROWSE) @bscmake.tmp - @$(DEL) bscmake.tmp + @del bscmake.tmp !endif -!if $(USE_PORTABLE_DUMPER) - @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) -out:$@ $(TEMACS_OBJS) $(TEMACS_LIBS) $(OUTDIR)\dump-id.obj + $(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS) << -!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 - -blddir=$(MAKEDIR:\=\\)\\.. -temacs_loadup=$(TEMACS_BATCH) -l $(LISP)/loadup.el -dump_temacs = $(temacs_loadup) dump -run_temacs = $(temacs_loadup) run-temacs -## We have automated tests!! -testdir=../tests/automated -batch_test_emacs=-batch -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir) - -# .PHONY: check check-temacs - -check: - cd $(SRC) - $(PROGNAME) $(batch_test_emacs) - -check-temacs: - 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=$(XEMACS_BATCH) -l texinfmt -f batch-texinfo-format -!endif - -MANDIR = $(XEMACS)\man -INFODIR = $(XEMACS)\info -INFO_FILES= \ - $(INFODIR)\cl.info \ - $(INFODIR)\custom.info \ - $(INFODIR)\emodules.info \ - $(INFODIR)\external-widget.info \ - $(INFODIR)\info.info \ - $(INFODIR)\standards.info \ - $(INFODIR)\term.info \ - $(INFODIR)\termcap.info \ - $(INFODIR)\texinfo.info \ - $(INFODIR)\widget.info \ - $(INFODIR)\xemacs-faq.info \ - $(INFODIR)\xemacs.info \ - $(INFODIR)\lispref.info \ - $(INFODIR)\new-users-guide.info \ - $(INFODIR)\internals.info - -{$(MANDIR)}.texi{$(INFODIR)}.info: - cd $(MANDIR) - $(MAKEINFO) $** - -XEMACS_SRCS = \ - $(MANDIR)\xemacs\abbrevs.texi \ - $(MANDIR)\xemacs\basic.texi \ - $(MANDIR)\xemacs\buffers.texi \ - $(MANDIR)\xemacs\building.texi \ - $(MANDIR)\xemacs\calendar.texi \ - $(MANDIR)\xemacs\cmdargs.texi \ - $(MANDIR)\xemacs\custom.texi \ - $(MANDIR)\xemacs\display.texi \ - $(MANDIR)\xemacs\entering.texi \ - $(MANDIR)\xemacs\files.texi \ - $(MANDIR)\xemacs\fixit.texi \ - $(MANDIR)\xemacs\frame.texi \ - $(MANDIR)\xemacs\glossary.texi \ - $(MANDIR)\xemacs\gnu.texi \ - $(MANDIR)\xemacs\help.texi \ - $(MANDIR)\xemacs\indent.texi \ - $(MANDIR)\xemacs\keystrokes.texi \ - $(MANDIR)\xemacs\killing.texi \ - $(MANDIR)\xemacs\m-x.texi \ - $(MANDIR)\xemacs\major.texi \ - $(MANDIR)\xemacs\mark.texi \ - $(MANDIR)\xemacs\menus.texi \ - $(MANDIR)\xemacs\mini.texi \ - $(MANDIR)\xemacs\misc.texi \ - $(MANDIR)\xemacs\mouse.texi \ - $(MANDIR)\xemacs\mule.texi \ - $(MANDIR)\xemacs\new.texi \ - $(MANDIR)\xemacs\packages.texi \ - $(MANDIR)\xemacs\picture.texi \ - $(MANDIR)\xemacs\programs.texi \ - $(MANDIR)\xemacs\reading.texi \ - $(MANDIR)\xemacs\regs.texi \ - $(MANDIR)\xemacs\search.texi \ - $(MANDIR)\xemacs\sending.texi \ - $(MANDIR)\xemacs\startup.texi \ - $(MANDIR)\xemacs\text.texi \ - $(MANDIR)\xemacs\trouble.texi \ - $(MANDIR)\xemacs\undo.texi \ - $(MANDIR)\xemacs\windows.texi \ - $(MANDIR)\xemacs\xemacs.texi - -LISPREF_SRCS = \ - $(MANDIR)\lispref\abbrevs.texi \ - $(MANDIR)\lispref\annotations.texi \ - $(MANDIR)\lispref\back.texi \ - $(MANDIR)\lispref\backups.texi \ - $(MANDIR)\lispref\buffers.texi \ - $(MANDIR)\lispref\building.texi \ - $(MANDIR)\lispref\commands.texi \ - $(MANDIR)\lispref\compile.texi \ - $(MANDIR)\lispref\consoles-devices.texi \ - $(MANDIR)\lispref\control.texi \ - $(MANDIR)\lispref\customize.texi \ - $(MANDIR)\lispref\databases.texi \ - $(MANDIR)\lispref\debugging.texi \ - $(MANDIR)\lispref\dialog.texi \ - $(MANDIR)\lispref\display.texi \ - $(MANDIR)\lispref\dragndrop.texi \ - $(MANDIR)\lispref\edebug-inc.texi \ - $(MANDIR)\lispref\edebug.texi \ - $(MANDIR)\lispref\errors.texi \ - $(MANDIR)\lispref\eval.texi \ - $(MANDIR)\lispref\extents.texi \ - $(MANDIR)\lispref\faces.texi \ - $(MANDIR)\lispref\files.texi \ - $(MANDIR)\lispref\frames.texi \ - $(MANDIR)\lispref\functions.texi \ - $(MANDIR)\lispref\glyphs.texi \ - $(MANDIR)\lispref\hash-tables.texi \ - $(MANDIR)\lispref\help.texi \ - $(MANDIR)\lispref\hooks.texi \ - $(MANDIR)\lispref\index.texi \ - $(MANDIR)\lispref\internationalization.texi \ - $(MANDIR)\lispref\intro.texi \ - $(MANDIR)\lispref\keymaps.texi \ - $(MANDIR)\lispref\ldap.texi \ - $(MANDIR)\lispref\lispref.texi \ - $(MANDIR)\lispref\lists.texi \ - $(MANDIR)\lispref\loading.texi \ - $(MANDIR)\lispref\locals.texi \ - $(MANDIR)\lispref\macros.texi \ - $(MANDIR)\lispref\maps.texi \ - $(MANDIR)\lispref\markers.texi \ - $(MANDIR)\lispref\menus.texi \ - $(MANDIR)\lispref\minibuf.texi \ - $(MANDIR)\lispref\modes.texi \ - $(MANDIR)\lispref\mouse.texi \ - $(MANDIR)\lispref\mule.texi \ - $(MANDIR)\lispref\numbers.texi \ - $(MANDIR)\lispref\objects.texi \ - $(MANDIR)\lispref\os.texi \ - $(MANDIR)\lispref\positions.texi \ - $(MANDIR)\lispref\processes.texi \ - $(MANDIR)\lispref\range-tables.texi \ - $(MANDIR)\lispref\scrollbars.texi \ - $(MANDIR)\lispref\searching.texi \ - $(MANDIR)\lispref\sequences.texi \ - $(MANDIR)\lispref\specifiers.texi \ - $(MANDIR)\lispref\streams.texi \ - $(MANDIR)\lispref\strings.texi \ - $(MANDIR)\lispref\symbols.texi \ - $(MANDIR)\lispref\syntax.texi \ - $(MANDIR)\lispref\text.texi \ - $(MANDIR)\lispref\tips.texi \ - $(MANDIR)\lispref\toolbar.texi \ - $(MANDIR)\lispref\tooltalk.texi \ - $(MANDIR)\lispref\variables.texi \ - $(MANDIR)\lispref\windows.texi \ - $(MANDIR)\lispref\x-windows.texi - -INTERNALS_SRCS = \ - $(MANDIR)\internals\internals.texi \ - $(MANDIR)\internals\index.texi - -NEW_USERS_GUIDE_SRCS = \ - $(MANDIR)\new-users-guide\custom1.texi \ - $(MANDIR)\new-users-guide\custom2.texi \ - $(MANDIR)\new-users-guide\edit.texi \ - $(MANDIR)\new-users-guide\enter.texi \ - $(MANDIR)\new-users-guide\files.texi \ - $(MANDIR)\new-users-guide\help.texi \ - $(MANDIR)\new-users-guide\modes.texi \ - $(MANDIR)\new-users-guide\new-users-guide.texi \ - $(MANDIR)\new-users-guide\region.texi \ - $(MANDIR)\new-users-guide\search.texi \ - $(MANDIR)\new-users-guide\xmenu.texi - -$(INFODIR)\xemacs.info: $(XEMACS_SRCS) - cd $(MANDIR)\xemacs - $(MAKEINFO) xemacs.texi - cd .. - - -$(INFODIR)\lispref.info: $(LISPREF_SRCS) - cd $(MANDIR)\lispref - $(MAKEINFO) lispref.texi - cd .. - -$(INFODIR)\internals.info: $(INTERNALS_SRCS) - cd $(MANDIR)\internals - $(MAKEINFO) internals.texi - cd .. - -$(INFODIR)\new-users-guide.info: $(NEW_USERS_GUIDE_SRCS) - cd $(MANDIR)\new-users-guide - $(MAKEINFO) new-users-guide.texi - cd .. - -info: makeinfo-test $(INFO_FILES) - -makeinfo-test: - @<<makeinfo_test.bat -@echo off -if exist "$(MAKEINFO)" goto test_done -@$(XEMACS_BATCH) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))" -@if not errorlevel 1 goto suggest_makeinfo -@echo XEmacs `info' cannot be built! -@echo Install XEmacs package `texinfo' (see README.packages). -:suggest_makeinfo -@echo Consider specifying path to makeinfo program: MAKEINFO=path -@echo as this will build info docs faster than XEmacs using `texinfo'. -@if errorlevel 1 exit 1 -:test_done -<<NOKEEP - -# Section handling info ends here - #------------------------------------------------------------------------------ # LISP bits 'n bobs LOADPATH=$(LISP) -# Rebuild docfile target -docfile :: - if exist $(DOC) del $(DOC) -docfile :: $(DOC) - -$(DOC): $(LIB_SRC)\make-docfile.exe $(DOC_SRC1) $(DOC_SRC2) $(DOC_SRC3) $(DOC_SRC4) $(DOC_SRC5) $(DOC_SRC6) $(DOC_SRC7) $(DOC_SRC8) $(DOC_SRC9) $(DOC_SRC10) $(DOC_SRC11) - if exist $(DOC) del $(DOC) - set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH) - set EMACSBOOTSTRAPMODULEPATH=$(MODULES) - $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages +$(DOC): $(LIB_SRC)\make-docfile.exe + -del $(DOC) + $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC1) $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC2) $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC3) @@ -1326,119 +903,95 @@ $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC7) $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC8) $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC9) - $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC10) - $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC11) update-elc: set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH) set EMACSBOOTSTRAPMODULEPATH=$(MODULES) - $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\update-elc.el - -# This file is touched by update-elc.el when redumping is necessary. -$(TEMACS_DIR)\NEEDTODUMP : - @echo >$(TEMACS_DIR)\NEEDTODUMP + $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\update-elc.el # This rule dumps xemacs and then possibly spawns sub-make if PURESPACE -# requirements have changed. - -$(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP +# requirements has changed. +dump-xemacs: $(TEMACS) @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 -!if $(USE_PORTABLE_DUMPER) - 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) + -1 $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\loadup.el dump + @cd $(NT) @if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@ + #------------------------------------------------------------------------------ # use this rule to build the complete system -all: installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \ - $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \ - update-auto-and-custom info +all: Installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) $(LIB_SRC_TOOLS) $(RUNEMACS) \ + $(TEMACS) update-elc $(DOC) dump-xemacs -temacs: $(LASTFILE) $(TEMACS) +temacs: $(TEMACS) # use this rule to install the system install: all - cd $(NT) @echo Installing in $(INSTALL_DIR) ... @echo PlaceHolder > PlaceHolder @xcopy /q PROBLEMS "$(INSTALL_DIR)\" @xcopy /q PlaceHolder "$(INSTALL_DIR)\lock\" - @$(DEL) "$(INSTALL_DIR)\lock\PlaceHolder" + @del "$(INSTALL_DIR)\lock\PlaceHolder" @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 $(SRC)\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" + @copy $(XEMACS)\src\xemacs.exe "$(INSTALL_DIR)\$(EMACS_CONFIGURATION)" + @copy $(RUNEMACS) "$(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\" @echo Making skeleton package tree in $(PACKAGE_PREFIX) ... @xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\site-packages\" - @$(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder" + @del "$(PACKAGE_PREFIX)\site-packages\PlaceHolder" @xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\mule-packages\" - @$(DEL) "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder" + @del "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder" @xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\xemacs-packages\" - @$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder" - @$(DEL) PlaceHolder + @del "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder" + @del PlaceHolder distclean: - $(DEL) *.bak - $(DEL) *.orig - $(DEL) *.rej - $(DEL) *.tmp - $(DEL) $(XEMACS)\Installation + del *.bak + del *.orig + del *.rej + del *.tmp + del Installation cd $(OUTDIR) - $(DEL) *.lib - $(DEL) *.obj - $(DEL) *.pdb - $(DEL) *.res - $(DEL) *.sbr + 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 + 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) + 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 /s /q *.bak *.elc *.orig *.rej depend: - cd $(SRC) - perl ./make-src-depend > depend.tmp - perl -MFile::Compare -e "compare('depend.tmp', 'depend') && rename('depend.tmp', 'depend') or unlink('depend.tmp')" + mkdepend -f xemacs.mak -p$(OUTDIR)\ -o.obj -w9999 -- $(TEMACS_CPP_FLAGS) -- $(DOC_SRC1) $(DOC_SRC2) $(DOC_SRC3) $(DOC_SRC4) $(DOC_SRC5) $(DOC_SRC6) $(DOC_SRC7) $(DOC_SRC8) $(DOC_SRC9) $(LASTFILE_SRC)\lastfile.c $(LIB_SRC)\make-docfile.c $(LIB_SRC)\run.c -$(XEMACS)\Installation:: installation - -installation:: - @type > $(XEMACS)\Installation << +Installation: + @type > Installation << !if defined(OS) OS: $(OS) !endif @@ -1454,10 +1007,10 @@ !if $(INFODOCK) Building InfoDock. !endif -!if $(HAVE_MS_WINDOWS) +!if $(HAVE_MSW) Compiling in support for Microsoft Windows native GUI. !endif -!if $(HAVE_X_WINDOWS) +!if $(HAVE_X) Compiling in support for X-Windows. !endif !if $(HAVE_MULE) @@ -1501,9 +1054,6 @@ !if $(HAVE_DIALOGS) Compiling in support for dialogs. !endif -!if $(HAVE_WIDGETS) - Compiling in support for widgets. -!endif !if $(HAVE_NATIVE_SOUND) Compiling in support for native sounds. !endif @@ -1525,36 +1075,13 @@ !if $(USE_UNION_TYPE) Using union type for Lisp object storage. !endif -!if $(USE_PORTABLE_DUMPER) - Using portable dumper. -!endif -!if $(USE_SYSTEM_MALLOC) - Using system malloc. -!endif -!if $(USE_CRTDLL) - Using DLL version of C runtime library -!endif !if $(DEBUG_XEMACS) Compiling in extra debug checks. XEmacs will be slow! !endif -!if $(QUICK_BUILD) - Disabling non-essential build actions. Use with care! -!endif <<NOKEEP @echo -------------------------------------------------------------------- - @type $(XEMACS)\Installation + @type Installation @echo -------------------------------------------------------------------- -# Update auto-autoloads.el and custom-load.el similar to what -# XEmacs.rules does for xemacs-packages. -update-auto-and-custom: -# Don't delete this, because it forces rebuilding from scratch, -# which is time-consuming; and the autoload code is specifically -# written to do in-place updating. -# @$(DEL) $(LISP)\auto-autoloads.el -# Combine into one invocation to avoid repeated startup penalty. - $(XEMACS_BATCH) -l autoload -f batch-update-one-directory $(LISP) -f batch-byte-compile-one-file $(LISP)\auto-autoloads.el -l cus-dep -f Custom-make-dependencies $(LISP) - @$(DEL) $(LISP)\auto-autoloads.el~ - # DO NOT DELETE THIS LINE -- make depend depends on it. diff -r 12e008d41344 -r 697ef44129c6 nt/xemacs.rc --- a/nt/xemacs.rc Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/xemacs.rc Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,3 @@ -#ifdef INCLUDE_DUMP -101 DUMP "xemacs.dmp" -#endif - -XEmacs ICON PRELOAD "xemacs.ico" -XEmacsFile ICON "File.ico" -XEmacsLisp ICON "Lisp.ico" +XEmacs icon preload "xemacs.ico" +XEmacsFile icon "File.ico" +XEmacsLisp icon "Lisp.ico" diff -r 12e008d41344 -r 697ef44129c6 nt/xpm.mak --- a/nt/xpm.mak Mon Aug 13 11:19:22 2007 +0200 +++ b/nt/xpm.mak Mon Aug 13 11:20:41 2007 +0200 @@ -1,44 +1,21 @@ # # XPM Makefile for Microsoft NMAKE without X libraries # -!if !defined(DEBUG) -!if defined(DEBUG_XEMACS) -DEBUG=$(DEBUG_XEMACS) -!else -DEBUG=0 -!endif -!endif -!if !defined(USE_CRTDLL) -USE_CRTDLL=0 +!if !defined(DEBUG_XEMACS) +DEBUG_XEMACS=0 !endif -!if $(DEBUG) +!if $(DEBUG_XEMACS) OPT=-Od -Zi -LINK_DEBUG=-debug !else -OPT=-Ox -!endif - -!if $(USE_CRTDLL) -!if $(DEBUG) -C_LIBFLAG=-MDd -!else -C_LIBFLAG=-MD -!endif -!else -!if $(DEBUG) -C_LIBFLAG=-MLd -!else -C_LIBFLAG=-ML -!endif +OPT=-O2 -G5 -Zi !endif WARN_CPP_FLAGS = -W3 CC=cl -CFLAGS=-nologo -DFOR_MSW $(C_LIBFLAG) $(WARN_CPP_FLAGS) \ - $(OPT) $(INCLUDES) -c +CFLAGS=-nologo -DFOR_MSW $(WARN_CPP_FLAGS) $(OPT) $(INCLUDES) -Fo$@ -c OBJS= data.obj create.obj misc.obj rgb.obj scan.obj parse.obj hashtab.obj \ WrFFrI.obj RdFToI.obj CrIFrDat.obj CrDatFrI.obj \ @@ -52,8 +29,8 @@ .SUFFIXES: .SUFFIXES: .c -.c.obj:: - $(CC) $(CFLAGS) $< +.c.obj: + $(CC) $(CFLAGS) $< -Fo$@ # targets @@ -67,9 +44,4 @@ mkdir ..\X11 Xpm.lib: $(OBJS) -!if $(USE_CRTDLL) -# Target is ok, link builds lib as a side effect. - link -nologo -dll -def:xpm.def -out:Xpm.dll gdi32.lib $(OBJS) -!else - lib -nologo -out:$@ $(OBJS) -!endif + link.exe -lib -nologo -out:$@ $(OBJS) diff -r 12e008d41344 -r 697ef44129c6 src/.cvsignore --- a/src/.cvsignore Mon Aug 13 11:19:22 2007 +0200 +++ b/src/.cvsignore Mon Aug 13 11:20:41 2007 +0200 @@ -8,8 +8,5 @@ sheap-adjust.h temacs xemacs -xemacs.dmp SATISFIED update-elc.stamp -*.so.* -gmon.out diff -r 12e008d41344 -r 697ef44129c6 src/.dbxrc --- a/src/.dbxrc Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,387 +0,0 @@ -# -*- ksh -*- -# Copyright (C) 1998 Free Software Foundation, Inc. - -# This file is part of XEmacs. - -# XEmacs is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2, or (at your option) any -# later version. - -# XEmacs is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. - -# You should have received a copy of the GNU General Public License -# along with XEmacs; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# Author: Martin Buchholz - -# You can use this file to debug XEmacs using Sun WorkShop's dbx. - -# Some functions defined here require a running process, but most -# don't. Considerable effort has been expended to this end. - -# Since this file is called `.dbxrc', it will be read by dbx -# automatically when dbx is run in the build directory, which is where -# developers usually debug their xemacs. - -# See also the comments in .gdbinit. - -# See also the question of the XEmacs FAQ, titled -# "How to Debug an XEmacs problem with a debugger". - -# gdb sources the ./.gdbinit in _addition_ to ~/.gdbinit. -# But dbx does _not_ source ~/.dbxrc if it found ./.dbxrc. -# So we simulate the gdb algorithm by doing it ourselves here. -if test -r $HOME/.dbxrc; then . $HOME/.dbxrc; fi - -dbxenv language_mode ansic - -ignore POLL -ignore IO - -document lbt << 'end' -Usage: lbt -Print the current Lisp stack trace. -Requires a running xemacs process. -end - -function lbt { - call debug_backtrace() -} - -document ldp << 'end' -Usage: ldp lisp_object -Print a Lisp Object value using the Lisp printer. -Requires a running xemacs process. -end - -function ldp { - call debug_print ($1); -} - -Lisp_Type_Int=-2 - -# A bug in dbx prevents string variables from having values beginning with `-'!! -function XEmacsInit { - function ToInt { eval "$1=\$[(int) \`alloc.c\`$1]"; } - ToInt dbg_USE_UNION_TYPE - ToInt Lisp_Type_Char - ToInt Lisp_Type_Record - ToInt dbg_valbits - ToInt dbg_gctypebits - function ToLong { eval "$1=\$[(\`alloc.c\`unsigned long) \`alloc.c\`$1]"; } - ToLong dbg_valmask - ToLong dbg_typemask - xemacs_initted=yes -} - -function printvar { - for i in $*; do eval "echo $i=\$$i"; done -} - -document decode_object << 'end' -Usage: decode_object lisp_object -Extract implementation information from a Lisp Object. -Defines variables $val, $type and $imp. -end - -# Various dbx bugs cause ugliness in following code -function decode_object { - if test -z "$xemacs_initted"; then XEmacsInit; fi; - if test $dbg_USE_UNION_TYPE = 1; then - # Repeat after me... dbx sux, dbx sux, dbx sux... - # Allow both `pobj Qnil' and `pobj 0x82746834' to work - case $(whatis $1) in - *Lisp_Object*) obj="$[(`alloc.c`unsigned long)(($1).i)]";; - *) obj="$[(`alloc.c`unsigned long)($1)]";; - esac - else - obj="$[(`alloc.c`unsigned long)($1)]"; - fi - if test $[(int)($obj & 1)] = 1; then - # It's an int - val=$[(long)(((unsigned long long)$obj) >> 1)] - type=$Lisp_Type_Int - else - type=$[(int)(((void*)$obj) & $dbg_typemask)] - if test $type = $Lisp_Type_Char; then - val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)] - else - # It's a record pointer - val=$[(void*)$obj] - if test "$val" = "(nil)"; then type=null_pointer; fi - fi - fi - - if test $type = $Lisp_Type_Record; then - lheader="((struct lrecord_header *) $val)" - lrecord_type=$[(enum lrecord_type) $lheader->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 -} - -function xint { - decode_object "$*" - print (long) ($val) -} - -document xtype << 'end' -Usage: xtype lisp_object -Print the Lisp type of a lisp object. -end - -function xtype { - decode_object "$*" - if test $type = $Lisp_Type_Int; then echo "int" - elif test $type = $Lisp_Type_Char; then echo "char" - elif test $type = null_pointer; then echo "null_pointer" - else - echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]" - fi -} - -function lisp-shadows { - run -batch -vanilla -f list-load-path-shadows -} - -function environment-to-run-temacs { - unset EMACSLOADPATH - export EMACSBOOTSTRAPLOADPATH=../lisp/:.. - export EMACSBOOTSTRAPMODULEPATH=../modules/:.. -} - -document run-temacs << 'end' -Usage: run-temacs -Run temacs interactively, like xemacs. -Use this with debugging tools (like purify) that cannot deal with dumping, -or when temacs builds successfully, but xemacs does not. -end - -function run-temacs { - environment-to-run-temacs - run -batch -l ../lisp/loadup.el run-temacs -q ${1+"$@"} -} - -document check-xemacs << 'end' -Usage: check-xemacs -Run the test suite. Equivalent to 'make check'. -end - -function check-xemacs { - run -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated -} - -document check-temacs << 'end' -Usage: check-temacs -Run the test suite on temacs. Equivalent to 'make check-temacs'. -Use this with debugging tools (like purify) that cannot deal with dumping, -or when temacs builds successfully, but xemacs does not. -end - -function check-temacs { - run-temacs -q -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated -} - -document update-elc << 'end' -Usage: update-elc -Run the core lisp byte compilation part of the build procedure. -Use when debugging temacs, not xemacs! -Use this when temacs builds successfully, but xemacs does not. -end - -function update-elc { - environment-to-run-temacs - run -batch -l ../lisp/update-elc.el -} - -document dump-temacs << 'end' -Usage: dump-temacs -Run the dumping part of the build procedure. -Use when debugging temacs, not xemacs! -Use this when temacs builds successfully, but xemacs does not. -end - -function dump-temacs { - environment-to-run-temacs - run -batch -l ../lisp/loadup.el dump -} - -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' -Usage: pobj lisp_object -Print the internal C representation of a Lisp Object. -end - -function pobj { - decode_object $1 - if test $type = $Lisp_Type_Int; then - print -f"Integer: %d" $val - elif test $type = $Lisp_Type_Char; then - if test $[$val > 32 && $val < 128] = 1; then - print -f"Char: %c" $val - else - print -f"Char: %d" $val - fi - 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 - echo "Unknown Lisp Object type" - print $1 - fi -} - -dbxenv suppress_startup_message 4.0 -# dbxenv mt_watchpoints on - -function dp_core { - print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core -} - -# Barf! -function print_shell { - print *(`frame-x.c`TopLevelShellRec*) (((struct `frame-x.c`x_frame*) (((struct `frame-x.c`frame*) (Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget) -} - -# ------------------------------------------------------------- -# functions to test the debugging support itself. -# If you change this file, make sure the following still work... -# ------------------------------------------------------------- -function test_xtype { - function doit { echo -n "$1: "; xtype "$1"; } - test_various_objects -} - -function test_pobj { - function doit { echo '==============================='; echo -n "$1: "; pobj "$1"; } - test_various_objects -} - -function test_various_objects { - doit Vemacs_major_version - doit Vhelp_char - doit Qnil - doit Qunbound - doit Vobarray - doit Vall_weak_lists - doit Vxemacs_codename -} diff -r 12e008d41344 -r 697ef44129c6 src/.gdbinit --- a/src/.gdbinit Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,513 +0,0 @@ -# -*- ksh -*- -# Copyright (C) 1998 Free Software Foundation, Inc. - -# This file is part of XEmacs. - -# XEmacs is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2, or (at your option) any -# later version. - -# XEmacs is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. - -# You should have received a copy of the GNU General Public License -# along with XEmacs; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# Author: Martin Buchholz - -# Some useful commands for debugging emacs with gdb 4.16 or better. -# -# Since this file is called `.gdbinit', it will be read by gdb -# automatically when gdb is run in the build directory, which is where -# developers usually debug their xemacs. You can also source this -# file from your ~/.gdbinit, if you like. -# -# Configure xemacs with --debug, and compile with -g. -# -# See also the question of the XEmacs FAQ, titled -# "How to Debug an XEmacs problem with a debugger". -# -# This can be used to debug XEmacs no matter how the following are -# specified: - -# USE_UNION_TYPE - -# (the above all have configure equivalents) - -# Some functions defined here require a running process, but most -# don't. Considerable effort has been expended to this end. - -# See the dbg_ C support code in src/alloc.c that allows the functions -# defined in this file to work correctly. - -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 - else - set $type = $obj & dbg_typemask - if $type == Lisp_Type_Char - set $val = ($obj & dbg_valmask) >> dbg_gctypebits - else - # It's a record pointer - set $val = $obj - end - end - - if $type == Lisp_Type_Record - 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 - -document decode_object -Usage: decode_object lisp_object -Extract implementation information from a Lisp Object. -Defines variables $val, $type and $imp. -end - -define xint -decode_object $arg0 -print ((long) $val) -end - -define xtype - decode_object $arg0 - if $type == $Lisp_Type_Int - echo int\n - else - if $type == Lisp_Type_Char - echo char\n - else - printf "record type: %s\n", $imp->name - end - end -end - -document xtype -Usage: xtype lisp_object -Print the Lisp type of a lisp object. -end - -define lisp-shadows - run -batch -vanilla -f list-load-path-shadows -end - -document lisp-shadows -Usage: lisp-shadows -Run xemacs to check for lisp shadows -end - -define environment-to-run-temacs - unset env EMACSLOADPATH - set env EMACSBOOTSTRAPLOADPATH=../lisp/:.. - set env EMACSBOOTSTRAPMODULEPATH=../modules/:.. -end - -define run-temacs - environment-to-run-temacs - run -batch -l ../lisp/loadup.el run-temacs -q -end - -document run-temacs -Usage: run-temacs -Run temacs interactively, like xemacs. -Use this with debugging tools (like purify) that cannot deal with dumping, -or when temacs builds successfully, but xemacs does not. -end - -define check-xemacs - run -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated -end - -document check-xemacs -Usage: check-xemacs -Run the test suite. Equivalent to 'make check'. -end - -define check-temacs - environment-to-run-temacs - run -batch -l ../lisp/loadup.el run-temacs -q -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated -end - -document check-temacs -Usage: check-temacs -Run the test suite on temacs. Equivalent to 'make check-temacs'. -Use this with debugging tools (like purify) that cannot deal with dumping, -or when temacs builds successfully, but xemacs does not. -end - -define update-elc - environment-to-run-temacs - run -batch -l ../lisp/update-elc.el -end - -document update-elc -Usage: update-elc -Run the core lisp byte compilation part of the build procedure. -Use when debugging temacs, not xemacs! -Use this when temacs builds successfully, but xemacs does not. -end - -define dump-temacs - environment-to-run-temacs - run -batch -l ../lisp/loadup.el dump -end - -document dump-temacs -Usage: dump-temacs -Run the dumping part of the build procedure. -Use when debugging temacs, not xemacs! -Use this when temacs builds successfully, but xemacs does not. -end - -# if you use Purify, do this: -# export PURIFYOPTIONS='-pointer-mask=0x0fffffff' - -define ldp - printf "%s", "Lisp => " - call debug_print($arg0) -end - -document ldp -Usage: ldp lisp_object -Print a Lisp Object value using the Lisp printer. -Requires a running xemacs process. -end - -define lbt -call debug_backtrace() -end - -document lbt -Usage: lbt -Print the current Lisp stack trace. -Requires a running xemacs process. -end - - -define leval -ldp Feval(Fcar(Fread_from_string(build_string($arg0),Qnil,Qnil))) -end - -document leval -Usage: leval "SEXP" -Eval a lisp expression. -Requires a running xemacs process. - -Example: -(gdb) leval "(+ 1 2)" -Lisp ==> 3 -end - - -define wtype -print $arg0->core.widget_class->core_class.class_name -end - -define xtname -print XrmQuarkToString(((Object)($arg0))->object.xrm_name) -end - -# GDB's command language makes you want to ... - -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 - printf "Integer: %d\n", $val - else - if $type == Lisp_Type_Char - if $val > 32 && $val < 128 - printf "Char: %c\n", $val - else - printf "Char: %d\n", $val - end - else - if $lrecord_type == lrecord_type_string - ptype Lisp_String - else - if $lrecord_type == lrecord_type_cons - ptype Lisp_Cons - else - if $lrecord_type == lrecord_type_symbol - ptype Lisp_Symbol - printf "Symbol name: %s\n", $type_ptr->name->data - else - 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 $lrecord_type == lrecord_type_bit_vector - ptype Lisp_Bit_Vector - else - if $lrecord_type == lrecord_type_buffer - pstructtype buffer - else - if $lrecord_type == lrecord_type_char_table - ptype Lisp_Char_Table - else - if $lrecord_type == lrecord_type_char_table_entry - ptype Lisp_Char_Table_Entry - else - if $lrecord_type == lrecord_type_charset - ptype Lisp_Charset - else - if $lrecord_type == lrecord_type_coding_system - ptype Lisp_Coding_System - else - if $lrecord_type == lrecord_type_color_instance - ptype Lisp_Color_Instance - else - if $lrecord_type == lrecord_type_command_builder - ptype command_builder - else - if $lrecord_type == lrecord_type_compiled_function - ptype Lisp_Compiled_Function - else - if $lrecord_type == lrecord_type_console - pstructtype console - else - if $lrecord_type == lrecord_type_database - ptype Lisp_Database - else - if $lrecord_type == lrecord_type_device - pstructtype device - else - if $lrecord_type == lrecord_type_event - ptype Lisp_Event - else - if $lrecord_type == lrecord_type_extent - pstructtype extent - else - if $lrecord_type == lrecord_type_extent_auxiliary - pstructtype extent_auxiliary - else - if $lrecord_type == lrecord_type_extent_info - pstructtype extent_info - else - if $lrecord_type == lrecord_type_face - ptype Lisp_Face - else - if $lrecord_type == lrecord_type_float - ptype Lisp_Float - else - if $lrecord_type == lrecord_type_font_instance - ptype Lisp_Font_Instance - else - if $lrecord_type == lrecord_type_frame - pstructtype frame - else - if $lrecord_type == lrecord_type_glyph - ptype Lisp_Glyph - else - if $lrecord_type == lrecord_type_gui_item - ptype Lisp_Gui_Item - else - if $lrecord_type == lrecord_type_hash_table - ptype Lisp_Hash_Table - else - if $lrecord_type == lrecord_type_image_instance - ptype Lisp_Image_Instance - else - if $lrecord_type == lrecord_type_keymap - ptype Lisp_Keymap - else - if $lrecord_type == lrecord_type_lcrecord_list - pstructtype lcrecord_list - else - if $lrecord_type == lrecord_type_ldap - ptype Lisp_LDAP - else - if $lrecord_type == lrecord_type_lstream - pstructtype lstream - else - if $lrecord_type == lrecord_type_marker - ptype Lisp_Marker - else - if $lrecord_type == lrecord_type_opaque - ptype Lisp_Opaque - else - if $lrecord_type == lrecord_type_opaque_ptr - ptype Lisp_Opaque_Ptr - else - if $lrecord_type == lrecord_type_popup_data - ptype popup_data - else - if $lrecord_type == lrecord_type_process - ptype Lisp_Process - else - if $lrecord_type == lrecord_type_range_table - ptype Lisp_Range_Table - else - if $lrecord_type == lrecord_type_specifier - ptype Lisp_Specifier - else - if $lrecord_type == lrecord_type_subr - ptype Lisp_Subr - else - if $lrecord_type == lrecord_type_symbol_value_buffer_local - pstructtype symbol_value_buffer_local - else - if $lrecord_type == lrecord_type_symbol_value_forward - pstructtype symbol_value_forward - else - if $lrecord_type == lrecord_type_symbol_value_lisp_magic - pstructtype symbol_value_lisp_magic - else - if $lrecord_type == lrecord_type_symbol_value_varalias - pstructtype symbol_value_varalias - else - if $lrecord_type == lrecord_type_timeout - ptype Lisp_Timeout - else - if $lrecord_type == lrecord_type_toolbar_button - pstructtype toolbar_button - else - if $lrecord_type == lrecord_type_tooltalk_message - ptype Lisp_Tooltalk_Message - else - if $lrecord_type == lrecord_type_tooltalk_pattern - ptype Lisp_Tooltalk_Pattern - else - if $lrecord_type == lrecord_type_weak_list - pstructtype weak_list - else - if $lrecord_type == lrecord_type_window - pstructtype window - else - if $lrecord_type == lrecord_type_window_configuration - pstructtype window_config - else - echo Unknown Lisp Object type\n - print $arg0 - # Barf, gag, retch - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - # Repeat after me... gdb sux, gdb sux, gdb sux... - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - # Are we having fun yet?? - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end - end -end - -document pobj -Usage: pobj lisp_object -Print the internal C representation of a Lisp Object. -end - -# ------------------------------------------------------------- -# functions to test the debugging support itself. -# If you change this file, make sure the following still work... -# ------------------------------------------------------------- -define test_xtype - printf "Vemacs_major_version: " - xtype Vemacs_major_version - printf "Vhelp_char: " - xtype Vhelp_char - printf "Qnil: " - xtype Qnil - printf "Qunbound: " - xtype Qunbound - printf "Vobarray: " - xtype Vobarray - printf "Vall_weak_lists: " - xtype Vall_weak_lists - printf "Vxemacs_codename: " - xtype Vxemacs_codename -end - -define test_pobj - printf "Vemacs_major_version: " - pobj Vemacs_major_version - printf "Vhelp_char: " - pobj Vhelp_char - printf "Qnil: " - pobj Qnil - printf "Qunbound: " - pobj Qunbound - printf "Vobarray: " - pobj Vobarray - printf "Vall_weak_lists: " - pobj Vall_weak_lists - printf "Vxemacs_codename: " - pobj Vxemacs_codename -end - diff -r 12e008d41344 -r 697ef44129c6 src/ChangeLog --- a/src/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,5332 +1,4892 @@ -2000-07-19 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.35 is released. - -2000-07-19 Martin Buchholz <martin@xemacs.org> - - * 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 <kkm@dtmx.com> - - * 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 <ajhoughton@lineone.net> - - * 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 <ajhoughton@lineone.net> - - * 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 <martin@xemacs.org> - - * 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 <ajhoughton@lineone.net> - - * 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 <ajhoughton@lineone.net> - - * gpmevent.c (tty_selection_exists_p): - * gpmevent.c (tty_own_selection): - Updated parameter lists. - -2000-07-15 Alastair J. Houghton <ajhoughton@lineone.net> - - * 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! +1999-05-14 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.14 is released + +1999-05-12 Andy Piper <andy@xemacs.org> + + * ntproc.c (sys_spawnve): kludge argv[0] in a MS compatible way. + +1999-05-11 Gunnar Evermann <ge204@eng.cam.ac.uk> + + * emacs.c (Frun_emacs_from_temacs): (re)alloc natgs+2 entries for + run_temacs_argv array -- fixes random memory corruption crash + +1999-05-12 Jan Vroonhof <vroonhof@math.ethz.ch> + + * window.c (Fcurrent_window_configuration): + Save minibuffer height; + + * window.c (set_window_configuration): use it. + +1999-05-10 Robert Pluim <rpluim@bigfoot.com> + + * lisp.h (NNUNGCPRO): fix typo in name of DEBUG_GCPRO version + +1999-04-21 Jan Vroonhof <vroonhof@math.ethz.ch> + + * redisplay.c (redisplay_window): Do not put data + in the line start cache if it is not guaranteed to be correct + +1999-04-02 Jan Vroonhof <vroonhof@math.ethz.ch> + + * window.c (struct window_config): Removed frame + size members. + (window_config_equal): No longer compare frame sizes. + (Fset_window_configuration): Resize old top window to fit in the + current frame directly, no longer use a fake frame resize. + (Fcurrent_window_configuration): No longer save frame size + +1999-05-11 Andy Piper <andy@xemacs.org> + + * ntproc.c (sys_spawnve): actually assign argv[0] instead of the + first character. + +1999-05-10 Hrvoje Niksic <hniksic@srce.hr> + + * sysdep.c (init_system_name): If gethostname gives a proper + domain name, don't look further for one. + +1999-05-09 Hrvoje Niksic <hniksic@srce.hr> + + * symbols.c (Fintern): Avoid frequent XSYMBOL (foo). + (Fintern_soft): Accept a symbol argument. + +1999-05-06 Hrvoje Niksic <hniksic@srce.hr> + + * symbols.c (Fintern): ...do it here. + + * lread.c (read_atom): Don't handle keywords here. + +1999-05-06 Hrvoje Niksic <hniksic@srce.hr> + + * symbols.c (reject_constant_symbols): Just use SYMBOL_IS_KEYWORD. + +1999-05-03 Olivier Galibert <galibert@pobox.com> + + * lisp.h (SYMBOL_IS_KEYWORD): A symbol can be a keyword only if it + is interned in the main obarray. + +1999-04-23 Gunnar Evermann <ge204@eng.cam.ac.uk> + + * menubar-x.c (pre_activate_callback): set accelerator field in + "No menu" entries to nil. Avoid crash in + command_builder_operate_menu_accelerator + +1999-05-03 Olivier Galibert <galibert@pobox.com> + + * symeval.h (symbol_value_forward_lheader_initializer): Ditto. + + * lisp.h (DEFUN): Fix lrecord header initialisation. + +1999-05-02 Andy Piper <andy@xemacs.org> + + * objects-msw.c (mswindows_font_instance_truename): add a ';'. + + * ntproc.c (sys_kill): cast using MS mandated defines. + +1999-04-29 Andy Piper <andy@xemacs.org> + + * m/intel386.h: remove redundant definitions. + + * s/mingw32.h: new header for mingw32. - * 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. + * unexnt.c: (open_input_file): function moved to nt.c. + (close_file_data): ditto. + (rva_to_section): function moved to ntproc. + + * symsinit.h: declare syms_of_ntproc(); - * select-x.c (x_get_foreign_selection): Use select_convert_in. + * objects-msw.c (mswindows_font_instance_truename): new function. + + * ntproc.c: remove many warnings. + (_sys_read_ahead): moved from nt.c and made static. + (rva_to_section): moved from unexnt.c but not defined under + mingw32. + (win32_executable_type): implement what we can for mingw32 + headers. + (sys_spawnve): fix bad MULE/GCPRO bug in filename handling. + + * ntheap.h: remove declarations of functions that are now static. - * select-x.c (x_handle_selection_clear): Use get-selection-timestamp, - rather than messing with selection-alist. + * ntheap.c: support static heap. + + * nt.h: conditionalise X_OK definition. + + * nt.c: eliminate many warnings and support mingw32. + (open_input_file): function moved from unexnt.c and made static + (close_file_data): ditto. + (_sys_read_ahead): moved to ntproc.c + + * emacs.c: make sure syms_of_ntptroc gets called under windows. - * select-msw.c (mswindows_get_foreign_selection): - Use TO_INTERNAL_FORMAT rather than hacking. - -2000-07-14 Martin Buchholz <martin@xemacs.org> - - * process-unix.c (unix_open_multicast_group): - (unix_open_multicast_group): Remove useless casts. - -2000-07-13 Martin Buchholz <martin@xemacs.org> - - * sound.c (Fplay_sound): Fix `unused variable' warning. - - * emacs.c (main): Use correct type for _environ on SCO5. - -2000-07-12 Alastair J. Houghton <ajhoughton@lineone.net> - - * 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: support mingw32. + * getloadavg.c: ditto. + * ntplay.c: ditto. + * sysdep.c: ditto. + * sysdir.h: ditto. + * systime.h: ditto. + * systty.h: ditto. + + * config.h.in: dont turn on DEBUG_ENCAPSULATION by default because + some systems don't have all of the encapsulated system calls. - * 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. + * callproc.c: warning elimination. + * dired-msw.c: ditto. + * process-nt.c: ditto. + * realpath.c: ditto. + + * Makefile.in.in: tweak : and ; for building under mswindows. - * 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 <martin@xemacs.org> - - * 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 <kkm@dtmx.com> - - * 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 <martin@xemacs.org> - - * eval.c (function_argcount): Work around a DEC CC compiler bug. - - * unexalpha.c: Remove system prototypes from C sources! - -2000-07-09 Adrian Aichner <aichner@ecf.teradyne.com> - - * eval.c: Remove references to M-x edit-options in DEFUNs for - `defvar' and `defconst'. - -2000-07-09 Martin Buchholz <martin@xemacs.org> - - * config.h.in: Remove SMART_INCLUDE hackery. +1999-04-26 Michael Harnois <mharnois@willinet.net> + + * eldap.c (allocate_ldap): Adapt to the new semantics of + alloc_lcrecord_type(). + +1999-03-16 MORIOKA Tomohiko <tomo@etl.go.jp> + + * file-coding.c (DECODE_HANDLE_END_OF_CONVERSION): fixed. + +1998-09-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * Delete mule-coding.c and mule-coding.h because they are not + used. + +1999-04-22 Gunnar Evermann <ge204@eng.cam.ac.uk> + + * objects.c (print_font_instance): Check for NILP(f->device), + i.e. Vthe_null_font_instance. + (font_instance_truename_internal): ditto. + (Ffont_instance_properties): ditto. + +1999-04-22 Olivier Galibert <galibert@pobox.com> + + * lrecord.h (DECLARE_LRECORD): lrecord_implementation isn't an + array anymore. + +1999-04-22 Hrvoje Niksic <hniksic@srce.hr> + + * Makefile.in.in (tests): Don't mention tests explicitly -- makes + it easier to add new ones. + +1999-04-22 Hrvoje Niksic <hniksic@srce.hr> + + * symbols.c (reject_constant_symbols): Ditto. + (init_symbols_once_early): Ditto. + + * print.c (print_symbol): Don't use ->obarray. + + * symbols.c (Funintern): Ditto. + + * alloc.c (Fmake_symbol): Don't set ->obarray. + + * lisp.h (struct Lisp_Symbol): Removed .obarray field. + + * symbols.c (init_symbols_once_early): Removed + Vpure_uninterned_symbol_table. + (Fintern): Don't store to ->obarray field. + +1999-04-22 Hrvoje Niksic <hniksic@srce.hr> + + * data.c (vars_of_data): Default debug_issue_ebola_notices to 0. + (eq_with_ebola_notice): Remove abracadabra support. + +1999-04-11 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * eldap.c (Fldap_search_internal): Add a new parameter `withdn' to + retrieve the distinguished names of entries + +1999-03-08 Martin Buchholz <martin@xemacs.org> + + * lread.c (read_escape): Make hex escapes read only two hex digits. + +1999-04-05 Olivier Galibert <galibert@pobox.com> + + * Makefile.in.in: Remove puresize-adjust.h and recursive makes. + * make-src-depend: Remove puresize-adjust.h. + * src-headers: Remove puresize-adjust.h. + * config.h.in: Kill everything purespace/gung-ho related. + + * dbxrc: Make gung-ho mandatory. + * gdbinit: Ditto. + + * lrecord.h: Make gung-ho mandatory. Remove pure flag and add + c_readonly and lisp_readonly. Remove implementation arrays. + (C_READONLY_RECORD_HEADER_P): Added. + (LISP_READONLY_RECORD_HEADER_P): Added. + (SET_C_READONLY_RECORD_HEADER): Added. + (SET_LISP_READONLY_RECORD_HEADER): Added. + + * lisp.h: Kill everything purespace/non gung-ho related. + (CHECK_C_WRITEABLE): Added. + (CHECK_LISP_WRITEABLE): Added. + (C_READONLY): Added. + (LISP_READONLY): Added. + + * lisp-union.h: Make gung-ho mandatory. + * lisp-disunion.h: Ditto. + + * alloc.c: Kill everything purespace/non gung-ho related. Fix all + set_lheader_implementation calls. + (c_readonly): Added. + (lisp_readonly): Added. + (make_string_nocopy): Added. + (Fpurecopy): Changed to do nothing. Kept the old documentation + for reference purposes for the next patches. + (sweep_lcrecords_1): Don't free C readonly lcrecords. + (sweep_bit_vectors_1): Don't free C readonly bitvectors. + (SWEEP_FIXED_TYPE_BLOCK): Don't free C readonly lrecords. + + * fns.c: Make gung-ho mandatory. + (Fput): CHECK_IMPURE -> CHECK_LISP_WRITEABLE. + (Fremprop): Ditto. + (Ffillarray): Ditto. + + * data.c: Make gung-ho mandatory. + (pure_write_error): Removed. + (c_write_error): Added. + (lisp_write_error): Added. + (Fsetcar): CHECK_IMPURE -> CHECK_LISP_WRITEABLE. + (Fsetcdr): Ditto. + (Faset): Ditto. + + * symbols.c: Make gung-ho mandatory. make_pure_pname -> + make_string or make_string_nocopy. Fix various + alloc_lcrecord_type. - 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 <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * general.c: Remove duplicate definition for Qfunction. - -2000-07-08 Ben Wing <ben@xemacs.org> - - * 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 <lanning@scra.org> - - * 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 <winsock.h> 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 <windows.h> for WIN32_NATIVE case. - -2000-07-05 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * 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 <mike@xemacs.org> - - * s/freebsd.h (INTERRUPTIBLE_OPEN): open *is* interruptible on - FreeBSD 4.0. - -2000-06-07 MORIOKA Tomohiko <tomo@etl.go.jp> - - * doprnt.c (emacs_doprnt_1): Fix problem with %0XXd for a negative - integer. - -2000-06-07 MORIOKA Tomohiko <tomo@urania.m17n.org> - - * data.c (Fstring_to_number): Don't recognize floating point if - base is not 10. - -2000-06-22 Martin Buchholz <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <mta@arbortext.com> - - (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 <ben@xemacs.org> - - * s\mingw32.h (sigset): - * s\windowsnt.h (sigset): - rename msw_ to mswindows_ for consistency with general convention. - -2000-06-12 Ben Wing <ben@xemacs.org> - - * 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): + * lread.c: Remove everything purespace related. + (Flocate_file_clear_hashing): purified -> c_readonly. + (locate_file): Ditto. + (read_atom): make_pure_pname -> make_string. + + * emacs.c (Frun_emacs_from_temacs): Remove purespace stats + reporting. + (Fdump_emacs): Ditto. + + * print.c (print_internal): Make gung-ho mandatory. + * ntheap.c (sbrk): Ditto. + * mem-limits.h (EXCEEDS_LISP_PTR): Ditto + * symeval.h (symbol_value_forward_lheader_initializer): Ditto. + + * sheap.c (more_static_core): Remove puresize-adjust.h from + message. + + * syntax.c (complex_vars_of_syntax): make_pure_string -> + make_string_nocopy. + * keymap.c (make_keymap): Fix alloc_lcrecord_type. + (vars_of_keymap): make_pure_string -> make_string_nocopy. + * events.c (deinitialize_event): Fix set_lheader_implementation. + (zero_event): Ditto. + * specifier.c (make_specifier_internal): Fix alloc_lcrecord. + * menubar-x.c (set_frame_menubar): Fix alloc_lcrecord_type. + * mule-charset.c (make_charset): Ditto. + * console.c (allocate_console): Ditto. + (complex_vars_of_console): Ditto. + * file-coding.c (allocate_coding_system): Ditto. + * device.c (allocate_device): Ditto + * gui-x.c (gcpro_popup_callbacks): Ditto. + * extents.c (allocate_extent_auxiliary): Ditto. + (allocate_extent_info): Ditto. + (copy_extent): Ditto. + * glyphs.c (allocate_image_instance): Ditto. + (allocate_glyph): Ditto. + * frame.c (allocate_frame_core): Ditto. + * database.c (allocate_database): Ditto. + * tooltalk.c (make_tooltalk_message): Ditto. + (make_tooltalk_pattern): Ditto. + * rangetab.c (Fmake_range_table): Ditto. + (Fcopy_range_table): Ditto. + * process.c (make_process_internal): Ditto. + * chartab.c (Fmake_char_table): Ditto. + (make_char_table_entry): Ditto. + (copy_char_table_entry): Ditto. + (Fcopy_char_table): Ditto. + * elhash.c (make_general_lisp_hash_table): Ditto. + (Fcopy_hash_table): Ditto. + * buffer.c (allocate_buffer): Ditto. + (complex_vars_of_buffer): Ditto. + * event-stream.c (allocate_command_builder): Ditto. + * objects.c (Fmake_color_instance): Ditto. + (Fmake_font_instance): Ditto. + (vars_of_objects): Ditto. + * toolbar.c (update_toolbar_button): Ditto. + * window.c (allocate_window): Ditto. + (make_dummy_parent): Ditto. + (Fcurrent_window_configuration): Fix alloc_lcrecord. + (vars_of_window): Fix make_lcrecord_list. + * faces.c (allocate_face): Fix alloc_lcrecord_type. pure_list -> + Flist. + * lstream.c (Lstream_new): Fix make_lcrecord_list. + * opaque.c (make_opaque): Fix alloc_lrecord. + (make_opaque_list): Fix alloc_lrecord_type. + +1999-04-19 Hrvoje Niksic <hniksic@srce.hr> + + * process.c (Fstart_process_internal): Ditto. + + * ntproc.c (sys_spawnve): Use Vlisp_EXEC_SUFFIXES when calling + locate_file(). + + * glyphs-x.c (x_locate_pixmap_file): Ditto. + + * glyphs-msw.c (mswindows_locate_pixmap_file): Fix call to + locate_file(). + + * emodules.c (vars_of_module): New variable Vmodule_extensions. + (emodules_load): Use it when calling locate_file(). + + * emacs.c (main_1): Use Vlisp_EXEC_SUFFIXES when calling + locate_file(). + + * callproc.c: Vlisp_EXEC_SUFFIXES: New variable. + (vars_of_callproc): Initialize it. + (Fcall_process_internal): Use it when calling locate_file(). + + * alloc.c (disksave_object_finalization): Use + Flocate_file_clear_hashing(). + + * lread.c (Flocate_file_clear_hashing): Clear all hasing when + given `t' as argument. + +1999-04-18 Hrvoje Niksic <hniksic@srce.hr> + + * lread.c (locate_file): Expand `pathel' when appropriate. + (Flocate_file_clear_hashing): Expand path elements. + (Flocate_file_clear_hashing): Use Vlocate_file_hash_table. + + * dired.c (make_directory_hash_table): Create the hash-table only + if the directory open is successful. + + * lread.c (decode_mode_1): New function. + (decode_mode): Ditto. + (Flocate_file): Use them. + (Flocate_file): Expand FILENAME. + (locate_file_map_suffixes): New function. + (locate_file_in_directory_mapper): New function. + (locate_file_in_directory): Use locate_file_in_directory_mapper() + and locate_file_map_suffixes(). + (locate_file_construct_suffixed_files): Use + locate_file_map_suffixes(). + (locate_file_without_hash): Don't GCPRO path. + (Flocate_file_clear_hashing): Use EXTERNAL_LIST_LOOP. + (syms_of_lread): Remove Qlocate_file_hash_table. + (locate_file_find_directory_hash_table): Use + Vlocate_file_hash_table. + (locate_file_refresh_hashing): Ditto. + + * lread.c: Renamed read_objects to Vread_objects. + +1999-04-16 Olivier Galibert <galibert@pobox.com> + + * mule-charset.c: Generally resync with fsf 20.3 charset + interface. + (make_charset): Add long and short name. Use id instead of + leading byte. + (Fmake_charset): Ditto. + (Fmake_reverse_direction_charset): Ditto. + (Fcharset_property): Ditto. + (Fcharset_short_name): Added. + (Fcharset_long_name): Added. + (Fcharset_description): Renamed from charset-doc-string. + (syms_of_mule_charset): Synced symbols. + (complex_vars_of_mule_charset): Synced charsets. + + * mule-charset.h: Removed leading byte (uses id instead), added + short and long name. + +1999-04-15 Hrvoje Niksic <hniksic@srce.hr> + + * file-coding.c (Fdefine_coding_system_alias): New function. + +1999-04-08 Olivier Galibert <galibert@pobox.com> + + * mule-charset.c (complex_vars_of_mule_charset): Allow all iso8859 + and -ascii fonts for displaying ascii instead of iso8859-1 only. + +1998-12-14 Hrvoje Niksic <hniksic@srce.hr> + + * extents.c (set_extent_glyph_1): Make sure that the glyph we + attach to the extent is valid. + +1998-12-12 Hrvoje Niksic <hniksic@srce.hr> + + * dired.c (user_name_completion): Mule-ize. + (user_name_completion): Use xmalloc/xrealloc/xfree. + (user_name_completion): Use DO_REALLOC. + (user_name_completion): Cut down the number of static variables; + use a structure. + (user_name_completion): Username completion is always + case-sensitive. + +1998-12-06 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (base64_decode_1): Remove COUNTER. + (base64_decode_1): Accept CRLF in addition to CR. + (base64_decode_1): Disallow a stray character after final EOF; the + check was probably a remnant of buggy recode code. + +1998-12-05 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (init_provide_once): Provide `base64'. + +1998-12-04 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (XMALLOC_UNBIND): Include SPECCOUNT argument, for clarity. + (Fbase64_encode_region): If buffer is read-only, bail out early. + (Fbase64_decode_region): Ditto. + (Fbase64_encode_region): Initialize SPECCOUNT to pacify the + compiler. + (Fbase64_encode_string): Ditto. + (Fbase64_decode_region): Ditto. + (Fbase64_decode_string): Ditto. + +1998-11-25 Hrvoje Niksic <hniksic@srce.hr> + + * dired.c (Fdirectory_files): Remove redundant code. + +1999-03-05 Philip Aston <philipa@parallax.co.uk> + + * frame-msw.c Make raise-frame restore minimised windows. + +1999-03-05 Philip Aston <philipa@parallax.co.uk> + + * device-msw.c: Fix DEFVAR format - Death to phantom quote, and + add magic newline. + +1999-03-05 Philip Aston <philipa@parallax.co.uk> + + * toolbar-msw.c Consider captions when deciding whether to rebuild + toolbar. This fixes the initial toolbar display for those of us + who don't like captions. These patches applied by Andy Piper. + +1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.13 is released + +1999-03-12 SL Baur <steve@xemacs.org> + + * file-coding.c: Guard ucs table initialization with ifdef MULE. + +1999-03-10 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> + + * file-coding.c: docstring and comment improvements. + (decode_ucs4) flag possible data loss with comment. + +1999-03-10 Martin Buchholz <martin@xemacs.org> + + * file-coding.c (Fset_ucs_char): add CHECK_INT, CHECK_CHAR + (ucs_to_char): + (Fucs_char): + (Fset_char_ucs): + (decode_coding_ucs4): + (encode_coding_ucs4): + (detect_coding_utf8): + (decode_coding_utf8): + (encode_utf8): + (encode_coding_utf8): + Add CHECK_* macros where needed to avoid crashes. + #ifdef out all composite character support using + #ifdef ENABLE_COMPOSITE_CHARS + Use normal XEmacs coding standards. + Fix docstrings. + Remove CODING_STREAM_COMPOSE, CODING_STREAM_DECOMPOSE. + +1998-09-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (make-coding-system): Add description about + `ucs-4' and `utf-8'. + (detection_state): Modify to implement ucs-4 and utf-8. + (detect_coding_type): Likewise. + (detect_coding_ucs4): New implementation. + (detect_coding_utf8): New implementation. + (encode_utf8): fixed. + (syms_of_mule_coding): Rename `ucs4' and `utf8' to `ucs-4' and + `utf-8'. + +1998-09-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (mule_char_to_ucs4): Encode 94x94 chars in ISO + 2022 registry to private area. + +1998-09-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (encode_utf8): New function. + (encode_coding_utf8): New implementation. + +1998-09-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (ucs_to_mule_table): New variable; abolish + `Vucs_to_mule_table' + (mule_to_ucs_table): renamed from `Vmule_to_ucs_table'. + (set-ucs-char): New function. + (ucs_to_char): New function. + (ucs-char): New function. + (set-char-ucs): New function. + (char-ucs): New function. + (decode_ucs4): Use `ucs_to_char'. + (complex_vars_of_mule_coding): Abolish `ucs-to-mule-table' and + `mule-to-ucs-table'. + +1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * chartab.h: EXFUN `Fget_char_table'. + + * file-coding.c (encode_ucs4): New function. + (encode_coding_ucs4): Use `encode_ucs4'. + +1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (decode_coding_ucs4): New implementation. + +1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (decode_coding_ucs4): fixed. + + * file-coding.c (Vmule_to_ucs_table): New variable. + (mule_char_to_ucs4): New function. + (encode_coding_ucs4): New implementation. + (complex_vars_of_mule_coding): Define variable + `mule-to-ucs-table'. + +1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (decode_coding_utf8): New implementation. + +1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (decode_coding_utf8): fixed. + +1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (Vucs_to_mule_table): New variable. + (decode_ucs4): Refer `Vucs_to_mule_table'. + (complex_vars_of_mule_coding): Define variable + `ucs-to-mule-table'. + +1998-09-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * file-coding.c (detect_coding_ucs4): New function (not + implemented yet). + (decode_coding_ucs4): New function. + (encode_coding_ucs4): New function (not implemented yet). + (detect_coding_utf8): New function (not implemented yet). + (decode_coding_utf8): New function. + (encode_coding_utf8): New function (not implemented yet). + (make-coding-system): New type `ucs4' and `utf8'. + (coding-system-type): Likewise. + (detection_state): Add `ucs4' and `utf8'. + (detect_coding_type): Likewise. + (mule_decode): Use `decode_coding_ucs4' and `decode_coding_utf8'. + (mule_encode): Use `encode_coding_ucs4' and `encode_coding_utf8'. + (decode_ucs4): New function (very incomplete). + (syms_of_mule_coding): Add `ucs4' and `utf8'. + + * file-coding.h: Add definitions for UCS-4 and UTF-8. + +1999-03-08 Martin Buchholz <martin@xemacs.org> + + * mule-charset.c: + (non_ascii_valid_char_p): + (lookup_composite_char): + (composite_char_string): + (make-composite-char): + (composite-char-string): + (syms_of_mule_charset): + (complex_vars_of_mule_charset): + * mule-charset.h (LEADING_BYTE_COMPOSITE): + (CHAR_LEADING_BYTE): + (MAKE_CHAR): + * file-coding.h (CODING_STATE_COMPOSITE): + (CODING_STATE_ISO2022_LOCK): + (iso_esc_flag): + (LEADING_BYTE_COMPOSITE): + * file-coding.c (struct iso2022_decoder): + (decoding_closer): + (reset_iso2022): + (parse_iso2022_esc): + (encode_coding_iso2022): + #ifdef out all composite character support using + #ifdef ENABLE_COMPOSITE_CHARS + + * alloc.c: Define lrecord_coding_system only if ! FILE_CODING + +1999-03-04 Takeshi YAMADA <yamada@cslab.kecl.ntt.co.jp> + + * fns.c (Fbase64_encode_string): Calculate `allength' in the same + way of `Fbase64_encode_region'. + +1999-02-18 Katsumi Yamaoka <yamaoka@jpl.org> + + * fns.c (base64_encode_1): Don't add a newline at the tail. + +1999-03-08 Andy Piper <andy@xemacs.org> + + * menubar-msw.c (displayable_menu_item): correct off-by-one & + handling. + +1999-03-07 Martin Buchholz <martin@xemacs.org> + + * console-stream.h (struct stream_console): + * event-unixoid.c (event_stream_unixoid_select_console): + (event_stream_unixoid_unselect_console): + * print.c (Fexternal_debugging_output): + * sysdep.c (reset_one_device): + * console-stream.c (stream_init_console): + (stream_delete_console): + (allocate_stream_console_struct): move into stream_init_console. + (free_stream_console_struct): move into stream_delete_console. + Use `fd' only for file descriptors. + Therefore, rename members of struct stream_console. + + * systime.h: Unix98 says sys/time.h should define select(), but + some systems define that in unistd.h. So include that file always. + + * glyphs.h (MAYBE_IIFORMAT_METH): Don't use leading `_'. Avoid + multiple evaluation of first arg. Do proper do {} while (0) wrapping. + (HAS_IIFORMAT_METH_P): Prevent macro from being used in + non-boolean context + (MAYBE_IIFORMAT_DEVMETH): Use standard internal macro naming convention. + + * EmacsShell.c: + * balloon_help.c: + Add #include <stdio.h>. + Some versions of assert.h use printf() without #include'ing stdio.h + + * free-hook.c (blocktype): Add gcpro5_type to blocktype. + (log_gcpro): Remove unused variable FRAME. + (show_gcprohist): Ansify. + Comment the #endif's + + * frame-x.c (x_delete_frame): Don't use FRAME_X_SHELL_WIDGET(f) + after it's just been XtDestroy'ed! + +1999-02-18 Martin Buchholz <martin@xemacs.org> + + * opaque.c (print_opaque): + (sizeof_opaque): + (equal_opaque): + (hash_opaque): + Egcs 1.1.1 seems to have a bug where + INTP (p->size_or_chain) + will crash XEmacs. Fix by introducing intermediate variable. + + * sound.c (Fdevice_sound_enabled_p): Fix compiler warning. + + * dired.c (Fdirectory_files): + (Ffile_name_completion): + (Ffile_name_all_completions): + (file_name_completion): + - Use `directory' instead of `dirname' to sync with FSF Emacs and + avoid compiler warnings. + - Fix up docstrings so that C variables match documentation. + +1999-03-05 Martin Buchholz <martin@xemacs.org> + + * alloc.c: (garbage_collect_1): Reorg code to make scope of local + variables as small as possible to help out the compiler and the maintainer. + + * alloc.c: (disksave_object_finalization): + Set all the *-load-path variables to + nil, not just load-path itself. This gets the locate-file hash + tables garbage collected BEFORE dump, and has the side effect of + preventing crashes on OSF4.0+egcs. + + * alloc.c: + * gdbinit: + * dbxrc: + - Clean up gdb/dbx debugging support. + - Storing an EMACS_INT in an enum is not 64-bit clean! + - So change the enum to a set of separate variables. + - Add test cases to help debug the debugging support! + - Add `lisp-shadows' and `run-temacs' targets for dbx. + - Both dbx and gdb have been tested now. + +1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.12 is released + +1999-02-16 Kazuyuki IENAGA <ienaga@jsys.co.jp> + + * device-x.c: Support to find best visual without flashing. + +1999-03-02 Paul Keusemann <pkeusem@visi.com> + + * database.c (berkdb_map): Add flags argument to cursor call (must + be 0 according to docs) required for Berkeley DB 2.6.4 and later. + +1999-03-03 Martin Buchholz <martin@xemacs.org> + + * hash.c: + * hash.h: + General cleanup. Get free-hook.c working again. + Remove unused functions: + make_strings_hash_table, copy_hash, expand_hash_table. + + * malloc.c: + * mem-limits.h: + Always use new ANSI-style function prototypes. + + * unexalpha.c (unexec): Never use implicit int. + + * sgiplay.c (close_sound_file): + (play_sound_file): + (restore_audio_port): + (play_sound_data): + (audio_initialize): + (play_internal): + (drain_audio_port): + (write_mulaw_8_chunk): + (write_linear_chunk): + (write_linear_32_chunk): + (initialize_audio_port): + (open_audio_port): + (set_channels): + (set_output_format): + (adjust_audio_volume): + (get_current_volumes): + (parse_snd_header): + Always use new ANSI-style function prototypes. + Use unistd.h for missing prototypes. + + * unexelfsgi.c (round_up): + (find_section): + (unexec): Always use new ANSI-style function prototypes + + * elhash.c (struct Lisp_Hash_Table): rename golden to golden_ratio + + * console.h (struct console_methods): Always use full ANSI prototypes + + * emacs.c (__sti__iflPNGFile_c___): Always use full ANSI prototypes + +1999-03-02 Andy Piper <andy@xemacs.org> + + * event-stream.c (init_event_stream): make sure native mswindows + gets an appropriate event loop. + +1999-02-22 Andy Piper <andy@xemacs.org> + + * frame-msw.c (mswindows_make_frame_visible): use SW_SHOW rather + than SW_SHOWNORMAL to prevent resizing of maximised frames. + (mswindows_raise_frame): remove comment. + +1999-03-01 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.11 is released + +1999-02-25 SL Baur <steve@xemacs.org> + + * mule-charset.c (Qleading_byte): New variable to implement + charset-leading-byte function. + (Fcharset_property): Use it. + (syms_of_mule_charset): Initialize it. + From Kazuyuki IENAGA <ienaga@jsys.co.jp> + +1999-02-17 Kazuo Oishi <oishi@ae.agr.yamaguchi-u.ac.jp> + + * glyphs-x.c (cononvert_EImage_to_XImage): correct + bytes per pixel counting. + +1999-02-15 Andy Piper <andy@xemacs.org> + + * s/cygwin32.h (BROKEN_SIGIO): don't define this as it causes + major lockups. + +1999-02-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> + + * fns.c (Fbase64_encode_string): New optional argument + `NO_LINE_BREAK'. + +1999-02-16 Martin Buchholz <martin@xemacs.org> + + * gdbinit: Fix up commands to run temacs. Add lisp-shadows command. + * alloc.c (xcalloc): undef xcalloc, just like xmalloc + +1999-02-10 Martin Buchholz <martin@xemacs.org> + + * s/bsdos4.h: New file. Port to BSDI BSD/OS 4.0. + * xintrinsic.h: Redo CONST support for X11 R4 compatibility. + +1999-02-05 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.10 is released + +1999-02-02 Gleb Arshinov <gleb@cs.stanford.edu> + + * process-nt.c (nt_send_process): + Fix for process-send-region/process-send-string breaking when size + of the input > 128 chars: change maximum chunk size for process + stream from 512 to 128, thus guaranteeing that ntpipe_shove_writer + succeeds. + +1999-02-02 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.9 is released + +1999-01-30 Martin Buchholz <martin@xemacs.org> + + * bytecode.c (funcall_compiled_function): Call + UNBIND_TO_GCPRO instead of UNBIND_TO_GCPRO_VARIABLES_ONLY. + + * backtrace.h (UNBIND_TO_GCPRO_VARIABLES_ONLY): + #ifdef 0 out unused macro. + +1999-01-27 Martin Buchholz <martin@xemacs.org> + + * gui.c (gui_parse_item_keywords_internal): Make static. + +1999-01-21 Andy Piper <andy@xemacs.org> + + * glyphs-msw.c: add xface support. + (mswindows_xface_instantiate): new function copied from glyphs-x.c + (image_instantiator_format_create_glyphs_mswindows): do device + specific initialisation for xfaces. + (xbm_create_bitmap_from_data): line data must be padded to a word + boundary. + + * glyphs-x.c (xface_validate): moved to glyphs.c + (xface_normalize): ditto. + (xface_possible_dest_types): ditto. + (image_instantiator_format_create_glyphs_x): do device specific + initialisation for xfaces. + + * glyphs.h: declare xface symbol. + + * glyphs.c: move generic xface support here. + (xface_validate): moved from glyphs-x.c + (xface_normalize): ditto. + (xface_possible_dest_types): ditto. + (image_instantiator_format_create): xface declarations moved from + glyphs-x.c. + +1999-01-14 Adrian Aichner <aichner@ecf.teradyne.com> + + * event-stream.c (vars_of_event_stream): Fixing documentation. + +1999-01-17 Gunnar Evermann <ge204@eng.cam.ac.uk> + + * glyphs-eimage.c (gif_instantiate): Correct handling of + interlaced gifs to avoid writing past the end of the eimage + buffer. + +1999-01-13 Hrvoje Niksic <hniksic@srce.hr> + + * search.c (Freplace_match): Handle single backslash at end of + NEWTEXT correctly. + +1999-01-12 William M. Perry <wmperry@aventail.com> + + * eldap.c (Fldap_open): slow down interrupts around ldap_open to + avoid connection errors. + +1999-01-12 Andy Piper <andy@xemacs.org> + + * redisplay-output.c (redisplay_update_line): backout change that + shouldn't have gone ine. + +1999-01-09 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * eldap.c (vars_of_ldap): Do no provide `ldap' here since it may + collide with ldap.el + +1999-01-11 Andy Piper <andy@xemacs.org> + + * redisplay.h (DISPLAY_LINE_HEIGHT): new macro. + (DISPLAY_LINE_YPOS): new macro. + + * redisplay-msw.c (mswindows_output_string): use it. + (mswindows_output_pixmap): ditto. + (mswindows_output_display_block): ditto. + + * redisplay-output.c (redisplay_output_display_block): new + function. just call the devmeth, maybe insert some generic code + here later. + (compare_display_blocks): use it. + (output_display_line): ditto. + (redisplay_unmap_subwindows_maybe): new function. potentially + unmap subwindows in the given area. + + * glyphs.c (reset_subwindow_cachels): unmap subwindows that we are + resetting. + +1999-01-10 J. Kean Johnston <jkj@sco.com> + + * Makefile.in.in: Set value of moduledir + - Changed DUMPENV to include $(MODULEPATH) + - Added install rule to install header files for use by ellcc. + + * config.h.in: Added INHIBIT_SITE_MODULES + - Added HAVE__DLERROR + - Added HAVE_DLFCN_H + - Added DLSYM_NEEDS_UNDERSCORE + + * dll.c: Removed. + + * emodules.c: New file containing dynamic loading code. + + * emodules.h: New file. + + * emacs.c: Added variables Vmodule_directory, + Vsite_module_directory, Vconfigure_module_directory and + Vconfigure_site_module_directory. + - (main_1): Added new variable inhibit_site_modules and command + line options `-no-site-modules' and `--no-site-modules'. + - (main_1): Call syms_of_module() instead of syms_of_dll(). + - (main_1): Call vars_of_module(). + - (vars_of_emacs): Introduce inhibit-site-modules, + module-directory, configure-module-directory, + site-module-directory, and configure-site-module-directory to the + Lisp reader. + + * lisp.h: Declare load_module and list_modules, as well as + Vmodule_directory, Vsite_module_directory, + Vconfigure_module_directory and Vconfigure_site_module_directory. + + * paths.h.in: Added PATH_MODULESEARCH and PATH_SITE_MODULES. + - Added correct support for site-lisp directory. + + * symbols.c (defsubr): Modified to allow modules to add new subrs + after dump time. + - (defsubr_macro): Same. + - (defvar_magick): Only use purespace when not initialized, so + that loaded modules can still add symbols. + + * symsinit.h: Add definitions for syms_of_module(), + vars_of_module(). Removed syms_of_dll(). + + * sysdll.c: Include dlfcn.h if HAVE_DLFCN_H is defined. + - (dll_variable): Take DLSYM_NEEDS_UNDERSCORE into account. + - (dll_error): use _dlerror() if HAVE__DLERROR is defined. + + * s/sco5-shr.h (C_SWITCH_SYSTEM): Correct for modern gcc and + explicitly pass -belf for native cc. + + * s/sco5.h (LIB_GCC): Use -print-libgcc-file-name instead of + hard-coding the library name. + +1999-01-01 <martin@xemacs.org> + + * device-x.c (Fx_set_font_path): + Add proper cast to permit compilation under C++. + + * buffer.c (directory_is_current_directory): + Add proper casts to permit compilation under C++. + +1998-12-30 Damon Lipparelli <lipp@primus.com> + * 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 <windows.h>. - - * 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 <ben@xemacs.org> - - * device-x.c: Correct doc string for sixth arg of x-get-resource. - -2000-06-10 Ben Wing <ben@xemacs.org> - - * 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): + Fixed failure when building with MSVC 5. + +1998-12-29 Martin Buchholz <martin@xemacs.org> + + * file-coding.c (decode_coding_iso2022): + - Prevent crash when decoding ISO7/Lock detected files + - the usual martin fiddling + +1998-12-29 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * event-msw.c: + glyphs-msw.c: + Fixed failures when building with MSVC. + * unexnt.c (dump_bss_and_heap): + Removed compiler warning by removing bss_data variable. + +1998-12-18 Jim Radford <radford@robby.caltech.edu> + + * device-x.c (Fx_set_font_path, Fx_get_font_path): New functions + so that packages that distribute their own fonts can access them. + +1998-12-28 Andy Piper <andy@xemacs.org> + + * glyphs-msw.c (mswindows_button_instantiate): cope with buttons + that have an image provided. + + * glyphs.h: add Q_image decl. + + * glyphs-widget.c new functionality allowing images in + widgets. + (check_valid_glyph_or_image): new function to validate + glyphs passed in through :image. + (widget_normalize): new function. convert :image parameters into + real glyphs if not already so. + (widget_instantiate_1): mess with size parameters to be similar to + :image if provided. + (syms_of_glyphs_widget): new keyword :image. + (image_instantiator_format_create_glyphs_widget): normalize + buttons and allow :image. + +1998-12-27 Andy Piper <andy@xemacs.org> + + * frame-msw.c (mswindows_init_frame_1): warning elimination. + + * glyphs-widget.c (check_valid_anything): no-op function. + (check_valid_callback): check callbacks in gui_items. + (check_valid_symbol): as it sounds. + (check_valid_string_or_vector): ditto. + (widget_validate): modified for descriptors that are vectors or + sequences of keyword/val pairs. + (widget_instantiate_1): ditto. + (image_instantiator_format_create_glyphs_widget): allow gui_item + keywords in the instantiator. + + * gui.c (gui_parse_item_keywords_internal): renamed from + gui_parse_item_keywords but taking error behaviour. + (gui_parse_item_keywords): use it. + (gui_parse_item_keywords_no_errors): ditto. + (gui_item_add_keyval_pair): add Error_behavior flag and only + signal invalid keywords if required. + + * gui.h: new gui signatures. + + * menubar.c (menu_parse_submenu_keywords): use new + gui_item_add_keyval_pair signature. + + * s/cygwin32.h: modify PTY_ITERATION to eliminate warnings. + +1998-12-28 Martin Buchholz <martin@xemacs.org> + + * XEmacs 21.2.8 is released. + +1998-12-28 Martin Buchholz <martin@xemacs.org> + + * editfns.c (get_home_directory): + (user-home-directory): Simplify. + + * 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. - + - Environment variables were being passed to inferior processes + using internal encoding. + - Convert to external encoding. + - Rename local var `tem' to better name `tail'. + - Use Flength instead of `manual' calculation. + + * buffer.c (kill-buffer): + (record-buffer): + (set-buffer-major-mode): + (current-buffer): + - Fix up parameter names to correspond to docstrings. + - Don't use `bufname' when a buffer will do as well. + - Remove one unneeded GCPRO. + + * buffer.h (initial_directory): + * buffer.c (init_initial_directory): + - use correct conversions between internal and external format. + (directory_is_current_directory): new function + (init_buffer): convert initial_directory to internal format. + - solve crashes when current working directory is non-ASCII. + + * alloc.c (xmalloc): + (xcalloc): + (xrealloc): + - remove stupid casts, since XEmacs requires an ANSI C system. + (lrecord_type_index): replace abort() with more readable assert(). + + (reset_lcrecord_stats): remove. + (sweep_lcrecords_1): + - replace call to reset_lcrecord_stats() with call to xzero(). + +1998-12-27 Martin Buchholz <martin@xemacs.org> + * 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 <ben@xemacs.org> - - * 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 <ben@xemacs.org> - - * 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 <ben@xemacs.org> - - * 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 <hniksic@iskon.hr> - - * lisp.h (set_string_char): Call set_string_byte with a Bufbyte, - not an Emchar. - -2000-06-04 Mike Sperber <mike@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * data.c (Faset): Don't cast XCHAR() to unsigned char. - -2000-06-05 Ben Wing <ben@xemacs.org> - - * callproc.c (child_setup): Don't do close_load_descs() under - MS Windows. Put in a comment explaining why. - -2000-05-28 Adrian Aichner <aichner@ecf.teradyne.com> - - * 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 <aj@suse.de> - - * s/s390.h: Support for S390, based on a patch by Martin - Schwidefsky <schwidefsky@de.ibm.com>. - -2000-05-30 Andy Piper <andy@xemacs.org> - - * 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 <galibert@pobox.com> - - * 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 <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.34 is released. - -2000-05-22 Jan Vroonhof <vroonhof@math.ethz.ch> - - * 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 <vroonhof@math.ethz.ch> - - * 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 <yoshiki@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <CraigL@DyCon.com> - - * 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 <andy@xemacs.org> - - * console-msw.c (mswindows_output_last_error): ; -> , - -2000-05-12 Andy Piper <andy@xemacs.org> - - * console-msw.c (FROB): compare ints with ints. - -2000-05-11 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_finalize_image_instance): make minimal build - happy. - -2000-05-20 Ben Wing <ben@xemacs.org> - - * 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. + - Fix crash invoking program with non-ASCII name. + Try invoking xemacs with SHELL=/bin/sh, then M-x shell. + - Remove unused variable `env'. + - Rename `temp' to better name `save_errno'. + - Reorganize code for clarity. But still too chicken to nuke the + BSD 4.2 support. + +1998-12-24 Martin Buchholz <martin@xemacs.org> + + * XEmacs 21.2.7 is released. + +1998-12-23 Martin Buchholz <martin@xemacs.org> + + * glyphs.c (decode_device_ii_format): + - Fix indentation. + - Use GET_C_STRING_FILENAME_DATA_ALLOCA with char *, not Extbyte *. + + * glyphs-x.c (x_subwindow_instantiate): + - A image instance mask was being assigned to a image instance type! + - X_SUBWINDOW_INSTANCE_DATA (ii) is not an lvalue in C++. + + * glyphs-msw.c (mswindows_initialize_dibitmap_image_instance): + Fix indentation. + * glyphs-x.h: Make indentation consistent. + + * emacs.c (Fdump_emacs): Remove Steve Martin merge artifacts. + + * glyphs-widget.c (check_valid_glyph): Warning suppression. + - Make it static + - #ifdef it out, since it's not actually used yet (FIX THIS!) + + * glyphs-widget.c: + * glyphs.h: + Move declarations of decode_device_ii_format and + decode_image_instantiator_format into glyphs.h where they belong. + +1998-12-22 Martin Buchholz <martin@xemacs.org> + + * frame-x.c (x_delete_frame): Revert part of my changes at the + suggestion of Gunnar Evermann - unfortunately no one really + understands this code. + + * callproc.c (init_callproc): code cleanup. + + * free-hook.c (malloc): + (check_malloc): + (__free_hook): + (__malloc_hook): + (__realloc_hook): + (block_input_malloc): + (block_input_realloc): + * device-x.c (x_delete_device): + * emacs.c (voodoo_free_hook): + * events.c (print_event): + (CHECK_EVENT_TYPE): + (CHECK_EVENT_TYPE2): + (CHECK_EVENT_TYPE3): + Use proper prototypes. + Make C_E_T macros a little faster. + Pedantic fiddly little changes. You really don't care. + +1998-12-22 Andy Piper <andy@xemacs.org> + + * redisplay-output.c (redisplay_clear_region): make sure that + fg/bg colors get set even when we are in the border area. + +1998-12-13 Martin Buchholz <martin@xemacs.org> + + * console-msw.c: Function definitions follow coding standards + - This prevents e.g. find-tag on Lisp_Event finding DEVENT + +1998-12-11 Martin Buchholz <martin@xemacs.org> + + * events.h (struct timeout_data): + * event-tty.c (tty_timeout_to_emacs_event): + * event-msw.c (mswindows_wm_timer_callback): + * event-Xt.c (Xt_timeout_to_emacs_event): + * event-msw.c (mswindows_cancel_dispatch_event): + Make sure Lisp_Objects inside events are initialized to Qnil, not + Qnull_pointer, which is now illegal. + +1998-12-10 Martin Buchholz <martin@xemacs.org> + + * lisp.h: Fix up prototypes to match alloc.c + +1998-12-08 Martin Buchholz <martin@xemacs.org> + + * windowsnt.h: Remove `support' for using index and rindex + + * filelock.c (current_lock_owner): + - Change uses of index -> strchr, rindex -> strrchr + +1998-12-07 Martin Buchholz <martin@xemacs.org> + + * sysdep.c (set_descriptor_non_blocking): + Since O_NONBLOCK is now always #defined, make use of fcntl + conditional on F_SETFL being defined. + + * console-msw.c (DHEADgER): + (DOPAQUE_DATA): + (DEVENT): + (DCONS): + (DCONSCDR): + (DSTRING): + (DVECTOR): + (DSYMBOL): + (DSYMNAME): + - max_align_t should not be visible to the user of the + XOPAQUE_DATA macro. + - use Bufbyte instead of char + - parens around (FOOP (obj)) are always redundant. + If they were necessary, we should fix the macro instead. + - Always use string_data(foo) instead of foo->data. + + +1998-12-06 Martin Buchholz <martin@xemacs.org> + + * frame-msw.c (mswindows_init_frame_1): + - use make_lisp_hash_table, not Fmake_hash_table + - include elhash.h * lisp.h: - add CHECK_FUNCTION. - - * rangetab.c: - implement map-range-table. - - -2000-05-17 Yoshiki Hayashi <yoshiki@xemacs.org> - - * redisplay-tty.c (reset_tty_modes): - (tty_redisplay_shutdown): Adjust argument type to - tty_frame_output_end. - -2000-05-11 Yoshiki Hayashi <yoshiki@xemacs.org> - - * eval.c (Fbacktrace): Don't output a line with only right - parenthesis. - -2000-05-17 Kenji Itoh <keit@tpj.co.jp> - - * postgresql.c (Fpq_connect_poll): Replace `PS' with `polling_status'. - (Fpq_reset_poll): Ditto. - -2000-05-16 Katsumi Yamaoka <yamaoka@jpl.org> - - * redisplay-tty.c: Replace tty_output_end with tty_frame_output_end. - -2000-05-16 Ben Wing <ben@xemacs.org> - - * 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. - + * alloc.c (make_vector): remove travesty + (Fmake_vector): + (make_pure_vector): + (pure_cons): + (make_bit_vector_internal): + (make_bit_vector): + (make_bit_vector_from_byte_vector): + (Fmake_bit_vector): + - make vector_equal a little faster. + - Don't use variable name `new'. + - Use size_t instead of EMACS_INT. + - usual Martin-style pointless bit-twiddling. + + * fns.c (mapcar1): + (Fmapconcat): + (Fmapcar): + (Fmapvector): + Make mapcar faster. In particular, make + (mapc #'identity long-string) + MUCH faster under Mule. + * tests/automated/lisp-tests.el: Test 'em! + + * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded + bytecode. + +1998-12-01 Martin Buchholz <martin@xemacs.org> + + * menubar-x.c (menu_item_descriptor_to_widget_value_1): Always use + Qnil, not NULL, to initialize `null' Lisp_Objects. + +1998-11-29 Hrvoje Niksic <hniksic@srce.hr> + + * specifier.c (display_table_validate): Update. + + * redisplay.c (create_text_block): Use them. + + * glyphs.c (display_table_entry): New function. + (get_display_tables): Ditto. + +1998-12-15 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * eldap.c (toplevel): Mention that eldap.c compiles with + OpenLDAP libs + (Fldap_open): Use `GET_C_STRING_OS_DATA_ALLOCA' + (Fldap_search_internal): Ditto + +1998-12-11 Martin Buchholz <martin@xemacs.org> + + * event-msw.c (mswindows_cancel_dispatch_event): + Gratuitous code prettification + + +1998-12-07 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (Fnconc): Fix use of wrong_type_argument(). + + * floatfns.c (Ffloat): Fix docstring. + (Ffloat): Fix use of wrong_type_argument(). + (Fabs): Ditto. + (extract_float): Ditto. + (Fceiling): Ditto. + (Fround): Ditto. + (Ftruncate): Ditto. + +1998-12-06 Martin Buchholz <martin@xemacs.org> + * 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 <ben@xemacs.org> - - * 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 <vroonhof@math.ethz.ch> - - 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 <ben@xemacs.org> - - * 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. - + - use make_lisp_hash_table, not Fmake_hash_table + - include elhash.h + * 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 <yoshiki@xemacs.org> - - * glyphs.c (image_instantiate): Suppress gcc warnings. - (Fmake_image_instance): Fix doc string. - * specifier.c (Fmake_specifier): Ditto. - -2000-05-02 Yoshiki Hayashi <yoshiki@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * fns.c (Ffeaturep): Update e-mail address in doc-string. - Document (featurep '(and xemacs 21.02)). - -2000-05-09 Ben Wing <ben@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <ben@xemacs.org> - - * ntheap.c (recreate_heap): Changed unknown (VC6 only?) SIZE_T to - DWORD. - -2000-04-26 Mike Woolley <mike@bulsara.com> - - * 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 <vroonhof@math.ethz.ch> - - * callproc.c (Fold_call_process_internal): GCPRO path - -2000-05-08 Jan Vroonhof <jan@xemacs.org> - - 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 <ben@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * nt.c: remove bogus reference to sysmmsystem.h - - * gui-x.c (popup_selection_callback): fix no selection abort. - -2000-05-02 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_update_widget): cope with nil text. + * alloc.c (make_vector): remove travesty + (Fmake_vector): + (make_pure_vector): + (pure_cons): + (make_bit_vector_internal): + (make_bit_vector): + (make_bit_vector_from_byte_vector): + (Fmake_bit_vector): + - make vector_equal a little faster. + - Don't use variable name `new'. + - Use size_t instead of EMACS_INT. + - usual Martin-style pointless bit-twiddling. + + * fns.c (mapcar1): + (Fmapconcat): + (Fmapcar): + (Fmapvector): + Make mapcar faster. In particular, make + (mapc #'identity long-string) + MUCH faster under Mule. + * tests/automated/lisp-tests.el: Test 'em! + + * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded + bytecode. + +1998-12-02 Didier Verna <verna@inf.enst.fr> + + * menubar-x.c (menu_item_descriptor_to_widget_value_1): set the + accelerator field to nil for labels. + +1998-12-16 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * menubar-msw.c (displayable_menu_item): + Escape occurrences of '&' and support occurrences of the + '%_' accelerator indicator in menus. + +1998-11-26 Didier Verna <verna@inf.enst.fr> + + * dired.c (Fdirectory_files): use make_string instead of + make_ext_string on the filename. The conversion external->internal + format is already done in sys_readdir. + +1998-12-15 Gunnar Evermann <ge204@eng.cam.ac.uk> + + * glyphs.c (normalize_image_instantiator): GCPRO instantiator + +1998-12-16 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * event-msw.c + (Belatedly) added Kirill to list of file's authors. + emacs_mswindows_quit_p: Don't process WM_PAINT messages in + quit checking. WM_PAINT messages cause redisplay, but + windows' states are not necessarily stable when this function + gets called. + +1998-12-17 Andy Piper <andy@xemacs.org> + + * strftime.c (zone_name): CONSTify. + +1998-12-15 Andy Piper <andy@xemacs.org> + + * glyphs-msw.c (mswindows_combo_instantiate): ditto. + (mswindows_widget_property): return Qunbound when no property available. + (mswindows_button_property): ditto. + (mswindows_combo_property): ditto. + (mswindows_widget_set_property): ditto. + + * glyphs-widget.c (check_valid_item_list): use properties. + + * glyphs.h (struct Lisp_Image_Instance): we have properties now. + + * glyphs.c (Fset_image_instance_property): allow setting of arbitrary properties. + (Fimage_instance_property): ditto. + * glyphs-widget.c (widget_property): ditto. + (widget_set_property): ditto. + + * frame-msw.c (mswindows_set_frame_pointer): SetCursor() as well + as setting the class cursor so that GC actually changes the + cursor. + + * config.h: don't undef MAIL_USE_POP. + +1998-12-13 Andy Piper <andy@xemacs.org> + + * glyphs-msw.c + (image_instantiator_format_create_glyphs_mswindows): line -> + label. + (mswindows_label_instantiate): ditto. Play with window flags. + (image_instantiator_format_create_glyphs_mswindows): ditto. + (vars_of_glyphs_mswindows): provide Qlabel as we support it now. + + * glyphs-widget.c (widget_instantiate_1): re-jig autosizing to + cope with lines and labels. + (static_instantiate): use widget_instantiate_1. + line -> label. + (image_instantiator_format_create_glyphs_widget): ditto. + +1998-12-10 Andy Piper <andy@xemacs.org> + + * Makefile.in.in (objs): add gui.o + +1998-12-10 Andy Piper <andy@xemacs.org> + + * gui.c: adjust defines of HAVE_POPUPS so that we can build with + no window system. + +1998-12-09 Andy Piper <andy@xemacs.org> + + * glyphs.c (finalize_image_instance): mark glyphs changed when an + image instance is removed so that the subwindow cache gets reset + and thus destroyed images get GC'd. + +1998-12-08 Andy Piper <andy@xemacs.org> + + * gui-msw.c (mswindows_handle_gui_wm_command): call + MARK_SUBWINDOWS_CHANGED. + + * glyphs-msw.c (mswindows_finalize_image_instance): make sure + subwindows really get deleted. + + * redisplay.c: new variable subwindows_changed[_set]. + (redisplay_window): use it. + (redisplay_frame): ditto. + (redisplay_device): ditto. + (redisplay_without_hooks): ditto. + + * device.h (MARK_DEVICE_SUBWINDOWS_CHANGED): new macro for + subwindows redisplay as per glyphs equivalent. + * redisplay.h: ditto. + (MARK_SUBWINDOWS_CHANGED): ditto. + (RESET_CHANGED_SET_FLAGS): ditto. + * frame.h (MARK_FRAME_SUBWINDOWS_CHANGED): ditto. + +1998-12-07 Andy Piper <andy@xemacs.org> + + * frame.c (Fmake_frame): reset subwindow cachels on non-stream + frames. + + * redisplay.c (redisplay_frame): invalidate subwindow cachels. + + * event-msw.c (mswindows_wnd_proc): catch the various WM_CTLCOLOR* + messages and paint widget glyphs as appropriate with their face fg + & bg. + +1998-12-06 Andy Piper <andy@xemacs.org> + + * glyphs-msw.c (vars_of_glyphs_mswindows): provide widget types + here rather than in glyphs-widget - do this because we only want + to provide what is really available. + + * glyphs.c (Fimage_instance_property): new function to get the + properties of image instances. wires through to console specific + methods and then to widget specific methods. + (Fset_image_instance_property): ditto but for setting widget properties. + (check_valid_face): make extern so that it can be used elsewhere. + + * glyphs-widget.c (widget_property): new function. gets the + properties of widgets in general and wires the function through to + widget specific ones. + (widget_set_property): ditto but for setting widget properties. + + * glyphs-msw.c (mswindows_combo_instantiate): Add functionality to + add items to the list. Play with window styles a bit to get the + desired effect. + (mswindows_widget_property): break out specific widget properties. + (mswindows_button_property): new function. gets the checked state + of a button. + (mswindows_combo_property): new function. gets the current + selection in the combo box. + (mswindows_widget_set_property): new function. sets specific + properties of specific widgets. + + * glyphs-widget.c (check_valid_item_list): new function. check + that items for a combo-box are just a list of strings. + (combo_validate): new function. check there is an item list. + (widget_instantiate_1): new function. renamed from + widget_instantiate so that we can do slightly different things for + other widgets. + (widget_instantiate): call widget_instantiate_1. + (combo_instantiate): new function to instantiate combo boxes, + defaults height to the pixel height of the number of items in the + box. + (syms_of_glyphs_widget): move widget keywords here. + (image_instantiator_format_create_glyphs_widget): use new combo + functions. + +1998-12-04 Andy Piper <andy@xemacs.org> + + * event-msw.c (mswindows_wnd_proc): mule-ize. + + * glyphs.c (pixmap_to_lisp_data): mule-ize. + + * glyphs-msw.c (extract_xpm_color_names): mule-ize. + (resource_name_to_resource): ditto. + (mswindows_resource_instantiate): ditto. (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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * glyphs.h (IIFORMAT_METH_OR_GIVEN): cope with null meths. - - * glyphs-widget.c (widget_layout): return something. - (layout_layout): return something. Fail if not intialized. - (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 <andy@xemacs.org> - - * 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. + (mswindows_widget_set_property): ditto. + + * redisplay-output.c (redisplay_output_subwindow): don't show + subwindows if they are obscured at the edge of the frame, emacs + gets into some sort of redisplay loop otherwise. + + * gui.h: prototype gui_item_selected_p. + + * gui.c (gui_item_selected_p): new function to determine the + selected state of a gui_item. + + * frame.h (struct frame): add subwindows_changed flag. + + * redisplay.c (redisplay_frame): call update_frame_subwindows (). + + * glyphs.c (update_subwindow): new function to update a + subwindow's state. + (update_frame_subwindows): new function to update all the + subwindows on a frame. + + * console.h (struct console_methods): add update_subwindow. + + * glyphs-msw.c (mswindows_widget_property): return selected state + for selected property. + (mswindows_update_subwindow): new function. updates widget glyphs + in redisplay as per menubars or toolbars e.g. selected state. + (console_type_create_glyphs_mswindows): add update_subwindow. + +1998-12-03 Andy Piper <andy@xemacs.org> + + * console-tty.c (syms_of_console_tty): MULE -> FILE_CODING since + tty coding system things are such. + + * glyphs-widget.c (widget_face_font_info): new function for + pulling out height and width metrics for a widget's face. + (widget_text_to_pixel_conversion): calculate pixel sizes of text + for widgets. + + * event-msw.c (mswindows_drain_windows_queue): translate messages + that are destined for subwindows. This makes edit fields interact + with the keyboard correctly. + nuke warnings by #ifndef'ing out stuff not required by msg select(). + + * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): new + macro defining the iiforma without the symbol required by widget. + (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT): use it. + + * general.c (syms_of_general): add Qwidget, Qselected. + + * faces.c (complex_vars_of_faces): add widget face inheriting from + gui-element face. + +1998-11-09 Andy Piper <andy@xemacs.org> + + * window.h (struct window): add a cache of subwindows on a + per-window basis. + + * window.c (mark_window): mark the subwindow_instance_cache. + (allocate_window): initialise the subwindow instance_cache. + + * toolbar-x.c (x_output_toolbar): call redisplay_clear_region + instead of the devmeth. + (x_clear_toolbar): ditto. + + * redisplay-x.c (x_output_display_block): call + redisplay_output_subwindow for subwindows and widgets. + + * redisplay-tty.c (tty_output_display_block): add IMAGE_WIDGET to + types to do nothing for. + + * lisp.h: declare new widget/subwindow symbols. + + * glyphs.c (image_instantiate): cache subwindows on a per-window + basis. + (subwindow_possible_dest_types): new function for subwindow dest + types. + (subwindow_instantiate): generic instantiation of a + subwindow. specialised by device multi-methods. + (Fsubwindowp): moved from glyphs-x.c. adapted for glyph-based + subwindows. + (Fimage_instance_subwindow_id): ditto. + (Fresize_subwindow): ditto. + (Fforce_subwindow_map): ditto. + + * glyphs-x.c (x_print_image_instance): remove subwindow + stuff. Handled genrically in glyphs.c. + (x_image_instance_equal): ditto. + (x_image_instance_hash): ditto. + (x_finalize_image_instance): delete subwindows when required. + (mark_subwindow) (print_subwindow) (finalize_subwindow) + (subwindow_hash) (Fmake_subwindow): deleted because of new, + glyph-based, subwindow implementation. + (Fsubwindow_height) (Fsubwindow_width) (Fsubwindow_xid): aliased + in glyphs.el + (Fsubwindowp) (Fresize_subwindow) (Fforce_subwindow_map): moved to + glyphs.c. + (x_unmap_subwindow): new function to unmap X subwindows. + (x_map_subwindow): new function to map X subwindows. + (x_subwindow_instantiate): new function to instantiate X + subwindows. + (x_resize_subwindow): new function to resize X subwindows. + (console_type_create_glyphs_x): add subwindow functions. + (image_instantiator_format_create_glyphs_x): add device + multi-methods for xpm, xbm and subwindow. + + * glyphs.el (subwindow-xid): old alias for new subwindow functions. + (subwindow-width): ditto. + (subwindow-height): ditto. + + * glyphs-msw.c (mswindows_widget_instantiate): new function for + generally instantiating ms subwindows. Used by + mswindows_*_instantiate. + (mswindows_edit_instantiate): instantiate an edit field on a + mswindows frame. + +1998-11-04 Andy Piper <andy@xemacs.org> + + * symsinit.h: declare new functions. + + * redisplay.h: declare new functions. + + * redisplay-x.c (x_output_display_block): call + redisplay_clear_region rather than x_clear_region. + (x_output_string): ditto. + (x_output_pixmap): ditto. + (x_clear_to_window_end): ditto. + (x_output_eol_cursor): ditto. + (x_clear_region): only do X specific things. other duties handled + in redisplay_clear_region. + + * redisplay-tty.c (tty_clear_region): do tty specific things - some + duties moved to redisplay_clear_region. + + * redisplay-output.c (clear_left_border): use + redisplay_clear_region instead of device method. + (clear_right_border): ditto. + (output_display_line): ditto. + (redisplay_output_subwindow): ditto. + (redisplay_clear_top_of_window): ditto. + (redisplay_clear_region): perform duties previously handled by + device methods. call the appropriate device method at the + end. unmap subwindows if necessary. + + * redisplay-msw.c (mswindows_output_string): use + redisplay_clear_region instead of mswindows_clear_region. + (mswindows_clear_to_window_end): ditto. + (mswindows_output_display_block): output subwindows when required. + (mswindows_clear_region): only do mswindows specific things, + everything else is now handled in redisplay_clear_region. + + * gui.h: add item id hash defines and declare function prototypes. + + * gui.c (mark_gui_item): new function for marking gui_items. + (gui_item_hash): generic hash function for generating command ids + for gui_items. + + * gui-msw.c: new file. + (mswindows_handle_gui_wm_command): new function to handle widget + callbacks. + + * glyphs.h (MAYBE_IIFORMAT_DEVMETH): new function for device + multi-methods. + (IIFORMAT_HAS_SHARED_METHOD): ditto. + (DEFINE_DEVICE_IIFORMAT): ditto. + (INITIALIZE_DEVICE_IIFORMAT): ditto. + (struct Lisp_Image_Instance): add widget and subwindow data plus + appropriate access functions. + + * glyphs.c (decode_device_ii_format): new function for decoding + image instantiator functions based on a device type as well as an + image format. + (decode_image_instantiator_format): just call + decode_device_ii_format with nil device. + (add_entry_to_device_ii_format_list): new function for per device + method instances. + (add_entry_to_image_instantiator_format_list): just call + add_entry_to_device_ii_format_list with nil device. + (check_valid_vector): new function. + (instantiate_image_instantiator): instantiate using per-format + method and then per-format-per-device method (device + multi-methods). signal an error if neither is possible. + (mark_image_instance): cope with subwindows and widgets. (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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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. + (glyph_width): ditto. + (glyph_height_internal): ditto. + (xpm_instantiate): removed because of device multi-methods. + (mark_subwindow_cachels): new cachel functions for caching + instantiated subwindows on a per-frame basis. mostly copied from + glyph cachel functions. + (update_subwindow_cachel_data): ditto. + (add_subwindow_cachel): ditto. + (get_subwindow_cachel_index): ditto. + (reset_subwindow_cachels): ditto. + (mark_subwindow_cachels_as_not_updated): ditto. + (unmap_subwindow): generic unmapping of subwindows based on cachel + data. (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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.33 is released. - -2000-05-01 Yoshiki Hayashi <yoshiki@xemacs.org> - - * make-src-depend: Allow dots in header file name. - -2000-05-01 Yoshiki Hayashi <yoshiki@xmacs.org> - - * 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 <yoshiki@xemacs.org> - - * 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 <torkel@hpc2n.umu.se> - - * 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 <ben@xemacs.org> + (initialize_subwindow_image_instance): generic initialisation of + subwindow data. + (syms_of_glyphs): add widget keywords. + + * glyphs-x.h (struct x_subwindow_data): convert Lisp_Subwindow to + x_subwindow_data. + +1998-11-04 Andy Piper <andy@xemacs.org> + + * glyphs-widget.c: new file for instantiating widget type glyphs. + (widget_possible_dest_types): new general dest type function for + widgets. + (widget_validate): ditto. + (initialize_widget_image_instance): ditto + (widget_instantiate): ditto. Sets up fg/bg, gui_item parsing + before handing on control to device multi-methods. + (syms_of_glyphs_widget): new function. + (image_instantiator_format_create_glyphs_widget): new function, + added placeholders for button, edit, combo, scrollbar + (vars_of_glyphs_widget): new function. + + * glyphs-msw.h (WIDGET_INSTANCE_MSWINDOWS_HANDLE): new define for + storing window ids of widgets. + + * glyphs-msw.c (mswindows_finalize_image_instance): cope with + deletion of widget and subwindow glyphs. + (mswindows_unmap_subwindow): new device function for unmapping + subwindows on a msw frame. + (mswindows_map_subwindow): ditto. + (mswindows_register_image_instance): register instantiated widgets + with the widget hastable. + (mswindows_button_instantiate): instantiate a button type widget + on an msw frame. + (mswindows_subwindow_instantiate): instanttiate a subwindow on a + mswindows frame. + (image_instantiator_format_create_glyphs_mswindows): add device + multi-methods for xbm, xpm, subwindow, edit and button. + + * frame.h (struct frame): add subwindow_cachels dynarr for caching + information about subwindows visible on the current frame. used by + redisplay_clear_region to unmap subwindows as required. + + * frame.c (mark_frame): mark subwindow_cachels. + (allocate_frame_core): instantiate subwindow_cachels. + + * frame-msw.c (mswindows_init_frame_1): instntiate and mark the + widget hashtable. + + * event-msw.c (mswindows_wnd_proc): add call to + mswindows_handle_gui_wm_command to handle widget callbacks. + + * emacs.c (main_1): add calls to glyphs-widget initialisation + routines. + + * console.h (struct console_methods): add + unmap/map_subwindow_method for use be redisplay_clear_region to + map and unmap subwindows. Remove xpm and xbm stuff - now dealt + with by image instantiator multi-methods. Add + resize_subwindow_method. + + * console-stream.c (stream_clear_region): change signature to + match new generic clear region function. + + * Makefile.in.in: add glyphs-widget.o to list of objects. + + * console-msw.h (struct mswindows_frame): add widget hashtable for + wiring command ids to callbacks. + +1998-12-16 Andy Piper <andy@xemacs.org> + + * XEmacs 21.2.6 is released + +1998-12-08 Hrvoje Niksic <hniksic@srce.hr> + + * md5.c (Fmd5): Correctly initiate string input stream. + + * Makefile.in.in (tests): Add md5-tests.el. + +1998-12-06 Martin Buchholz <martin@xemacs.org> + + * lisp.h: + * alloc.c (make_vector): remove travesty + (Fmake_vector): + (make_pure_vector): + (pure_cons): + (make_bit_vector_internal): + (make_bit_vector): + (make_bit_vector_from_byte_vector): + (Fmake_bit_vector): + - make vector_equal a little faster. + - Don't use variable name `new'. + - Use size_t instead of EMACS_INT. + - usual Martin-style pointless bit-twiddling. + + * fns.c (mapcar1): + (Fmapconcat): + (Fmapcar): + (Fmapvector): + Make mapcar faster. In particular, make + (mapc #'identity long-string) + MUCH faster under Mule. + * tests/automated/lisp-tests.el: Test 'em! + +1998-12-06 Martin Buchholz <martin@xemacs.org> + + * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded + bytecode. + +1998-12-13 Martin Buchholz <martin@xemacs.org> + + * console-msw.c: Function definitions follow coding standards + - This prevents e.g. find-tag on Lisp_Event finding DEVENT + +1998-12-11 Martin Buchholz <martin@xemacs.org> + + * events.h (struct timeout_data): + * event-tty.c (tty_timeout_to_emacs_event): + * event-msw.c (mswindows_wm_timer_callback): + * event-Xt.c (Xt_timeout_to_emacs_event): + * event-msw.c (mswindows_cancel_dispatch_event): + Make sure Lisp_Objects inside events are initialized to Qnil, not + Qnull_pointer, which is now illegal. + +1998-12-10 Martin Buchholz <martin@xemacs.org> + + * lisp.h: Fix up prototypes to match alloc.c + +1998-12-09 Andy Piper <andy@xemacs.org> + + * glyphs-msw.c (init_image_instance_from_xbm_inline): don't use + XSETINT for assigning lisp objects. + +1998-12-07 Martin Buchholz <martin@xemacs.org> + + * opaque.h: + * console-msw.c (DHEADER): + (DOPAQUE_DATA): + (DEVENT): + (DCONS): + (DCONSCDR): + (DSTRING): + (DVECTOR): + (DSYMBOL): + (DSYMNAME): + - max_align_t should not be visible to the user of the + XOPAQUE_DATA macro. + - use Bufbyte instead of char + - parens around (FOOP (obj)) are always redundant. + If they were necessary, we should fix the macro instead. + - Always use string_data(foo) instead of foo->data. + +1998-12-07 Martin Buchholz <martin@xemacs.org> + + * sysdep.c (set_descriptor_non_blocking): + Since O_NONBLOCK is now always #defined, make use of fcntl + conditional on F_SETFL being defined. + +1998-12-09 Andy Piper <andy@xemacs.org> + + * menubar-msw.c (mswindows_handle_wm_command): add back in checks + that got removed in the merge + +1998-11-30 Greg Klanderman <greg@alphatech.com> + + * dired.c (vars_of_dired): bugfix for previous conditionalization + of user-name-completion on non- Windows NT. + +1998-12-08 Martin Buchholz <martin@xemacs.org> + + * windowsnt.h: Remove `support' for using index and rindex + + * filelock.c (current_lock_owner): + - Change uses of index -> strchr, rindex -> strrchr + +1998-12-06 Martin Buchholz <martin@xemacs.org> * 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. - + - use make_lisp_hash_table, not Fmake_hash_table + - include elhash.h + +1998-12-05 XEmacs Build Bot <builds@cvs.xemacs.org> + + * XEmacs 21.2.5 is released + +1998-11-30 Martin Buchholz <martin@xemacs.org> + + * xselect.c (receive_incremental_selection): + * xselect.c (x_get_window_property): + * xmu.c (XmuReadBitmapDataFromFile): + * xmu.c (XmuCursorNameToIndex): + * xgccache.c (describe_gc_cache): + * xgccache.c (gc_cache_lookup): + * xgccache.c (free_gc_cache): + * xgccache.c (make_gc_cache): + * window.h: + * window.c (map_windows_1): + * window.c (Fother_window_for_scrolling): + * window.c (window_scroll): + * window.c (change_window_height): + * window.c (Fsplit_window): + * window.c (window_left_gutter_width): + * window.c (window_modeline_height): + * window.c (invalidate_vertical_divider_cache_in_window): + * window.c (window_needs_vertical_divider_1): + * window.c (update_mirror_internal): + * window.c (SET_LAST_FACECHANGE): + * widget.c (Fwidget_plist_member): + * unexec.c (copy_text_and_data): + * unexcw.c (copy_executable_and_dump_data_section): + * tooltalk.doc: + * tooltalk.c (struct Lisp_Tooltalk_Pattern): + * tooltalk.c (struct Lisp_Tooltalk_Message): + * toolbar.h (struct toolbar_button): + * toolbar.c (default_toolbar_visible_p_changed_in_window): + * toolbar.c (recompute_overlaying_specifier): + * toolbar.c (toolbar_validate): + * toolbar.c (toolbar_button_at_pixpos): + * toolbar.c (get_toolbar_coords): + * toolbar.c (update_frame_toolbars): + * toolbar-x.c: + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): + * toolbar-msw.c (mswindows_find_toolbar_pos): + * toolbar-msw.c (mswindows_output_toolbar): + * toolbar-msw.c (mswindows_clear_toolbar): + * toolbar-msw.c: + * systty.h: + * syssignal.h: + * sysproc.h: + * sysfile.h: + * sysdll.c: + * sysdep.h: + * sysdep.c (rmdir): + * sysdep.c (sys_fopen): + * sysdep.c (sys_open): + * sysdep.c (tty_init_sys_modes_on_device): + * sysdep.c (get_eof_char): + * sysdep.c (child_setup_tty): + * sysdep.c (set_descriptor_non_blocking): + * syntax.h: + * syntax.c (scan_words): + * syntax.c: + * symsinit.h: + * symeval.h (struct symbol_value_varalias): + * symeval.h (struct symbol_value_forward): + * symbols.c (syms_of_symbols): + * symbols.c (init_symbols_once_early): + * symbols.c (Fbuilt_in_variable_type): + * symbols.c (Fsymbol_value_in_buffer): + * symbols.c (default_value): + * symbols.c (Fset): + * symbols.c (find_symbol_value_quickly): + * symbols.c (store_symval_forwarding): + * symbols.c (set_default_console_slot_variable): + * symbols.c (set_default_buffer_slot_variable): + * symbols.c (verify_ok_for_buffer_local): + * symbols.c (symbol_is_constant): + * symbols.c (oblookup): + * symbols.c (Funintern): + * symbols.c (Fintern): + * symbols.c (check_obarray): + * sunplay.c: + * specifier.h (struct specifier_methods): + * specifier.h: + * specifier.c (specifier_instance): + * specifier.c (specifier_instance_from_inst_list): + * specifier.c (decode_locale_type): + * specifier.c (specifier_equal): + * specifier.c (finalize_specifier): + * specifier.c (prune_specifiers): + * specifier.c (kill_specifier_buffer_locals): + * sound.c (init_native_sound): + * sound.c: + * signal.c (alarm): + * search.c (Fmatch_data): + * search.c (match_limit): + * search.c (Freplace_match): + * search.c (skip_chars): + * search.c (scan_buffer): + * search.c: + * scrollbar.c (specifier_vars_of_scrollbar): + * scrollbar.c (Fscrollbar_set_hscroll): + * scrollbar.c (vertical_scrollbar_changed_in_window): + * scrollbar.c (release_window_mirror_scrollbars): + * scrollbar.c (free_scrollbar_instance): + * scrollbar-x.c: + * scrollbar-msw.c: + * s/msdos.h (O_BINARY): + * s/linux.h: + * s/freebsd.h (LIBS_TERMCAP): + * regex.c (re_match_2_internal): + * regex.c (compile_extended_range): + * regex.c (POP_FAILURE_POINT): + * regex.c (PUSH_FAILURE_POINT): + * redisplay.h (RESET_CHANGED_SET_FLAGS): + * redisplay.h: + * redisplay.h (struct display_line): + * redisplay.h (struct rune): + * redisplay.c (vars_of_redisplay): + * redisplay.c (redisplay_variable_changed): + * redisplay.c (UPDATE_CACHE_RETURN): + * redisplay.c (validate_line_start_cache): + * redisplay.c (mark_redisplay_structs): + * redisplay.c (mark_glyph_block_dynarr): + * redisplay.c (window_line_number): + * redisplay.c (redisplay_frame): + * redisplay.c (redisplay_window): + * redisplay.c (generate_modeline): + * redisplay.c (create_right_glyph_block): + * redisplay.c (create_left_glyph_block): + * redisplay.c (create_text_block): + * redisplay.c: + * redisplay-x.c (x_output_hline): + * redisplay-x.c (x_output_vertical_divider): + * redisplay-tty.c (tty_output_display_block): + * redisplay-output.c (output_display_line): + * redisplay-output.c: + * redisplay-msw.c (mswindows_output_vertical_divider): + * redisplay-msw.c (mswindows_ring_bell): + * redisplay-msw.c (mswindows_output_cursor): + * redisplay-msw.c: + * rangetab.c: + * ralloc.c: + * puresize.h (RAW_PURESIZE): + * profile.c (syms_of_profile): + * profile.c (Fstart_profiling): + * profile.c (sigprof_handler): + * profile.c: + * procimpl.h: + * process.c (vars_of_process): + * process.c (read_process_output): + * process.c (get_process): + * process.c: + * process-unix.c (unix_open_multicast_group): + * process-unix.c (unix_get_tty_name): + * process-unix.c (unix_send_process): + * process-unix.c (unix_reap_exited_processes): + * process-unix.c (unix_create_process): + * process-unix.c (unix_init_process_io_handles): + * process-unix.c (allocate_pty): + * process-unix.c: + * process-nt.c (nt_open_network_stream): + * process-nt.c (nt_update_status_if_terminated): + * process-nt.c (nt_finalize_process_data): + * process-nt.c: + * print.c (debug_short_backtrace): + * print.c (debug_backtrace): + * print.c (print_symbol): + * print.c (print_internal): + * print.c (print_cons): + * print.c (Fwrite_char): + * print.c (print_prepare): + * print.c (canonicalize_printcharfun): + * print.c (output_string): + * print.c: + * opaque.h: + * opaque.c (allocate_managed_opaque): + * opaque.c: + * offix.c (DndSetData): + * objects.c (face_boolean_create): + * objects.c (font_instantiate): + * objects.c (font_create): + * objects.c (color_create): + * objects.c (finalize_font_instance): + * objects.c (finalize_color_instance): + * objects.c: + * objects-x.c (x_font_instance_truename): + * objects-x.c: + * objects-x.c (x_initialize_font_instance): + * objects-x.c (allocate_nearest_color): + * objects-tty.c (tty_initialize_font_instance): + * objects-tty.c (tty_initialize_color_instance): + * objects-msw.c (mswindows_initialize_color_instance): + * ntproc.c (syms_of_ntproc): + * ntproc.c (Fwin32_set_process_priority): + * ntproc.c (sys_spawnve): + * ntproc.c: + * ntheap.c (get_data_end): + * nt.c (period): + * nt.c: + * nt.c (stat): + * nt.c (generate_inode_val): + * nt.c (sys_rename): + * nas.c: + * mule-wnnfns.c (Fwnn_hinsi_number): + * mule-wnnfns.c (Fwnn_yuragi): + * mule-wnnfns.c (Fwnn_common_learn): + * mule-wnnfns.c (Fwnn_suffix_learn): + * mule-wnnfns.c (Fwnn_prefix_learn): + * mule-wnnfns.c (Fwnn_okuri_learn): + * mule-wnnfns.c (Fwnn_complex_conv): + * mule-wnnfns.c (Fwnn_last_is_first): + * mule-wnnfns.c (Fwnn_bmodify_dict_add): + * mule-wnnfns.c (Fwnn_notrans_dict_add): + * mule-wnnfns.c (Fwnn_fiusr_dict_add): + * mule-wnnfns.c (Fwnn_fisys_dict_add): + * mule-wnnfns.c (Fwnn_hinsi_list): + * mule-wnnfns.c (Fwnn_fuzokugo_set): + * mule-wnnfns.c (Fwnn_dict_search): + * mule-wnnfns.c (Fwnn_word_toroku): + * mule-wnnfns.c (Fwnn_hindo_update): + * mule-wnnfns.c (Fwnn_bunsetu_henkou): + * mule-wnnfns.c (Fwnn_kakutei): + * mule-wnnfns.c (Fwnn_begin_henkan): + * mule-wnnfns.c (Fwnn_dict_comment): + * mule-wnnfns.c (Fwnn_dict_add): + * mule-wnnfns.c (Fwnn_open): + * mule-mcpath.c (mc_getcwd): + * mule-coding.c (vars_of_mule_coding): + * mule-coding.c (convert_to_external_format): + * mule-coding.c (encoding_marker): + * mule-coding.c (decoding_marker): + * mule-coding.c (Fcopy_coding_system): + * mule-coding.c (Fmake_coding_system): + * mule-coding.c (Fcoding_system_list): + * mule-coding.c (Ffind_coding_system): + * mule-coding.c (symbol_to_eol_type): + * mule-coding.c: + * mule-charset.c (complex_vars_of_mule_charset): + * mule-charset.c (vars_of_mule_charset): + * mule-charset.c (Fset_charset_ccl_program): + * mule-charset.c (struct charset_list_closure): + * mule-charset.c (Ffind_charset): + * mule-charset.c (make_charset): + * mule-charset.c (non_ascii_valid_char_p): + * mule-charset.c: + * mule-ccl.c (ccl_driver): + * mule-canna.c (c2mu): + * mule-canna.c (Fcanna_henkan_begin): + * mule-canna.c (Fcanna_parse): + * mule-canna.c (Fcanna_store_yomi): + * mule-canna.c (Fcanna_touroku_string): + * mule-canna.c (Fcanna_initialize): + * minibuf.c: + * menubar.c (menu_parse_submenu_keywords): + * menubar-x.c (make_dummy_xbutton_event): + * menubar-x.c (set_frame_menubar): + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + * menubar-x.c: + * menubar-msw.h: + * menubar-msw.c (mswindows_popup_menu): + * menubar-msw.c (mswindows_update_frame_menubars): + * menubar-msw.c (mswindows_handle_wm_command): + * menubar-msw.c (unsafe_handle_wm_initmenu_1): + * menubar-msw.c (unsafe_handle_wm_initmenupopup_1): + * menubar-msw.c (update_frame_menubar_maybe): + * menubar-msw.c (populate_or_checksum_helper): + * menubar-msw.c (empty_menu): + * menubar-msw.c: + * md5.c: + * marker.c (set_marker_internal): + * marker.c (print_marker): + * malloc.c: + * make-src-depend: + * lstream.c (lisp_buffer_rewinder): + * lstream.c (mark_lstream): + * lrecord.h: + * lrecord.h (struct lrecord_header): + * lread.c (readevalloop): + * lread.c (locate_file): + * lread.c (locate_file_in_directory): + * lread.c (Flocate_file): + * lread.c (load_force_doc_string_unwind): + * lread.c (ebolify_bytecode_constants): + * lread.c: + * lisp.h: + * lisp-union.h: + * lisp-disunion.h: + * linuxplay.c (linux_play_data_or_file): + * linuxplay.c (audio_init): + * line-number.c: + * keymap.h: + * keymap.c (describe_map): + * keymap.c (describe_map_mapper): + * keymap.c (Fdescribe_bindings_internal): + * keymap.c (Fsingle_key_description): + * keymap.c (map_keymap_sorted): + * keymap.c (get_relevant_keymaps): + * keymap.c (Flookup_key): + * keymap.c (raw_lookup_key_mapper): + * keymap.c (Fdefine_key): + * keymap.c (Fevent_matches_key_specifier_p): + * keymap.c (key_desc_list_to_event): + * keymap.c (define_key_parser): + * keymap.c (define_key_check_and_coerce_keysym): + * keymap.c (keymap_submaps): + * keymap.c (keymap_store_internal): + * keymap.c (keymap_delete_inverse_internal): + * keymap.c (keymap_store_inverse_internal): + * keymap.c (print_keymap): + * keymap.c (Lisp_Keymap): + * keymap.c: + * intl.c: + * insdel.c (convert_bufbyte_string_into_emchar_dynarr): + * insdel.c (make_gap): + * input-method-xlib.c (get_XIM_input): + * input-method-xlib.c (XIM_init_frame): + * imgproc.c: + * hash.h: + * hash.c: * 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. - + * gui-x.c (button_item_to_widget_value): + * gui-x.c (popup_selection_callback): + * glyphs.h (struct image_instantiator_methods): + * glyphs.c (mark_glyph_cachels): + * glyphs.c (Fglyph_type): + * glyphs.c (image_instantiate): + * glyphs.c (image_create): + * glyphs.c (make_image_instance_1): + * glyphs.c (finalize_image_instance): + * glyphs.c: + * glyphs-x.c (finalize_subwindow): + * glyphs-x.c (xface_validate): + * glyphs-x.c (x_locate_pixmap_file): + * glyphs-x.c (convert_EImage_to_XImage): + * glyphs-msw.c: + * glyphs-msw.c (mswindows_resource_instantiate): + * glyphs-msw.c (xpm_to_eimage): + * glyphs-msw.c (convert_EImage_to_DIBitmap): + * glyphs-eimage.c (tiff_instantiate): + * glyphs-eimage.c (png_instantiate): + * glyphs-eimage.c (struct png_error_struct): + * glyphs-eimage.c (gif_memory_storage): + * glyphs-eimage.c: + * gifrlib.h: + * getloadavg.c (getloadavg): + * getloadavg.c: + * gdbinit: + * free-hook.c (log_gcpro): + * free-hook.c (check_malloc): + * free-hook.c (check_free): + * free-hook.c (ROUND_UP_TO_PAGE): + * free-hook.c: + * frame.h (struct frame): + * frame.h: + * frame.c (change_frame_size_1): + * frame.c (allocate_frame_core): + * frame.c: + * frame-x.c (x_focus_on_frame): + * frame-x.c (x_init_frame_2): + * frame-x.c (x_popup_frame): + * frame-x.c (xemacs_XtPopup): + * frame-x.c: + * frame-x.c (Foffix_start_drag_internal): + * frame-x.c (x_cde_destroy_callback): + * frame-x.c (x_wm_hack_wm_protocols): + * frame-tty.c (tty_frame_visible_p): + * frame-msw.c (mswindows_make_frame_invisible): + * frame-msw.c (mswindows_after_init_frame): + * frame-msw.c (mswindows_init_frame_1): + * fns.c (syms_of_fns): + * fns.c (Fbase64_decode_string): + * fns.c (Fnconc): + * fns.c (Ffillarray): + * fns.c (Fobject_plist): + * fns.c (Fget): + * fns.c (Fcanonicalize_lax_plist): + * fns.c (Fcanonicalize_plist): + * fns.c (Fplist_remprop): + * fns.c (Fplist_get): + * fns.c (advance_plist_pointers): + * fns.c (internal_plist_put): + * fns.c (Fnreverse): + * fns.c (Fremassq): + * fns.c (Felt): + * fns.c (Fsubstring): + * fns.c (Fbvconcat): + * fns.c (Flength): + * fns.c (length_with_bytecode_hack): + * fns.c (print_bit_vector): + * fns.c: + * floatfns.c (Ffloor): + * floatfns.c: + * floatfns.c (in_float_error): + * fileio.c (Ffile_modes): + * fileio.c (Fexpand_file_name): + * fileio.c (Fmake_temp_name): + * fileio.c (Ffile_name_nondirectory): + * fileio.c (Ffile_name_directory): + * file-coding.h: + * file-coding.c (vars_of_mule_coding): + * file-coding.c (convert_to_external_format): + * file-coding.c (encoding_marker): + * file-coding.c (decoding_marker): + * file-coding.c (Fcopy_coding_system): + * file-coding.c (Fmake_coding_system): + * file-coding.c (struct coding_system_list_closure): + * file-coding.c (Ffind_coding_system): + * file-coding.c (symbol_to_eol_type): + * file-coding.c: + * faces.h (struct face_cachel): + * faces.c (vars_of_faces): + * faces.c (face_property_was_changed): + * faces.c (mark_face_cachels): + * faces.c (temporary_faces_list): + * faces.c (struct face_list_closure): + * faces.c: + * extents.h (struct extent): + * extents.c (vars_of_extents): + * extents.c (struct copy_string_extents_1_arg): + * extents.c (add_string_extents_mapper): + * extents.c (Fextent_property): + * extents.c (Fset_extent_property): + * extents.c (symbol_to_glyph_layout): + * extents.c (properties_equal): + * extents.c (print_extent): + * extents.c (print_extent_1): + * extents.c (extent_in_region_p): + * extents.c (gap_array_make_gap): + * extents.c: + * events.h (struct Lisp_Event): + * events.h: + * events.c (Fevent_properties): + * events.c (format_event_object): + * events.c (Fmake_event): + * events.c (event_equal): + * events.c (print_event): + * events.c (mark_event): + * event-stream.c ((read-char) + * event-stream.c (vars_of_event_stream): + * event-stream.c (syms_of_event_stream): + * event-stream.c (Fset_recent_keys_ring_size): + * event-stream.c (Fsit_for): + * event-stream.c (Fnext_event): + * event-stream.c (execute_help_form): + * event-stream.c (maybe_kbd_translate): + * event-stream.c: + * event-msw.c (vars_of_event_mswindows): + * event-msw.c (mswindows_wnd_proc): + * event-msw.c (mswindows_need_event): + * event-msw.c (mswindows_drain_windows_queue): + * event-msw.c (mswindows_pump_outstanding_events): + * event-msw.c: + * event-msw.c (slurp_thread): + * event-msw.c (struct ntpipe_slurp_stream): + * event-msw.c (HANDLE_TO_USID): + * event-Xt.c (emacs_Xt_handle_magic_event): + * event-Xt.c (x_event_to_emacs_event): + * event-Xt.c (x_reset_modifier_mapping): + * event-Xt.c (x_reset_key_mapping): * 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 <ben@xemacs.org> + * eval.c (syms_of_eval): + * eval.c (warn_when_safe): + * eval.c (warn_when_safe_lispobj): + * eval.c (Fbacktrace_frame): + * eval.c (Fbacktrace): + * eval.c (top_level_set): + * eval.c (unbind_to_hairy): + * eval.c (specbind_magic): + * eval.c (specbind_unwind_wasnt_local): + * eval.c (call2_trapping_errors): + * eval.c (call1_trapping_errors): + * eval.c (catch_them_squirmers_call2): + * eval.c (call0_trapping_errors): + * eval.c (run_hook_trapping_errors): + * eval.c (catch_them_squirmers_eval_in_buffer): + * eval.c (call4_in_buffer): + * eval.c (call3_in_buffer): + * eval.c (call2_in_buffer): + * eval.c (call1_in_buffer): + * eval.c (call0_in_buffer): + * eval.c (run_hook): + * eval.c (run_hook_with_args_in_buffer): + * eval.c (Fapply): + * eval.c (Feval): + * eval.c (do_autoload): + * eval.c (un_autoload): + * eval.c (Fautoload): + * eval.c (Finteractive_p): + * eval.c (Fcommand_execute): + * eval.c (signal_quit): + * eval.c (call_with_suspended_errors): + * eval.c (signal_error): + * eval.c (return_from_signal): + * eval.c (Fcall_with_condition_handler): + * eval.c (run_condition_case_handlers): + * eval.c (condition_case_1): + * eval.c (Funwind_protect): + * eval.c (unwind_to_catch): + * eval.c (internal_catch): + * eval.c (Fmacroexpand_internal): + * eval.c (Fuser_variable_p): + * eval.c (Fdefconst): + * eval.c (Fdefvar): + * eval.c (Ffunction): + * eval.c (signal_call_debugger): + * eval.c (call_debugger): + * eval.c: + * emacs.c (main): + * emacs.c (sort_args): + * emacs.c (main_1): + * elhash.h: + * elhash.c: + * editfns.c (Fencode_time): + * editfns.c (Fdecode_time): + * editfns.c (Fuser_full_name): + * editfns.c: + * editfns.c (save_excursion_restore): + * ecrt0.c: + * dynarr.c: + * doprnt.c (emacs_doprnt_1): + * doc.c (verify_doc_mapper): + * doc.c (Fsnarf_documentation): + * doc.c (Fdocumentation): + * dll.c: + * dired.c (user_name_completion): + * dired.c (Fdirectory_files): + * dialog-x.c: + * dialog-msw.c: + * dgif_lib.c (FreeSavedImages): + * dgif_lib.c (DGifGetImageDesc): + * device.h: + * device.h (struct device): + * device.c (Fselect_device): + * device.c (allocate_device): + * device.c: + * device-x.c (Fx_keysym_on_keyboard_p): + * device-x.c (Fx_valid_keysym_name_p): + * device-x.c (x_IO_error_handler): + * device-x.c (x_delete_device): + * device-x.c (x_finish_init_device): + * device-x.c (x_init_device): + * device-x.c: + * device-msw.c (mswindows_init_device): + * dbxrc: + * database.c (vars_of_database): + * database.c (Fput_database): + * database.c (Fopen_database): + * database.c (berkdb_remove): + * database.c (berkdb_put): + * database.c (Fdatabasep): + * database.c (print_database): + * database.c: + * data.c (vars_of_data): + * data.c (syms_of_data): + * data.c (init_errors_once_early): + * data.c (prune_weak_lists): + * data.c (finish_marking_weak_lists): + * data.c (print_weak_list): + * data.c (Fmod): + * data.c (Fstring_to_number): + * data.c (Fnumber_to_string): + * data.c (Findirect_function): + * data.c (Fsetcdr): + * data.c (Ffloatp): + * data.c (Fsubr_interactive): + * data.c (Farrayp): + * data.c (Fkeywordp): + * data.c (Fnull): + * data.c: + * console.h (CONSOLE_NAME): + * console.h: + * console.c (vars_of_console): + * console.c (Fselect_console): + * console.c: + * console-x.h (DEVICE_X_COLORMAP): + * console-x.h (struct x_device): + * console-x.c (x_device_to_console_connection): + * console-tty.h (CONSOLE_TTY_FINAL_CURSOR_Y): + * console-tty.c (tty_init_console): + * console-tty.c: + * console-msw.h (struct mswindows_frame): + * conslots.h: + * config.h.in: + * cmds.c (internal_self_insert): + * cmds.c (Fforward_line): + * cmds.c (Fforward_char): + * cmds.c: + * cmdloop.c: + * chartab.c (mark_char_table_entry): + * chartab.c: + * casefiddle.c (casify_word): + * callproc.c (child_setup): + * callproc.c (Fcall_process_internal): + * callproc.c: + * callint.c (Fcall_interactively): + * bytecode.h: + * bytecode.c (execute_rare_opcode): + * bytecode.c (execute_optimized_program): + * bytecode.c: + * bufslots.h: + * buffer.h (BUFFER_REALLOC): + * buffer.h (GET_CHARPTR_INT_DATA_ALLOCA): + * buffer.h (GET_CHARPTR_EXT_DATA_ALLOCA): + * buffer.h: + * buffer.h (MAP_INDIRECT_BUFFERS): + * buffer.h (CHECK_LIVE_BUFFER): + * buffer.c (init_initial_directory): + * buffer.c (complex_vars_of_buffer): + * buffer.c (vars_of_buffer): + * buffer.c (finish_init_buffer): + * buffer.c (Fget_file_buffer): + * buffer.c (Fbuffer_list): + * buffer.c (mark_buffer): + * balloon_help.c (balloon_help_move_to_pointer): + * balloon_help.c (show_help): + * balloon_help.c: + * backtrace.h: + * alloc.c (garbage_collect_1): + * alloc.c (sweep_strings): + * alloc.c (sweep_compiled_functions): + * alloc.c (sweep_bit_vectors_1): + * alloc.c (sweep_vectors_1): + * alloc.c (sweep_lcrecords_1): + * alloc.c (tick_lcrecord_stats): + * alloc.c (pure_string_sizeof): + * alloc.c (mark_conses_in_list): + * alloc.c (mark_object): + * alloc.c (report_pure_usage): + * alloc.c (make_pure_float): + * alloc.c (make_pure_string): + * alloc.c (free_managed_lcrecord): + * alloc.c (mark_string): + * alloc.c (noseeum_make_marker): + * alloc.c (allocate_event): + * alloc.c (Fbit_vector): + * alloc.c (Fvector): + * alloc.c (make_float): + * alloc.c (Fmake_list): + * alloc.c (Flist): + * alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC): + * alloc.c (PUT_FIXED_TYPE_ON_FREE_LIST): + * alloc.c (DECLARE_FIXED_TYPE_ALLOC): + * alloc.c (dbg_constants): + * alloc.c (gc_record_type_p): + * alloc.c (free_lcrecord): + * alloc.c (xmalloc): + * alloc.c (NOSEEUM_INCREMENT_CONS_COUNTER): + * abbrev.c: + * Makefile.in.in (mostlyclean): + * Makefile.in.in (external_client_xlib_objs_nonshared): + * Makefile.in.in (temacs_link_args): + * Makefile.in.in (release): + * Makefile.in.in (dnd_objs): + * Makefile.in.in (objs): + * Makefile.in.in (PROGNAME): + * EmacsShell.c: cast strings to (XtPointer) + * EmacsFrame.c: cast strings to (XtPointer) + - mega patch + - rewrite basic lisp functions for speed + - rewrite bytecode interpreter for speed + - rewrite list looping constructs for speed and safety using + tortoise/hare. + - use size_t where appropriate. + - new hashtable implementation + - cleanup implementation of opaques + - opaques can now be purecopy'ed + - move some cl functionality into C for speed. + - remove last remaining VMS support + - spelling fixes + - improve gdb/dbx debugger support + - move pure.c back into alloc.c for performance + - enable report_pure_usage() if --memory-usage-stats + - remove remnants of Energize support (EMACS_BTL, cadillac...) + - don't use symbols with leading `_' or embedded `__' + - globally cleanup duplicated semicolons `;;' + - I give in on %p vs %lx - we use printf("%lx",(long) p) + globally. + - globally replace O_NDELAY with O_NONBLOCK. + - globally replace CDISABLE with _POSIX_VDISABLE. + - use O_RDONLY and O_RDWR instead of magic `0' and `2'. + - define (and maybe use!) STDERR_FILENO and friends. + - add support for macros defined in C + - `when', `unless', `not' and `defalias' now defined in C, + so that they are universally available. + - rename defvar_mumble to defvar_magic + - rename RETURN__ to RETURN_SANS_WARNINGS + - use consistent style of initial caps in error messages + - implement last, butlast, nbutlast, copy-list in C. + - provide typedefs for all struct Lisp_foo types + - Lisp_Objects must be initialized to Qnil rather than 0. + - make sure XEmacs runs (slowly) with always_gc == 1; + - fast and safe LOOP_* macros + - change calls to XSETOBJ to XSETFOO + - replace calls to XSETINT by make_int() + - plug up memory leaks + - use style markobj (foo), not silly ((markobj) (foo)) + - use XFLOAT_DATA (obj) instead of float_data (XFLOAT (obj)) + +1998-12-02 P. E. Jareth Hein <jareth@camelot.co.jp> + + * unexec.c: Changed a #ifndef statement to fix XEmacs on BSDI 3.0 + +1998-11-28 SL Baur <steve@altair.xemacs.org> + + * XEmacs 21.2-beta4 is released. + +1998-11-27 SL Baur <steve@altair.xemacs.org> + + * mule-charset.c (complex_vars_of_mule_charset): Fix graphic + property in control-1 charset. + From Julian Bradfield <jcb@daimi.au.dk> + +1998-11-26 Jan Vroonhof <vroonhof@math.ethz.ch> + + * gui-x.c (button_item_to_widget_value): Ignore :key-sequence + keyword. + Add stub for :label. + + * gui.c (gui_item_add_keyval_pair): ditto. + + * menubar-x.c (menu_item_descriptor_to_widget_value_1): Ignore + :key-sequence keyword. + Add stub for:label. + Support :active for submenus like the Windows code and FSF Emacs. + +1998-11-27 Hrvoje Niksic <hniksic@srce.hr> + + * dired.c (make_directory_hash_table): make_string() is OK because + readdir() Mule-encapsulates. + +1998-11-26 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (Fbase64_encode_string): Fix docstring. + (Fbase64_decode_string): Ditto. + +1998-11-26 Hrvoje Niksic <hniksic@srce.hr> + + * editfns.c (Ftranslate_region): Use + convert_bufbyte_string_into_emchar_string(). + +1998-11-25 Hrvoje Niksic <hniksic@srce.hr> + + * editfns.c (Ftranslate_region): Accept vectors and char-tables as + well as strings. + (Ftranslate_region): Turn table into an array of Emchars for + larger regions. + +1998-11-25 Hrvoje Niksic <hniksic@srce.hr> + + * chartab.c (Freset_char_table): Fix wrong placement of #endif. + +1998-11-24 Hrvoje Niksic <hniksic@srce.hr> + + * chartab.c (Freset_char_table): Don't blindly fill chartables of + type `char' with nils. + + * chartab.c (canonicalize_char_table_value): Coerce ints to chars + for tables of type `char'. + +1998-11-26 Didier Verna <verna@inf.enst.fr> + + * 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 <verna@inf.enst.fr> + + * process-unix.c (unix_create_process): handle properly + Vfile_name_coding_system for converting the program and directory + names. + +1998-11-27 SL Baur <steve@altair.xemacs.org> + + * m/arm.h: New file. + From James LewisMoss <dres@ioa.com> + +1998-11-27 Takeshi Hagiwara <hagiwara@ie.niigata-u.ac.jp> + + * m/mips-nec.h: + Fix the realpath() problem of UnixWare2.1.3. + Patches for NEC's sysv4.2 machine. + +1998-11-25 Hrvoje Niksic <hniksic@srce.hr> + + * dired.c (Fdirectory_files): Remove redundant code. + +1998-11-25 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (free_malloced_ptr): New function. + (XMALLOC_OR_ALLOCA): New macro. + (XMALLOC_UNBIND): Ditto. + (Fbase64_encode_region): Use malloc() for large blocks; arrange it + to be freed in case of non-local exit. + (Fbase64_encode_string): Ditto. + (Fbase64_decode_region): Ditto. + (Fbase64_decode_string): Ditto. + (STORE_BYTE): New macro. + (base64_decode_1): Use it. + +1998-11-25 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (base64_value_to_char): Base64 stuff. + +1998-11-24 Hrvoje Niksic <hniksic@srce.hr> + + * editfns.c (Fbuffer_substring): New function. + + * lisp.h: Declare make_string_from_buffer_no_extents(). + + * insdel.c (make_string_from_buffer_1): New function. + (make_string_from_buffer_no_extents): Ditto. + +1998-11-15 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * linuxplay.c: Including <fcntl.h> instead of <sys/fcntl.h> makes + sound work on AIX with OSS installed. Linux should still work. + +1998-11-03 Andy Piper <andyp@parallax.co.uk> + + * config.h.in: name change for cygwin/version.h + + * configure.in: check for cygwin/version.h now. + + * cygwin32.h: track CYGWIN_DLL_VERSION_MAJOR -> + CYGWIN_VERSION_DLL_MAJOR name change in cygwin b20. + move cygwin32/version.h to cygwin/version.h + +1998-11-03 Olivier Galibert <galibert@pobox.com> + + * lisp.h (struct Lisp_Bit_Vector): Fix declaration of bits from + int to long. + +1998-10-22 Andy Piper <andyp@parallax.co.uk> + + * cygwin32.h: track CYGWIN_DLL_VERSION_MAJOR -> + CYGWIN_VERSION_DLL_MAJOR name change in cygwin b20. + enable BROKEN_SIGIO under b20 to make QUIT work. + +1998-10-22 Andy Piper <andyp@parallax.co.uk> + + * frame-msw.c (mswindows_size_frame_internal): force frame sizing + to fit within the constraints of the screen size. I.e. make the + frame small enough to fit and move it if some of it will be + off-screen. + +1998-10-19 Greg Klanderman <greg@alphatech.com> + + * dired.c: conditionalize inclusion of user-name-completion + primitives on non-Windows NT. The needed functions don't exist on NT. + +1998-11-24 SL Baur <steve@altair.xemacs.org> + + * gifrlib.h: Clean up types for 64 bit compile. + * dgif_lib.c (DGifInitRead): Ditto. + (MakeSavedImage): Ditto. + * emacs.c (decode_path): Ditto. + From Steve Carney <carney@pa.dec.com> + +1998-10-16 William M. Perry <wmperry@aventail.com> + + * glyphs-msw.c (bitmap_table): Fixed typo in builtin bitmaps + (cehckboxes instead of checkboxes). + +1998-10-15 SL Baur <steve@altair.xemacs.org> + + * XEmacs 21.2-beta3 is released. + +1998-10-13 Raymond Toy <toy@rtp.ericsson.se> + + * runemacs.c (WinMain): If the basename is "rungnuclient.exe", run + gnuclient. Otherwise, we run xemacs as we always did. This gets + rid of the annoying DOS window when running gnuclient. + +1998-10-13 Andy Piper <andyp@parallax.co.uk> + + * dragdrop.c (vars_of_dragdrop): rename HAVE_MSWINDOWS -> + HAVE_MS_WINDOWS typo. + +1998-10-13 SL Baur <steve@altair.xemacs.org> + + * process-unix.c (unix_send_process): Set closed flag on writable + pipe after SIGPIPE is received and before we call deactivate_process. + +1998-10-03 Gunnar Evermann <ge204@eng.cam.ac.uk> + + * window.c (Fset_window_start): respect narrowing when + checking wheter start is at the beginning of a line. + (Fset_window_buffer): Ditto + Fixes repeatable crash in VM. + +1998-10-09 SL Baur <steve@altair.xemacs.org> + + * window.c (specifier_vars_of_window): Set default vertical + divider width to 1 on ttys. + +1998-10-08 Martin Buchholz <martin@xemacs.org> + + * alloc.c: + * unexec.c: + * malloc.c: + Add <stddef.h> to get ptrdiff_t declaration + +1998-10-07 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * scrollbar-msw.c: Use the same vertical scrollbar drag hack as + is used for Motif or Lucid scrollbars under X. + +1998-10-08 Pierre Wendling <pw@ebc.vbe.dec.com> + + * m/alpha.h (UNEXEC): quoted to avoid bad expansion when running + `configure' + +1998-10-06 Takeshi Hagiwara <hagiwara@ie.niigata-u.ac.jp> + + * frame-x.c (x_delete_frame): Fix an argument of XtDestroyWidget. + +1998-10-05 Andy Piper <andyp@parallax.co.uk> + + * s/cygwin32.h: more cygwin b20 reorganisation. + +1998-10-01 Raymond Toy <toy@rtp.ericsson.se> + + * nas.c: Added necessary support functions to be able to handle + WAVE files in memory, just like the support for SND files in + memory. + +1998-09-30 SL Baur <steve@altair.xemacs.org> + + * callproc.c (child_setup): Fix spelling typo. + +1998-09-29 SL Baur <steve@altair.xemacs.org> + + * XEmacs 21.2-beta2 is released. + +1998-09-27 P. E. Jareth Hein <jareth@camelot.co.jp> + + * regex.c (re_match_2_internal): Add in code to reset lowest_active_reg + to prevent memory corruption in the case of jumping out of a series of + nested match patterns. This is a rather brute force approach, though. + +1998-09-02 Andy Piper <andyp@parallax.co.uk> + + * config.h.in: ditto. + + * s/cygwin32.h: rearrange declarations to cope with cygwin + b20. Include cygwin32/version.h if it exists. + +1998-09-20 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * device-msw.c (mswindows_init_device): Call new + mswindows_enumerate_fonts() function in objects-msw.c instead + of font_enum_callback_1() to enumerate fonts. + + font_enum_callback_1() and _2() moved to objects-msw.c. + + * faces.c (complex_vars_of_faces): Make the mswindows default + face font fully specified and provide some fallbacks. + + * objects-msw.c: font_enum_callback_1() and _2() moved here + from objects-msw.c. Obtain the enumerated font's character + sets by table lookup instead of using the locale-specific + string provided by Windows. + + New public non-method mswindows_enumerate_fonts() that fills + in the supplied mswindows device's font list. + + mswindows_initialize_font_instance: Use the supplied name + variable instead of f->name when signalling errors. Match font + weights and character sets using lookup tables which handle + spaces instead of by frobbing. + +1998-09-20 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * process-nt.c: Define an arbitrary limit, FRAGMENT_CODE_SIZE, + on the size of code fragments passed to run_in_other_process. + + run_in_other_process(): Use FRAGMENT_CODE_SIZE to determine + the amount of memory to allocate in the other process. + + Removed sigkill_code_end(), sigint_code_end() and + sig_enable_code_end() since they are now redundant. + + send_signal() and enable_child_signals(): Don't try to work + out the end of the code fragments passed to + run_in_other_process() + +1998-09-10 Kazuyuki IENAGA <ienaga@jsys.co.jp> + + * src/s/freebsd.h: Added __ELF__ and compiler/liker flags for + FreeBSD-current. + + * src/unexelf.c: Partially synched with FSF's 20.3. + +1998-09-10 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (signal_after_change): Map across indirect buffers + here, and not in the upper-level functions. + (signal_first_change): Don't check for Armageddon. + (signal_before_change): Map across indirect buffers here. + (prepare_to_modify_buffer): ...and here. + +1998-09-09 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (signal_after_change): Add return value. + (buffer_insert_string_1): Use it. + (buffer_delete_range): Ditto. + (buffer_replace_char): Ditto. + (cancel_multiple_change): Map the indirect buffers. + +1998-09-06 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (init_buffer_text): Remove INDIRECT_P parameter. + (uninit_buffer_text): Ditto. + + * buffer.c (Fmake_indirect_buffer): Implement stricter + error-checking. + +1998-09-04 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (change_function_restore): Reverse order of + function-call and assignment. + (first_change_hook_restore): Ditto. + + * extents.c (mark_extent_auxiliary): Mark them. + (Fset_extent_property): Set them. + (Fextent_property): Get them. + (Fextent_properties): Ditto. + (vars_of_extents): Set their default. + + * extents.h (struct extent_auxiliary): Add before_change_functions + and after_change_functions. + + * insdel.c (signal_before_change): Use it. + (signal_after_change): Ditto. + + * extents.c (report_extent_modification): New function. + + * insdel.c (signal_before_change): Don't check for Armageddon. + (signal_after_change): Ditto. + +1998-09-11 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> + + * redisplay.c (redisplay_window): make sure a new starting point + is chosen if it somehow got moved from the beginning of the line + -- this can happen because Fwiden was called recently. + + * window.c (Fset_window_start): set start_at_line_beg correctly + (Fset_window_buffer): Ditto + +1998-09-06 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (init_buffer_text): Remove INDIRECT_P parameter. + (uninit_buffer_text): Ditto. + + * buffer.c (Fmake_indirect_buffer): Implement stricter + error-checking. + +1998-05-14 Jan Vroonhof <vroonhof@math.ethz.ch> + + * emacs.c (main_1): Removed references to *vars_of_filelock. + + * lisp.h: Added Fsystem_name. + + * filelock.c: Replaced by version from FSF 20.2. Now implements + locking by using symlinks which is NFS safe. However keep the + GCPRO's in lock_file and the calls to callx_in_buffer like our old + version (and of course use ansi C, acessor macros, etc). + +1998-09-06 Jan Vroonhof <vroonhof@math.ethz.ch> + + * process-unix.c (unix_create_process): Reset SIGHUP handler to + SIG_DFL. We now try to conserve any inherted SIG_IGN settings + in init_signals_very_early. However these should not be passed + on to children attached to the new pty. + +1998-08-28 Andy Piper <andyp@parallax.co.uk> + + * glyphs-eimage.c (png_instantiate_unwind): clean up eimage after use. + +1998-09-07 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * fileio.c (file-name-directory, file_name_as_directory): + Don't call CORRECT_DIR_SEPS, even when #defined WINDOWSNT. + +1998-09-02 Andy Piper <andyp@parallax.co.uk> + + * emacs.c (main_1): init_ralloc() if initialised and we have REL_ALLOC + + * ralloc.c: uncomment __morecore. + +1998-09-92 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * event-msw.c(winsock_writer): Supply a dummy 4th argument to + WriteFile() to fix a winsock 1.x bug on Win95. + +1998-08-28 Hrvoje Niksic <hniksic@srce.hr> + + * event-Xt.c (emacs_Xt_mapping_action): Check for device being + deleted. + (x_event_to_emacs_event): Ditto. + (emacs_Xt_handle_focus_event): Ditto. + (emacs_Xt_handle_magic_event): Ditto. + + * console-x.h (struct x_device): New flag being_deleted. + (DEVICE_X_BEING_DELETED): New macro. + + * device-x.c (x_IO_error_handler): Throw to top-level instead of + returning. Before doing that, set the being_deleted flag on the + device. + +1998-08-27 Hrvoje Niksic <hniksic@srce.hr> + + * device-x.c (x-seppuku-on-epipe): Removed. + +1998-08-26 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> + + * frame-x.c (x_delete_frame): Flush the X output buffer after + calling XtDestroyWidget to ensure that the windows are really + killed right now. + +1998-08-26 Hrvoje Niksic <hniksic@srce.hr> + + * menubar-x.c (my_run_hook): New unused function. + (pre_activate_callback): Use run_hook for Qactivate_menubar_hook, + since we ignore the results of the contained functions anyway. + +1998-08-26 P. E. Jareth Hein <jareth@camelot.co.jp> + + * glyphs-eimage.c (gif_instantiate): Fix a crash in handling + interlaced GIF files that are smaller than 4 lines high... + +1998-08-31 Hrvoje Niksic <hniksic@srce.hr> + + * buffer.c (map_over_sharing_buffers): Deleted. + + * insdel.c (MAP_INDIRECT_BUFFERS): Move to buffer.h. + + * buffer.c (Fkill_buffer): Keep indirect_children updated while + killing them. + +1998-08-31 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (buffer_insert_string_1): Advance the point bytind in + all the buffers. + (buffer_delete_range): Ditto. + + * marker.c (init_buffer_markers): Set point-marker to the value of + point in an indirect buffer. + +1998-08-30 Hrvoje Niksic <hniksic@srce.hr> + + * undo.c (undo_prelude): Test last-undo-buffer against base + buffer. + + * insdel.c (MAP_INDIRECT_BUFFERS): Use it. + + * buffer.h (BUFFER_BASE_BUFFER): New macro. + +1998-08-30 Hrvoje Niksic <hniksic@srce.hr> + + * insdel.c (init_buffer_text): Initialize it here. + + * line-number.c: Address line_number_cache through buffer->text. + + * buffer.c (mark_buffer): Mark line number cache. + + * bufslots.h (line_number_cache): Move to struct buffer_text. + + * insdel.c (buffer_insert_string_1): Propagate signals and changes + across the children buffers. + (buffer_delete_range): Ditto. + (buffer_replace_char): Ditto. + (gap_left): Ditto. + (gap_right): Ditto. + + * insdel.c (MAP_INDIRECT_BUFFERS): New macro. + + * buffer.c (Fmake_indirect_buffer): Uncomment. + +1998-08-31 Hrvoje Niksic <hniksic@srce.hr> + + * macros.c (Fend_kbd_macro): Remove trailing period from error + message. + (Fexecute_kbd_macro): Ditto. + +1998-08-21 Greg Klanderman <greg@alphatech.com> + + * dired.c (Fuser_name_completion): remove optional 2nd argument. + (Fuser_name_completion_1): new function to return uniqueness + indication in addition to the user name completion. + (user_name_completion): change type of `uniq' argument. + +1998-08-19 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * lread.c (vars_of_lread): Removed `source-directory' variable. + +1998-08-22 Hrvoje Niksic <hniksic@srce.hr> + + * fileio.c (Ffile_readable_p): Apply the DOS/Windows logic to + Cygwin. + +1998-08-19 SL Baur <steve@altair.xemacs.org> + + * dired.c (vars_of_dired): Fix misapplied patch. + +1998-08-16 Martin Buchholz <martin@xemacs.org> + + * fns.c (Fremrassq, remrassq_no_quit): + A XCAR that should have been an XCDR turned Fremrassq into Fremassq + +1998-07-17 Didier Verna <verna@inf.enst.fr> + + * redisplay-x.c (x_get_gc): returns a GC with a FillStipple fill + style as foreground GC for faces that have the `dim' property. + (x_output_string): when the `dim' face property is set, + ensure the gray pixmap has been created, and get a proper + foreground GC to draw the text. + +1998-08-09 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * event-msw.c (mswindows_wnd_proc): Workaround for a Win95 bug: + Manually track the state of the left and right Ctrl and Alt + modifiers. + +1998-08-07 Matt Stupple <matts@tibco.com> + + * ntproc.c: don't wait on char_consumed at thread entry. + Additionally, to get the 'process' marked as finished, ensure + that the CHILD_ACTIVE macro returns false, so before exiting + close char_avail and set it to NULL, and close other handles + to reduce handle leak problems. + +1998-08-09 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * menubar-msw.c (displayable_menu_item): take account of menu + depth when deciding whether to try to display accelerators. + +1998-08-04 Andy Piper <andyp@parallax.co.uk> + + * event-msw.c: use MsgWaitForMultipleObjects if there are no + subprocesses. + + * glyphs-msw.c: fix a couple of potential handle leaks. + +1998-08-04 P. E. Jareth Hein <jareth@camelot.co.jp> + + * dgif_lib.c gif_io.c gifrlib.h: New files to put GIF + *decoding ONLY* back into the core. + * glyphs-eimage.c: Change referenced header file for GIF + reading to point to the incore version. + +1998-07-20 Martin Buchholz <martin@xemacs.org> + + * casefiddle.c (casify_object): + Change algorithm from O(N**2) to O(N). + Code cleanup. + Doc string cleanup. + +1998-07-22 Greg Klanderman <greg@alphatech.com> + + * dired.c (file_name_completion_unwind): don't leak the cons. + +1998-07-20 Greg Klanderman <greg@alphatech.com> + + * dired.c (Fuser_name_completion): new function. + (Fuser_name_all_completions): new function. + (user_name_completion): new function. + (syms_of_dired): 2 new DEFSUBRs. + (vars_of_dired): initialize user name cache vars. + +1998-07-29 P. E. Jareth Hein <jareth@camelot.co.jp> + + * glyphs-eimage.c (png_instantiate): Add proper handling for background + colors taken from the default face. Also correct a thinko in + transparency (not alpha) handling. + +1998-07-23 Martin Buchholz <martin@xemacs.org> + + * s/decosf4-0.h: Use a perfectly ordinary link. Nuke BSD crap. + * unexalpha.c: ANSI C-ize. Clean compiler warnings. + * lread.c (Fload_internal): Be very careful with printfs of + size_t's + * gui-x.c (menu_name_to_accelerator): tolower wants an `int' + argument. + +1998-07-27 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> + + * callint.c (Fcall_interactively): GCPRO prompt string before + passing it to Fread_key_sequence + +1998-07-27 SL Baur <steve@altair.xemacs.org> + + * keymap.c (vars_of_keymap): Initialize Vkey_translation_map and + Vvertical_divider_map. + + * mule-canna.c (vars_of_mule_canna): Initialize every symbol to + Qnil or 0, none were initialized prior to this change. + + Rename misnamed `V' prefixed integer variables: + Vcanna_empty_info, Vcanna_through_info, Vcanna_underline, + Vcanna_inhibit_hankakukana, Vcanna_henkan_length, Vcanna_henkan_revPos, + Vcanna_henkan_revLen, Vcanna_ichiran_length, Vcanna_ichiran_revPos, + Vcanna_ichiran_revLen. + + Rename misnamed `V' prefixed integer variables and initialize + properly in the vars_of routine. + Vcanna_mode_AlphaMode, Vcanna_mode_EmptyMode, Vcanna_mode_KigoMode, + Vcanna_mode_YomiMode, Vcanna_mode_JishuMode, Vcanna_mode_TankouhoMode, + Vcanna_mode_IchiranMode, Vcanna_mode_YesNoMode, Vcanna_mode_OnOffMode, + Vcanna_mode_AdjustBunsetsuMode, Vcanna_mode_ChikujiYomiMode, + Vcanna_mode_ChikujiTanMode, Vcanna_mode_HenkanMode, + Vcanna_mode_HenkanNyuryokuMode, Vcanna_mode_ZenHiraHenkanMode, + Vcanna_mode_HanHiraHenkanMode, Vcanna_mode_ZenKataHenkanMode, + Vcanna_mode_HanKataHenkanMode, Vcanna_mode_HanKataHenkanMode, + Vcanna_mode_ZenAlphaHenkanMode, Vcanna_mode_HanAlphaHenkanMode, + Vcanna_mode_ZenHiraKakuteiMode, Vcanna_mode_HanHiraKakuteiMode, + Vcanna_mode_ZenKataKakuteiMode, Vcanna_mode_HanKataKakuteiMode, + Vcanna_mode_ZenAlphaKakuteiMode, Vcanna_mode_HanAlphaKakuteiMode, + Vcanna_mode_HexMode, Vcanna_mode_BushuMode, Vcanna_mode_ExtendMode, + Vcanna_mode_RussianMode, Vcanna_mode_GreekMode, Vcanna_mode_LineMode, + Vcanna_mode_ChangingServerMode, Vcanna_mode_HenkanMethodMode, + Vcanna_mode_DeleteDicMode, Vcanna_mode_TourokuMode, + Vcanna_mode_TourokuEmptyMode, Vcanna_mode_TourokuHinshiMode, + Vcanna_mode_TourokuDicMode, Vcanna_mode_QuotedInsertMode, + Vcanna_mode_BubunMuhenkanMode, Vcanna_mode_MountDicMode, + Vcanna_fn_SelfInsert, Vcanna_fn_FunctionalInsert, + Vcanna_fn_QuotedInsert, Vcanna_fn_JapaneseMode, Vcanna_fn_AlphaMode, + Vcanna_fn_HenkanNyuryokuMode, Vcanna_fn_Forward, Vcanna_fn_Backward, + Vcanna_fn_Next, Vcanna_fn_Prev, Vcanna_fn_BeginningOfLine, + Vcanna_fn_EndOfLine, Vcanna_fn_DeleteNext, Vcanna_fn_DeletePrevious, + Vcanna_fn_KillToEndOfLine, Vcanna_fn_Henkan, Vcanna_fn_Kakutei, + Vcanna_fn_Extend, Vcanna_fn_Shrink, Vcanna_fn_AdjustBunsetsu, + Vcanna_fn_Quit, Vcanna_fn_ConvertAsHex, Vcanna_fn_ConvertAsBushu, + Vcanna_fn_KouhoIchiran, Vcanna_fn_BubunMuhenkan, Vcanna_fn_Zenkaku, + Vcanna_fn_Hankaku, Vcanna_fn_ExtendMode, Vcanna_fn_ToUpper, + Vcanna_fn_Capitalize, Vcanna_fn_ToLower, Vcanna_fn_Hiragana, + Vcanna_fn_Katakana, Vcanna_fn_Romaji, Vcanna_fn_BaseHiragana, + Vcanna_fn_BaseKatakana, Vcanna_fn_BaseEisu, Vcanna_fn_BaseZenkaku, + Vcanna_fn_BaseHankaku, Vcanna_fn_BaseKana, Vcanna_fn_BaseKakutei, + Vcanna_fn_BaseHenkan, Vcanna_fn_BaseHiraKataToggle, + Vcanna_fn_BaseZenHanToggle, Vcanna_fn_BaseKanaEisuToggle, + Vcanna_fn_BaseKakuteiHenkanToggle, Vcanna_fn_BaseRotateForward, + Vcanna_fn_BaseRotateBackward, Vcanna_fn_Touroku, Vcanna_fn_HexMode, + Vcanna_fn_BushuMode, Vcanna_fn_KigouMode, Vcanna_fn_Mark, + Vcanna_fn_TemporalMode, Vcanna_key_Nfer, Vcanna_key_Xfer, + Vcanna_key_Up, Vcanna_key_Left, Vcanna_key_Right, Vcanna_key_Down, + Vcanna_key_Insert, Vcanna_key_Rollup, Vcanna_key_Rolldown, + Vcanna_key_Home, Vcanna_key_Help, Vcanna_key_KP_Key, + Vcanna_key_Shift_Nfer, Vcanna_key_Shift_Xfer, Vcanna_key_Shift_Up, + Vcanna_key_Shift_Left, Vcanna_key_Shift_Right, Vcanna_key_Shift_Down, + Vcanna_key_Cntrl_Nfer, Vcanna_key_Cntrl_Xfer, Vcanna_key_Cntrl_Up, + Vcanna_key_Cntrl_Left, Vcanna_key_Cntrl_Right, Vcanna_key_Cntrl_Down + +1998-07-16 Jan Vroonhof <vroonhof@math.ethz.ch> + + * event-Xt.c (x_to_emacs_keysym): Return nil for modifier keysyms. + (x_event_to_emacs_event): Let x_to_emacs_keysym check for modifier + keys thus no longer considering all keysyms on a key. + +1998-07-19 SL Baur <steve@altair.xemacs.org> + + * XEmacs 21.2-beta1 is released. + +1998-07-12 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * eldap.c (Fldap_search_internal): When converting the list of + attributes to search Copy the final 0 from Lisp strings to C + strings. + Check base, not Vldap_default_base as a a string + +1998-07-13 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * nt.c: Remove Vstdio_str; already defined in console-stream.c. + + * unexnt.c: Unconditionally define bss_start and bss_size, and + ensure that they don't go in the .bss section. + +1998-07-17 Olivier Galibert <galibert@pobox.com> + + * glyphs-x.c (convert_EImage_to_XImage): Fix previous patch (conv + byte order is dependant of the local byte order). + From Takeshi Hagiwara <hagiwara@ie.niigata-u.ac.jp> + +1998-07-18 SL Baur <steve@altair.xemacs.org> + + * glyphs-msw.c (mswindows_resource_normalize): Qresource -> + Qmswindows_resource. + From Jonathan Harris <jhar@tardis.ed.ac.uk> + +1998-07-12 SL Baur <steve@altair.xemacs.org> + + * general.c (syms_of_general): Add defsymbol for Qresource. + + * glyphs-msw.c (vars_of_glyphs_mswindows): Rename Qresource to + Qmswindows_resource. + (TopLevel): Rename 'resource image format to 'mswindows_resource. + (mswindows_resource_validate): Rename. + (mswindows_resource_normalize): Rename. + (mswindows_resource_possible_dest_types): Rename. + (mswindows_resource_instantiate): Rename. + (image_instantiator_format_create_glyphs_mswindows): Replace + `resource' with `mswindows.resource'. + + * XEmacs 21.0-pre5 is released. + +1998-07-10 SL Baur <steve@altair.xemacs.org> + + * mule-wnnfns.c (Fwnn_open): Correctly trap on misdefined Wnn + server type in environment. + Use alloca-ed strings instead of tiny fixed size ones. + +1998-07-09 SL Baur <steve@altair.xemacs.org> + + * XEmacs 21.0-pre4 is released. + +1998-07-01 James N. Potts <jnpotts@plutonium.net> + + * 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 + reportedly cause problems under Win95. + +1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * windowsnt.h: Define DUMP_SEPARATE_SECTION when building with + MSVC >= 5.0. Put emacs init and zero-init data in a special + section of the executable when this is defined. + + * unexnt.c, ntheap.h: + Removed unused find_section() and get_section_size(). + + * unexnt.c: + Fix up the executable's checksum after dumping otherwise the + profiler complains. + When DUMP_SEPARATE_SECTION is defined, don't need to dump + zero-init data separately from init data. Dump emacs data + into a special section of the executable. + When DUMP_SEPARATE_SECTION not defined, dump .bss up to + my_ebss instead of up to the end of bss. + +1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * filelock.c: Removed Vconfigure_lock_directory - already + defined in emacs.c. + + * frame-msw.c: Removed Qinitially_unmapped and Qpopup - already + defined in frame.c and general.c respectively. + + * glyphs-msw.c: Removed Qresource - already defined in + general.c. + +1998-07-05 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * eldap.c (Fldap_search_internal): Docstring fixes + +1998-07-04 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * nt.c (init_environment): Removed unused PRELOAD_WINSOCK, + EMACSDOC and TERM variables. Added EMACSDEBUGPATHS, + EMACSPACKAGEPATH and INFOPATH variables. + Removed unused get_emacs_configuration function. + + * s/windowsnt.h: Don't define EMACS_CONFIGURATION here because + it is now defined at build-time by the makefile. + +1998-07-01 James N. Potts <jnpotts@plutonium.net> + + * 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 + reportedly cause problems under Win95. + +1998-07-05 Andy Piper <andyp@parallax.co.uk> + + * faces.c (complex_vars_of_faces): for the gui-element face don't + fallback to the default face, instead provide reasonable default + fallbacks that were previously hardcoded elsewhere. + +1998-07-06 Olivier Galibert <galibert@pobox.com> + + * glyphs-x.c (convert_EImage_to_XImage): Fix pixel writing problem + when the X server endianness is different than the client's one. + +1998-06-29 Kyle Jones <kyle_jones@wonderworks.com> + + * eval.c (run_hook_with_args_in_buffer): Check + default (non-buffer-local) value of hook for + nil before treating it as a function. Don't initialize + the `globals' variable twice. + +1998-06-24 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * fileio.c: Don't do directory seperator canonicalisation in + substitute-in-file-name because we don't know that the + filename refers to a local file. + +1998-06-24 Adrian Aichner <aichner@ecf.teradyne.com> + + * process-nt.c (nt_create_process): Try appending the standard + executable file extensions to the filename if none supplied. + +1998-06-29 SL Baur <steve@altair.xemacs.org> + + * fileio.c (Fsubstitute_in_file_name): Enable double slash notation + for cygwin32. + From Keisuke Mori <ksk@ntts.com> + +1998-06-24 Andy Piper <andyp@parallax.co.uk> + + * toolbar-msw.c (mswindows_output_toolbar): only enable masked + images if we have masks. This handles the xbm case (have masks) + and avoids overuse of resources in the xpm case (generally no masks). + Don't output small toolbars. + +1998-06-29 Kyle Jones <kyle_jones@wonderworks.com> + + * eval.c (run_hook_with_args_in_buffer): Don't treat + the default value of a buffer local hook as a list of + hooks unless it is both a cons and the car of that cons + is not Qlambda. + +1998-06-29 SL Baur <steve@altair.xemacs.org> + + * extents.c: Email address for Ben Wing is ben@xemacs.org. + * process-unix.c: Ditto. + * mule-coding.h: Ditto. + * mule-coding.c: Ditto. + * mule-charset.c: Ditto. + * mule-charset.h: Ditto. + * file-coding.c: Ditto. + * file-coding.h: Ditto. + +1998-06-22 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * event-msw.c: Guard against recursion when freeing + FRAME_MSWINDOWS_TARGET_RECT struture in WM_SIZE processing. + + * frame-msw.c: Don't set WS_VISIBLE attribute on first frame. + Call ShowWindow twice in init_frame_3 to get round runemacs + weirdness. + +1998-06-27 Hrvoje Niksic <hniksic@srce.hr> + + * scrollbar.c (vertical_scrollbar_changed_in_window): Ditto. + + * winslots.h: Rename. + + * window.c (specifier_vars_of_window): Renamed + vertical-divider-draggable-p to vertical-divider-always-visible-p, + as suggested by Ben Wing. + (specifier_vars_of_window): Fix docstrings. + +1998-06-22 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * unexaix.c: Line number information works correctly again. + +1998-06-22 Olivier Galibert <galibert@pobox.com> + + * emacs.c (__sti__iflPNGFile_c___): Added. See comment. Cry. + +1998-06-21 Martin Buchholz <martin@xemacs.org> + + * editfns.c (get_home_directory): ANSIfy. + XEmacs is compilable under C *and* C++. + It's XEmacs, not Xemacs! + +1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * console-msw.h: added a list of fonts to device data. + + * device-msw.c: enumerate list of available fonts in + mswindows_init_device. Free list in mswindows_delete_device. + + * 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. + +1998-06-23 Greg Klanderman <greg@alphatech.com> + + * indent.c (column_at_point): column cache bugfix. + Set last_known_column_point to the buffer position for + which the column was requested, not buffer's point. + + * redisplay.c (decode_mode_spec): for current-column, show + window's point's column, not buffer's point's column. + +1998-06-23 Andy Piper <andyp@parallax.co.uk> + + * menubar-msw.c (mswindows_handle_wm_command): use + enqueue_misc_user event rather than + mswindows_enqueue_msic_user_event to fix customize problems. Add some + checks that X does. + + * console-msw.h: declare mswindows_enqueue_magic_event. + + * event-msw.c (mswindows_enqueue_magic_event): make global. + +1998-06-24 Hrvoje Niksic <hniksic@srce.hr> + + * line-number.c (LINE_NUMBER_FAR): Reverted to 16384. + (buffer_line_number): Use EMACS_INT_MAX instead of random LOTS. + (add_position_to_cache): Use EMACS_INT instead of int. + +1998-06-21 Olivier Galibert <galibert@pobox.com> + + * lisp-disunion.h (XMARKBIT): Have XMARKBIT return something + suitable for an int used as a boolean (btw, C sucks.). + +1998-06-18 Andy Piper <andyp@parallax.co.uk> + + * object-msw.c: remove warnings. + + * device-msw.c: #define wrongly named cygwin structure elements. + + * s/cygwin32.h: define DEMI_BOLD + +1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * redisplay-msw.c: new function mswindows_apply_face_effects. + This is called by output_string and output_cursor to display + underline and strikeout on faces. + +1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * console-msw.h: added a list of fonts to device data. + + * device-msw.c: enumerate list of available fonts in + mswindows_init_device. Free list in mswindows_delete_device. + + * 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. + +1998-06-15 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * objects-msw.c: + Removed compilation warnings from mswindows_string_to_color. + mswindows_list_fonts returns a more general bogus font. + New lisp-visible function mswindows-color-list. + +1998-06-19 David Bush <david.bush@adn.alcatel.com> + + * editfns.c (Fuser_login_name): Modify to user new function + user_login_name. + (user_login_name): C only function to avoid Lisp object overhead + Returns "unknown" instead of nil in Cygwin environment + + * fileio.c (Fexpand_file_name): Treat "~" and "~user" as + equivalent for current user in Cygwin environment. Use new + function user_login_name to get username. + + * lisp.h: Declare user_login_name + +1998-06-18 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * unexaix.c (make_hdr): Fixed bias computations so debugging info + works again. + Some other insignificant nitpicks. + +1998-06-18 Andy Piper <andyp@parallax.co.uk> + + * toolbar-msw.c (mswindows_output_toolbar): specify ILC_MASK when + creating the image list and make sure he bk color is transparent. + +1998-06-18 Jan Vroonhof <vroonhof@math.ethz.ch> + + * event-Xt.c (emacs_Xt_remove_timeout): Also remove timeout from + completed_timeouts. The timer could have expired. + +1998-06-17 Andy Piper <andyp@parallax.co.uk> + + * console-msw.h: move XEMACS_RECT_WH inside frame + 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): + 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 + parameters not just if init is finished - WM_SIZE happens too + early for some specs. (mswindows_size_frame_internal): new + function abstracted from mswindows_set_frame_properties. + (Vmswindows_use_system_frame_size_defaults): + new variable controls whether to allow the system to pick frame + size defaults, defaults to nil. + + * event-msw.c: in WM_SIZE use mswindows_size_frame_internal rather + than duplicated code. + +1998-06-15 Colin Rafferty <colin@xemacs.org> + + * Makefile.in.in: Made EXTW_LINK expand properly. + +1998-06-12 Martin Buchholz <martin@xemacs.org> + + * redisplay.c (vars_of_redisplay): default value of + column-number-start-at-one should be NIL! + +1998-06-11 Martin Buchholz <martin@xemacs.org> + + * casefiddle.c: + (upcase-initials "fooBar") ==> "FooBar" instead of "Foobar" + +1998-06-05 Hrvoje Niksic <hniksic@srce.hr> + + * eldap.c (Fldap_search_internal): Use build_ext_string instead of + build_string to avoid crashes under Mule. + +1998-06-13 Andy Piper <andyp@parallax.co.uk> + + * ntplay.c (play_sound_data_1): don't delete the sound data until + the next sound is played and the previous one finished. + +1998-06-10 Samuel Mikes <smikes@alumni.hmc.edu> + + * fileio.c (directory-sep-char): Escape backslashes. + +1998-06-10 Hrvoje Niksic <hniksic@srce.hr> + + * event-stream.c: Fix docstring reference. + +1998-06-12 Hrvoje Niksic <hniksic@srce.hr> + + * alloc.c (make_float): Remove useless initialization of `next' + field. + (make_pure_float): Ditto. + + * lisp.h (struct Lisp_Float): Rename `next' to `__unused__next'. + +1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> + + * fileio.c (Fmake_directory_internal): Remove conditionals + on WINDOWSNT when calling mkdir. + + * ntproc.c: Deleted the following unused functions: + register_child, reap_subprocess, sys_wait. + + * nt.c (sys_rename): Ifzeroed this implementation. + Deleted the following unused functions: + sys_access, sys_chdir, sys_chmod, sys_creat, sys_link, sys_mkdir, + sys_mktemp, sys_rmdir, sys_unlink, sys_close, sys_dup, sys_dup2, + sys_read, sys_write. + Merger sys_fopen and sys_open with sysdep.c implementation. + + * sysdep.c: Removed MS-DOS code. + (sys_rename): Deal with Microsoft rename weirdness. + (sys_open): Implemented for Windows. + (sys_fopen): Ditto. + (sys_mkdir): Ditto. + +1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> + + * buffer.c (complex_vars_of_buffer): Removed %t description from + the docstring. + +1998-06-04 Rick Rankin <Rick_Rankin-P15254@email.mot.com> + + * scrollbar-msw.c: initialize the cbSize element of the + SCROLLINFO struct before calling SetScrollInfo. WinNT seems + to ignore the value of cbSize, but Win95 (and I presume Win98) + appear to want it set to sizeof(SCROLLINFO). + +1998-06-04 Kirill M. Katsnelson <kkm@kis.ru> + + * event-stream.c: Defined Qcancel_mode_internal. + (syms_of_event_stream): defsymbol'ed it. + + * events.h: Externed it. + + * event-msw.c (mswindows_wnd_proc, WM_CANCELMODE): Added this handler. + +1998-06-04 Oliver Graf <ograf@fga.de> + + * frame-x.c (x_cde_destroy_callback): free the data + (cde-start-drag-internal) corrected root position, 21.1 needs this + hardcoded in Button events + (offix-start-drag-internal) corrected root position + +1998-06-03 Kirill M. Katsnelson <kkm@kis.ru> + + * process-nt.c (signal_cannot_launch): Use signal_simple_error() + instead of error(). + +1998-06-03 Kirill M. Katsnelson <kkm@kis.ru> + + * dialog-msw.c (button_width): Removed `inline' from the function + declaration. + +1998-06-03 Rick Rankin <Rick_Rankin-P15254@email.mot.com> + + * frame-msw.c: add WS_VISIBLE flag to the first frame created. + Note that adding this flag to subsequent frames causes problems. + +1998-06-03 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> + + * glyphs-eimage.c (png_instantiate) move 'struct + png_memory_storage tbr' out of nested block to avoid dangling + reference + +1998-06-02 Andy Piper <andyp@parallax.co.uk> + + * faces.h: + * faces.c: rename 3d-object -> gui-element. add toolbar face which + inherits from gui-element. + + * glyphs-msw.c: use DIBitmaps for xbm bitmaps to be consistent + with existing code, generate masks correctly. + +1998-06-03 P. E. Jareth Hein <jareth@camelot-soft.com> + + * glyphs-eimage.c: Changed included header for gifs to use + Gifreader instead of giflib. + + * glyphs-x.c: removed the image-related functions that were + moved into glyphs-eimage. + +1998-06-02 David Bush <david.bush@adnb.alcatel.com> + + * glyphs.c (bitmap_to_lisp_data) Define XFree to be free + if built without X Windows support. + +1998-06-02 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (Fconcat): Synch docstring with new reality. + +1998-06-03 SL Baur <steve@altair.xemacs.org> + + * frame.c: Remove reference to msdos.h (which is going away). + Suggested by Hrvoje Niksic and Kirill Katsnelson. + +1998-06-02 P. E. Jareth Hein <jareth@camelot-soft.com> + + * glyphs-eimage.c (jpeg_instantiate): Fix handling of + grayscale images/ + + +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> + + * events.h: Fixed commentary about misc-user scrollbar events. + + * scrollbar-x.c (x_update_vertical_scrollbar_callback): Use frame + object as an event channel, instead of window object. + (x_update_horizontal_scrollbar_callback): Ditto. + +1998-05-29 Andy Piper <andyp@parallax.co.uk> + + * ntplay.c (play_sound_data_1) new function. convert alloca data + to malloc if necessary. + (play_sound_file): if the file is not in our path then convert to + data and play. + +1998-06-01 SL Baur <steve@altair.xemacs.org> + + * mule-mcpath.c (mc_chdir): Reverse parameters in call to memcpy. + * msdos.c (Frecent_doskeys): Ditto. + + * unexalpha.c (unexec): Reverse parameters in call to memcpy. + Suggested by Reggie Perry <perry@zso.dec.com> + + * buffer.h: Eliminate size in declaration. + +1998-06-01 Olivier Galibert <galibert@pobox.com> + + * unexelfsgi.c (unexec): Cleanup n/nn and remove useless kludge. + +1998-06-01 Kirill M. Katsnelson <kkm@kis.ru> + + * gui.c (gui_item_init): Changed the default value for config member + from Qunbound to Qnil. + +1998-06-01 Greg Klanderman <greg@alphatech.com> + + * indent.c (vmotion_pixels): Don't #define abs(). + +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> + + * s/windowsnt.h: Defined popen and pclose to be _popen and _pclose + respectively. + +1998-05-30 Andy Piper <andyp@parallax.co.uk> + + * glyphs.h: add xbm declarations. + + * console.h: add xbm_instantiate_method device method. + + * glyphs.c (check_valid_xbm_inline) (xbm_validate) + (bitmap_to_lisp_data) (xbm_mask_file_munging) (xbm_normalize) + (xbm_possible_dest_types): moved here from glyphs-x.c. use + locate_pixmap_file device method and read_bitmap_data_from_file + instead of XmuReadBitmapDataFromFile. + (xbm_instatntiate): make a device method. + + * glyphs-x.c: see glyphs.c changes. (read_bitmap_data_from_file) + new function that just calls XmuReadBitmapDataFromFile. + (x_xbm_instatntiate): device method from xbm_instantiate. + + * glyphs-msw.c (read_bitmap_data) (NextInt) + (read_bitmap_data_from_file): new functions copied from Xmu + sources. + (xbm_create_bitmap_from_data) from Ben <ben@666.com> convert + inline data to an mswindows bitmap. + (init_image_instance_from_xbm_inline) (xbm_instantiate_1) + (mswindows_xbm_instantiate): mswindows-ized versions of the X + functions. + +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> + + * window.c (specifier_vars_of_window): Renamed `has_modeline-p' to + `modeline-visible-p'. + Declared specifier lisp variables at the beginning oh the file + as static. + + * procimpl.h (struct process_methods): Changed semantics of + create_process method so it accepts lisp strings instead of + char pointers. + + * process.c (Fstart_process_internal): Moved building of + unix style argv from here to process-unix.c, ... + + * process-unix.c (unix_create_process): ... right here. + + * process-nt.c (nt_create_process): Changed this function to + support new semantics, so avoided a GC problem. + + * events.c (Fmake_event): Document misc-user events properties. + (Fmake_event): Do not allow arbitrary objects for channel property + of misc-user events. + (Fmake_event): Change misc-user event validation: it is function + which is required, not button. + + * event-msw.c (mswindows_user_event_p): Recognize misc user events as + user events. + (mswindows_enqueue_misc_user_event): Added function. + (mswindows_bump_queue): Removed function. + (mswindows_enqueue_magic_event): Support NULL HWND parameter. + (mswindows_wnd_proc, WM_CLOSE): Use mswindows_enqueue_misc_user_event(). + (mswindows_wnd_proc, WM_EXITSIZEMOVE): Ditto. + (emacs_mswindows_handle_magic_event): Handle XM_BUMPQUEUE, by doing + really nothing, which is my personal favorite thing. + + * console-msw.h: Removed prototype for mswindows_bump_queue(). + Added prototype for mswindows_enqueue_misc_user_event(). + + * menubar-msw.c (mswindows_handle_wm_command): Use + mswindows_enqueue_misc_user_event(). + + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. + + * dialog-msw.c (dialog_proc): Ditto. + + * scrollbar-msw.c (mswindows_handle_scrollbar_event): Ditto. + (mswindows_handle_scrollbar_event): Use frame, not window, for misc + user events channel. + +1998-05-29 Greg Klanderman <greg@alphatech.com> + + * window.c (Fwindow_displayed_text_pixel_height): was relying on + incorrect semantics of vmotion_pixels which has been fixed. don't + use it anymore as it can't easily be used. + + * indent.c (vmotion_pixels): fix off by one bug moving up. also + the motion was reported incorrectly if you tried to go past end of + buffer. + +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> + + * toolbar.h: Removed misleading commentary, as Martin suggested. + +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> + + * lisp.h: Extern Qactivate_menubar_hook. + + * menubar-msw.c (unsafe_handle_wm_initmenu_1): Pass correct value to + run_hook (). + +1998-05-29 Andy Piper <andyp@parallax.co.uk> + + * glyphs-msw.c: use BPLINE macro. + + * select-msw.c (mswindows-selection-exists-p) + (mswindows-delete-selection): doc string fixes. + + * toolbar-msw.c (mswindows_output_toolbar): make disabled buttons + unpressable. warning elimination. + +1998-05-28 Martin Buchholz <martin@xemacs.org> + + * alloc.c (dbg_constants): + * dbxrc: + * gdbinit: + Remove toolbar_data debugging code, since that lrecord has + also been removed. + +Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> + + * alloc.c: zap cached value of (user-home-directory), so that + it's not undumped. + + * buffer.c: From init_buffer(), separated out code that + determined the initial directory for the *scratch* buffer, and + put them into a function called "init_initial_directory()". + The initial directory is now available as a global "char *" + called initial_directory. + + * buffer.h: Added extern entries for initial_directory[] and + init_initial_directory(). + + * editfns.c: added new elisp function "user-home-directory", + which basically returns getenv("HOME"), but attempts to use + other values if $HOME isn't set.This may have to be tweaked in + the future as, under Unix, "/" is used if $HOME isn't set (this + probably should be set to the current directory). To support + this, a new C function, "get_home_directory()", now exists, + which returns the "home directory", as a "char *" string. + + * emacs.c: Rearrange NT initialization order so that + environment/registry variables will be properly entered into + Vprocess_enviroment. + + * fileio.c: replaced egetenv("HOME") with calls to the new + get_home_directory(). + + * lisp.h: Added function prototypes for uncache_home_directory() + and get_home_directory(), along with lisp prototypes for + Fuser_home_directory() and friends. + + * nt.c: replaced getenv("HOME") with calls to the new + get_home_directory(). + + * sysfile.h: for WINDOWSNT, #include <direct.h>, to suppress + warnings about getcwd(), etc. not having prototypes. + +1998-05-28 Kirill M. Katsnelson <kkm@kis.ru> + + * process-nt.c (send_signal): Emulate SIGHUP. + (validate_signal_number): Ditto. + + * event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Unconditionally + remove MOD_SHIFT from ASCII characters. + (mswindows_wnd_proc, WM_KEYDOWN): Do not activate the menubar when + F10 is pressed. + +1998-05-24 Oliver Graf <ograf@fga.de> + + * frame-x.c (cde-start-drag-internal): added filename and multi- + data transfers + (x_cde_convert_callback) dito + +1998-05-26 Oliver Graf <ograf@fga.de> + + * frame-x.c: include event-mod.h also with CDE + (x_cde_convert_callback) made the thing working + (cde-start-drag-internal) also debugging + +1998-05-25 Hans Guenter Weigand <hgweigand@wiesbaden.netsurf.de> + + * m/sparc.h: + * getloadavg.c: + * malloc.c: + * unexec.c: + * mem-limits.h: + - add __OpenBSD__ where __NetBSD__ was found. + - TODO: replace platform-specific conditional compilation by + feature tests in configure.in. + +1998-05-15 Greg Klanderman <greg@alphatech.com> + + * window.c (Fwindow_displayed_text_pixel_height): New function. + (syms_of_window): DEFSUBR it. + + * indent.c (Fvertical_motion_pixels): New function - request + movement in pixels. + (vmotion_pixels): helper. + (syms_of_indent): DEFSUBR. + * lisp.h: declaration for vmotion_pixels(). + + * indent.c (Fvertical_motion): Add optional third argument PIXELS, + to request returning motion in pixels. + (Fvertical_motion_pixels): Remove, functionality merged into + Fvertical_motion. + * window.c (window_scroll): call Fvertical_motion with 3 arguments. + (Fmove_to_window_line): ditto. + * lisp.h: Change declaration for Fvertical_motion. + + * window.c: rename window-text-pixel-{height,width,edges} to + window-text-area-pixel-*. + +1998-05-26 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> + + * tooltalk.c (vars_of_tooltalk) added staticpro for + Tooltalk_Message_plist_str and Tooltalk_Pattern_plist_str + +1998-05-27 Andy Piper <andyp@parallax.co.uk> + + * faces.c: create a new 3d_object_face, make modeline and + vertical_divider faces fallback to this rather than the default. + +1998-05-21 Andy Piper <andyp@parallax.co.uk> + + * s/cygwin32.h: define charsets for cygwin. + +1998-05-25 Andy Piper <andyp@parallax.co.uk> + + * toolbar-msw.c (mswindows_output_toolbar): fix up button sizes + and coordinates. resize bitmaps if we have already settled on a + different size. + + * glyphs-msw.c (xpm_to_eimage): add ';' for mswindows compiler. + +1998-05-25 Hrvoje Niksic <hniksic@srce.hr> + + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. + + * menubar-msw.c (mswindows_handle_wm_command): Ditto. + + * gui.h: Ditto. + + * gui-x.c (popup_selection_callback): Ditto. + + * dialog-msw.c (dialog_proc): get_callback -> get_gui_callback. + + * gui.c (get_callback): Renamed to get_gui_callback. + +1998-05-17 Martin Buchholz <martin@xemacs.org> + + * glyphs.h: order rearrangement. + + * device-tty.c (tty_asynch_device_change): Warning suppression. + * device-x.c (x_device_system_metrics): Warning suppression. + Make Doc strings consistent with coding standards. + +1998-05-24 Martin Buchholz <martin@xemacs.org> + + * general.c: multiple definition of `Qicon'. general.c seems + like a good home for Qicon. + +1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> + + * This patch is to fix compilation warnings under Windows. + + * s/windowsnt.h: Encapsulate getpid with sys_getpid. + Added prototypes for FSF inherited functions, with which XEmacs is + sprinkled thoroughly. + Removed some #if 0 code. Bracketed some more definitions, probably + related to Visual C versions prior to 4 (we do not support them). + + * sysfloat.h (logb): Finally, get logb() prototyped. + + * sysfile.h: Added Windows specific includes. + Removed old Windows specific code bracketed with #if 0. + + * sysdep.h: Added prototype for xrealpath(). + + * sysdep.c (sys_getpid): Added function, to support '95 negative pids. + + * symsinit.h: Added prototypes for syms_of_dired_mswindows, + vars_of_dired_mswindows and init_ntproc (Grrr). + + * realpath.c: Added Windows specific include files. + (xrealpath): Conditionalized declaration of some auto variables on + S_IFLNK, to avoid warnings. + + * ntproc.c: Disabled some compiler warnings. This file is going to + die, so I have not cleaned it up much. + (set_process_dir): Const parameter. + (Fwin32_short_file_name): Down CHECK_* macros to one argument. + (Fwin32_long_file_name): Ditto. + (Fwin32_set_process_priority): Ditto. Why didn't I remove these + three functions? + + * nt.h: Added prototypes for set_process_dir and convert_time. + + * nt.c: More include files. + (getpwnam): Consted char* argument. + (get_emacs_configuration): Const return value. + (opendir): Const argument. + (stat): Casted converstion long->short. + (stat): Removed ad hoc and questionable support for non-MSC compile. + (sys_pipe): Removed unused auto variable. + (_sys_read_ahead): Removed calls to DebPrint. + (sys_read): Ditto, in 2 places. + (term_ntproc): Added unused int parameter to signal handler, to + avoid a warning when compiling a call to signal(). + (msw_sigset): Properly return old signandler or NULL instead of void. + + * floatfns.c (Flogb): Casted arguments to unary minus to signed. + + * gmalloc.c (morecore): Ditto. + (_free_internal): Ditto. + + * lread.c (parse_integer): Ditto. + + * dired-msw.c: Added several include files. + + * cmdloop.c (Fcommand_loop_1): Added Microsoft C to the Big List + of Compilers to Shut Up. + + * callproc.c: Added #includes to suppress warnings under Windows. + (init_callproc): Removed #if0'ed code and unused variables. + +1998-05-25 Andy Piper <andyp@parallax.co.uk> + + * device-msw.c (mswindows_device_system_metrics): do planes in a + way consistent with X. + + * glyphs-msw.c (mswindows_initialize_image_instance_mask): don't + use SetPixel, use DIBits functions. + (xpm_to_eimage): frob colors more closely like xpm deos. + + * toolbar-msw.c: only resize bitmaps when shrinking. Adjust look + to be closer to X version. + + * event-msw.c: use tooltip string directly. + + * redisplay-msw.c: reinstate Kirill's bg pixmap change. + + * objects-msw.c: frob rgb colors that only Kyle uses. + + * dialog-msw.c (button_width): INLINE -> inline. + +1998-05-23 SL Baur <steve@altair.xemacs.org> + + * getloadavg.c (getloadavg): Fix typo. + +1998-05-23 Kirill M. Katsnelson <kkm@kis.ru> + + * objects-msw.c (mswindows_initialize_font_instance): Added support + for font character sets. + Replaced 'XXX' with '####' in comments throughout the file. + +1998-05-23 Kirill M. Katsnelson <kkm@kis.ru> + + * emacs.c (main_1): Added calls to vars_of_dialog_mswindows() and + console_type_create_dialog_mswindows(), to initialize Windows dialog + support. + + * symsinit.h: Prototyped the above functions. + + * dialog-x.c (x_popup_dialog_box): Moved dialog descriptor consistency + checks to dialog.c... + + * dialog.c (Fpopup_dialog_box): ...right here. Added more checks: a + device must support dialog boxes, and the descriptor must supply at + least one button. + + * dialog-msw.c: New file, dialogs for Windows. + +1998-05-21 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + + * eldap.c (ldap_search_unwind): Return Qnil instead of nothing + (Fldap_search_internal): Removed unused variable `err' + + * eldap.h: Moved Lisp_LDAP declaration here instead of using a + forward declaration + +1998-05-17 Martin Buchholz <martin@xemacs.org> + + * eldap.h: eldap.[ch] should never be used unless HAVE_LDAP is + defined. Therefore there is no need to handle the case when + HAVE_LDAP is undefined. Similarily, there is no reason to have + any code wrapped within `#ifdef emacs', since this code is only + useful within an emacs. This simplifies the code significantly. + + * inline.c: Include eldap.h only if HAVE_LDAP. + * inline.c: Don't bother including TT_C_H_PATH, since tooltalk.h + already does that. + +1998-05-21 Kirill M. Katsnelson <kkm@kis.ru> + + * unexnt.c (copy_executable_and_dump_data_section): Suppress + printing dump stats when building without DEBUG_XEMACS. + (dump_bss_and_heap): Ditto. + +1998-05-21 Andy Piper <andyp@parallax.co.uk> + + * gnuclient.c: don't suppress window system if there is no display + and we are running under mswindows. send 'mswindows device type if + we are in this situation. + +1998-05-20 Andy Piper <andyp@parallax.co.uk> + + * general.c: + * lisp.h: Qbitmap, Qcursor, Qicon moved here from glyphs-msw.c. + + * glyphs-msw.c: change cursor imgae type name to resource. Fix + some nits. + +1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> + + * EmacsFrame.c (Xt_StringToScrollBarPlacement): Added support for + {top,bottom}-{left,right} values in addition to + {top,bottom}_{left,right}. + +1998-05-18 Hrvoje Niksic <hniksic@srce.hr> + + * fileio.c (Fmake_temp_name): Remove unreached code. + + * process-nt.c (validate_signal_number): Use + signal_simple_error(). + +1998-05-19 Martin Buchholz <martin@xemacs.org> + + * unexhp9k800.c: + * sound.c (vars_of_sound): + * sysdep.c (reset_sigio_on_device): + * window.c (window_bottom_gutter_height): + unexhp9k800.c:258: warning: implicit declaration of function + `calculate_checksum' + sound.c:604: warning: implicit declaration of function `vars_of_hpplay' + sysdep.c:1012: warning: unused variable `owner' + window.c:993: warning: `window_right_toolbar_width' defined but not used + +1998-05-19 Andy Piper <andyp@parallax.co.uk> + + * glyphs-msw.c (mswindows_create_resized_mask) + (mswindows_create_resized_bitmap): new funnctions split out from + mswindows_resize_dibitmap_instance. + + * glyphs-msw.h: declare new resize functions. + + * toolbar-msw.c (mswindows_output_toolbar): use new bitmap resize + functions so that the original bitmaps are preserved. + + * sheap.c: fixup static heap exhausted error to avoid FAQs. + + * redisplay-msw.c (mswindows_output_blank): fixup brush from bg + color if we are trying to output 0 depth bg pixmap. + + * scrollbar-msw.c: warning elimination. + +1998-05-18 Martin Buchholz <martin@xemacs.org> + + * frame-x.c (x_update_frame_external_traits): Start preprocessor + directives in column 1. + + * search.c (skip_chars): Avoid using xzero with arrays, since some + compilers get confused by the construct &array. + +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> + + * objects-msw.h: + * objects-msw.c: Changed the charset value for a new font from + "don't care" to "ansi". + + * glyphs-msw.c (convert_EImage_to_DIBitmap): Warnings fix. + +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> + + * event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Do not clear shift + modifier on control chars. + Use IsCharAlpha() instead of isaplha(). + +1998-05-19 Kazuyuki IENAGA <ienaga@jsys.co.jp> + + * s/freebsd.h: FreeBSD 2.2.6 now supports setlocale(LC_ALL, ""). + +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> + + * objects-msw.c (mswindows_initialize_font_instance): Use ANSI + charset when creating font. + (mswindows_initialize_color_instance): Do not create brush along + with a color. + (mswindows_finalize_color_instance): Do not delete it then. + + * objects-msw.h (struct mswindows_color_instance_data): Removed + brush slot, and corresponding accessor macro. + +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> + + * toolbar.c: Removed toolbar_data lrecord implementation. + (mark_frame_toolbar_buttons_dirty): Replase usage of toolbar_data + with toolbar_buttons (via FRAME_TOOLBAR_BUTTONS). + (compute_frame_toolbar_buttons): Ditto. + (CHECK_TOOLBAR): Ditto. + (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 + marked changed in set_frame_selected_window() in frame.c + Added check for changed toolbars geometry. + (compute_frame_toolbars_data): Removed unused second parameter; + Adjusted callers of this static function throughout the file. + (init_frame_toolbars): Initialize current_toolbar_size. + (update_frame_toolbars): Use DEVICE_SUPPORTS_TOOLBARS_P instead of + what is its current expansion, for clarity. + (init_frame_toolbars): Ditto. + (init_device_toolbars): Ditto. + (init_global_toolbars): Ditto. + + * toolbar.h: Removed definition of toolbar_data lrecord. + Added accessor macros FRAME_TOOLBAR_BUTTONS and + FRAME_CURRENT_TOOLBAR_SIZE. + Added macro DEVICE_SUPPORTS_TOOLBARS_P. + + * toolbar-x.c (x_output_toolbar): The same change as in + toolbar-msw.c + (x_output_toolbar): Ditto. + (x_redraw_exposed_toolbar): Ditto. + + * toolbar-msw.c (mswindows_output_toolbar): Retrieve current + buttons from toolbar_buttons using FRAME_TOOLBAR_BUTTONS macro. + (mswindows_output_toolbar): Ditto. + (mswindows_output_toolbar): Ditto. + + * frame.c (mark_frame): Removed marking of arrays, according to + frameslots.h change. + (nuke_all_frame_slots): Ditto. + (set_frame_selected_window): Mark toolbars changed when + last_nonminibuf_window changes. + + * frame.h (struct frame): Moved some slots to frameslots.h. + Added current_toolbar_size array. + Changed references from toolbar_data to toolbar_buttons in macros + FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE, + FRAME_RAW_THEORETICAL_TOOLBAR_SIZE and + FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH. + + * frameslots.h: Added macro MARKED_SLOT_ARRAY a la winslots.h + Moved arrays of lisp objects here from frame.h: toolbar_size, + toolbar_visible_p, toolbar_border_width. + Removed toolbar_data slot and added toolbar_buttons. + +1998-05-17 Kirill M. Katsnelson <kkm@kis.ru> + + * symsinit.h: Externed syms_of_process_nt() + + * emacs.c (main_1): Call syms_of_process_nt() + + * process-nt.c: Quote process arguments by a call to Lisp function + `nt-quote-process-args'. + (syms_of_process_nt): New function. + (nt_send_process): Flush data stream after each write, to avoid + leaving buffered data. + (nt_send_process): When blocked on process output, wait for + process to slurp more for progressively increasing time intervals. + +1998-05-17 Martin Buchholz <martin@xemacs.org> + + * window.c (have_undivided_common_edge): Make file-local function + static. + (map_windows): Return 0 if all map functions successful. + Fix typos. + + * winslots.h: Use unlikely names for local variables in macros to + avoid shadowing warnings. + +1998-05-17 Andy Piper <andyp@parallax.co.uk> + + * toolbar-msw.c (mswindows_output_toolbar): hash on toolbar width + so that we re-output if the toolbar size has changed. + +1998-05-17 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * s/aix4-2.h (ALIGN_DATA_RELOC): Undefined to support new unexaix.c. + + * s/aix3-1.h (ALIGN_DATA_RELOC): Defined to support new unexaix.c. + + * unexaix.c: Massive cleanup and support of AIX 4.2 (and hopefully + greater). + +1998-05-16 Kirill M. Katsnelson <kkm@kis.ru> + + * glyphs-msw.c: Defined OEMRESOURCE before including windows.h to + get bitmap manifest constants defined. + + * console-msw.h: Include system files in angle brackets, not in + quotes. + + * window.c (specifier_vars_of_window): Fixed a typo in + `vertical-divider-line-width' docstirng. + +1998-05-16 Olivier Galibert <galibert@pobox.com> + + * line-number.c (delete_invalidate_line_number_cache): Use an + EMACS_INT. + (buffer_line_number): Remove dangerous, plain wrong when using + 64bits emacs ints, cast. + + * insdel.c (buffer_delete_range): Use an EMACS_INT. + + * cmds.c (Fforward_line): Use EMACS_INTs. + + * search.c (bi_scan_buffer): Change to use EMACS_INTs. + (scan_buffer): Ditto. + (bi_find_next_newline_no_quit): Remove useless cast. + (find_next_newline_no_quit): Ditto. + (find_next_newline): Ditto. + (find_before_next_newline): Use an EMACS_INT. + + * lisp.h: Change scan_buffer to pass EMACS_INTs. + +1998-05-16 Hrvoje Niksic <hniksic@srce.hr> + + * menubar-msw.c (mswindows_handle_wm_command): Ditto. + + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. + + * gui-x.c (popup_selection_callback): Use it. + + * gui.h (get_callback): Declare it. + + * gui.c (get_callback): New function. + +1998-05-15 SL Baur <steve@altair.xemacs.org> + + * window.c (have_undivided_common_edge): Guard scrollbar specific + stuff. + (window_needs_vertical_divider_1): Ditto. + +1998-05-16 Hrvoje Niksic <hniksic@srce.hr> + + * emacs.c (decode_path): Eliminate compiler warning. + (Fdecode_path): Renamed to Fsplit_path. + (Fsplit_string_by_char): New function. + +1998-05-14 Damon Lipparelli <lipp@primus.com> + + * winslots.h: close comment + +1998-05-16 Kirill M. Katsnelson <kkm@kis.ru> + + * callproc.c: Removed declared and unused variable Qbuffer_file_type. + + * bufslots.h: Removed buffer_file_type slot. + + * buffer.c (complex_vars_of_buffer): Removed buffer_file_type from + buffer local flags. + (complex_vars_of_buffer): Removed buffer-file-type variable and + its default reference. + +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> + + * faces.c (complex_vars_of_faces): Defined + Vvertical_divider_face. + (vars_of_faces): Staticpro it. + + * faces.h: Externed Vvertical_divider_face. + + * redisplay-x.c (x_output_vertical_divider): Use + Vvertical_divider_face to draw the divider instead of modeline + face. + + * redisplay-msw.c (mswindows_output_vertical_divider): Draw + divider face using Vvertical_divider_face background. + Fix drawing spacing gaps around the divider. + +1998-05-14 Didier Verna <verna@inf.enst.fr> + + * redisplay-x.c (x_output_vertical_divider): removed hard-wired + values for the vertical divider line width and spacing. Use the + cached values from the window structure instead. + (x_divider_width): ditto. + + * window.c (specifier_vars_of_window): new specifiers: + vertical-divier -line-width and -spacing. + (vertical_divider_global_width_changed): formerly known as + vertical_divider_shadow_thickness_changed. + + * winslots.h: new slots: vertical_specifier _line_width and + _spacing. Plus corrected a comment typo. + +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> + + * window.h: Declared window_divider_width(). + + * console-stream.c (stream_divider_width): Removed method. + (console_type_create_stream): And declaration for it. + + * redisplay.c (pixel_to_glyph_translation): Use + window_divider_width() instead of divider_width redisplay method. + (pixel_to_glyph_translation): Fix top divider edge calculation + when scrollbar is on top. + + * window.c (window_divider_width): New function, an outphaser for + divider_width redisplay method. + (window_right_gutter_width): Use it. + (specifier_vars_of_window): For vertical-divider-{spacing,line-width} + specifiers, set fallback values differently on TTYs, and document + the behavior of these on TTYs in the docstrings. + + * scrollbar.c (update_scrollbar_instance): Use + window_divider_width() instead of divider_width redisplay method. + + * console.h (struct console_methods): Removed divider_width_method. + + * redisplay-tty.c (tty_divider_width): Removed device method. + (console_type_create_redisplay_tty): Removed definition for it. + (tty_output_vertical_divider): Respect the value returned by + window_divider_width thus divider line width specification. + + * redisplay-msw.c (mswindows_divider_width): Removed device method. + (console_type_create_redisplay_mswindows): Removed definition for it. + (mswinodws_output_vertical_divider): Respect the value returned by + window_divider_width thus divider line width specification. + +1998-05-15 Andy Piper <andyp@parallax.co.uk> + + * toolbar-msw.c: guess toolbar frame size a bit more accurately. + +1998-05-15 Andy Piper <andyp@parallax.co.uk> + + * glyphs-msw.c: resource loading implementation. + (cursor_normalize): new function. + (cursor_validate): ditto. + (cursor_instantiate): ditto. + (cursor_name_to_resource): ditto. + (cursor_possible_dest_types): ditto. + (check_valid_symbol): ditto. + (check_valid_string_or_int): ditto. + +1998-05-14 Martin Buchholz <martin@xemacs.org> + + * sysdep.c (tty_init_sys_modes_on_device): Treat VSUSP just like + VINTR and VQUIT. + + * process-unix.c (process_signal_char): Use VSUSP instead of + non-standard VSWTCH. Always prefer VSUSP to VSWTCH. + +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> + + * specifier.c (specifier_instance): Change locale precedence of + instantiation so window locale has higher priority than buffer + locale. + (Fspecifier_instance): Reflect this in docstring. + (Fadd_spec_list_to_specifier): Ditto. + (Fadd_spec_to_specifier): Ditto. + (Fremove_specifier): Ditto. + +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> + + ** Dialog separation into a device method from Andy Piper + + * emacs.c (main_1): Call console_type_create_dialog_x(). + + * dialog-x.c (x_popup_dialog_box): Old Fpopup_dialog_box converted + into this device method. + (console_type_create_dialog_x): New function. + + * dialog.c (Fpopup_dialog_box): New function. + (syms_of_dialog): Defsubr it. + + * console.h (struct console_methods): Declared + popup_dialog_box_method(). + + * symsinit.h: Defined console_type_create_dialog_{x,mswindows} + +1998-05-14 Oliver Graf <ograf@fga.de> + + * dragdrop.c (vars_of_dragdrop): dragdrop-protocols created + * frame-x.c (x_cde_transfer_callback): checked for merge errors + +1998-05-13 Oliver Graf <ograf@fga.de> + + * dragdrop.c (vars_of_dragdrop): provide dragdrop-api + +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> + + * console.h (device_metrics): Removed dbcs, input-method-editor + and right-to-left metrics. + + * device.c (Fdevice_system_metric): Ditto. + (Fdevice_system_metrics): Ditto. + (syms_of_device): Ditto. + (Fdevice_system_metric): Swapped DEVICE and METRIC parameters back + again. + +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> + + * line-number.h (mark_line_number_cache): Remove unused + declaration. + + * line-number.c (LINE_NUMBER_FAR): Increase to 32768. + (get_nearest_line_number): Simplify. + (add_position_to_cache): Make the old marker point nowhere. + +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> + + ** Renamed window-divider-map => vertical-divider-map + and event-over-divider-p => event-over-vertical-divider-p, + in the following files/functions: + * events.h: + * events.c (Fevent_over_divider_p): + * keymap.c (get_relevant_keymaps): + (vars_of_keymap): + + * redisplay.h (OVER_V_DIVIDER): Renamed so from OVER_DIVIDER. + + * redisplay.c (pixel_to_glyph_translation): Use OVER_V_DIVIDER. + +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> + + * window.c (vertical_divider_changed_in_window): Renamed so. + (specifier_vars_of_window): Defined Vvertical_divider_draggable_p. + (window_needs_vertical_divider_1): Decide whether we need it based + on the value of the above specifier. If separators are unwanted, + put them only if there's no scrollbar between this window and its + right neighbor. + (have_undivided_common_edge): New function, helper for the above. + (window_needs_vertical_divider): Return either a cached value, + or clauclate and cache one. + (invalidate_vertical_divider_cache_in_window): Implemented. + (map_windows): Changed return type to int, return the value from + MAPFUN. + + * window.h: Prototype invalidate_vertical_divider_cache_in_window. + (struct window): Added need_vertical_divider_p and + need_vertical_divider_valid_p. + + * winslots.h: Added vertical_divider_draggable_p slot. + + * scrollbar.c (vertical_scrollbar_changed_in_window): Implemented. + (specifier_vars_of_scrollbar): Used it in all vertical specifiers. + + * frame.c (invalidate_vertical_divider_cache_in_frame): New function. + + * frame.h (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): Call + invalidate_vertical_divider_cache_in_frame(). + Prototype it. + +1998-05-14 Andy Piper <andyp@parallax.co.uk> + + * toolbar-msw.c: provide correct parameters to TB_SETROWS. + + * glyphs-msw.c (mswindows_initialize_image_instance_mask): size + masks correctly and don't select 0. + +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> + + * winslots.h: New file, declaration of some struct window and + struct saved_window members. + + * window.h (struct window): Include it, with required preprocessor + magic. + + * window.c (mark_window): Ditto. + (allocate_window): Ditto. + (struct saved_window): Ditto. + (mark_window_config): Ditto. + (saved_window_equal): Ditto. + (Fset_window_configuration): Ditto. + +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> + + * redisplay-msw.c (mswindows_output_vertical_divider): Syntax fix. + +1998-05-12 Didier Verna <verna@inf.enst.fr> + + * 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 <verna@inf.enst.fr> + + * console.h (struct console_methods): the divider_width console + method now requires a struct window * argument. + + * redisplay-x.c (x_divider_width): ditto. Plus remove + X_DIVIDER_WIDTH, X_DIVIDER_SHADOW_THICKNESS. + (x_output_vertical_divider): give a depressed look when the shadow + thickness is negative. + + * console-stream.c (stream_divider_width): pass a struct window * + argument. + + * redisplay-tty.c (tty_divider_width): ditto. + + * window.c (window_right_gutter_width): totdi. + + * redisplay.c (generate_modeline): ittod. + + * scrollbar.c (update_scrollbar_instance): ttido. + + * redisplay-msw.c (mswindows_divider_width): ottid. + WARNING: this enables to compile, but the feature is not functional. + + * window.h (struct window): new field + vertical_divider_shadow_thickness. + + * window.c (specifier_vars_of_window): new specifier + vertical-divider-shadow-thickness. + (vertical_divider_shadow_thickness_changed): new function to + inform redisplay that the window has changed. + (mark_window): handle new field vertical_divider_shadow_thickness + from struct window. + (allocate_window): ditto. + (saved_window_equal): toddi. + (Fset_window_configuration): totid. + (save_window_save): ttdio. + (struct saved_window): new field vertical_divider_shadow_thickness. + +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> + + * device-msw.c (mswindows_device_system_metrics): Support a deluge + of metrics. + +1998-05-12 Oliver Graf <ograf@fga.de> + + * frame-x.c (x_cde_transfer_callback): fixed for the new protocol + * event-Xt.c (x_event_to_emacs_event): C++ compability + +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> + + * emacs.c (Fdecode_path): Default SEPCHAR to value of + path-separator. + +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> + + * emacs.c (vars_of_emacs): Do it here; change the meaning of + Vpath_separator. + + * fileio.c (vars_of_fileio): Don't define Vpath_separator here. + +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> + + * emacs.c (decode_path_1): New function. + (decode_path): Use it. + (Fdecode_path): Renamed from Fdecode_path_internal; use + decode_path_1. + +1998-05-12 Hrvoje Niksic <hniksic@srce.hr> + + * macros.c (Fzap_last_kbd_macro_event): New function. + (Fend_kbd_macro): Remove REMOVE_LAST kludge. + +1998-05-10 Andy Piper <andyp@parallax.co.uk> + + * redisplay-msw.c (mswindows_output_dibitmap_region): make sure + multiple bitmaps are output vertically as well as horizontally. + * (mswindows_output_dibitmap): don't cope with bitmap boundaries + crossing lines this is handled by + mswindows_output_dibitmap_region. + +1998-05-12 Martin Buchholz <martin@xemacs.org> + + * inline.c: Include eldap.h + + * menubar-x.c (x_update_frame_menubar_internal): + Remove: unused variable `container' + +1998-05-11 Martin Buchholz <martin@xemacs.org> + + * s/aix4.h: Allow AIX 4.3 XEmacs to compile cleanly. + Unfortunately, the resulting temacs still cannot dump. + + * symbols.c (symbol_is_constant): + (verify_ok_for_buffer_local): + -Wswitch Warning suppression - add default case to switches. + + * redisplay.c (decode_mode_spec): Remove unused variables, + Replace Fcoding_system_property (codesys, Qmnemonic) with + XCODING_SYSTEM_MNEMONIC (codesys); + Fcoding_system_property is for users. * 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 <ben@xemacs.org> - - * 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 <ben@xemacs.org> - - * 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 <tomonori@suiyokai.org> - - * 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 <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <limits.h> - - * 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 <yoshiki@xemacs.org> - - * filelock.c (current_lock_owner): Remove unused variable o, p. - -2000-04-17 Norbert Koch <n.koch@eai-delta.de> - - * callint.c: Remove multiply defined symbol Qlet - (syms_of_callint): ditto. - -2000-04-14 Andy Piper <andy@xemacs.org> - - * 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 <hniksic@iskon.hr> - - * event-stream.c (Fdispatch_event): Doc fix. - -2000-03-29 SL Baur <steve@musashimaru.m17n.org> - - * 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 <kkm@dtmx.com> - - * 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 <jan@xemacs.org> - - * process-unix.c (unix_send_process): Guard against process MIA - after Faccept_process_output. - -2000-04-11 Ben Wing <ben@xemacs.org> - - * eval.c (unbind_to_hairy): fix brokenness introduced by - nanosecond speed improvements. - -2000-04-07 Raymond Toy <toy@rtp.ericsson.se> - - * 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 <tomonori@suiyokai.org> - - * redisplay.c (add_margin_runes): Add text image glyph - handling. - -2000-04-06 Yoshiki Hayashi <yoshiki@xemacs.org> - - * lisp.h (DOESNT_RETURN): Don't declare as volatile when - gcc is newer than 2.5. - -2000-04-06 Colin Rafferty <colin@xemacs.org> - - * 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 <andy@xemacs.org> - - * gmalloc.c (malloc): undo previous change. - (malloc): ditto. - (free): ditto. - (realloc): ditto. - -2000-04-06 IKEYAMA Tomonori <tomonori@suiyokai.org> - - * line-number.c (buffer_line_number): Revert to former version. - -2000-04-06 Andy Piper <andy@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * buffer.h (struct buffer): auto_save_modified should be long. - -2000-04-05 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * faces.c (complex_vars_of_faces): The widget face should inherit - the font of the gui-element face. - -2000-04-04 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <tomonori@suiyokai.org> - - * 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 <tomonori@suiyokai.org> - - * 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 <mta@arbortext.com> - - 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 <vroonhof@math.ethz.ch> - - * 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 <andy@xemacs.org> - - * glyphs-widget.c: (button_query_geometry): new function. Adjust - for toggle and radio buttons. - (image_instantiator_buttons): use it. - -2000-03-03 Jan Vroonhof <vroonhof@math.ethz.ch> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * toolbar-msw.c (TBSTYLE_FLAT): add. - (mswindows_output_toolbar): minor fiddling. - -2000-03-29 Andy Piper <andy@xemacs.org> - - * 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 <mta@arbortext.com> - - * 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 <andy@xemacs.org> - - * gui.c (get_gui_callback): treat Quit specially. - -2000-03-27 Andy Piper <andy@xemacs.org> - - * glyphs.c (image_instantiate): be careful to check in the same - way we assigned. - -2000-03-27 Didier Verna <didier@xemacs.org> - - * 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 <andy@xemacs.org> - - * glyphs-msw.c (mswindows_update_widget): make sure the widget - gets updated whenever the face might have changed. - -2000-03-26 Mike Alexander <mta@arbortext.com> - - * dumper.c (pdump_resource_free): Fix the comment. - -2000-03-21 Olivier Galibert <galibert@pobox.com> - - * input-method-xlib.c (XIM_init_frame): Remove painful warning. - -2000-03-22 Mike Alexander <mta@arbortext.com> - - * 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 <mta@arbortext.com> - - * gui.c (copy_gui_item_tree): Return a value in all cases - -2000-03-21 Didier Verna <didier@xemacs.org> - - * 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 <andy@xemacs.org> - - * gutter.c (redraw_exposed_gutters): must be "in display" when we - do this. - -2000-03-24 Andy Piper <andy@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * 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 <ben@xemacs.org> - - * ntproc.c (create_child): remove bogus HAVE_NTGUI's. - From Mike Alexander <mta@arbortext.com>. - -2000-03-21 Ben Wing <ben@xemacs.org> - - * 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 <martin@xemacs.org> - - * Makefile.in.in: Coalesce HAVE_NATIVE_SOUND code fragments. - -2000-03-20 Andy Piper <andy@xemacs.org> - - * glyphs.c (full_list_hash): make hashes of the same elements in - different orders return different values. - -2000-03-20 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.32 is released. - -2000-03-20 Martin Buchholz <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * sysfile.h: - Make sure PATH_MAX is always defined. - Include limits.h for PATH_MAX. - Deprecate use of MAXPATHLEN. - -2000-03-10 Martin Buchholz <martin@xemacs.org> - - * 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 <andy@xemacs.org> - - * glyphs.c (image_instantiate): allow text glyphs to be - instantiated in the minibuffer window. - -2000-03-19 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 unneccessary - 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 <yoshiki@xemacs.org> - - * window.c (Fselect_window): Undo 2000-03-17 change. - -2000-03-17 SL Baur <steve@musashimaru.m17n.org> - - * 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 <andy@xemacs.org> - - * 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 <galibert@pobox.com> - - * emacs.c (Frunning_temacs_p): Revert previous patch. - (main_1): Reinitialize running_temacs_argc if pdump_load succeeds. - -2000-03-16 Andy Piper <andy@xemacs.org> - - * 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 <galibert@pobox.com> - - * 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 <galibert@pobox.com> - - * 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 <steve@musashimaru.m17n.org> - - * 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 <steve@musashimaru.m17n.org> - - * postgresql.c (Fpq_lo_import): Fix return value. - Suggested by: Kenji Itoh <keit@tpj.co.jp>. - -2000-03-13 Ben Wing <ben@xemacs.org> - - * alloc.c (pdump_load): - Fix compile warning under mswin. - -2000-03-14 SL Baur <steve@musashimaru.m17n.org> - - * 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 <steve@musashimaru.m17n.org> - - * postgresql.c (vars_of_postgresql): Mule-ize. - (Fpq_conn_defaults): Ditto. - -2000-03-12 Ben Wing <ben@xemacs.org> - - * 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 <kkm@dtmx.com> - - * nt.c (fstat): Added a comment for another problem with - non-encapsulated [f]stat(), reported by Adrian Aichner - <aichner@ecf.teradyne.com>. - -2000-03-11 Andy Piper <andy@xemacs.org> - - * window.c (make_dummy_parent): initialize subwindow instance - cache. - (Fset_window_configuration): zero extent_modiff. - -2000-03-10 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * alloc.c (pdump_dump_data): remove i & count shadows. - -2000-02-27 Mike Alexander <mta@arbortext.com> - - * 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 <steve@musashimaru.m17n.org> - - * lrecord.h: add `lrecord_type_pgsetenv'. - -2000-03-08 SL Baur <steve@musashimaru.m17n.org> - - * symsinit.h: declare (vars|syms)_of* functions. - * lrecord.h: add `lrecord_type_pgconn' and 'lrecord_type_pgresult'. - -2000-03-06 SL Baur <steve@musashimaru.m17n.org> - - * 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 <yoshiki@xemacs.org> - - * redisplay-output.c (redisplay_output_display_block): Disable - redundant code. - -2000-03-09 Yoshiki Hayashi <yoshiki@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * emacs.c (main_1): Always call syms_of_gui. - * inline.c: include gui.h - -2000-03-09 Yoshiki Hayashi <yoshiki@xemacs.org> - - * 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 <andy@xemacs.org> - - * buffer.c (Frename_buffer): record new buffer name the right way. - -2000-03-08 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <yoshiki@xemacs.org> - - * redisplay.h: Fix comment style. - -2000-03-08 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * 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 <didier@xemacs.org> - - * dired.c: #include `regex.h' after `sysfile.h'. - -2000-03-06 Martin Buchholz <martin@xemacs.org> - - * 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 <jhar@tardis.ed.ac.uk> - - * 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 <CraigL@DyCon.com> - - * process-nt.c: MinGW now has <shellapi.h>, but still needs - <errno.h>. - - * 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 <tomonori@suiyokai.org> - - * 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 <jhar@tardis.ed.ac.uk> - - * fileio.c (Fmake_symbolic_link): - (Ffile_symlink_p): - Run handlers even if local machine doesn't have symlinks. - -2000-03-05 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c (mswindows_drain_windows_queue): - Don't generate paint magic events for non-XEmacs frames. - -2000-03-05 Andy Piper <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * opaque.c (DEFINE_LRECORD_IMPLEMENTATION): opaque_ptr ==> opaque-ptr - -2000-03-03 Jan Vroonhof <vroonhof@math.ethz.ch> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 optimisation. - - * 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 <stephen@xemacs.org> - - * emacs.c (data-directory): Xref `locate-data-file' in docstring. - -2000-02-29 Stephen J. Turnbull <stephen@xemacs.org> - - * alloc.c (dumpopaquevec): Increase dimension for --with-canna. - -1999-12-30 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * file-coding.c (reset_decoding_stream): Clear previous - detection state when autodetect. - -2000-02-29 Didier Verna <didier@xemacs.org> - - * extents.c (set_extent_glyph_1): don't require extents to be - attached. - -2000-02-27 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * device-msw.c: Be kind to older cygwin versions. From Raymond - Toy <toy@rtp.ericsson.se>. - - * gui-msw.c (Fmswindows_shell_execute): Remove things unknown to - earlier cygwins. From Raymond Toy <toy@rtp.ericsson.se>. - -2000-02-25 Martin Buchholz <martin@xemacs.org> - - * elhash.c (MARK_OBJ): Practice macro hygiene. - -2000-02-24 Martin Buchholz <martin@xemacs.org> - - * 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 <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * glyphs.h (IMAGE_INSTANCE_FACE): glyph might be nil, don't crash - if it is. - -2000-02-24 Martin Buchholz <martin@xemacs.org> - - * 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 <kkm@dtmx.com> - - * 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 <mta@arbortext.com> - - * 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 <kkm@dtmx.com> - - * 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 <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.31 is released. - -2000-02-22 Ben Wing <ben@xemacs.org> - - * ntheap.c (allocate_heap): Make sure `ptr' is initialized. - -2000-02-22 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_widget_instantiate): don't explicitly resize here. - -2000-02-21 Mike Sperber <mike@xemacs.org> - - * .dbxrc: - * .gdbinit: - * Makefile.in.in: Remove obsolete EMACSBOOTSTRAP... environment - variables. - -2000-02-21 Mike Sperber <mike@xemacs.org> - - * s/aix4.h: Declare getaddrinfo broken for AIX 4, which it is. - -2000-02-21 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.30 is released. - -2000-02-20 Martin Buchholz <martin@xemacs.org> - - 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 <andy@xemacs.org> - - * 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 <jhar@tardis.ed.ac.uk> - - * 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 <jhar@tardis.ed.ac.uk> - - * s/windowsnt.h: Only use __declspec(noreturn) with MSVC>=6. - -2000-02-18 Olivier Galibert <galibert@pobox.com> - - * 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 <jhar@tardis.ed.ac.uk> - - * device-msw.c (mswindows_delete_device): Free DDE string - handles. - -2000-02-16 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * 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 <martin@xemacs.org> - - * eldap.c (Fldap_open): - (Fldap_search_basic): - (Fldap_add): - (Fldap_modify): - Use new coding system conversion macros. - -2000-01-06 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * console-tty.c (tty_init_console): Change MULE to FILE_CODING. - -1999-11-27 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * 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 <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <jhar@tardis.ed.ac.uk> - - * 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 <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.29 is released. - -2000-02-15 Olivier Galibert <galibert@pobox.com> - - * fns.c (size_bit_vector): Fix computation of the size. - -2000-02-15 Martin Buchholz <martin@xemacs.org> - - * *.[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 <jhar@tardis.ed.ac.uk> - - * 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 <jhar@tardis.ed.ac.uk> - - * 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 <ueno@ueda.info.waseda.ac.jp> - - * gui.c (gui_item_accelerator): Return the first underlined - character in item name. - -2000-02-11 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * 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 <yoshiki@xemacs.org> - - * frame.c (change_frame_size_1): Undo 2000-02-03 change. - -1999-12-20 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * syntax.c (scan_words): Always advance at least one character. - -2000-02-13 Andy Piper <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <galibert@pobox.com> - - * 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 <galibert@pobox.com> - - * 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 <andy@xemacs.org> - - * 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 <martin@xemacs.org> - - * 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 <hamishm@lucent.com> - - * .cvsignore: Ignore portable dumper xemacs.dmp file - -2000-02-09 Andy Piper <andy@xemacs.org> - - * 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 <andy@xemacs.org> - - * gui-msw.c (Fmswindows_shell_execute): Make - mswindows-shell-execute industrial strength. - -2000-02-08 Martin Buchholz <martin@xemacs.org> - - * 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 <martin@xemacs.org> - - * event-Xt.c (x_has_keysym): Use XConvertCase only if available. - * config.h.in: Add HAVE_XCONVERTCASE. - -2000-02-07 Andy Piper <andy@xemacs.org> - - * glyphs.c (image_instance_layout): undo 2000-01-29 change since - it breaks many things. - -2000-02-07 Jan Vroonhof <vroonhof@math.ethz.ch> - - * 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 <martin@xemacs.org> - - * XEmacs 21.2.28 is released. - -2000-02-06 Martin Buchholz <martin@xemacs.org> - - * event-Xt.c (x_keysym_to_character): New. - (maybe_define_x_key_as_self_inserting_character): New. - (x_has_keysym): New. - Auto-define all keys on the keyboard as self-insert-key. - -2000-02-02 Martin Buchholz <martin@xemacs.org> - - * menubar.c (vars_of_menubar): A small code simplification. - - * minibuf.c (echo_area_append): Workaround egcs-20000131 c++ compiler bug - - * 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): - 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): - 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. - (check_keymap_definition_loop): New function. - (keymap_store_internal): Keep luser from shooting self in foot, - via (define-key ctl-x-4-map "p" global-map). - Remove fullness slot from struct Lisp_Keymap, since hash tables - are now reliable. - (print_keymap): Remove 'Yuck' factor by simply printing "size %d". - -2000-01-30 Martin Buchholz <martin@xemacs.org> - - * redisplay.c (init_redisplay): Fix small memory leak. - * 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. - * alloc.c (pdump_load): Replace LISP_TO_VOID with higher-level macros. - * alloc.c: No need to #ifndef before #undef. - - * print.c: Allow debug_print() to print readably by modifying - debug_print_readably. Use consistent variable names. - - * .dbxrc: Try to get things to work even if stopped in a function - without source available by explicitly specifying source files. -2000-02-03 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * unexnt.c (_start): Removed bogus code which caused loading heap - from differrent executable file. - Removed bogus assignment to _fmode, which caused inconsistencies. - -2000-02-03 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * s\windowsnt.h: Removed lots of #if 0 blocks of Emacs heritage. - Have spawnve encapsulation regard DONT_ENCAPSULATE. - Do not preliminary `#define signal sigset'. - - * systime.h: Do not prototype environ on windows nt and cygwin, - this conflicts with system header. - - * syssignal.h: Use correct define for WINDOWSNT - - * sysdep.h: Do not prototype environ on windows nt, this conflicts - with system header. - - * sysdep.c (near start of file): Fixed commentary and rearranged - ifdefs in readable order. - (NEED_STARTS): Do not force NEED_STARTS when PDUMPing. - (start_of_text): - (end_of_text): - (end_of_data): Do not compile in if using PDUMP. - - * symsinit.h: Protptyped vars_of_nt(). - - * ntproc.c (windows9x_p): Added, instead of os_subtype. - (find_child_console): Use it. - (sys_kill): Use it. - - * ntheap.h: Do not extern os_subtype. - - * ntheap.c (cache_system_info): Do not cache unneeded: - nt_major_version, nt_minor_version and os_subtype. - (recreate_heap): Do not compile in when PDUMPing. - - * nt.c (geteuid and friends): Use the new varibale - nt_fake_unix_uid, instead of hashing fake uid out of NT RID. - (init_user_info): Removed the above mentioned hackery. - (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 - the above. - - * emacs.c (main_1): Call vars_of_nt(). - (right before Fdump_emacs_data): Don't need lastfile if using both - portabe dumper and system malloc. - - * alloc.c (Fmemory_limit): Conditionalized out. - (pdump): Use OPEN_BINARY for the portable dump file. - (pdump_load): Ditto. - -2000-02-02 Mike Alexander <mta@arbortext.com> - - * nt.c (convert_time): Set tm_isdst before calling mktime and - avoid calling it at all if the compiler supports 64 bit integers. - Also initialize utc_base_ft before using it. - -2000-02-03 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> - - * frame.c (change_frame_size_1): Take f->internal_border_width - into consideration when calculating the width of the frame. - -2000-02-01 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * window.c (frame_min_height): - (frame_size_valid_p): - (frame_pixsize_valid_p): Added. - (check_frame_size): Generalized. - - * window.h: Prototyped the above. - - * lisp.h: - * general.c: Added Qbottom_margin, Qduplex, Qlandscape, - Qleft_margin, Qorientation, Qportrait, Qright_margin, Qtop_margin. - Deleted Vwin32_* and Vbinary_process_* unused variables. - - * device-msw.c (msprinter_init_device): Do not get printer font - list; Added DEVMODE functions. - - * frame-msw.c: Added lots of printer code. - - * faces.c: Moved 'left-margin and 'right-margin defsymbols to - general.c. - - * console-msw.h: Added more msprinter device private slots. - -2000-02-01 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * event-msw.c (key_needs_default_processing_p): Added. - (mswindows_wnd_proc, WM_KEYUP, KEYDOWN): Call it. - -2000-01-29 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * glyphs.c (image_instance_layout): Mark image instance as clean - after layout. - (glyph_dirty_p): Removed redundant function. - (invalidate_glyph_geometry_maybe): Added. - (update_glyph_cachel_data): Call it. - - * glyphs.h: Prototyped it. - - * redisplay.c (add_glyph_rune): Call it. - (redisplay_window): Reset glyphs cachels when frame faces has - changed, thus forcing recomputation of built-in border glyphs. - -2000-01-30 Martin Buchholz <martin@xemacs.org> - - * Makefile.in.in: Make portable dumper and purify play well together. - Add imperfect, but better than nothing, support for pdump. - Remove xemacs.dmp when temacs is re-generated. - Don't ignore errors when dumping xemacs. - - * symbols.c (maybe_call_magic_handler): Remove one magic number. - -2000-01-28 Andy Piper <andy@xemacs.org> - - * frame.c (allocate_frame_core): Use new Fset_window_buffer signature. - (setup_normal_frame): ditto. - (setup_frame_without_minibuffer): ditto. - (setup_minibuffer_frame): ditto. - (delete_frame_internal): ditto. - (Fmake_frame_invisible): ditto. - (Ficonify_frame): ditto. - - * window.h: change Fset_window_buffer signature. - - * window.c (Fsplit_window): Use new Fset_window_buffer signature. - (Fset_window_buffer): allow recording of buffer if the window is - the selected window. - (window_loop): Use new Fset_window signature. - -2000-01-23 Daniel Pittman <daniel@danann.net> - - * config.h.in: Added template for `HAVE_ATHENA_3D' - -2000-01-29 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_resize_subwindow): Try and catch bogus resizes. - - * gutter.c (output_gutter): Don't output if the window isn't live. - -2000-01-28 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * glyphs-msw.c (mswindows_unmap_subwindow): Fix of corrupted patch - of 01/12/00: Moved SetFocus back here where it belongs. - -2000-01-23 Andy Piper <andy@xemacs.org> - - * s/cygwin32.h: declare printer things. - -2000-01-26 Andy Piper <andy@xemacs.org> - - * select.c (Fown_selection_internal): GCPRO bug fix from Mike - Alexander. - -2000-01-24 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_locate_pixmap_file): Expand filename. - (mswindows_button_instantiate): Make sure glyph is a pixmap. - - * glyphs-widget.c (widget_instantiate): Avoid shadows. - - * frame-msw.c (msprinter_init_frame_3): Nuke warning. - - * glyphs-msw.c: (mswindows_string_to_color): remove declaration. - - * redisplay-msw.c (mswindows_output_cursor): Avoid shadows. - (mswindows_output_display_block): Avoid local shadows. - - * event-msw.c (mswindows_enqueue_magic_event): Avoid shadows. - (mswindows_enqueue_mouse_button_event): ditto. - (mswindows_handle_gui_wm_command): remove declaration. - - * console-msw.c (mswindows_canonicalize_console_connection): Avoid - warnings. - - * console-msw.h: Avoid shadows. - (mswindows_get_toolbar_button_text): - (emacs_mswindows_create_stream_pair): - (emacs_mswindows_delete_stream_pair): - (mswindows_handle_toolbar_wm_command): declare. - - * device-msw.c (build_syscolor_string): Avoid shadows. - -2000-01-23 Andy Piper <andy@xemacs.org> - - * glyphs-widget.c (widget_instantiate): reverse the items for - layouts so that children are in the expected order. - -2000-01-28 Martin Buchholz <martin@xemacs.org> - - * ralloc.c: safe_bcopy ==> memmove - * gmalloc.c: Remove MEMMOVE_MISSING conditional code. - * s/msdos.h: Remove BCOPY macros. - * insdel.c (gap_right): Remove BCOPY conditional code. - * insdel.c (gap_left): Remove BCOPY conditional code. - XEmacs demands a working ANSI C compiler - hence memmove. - - * regex.c (regex_compile): Remove accidental use of trigraphs. - -2000-01-27 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * event-msw.c (mswindows_enqueue_misc_user_event): Initialize - event timestamp. - -2000-01-26 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * event-msw.c (mswindows_drain_windows_queue): Added the - parameter. - (mswindows_need_event): Commented the call to - mswindows_drain_windows_queue(). - (emacs_mswindows_quit_p): Lookup the windows for keyboard messages - only. - - * console-msw.h: Moved a few function prototypes here from - event-msw.c. - - * gui-msw.c (mswindows_handle_gui_wm_command): Changed the ID - parameter from unsigned short to unsigned long. - (Fmswindows_shell_execute): Added return value. - -2000-01-27 URA Hiroshi <ura@hiru.aoba.yokohama.jp> - - * 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): - Moved the code to get a port # into address loop. - -2000-01-27 Martin Buchholz <martin@xemacs.org> - - * buffer.c (reinit_vars_of_buffer): - The right place to initialize conversion_in_dynarr and - conversion_out_dynarr. - - * alloc.c (pdump): Use the real open() till sys_open() is functional. - - * process-unix.c (unix_canonicalize_host_name): Muleize. - (unix_open_network_stream): Muleize. - - * buffer.h: Fix up prototypes for ralloc.c functions. - -2000-01-27 URA Hiroshi <ura@hiru.aoba.yokohama.jp> - * config.h.in: added HAVE_GETADDRINFO and HAVE_GETNAMEINFO - * sysdep.c: In init_system_name(), add code to use getaddrinfo() - instead of gethostbyname() - * process-unix.c: In unix_canonicalize_host_name() and - unix_open_network_stream(), add code to use getaddrinfo() - instead of gethostbyname(). - -2000-01-27 Daniel Pittman <daniel@danann.net> - - * device-x.c (x_init_device): Warn at run-time if using Athena 3d - libs when built with flat Athena. - -2000-01-27 Martin Buchholz <martin@xemacs.org> - - * ralloc.c: Replace SIZE (conflicts with Windows headers) with size_t. - Use coding standards for function prototypes. - -2000-01-25 Martin Buchholz <martin@xemacs.org> - - * dialog-msw.c (push_lisp_string_as_unicode): - * doc.c (unparesseuxify_doc_string): - * dired.c (Fuser_name_completion_1): - * dired.c (Fuser_name_all_completions): - * dired.c (free_user_cache): - * dired.c (user_name_completion): - * console-x.c (get_display_arg_connection): - * minibuf.c (clear_echo_area_internal): - * minibuf.c (echo_area_append): - * eldap.c (Fldap_open): - * eldap.c (Fldap_search_internal): - * frame-x.c (x_set_frame_text_value): - * frame-x.c (x_set_frame_properties): - * frame-x.c (x_create_widgets): - * redisplay-tty.c (term_get_fkeys_1): - * objects-x.c (x_parse_nearest_color): - * objects-x.c (x_valid_color_name_p): - * objects-x.c (x_initialize_font_instance): - * objects-x.c (x_list_fonts): - * objects-x.c (x_find_charset_font): - * tooltalk.c (Fadd_tooltalk_message_arg): - * tooltalk.c (Fadd_tooltalk_pattern_attribute): - * tooltalk.c (Fadd_tooltalk_pattern_arg): - * process-unix.c (unix_create_process): - * ntproc.c (sys_spawnve): - * sound.c (Fplay_sound_file): - * sound.c (Fplay_sound): - * buffer.c (init_initial_directory): - * buffer.c (init_buffer): - * editfns.c (init_editfns): - * editfns.c (Ftemp_directory): - * editfns.c (Fuser_full_name): - * editfns.c (uncache_home_directory): - * editfns.c (get_home_directory): - * editfns.c (Fuser_home_directory): - * editfns.c (Fformat_time_string): - * editfns.c (Fcurrent_time_string): - * gui-x.c (button_item_to_widget_value): - * database.c (Fopen_database): - * event-Xt.c (x_to_emacs_keysym): - * event-Xt.c (x_event_to_emacs_event): - * event-Xt.c (describe_event_window): - * event-msw.c (mswindows_wnd_proc): - * glyphs-eimage.c (jpeg_instantiate): - * glyphs-eimage.c (gif_instantiate): - * glyphs-eimage.c (png_instantiate): - * glyphs-eimage.c (tiff_instantiate): - * 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_widget_instantiate): - * glyphs-x.c (x_widget_set_property): - * glyphs-x.c (x_widget_property): - * glyphs-x.c (BUILD_GLYPH_INST): - * print.c (write_string_to_stdio_stream): - * print.c (output_string): - * print.c (Falternate_debugging_output): - * print.c (Fexternal_debugging_output): - * glyphs-msw.c (extract_xpm_color_names): - * glyphs-msw.c (mswindows_xpm_instantiate): - * glyphs-msw.c (bmp_instantiate): - * glyphs-msw.c (resource_name_to_resource): - * glyphs-msw.c (mswindows_resource_instantiate): - * glyphs-msw.c (xbm_instantiate_1): - * glyphs-msw.c (mswindows_xbm_instantiate): - * glyphs-msw.c (mswindows_xface_instantiate): - * glyphs-msw.c (mswindows_widget_instantiate): - * glyphs-msw.c (add_tree_item): - * glyphs-msw.c (add_tab_item): - * glyphs-msw.c (mswindows_combo_box_instantiate): - * glyphs-msw.c (mswindows_widget_property): - * glyphs-msw.c (mswindows_combo_box_property): - * glyphs-msw.c (mswindows_widget_set_property): - * console.c (stuff_buffered_input): - * objects-msw.c (mswindows_initialize_color_instance): - * objects-msw.c (mswindows_valid_color_name_p): - * objects-msw.c (mswindows_list_fonts): - * objects-msw.c (mswindows_font_instance_truename): - * bytecode.c (optimize_compiled_function): - * select-x.c (symbol_to_x_atom): - * select-x.c (x_atom_to_symbol): - * select-x.c (hack_motif_clipboard_selection): - * select-x.c (selection_data_to_lisp_data): - * select-x.c (lisp_data_to_selection_data): - * select-x.c (Fx_get_cutbuffer_internal): - * select-x.c (Fx_store_cutbuffer_internal): - * buffer.h (TO_EXTERNAL_FORMAT): New function. - * buffer.h (TO_INTERNAL_FORMAT): New function. - * emacs.c (make_arg_list_1): - * emacs.c (make_argc_argv): - * emacs.c (main_1): - * emacs.c (Fdump_emacs): - * emacs.c (split_string_by_emchar_1): - * file-coding.h: - * lisp.h: - * lstream.h: - * symsinit.h: - * device-x.c (x_init_device): - * device-x.c (Fx_valid_keysym_name_p): - * device-x.c (Fx_get_font_path): - * device-x.c (Fx_set_font_path): - * glyphs.c (bitmap_to_lisp_data): - * glyphs.c (pixmap_to_lisp_data): - * alloc.c (make_ext_string): Use coding system arguments. Update - all callers. - * alloc.c (build_string): - * callproc.c (child_setup): - * callproc.c (init_callproc): - * fileio.c (lisp_strerror): - * fileio.c (directory_file_name): - * fileio.c (Fexpand_file_name): - * fileio.c (Ffile_truename): - * fileio.c (Fsysnetunam): - * fileio.c (Fdo_auto_save): - * sysdep.c (sys_readdir): - * tests.c: New file. Allow adding C tests. - Replace GET_* macros with a more comprehensible and flexible - interface, TO_INTERNAL_FORMAT() and TO_EXTERNAL_FORMAT(). - Modify all calls. - Any coding system can be used to do format conversion. - Eliminate enum external_data_format. - Eliminate convert_to_external_format. - Eliminate convert_to_internal_format. - Make sure file-name, keyboard, terminal, and ctext are always - defined as coding systems or aliases. Make - 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. - * file-coding.c (append_suffix_to_symbol): New function. - * file-coding.c (dangling_coding_system_alias_p): New function. - * file-coding.c (Ffind_coding_system): - * file-coding.c (Fcopy_coding_system): - * file-coding.c (encode_coding_no_conversion): - * file-coding.c (syms_of_file_coding): - * file-coding.c (vars_of_file_coding): - Rewrite coding system alias code. - Allow nested aliases, like symbolic links. - Allow redefinition of coding system aliases. - Prevent existence of dangling coding system aliases. - - * dired.c (Fuser_name_completion_1): - * dired.c (Fuser_name_all_completions): - A crash would happen if user did QUIT in the middle of building - user_name_cache. Remove redundant code in mainline and unwind_protect. - - * lisp.h: - * dynarr.c (Dynarr_min_size): Make static. Increase value to 8. - - * lstream.c (make_fixed_buffer_input_stream): Take a void *, not - an unsigned char *. Update all callers. - -2000-01-26 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * callproc.c (Fcall_process_internal): Ignore Vbinary-process_output. - -2000-01-25 Martin Buchholz <martin@xemacs.org> - - * elhash.c (hentry_description): Use more portable definition. - (resize_hash_table): Initialize new hentries using - xnew_array_and_zero, thereby simplifying the code. - - * mule-charset.c (make_charset): Make sure entire object is - intialized, to avoid Purify warnings. - - * alloc.c (resize_string): Fix unlikely crash with big strings. - -2000-01-24 Martin Buchholz <martin@xemacs.org> - - * realpath.c (xrealpath): - Don't call getwd(). - -2000-01-25 Martin Buchholz <martin@xemacs.org> - - * lread.c (read_bit_vector): Fix memory leak reading literal bit vectors. - -1999-12-28 Max Matveev <max@melbourne.sgi.com> - - * unexelfsgi.c (unexec): Change the way we decide which segment - should be extended. - - Assumption that .bss section should be outside the PT_LOADable - segment. On IRIX with version 6.2 and above, .bss (or .sbss, if - it's present) is inside the 'data' segment. This would fail the - test which was used to find a segment to grow and cover new - heap. Instead of this assumption, I created another one - on IRIX - the segment to grow should start below .bss and it's address - should extent above the end of .bss. Once this segment is - identified, it's grown to accommodate the new heap and new - zero-length .bss section is added at the end of .data2. - -2000-01-25 Martin Buchholz <martin@xemacs.org> - - * eval.c (Feval): Wrong number of arguments should use original - function, not the indirect_function version of it. - -2000-01-24 Yoshiki Hayashi <yoshiki@xemacs.org> - - * glyphs-x.c (x_button_instantiate): Don't add image if - it is not a pixmap. - (x_locate_pixmap_file): Call Fexpand_file_name when file name - is relative. - -2000-01-21 Yoshiki Hayashi <yoshiki@xemacs.org> - - * symeval.h (DEFVAR_LISP_MAGIC): Remove semicolon after macro - declaration. - (DEFVAR_INT_MAGIC): Ditto. - (DEFVAR_BOOL_MAGIC): Ditto. - * glyphs.h: Reindent backslash. - -2000-01-24 Martin Buchholz <martin@xemacs.org> - - * glyphs-widget.c (layout_query_geometry): - (layout_layout): Use correct types for gheight, gwidth. - -2000-01-24 Martin Buchholz <martin@xemacs.org> - - * EmacsManager.c (QueryGeometry): Purified. - -2000-01-23 Martin Buchholz <martin@xemacs.org> - - * alloc.c (make_float): Make sure entire object is intialized, to - avoid Purify warnings. - (pdump_register_sub): Remove useless assignment. - (pdump): Use xmalloc, not malloc. - (pdump_load): Use xmalloc, not malloc. - -2000-01-23 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * callproc.c: - * dired-msw.c: * fileio.c: - * process-nt.c: - * redisplay-msw.c: - * sysdep.c: Removed redundant #include <windows.h> - -2000-01-22 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * 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. - - * device-msw.c (msprinter_device_system_metrics): Implemented. - (mswindows_device_system_metrics): Added 'device-dpi property. - - * device.c: (Fdevice_printer_p): Added. - Added 'offset-workspace device metric. - - * console.h (device_metrics): Declared DM_offset_workspace. - -2000-01-23 Martin Buchholz <martin@xemacs.org> - - * fileio.c (Ffile_truename): Remove pointless and confusing - initialization of elen. - - * glyphs-widget.c: Compiler warning fixes. - -2000-01-23 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * process.h (PROCESS_LIVE_P): Modify to take a Lisp_Process - instead of a Lisp_Object as argument to make it consistent with - the other LIVE_P macros. - (CHECK_LIVE_PROCESS): New macro. - - * process.c: Declare Qprocess_live_p. - (Fprocess_live_p): New function. - (create_process): Use PROCESS_LIVE_P. - (read_process_output): Ditto. - (set_process_filter): Ditto. - (Fdelete_process): Ditto. - (kill_buffer_processes): Ditto - (process_send_signal): Use CHECK_LIVE_PROCESS. - (Fprocess_input_coding_system): Check whether process is still - alive (fix PR#1061). - (Fprocess_output_coding_system): Ditto. - (Fprocess_coding_system): Ditto. - (Fset_process_input_coding_system): Ditto. - (Fset_process_output_coding_system): Ditto. - -2000-01-23 Andy Piper <andy@xemacs.org> - - * glyphs.h (struct Lisp_Image_Instance): change format by unifying - layout and widget. - - * glyphs.c (mark_image_instance): take into account changed - image_instance format. - (image_instance_equal): ditto. - (image_instance_hash): ditto. - - * glyphs-widget.c (widget_instantiate): Incorporate layout - instantiation here. Delay layout of the layout until later. - (layout_instantiate): deleted. - (layout_query_geometry): new function. get the geometry of a - layout. - (layout_layout): layout a layout dynamically. - (image_instantiator_widget): New function - splitting up - image_instantiator_format_create_glyphs_widget for netwinder - compilation. - (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): ditto. - (image_instantiator_format_create_glyphs_widget): Call preceeding - functions. - -2000-01-22 Martin Buchholz <martin@xemacs.org> - - * process.c (Fset_process_coding_system): - * 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): - (Fwrite_region_internal): - * emacs.c: - * sysdep.c: - * getloadavg.c: - * systty.h: - Remove vestigial APOLLO-conditional code. - -2000-01-21 Martin Buchholz <martin@xemacs.org> - - * getpagesize.h: Add guard macros. - * libsst.h: Add guard macros. - * libst.h: Add guard macros. - * line-number.h: Add guard macros. - * ndir.h: Add guard macros. - * sysfloat.h: Add guard macros. - * sysfile.h: Add guard macros. - * sysproc.h: Add guard macros. - * syswait.h: Add guard macros. - * xintrinsic.h: Add guard macros. - * xintrinsicp.h: Add guard macros. - * xmmanager.h: Add guard macros. - * xmmanagerp.h: Add guard macros. - * xmprimitive.h: Add guard macros. - * xmu.h: Add guard macros. - * gpmevent.h: Add copyright statement. Add guard macros. - * miscplay.h: Add guard macros. - * *.h: Use consistent C-standards-approved guard macro names. - - * 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. - - * config.h.in (type_checking_assert): Added. - (bufpos_checking_assert): Added. - -2000-01-21 Martin Buchholz <martin@xemacs.org> - - * alloc.c: Harmless pdump changes. - - Use countof(). - - spell alignment correctly. - * sysdep.c: Use countof() - -2000-01-20 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * console.c (create_console): Use CONMETH_OR_GIVEN when calling - initially_selected_for_input() console method, default to 0. - (semi_canonicalize_console_connection): Try to delegate to - canonicalize_console_connection if no such console method. - (canonicalize_console_connection): Vice versa. - (print_console): Do not print nil connection. - - * console.h (XDEVIMPF_IS_A_PRINTER): Added. - (XDEVIMPF_NO_AUTO_REDISPLAY): Added. - (XDEVIMPF_FRAMELESS_OK): Added. - (CONSOLE_INHERITS_METHOD): Added. - - * console-msw.c (mswindows_canonicalize_console_connection): - Added. - (mswindows_canonicalize_device_connection): Added. - - * console-msw.h (struct msprinter_device): Added this struct and - accessor macros. - (mswindows_device): Made fontlist a lisp object. - - * device.c (semi_canonicalize_device_connection): Try to delegate - to canonicalize_device_connection if no such console method. - (canonicalize_device_connection): Vice versa. - (print_device): Do not print nil connection. - - * device-msw.c (mswindows_init_device): Call InitCommonControls - when have widgets. - (mswindows_delete_device): Removed fontlist deallocation. - (mswindows_mark_device): Added. - - * events.c (event_equal): Added abort() at unreached code. - (event_hash): Ditto. - - * faces.c (complex_vars_of_faces): Added Qmsprinter to the list of - fallback tags of Windows devices. - - * general.c (syms_of_general): Initialized Qmsprinter. - - * gutter.c (complex_vars_of_gutters): Added Qmsprinter to the list - of fallback tags of Windows devices. - - * lisp.h: Declared Qmsprinter. - - * objects-msw.c (font_enum_callback_2): Rewrote to build lisp list - of strings. - (mswindows_list_fonts): Ditto. - (mswindows_enumerate_fonts): Removed dependency on XDEVICE, so - that it can be used by both mswindows and msprinter devices. - (initialize_font_instance): Added. - (mswindows_initialize_font_instance): Use it. - (msprinter_initialize_font_instance): Added. - - * redisplay.c (redisplay_device): Added the parameter AUTOMATIC - and implementation flags check. - (redisplay_without_hooks): Changed the call to the above. - (Fredraw_device): Ditto. - (Fredisplay_device): Ditto. - - * redisplay-msw.c (get_frame_dc): Implemented. - (get_frame_compdc): Implemented. - (many functions): Use the two functions above to get device - contexts, ether for a window or a printer. - -2000-01-21 Olivier Galibert <galibert@pobox.com> - - * symbols.c (reinit_symbols_once_early): Put Qzero/Qnull_pointer - initialization here. - (init_symbols_once_early): Call it. - * emacs.c (main_1): Call it. - * symsinit.h: Declare it. - -2000-01-19 Olivier Galibert <galibert@pobox.com> - - * alloc.c: Use a lrecord_header * in the backtrace instead of a - Lisp_Object. - (pdump_backtrace): Ditto. - (pdump_register_object): Ditto. Cleanup use of the pointers. - (pdump_get_entry): Abort if trying to register a null pointer. - (pdump_dump_data): Cleanup types when relocating. - (pdump_dump_staticvec): Cleanup types w.r.t the reloc table. - (pdump_dump_rtables): Remove bad casts. - (pdump_load): Cleanup relocation w.r.t union type. Use a - Lisp_Object instead of a EMACS_INT for the hashtable - reorganization. - -2000-01-20 Martin Buchholz <martin@xemacs.org> - - * emacs.c (main_1): Rearrange morass of #ifdef's for correctness. - - * callproc.c (call_process_cleanup): Isolate WINDOWSNT code for clarity. - - * EmacsManager.c (GeometryManager): Avoid use of CPP for clarity. - - * *.[ch]: global-replace 's/_of_xselect/_of_select_x/g' *.[ch] - -2000-01-17 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * faces.h (FACE_STRIKETHRU_P): Added. - - * glyphs-msw.c (mswindows_widget_hfont): Implemented, to take care - of font variants. - - * redisplay-msw.c (mswindows_apply_face_effects): Deleted. - (mswindows_set_dc_font): New function, aware of font variants, - separated from mswindows_update_dc. - - * objects-msw.h (struct mswindows_font_instance_data): Added - definition. - - * objects-msw.c (mswindows_finalize_font_instance): Delete all - cached fonts and the data structure. - (mswindows_initialize_font_instance): Added creation of font data - structure. - (mswindows_print_font_instance): Print at least something. - (mswindows_create_font_variant): Implemented. - (mswindows_get_hfont): Implemented. - -2000-01-13 Fabrice Popineau <Fabrice.Popineau@supelec.fr> - - * dired-msw.c: permute "sysdir.h" with "sysfile.h" because of - prototyping problem with msvc. - - * emacs.c (main_1): added syms_of_gui_mswindows() call - - * gui-msw.c: added "mswindows-shell-execute" lisp subr and - syms_of_gui_mswindows() function - - * symsinit.h: added the prototype for syms_of_gui_mswindows() - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.27 is released. - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * glyphs-eimage.c (struct tiff_error_struct): - (tiff_error_func): - (tiff_warning_func): - #if HAVE_VSNPRINTF ==> #ifdef HAVE_VSNPRINTF - - * unexmips.c: - * unexhp9k3.c: - * unexfreebsd.c: - * unexec.c: Remove vestigial Lucid C code. - * unexalpha.c: - * unexaix.c: - * termcap.c: - * libsst.c: Ansify. - Remove declarations of errno and strerror(). - - * eval.c (Fbacktrace): Small Purify-cation. Fix docstring. - - * .dbxrc (run-temacs): Use the horrible ${1+"$@"} instead of "$@". - -2000-01-16 Martin Buchholz <martin@xemacs.org> - - * mule-charset.c (Fchar_octet): Resurrect from earlier in 1999. - Optimize. - -2000-01-14 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * md5.c: - * file-coding.c: - * file-coding.h: - Change enum eol_type to eol_type_t. - -2000-01-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * gui.c (get_gui_callback): Check cons before accessing car. - -2000-01-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * specifier.h (XSPECIFIER_TYPE): Add error checking version. - (XSETSPECIFIER_TYPE): Ditto. - -2000-01-17 Didier Verna <didier@xemacs.org> - - * redisplay.c (generate_fstring_runes): compute string size in - characters, not bytes. - -2000-01-09 Hrvoje Niksic <hniksic@iskon.hr> - - * window.c (Fwindow_minibuffer_p): Make WINDOW optional. - -2000-01-14 Hrvoje Niksic <hniksic@iskon.hr> - - * print.c (print_error_message): Call print_prepare(). - -2000-01-14 Martin Buchholz <martin@xemacs.org> - - * .dbxrc: Renamed from dbxrc. - - * events.c (event_to_character): - Use `assert (foo)' instead of `if (!foo) abort()' - - * .gdbinit (xtype): Add documentation. - * .gdbinit (check-temacs): New function. - * .gdbinit (check-xemacs): New function. - * dbxrc (check-xemacs): New function. - * dbxrc (check-xemacs): New function. - -2000-01-14 Andy Piper <andy@xemacs.org> - - * glyphs-widget.c (widget_query_geometry): Make sure that we - calculate default dimensions correctly. - -2000-01-13 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * symsinit.h: Added prototype for reinit_vars_of_frame_mswindows. - - * event-msw.c (vars_of_event_mswindows): Fixed a mistyped - pdump_wire'd variable. - - * emacs.c: (main_1): Conditionalized calls to - reinit_vars_of_scrollbar_x and reinit_vars_of_module. - -2000-01-13 Martin Buchholz <martin@xemacs.org> - - * window.c (Fset_window_configuration): - * sysdep.c (_start): - * input-method-motif.c (res): - * event-Xt.c (Xt_process_to_emacs_event): - Simple compiler warning fixes. - - * bytecode.c (funcall_compiled_function): Use the original - function symbol on the backtrace list in preference to the - compiled_function object in error messages. - -2000-01-13 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (update_widget_face): Make sure we update the widget - background as well as foreground. - -2000-01-13 Andy Piper <andy@xemacs.org> - - * glyphs.h (struct Lisp_Image_Instance): Move justify and orient - fields to subwindow. - (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY): new macro. - (XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY): ditto. - (IMAGE_INSTANCE_SUBWINDOW_ORIENT): ditto. - (XIMAGE_INSTANCE_SUBWINDOW_ORIENT): ditto. - - * glyphs-widget.c (check_valid_tab_orientation): new function. - (initialize_widget_image_instance): zero orientation and - justification. - (widget_instantiate): pick up orientation. - (tab_control_query_geometry): return appropriate values for - vertical tabs. - - * glyphs-msw.c: (mswindows_tab_control_instantiate): assign - appropriate creation flags for left, right and bottom tabs. - - * s/cygwin32.h: add tab definitions. - -2000-01-12 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * glyphs-msw.c (mswindows_unmap_subwindow): Set focus back to the - frame upon hiding a subwindow. - (mswindows_button_instantiate): Changed the push button style to - BS_PUSHBUTTON. - (mswindows_button_instantiate): Removed button BS_NOTIFY - style. - (mswindows_button_instantiate): Removed redundant check for - a disabled gui item. - (mswindows_button_instantiate): Made use of WS_TABSTOP - consistent: "operable" controls (edit, button, tree, scroll) have - this style, "display-only" ones (static, progress gauge) do - not. This style is currently ignored by XEmacs though. Also, - removed the WS_EX_CONTROLPARENT style - it is not for children, - it is for their parents! - (mswindows_edit_field_instantiate): Ditto. - (mswindows_progress_gauge_instantiate): Ditto. - (mswindows_tree_view_instantiate): Ditto. - (mswindows_tab_control_instantiate): Ditto. - (mswindows_scrollbar_instantiate): Ditto. - (mswindows_combo_box_instantiate): Ditto. - (mswindows_widget_instantiate): Added the WS_EX_CONTROLPARENT - style to the "clip" window. - (mswindows_button_instantiate): Removed compilation warning by - equally typing terms of the ?: operator. - -2000-01-12 Didier Verna <didier@xemacs.org> - - * redisplay.c (generate_fstring_runes): new parameter holding the - last modeline-format extent. - (add_glyph_to_fstring_db_runes): new parameter holding the glyph - extent, fill the glyph block with it. - (generate_fstring_runes): handle these parameters. - (generate_formatted_string_db): ditto. - - * keymap.c (get_relevant_keymaps): retreive the keymaps from the - glyphs'extents in the modeline. - -1999-01-11 Mike Woolley <mike@bulsara.com> - - * ntheap.c: Reduced the reserved heap space from 1Gb down to - 256Mb, as a workaround for the non-starting problem many people - have experienced. - -2000-01-06 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * console-tty.c (Fset_console_tty_output_coding_system): - Force redrawing tty frame. - -2000-01-10 Didier Verna <didier@xemacs.org> - - * redisplay.c (generate_fstring_runes): fix size computation bug. - -2000-01-09 William M. Perry <wmperry@aventail.com> - - * gpmevent.c: (gpm_next_event_cb): Don't return value from void function. - -2000-01-09 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c: index -> i to avoid shadows. - (xbm_create_bitmap_from_data): make static. - (check_valid_string_or_int): deleted. - (mswindows_control_wnd_proc): message -> msg to avoid shadows. - - * glyphs-x.c (x_update_subwindow): remove unused args. - - * glyphs.c (glyph_image_instance): return the thing. Don't set the - back pointer - this is done in allocate_image_instance. - (query_string_font): return Qnil to make the compiler happy. - (unmap_subwindow): set to ~0 to make the compiler happy. - (glyph_query_geometry): comment out until used. - (glyph_layout): ditto. - -2000-01-09 Hrvoje Niksic <hniksic@iskon.hr> - - * insdel.c (signal_after_change): Remove extraneous unbind_to(). + * lread.c: + * xselect.c: + Change empty docstrings into no doc strings at all. + Fix bogus FSF-format docstrings. + + * extents.c: + Standardize docstrings. + + * floatfns.c: + Explain problems with matherr. + + * glyphs.c: make DEFUNs etags-readable, i.e. single-line + + * syssignal.h: + if BROKEN_SIGIO, then SIGIO wants to be undefined. + if SIGIO and not SIGPOLL, SIGPOLL wants to be SIGIO.\ + Fix the weird resultant interaction (causes windows problems) + + * gdbinit: + * dbxrc: + Take new EMACSBOOTSTRAPLOADPATH into account. + Update documentation strings + + * Makefile.in.in: + - Adjust for luser's CDPATH being set to something weird. + - Take into account bash 2.02's tendency to print the cwd when + using CDPATH. Always use `cd ./foo' instead of `cd foo'. + - fix the run-temacs target to use $(DUMPENV) + - fix the run-puremacs target to use $(DUMPENV) + - fix the `depend' target to properly $(RM) the right files + - Generate a better TAGS file for XEmacs' lisp code using + hand-crafted regexps. + - Use standard coding conventions for modules/Makefile.in + +1998-05-12 Didier Verna <verna@inf.enst.fr> + + * redisplay.c: removed the scrolling modeline code that didn't + make it for 21.0. To be continued ... + +1998-05-13 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> + + * emacs.c (Fdecode_path_internal): Removed bogus handling of nil + and empty string inputs. + +1998-05-12 Hrvoje Niksic <hniksic@srce.hr> + + * redisplay-x.c (x_output_vertical_divider): Fixed typo. + +1998-05-10 Oliver Graf <ograf@fga.de> + + * event-stream.c (enqueue_misc_user_event_pos): created + * lisp.h (enqueue_misc_user_event_pos): prototype added + * frame-x.c (x_cde_transfer_callback): debug code plus API changes + * emacs.c: call vars_of_dragdrop + * dragdrop.c (vars_of_dragdrop): provide dragdrop + +1998-05-11 Oliver Graf <ograf@fga.de> + + * frame-x.c (x_cde_transfer_callback): return at correct pos + * event-Xt.c (x_event_to_emacs_event): changed format of drop + object for MIME (see comment in dragdrop.c) + * dragdrop.c: API change documented in comment + removed provide of dragdrop [is provided by dragdrop.el] + +1998-05-12 Kirill M. Katsnelson <kkm@kis.ru> + + * window.c (window_needs_vertical_divider): Enable vertical + dividers for every non-rightmost window. + (window_left_gutter_width): Left gutter consists of mythical + toolbar and a virtual scrollbar. + (window_right_gutter_width): The right one may have a divider + also. + + * scrollbar.c (update_scrollbar_instance): Position vertical + scrollbar left to divider if the latter present. + + * redisplay.h: Declared OVER_DIVIER constant. + + * redisplay.c (pixel_to_glyph_translation): Handle OVER_DIVIDER + case. + + * redisplay-x.c (x_output_vertical_divider): Output divider along + the right side of the window, down to window bottom. Swapped + foreground and background colors so it is visible by default. + + * redisplay-tty.c (tty_output_vertical_divider): Uncondiionally + stick the divider to the right window side. + + * redisplay-msw.c (mswindows_redisplay_deadbox_maybe): Fixed + deadbox painting. + (mswindows_divider_width): Ask system for user preferred value. + (mswindows_output_vertical_divider): Always output the divider on + the right side of a window, down to bottom. + + * keymap.c (get_relevant_keymaps): Route mouse button events which + happened over a window divider through window-divider-map. + (Fkey_binding): Documented that in the docstring. + Defined the variable Vwindow_divider_map. + + * events.c (Fevent_over_divider_p): Added this function. + + * events.h: EXFUNed it. + +1998-05-12 Kirill M. Katsnelson <kkm@kis.ru> + + * toolbar.c (update_frame_toolbars): Re-layout frame windows if + toolbar geometry is suspected to change. + +1998-05-11 Jonathan Harris <jhar@tardis.ed.ac.uk> + + * src/device-msw.c + * src/event-msw.c + Condition dnd and dde code on HAVE_DRAGNDROP. + +1998-05-11 Hrvoje Niksic <hniksic@srce.hr> + + * events.c (format_event_object): Print space as SPC etc. + +1998-05-11 Hrvoje Niksic <hniksic@srce.hr> + + * print.c (print_internal): In the default case, abort() if + ERROR_CHECK_TYPECHECK. + + * fileio.c (Fmake_temp_name): Doc fix. + +1998-05-10 Hrvoje Niksic <hniksic@srce.hr> + + * xgccache.c (describe_gc_cache): Define only if DEBUG_XEMACS. + + * undo.c (Fprimitive_undo): Fixed typo. + +1998-05-11 Hrvoje Niksic <hniksic@srce.hr> + + * fns.c (concat): Signal error on integer argument. + +1998-05-10 Kirill M. Katsnelson <kkm@kis.ru> + + * console.h (device_metrics): Prefixed each constatnt with DM_ + + * device.c: (Fdevice_system_metric): Renamed so from plural form + (metrics); Changed parameters order and added DEFAULT parameter; + Unabbreviated some metric constants; Fixed and untabified doc string. + (Fdevice_system_metrics): Added. Returns a plist of all provided + metrics. + + * device-msw.c (mswindows_device_system_metrics): Renamed + device_metrics enum constants. + Return Qunbound instead of Qnil. + + * device-tty.c (tty_device_system_metrics): Ditto. + + * device-x.c (x_device_system_metrics): Ditto. + +1998-05-10 Andy Piper <andyp@parallax.co.uk> + + * redisplay-msw.c: implement background pixmaps (really!). Make + sure bg color is transparent if we have bg pmaps. + * (mswindows_output_string) (mswindows_clear_region): output bg + pmap if required. + * (mswindows_output_dibitmap_region): new function. + * (mswindows_output_dibitmap): output offset pixmaps, blt masks in + the bg color rather than transparently. + + * toolbar-msw.c: use masks if they exist. + + * glyphs-msw.c: set up masks correctly. + + * event-msw.c: typedef SOCKET if cygwin and not msg select(). + +1998-05-10 Hrvoje Niksic <hniksic@srce.hr> + + * regex.c (re_match_2_internal): Check for quit. + +1998-05-10 Hrvoje Niksic <hniksic@srce.hr> + + * frame.c (Ffocus_frame): New function. + diff -r 12e008d41344 -r 697ef44129c6 src/ChangeLog.1 --- a/src/ChangeLog.1 Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ChangeLog.1 Mon Aug 13 11:20:41 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 <didier@xemacs.org> + Spare parts supplied by Didier Verna <verna@inf.enst.fr> * 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 <kkm@kis.ru> - * 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 <specifier>_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 <martin@xemacs.org> - * 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 <steve@altair.xemacs.org> @@ -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 <hniksic@srce.hr> @@ -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 <martin@xemacs.org> - * 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 <andyp@parallax.co.uk> @@ -874,10 +874,10 @@ 1998-04-23 Hrvoje Niksic <hniksic@srce.hr> - * 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 <steve@altair.xemacs.org> @@ -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 <steve@altair.xemacs.org> @@ -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 <hniksic@srce.hr> @@ -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 <galibert@pobox.com> @@ -1359,7 +1359,7 @@ 1998-04-13 Greg Klanderman <greg@alphatech.com> - * 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 <kkm@kis.ru> @@ -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 <martin@xemacs.org> - * 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 <martin@xemacs.org> - * 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 <martin@xemacs.org> - * 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 <martin@xemacs.org> - * 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 <martin@xemacs.org> - * 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 <martin@xemacs.org> @@ -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 <martin@xemacs.org> - * 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 <martin@xemacs.org> - * 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 <martin@xemacs.org> * 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 <steve@altair.xemacs.org> * 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 <kyle_jones@wonderworks.com> - * 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 <kkm@kis.ru> * 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 <jareth@camelot-soft.com> - * 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 <kkm@kis.ru> - * 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 <andyp@parallax.co.uk> * configure.in: compile in glyphs-msw.o when compiling fopr mswindows. - + Mon Mar 23 22:14:12 1998 Andy Piper <andyp@parallax.co.uk> * 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 <kyle_jones@wonderworks.com> - * 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 <jareth@camelot-soft.com> * 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 <kyle_jones@wonderworks.com> - * 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 <kyle_jones@wonderworks.com> - * 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 <Aki.Vehtari@hut.fi> @@ -3451,11 +3451,11 @@ * s/sol2.h: define HAVE_GETLOADAVG for late edition Solaris From Georg Nikodym <georgn@Canada.Sun.COM> -1998-02-24 Didier Verna <didier@xemacs.org> +1998-02-24 Didier Verna <verna@inf.enst.fr> * 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 <aj@arthur.rhein-neckar.de> - + 1998-02-18 SL Baur <steve@altair.xemacs.org> * 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 <didier@xemacs.org> +1998-02-18 Didier Verna <verna@inf.enst.fr> * 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 <didier@xemacs.org> +1998-02-18 Didier Verna <verna@inf.enst.fr> * 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 ammount. (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 ammount. (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 <martin@xemacs.org> - * 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 <andyp@parallax.co.uk> * Makefile.in.in: add support for sheap-adjust.h generation for - static heap. + static heap. Wed Jan 28 13:41:22 1998 Andy Piper <andyp@parallax.co.uk> @@ -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 <hniksic@srce.hr> * 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 <Aki.Vehtari@hut.fi> * src/symbols.c (Fsetq_default): Fix docstring. - From Didier Verna <didier@xemacs.org> + From Didier Verna <verna@inf.enst.fr> 1998-01-07 Kirill M. Katsnelson <kkm@kis.ru> @@ -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 <kkm@kis.ru> - * 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 <steve@altair.xemacs.org> @@ -4362,7 +4362,7 @@ 1997-12-29 Kirill M. Katsnelson <kkm@kis.ru> - * 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 <kkm@kis.ru> * 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 @@ -4458,7 +4458,7 @@ 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. + * Most of the above touched files: Eliminated compiler warnings. 1997-12-18 Hrvoje Niksic <hniksic@srce.hr> @@ -4471,7 +4471,7 @@ 1997-12-26 P. E. Jareth Hein <jareth@camelot-soft.com> - * 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 <steve@altair.xemacs.org> @@ -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 <jsparkes@internetivity.com (Jeff Sparkes)> - +1997-12-16 <jsparkes@internetivity.com (Jeff Sparkes)> + * 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 <kkm@kis.ru> * msw-proc.c: Minor bug in the middle button emulation code @@ -4706,7 +4706,7 @@ 1997-12-12 SL Baur <steve@altair.xemacs.org> - * 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 <didier@xemacs.org> and + Suggested by Didier Verna <verna@inf.enst.fr> and Martin Buchholz <martin@xemacs.org> - + 1997-12-10 Karl M. Hegbloom <karlheg@bittersweet.inetarena.com> * config.h.in: #undef MAGICK_HEADERS_ARE_UNDER_X11 @@ -4902,11 +4902,11 @@ set the correct window size. 1997-12-04 Jeff Sparkes <jsparkes@internetivity.com> - + * 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 <jhar@tardis.ed.ac.uk> * 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 <jareth@camelot-soft.com> - + * 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 <marcpa@cam.org> - * 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 <jhar@tardis.ed.ac.uk> @@ -5199,7 +5199,7 @@ * callproc.c (Fcall_process_internal): Close fd_error. -1997-11-19 Didier Verna <didier@xemacs.org> +1997-11-19 Didier Verna <verna@inf.enst.fr> * 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 <hniksic@srce.hr> - * 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 <aj@arthur.rhein-neckar.de> - * 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 <aj@arthur.rhein-neckar.de> * 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 <aj@arthur.rhein-neckar.de> - * sysdep.c: - * getloadavg.c: + * sysdep.c: + * getloadavg.c: * malloc.c: Remove old VMS code. 1997-11-02 Hrvoje Niksic <hniksic@srce.hr> @@ -5803,12 +5803,12 @@ 1997-10-31 Kyle Jones <kyle_jones@wonderworks.com> - * 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 <steve@altair.xemacs.org> - * 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 <kyle_jones@wonderworks.com> @@ -5824,7 +5824,7 @@ 1997-10-28 Kyle Jones <kyle_jones@wonderworks.com> - * 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 <kyle_jones@wonderworks.com> @@ -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 <tma@nettest.dk> @@ -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 <vroonhof@math.ethz.ch> - +1997-10-20 Jan Vroonhof <vroonhof@math.ethz.ch> + * 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 <kyle_jones@wonderworks.com> * 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 <steve@altair.xemacs.org> - * 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 <kyle_jones@wonderworks.com> * 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 <kyle_jones@wonderworks.com> @@ -6458,7 +6458,7 @@ 1997-09-26 Hrvoje Niksic <hniksic@srce.hr> * 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 <steve@altair.xemacs.org> @@ -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 <vroonhof@math.ethz.ch> - + * 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 <petersen@kurims.kyoto-u.ac.jp> - * 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 <steve@altair.xemacs.org> @@ -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 <hniksic@srce.hr> @@ -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 <hniksic@srce.hr> - + * 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 <mrb@eng.sun.com> - * 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 <steve@altair.xemacs.org> @@ -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 <kyle_jones@wonderworks.com> @@ -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 <kyle_jones@wonderworks.com> * 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 <davidh@wr.com.au> - + Sat Jun 7 22:00:54 1997 Kyle Jones <kyle_jones@wonderworks.com> * device-x.c (x_delete_device): @@ -7130,7 +7130,7 @@ * frame.c (Fmake_frame): Correct checking of first_frame_on_device. From Hrvoje Niksic <hniksic@srce.hr> - + 1997-06-04 Steven L Baur <steve@altair.xemacs.org> * device.c (delete_deviceless_console): New function. @@ -7170,7 +7170,7 @@ Sat May 31 19:59:49 1997 Kyle Jones <kyle_jones@wonderworks.com> * 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 <steve@altair.xemacs.org> @@ -7233,7 +7233,7 @@ (Fset_recent_keys_ring_size): New function. Modifies the above. From Hrvoje Niksic <hniksic@srce.hr> - + * 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 <kyle@crystal.wonderworks.com> * 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 <steve@altair.xemacs.org> @@ -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 <kyle@crystal.WonderWorks.COM> @@ -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 <steve@altair.xemacs.org> - * 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 <steve@altair.xemacs.org> @@ -7613,7 +7613,7 @@ Mon Mar 24 12:40:56 1997 David Moore <dmoore@ucsd.edu> * 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,7 +7647,7 @@ (Fset_file_modes): ditto (Ffile_newer_than_file_p): ditto (Fset_visited_file_modtime): ditto - + *fileio.c (Ffile_truename): Unneccessary GC protection. (Fdelete_directory): Fix broken caller-must-GC-protect call. @@ -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 <t.cholewo@ieee.org> - * 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 <steve@altair.xemacs.org> @@ -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 <mrb@eng.sun.com> * scrollbar.c (update_scrollbar_instance): Fix for @@ -8312,3 +8312,4 @@ Wed Dec 4 23:38:03 1996 Steven L Baur <steve@altair.xemacs.org> * redisplay.c: Allow column numbers in modeline to start from 1. + diff -r 12e008d41344 -r 697ef44129c6 src/ChangeLog.2 --- a/src/ChangeLog.2 Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8737 +0,0 @@ -2000-01-09 Norbert Koch <norbert@s.netic.de> - - * sysfile.h: Remove definition of HAVE_FSYNC. It's tested for - in configure. - -2000-01-09 Martin Buchholz <martin@xemacs.org> - - * 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): - (verify_string_chars_integrity): - (compact_string_chars): Now only called for small strings. - (sweep_strings): - String allocation rewrite. - Properly handle resizing big strings. - Fixes crash when evaluating: - (aset (make-string 9003 ??) 1 (make-char 'latin-iso8859-1 57)) - Use consistent coding convention. - Never use xfree_1() directly. - General cleanup. - (CHARS_TO_STRING_CHAR): Remove. No longer needed. - Big strings had unused space at beginning. - - * scrollbar.c (specifier_vars_of_scrollbar): - * scrollbar.c (complex_vars_of_scrollbar): - * gutter.c (specifier_vars_of_gutter): - * menubar.c (specifier_vars_of_menubar): - * toolbar.c (specifier_vars_of_toolbar): - * glyphs.c (specifier_vars_of_glyphs): - * redisplay.c (specifier_vars_of_redisplay): - * window.c (specifier_vars_of_window): - * lisp.h (slot_offset): Remove slot_offset. - Replace all calls to `slot_offset' with the standard name, `offsetof'. - - * menubar-x.c (compute_menubar_data): - Remove Fset_buffer(), always called by unwind_protect. - * menubar-x.c (menu_item_descriptor_to_widget_value_1): Fiddling. - * menubar-x.c (set_frame_menubar): comment fix. - - * keymap.c (lookup_keys): Remove extra parens. - * keymap.c (lookup_events): Remove extra parens. - - * dbxrc (run-temacs): Allow function to take arguments. - - * Makefile.in.in (PURIFY_FLAGS): No longer need pointer-mask. - -2000-01-08 Andy Piper <andy@xemacs.org> - - * event-msw.c (mswindows_wnd_proc): don't need to check for widget - face anymore. - - * frame.c (change_frame_size_1): use new glyph_* signatures. - (frame_conversion_internal): ditto. - - * toolbar-x.c (x_get_button_size): Use modified glyph_* - signatures. - - * redisplay.c (add_glyph_rune): Use modified glyph_* signatures. - (add_glyph_rune): dittto. - (add_margin_runes): ditto. - (create_left_glyph_block): ditto. - (create_right_glyph_block): ditto. - (redisplay_window): ditto. - - * redisplay-output.c (redisplay_output_layout): Use modified - glyph_* signatures. - - * glyphs.h: (struct image_instantiator_methods): change signature - of query_geometry and layout. - (struct Lisp_Image_Instance): Clean up fields for dynamic geometry - calculations. - (struct expose_ignore): change field types. - (struct subwindow_cachel): ditto. declare new functions and - accessor macros. - - * glyphs.c: (instantiate_image_instantiator): assign glyph when - creating the image instance. - (image_instance_hash): fixup for new and deleted fields. - (image_instance_equal): ditto. - (mark_image_instance): ditto. - (print_image_instance): ditto. - (allocate_image_instance): zero width and height. assign attached - glyph. mark as dirty for future layout. - (make_image_instance_1): pass Qnil as the glyph its attached to. - (Fimage_instance_height): simply return the height. - (Fimage_instance_width): simply return the width. - (image_instance_query_geometry): new function. query the image - instance's geometry by wiring through to format and device - specific methods. fallback on the existing geometry. - (image_instance_layout): new function. layout the image instance - by querying its geometry and then wiring through to format and - device specific methods. - (query_string_geometry): new function to decide the bounding box - of a string. text glyph geometry calculations moved here. - (query_string_font): new function. find out the font for a given - string in a given face. - (text_query_geometry): return geometry based on - quert_string_geometry. - (formatted_string_instantiate): call string_instantiate. - (image_instantiate): put strings in the per-window cache. Feed the - glyph to the instantiated image instance. - (glyph_height_internal): deleted. - (glyph_width): simply return the required dimension. re-layout if - the instance is dirty. Remove references to face_index and - frame_face which were only used for strings. - (glyph_ascent): ditto. - (glyph_descent): ditto. - (glyph_height): ditto. - (Fglyph_width): use new glyph_width function. - (Fglyph_ascent): use new glyph_ascent function. - (Fglyph_descent): use new glyph_descent function. - (Fglyph_height): use new glyph_height function. - (glyph_property_was_changed): - (glyph_image_instance_maybe): new function to possible create an - image instance from a glyph if we don't have one already. - (glyph_dirty_p): use it. - (glyph_layout): new function for laying out a glyph. - (glyph_query_geometry): new function for finding out the desired - geometry of a glyph. - (update_glyph_cachel_data): use new glyph_* signatures. - (update_subwindow): call resize_subwindow. - (map_subwindow): call update_subwindow if the image is dirty. - (subwindow_instantiate): add comment. - (Fresize_subwindow): don't actually resize the window, just record - the values and let update_subwindow handle it. - (Fglyph_animated_timeout_handler): use - MARK_IMAGE_INSTANCE_CHANGED. - (image_instantiator_format_create): declare things with - query_geometry and layout functions. - - * glyphs-x.c: (x_update_subwindow): remove widget sizing. - (update_widget_face): use query_string_font. - (x_widget_set_property): don't return Qt when setting is - succesful. - (x_combo_box_instantiate): call widget_instantiate rather than - widget_instantiate_1. - - * glyphs-widget.c: (widget_face_font_info): deleted. - (widget_text_to_pixel_conversion): deleted. - (widget_set_property): make sure the new text gets propagated to - the image instance. - (widget_layout): new function. wire through to device and format - specific methods. - (widget_query_geometry): new function. wire through to device and - format specific methods. fallback on geometry of widget text. - (initialize_widget_image_instance): fixup new fields. - (widget_instantiate_1): deleted. - (tree_view_instantiate): deleted. - (tree_view_query_geometry): new function. returns desired sizing - of tree view. - (tab_control_instantiate): deleted. - (tab_control_query_geometry): new function. returns desired sizing - of tab. - (widget_instantiate): subsume widget_instantiate_1. Fixup geometry - things in the light of dynamic layout. - (static_instantiate): deleted. - (layout_instantiate): use new glyph_* signatures. - (image_instantiator_format_create_glyphs_widget): fixup - query_geometry and layout declarations for various widgets. - - * glyphs-msw.c: (mswindows_widget_instantiate): add comment. - (mswindows_button_instantiate): use query_string_font for geometry - calculations. - (mswindows_update_subwindow): ditto. - (mswindows_combo_box_instantiate): fixup for new geometry - management. - (mswindows_widget_set_property): Don't return Qt so that other - methods can be called. - -2000-01-08 Martin Buchholz <martin@xemacs.org> - - * gdbinit: rename to .gdbinit so that gdb will automatically source it. - -2000-01-09 Hrvoje Niksic <hniksic@iskon.hr> - - * insdel.c (signal_before_change): Make sure START and END are - within the buffer before calling report_extent_modification(). - (signal_after_change): Ditto for START, NEW_END, and ORIG_END. - -2000-01-09 Hrvoje Niksic <hniksic@iskon.hr> - - * extents.h: Correct prototype of report_extent_modification(). - - * insdel.c (signal_before_change): Place record_unwind_protect() - outside MAP_INDIRECT_BUFFERS loops. - (signal_after_change): Ditto. - - * extents.c (report_extent_modification): Don't expect pointer to - inside_change_hook. - (report_extent_modification_mapper): Explain why - closure->speccount is almost unused. - - * insdel.c (change_function_restore): Call Fset_buffer only if - necessary. - (signal_before_change): Don't propagate inside_change_hook to - report_extent_modification(). - -2000-01-07 Martin Buchholz <martin@xemacs.org> - - * elhash.c (make_general_lisp_hash_table): Remove purify UMR. - (hash_table_rehash_threshold): Removed. Update all callers. - -2000-01-03 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * s/windowsnt.h: Fix mail locking stuff. - - * s/aix3-2.h: Remove HAVE_FSYNC which is now autodetected. - - * emacs.c (vars_of_emacs): Added `mail-lock-methods' and - `configure-mail-lock-method' variables. - - * config.h.in: Fix mail locking stuff. - -2000-01-04 Martin Buchholz <martin@xemacs.org> - - * 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. - -2000-01-03 Didier Verna <didier@xemacs.org> - - * redisplay.c (generate_fstring_runes): new parameter `offset'. - Take offset into account when outputting strings or glyphs. - (generate_formatted_string_db): call generate_fstring_runes with - an offset of 0 if generating a frame or icon title, or the - modeline hscroll if generating a modeline. - - * redisplay.h: remove prototype of `generate_formatted_string' and - add prototype for `generate_formatted_string_db', now used in - "frame.c". - - * frame.c: `title_string_display_line' and - `title_string_emchar_dynarr', formerly known as - `format_string_display_line' and `format_string_emchar_dynarr' - moved here from "redisplay.c". - (generate_title_string): formerly known as - `generate_format_string', moved here from "redisplay.c". - (update_frame_title): take these name changes into account. - (init_frame): new function. Initialize here the variables that - were previously in "redisplay.c" and initialized in - `init_redisplay'. - - * frame.h: prototype for `init_frame'. - - * window.c (Fmodeline_hscroll): restore the definition (remove the - MODELINE_IS_SCROLLABLE #ifdef). - (Fset_modeline_hscroll): ditto, docstring improvement, and return - the actual value that was set. - (struct saved_window): turn the `modeline_hscroll' field into a - Charcount. - (syms_of_window): restore the declaration of - `[set-]modeline-hscroll' (remove the MODELINE_IS_SCROLLABLE #ifdef). - - * window.h (struct window): turn the `modeline_hscroll field' into - a Charcount. - - * emacs.c: include "frame.h" to get `init_frame'. - (main_1): call `init_frame'. - -1999-12-31 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.26 is released. - -1999-12-31 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_widget_instantiate): Avoid X errors calling - XMapWindow() on a NULL pointer X window. - -1999-12-31 Martin Buchholz <martin@xemacs.org> - - * data.c (indirect_function): Use signal_void_function_error(). - - * lisp.h: Modify prototypes for signal_*(). Add SUBR_FUNCTION macro. - - * eval.c (PRIMITIVE_FUNCALL): Optimize. - (signal_void_function_error): return result of Fsignal(). - (signal_invalid_function_error): return result of Fsignal(). - (signal_wrong_number_of_arguments_error): return result of Fsignal(). - (signal_malformed_list_error): Add DOESNT_RETURN. - (signal_malformed_property_list_error): Add DOESNT_RETURN. - (signal_circular_list_error): Add DOESNT_RETURN. - (signal_circular_property_list_error): Add DOESNT_RETURN. - (Feval): Use returned results of signal_*(). Avoids a crash! - (Ffuncall): Use returned results of signal_*(). Avoids the crash: - (setq debug-on-error t) (funcall 'foo) kbd{r42} kbd{RET} - - Only check for fun_nargs < subr_min_args if fun_nargs != max_args. - (function_argcount): Use signal_invalid_function_error(). - (funcall_lambda): Use signal_wrong_number_of_arguments_error(). - Use signal_invalid_function_error(). - -1999-12-28 Andy Piper <andy@xemacs.org> - - * debug.c: rename debug_loop elements to X_ to avoid name clashes. - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): strdup - string_chars. - (menu_item_descriptor_to_widget_value_1): strdup name. - (pre_activate_callback): strdup name. - - * scrollbar-x.c (scrollbar_instance_to_widget_value): strdup name. - (x_update_scrollbar_instance_status): use free_widget_value_tree. - - * dialog-x.c (maybe_run_dbox_text_callback): strdup name. use - free_widget_value_tree. - (dbox_descriptor_to_widget_value): ditto. - - * gui-x.c (widget_value_unwind): use free_widget_value_tree. - (gui_items_to_widget_values_1): ditto. - (gui_items_to_widget_values): ditto. - (free_popup_widget_value_tree): free name. - -1999-12-27 Andy Piper <andy@xemacs.org> - - * nt.c (fstat): use get_osfhandle rather than the handle - directly. From Fabrice Popineau. - - * process-nt.c (nt_open_network_stream): take types into account - when warning. From Fabrice Popineau. - -1999-12-24 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.25 is released. - -1999-12-22 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * syntax.c (vars_of_syntax): Initialize parse-sexp_ignore_comments. - -1999-12-21 Martin Buchholz <martin@xemacs.org> - - * 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): - Remove extra parens, esp. of the form ((expr)) - - * floatfns.c (Flogb): Make 64-bit clean. - -1999-12-12 Daniel Pittman <daniel@danann.net> - - * configure.in: - * configure.usage: - Clean up Athena widget support: - - Add `with-athena' to select a variant. - - Remove all `athena3d' options. - - Robust detection of Athena libraries and headers. - - Refuse to build with mismatched library and headers. - - Only build a 3d Athena if the user asks for it. - -1999-12-21 Andy Piper <andy@xemacs.org> - - * redisplay.c (redisplay_frame): check for faces changed when - reseting subwindow caches. - - * glyphs.h (struct ii_keyword_entry): add copy_p. - (struct image_instantiator_methods): add query_geometry_method and - layout_children_method. - (IIFORMAT_VALID_GENERIC_KEYWORD): new macro to take into account - copying characteristics of keywords. - (IIFORMAT_VALID_NONCOPY_KEYWORD): new macro for defining keywords - whose arguments should not be copied by the specifier code. - (image_instance_geometry): new enum for layouts. - (struct Lisp_Image_Instance): re-jig for layouts and update - macros. - - * glyphs.c (string_instantiate): rename variables. - (image_instantiate): add strings to those widgets that are - instantiated per-window. - (image_copy_vector_instantiator): new function for copying glyph - specifier instantiators. - (image_copy_instantiator): ditto. - - * glyphs-x.c (x_update_subwindow): use new face update functions. - (update_widget_face): update to use new lwlib arg functions. - (update_tab_widget_face): new function for updating tab control - label faces. - (x_widget_instantiate): use new face update functions and new - lwlib arg functions. - (x_tab_control_instantiate): ditto. - (x_tab_control_set_property): ditto. - - * glyphs-widget.c (VALID_GUI_KEYWORDS): use NONCOPY keyword for - callbacks and other things that could recurse. - (VALID_GUI_KEYWORDS): - - * event-msw.c: fix cpp stuff for cygwin < b20. - - * config.h.in: move uid_t and friends to before the s&m files so - that they can be used there. - - * Makefile.in.in (debug-temacs): new target that adds emacs - environment before invoking gdb. - - * lwlib.h (_widget_args): new structure for holding widget - args. It is reference counted so that we don't have to copy Xt - args. - (_widget_value): remove widget args. Add reference to widget_args. - - * lwlib.c (free_widget_value_contents): free widget args using - free_widget_value_args. - - * lwlib-Xaw.c (xaw_update_one_widget): use new arg packet. - (xaw_update_one_widget): use XtIsSubclass for determining labels. - - * lwlib.c (lw_add_value_args_to_args): modify to use our reference - counted arg packet. - (lw_add_widget_value_arg): new function. Add an arg to the arg - packet. - (free_widget_value_args): new function. Remove a reference counted - arg packet. - (lw_copy_widget_value_args): new function. Copy reference counted - arg packet. - (merge_widget_value_args): new function. Do a merge of widget - args. - (merge_widget_value): use it. - (copy_widget_value_tree): copy widget args using reference - counting, since we can't easily copy the args we have been given. - - * specifier.h (struct specifier_methods): add copy_instantiator_method. - - * specifier.c (build_up_processed_list): use - copy_instantiator_method if defined. - -1999-12-19 Martin Buchholz <martin@xemacs.org> - - * fns.c (Ffillarray): Use O(N), not O(N^2) algorithm for strings. - -1999-12-19 Hrvoje Niksic <hniksic@iskon.hr> - - * profile.c (sigprof_handler): FUN retrieved from the backtrace - can also be a cons representing anonymous interpreted function. - -1999-12-18 Martin Buchholz <martin@xemacs.org> - - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): - Docstring fixes. Make them consistent with the lispref and ANSI Lisp. - -1999-12-17 Martin Buchholz <martin@xemacs.org> - - * print.c (print_internal): print ?+ instead of ?\+, etc... - Make printing a little more efficient. - Prevent buffer overflow if sizeof EMACS_INT > 8. - My first 128-bit fix! - -1999-12-14 Karl M. Hegbloom <karlheg@inetarena.com> - - * filelock.c (unlock_all_files): GC_CONSP should be CONSP - -1999-12-17 Martin Buchholz <martin@xemacs.org> - - * database.c: - * 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. - - Any garbage collection when mapping over a string could cause a - crash (typically in mapconcat). - -1999-12-08 Adrian Aichner <adrian@xemacs.org> - - * s\windowsnt.h (DIRECTORY_SEP): Initialize from - `Vdirectory_sep_char'. - - * lisp.h: Add declaration for `Vdirectory_sep_char' to allow - customization of `DIRECTORY_SEP' under native Windows NT. - -1999-12-14 Katsumi Yamaoka <yamaoka@jpl.org> - - * buffer.c (Fbury_buffer): Add directions to the docstring. - -1999-12-14 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.24 is released. - -1999-12-13 Martin Buchholz <martin@xemacs.org> - - * sound.c (vars_of_sound): Provide esd-sound if HAVE_ESD_SOUND - - * nas.c: Fix compiler warnings. Ansify. C++ compilation support. - -1999-12-13 Kazuyuki IENAGA <ienaga@jsys.co.jp> - - * input-method-xlib.c: Make sure src/ does not use Athena, except - indirectly through lwlib. - -1999-12-13 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * dbxrc (pobj): Add opaque_ptr, remove opaque_list. - -1999-12-10 Shenghuo ZHU <zsh@cs.rochester.edu> - - * file-coding.c (add_coding_system_to_list_mapper): - - (coding-system-list) should list aliases correctly. - -1999-12-07 Andy Piper <andy@xemacs.org> - - * fileio.c (vars_of_fileio): directory separator fix from Mike Alexander. - * windowsnt.h (ditto): - -1999-11-27 Adrian Aichner <adrian@xemacs.org> - - * sysfile.h: Encapsulate `fstat' for Windows NT just like stat to - get consistent file modification times. - - * sysdep.h: Declare `wait_for_termination' to use process handle, - not PID, on Windows NT native. - - * sysdep.c (wait_for_termination): Use process handle, not PID, on - Windows NT native. Set exit code correctly on Windows NT. - (sys_subshell): Use process handle, not PID, - on Windows NT native. - (sys_fstat): Add ENCAPSULATE_FSTAT for Windows NT. - - * process-nt.c (nt_create_process): Remove negative pid hack for - Windows 95. - (nt_send_process): Declare vol_proc volatile. - (get_internet_address): warn_when_safe if IP address cannot be - 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. - - * nt.c (fstat): Encapsulate for Windows NT just like stat to get - consistent file modification times. - - * callproc.c (call_process_cleanup): Use process handle, not PID, - on Windows NT native. - (Fcall_process_internal): Ditto. Close fd_error in parent. Don't - check for negative pid on Windows NT/9[58]. - -1999-12-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.23 is released. - -1999-12-06 Martin Buchholz <martin@xemacs.org> - - * events.c (Fcopy_event): Don't copy the lrecord_header. - - * lisp.h (DO_REALLOC): - Optimize. - Remove redundant parens. - Remove generic hygienic macro comment. - - * lrecord.h (set_lheader_implementation): Remove redundant parens. - -1999-12-05 Martin Buchholz <martin@xemacs.org> - - * lstream.c (Lstream_adding): - - Never compare a size_t and a possibly negative number. - - Optimize. - -1999-12-05 Kyle Jones <kyle_jones@wonderworks.com> - - * lisp/itimer.el: (require 'lisp-float-type). Use - floats directly in itimer-time-difference. - -1999-12-05 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_output_layout): avoid name hiding. - - * gui.h: declare gui_add_item_keywords_to_plist. - - * window.c (Fdelete_window): mark subwindows as changed so that - they can be GC'd if necessary. - -1999-12-02 Jan Vroonhof <vroonhof@math.ethz.ch> - - * src/callproc.c (Fcall_process_internal): Be careful in writing - terminating null when copying args. nargs can be < 4. - Idea from Klaus Frank <klausf@i3.informatik.rwth-aachen.de> - -1999-11-29 Kyle Jones <kyle_jones@wonderworks.com> - - * src/sound.c (Fding): Remove zero initialization of - static variables to avoid crashes on systems that dump - the initialized data segment read-only. - -1999-12-05 Jan Vroonhof <vroonhof@math.ethz.ch> - - * glyphs-x.c (convert_EImage_to_XImage): Guard against other - visual classes. From Rasmus Borup Hansen <rbh@math.ku.dk> - -1999-12-04 Martin Buchholz <martin@xemacs.org> - - * 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: - * sysdep.h: - * sysdep.c: - - Replace macro calls to EMACS_GET_TTY and EMACS_SET_TTY with - function equivalents emacs_get_tty() and emacs_set_tty(). - - Moved prototypes to systty.h, where struct event_tty is defined. - - Renamed bogus `waitp' parameter to `flushp'. - - * lstream.c (filedesc_reader): Support broken systems where return - type of read() is different from ssize_t. - - * events.c (Fcopy_event): Avoid redundant EQ test if event2 is nil. - - * event-stream.c (menu_move_up): Remove redundant if block. - (menu_move_down): Gratuitous rewriting. - (menu_move_left): Work around Cygnus codefusion-990706 compiler bug. - (menu_move_right): Ditto. - - * lrecord.h (copy_lcrecord): - (zero_lcrecord): - Always add parentheses around uses of macro arguments. - - * sysdll.c: #include <stdlib.h> for exit(). - * unexhp9k800.x: #include <stdlib.h> for malloc(). - Use proper prototype for Save_Shared_Data(void). - -1999-12-04 Jan Vroonhof <vroonhof@math.ethz.ch> - - * src/redisplay.c (point_would_be_visible): Correct for topclip. - -1999-12-02 Hrvoje Niksic <hniksic@iskon.hr> - - * lisp.h: Declare Qself_insert_defer_undo. - - * event-stream.c (Fdispatch_event): Get the magic undo thing from - a symbol property, so commands other than self-insert-command can - install it. - (syms_of_event_stream): Define Qself_insert_defer_undo. - -1999-11-30 Martin Buchholz <martin@xemacs.org> - - * floatfns.c (emacs_rint): Rename rint to emacs_rint, so that - `#undef HAVE_RINT' works. - - * sysdep.h: Fix up prototypes for sys_read_1(), sys_write_1() - -1999-11-25 Andy Piper <andy@xemacs.org> - - * select-msw.c (Fmswindows_set_clipboard): selection fixes from - Mike Alexander. - (Fmswindows_delete_selection): ditto. - - * redisplay.h (CLASS_REDISPLAY_FLAGS_CHANGEDP): add size_changed. - (GLOBAL_REDISPLAY_FLAGS_CHANGEDP): ditto. - - * redisplay.c (redisplay_device): move size changed to macros in - redisplay.h - (redisplay_without_hooks): ditto. - - * redisplay-output.c (redisplay_output_layout): rename to avoid - name hiding. - - * process-nt.c (struct nt_process_data): mks toolkit fixes from - Mike Alexander. - (nt_create_process): ditto. - (nt_send_process): ditto. - - * nt.c (init_environment): make sure mingw32 gets the cached - system info. - - * gui.h: declare gui_add_item_keywords_to_plist. - - * event-msw.c (mswindows_wnd_proc): Clipboard fixes from Mike - Alexander. - - * console-msw.h: fix cygwin define/header 1.0 problems. - * glyphs-msw.c: ditto. - * ntplay.c: ditto. - * unexcw.c: ditto. - * s/cygwin32/h: ditto. - -1999-11-29 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.21 is released. - -1999-11-26 Martin Buchholz <martin@xemacs.org> - - * callproc.c (Fcall_process_internal): - * config.h.in: - * esd.c: - * event-msw.c (ntpipe_slurp_reader): - * event-msw.c (ntpipe_shove_writer): - * event-msw.c (winsock_reader): - * event-msw.c (winsock_writer): - * event-stream.c (dribble_out_event): - * fileio.c: - * fileio.c (Fexpand_file_name): - * glyphs-x.c (write_lisp_string_to_temp_file): - * gpmevent.c (tty_get_foreign_selection): - * lisp.h: Update prototypes. - * lstream.c (Lstream_flush_out): - * lstream.c (Lstream_write_1): - * lstream.c (Lstream_was_blocked_p): - * lstream.c (Lstream_read_more): - * lstream.c (Lstream_read): - * lstream.c (Lstream_fputc): - * lstream.c (make_stdio_output_stream): - * lstream.c (stdio_flusher): - * lstream.c (stdio_closer): - * lstream.c (make_filedesc_output_stream): - * lstream.c (errno_would_block_p): - * lstream.c (filedesc_writer): - * lstream.c (make_lisp_string_input_stream): - * lstream.c (make_fixed_buffer_output_stream): - * lstream.c (fixed_buffer_reader): - * lstream.c (make_resizing_buffer_output_stream): - * lstream.c (make_dynarr_output_stream): - * lstream.c (make_lisp_buffer_output_stream): - * lstream.c (lisp_buffer_reader): - * lstream.h (lstream_implementation): - * md5.c (Fmd5): - * miscplay.h (reset_parsestate): - * process-nt.c (nt_send_process): - * process-unix.c (unix_send_process): - * sound.c: - * sysdep.c (sys_close): - * sysdep.c (sys_read_1): - * sysdep.c (sys_write_1): - * sysfile.h: - * file-coding.c (determine_real_coding_system): - * file-coding.c (Fdetect_coding_region): - * file-coding.c (struct decoding_stream): - * file-coding.c (decoding_reader): - * file-coding.c (Fdecode_coding_region): - * file-coding.c (struct encoding_stream): - * file-coding.c (encoding_reader): - * file-coding.c (Fencode_coding_region): - * 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. - - 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. - - Update all callers of Lstream_read and Lstream_write to - use the new types. - - Fix esd* initiated C++ compile errors. - - Remove comments referring to `fpurge' - we don't want to call it - even if it's there. - - * lisp.h - - Remove some lingering Lucid compiler support. - - * lisp.h - - Add prototype for Fdelete_process. - - * gpmevent.c (Freceive_gpm_event): Remove unused variables. - -1999-11-27 Martin Buchholz <martin@xemacs.org> - - * Makefile.in.in (depend): Only update `depend' if there were changes. - -1999-11-26 Martin Buchholz <martin@xemacs.org> - - * editfns.c (get_system_name): Remove. - -1999-11-26 Martin Buchholz <martin@xemacs.org> - - * 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): - - Look for both initial and final -*- cookies. - - Replace EQ (foo, Qnil) with NILP (foo) - - Make searching for cookies more efficient. - - Recognize only rfc 1521 characters in charset names. - -1999-11-22 Kazuyuki IENAGA <kazz@imasy.or.jp> - - * input-method-xlib.c (IMDestroyCallback): #ifdef'd by - "THIS_IS_X11R6", because it shouldn't be evaluated unless X11R6. - * input-method-xlib.c (IMInstantiateCallback): Ditto. - * input-method-xlib.c (XIM_init_device): Revive XOpenIM function - call for X11R5 systems. - * input-method-xlib.c (XIM_delete_frame): Enabled XDestroyIC() - again because XIM doesn't concern with frame deletion itself. - The XIC will be cleared by XIM when XIM is closing (at XIM destroy - callback). - -1999-10-25 Kazuyuki IENAGA <kazz@imasy.or.jp> - - * input-method-xlib.c: Added new lisp object Qxim_xlib. - New macro xim_warn(str), xim_warn1(fmt,str) and xim_info(str). - All the valid stderr_out were changed to those macros. - (IMDestroyCallback): Don't test the XIC if the frame is not X - frame. - (IMInstantiateCallback): Treat the client_data as "device" not - "frame" because the caller changed from frame to device. - Here initializes XIM and activates XICs for each frame which - doesn't have XIC. - (XIM_init_device): Register the XIM instantiation callback which - had been performed by XIM_init_frame() before. - (XIM_delete_frame): Added a test for the XIM before clearing XIC. - (XIM_init_frame): Placed an actual code for XIC activation which - was moved from IMInstantiateCallback. - (syms_of_input_method_xlib): New function which includes a symbol - Qxim_xlib that uses in emacs.c. - - * emacs.c: Added a function entry "syms_of_input_method_xlib" for - input_method_xlib. - - * symsinit.h: Added a declaration of "syms_of_input_method_xlib". - -1999-11-05 Robert Pluim <rpluim@bigfoot.com> - - * emacs.c (shut_down_emacs): Point users to PROBLEMS file - -1999-11-16 Jan Vroonhof <vroonhof@math.ethz.ch> - - * redisplay-output.c (compare_runes): Add comments about - results from profiling. - - * redisplay.h (struct rune): Do not use bitfields for members. - (struct rune): Add various comments about further optimizations. - -1999-11-19 Eric Darve <darve@crocco.stanford.edu> - - * abbrev.c (abbrev_oblookup): Check whether wordend <= wordstart - if Vabbrev_start_location is used too. - -1999-10-27 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * file-coding.c (detect_eol_type): Return CR when two - sequential CR are found. - (determine_real_coding_system): Check EOL type when coding: - cookie is found and EOL type is not specified. - Don't assume 8bit char as part of coding: cookie. - -1999-10-26 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * file-coding.c (determine_real_coding_system): Check if - '-*-' exists. End searching for coding: cookie at the end - of line. Check whether character before coding: is space, - tab or ';'. - -1999-11-07 William M. Perry <wmperry@aventail.com> - - * gpmevent.c: Completely rewrote GPM mouse support for linux - console. The TTY console and event stream are modified at run - time, so this code can now be used as a module. - (tty_get_foreign_selection): New function to allow pasting from - other virtual consoles. - (Fgpm_enable): New lisp-visible function to turn GPM on or off - at run time. - - * device-tty.c (tty_asynch_device_change): No longer need to - notify GPM code of window/console height/width changes. - - * console-tty.c (tty_init_console): Removed outdated GPM support - that was part of the console/event code. - - * event-Xt.c (emacs_Xt_select_console): Ditto - - * event-Xt.c (emacs_Xt_unselect_console): Ditto - - * event-unixoid.c (read_event_from_tty_or_stream_desc): Ditto - - * frame-tty.c (console_type_create_frame_tty): Ditto - -1999-11-17 Martin Buchholz <martin@xemacs.org> - - * nt.c: - * sysdep.c: - * s/mingw32.h: - * s/windowsnt.h: - - Use Unix 98 types uid_t, gid_t, pid_t. - - Define them. - -1999-11-01 Olivier Galibert <galibert@pobox.com> - - * alloc.c (reinit_alloc_once_early): Move purify_flag init... - * emacs.c (main_1): ...here, to get the correct value even with - the portable dumper. - -1999-11-17 Martin Buchholz <martin@xemacs.org> - - * lisp.h (BIT_VECTOR_LONG_STORAGE): Add extra parens. It's a macro! - - * 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): - (memind_to_bytind): - Remove extra parens. Inline functions are not macros. - - * editfns.c (Fuser_login_name): - (user_login_name): - Use proper type uid_t. - -1999-11-15 Martin Buchholz <martin@xemacs.org> - - * syntax.c (complex_vars_of_syntax): Make more readable. - (define_standard_syntax): New function. - - * syntax.c (forward-comment): Gradually make XEmacs 64-bit-clean. - -1999-11-14 Martin Buchholz <martin@xemacs.org> - - * mule-ccl.c (CCL_WRITE_STRING): Fix compiler warnings. - -1999-11-12 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * mule-charset.h (LEADING_BYTE_OFFICIAL_1, LEADING_BYTE_OFFICIAL_2): - New enum type to make sure no gap in the leading byte definition. - -1999-11-11 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * mule-charset.h (LEADING_BYTE_CYRILLIC_ISO_8859_5, - LEADING_BYTE_LATIN_ISO8859_9): Moved to 0x8B and 0x8C - to remove a hole in leading byte definition. - -1999-11-10 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * mule-charset.c (non_ascii_valid_charptr_p): Check if - private charset is defined. - -1999-11-09 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * mule-ccl.c (ccl_driver): Make sure generated sequences - are valid when doing `CCL_WRITE_STRING'. - (ccl-execute-on-string): Pass CCL_MODE_DECODING to ccl_driver. - -1999-11-10 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.20 is released - -1999-11-04 Martin Buchholz <martin@xemacs.org> - - * mule-ccl.c (ccl_driver): Warning suppression - -1999-11-01 SL Baur <steve@miho.m17n.org> - - * emacs.c (main_1): Guard call to reinit_vars_of_debug when not - building a debugged XEmacs. - -1999-10-28 Andreas Jaeger <aj@suse.de> - - * src/emacs.c (main_1): Don't set the malloc hooks if using - DOUG_LEA_MALLOC. - -1999-10-30 Olivier Galibert <galibert@pobox.com> - - * alloc.c (pdump_dump_rtables): Don't forget to dump the last - registered type. - (pdump): Ditto. - -1999-10-25 Olivier Galibert <galibert@pobox.com> - - * emacs.c (main_1): Call reinit_vars_of_scrollbar_x. - - * symsinit.h: Declare reinit_vars_of_scrollbar_x. - -1999-10-25 Martin Buchholz <martin@xemacs.org> - - * 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): - Fix compile errors/warnings. - - * alloc.c (xstrdup): Use fact that memcpy returns its first arg. - (allocate_lisp_storage): Simplify. - -1999-10-24 Olivier Galibert <galibert@pobox.com> - - * conslots.h: Add defines with first and last slot names. - * bufslots.h: Add defines with first and last slot names. - - * buffer.c (common_init_complex_vars_of_buffer): Renamed from - reinit_complex_vars_of_buffer - (reinit_complex_vars_of_buffer): Reset the slots to the dumped - value. - (complex_vars_of_buffer): Dump the slots values. - - * console.c (common_init_complex_vars_of_console): Renamed from - reinit_complex_vars_of_console - (reinit_complex_vars_of_console): Reset the slots to the dumped - value. - (complex_vars_of_console): Dump the slots values. - - * alloc.c: Rename reloc_table to pdump_reloc_table, rt_list to - pdump_rt_list and move them at the beginning of the file. - (gc_sweep): Unmark pdumped objects after the sweep phase. - (pdump_dump_rtables): Change a bare 256 to - last_lrecord_type_index_assigned. Add a separator between the - adresses or lrecords and the ones of C structs in the dump file. - (pdump_load): Cope with the new separator and the renamings. Stop - looking for the hash tables list after it has been found (duh!). - -1999-10-24 Robert Bihlmeyer <robbe@orcus.priv.at> - - * sound.c: support HAVE_ESD_SOUND - - * miscplay.c: - * miscplay.h: - * linuxplay.c: Move large part of linuxplay to generalized file - miscplay. Make it platform independent. - - * esd.c: New file - -1999-10-24 Adrian Aichner <adrian@xemacs.org> - - * lisp.h (Dynarr_declare): Fix boo-boo. - -1999-10-24 Olivier Galibert <galibert@pobox.com> - - * process-unix.c (allocate_pty): Fix HAVE_GETPT. - * process.h: Ditto. - -1999-10-24 Jan Vroonhof <vroonhof@math.ethz.ch> - - * redisplay.c (start_with_line_at_pixpos): Remove assert(cur_elt - >=0). Handle the cur_elt == 0 case. - -1999-10-24 Jan Vroonhof <vroonhof@math.ethz.ch> - - * unexelf.c: Merge Martin's c++ fixes back in - -1999-10-20 Jan Vroonhof <vroonhof@math.ethz.ch> - - * unexelf.c (unexec): Only copy the global offset - table from memory on sgi machines. - -1999-08-13 Alexandre Oliva <oliva@dcc.unicamp.br>, Vin Shelton <acs@xemacs.org> - - * unexelf.c: Enable GNU/Linux/alpha to build with gcc 2.95 by - adding support for an sbss section. Get IRIX 5.2 to build using - unexelf.c. - - * m/iris4d.h: Use unexelf.o for unexec. - - * m/iris5d.h: Use unexelf.o for unexec. - -1999-10-24 Jan Vroonhof <vroonhof@math.ethz.ch> - - * unexelf.c: Revert to 21.1 version - -1999-08-28 Jan Vroonhof <vroonhof@math.ethz.ch> - - * window.c (Fwindow_truncated_p): New function. - -1999-08-25 Jonathan Marten <jonathan.marten@uk.sun.com> - - * window.c (window_truncation_on): Always return 0 for minibuffer - windows, to enable auto scrolling. - -1999-10-24 Neal Becker <nbecker@fred.net> - * process.h: Unix98 PTY support - -1999-10-17 Jan Vroonhof <vroonhof@math.ethz.ch> - - * fileio.c (Ffile_truename): Do proper mule decoding on - the argument to xrealpath() - -1999-08-19 Stephen Tse <stephent@sfu.ca> - - * process-unix.c (unix_open_network_stream): Add udp network - support; rename variable Qtcpip to Qtcp, parameter family to - protocol for consistency with Qudp. - - * process-nt.c (nt_open_network_stream): Rename variable Qtcpip to - Qtcp, parameter family to protocol for consistency with Qudp. - - * process.c (global_variables): Add a new variable Qudp for udp - network support; rename variable Qtcpip to Qtcp for consistency - with Qudp. - (Fopen_network_stream_internal): Rename parameter FAMILY to - PROTOCOL for consistency; fix a minor typo and add an explanation - in docstring for udp programming. - (Fopen_multicast_group_internal): Fix a minor typo in docstring. - (syms_of_process): Add a new variable Qudp for udp network - support; rename variable Qtcpip to Qtcp for consistency with Qudp. - - * process.h (extern_variables): Add a new variable Qudp for udp - network support; rename variable Qtcpip to Qtcp for consistency - with Qudp. - - * procimpl.h: Add a new variable Qudp for udp network support; - rename variable Qtcpip to Qtcp for consistency with Qudp. - (struct process_methods): Rename parameter family to protocol. - - -1999-10-24 Olivier Galibert <galibert@pobox.com> - - * alloc.c (pdump_make_hash): Divide pointers by 8 for a better hash. - -1999-10-23 Olivier Galibert <galibert@pobox.com> - - * lrecord.h (struct lrecord_header): Removed dumped flags. - - * dynarr.c: Use DUMPEDP instead of dumped flag. - - * 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. - -1999-10-14 Andy Piper <andy@xemacs.org> - - * redisplay-x.c (x_output_shadows): fix dodgy maths for border - calculations. - - * gutter.c (output_gutter): be more accurate about the area to be - cleared since X seems to manage to do the clear after drawing the - border. - - * redisplay.h (RESET_CHANGED_FLAGS): new macro for setting - redisplay flags as a group. - (RESET_CHANGED_SET_FLAGS): ditto. - (CLASS_RESET_CHANGED_FLAGS): ditto. - (GLOBAL_RESET_CHANGED_FLAGS): ditto. - (REDISPLAY_FLAGS_CHANGEDP): new macro for testing redisplay flags - as a group. - (CLASS_REDISPLAY_FLAGS_CHANGEDP): ditto. - (GLOBAL_REDISPLAY_FLAGS_CHANGEDP): ditto. - - * redisplay.c (redisplay_frame): use CLASS_RESET_CHANGED_FLAGS - instead of setting flags individually. - (redisplay_device): ditto CLASS_REDISPLAY_FLAGS_CHANGEDP. - (redisplay_device): ditto. - (redisplay_device): ditto CLASS_RESET_CHANGED_FLAGS. - (redisplay_without_hooks): ditto GLOBAL_REDISPLAY_FLAGS_CHANGEDP. - (redisplay_without_hooks): ditto CLASS_REDISPLAY_FLAGS_CHANGEDP. - (redisplay_without_hooks): ditto. - (redisplay_without_hooks): ditto GLOBAL_RESET_CHANGED_FLAGS. - - * redisplay-x.c (x_output_string): unmap subwindows in the area. - (x_output_blank): ditto. - - * redisplay-output.c (redisplay_output_display_block): don't unmap - subwindows in case layout optimization can avoid it. - (redisplay_output_subwindow): unmap subwindows in the area. - (redisplay_output_layout): optimize the output of layouts - only - output glyphs that have changed if nothing else of redisplay - significance has occurred. - (redisplay_output_pixmap): change args to - redisplay_clear_clipped_region. - (redisplay_clear_clipped_region): allow the clipped region to be - cleared of all subwindows except the one passed in. - - * redisplay-msw.c (mswindows_output_blank): unmap subwindows in - the area. - (mswindows_output_cursor): ditto. - (mswindows_output_string): ditto. - - * gutter.c (calculate_gutter_size): if the window buffer is nil - then don't continue. - (update_frame_gutters): be more lenient about when we actually - update the gutter. Layout optimization makes this - non-costly. Cache redisplay flags that we want to temporarily - ignore. - - * glyphs.c (Fglyph_animated_timeout_handler): handle image - specific timeouts rather than iterating over the instance cache. - (glyph_animated_timeout_mapper): deleted. - (add_glyph_animated_timeout): use a weak list to hold onto the - image so that it can be GC'ed. - (disable_glyph_animated_timeout): disable a specific timeout. - (vars_of_glyphs): disable-animated-pixmaps is a new boolean for - controlling whether pixmaps are animated or not. - - * glyphs-msw.c (mswindows_finalize_image_instance): make sure the - image timeout gets disabled when the image gets freed. - - * glyphs-eimage.c (gif_instantiate): remove meaningless - comment. Cope with timeouts specified in the gif extension block. - - * event-msw.c (vars_of_event_mswindows): new variable - mswindows-meta-activates-menu. - (mswindows_wnd_proc): only goto defproc with VK_MENU if the user - wants it. - - * glyphs-x.c (x_finalize_image_instance): delete mask first so - that we can compare with image. - -1999-10-14 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c (mswindows_key_to_emacs_keysym): - Recognise keypad keys as different from normal keys. - -1999-10-14 Didier Verna <didier@xemacs.org> - - * glyphs-x.c (x_finalize_image_instance): avoid freeing null pixmaps. - -1999-10-10 Olivier Galibert <galibert@pobox.com> - - * symbols.c (init_symbols_once_early): dump Vquit_flag. - - * symsinit.h: Updated. - - * ntproc.c (vars_of_ntproc): Use defsymbol. - - * emacs.c (main_1): Updated reinit calls. - - * lisp.h: Removed Fpurecopy and pure_put declarations. - * fns.c: Removed pure_put. - - * eval.c (Fdefvar): pure_put -> Fput - (Fdefconst): Ditto. - * frame-x.c (init_x_prop_symbols): Ditto. - * symbols.c (deferror): Ditto. - - * alloc.c (Fmake_byte_code): Remove Fpurecopy call. - * buffer.c (vars_of_buffer): Ditto. - * bytecode.c (Ffetch_bytecode): Ditto. - (optimize_compiled_function): Ditto. - * emacs.c (vars_of_emacs): Ditto. - * emodules.c (vars_of_module): Ditto. - * eval.c (define_function): Ditto. - (Fautoload): Ditto. - * frame.c (vars_of_frame): Ditto. - * intl.c (Fset_domain): Ditto. - * lread.c (load_force_doc_string_unwind): Ditto. - * menubar.c (vars_of_menubar): Ditto. - * minibuf.c (reinit_complex_vars_of_minibuf): Ditto. - - * debug.c (reinit_vars_of_debug): Extracted. - * device-x.c (reinit_vars_of_device_x): Ditto. - * emodules.c (reinit_vars_of_module): Ditto. - * font-lock.c (reinit_vars_of_font_lock): Ditto. - * glyphs-widget.c (reinit_vars_of_glyphs_widget): Ditto. - * glyphs.c (reinit_vars_of_glyphs): Ditto. - * gui-x.c (reinit_vars_of_gui_x): Ditto. - * insdel.c (reinit_vars_of_insdel): Ditto. - * menubar-x.c (reinit_vars_of_menubar_x): Ditto. - * minibuf.c (reinit_complex_vars_of_minibuf): Ditto. - * mule-wnnfns.c (reinit_vars_of_mule_wnn): Ditto. - * print.c (reinit_vars_of_print): Ditto. - * redisplay.c (reinit_vars_of_redisplay): Ditto. - * select-x.c (reinit_vars_of_xselect): Ditto. - * undo.c (reinit_vars_of_undo): Ditto. - -1999-10-10 Olivier Galibert <galibert@pobox.com> - - * symsinit.h: Updated declarations, see other ChangeLog entries. - - * redisplay.c (init_redisplay): Ensure proper reinitialisation. - - * lrecord.h (XD_DYNARR_DESC): Introduce XD_INT_RESET and use it. - - * glyphs.c: Add the ii_keyword_entry and related descriptions. - Fix the image_instantiator_methods one. - - * file-coding.c: Plonk all data that needs to be dumped in a - dynamically allocated structure. - - * extents.c (reinit_vars_of_extents): Extracted from - vars_of_extents. - - * event-stream.c (vars_of_event_stream): Don't staticpro when - pdump_wire is enough. - - * event-msw.c (reinit_vars_of_event_mswindows): Extracted from - vars_of_event_mswindows. - - * event-Xt.c (reinit_vars_of_event_Xt): Extracted from - vars_of_event_Xt. - - * eval.c (vars_of_eval): Don't staticpro when pdump_wire is enough. - - * emacs.c (main_1): Added some reinit calls. - - * device-x.c (reinit_console_type_create_device_x): Extracted from - console_type_create_device_x. - - * console.h: Declare the console_type_entry_dynarr description. - - * console.c: Unstatic the console_type_entry_dynarr description. - - * alloc.c: Removed some dubious comments. Handle XD_INT_RESET. - -1999-10-07 Olivier Galibert <galibert@pobox.com> - - * symsinit.h: Updated declarations, see other ChangeLog entries. - - * minibuf.c (reinit_complex_vars_of_minibuf): Extracted from - complex_vars_of_minibuf. - - * lrecord.h: Removed XD_PARENT_INDIRECT (unused and - unimplemented), added XD_LO_LINK. - - * lisp.h (pdump_wire_list): Add declaration. - - * glyphs.h (INITIALIZE_DEVICE_IIFORMAT): Fix bug found by Andy. - (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT): Fix stupid bug. - (REINITIALIZE_IMAGE_INSTANTIATOR_FORMAT): Remove, useless once the - stupid bug fixed. - - * glyphs.c (reinit_image_instantiator_format_create): Remove. - - * glyphs-x.c (reinit_image_instantiator_format_create_glyphs_x): - Remove. - - * glyphs-widget.c - (reinit_image_instantiator_format_create_glyphs_widget): Remove. - - * glyphs-msw.c - (reinit_image_instantiator_format_create_glyphs_mswindows): - Remove. - - * glyphs-eimage.c - (reinit_image_instantiator_format_create_glyphs_eimage): Remove. - - * frame.c (Fmake_frame): Don't reset the face cache when using the - stream device. - - * file-coding.c: Dumped the_codesys_prop_dynarr and added all - relevant descriptions. - - * events.c (reinit_vars_of_events): Extracted from vars_of_events. - - * eval.c: The subr is _not_ a lcrecord. - - * emacs.c (main_1): Call vars_of_specifier early before any - specifier creation (e.g in vars_of_glyphs, at least). Remove the - useless reinit_image_instantiator_format*. Add - reinit_vars_of_events and reinit_complex_vars_of_minibuf. Add - calls to lstream_type_create* and process_type_create*. - - * elhash.c: Dump Vall_weak_hash_tables correctly. - - * data.c: Dump Vall_weak_lists correctly. - - * console.c: Fix description. - - * console-stream.c (init_console_stream): Do initializations - correctly in the pdump case. - - * chartab.c: Fix description. Dump Vall_syntax_tables correctly. - (Fcopy_char_table): Link into Vall_syntax_tables. - - * alloc.c (pdump_wire_list): Added. - (Fgarbage_collect): Fix loop in stats couting missing the last - lrecord type. - (pdump_register_sub): Added XD_LO_LINK. - (pdump_dump_data): Ditto. Fixed XD_LO_RESET_NIL forgttting the - counter. - (pdump_reloc_one): Ditto. - (pdump_scan_by_alignement): Use last_lrecord_type_index_assigned - instead of 256. - (pdump_dump_wired): Added lists. - (pdump): Use last_lrecord_type_index_assigned instead of 256. - Dump last_lrecord_type_index_assigned value. Fix minor bugs. - -1999-10-07 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_finalize_image_instance): zero out - bitmap slices. - - * glyphs-x.c (x_finalize_image_instance): fix FMW problem. - -1999-10-06 Andy Piper <andy@xemacs.org> - - * elhash.c (resize_hash_table): Correct reference to lrecord_header. - -1999-10-06 Damon Lipparelli <lipp@primus.com> - - * elhash.h: forward declare Lisp_Hash_Table. - -1999-10-06 Andy Piper <andy@xemacs.org> - - * glyphs.c (Fset_image_instance_property): mark glyphs as dirty - after setting an image instance property. - -1999-10-05 Andy Piper <andy@xemacs.org> - - * gutter.c (update_frame_gutters): output gutters if - windows_changed is set. This is the only way of catching changes - in selected window which obviously can affect the specifiers. - - * redisplay.c: new state flags, subwindows_state_changed and - subwindows_state_changed set. - (redisplay_window): use them. - (redisplay_device): ditto. - (redisplay_without_hooks): ditto. - (redisplay_frame): ditto. Reset subwindow cachels if - subwindows_changed is set. - (redisplay_window): call mark_glyph_cachels_as_clean after - redisplaying. - - * redisplay-x.c (x_output_x_pixmap): select correct - pixmap image for display depending on the currently selected - slice. - - * redisplay-output.c (compare_runes): check dirtiness when - checking RUNE_DGLYPH runes. - (compare_display_blocks): relax invalidation of display blocks - since we can now detect whether individual glyphs have changed or - not. - - * redisplay-msw.c (mswindows_output_dibitmap): select correct - bitmap image for display depending on the currently selected - slice. - - * glyphs.h (struct Lisp_Image_Instance): add a dirty flag. - (IMAGE_INSTANCE_DIRTYP): new macro. - (XIMAGE_INSTANCE_DIRTYP): ditto. - (MARK_IMAGE_INSTANCE_CHANGED): ditto. - (GLYPH_DIRTYP): ditto. - (XGLYPH_DIRTYP): ditto. - (MARK_GLYPH_CHANGED): ditto. - (GLYPH_CACHEL_DIRTYP): ditto. - (struct glyph_cachel): add a dirty flag. - - * glyphs.c (update_frame_subwindows): Don't update on - glyphs_changed. - (glyph_animated_timeout_mapper): new function. Map over the - instance cache lookinng for animated images to update. - (Fglyph_animated_timeout_handler): new function. Lisp callback for - handling animated image timeout events. - (disable_glyph_animated_timeout): new function. Add the animated - image timeout. - (disable_glyph_animated_timeout): new function. Remove the - animated image timeout. - (syms_of_glyphs): initialize Qglyph_animated_timeout_handler and - friends. - (vars_of_glyphs): initialize Vglyph_animated_ticker. - (image_instance_equal): add the currently displayed slice. - (image_instance_hash): ditto. - (allocate_glyph): initialize dirty flag. - (glyph_width): rename glyph -> glyph_or_image. - (glyph_height_internal): ditto. - (glyph_dirty_p): new function. Determine whether the image - instance in the domain and/or glyph is dirty. - (set_glyph_dirty_p): set the dirtiness. - (update_glyph_cachel_data): take dirtiness into account. Pass the - image instance we are interested in to glyph_width and friends. - (get_glyph_cachel_index): make non-static. Always call - update_glyph_cachel_data. - (mark_glyph_cachels_as_not_updated): meaningless formatting - change. - (mark_glyph_cachels_as_clean): new function. Clean dirtiness from - glyph cachels. - - * glyphs-x.h (struct x_image_instance_data): change - pixmap to a list of pixmaps. - (IMAGE_INSTANCE_X_PIXMAP_SLICE): new macro. - (IMAGE_INSTANCE_X_PIXMAP_SLICES): ditto. - (XIMAGE_INSTANCE_X_PIXMAP_SLICE): ditto. - (XIMAGE_INSTANCE_X_PIXMAP_SLICES): ditto. - - * glyphs-x.c (x_finalize_image_instance): make sure multi pixmap - images get deleted properly. - (init_image_instance_from_x_image): add slices paramater and use - it to initialize x_image_instance_data correctly. - (image_instance_add_x_image): new function. Add new pixmaps to our - set of instantiated pixmaps for an image. Used by animated images. - (x_init_image_instance_from_eimage): add a slices - parameter. Instantiate all images from the eimage. - (x_xpm_instantiate): update use of - init_image_instance_from_x_image. - (init_image_instance_from_xbm_inline): ditto. - (x_initialize_pixmap_image_instance): add slices paramater and use - it to allocate x_image_instance_data correctly. - - * glyphs-msw.h (struct mswindows_image_instance_data): change - bitmap to a list of bitmaps. - (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE): new macro. - (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES): ditto. - (XIMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE): ditto. - (XIMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES): ditto. - - * glyphs-msw.c (init_image_instance_from_dibitmap): add slices - paramater and use it to initialize mswindows_image_instance_data - correctly. - (image_instance_add_dibitmap): new function. Add new bitmaps to - our set of instantiated bitmaps for an image. Used by animated - images. - (mswindows_init_image_instance_from_eimage): add a slices - parameter. Instantiate all images from the eimage. - (mswindows_xpm_instantiate): update use of - init_image_instance_from_dibitmap. - (bmp_instantiate): ditto. - (init_image_instance_from_xbm_inline): ditto. - (mswindows_finalize_image_instance): make sure all the bitmap - slices get deleted. - (mswindows_initialize_dibitmap_image_instance): add slices - paramater and use it to allocate mswindows_image_instance_data - correctly. - - * glyphs-eimage.c (jpeg_instantiate): give extra paramter to - init_image_instance_from_eimage. - (png_instantiate): ditto. - (tiff_instantiate): ditto. - (gif_instantiate): allocate bitmaps for all gif slices not just - the first one. - - * device.h (struct device): add subwindows_state_changed flag. - (MARK_DEVICE_SUBWINDOWS_STATE_CHANGED): new macro. - (MARK_DEVICE_FRAMES_GLYPHS_CHANGED): ditto. - - * console.h (struct console_methods): add a slice parameter to - init_image_instance_from_eimage_method. - - * redisplay.c (create_string_text_block): Allow buffer to be nil - without crashing. - -1999-09-24 Andy Piper <andy@xemacs.org> - - * glyphs-x.c: only include gui-x.h if we are building with - widgets. - - * gui-x.c (vars_of_gui_x): only set popup_up_p if we have popups. - -1999-09-28 Lee Kindness <lkindness@csl.co.uk> - - * objects-x.c (allocate_nearest_color): will return 0 (failure) - when the colormap is full and the color it has computed to be the - 'nearest' has been allocated read/write. - -1999-10-02 Olivier Galibert <galibert@pobox.com> - - * search.c (reinit_vars_of_search): Reinit the search cache - correctly. - - * elhash.h: Make the description visible. Declare - resize_hash_table. - - * elhash.c (resize_hash_table): Extracted from enlarge_hash_table - to generalize the hash table reorganization. - (reorganize_hash_table): Added. - (enlarge_hash_table): Uses resize_has_table. - - * casetab.c (complex_vars_of_casetab): staticpro the mule mirror - tables. - - * alloc.c: Add correct management of blocks of structures. - Reorganize hash tables at reload since the hash values can change - with the pointers. - -1999-10-01 Olivier Galibert <galibert@pobox.com> - - * lisp.h: Add pdump_wire declaration - - * elhash.c (vars_of_elhash): Wire Vall_weak_hash_tables. - * symbols.c (init_symbols_once_early): Wire Qnil and Qunbound. - - * alloc.c (pdump_wire): Added.. - (pdump_load): Support it. - (pdump): Support it - - * glyphs-msw.c - (reinit_image_instantiator_format_create_glyphs_mswindows): Fix - macro calls. - -1999-09-28 Olivier Galibert <galibert@pobox.com> - - * symsinit.h: Added lots of prototypes. - - * symeval.h: Added defsymbol_nodump declaration. - - * symbols.c (find_symbol_value): Lame attempt at making the - startup go further. - (defsymbol_nodump): Added. - - * mule-charset.c: Collapsed global lisp objects arrays in one - dumpable structure. - - * lrecord.h: Added some flags. - - * lisp.h: Added dumped flag to dynarrs. Added dumpstruct - declaration. - - * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): Don't - staticpro dynamic variables. - - * glyphs.c (reinit_specifier_type_create_image): Added. - (image_instantiator_format_create): Dump image instantiator format - dynarr. - (reinit_image_instantiator_format_create): Added. - - * emacs.c (main_1): Added reinits calls. - - * dynarr.c: Protect dumped dynarrays from going berzek in free or - realloc. - - * specifier.h (INITIALIZE_SPECIFIER_TYPE): Don't staticpro dynamic - variables. - * specifier.c (specifier_type_create): Dump the specifier type - dynarr. - (reinit_specifier_type_create): Added. - * console.h (INITIALIZE_CONSOLE_TYPE): Don't staticpro dynamic - variables. - * console.c (console_type_create): Dump the console type dynarr. - (reinit_vars_of_console): Extracted from vars_of_console. - (reinit_complex_vars_of_console): Extracted from - complex_vars_of_console - * window.c (reinit_vars_of_window): Extracted from vars_of_window. - * toolbar.c (reinit_specifier_type_create_toolbar): Added. - * search.c (reinit_vars_of_search): Extracted from vars_of_search. - * objects.c (reinit_specifier_type_create_objects): Added. - (reinit_vars_of_objects): Extracted from vars_of_objects. - * lstream.c (reinit_vars_of_lstream): Extracted from - vars_of_lstream. - * lread.c (reinit_vars_of_lread): Extracted from vars_of_lread. - * gutter.c (reinit_specifier_type_create_gutter): Added. - * glyphs-x.c (reinit_image_instantiator_format_create_glyphs_x): - Added. - * glyphs-widget.c - (reinit_image_instantiator_format_create_glyphs_widget): Added - * glyphs-msw.c - (reinit_image_instantiator_format_create_glyphs_mswindows): Added. - * glyphs-eimage.c - (reinit_image_instantiator_format_create_glyphs_eimage): Added. - * event-stream.c (reinit_vars_of_event_stream): Extracted from - vars_of_event_stream - * eval.c (reinit_vars_of_eval): Extracted from vars_of_eval. - * device.c (reinit_vars_of_device): Extracted from vars_of_device. - * console-x.c (reinit_console_type_create_x): Added. - * console-tty.c (reinit_console_type_create_tty): Added - * console-stream.c (reinit_console_type_create_stream): Added. - (init_console_stream): If PDUMP, always reinitialise basic - devices. - * console-msw.c (reinit_console_type_create_mswindows): Added. - * buffer.c (reinit_vars_of_buffer): Extracted from - init_vars_of_buffer. - (reinit_complex_vars_of_buffer): Extracted from - complex_vars_of_buffer - - * alloc.c: Further with the portable dumping, the revenge. - (dumpstruct): Added. - (reinit_alloc_once_early): Extracted from init_alloc_once_early. - - * specifier.c (sizeof_specifier): Correct size computation. - (make_specifier_internal): Ditto. - -1999-09-27 Olivier Galibert <galibert@pobox.com> - - * alloc.c: Further with the portable dumping. - -1999-09-27 Martin Buchholz <martin@xemacs.org> - - * glyphs-x.c (update_widget_face): Remove bogus cast - - * data.c (sign_extent_lisp): - * data.c (check_int_range): - * data.c (Faref): - * data.c (Faset): - * data.c (number_char_or_marker_to_int): - * data.c (number_char_or_marker_to_double): - * data.c (Frem): - * data.c (Fmod): - * extents.c (print_extent_1): - * fns.c (print_bit_vector): - * fns.c (Flength): - * fns.c (Fsafe_length): - * fns.c (copy_list): - * fns.c (Fsubseq): - * fns.c (Felt): - * fns.c (Flast): - * fns.c (Fnbutlast): - * insdel.h: - * marker.c (print_marker): - * syntax.h: - * bytecode.c (bytecode_arithcompare): - * bytecode.c (bytecode_arithop): - * lisp.h: - * lisp.h (EXTERNAL_LIST_LOOP_DELETE_IF): - * lisp.h (TRUE_LIST_P): - * lisp.h (CHECK_TRUE_LIST): - * lisp.h (bit_vector_length): - * lisp.h (GCPRO4): Make consistent. - * lisp.h (NGCPRO4): Make consistent. - * lisp.h (NNGCPRO4): Make consistent. - * alloc.c (Fmake_list): - * alloc.c (Fmake_string): - Use proper 64-bit types, e.g. EMACS_INT or size_t instead of int. - This should make all arithmetic 64-bit clean. - - Use %ld with (long) casts in print statements of types with sizes - possibly larger than int. - - Following functions had mismatched prototypes!!: - do_marker_adjustment(), fixup_internal_substring(), scan_lists(), - char_quoted(), make_string_from_buffer(), - make_string_from_buffer_no_extents() - - The types of Bufpos, Bytind, Memind, Bytecount, Charcount, - Extcount are all now EMACS_INT. I hope to see the day when I can - create a buffer with more than INT_MAX characters, without having - 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): - 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! - -1999-09-27 Martin Buchholz <martin@xemacs.org> - - * cmdloop.c (num_input_keys): - * print.c (debug_temp): - * emacs.c (Vinfo_directory): - Delete unused variables - - * console-x.h (x_interline_space): Mark as unimplemented. - * redisplay-x.c (x_interline_space): Mark as unimplemented. - - * event-Xt.c (pending_timeouts): - * linuxplay.c (linuxplay_sndbuf): - * profile.c (QS*): - * search.c (searchbufs): - * specifier.c (specifier_type_entry_dynarr): - * undo.c (pending_boundary): - * event-stream.c (the_low_level_timeout_blocktype): - * extents.c (gap_array_marker_freelist): - * extents.c (extent_list_marker_freelist): - * print.c (being_printed): - * print.c (alternate_do_pointer): - * alloc.c (first_string_chars_block): - * alloc.c (current_string_chars_block): - * emacs.c (initial_argv): - * emacs.c (initial_argc): - * eval.c (lisp_eval_depth): - * free-hook.c (pointer_table): - * free-hook.c (free_queue): - * free-hook.c (current_free): - * free-hook.c (strict_free_check): - * redisplay.c (formatted_string_emchar_dynarr): - * redisplay.c (formatted_string_display_line): - * redisplay.c (formatted_string_extent_dynarr): - * redisplay.c (formatted_string_extent_start_dynarr): - * redisplay.c (formatted_string_extent_end_dynarr): - * redisplay.c (updating_line_start_cache): - * redisplay.c (last_display_warning_tick): - * redisplay.c (display_warning_tick): - * redisplay.c (internal_cache): - * window.c (Vwindow_configuration_free_list): - Make static. - - * redisplay.c (Vinitial_window_system): Make CONST. - -1999-09-24 Martin Buchholz <martin@xemacs.org> - - * redisplay-tty.c (term_get_fkeys_1): Minor aesthetic improvements. - - * doprnt.c (get_doprnt_args): Use int, not short, with va_arg. - -1999-09-24 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (output_display_line): only clear the borders - if we are not displaying the gutter. - -1999-09-24 Jan Vroonhof <vroonhof@math.ethz.ch> - - * frame-x.c (x_any_window_to_frame): Let Xt find the widget and - then use x_any_widget_or_parent_to_frame(). - (x_find_frame_for_window): remove special cases. - -1999-09-24 Andy Piper <andy@xemacs.org> - - * scrollbar-x.c (x_window_is_scrollbar): deleted. - * scrollbar-x.h: ditto. - -1999-09-23 Martin Buchholz <martin@xemacs.org> - - * alloc.c (this_marks_a_marked_record): Remove. - - * buffer.c (mark_buffer): - * buffer.c (nuke_all_buffer_slots): - * console.c (mark_console): - * console.c (nuke_all_console_slots): - * frame.c (mark_frame): - * frame.c (nuke_all_frame_slots): - Treat MARKED_SLOT() macros consistently. - - * device.h (error_check_device_type): - * faces.c (face_getprop): - * fileio.c (DRIVE_LETTER): - * filelock.c (lock_file_1): - * frame-x.c (x_create_widgets): - * frame.h (error_check_frame_type): - * keymap.c (print_keymap): - * keymap.c (Fkey_description): - * keymap.c (where_is_recursive_mapper): - * mule-charset.h (CHARSET_LEADING_BYTE): - * objects-msw.c (mswindows_color_instance_hash): - * objects.c (color_instance_equal): - * objects.h (struct color_specifier): - * objects.h (struct font_specifier): - * objects.h (struct face_boolean_specifier): - * opaque.h (get_opaque_ptr): - * opaque.h (set_opaque_ptr): - * process-unix.c (set_socket_nonblocking_maybe): - * specifier.h (SPECIFIER_TYPE_P): - * symbols.c (store_symval_forwarding): - * syssignal.h (EMACS_KILLPG): - * terminfo.c (emacs_tparam): - * glyphs.c (glyph_putprop): - * glyphs.c (glyph_remprop): - * glyphs.c (Fimage_instance_subwindow_id): - * window.c (mark_window): - * window.c (mark_window_config): - * window.c (Fset_window_configuration): - * window.c (save_window_save): - * eval.c (Fuser_variable_p): - * eval.c (Fcommand_execute): - * eval.c (Feval): - * eval.c (Ffuncall): - * lisp.h (XPNTR): - * lisp.h (INT_OR_FLOATP): - * lisp.h (GC_INT_OR_FLOATP): - * lisp.h (XFLOATINT): - * lisp.h (IS_ANY_SEP): - * mule-ccl.c (Fccl_execute): - * mule-ccl.c (Fccl_execute_on_string): - * redisplay-x.c (x_output_string): - Remove redundant extra parentheses. - -1999-09-22 Martin Buchholz <martin@xemacs.org> - - * chartab.c (word_boundary_p): Add prototype for warning avoidance. - * eval.c (PRIMITIVE_FUNCALL): ANSIfy - * free-hook.c (fun_ptr): ANSIfy - * getloadavg.c: Remove declaration for errno. - * gui.c (allocate_gui_item): ANSIfy - * gui.h (allocate_gui_item): ANSIfy - * mule-ccl.c (resolve_symbol_ccl_program): Make static - * realpath.c: Remove K&R support. - * redisplay-x.c (x_output_display_block): Don't shadow previous local - * glyphs-widget.c (layout_instantiate): Don't shadow previous local - * gutter.c (get_gutter_coords): Make static. - * lread.c (locate_file_map_suffixes): Make static. - * ralloc.c (relinquish): ANSIfy - * redisplay.c: - * lisp.h: - Move prototypes from redisplay.c to lisp.h - -1999-09-22 Martin Buchholz <martin@xemacs.org> - - * glyphs-x.c (x_widget_set_property): - - Remove unnecessary initialization. - - Use char*, not Bufbyte *, with GET_C_STRING_OS_DATA_ALLOCA - * glyphs-x.c (x_widget_instantiate): - - Use char*, not Bufbyte *, with GET_C_STRING_OS_DATA_ALLOCA - * unexelf.c (unexec): - Add cast for C++ compilability. - * redisplay.h: - Fix a typo. - * ralloc.c (r_alloc_reinit): - SET_FUN_PTR was broken wrt ANSI aliasing! - To compensate, use __typeof__ when using gcc, else live with - possible (but rare) warnings. - * ralloc.c (init_ralloc): - Ditto - * ralloc.c: Use the real dlmalloc prototype for __morecore. - * lread.c (locate_file_map_suffixes): - * input-method-xlib.c (XIM_init_frame): - - Xlib functions should use XPointer, not XtPointer. - * input-method-xlib.c (XIM_delete_frame): - - Xlib functions should use XPointer, not XtPointer. - * input-method-xlib.c (IMDestroyCallback): - - Simplify. - - XFRAME (obj) can never be NULL, so don't test for it. - * gutter.h: - Add GUTTER_POS_LOOP for iterating over all gutter_pos'es - * gutter.c (SET_GUTTER_WAS_VISIBLE_FLAG): - Run c-backslash-region on macro body. - * gutter.c (gutter_was_visible): - Remove redundant parens - this is not a macro. - * gutter.c (redraw_exposed_gutters): - Use GUTTER_POS_LOOP. - * gutter.c (gutter_specs_changed): - Use GUTTER_POS_LOOP. - * gutter.c (gutter_geometry_changed_in_window): - Use GUTTER_POS_LOOP. - * gutter.c (update_frame_gutters): - Use GUTTER_POS_LOOP. - * gutter.c (init_frame_gutters): - Use GUTTER_POS_LOOP. - * file-coding.c (determine_real_coding_system): - Fix C++ compile error. - * emodules.c (find_make_module): - Cast return value from xrealloc - * emacs.c (Fkill_emacs): - Use __typeof__, when available. - * emacs.c (voodoo_free_hook): - Use __typeof__, when available. - (Unfortunately, the type of __free_hook is glibc-version-dependent) - * dired.c (user_cache): Use Bufbyte *, not char * - * dired.c (Fuser_name_all_completions): Ditto. - -1999-09-22 Andy Piper <andy@xemacs.org> - - * redisplay.c (redisplay_frame): reset the gutter display lines - when we reset the subwindows. - - * gutter.c (reset_gutter_display_lines): new function. - - * window.c (Flast_nonminibuf_window): new function equivalent to - FRAME_LAST_NONMINIBUF_WINDOW (). - (syms_of_window): declare it. - - * redisplay.c (create_string_text_block): don't add bogus eol - markers to gutter display lines. - - * glyphs.c (reset_subwindow_cachels): make sure we unmap - subwindows using unmap_subwindow so that expose events get - registered correctly. - - * window.c (window_scroll): use Vwindow_pixel_scroll_increment to - determine how much to scroll the window. - (vars_of_window): Vwindow_pixel_scroll_increment is a new - variable. - -1999-09-20 Robert Pluim <rpluim@nortelnetworks.com> - - * glyphs-x.c (update_widget_face): Guard fontList declaration for - non-motif uses. - -1999-09-20 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_update_subwindow): update faces. - -1999-09-19 Andy Piper <andy@xemacs.org> - - * glyphs.c (update_frame_subwindows): update if faces have - changed. - - * glyphs-x.c (x_widget_instantiate): create the clip widget using - lwlib rather than directly. - (x_finalize_image_instance): delete the clip widget using lwlib. - (x_update_subwindow): update widget faces. - (update_widget_face): new function for updating the face - properties of a widget. - (x_widget_set_property): update widget faces. - - * lwlib-Xlw.c (xlw_create_clip_window): new function. We need to - manage the clip widgets using lwlib so that we can delete them in - a safe manner. - -1999-09-16 Martin Buchholz <martin@xemacs.org> - - * lisp-union.h: - * lisp-disunion.h: - Define new, potentially faster INT arithmetic macros - INT_PLUS, INT_MINUS, INT_PLUS1, INT_MINUS1 - * bytecode.c (execute_optimized_function): - Use new macros. - Fix metering code - * bytecode.c (bytecode_negate): - Optimize for integer case. - -1999-08-29 Andreas Jaeger <aj@arthur.rhein-neckar.de> - - * m/mips.h: Support for mips-linux: Add !linux around places - that are not valid for linux, define TEXT_START, DATA_START, - DATA_SEG_BITS. - -1999-09-16 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_output_subwindow): clip subwindows - that don't completely fit on-screen rather than just unmapping - them. - - * glyphs.h: change signature of map_subwindow. - - * glyphs.c (map_subwindow): add display_glyph_area to the - signature. make sure the mapped area saved in the subwindow_cachel - reflects this. - (Fforce_subwindow_map): make a no-op. I don't think this does - anything useful. - - * glyphs-x.h (struct x_subwindow_data): save the Display rather - than the Screen. Add a clipwindow and clipwidget handle. - (IMAGE_INSTANCE_X_CLIPWINDOW): new accessor. - (IMAGE_INSTANCE_X_CLIPWIDGET): ditto. - (XIMAGE_INSTANCE_X_CLIPWIDGET): ditto. - (XIMAGE_INSTANCE_X_CLIPWINDOW): ditto. - - * glyphs-x.c (x_finalize_image_instance): destroy the clipwidget - as well as the widget itself. - (x_unmap_subwindow): unmap the clipwindow and clipwidget rather - than the widgets and subwindows themselves. move the widget inside - the clipwidget. - (x_subwindow_instantiate): hold onto the Display rather than the - Screen. allocate a clipwindow to put the subwindow inside. - (x_resize_subwindow): use saved Display directly. - (x_widget_instantiate): allocate a clipwidget of type EmacsManager - to put widgets inside. - - * glyphs-widget.c: remove group stuff. - - * glyphs-msw.h (struct mswindows_subwindow_data): new structure to - hold the clipwindow. - (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW): new accessor. - (XIMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW): ditto. - - * glyphs-msw.c: remove group stuff. - (mswindows_finalize_image_instance): destroy clipwindow as well as - the widget itself. - (mswindows_unmap_subwindow): unmap the clipwindow rather than the - widget. - (mswindows_map_subwindow): ditto. move the widget within the - clipwindow. - (mswindows_subwindow_instantiate): allocate and initialize - mswindows_subwindow_data. allocate a clipwindow with the subwindow - as a child. - (mswindows_widget_instantiate): ditto. - (mswindows_control_wnd_proc): new function that allows us to - propagate events from the widget to the main windows control loop. - - * device-msw.c (mswindows_init_device): register new widget clip window - class. - - * console.h (struct console_methods): add display_glyph_area to - map_window. - - * console-msw.h: declare new window class and wnd proc for - widgets. - -1999-09-14 Martin Buchholz <martin@xemacs.org> - - * general.c: - * eldap.c: - Move symbols used only by eldap.c into eldap.c as statics. - -1999-09-09 Martin Buchholz <martin@xemacs.org> - - * window.c (syms_of_window): - * symbols.c (syms_of_symbols): - * redisplay.c (syms_of_redisplay): - * print.c (syms_of_print): - * lisp.h: - * intl.c (syms_of_intl): - * general.c (syms_of_general): - * frame.c (syms_of_frame): - * fileio.c (syms_of_fileio): - * file-coding.h: - * file-coding.c (syms_of_file_coding): - * extents.c (syms_of_extents): - * event-stream.c (syms_of_event_stream): - * event-stream.c (Fnext_event): - * device.c (syms_of_device): - * data.c (syms_of_data): - * casetab.c (syms_of_casetab): - * casetab.c (check_case_table): - * callint.c (syms_of_callint): - * buffer.c (syms_of_buffer): - Delete unused C symbols: - Qbuffer_file_name, Qbuffer_undo_list, Quser_variable_p, - Qcurrent_prefix_arg, Qtranslate_table, Qkeywordp, - Qnumber_or_marker_p, Qcons, Qkeyword, Qignore, Qdelete_device, - Qcommand_execute, Qglyph_invisible, - Qbuffer_file_coding_system, Qfile_name_handler_alist, - Qframe_x_p, Qframe_tty_p, Qblack, Qkeyboard, Qmenubar, Qpath, - Qvector, Qwhite, Qcase, Qdomain, Qalternate_debugging_output, - Qprint_escape_newlines, Qprint_readably, Qfloat_output_format, - Qwindow_scroll_functions, Qfboundp, Qscroll_up, Qscroll_down - - Rename symbols as required by the CHECK_RECORD macro: - - Qcase_table_p to Qcase_tablep - - Qcoding_system_p to Qcoding_systemp - - * debug.h: - * debug.c (syms_of_debug): - Make debug.c's internal Lisp_Objects static. - - * events.c (vars_of_events): - * events.c (syms_of_events): - Use regular old defsymbol instead of KEYSYM + staticpro(). - - * select-x.c (CHECK_CUTBUFFER): - Rewrite in accordance with coding standards. - - * keymap.c (syms_of_keymap): - Use SPC in the same way as RET, TAB, etc. - -1999-08-27 Jan Vroonhof <vroonhof@math.ethz.ch> - - * xemacs-20/src/menubar-x.c (make_dummy_xbutton_event): Don't add - offset twice if HAVE_WMCOMMAND is defined. - -1999-09-13 Mike McEwan <mike@lotusland.demon.co.uk> - - * redisplay-x.c (x_output_vertical_divider): make sure - shadow_thickness is positive. - -1999-09-10 Julian Back <jback@rudd.compulink.co.uk> - - * process-nt.c (nt_create_process): fixup to cope with - Vprocess_environment. - -1999-09-02 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_output_layout): call output - routines with clear_clip false. output layout borders with text - correctly. - - * redisplay-msw.c (mswindows_output_blank): call output routines - with clear_clip true. - (mswindows_output_string): ditto. - (mswindows_output_display_block): ditto. - - * redisplay-x.c (x_output_display_block): call output routines - with clear_clip true. - - * redisplay.h: fix output routines for clear_clip parameter. - - * redisplay-output.c (redisplay_output_layout): cope with glyphs - in the border. - - * glyphs-widget.c (layout_instantiate): deal with border glyphs. - (check_valid_glyph_or_instantiator): renamed from - check_valid_glyph_or_image. - (check_valid_border): allow glyphs or their instantiators. - (check_valid_glyph_or_instantiator_list): renamed from - check_valid_glyph_or_image_list, - (glyph_instantiator_to_glyph): new function. make sure a glyph is - a glyph and not an instantiator. - (substitute_keyword_value): new function. replace a keyword value - with a new one. - -1999-09-01 Andy Piper <andy@xemacs.org> - - * glyphs.c (string_set_property): new function to set the data of - a string. - (image_instantiator_format_create): use it. - -1999-09-07 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fmapc): Rename back to Fmapc_internal. - -1999-07-30 Gleb Arshinov <gleb@cs.stanford.edu> - - * ntheap.h: CONST (semantically constant) name field of file_data - struct - - * unexnt.c (open_output_file): match function definition with - function declaration - - * editfns.c: #include "sysfile.h" for getcwd() prototype - - * gif_io.c: #include "sysfile.h" for close() prototype - -1999-09-02 Martin Buchholz <martin@xemacs.org> - - * elhash.c: - * elhash.h: - Change the :type keyword to :weakness, for compatibility with the - GNU Emacs 20.5 hash table implementation. - Keep (but don't document) the :type keyword for compatibility. - Obsolete function hash-table-type - General cleanup. - Define function sxhash for compatibility with Common Lisp and GNU Emacs. - -1999-09-01 Martin Buchholz <martin@xemacs.org> - - * floatfns.c (arith_error): - * floatfns.c (range_error): - * floatfns.c (range_error2): - * floatfns.c (domain_error): - * floatfns.c (domain_error2): - * lrecord.h (LRECORDP): - * console-x.h (X_ERROR_OCCURRED): - * console-x.h (HANDLING_X_ERROR): - * chartab.c (CATEGORYP): - * buffer.h (XCHAR_OR_CHAR_INT): - Remove redundant and confusing parentheses. - - * redisplay-output.c (redisplay_clear_to_window_end): - Remove redundant initialization. - - * redisplay.h: - * redisplay-msw.c: - * redisplay-x.c: - Move declarations of bevel_modeline() into redisplay.h. - -1999-08-30 Olivier Galibert <galibert@pobox.com> - - * lisp.h: Add staticpro_nodump for undumped staticpro-ing. - * alloc.c: Add staticpro_nodump for undumped staticpro-ing. Add - alignment information for dumped data. Enhance - descriptions. Phase out Vterminal_* variables while - dumping. - * lrecord.h: Add chained descriptions and automagically-reset - lisp_objects to the description system. - - * console-stream.h: Declare the Vterminal_* variables. - - * buffer.c: Don't dump Vbuffer_alist, Vbuffer_defaults and - Vbuffer_local_symbols. - * console.c: Don't dump Vconsole_list, Vconsole_defaults and - Vconsole_local_symbols. - * eval.c: Don't dump Qunbound_suspended_errors_tag. - * lread.c: Don't dump Vread_buffer_stream. - * lstream.c: Don't dump Vlstream_free_list[]. - * search.c: Don't dump last_thing_searched. - * window.c: Don't dump minibuf_window and - Vwindow_configuration_free_list[]. - - * faces.c: Add face description. - * fns.c: Add bit_vector description. - * glyphs.c: Add image specifier description. - * objects.c: Add color, face and face boolean specifiers descriptions. - * opaque.c: Add opaque description. Don't dump Vopaque_ptr_free_list. - * rangetab.c: Add range table description. - * specifier.c: Add specifier and specifier methods description. - * specifier.h: Add specifier extra description support. - - * symbols.c: Fix symbol_value_buffer_local_description. - - * gdbinit (Lisp): Add opaque_ptr, remove opaque_list. - -1999-09-02 Hrvoje Niksic <hniksic@srce.hr> - - * extents.c (extent_remprop): Get extent's plist address - correctly. - -1999-08-31 Andy Piper <andy@xemacs.org> - - * xmu.h: define Xmu/Converters.h things. - -1999-08-31 Andy Piper <andy@xemacs.org> - - * opaque.c (equal_opaque_ptr): define. - (hash_opaque_ptr): define. - - * xmu.h: define Xmu/Misc.h things. - -1999-08-17 MORIOKA Tomohiko <tomo@etl.go.jp> - - * file-coding.c (determine_real_coding_system): Treat `coding:' - cookie. - -1999-08-16 MORIOKA Tomohiko <tomo@etl.go.jp> - - * file-coding.c (struct decoding_stream): New member `counter'. - (reset_decoding_stream): Initialize `counter'. - (decode_coding_ucs4): Use `counter'. - (decode_coding_utf8): Likewise. - -1999-08-31 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_normalize_glyph_area): make sure - the clip offset doesn't exceed the height we have available to - show. - - * window.h (struct window): add top_yoffset and left_xoffset for - pixel scrolling. - (WINDOW_TEXT_TOP_CLIP): new macro. - - * window.c (window_scroll): add behaviour for pixel-scrolling of - tall lines. - - * redisplay.h (struct display_line): add top_clip. - (DISPLAY_LINE_HEIGHT): adjust for top_clip. - (DISPLAY_LINE_YPOS): ditto. - - * redisplay.c (position_redisplay_data_type): add - start_col_xoffset to prepare for pixel-based h-scrolling. - (WINDOW_SCROLLED): new macro. - (next_tab_position): use it. - (add_glyph_rune): use new hscoll vars. - (create_text_block): ditto. - (generate_displayable_area): adjust off-by-one error. - (regenerate_window): take top_clip into account. - (regenerate_window_extents_only_changed): ditto. - (regenerate_window_incrementally): ditto. - - * redisplay-x.c (x_output_display_block): use DISPLAY_LINE_YPOS, - DISPLAY_LINE_HEIGHT and DISPLAY_LINE_YEND macros. - (x_output_string): ditto. - (x_output_blank): ditto. - (x_output_hline): ditto. - (x_output_eol_cursor): ditto. - - * redisplay-output.c (output_display_line): allow for - top_clip. use DISPLAY_LINE_YPOS, DISPLAY_LINE_HEIGHT and - DISPLAY_LINE_YEND macros. - (redisplay_output_layout): output strings in layouts correctly. - (redisplay_clear_clipped_region): allow for top_clip. - (redisplay_calculate_display_boxes): ditto. - - * redisplay-msw.c (mswindows_output_blank): use DISPLAY_LINE_YPOS, - DISPLAY_LINE_HEIGHT and DISPLAY_LINE_YEND macros. - (mswindows_output_cursor): ditto. - (mswindows_output_string): ditto. - (mswindows_redraw_exposed_window): ditto. - (mswindows_output_display_block): ditto. - - * gutter.c: new specifier type gutter-size. - (gutter_size_validate): validate gutter-size specifier. - (Fgutter_size_specifier_p): predicate for gutter-size. - (Fredisplay_gutter_area): allow the gutter area to be redisplayed - under user contol, like Fredisplay_echo_area. - (syms_of_gutter): add new functions. - (specifier_type_create_gutter): add new specifier. - (specifier_vars_of_gutter): change specifier types of *-height to - gutter-size. - - * glyphs.c (glyph_width): make work with image instances. - - * console.h (struct console_methods): change api of output_string. - - * glyphs-x.c (x_map_subwindow): move before mapping as reported by - Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> - -1999-08-30 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_finalize_image_instance): X_MASK -> PIXMAP_MASK - for assignment. - (init_image_instance_from_x_image): ditto. - (x_xpm_instantiate): ditto. - (x_colorize_image_instance): ditto. Reported by Richard Cognot - <cognot@ensg.u-nancy.fr> - -1999-08-29 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_widget_instantiate): move font initialisation so - that it doesn't get saved in the user defined args. - (x_tab_control_instantiate): Set the fg color of the tab's - children. - (x_tab_control_set_property): ditto. - -1999-08-27 Damon Lipparelli <lipp@primus.com> - - * events.h (XTIMEOUT): must preface Lisp_Timeout with ``struct'' - (XSETTIMEOUT): fixup typo - -1999-08-11 Jan Vroonhof <vroonhof@math.ethz.ch> - - * syntax.c (scan_words): Unified Mule and Non-mule scanning. - Word boundary search looks back instead of forward so that it - doesn't peek over the limit. - -1999-08-20 Olivier Galibert <galibert@pobox.com> - - * config.h.in: Add PDUMP define. - * emacs.c (Fdump_emacs): Hackish, call pdump() if configured in. - - * lrecord.h: Enhance description system. - * alloc.c: Fix vector and string description. Add portable - dumper enumeration fonctions. - - * symbols.c: Fix symbols description. Add symbol_value_forward - description. - * eval.c: Add subr description. - * elhash.c (CLEAR_HENTRY): Clean value pointer too. Fix hash - table description. - (remhash_1): CLEAR_HENTRY evaluates the parameter two times now. - -1999-08-20 Olivier Galibert <galibert@pobox.com> - - * opaque.c: Kill opaque lists, make Lisp_Opaque_Ptr a lrecord of - its own. - * opaque.h: Ditto. - - * eval.c (eval_in_buffer_trapping_errors): - (run_hook_trapping_errors): - (safe_run_hook_trapping_errors): - (call0_trapping_errors): - (call1_trapping_errors): - (call2_trapping_errors): OPAQUEP -> OPAQUE_PTRP. make_opaque_ptr - now takes a non-const void *. - -1999-08-20 Olivier Galibert <galibert@pobox.com> - - * opaque.c: Remove make_opaque_long. - - * opaque.h: Remove everything opaque_long related. - - * eval.c (vars_of_eval): Make Qunbound_suspended_errors_tag an - opaque_ptr. - - * emacs.c (main_1): Remove make_opaque_long from comment. - -1999-08-20 Olivier Galibert <galibert@pobox.com> - - * event-stream.c (mark_timeout): - (print_timeout): - (event_stream_generate_wakeup): - (event_stream_resignal_wakeup): - (event_stream_disable_wakeup): - (event_stream_wakeup_pending_p): - (vars_of_event_stream): Lisp_Timeout is now a lrecord. - - * events.h (struct Lisp_Timeout): Added. - -1999-08-24 Andy Piper <andy@xemacs.org> - - * console-x.h: declare new pixmap signatures. - -1999-08-23 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_update_subwindow): make sure the widget size is - maintained after an update. - - * event-Xt.c (emacs_Xt_handle_magic_event): use - find_matching_subwindow to check whether the exposure is totally - inside a subwindow, if it is then ignore it. - - * glyphs.c (find_matching_subwindow): new function. - - * toolbar-x.c (x_draw_blank_toolbar_button): use new - x_output_shadows signature. - (x_output_toolbar_button): use new x_output_x_pixmap signature. - - * redisplay.h (struct display_box): new structure. - (struct display_glyph_area): ditto. - declare new display_box functions. - - * redisplay-x.c (x_output_pixmap): update for new display - box stuff. - (x_bevel_area): update to allow multiple edge styles and border - segments. - (x_output_display_block): update for new display_box stuff and - signatures. - (x_clear_region): ditto. - (x_output_x_pixmap): ditto. adjust offsets rather than clip. - (console_type_create_redisplay_x): declare new console methods. - (x_output_vertical_divider): update for new bevel_area signature. - (x_output_shadows): update to allow selective drawing of edges. - - * redisplay-tty.c (tty_output_display_block): do nothing for - layouts. - - * redisplay-output.c (redisplay_output_subwindow): convert to use - display_box structure, this allows us to put subwindows anywhere - with any offset, useful for layout glyphs. - (redisplay_output_layout): new function. output a layout and its - sub-glyphs. - (redisplay_output_pixmap): new modular function combining generic - parts of the X and mswindows versions. convert to use display_box - structures. - (redisplay_clear_clipped_region): new function. clear the area a - glyph is going into. - (redisplay_normalize_glyph_area): new function. calculate the - bounds of a display_glyph_area given a display_box. - (redisplay_normalize_display_box): new function. shrink a - display_box to enclose a display_glyph_area. - (redisplay_display_boxes_in_window_p): check whether the input - display_box and display_glyph_area are actually in a window. - (redisplay_calculate_display_boxes): calculate display boxes based - on conventional display_line metrics. - (bevel_modeline): update for new bevel_area signature. - - * redisplay-msw.c (mswindows_output_blank): update for new - display_box stuff. - (mswindows_output_string): ditto. - (mswindows_output_dibitmap): ditto. - (mswindows_output_dibitmap_region): ditto. - (mswindows_output_pixmap): ditto. - (mswindows_bevel_area): update to allow multiple edge styles and - border segments. - (mswindows_output_display_block): update for new display_box stuff - and signatures. - (mswindows_clear_region): ditto. - (console_type_create_redisplay_mswindows): declare new console methods. - - * lisp.h (edge_style): new enum. - declare display_box and display_glyph_area. - - * gutter.c (output_gutter): update for new bevel_area signature. - - * glyphs.h (image_instance_type): add layout. - (IMAGE_LAYOUT_MASK): ditto. - (LAYOUT_IMAGE_INSTANCEP): new macro. - (CHECK_LAYOUT_IMAGE_INSTANCE): ditto. - (struct Lisp_Image_Instance): add offsets for layout and the - layout type itself. move mask here also. - (IMAGE_INSTANCE_LAYOUT_CHILDREN): new macro. - (IMAGE_INSTANCE_LAYOUT_BORDER): ditto. - (XIMAGE_INSTANCE_LAYOUT_CHILDREN): ditto. - (XIMAGE_INSTANCE_LAYOUT_BORDER): ditto. - - * glyphs.c (mark_image_instance): update for layouts. - (print_image_instance): ditto. - (image_instance_equal): ditto. - (image_instance_hash): ditto. - (allocate_image_instance): initialise offsets for layout. - (decode_image_instance_type): update for layouts. - (encode_image_instance_type): ditto. - (Fimage_instance_height): ditto. - (Fimage_instance_width): ditto. - (allocate_glyph): ditto. - (glyph_width): allow image instances as an argument. update for layouts. - (glyph_height_internal): ditto. - (syms_of_glyphs): add layout symbols. - - * glyphs-x.h (struct x_image_instance_data): remove mask entry. - (IMAGE_INSTANCE_X_MASK): update. - - * glyphs-x.c (x_label_instantiate): new function. instantiate a - label. - (image_instantiator_format_create_glyphs_x): initialise new layout - glyph type. - - * glyphs-widget.c: new layout type. - (check_valid_orientation): new keyword checker for layouts. - (check_valid_justification): ditto. - (check_valid_border): ditto. - (check_valid_glyph_or_image_list): ditto. - (layout_possible_dest_types): new function for layout glyph type. - (layout_normalize): ditto. - (layout_instantiate): ditto. - (syms_of_glyphs_widget): new keywords for layout. - (image_instantiator_format_create_glyphs_widget): initialise the - layout glyph type. - - * glyphs-msw.h (struct mswindows_image_instance_data): remove mask - argument. - (IMAGE_INSTANCE_MSWINDOWS_MASK): update. - - * glyphs-msw.c: declare layout format. - (image_instantiator_format_create_glyphs_mswindows): initialise it. - - * general.c: new symbols for layouts. - - * console.h (struct console_methods): new console methods for - outputting pixmaps and strings. - -1999-08-23 Didier Verna <didier@xemacs.org> - - * sound.c: revert the renaming of `bell_volume' to `Vbell_volume' - and `bell_inhibit_time' to `Vbell_inhibit_time'. - -1999-08-18 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_output_subwindow): disable - clipping attempt. - -1999-08-17 Andy Piper <andy@xemacs.org> - - * gutter.c (redraw_exposed_gutter): handle degenerate case of no - area to expose or no gutter to display. - -1999-08-16 Charles G Waldman <cgw@fnal.gov> - - * sound.c: rename `bell_volume' to `Vbell_volume' and - `bell_inhibit_time' to `Vbell_inhibit_time'. - -1999-08-13 Charles G Waldman <cgw@fnal.gov> - - * sound.c: (bell-inhibit-time): New variable. - (ding): Use it. - (sound-alist): Fix docstring. - -1999-08-17 Andy Piper <andy@xemacs.org> - - * gui-x.c (button_item_to_widget_value): xstrdup name so that - deleting it is ok. - -1999-08-16 Jeff Miller <jmiller@smart.net> - - * syntax.c (scan_words): make compile. - -1999-08-16 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_output_subwindow): try and be more - relaxed about clipping possibilities. - - * glyphs-x.c (x_tab_control_set_property): free_widget_value_tree - rather than just the widget_value. - (x_update_subwindow): ditto. - (x_widget_instantiate): ditto. - - * gutter.c (output_gutter): shrink current display lines if - required. - -1999-08-15 Andy Piper <andy@xemacs.org> - - * redisplay.h: declare free_display_lines. - - * redisplay.c (free_display_lines): make non-static. - - * gutter.c (free_frame_gutters): use free_display_lines instead of - Dynarr_free. - (calculate_gutter_size): ditto. - -1999-08-12 Jan Vroonhof <vroonhof@math.ethz.ch> - - * eval.c (run_hook_with_args_in_buffer): GCPRO globals. - -1999-08-14 Andy Piper <andy@xemacs.org> - - * glyphs.c (update_subwindow_cachel): make it less brittle. - -1999-08-04 Mike Woolley <mike@bulsara.com> - - * scrollbar-msw.c (mswindows_handle_mousewheel_event): Fixed - problem in wheelmouse code occurring when the horizontal scrollbar - is enabled but not visible. - -1999-08-08 Andy Piper <andyp@beasys.com> - - * toolbar-msw.c (mswindows_redraw_frame_toolbars): new function. - (console_type_create_toolbar_mswindows): use it. - - * glyphs.c (Fset_image_instance_property): fiddly reorganisation. - - * redisplay-output.c (redisplay_output_display_block): unmap - subwindows in the block area before outputting the block. - - * event-msw.c (mswindows_wnd_proc): check the update rect before - painting and disable expose registration while painting. - - * glyphs.c (register_ignored_expose): check - hold_ignored_expose_registration before registering expose events. - - * redisplay.c (redisplay_frame): reset the subwindow cache before - displaying the gutter. - - * glyphs-msw.c (mswindows_map_subwindow): move the window before - mapping. - - * gutter.c (update_frame_gutters): check for glyphs_changed as if - it is the subwindow cache will have been reset. - -1999-08-06 Andy Piper <andyp@beasys.com> - - * gui-x.c (button_item_to_widget_value): cope with strings. - - * glyphs.h: declare global widget functions. - (IIFORMAT_HAS_SHARED_DEVMETHOD): new macro. - - * glyphs-x.c (x_combo_box_instantiate): do generic initialization - here. remove dead code. - (image_instantiator_format_create_glyphs_x): enable combo boxes - for Motif 2.0. - - * glyphs-widget.c (widget_instantiate_1): make non-static. - (tree_view_instantiate): renamed from combo_box_instantiate. - (image_instantiator_format_create_glyphs_widget): use new/changed methods. - - * glyphs-msw.c (mswindows_combo_box_instantiate): do generic - initialization here. - - * lwlib-Xm.c (xm_update_combo_box): new function. - (xm_update_one_widget): call it. - (xm_update_one_value): deal with combo boxes as well as lists. - (xm_create_combo_box): create a drop-down combo box. - - * toolbar-msw.c (mswindows_output_toolbar): call - mswindows_move_toolbar. - -1999-08-05 Andy Piper <andyp@beasys.com> - - * window.c (Fcurrent_pixel_column): new function. use display - lines to calculate pixel position of point. - * window.c (syms_of_window): declare it. - -1999-08-05 Andy Piper <andy@xemacs.org> - - * glyphs.c (check_for_ignored_expose): ignore exposures wholly - contained in our ignore list. - - * buffer.c (Frecord_buffer): add call to record-buffer-hook. - (syms_of_buffer): declare record-buffer-hook. - - * s/mingw32.h: define mousewheel things. - -1999-08-04 Mike Woolley <mike@bulsara.com> - - * windowsnt.h (_WIN32_WINNT): enable for win95 - - * s/cygwin32.h: define mousewheel things. - - * scrollbar-msw.h: declare mousewheel handler. - - * scrollbar-msw.c (mswindows_handle_mousewheel_event): new function. - -1999-08-04 Andy Piper <andy@xemacs.org> - - * gui-x.c (gui_items_to_widget_values): remove unused variable. - (gui_items_to_widget_values_1): ditto. - - * gui-x.h: unconditionally define since it is used everywhere. - -1999-08-04 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_finalize_image_instance): only free pixels if we - have that type of image. - -1999-07-30 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_unmap_subwindows): add comparison - subwindow to not unmap if required. - (redisplay_unmap_subwindows_maybe): comparison is Qnil. - (redisplay_unmap_subwindows_except_us): new function. - (redisplay_output_subwindow): use it to unmap windows in the area - we are displaying into. - - * glyphs.c (update_subwindow_cachel_data): always update as we - only ever get called when an update is required. - (update_subwindow_cachel): new function. sync a subwindow with its - cachel. - (Fresize_subwindow): use it. - (register_ignored_expose): make sure we set the tail correctly. - -1999-07-28 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_clear_bottom_of_window): remove - unneeded device. - - * gutter.c (redraw_exposed_gutter): unmap subwindows from the - whole gutter. - - * gui.h: declare parse_gui_item_tree_list and - parse_gui_item_tree_children. - - * gui.c (parse_gui_item_tree_item): new function for parsing item - lists into gui-item trees. - (parse_gui_item_tree_children): ditto. - (parse_gui_item_tree_list): ditto. - - * gui-x.h: declare gui_items_to_widget_values. - - * gui-x.c (gui_items_to_widget_values_1): new function for - recursively parsing gui-items into widget_values. - (gui_item_children_to_widget_values): ditto. - (gui_items_to_widget_values): ditto. - (sanity_check_lwlib): add widgets macrolets. - - * glyphs.h (IMAGE_INSTANCE_WIDGET_ITEMS): rename from *ITEM. - (XIMAGE_INSTANCE_WIDGET_ITEMS): ditto. - (IMAGE_INSTANCE_WIDGET_ITEM): rename from *SINGLE_ITEM. - (XIMAGE_INSTANCE_WIDGET_ITEM): ditto. - (struct expose_ignore): new structure for storing ignorable expose - events. - - * glyphs.c (valid_image_instantiator_format_p): fix so that using - a console-type as a locale works. - (mark_image_instance): ITEM->ITEMS. - (image_instance_equal): ditto. - (image_instance_hash): ditto. - (struct expose_ignore_blocktype): new blocktype. - (check_for_ignored_expose): new function. checks frame exposure - list for events to ignore. - (register_ignored_expose): new function. registers an expose event - as ignorable. - (unmap_subwindow): register the expose event as ignorable. - (vars_of_glyphs): initialise the exposure blocktype. - - * glyphs-x.c (x_finalize_image_instance): use lw_destroy_widget. - (x_update_subwindow): modify all widgets using widget_value tree - rather than just a single widget value. - (x_widget_instantiate): LWLIB_USES_MOTIF -> LWLIB_WIDGETS_MOTIF. - make sure widgets don't resize themselves. - (x_tab_control_instantiate): new function. use lwlib tab functions. - (x_tab_control_set_property): new function. - (image_instantiator_format_create_glyphs_x): add tab_control. - - * glyphs-widget.c (widget_text_to_pixel_conversion): calculate - slightly more sensibly. - (initialize_widget_image_instance): ITEM->ITEMS. - (widget_instantiate_1): parse gui items generically into the ITEMS - entry. - - * glyphs-msw.c (mswindows_update_subwindow): replace - SINGLE_ITEM->ITEM. - (mswindows_register_widget_instance): ditto. - (add_tree_item): modify to use new pre-initialised gui-item - structure. - (add_tab_item): ditto. - (mswindows_tab_control_instantiate): ditto. - (mswindows_tab_control_set_property): ditto. - (image_instantiator_format_create_glyphs_mswindows): predicate - existance of widgets on HAVE_WIDGETS. - - * frame.h (struct frame): add subwindow_exposures variables. - - * frame.c (allocate_frame_core): reset subwindow_exposures links. - - * event-msw.c (mswindows_wnd_proc): check for ignored - expose events before redrawing. - - * event-Xt.c (emacs_Xt_handle_magic_event): check for ignored - expose events before redrawing. - -1999-07-30 SL Baur <steve@xemacs.org> - - * scrollbar-x.c: should include EmacsFrame.h. - From Jeff Miller <jmiller@smart.net> - -1999-07-30 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.19 is released - -1999-07-27 Jeff Miller <jmiller@smart.net> - - * add a "#ifdef HAVE_MENUBARS" wrapper to gui.c around - menubar_show_keybindings. - -1999-07-23 SL Baur <steve@miho> - - * mule-charset.c (syms_of_mule_charset): Delete duplicated - definition of Qccl_program. - - * mule-ccl.h: Make a global declaration of it here. - -1999-07-20 Bob Weiner <weiner@beopen.com> - - * s/sco7.h: Added from rr@sco.com. - -1999-06-25 MORIOKA Tomohiko <tomo@etl.go.jp> - - * mule-ccl.c (ccl_driver): Fix `CCL_WriteMultibyteChar2'. - -1999-06-24 MORIOKA Tomohiko <tomo@etl.go.jp> - - * file-coding.c (mule_decode): Setup `str->ccl.last_block'. - (mule_encode): Likewise. - - * mule-ccl.c (Qccl_program): New variable. - (CCL_SUSPEND): New macro. - (CCL_INVALID_CMD): New macro. - (CCL_READ_CHAR): Don't regard as invalid command while processing - the last block even if input is empty; use - `CCL_STAT_SUSPEND_BY_SRC' instead of `CCL_STAT_SUSPEND'. - (vars_of_mule_ccl): Setup `Qccl_program' and `Qccl_program_idx'. - - * mule-ccl.h (CCL_STAT_SUCCESS): Moved from mule-ccl.c. - (CCL_STAT_SUSPEND_BY_SRC): Imported from Emacs 20.3.10. - (CCL_STAT_SUSPEND_BY_DST): Likewise. - (CCL_STAT_INVALID_CMD): Moved from mule-ccl.c; change value from 2. - (CCL_STAT_QUIT): Moved from mule-ccl.c; change value from 3. - -1999-05-04 Ken'ichi Handa <handa@gnu.org> - - * mule-ccl.h (struct ccl_program): New member stack_idx. - - * mule-ccl.c (ccl_prog_stack_struct): Declare it as static. - (ccl_driver): Setup stack_idx and ccl_prog correctly. Update them - before returing. - (setup_ccl_program): Initialize ccl->stack_idx to 0. - -1998-10-12 Kenichi Handa <handa@etl.go.jp> - - * mule-ccl.c (CCL_DECODE_SJIS, CCL_ENCODE_SJIS): Swap the - definitions. - -1998-08-18 Kenichi Handa <handa@etl.go.jp> - - * mule-ccl.c (CCL_READ_CHAR): If eof is encounterd while - processing the last block, don't just finish but processes eol - block of the current CCL program. - (ccl_driver): Add a new jump label ccl_repeat for the above - change. - -1998-04-15 Kenichi Handa <handa@etl.go.jp> - - * mule-ccl.c: Typo in comments fixed. - (Qccl_program_idx): New variables. - (CCL_ReadMultibyteChar2): Macro name changed from - CCL_ReadMultibyteCharacter. - (CCL_WriteMultibyteChar2): Macro name changed from - CCL_WriteMultibyteChar2. - (ccl_driver): Adjusted for the above changes. - (resolve_symbol_ccl_program): New function. - (Fccl_execute): The arg CCL-PROGRAM can be a symbol of CCL - program. If CCL-PRGRAM is a vector, convert symbols in it to ID - numbers by resolve_symbol_ccl_program. - (Fccl_execute_on_string): Likewise. - (Fregister_ccl_program): If the arg CCL-PRGRAM is a vector, - convert symbols in it to ID numbers by resolve_symbol_ccl_program. - -1998-01-21 Kenichi Handa <handa@etl.go.jp> - - * mule-ccl.h: (struct ccl_program): New member private_state. - - * mule-ccl.c - (CCL_Call): Fix the comment. - (CCL_ReadMultibyteCharacter, CCL_WriteMultibyteCharacter): New - macros for CCL Commands. - (EXCMD): New macro. - (ccl_driver): New case label `CCL_Extension'. - (setup_ccl_program): Initialize the member `private_state' of CCL. - -1999-07-08 Katsumi Yamaoka <yamaoka@jpl.org> - - * keymap.c (copy_keymap_internal): Inherit the default binding. - -1999-07-14 Kazuyuki IENAGA <kazz@imasy.or.jp> - - * event-Xt.c (handle_focus_event_1): Re-enable Motif/XIM to get - focus the event (XIM_focus_event). - (emacs_Xt_handle_magic_event): No side effect on Motif/XIM because - XIM_SetGeometry does nothing in input_method_motif.c, but re-unify - the interface for future use (XIM_SetGeometry). - * redisplay-x.c (x_output_string): Re-enable Motif/XIM to set spot - location (XIM_SetSpotLocation). - (x_output_eol_cursor): Ditto. - -1999-07-17 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * gdbinit (pobj): change lrecord_foo to &lrecord_foo to match - Olivier's change to lrecord.h of 1999-04-22 - -1999-07-20 Robert Pluim <rpluim@bigfoot.com> - - * gutter.c (redraw_exposed_gutter): Change type of pos from - enum toolbar_pos -> enum gutter_pos, since former is only defined - if toolbar support is. - -1999-07-19 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_resize_subwindow): cope with widgets as well as - subwindows. - - * gutter.c (gutter_validate): new function for the gutter specifier. - (specifier_type_create_gutter): declare specifier validator. - - * buffer.h (INC_CHARBYTIND): add for no error checking version. - -1999-07-18 Andy Piper <andy@xemacs.org> - - * redisplay.c (add_emchar_rune): use XSTRING_DATA not string_data. - - * glyphs-msw.c (console_type_create_glyphs_mswindows): add - resize_subwindow. - (mswindows_resize_subwindow): new function. - - * gutter.c (redraw_exposed_gutter): only reset the - current_display_lines if non-zero. - (Fgutter_pixel_height): new function. - (Fgutter_pixel_width): new function. - - * event-msw.c (mswindows_wnd_proc): set the mask of the parameter - we want to retrive from the tab control. - -1999-07-17 Andy Piper <andy@xemacs.org> - - * window.c (change_window_height): mark gutters changed when we're - done. - - * gutter.c (specifier_vars_of_gutter): make defaults more - sensible. - - * gutter.h (WINDOW_REAL_GUTTER_BORDER_WIDTH): adjust to be 0 for 0 - height gutter. - (DEFAULT_GUTTER_WIDTH): change. - (DEFAULT_GUTTER_BORDER_WIDTH): change. - -1999-07-18 Andy Piper <andy@xemacs.org> - - * redisplay.c (add_emchar_rune): use XSTRING_DATA not string_data. - -1999-07-16 Andy Piper <andy@xemacs.org> - - * frame.c (Fmake_frame): call init_frame_gutters(). - - * redisplay.c (add_emchar_rune): use string functions if we are - working with a string. - (position_redisplay_data_type): add string element. - -1999-07-15 Andy Piper <andy@xemacs.org> - - * winslots.h: add real_gutter_size slots to hold the actual gutter - size. This is important for autodetected sizes. - - * gutter.c (calculate_gutter_size): calculate size for gutters - that have 'autodetect size. - - * redisplay-msw.c (mswindows_output_vertical_divider): adjust - extent of divider for gutters. - - * redisplay-x.c (x_output_vertical_divider): adjust extent of - divider for gutters. - - * scrollbar.c (update_scrollbar_instance): adjust scrollbar - position to take into account the gutters. - - * redisplay.c (generate_modeline): adjust modeline position to - take into account the gutters. - -1999-07-14 Andy Piper <andy@xemacs.org> - - * gutter.c (frame_topmost_window): new function. - (frame_bottommost_window): ditto. - (frame_leftmost_window): ditto. - (frame_rightmost_window): ditto. - -1999-07-13 Andy Piper <andy@xemacs.org> - - * redisplay.c (calculate_display_line_boundaries): use text - boundaries so that gutters get handled properly. - -1999-07-12 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_widget_instantiate): set the font Motif-style if - we're using Motif. - - * redisplay-output.c (redisplay_clear_to_window_end): generalised - from redisplay-x.c - - * redisplay-x.c (redisplay_clear_to_window_end): moved to - redisplay.c - - * redisplay-msw.c (redisplay_clear_to_window_end): deleted. - - * gutter.c: new file - implements gutters. All new functions are - semantically equivalent to the toolbar functions. - (gutter_was_visible): new function. - (get_gutter_coords): ditto. - (output_gutter): ditto. - (clear_gutter): ditto. - (update_frame_gutters): ditto. - (redraw_exposed_gutter): ditto. - (redraw_exposed_gutters): ditto. - (free_frame_gutters): ditto. - (init_frame_gutters): ditto. - (decode_gutter_position): ditto. - (Fset_default_gutter_position): ditto. - (Fset_default_gutter_position): ditto. - (Fdefault_gutter_position): ditto. - (gutter_after_change): ditto. - (Fgutter_specifier_p): ditto. - (recompute_overlaying_specifier): ditto. - (gutter_specs_changed): ditto. - (default_gutter_specs_changed): ditto. - (gutter_geometry_changed_in_window): ditto. - (default_gutter_size_changed_in_window): ditto. - (default_gutter_border_width_changed_in_window): ditto. - (default_gutter_visible_p_changed_in_window): ditto. - (syms_of_gutter): ditto. - (vars_of_gutter): ditto. - (specifier_type_create_gutter): ditto. - (specifier_vars_of_gutter): ditto. - - * gutter.h: new file. Contains gutter constants and sizing macros - similar to those for the toolbar. - - * winslots.h: add gutter variables. - - * window.h: declare window_is_* functions. - - * window.c (window_is_lowest): make non-static. - (window_is_highest): ditto. - (window_top_toolbar_height): deleted. - (window_bottom_toolbar_height): deleted. - (window_left_toolbar_width): deleted. - (window_right_toolbar_width): deleted. - (window_top_gutter_height): add gutter sizing. - (window_bottom_gutter_height): ditto. - (window_left_gutter_width): ditto. - (window_right_gutter_width): ditto. - - * symsinit.h: declarations for gutters vars etc. - - * search.c (bi_find_next_emchar_in_string): new function. - - * scrollbar.c (update_scrollbar_instance): remove reference to - window_bottom_toolbar_height which did nothing. - - * redisplay.h (struct display_line): add face indices for - overriding defaults in output_display_line. - Add gutter_changed flags and declarations. - - * redisplay.c (create_string_text_block): new function, similar to - create_text_block but for strings. Display tables etc are used - from the currently selected window. - (generate_string_display_line): ditto. Similar to - generate_display_line. - (generate_displayable_area): generate display lines for a given - area on a frame. Input is the string, with associated extents, to - display. - (redisplay_frame): add gutter_changed check. - (redisplay_device): ditto. - (redisplay_without_hooks): ditto. - - * redisplay-x.c (bevel_modeline): moved to redisplay.c. - (x_redraw_exposed_area): redraw exposed gutters. - (x_bevel_area): new redisplay device method. - (x_type_create_redisplay_mswindows): add bevel_area device method. - (x_output_display_block): fiddly Martin-style cleanup. - (x_output_vertical_divider): use bevel_area. - - * redisplay-output.c (output_display_line): check display_lines - for face information before using defaults. - (bevel_modeline): new function, calls bevel_area with appropriate - values. - - * redisplay-msw.c (bevel_modeline): moved to redisplay.c. - (mswindows_redraw_exposed_area): redraw exposed gutters. - (mswindows_bevel_area): new redisplay device method. - (console_type_create_redisplay_mswindows): add bevel_area device - method. - - * indent.c (string_column_at_point): add column_at_point but for - strings. - - * glyphs-x.c (image_instantiator_format_create_glyphs_x): only - instantiate widgets that we have a toolkit for. - - * general.c: add Qgutter. - - * frame.h (struct frame): add display lines for gutters and - visibility flags. - - * frame.c (set_frame_selected_window): mark gutters changed. - - * emacs.c (main_1): add gutter initialisation. - - * device.h (struct device): add gutter_changed flag and macros to - manipulate it. - - * console.h (struct console_methods): new bevel area redisplay - method. - - * buffer.h (REAL_INC_CHARBYTIND): new macro for strings as - REAL_INC_BYTIND is for buffers. - (INC_CHARPTR): ditto. - - * Makefile.in.in (objs): add gutter.o - -1999-07-13 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.18 is released - -1999-07-08 SL Baur <steve@mule.m17n.org> - - * event-Xt.c (handle_focus_event_1): Guard FRAME_X_XIC with - XIM_XLIB. - (emacs_Xt_handle_magic_event): Ditto. - * redisplay-x.c (x_output_string): Ditto. - (x_output_eol_cursor): Ditto. - -1999-06-30 Kazuyuki IENAGA <kazz@imasy.or.jp> - - * event-Xt.c, input-method-xlib.c, redisplay-x.c: Avoid the - problem that when XIM is destroyed or missed with some reason, - xemacs will die. Now xim=xlib waits the XIM will be ready and - endures the case of XIM end up. - -1999-07-03 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * tooltalk.c (init_tooltalk): save signal actions for SIGQUIT, - SIGINT and SIGCHLD before calling tt_open and restore the - afterwards. This fixes e.g. the zombie subprocesses on Solaris - -1999-07-06 SL Baur <steve@xemacs.org> - - * s/linux.h: gcc-2.8 changes for powerpc - From Justin Vallon <vallon@mindspring.com> - -1999-07-05 Didier Verna <didier@xemacs.org> - - * indent.c: new symbol Qcoerce. - (Fmove_to_column): use it + doc string update. - -1999-07-04 Andy Piper <andy@xemacs.org> - - * console.c: undo earlier Fprovide changes. - * fns.c: ditto. - * console.h: ditto. - - * console-tty.c (image_instantiator_format_create_glyphs_tty): new - function. validate appropriate image formats for tty. - - * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): - initialize consoles parameter. - (struct image_instantiator_methods): add consoles parameter. - (IIFORMAT_VALID_CONSOLE): new function. validate the format on the - console. - (INITIALIZE_DEVICE_IIFORMAT): validate the format on the given - console. - - * glyphs-msw.c: declare instantiators for later use. - (image_instantiator_format_create_glyphs_mswindows): validate xpm - and friends on the mswindows console. - * glyphs-x.c: ditto. - - * glyphs.c (valid_image_instantiator_format_p): disallow glyphs - that have not been registered on the supplied device. - (Fvalid_image_instantiator_format_p): add locale argument. - (instantiate_image_instantiator): valid image instantiator on the - device. - - * symsinit.h: add image_instantiator_format_create_glyphs_tty() - declaration. - - * emacs.c (main_1): add call to - image_instantiator_format_create_glyphs_tty(). - -1999-06-29 Olivier Galibert <galibert@pobox.com> - - * lisp.h: Add #include <stddef.h>. - - * sysdep.c: Remove #include <stddef.h>. - * symbols.c: Remove #include <stddef.h>. - * sheap.c: Remove #include <stddef.h>. - * opaque.c: Remove #include <stddef.h>. - * nt.c: Remove #include <stddef.h>. - * mule-charset.c: Remove #include <stddef.h>. - * marker.c: Remove #include <stddef.h>. - * file-coding.c: Remove #include <stddef.h>. - * extents.c: Remove #include <stddef.h>. - * elhash.c: Remove #include <stddef.h>. - * data.c: Remove #include <stddef.h>. - * chartab.c: Remove #include <stddef.h>. - * bytecode.c: Remove #include <stddef.h>. - * alloc.c: Remove #include <stddef.h>. Fix vector description - -1999-06-30 SL Baur <steve@miho.m17n.org> - - * editfns.c: Document "%s" format spec. - Suggested by Bob Weiner <weiner@altrasoft.com> - -1999-06-29 Andy Piper <andy@xemacs.org> - - * event-msw.c: fix definition booboo. - -1999-06-28 Andy Piper <andy@xemacs.org> - - * glyphs-x.c: change tree -> tree-view, progress -> - progress_gauge, edit -> edit-field, tab -> tab-control, combo -> - combo-box. - (complex_vars_of_glyphs_x): provide-on-console the implemented - widget types. - - * glyphs-msw.c: ditto. - (complex_vars_of_glyphs_mswindows): ditto. - - * lisp.h: add Fprovide_on_console. - - * fns.c (Ffeaturep): add extra optional console argument. - (Fprovide_on_console): like Fprovide but provides only on the - specified console-type. - (Frequire): check console-features as well as global features. - - * console.c (Fconsole_features): new function. return features for - this console. - (syms_of_console): add Fconsole_features. - - * console.h (CONMETH_FEATURES): new function for accessing features. - (CONSOLE_FEATURES): ditto. - (struct console_methods): add features slot. - (INITIALIZE_CONSOLE_TYPE): initialize features slot. - -1999-06-28 Andy Piper <andy@xemacs.org> - - * event-Xt.c (handle_focus_event_1): conditionally compile for - X11R5. - - * s/cygwin32.h: fix me website address. - - * event-msw.c: add NMHDR for pre b20 cygwin builds. - - * gui-x.c (button_item_to_widget_value): only add callback if it - is non-nil. - - * glyphs-x.c: add progress, edit and combo instantiators. - (x_widget_set_property): new function. uses lwlib to set widget - values. - (x_widget_property): new function. uses lwlib to get widget - values. - (x_button_instantiate): support images in buttons. - (x_button_property): new function. use lwlib to get the selected - state. - (x_progress_instantiate): new function for instantiating progress - gauges. - (x_progress_set_property): new function. sets the progress gauge - position. - (x_edit_instantiate): new function. for instantiating edit fields. - (x_combo_instantiate): new function. for instantiating combo - boxes. - (image_instantiator_format_create_glyphs_x): add new device ii - formats. - - * glyphs-msw.c (mswindows_tab_instantiate): remove redundant var. - - * console.h (CONSOLE_FEATURES): new features accesor. - - * conslots.h (MARKED_SLOT): add features entry. - -1999-06-25 Andy Piper <andy@xemacs.org> - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): use new - gui functions. - - * menubar-msw.c: move MAX_MENUITEM_LENGTH to gui.h - - * gui.h (struct Lisp_Gui_Item): add accelerator. - - * gui.c (gui_item_add_keyval_pair): deal with accelerators. - (gui_item_init): ditto. - (gui_add_item_keywords_to_plist): ditto. - (mark_gui_item): ditto. - (gui_item_hash): ditto. - (gui_item_accelerator): new function. - (gui_name_accelerator): new function stolen from gui-x.c - - * gui-x.c (popup_selection_callback): always define. mark - subwindows changed after calling a callback. - (menu_name_to_accelerator): deleted. - (button_item_to_widget_value): forward gui_item things to gui_item - functions. - - * glyphs-x.h (struct x_subwindow_data): add data for widgets. add - appropriate accesors. - - * glyphs-x.c: declare new glyph formats. - (x_finalize_image_instance): unmanage and destroy widgets if they - exist. - (x_unmap_subwindow): handle widgets specially. - (x_map_subwindow): ditto. offset display of widgets by offset of - text widget within container. - (x_update_subwindow): new function. call lw_modify_all_widgets - when we are a widget. - (x_widget_instantiate): new function for generically creating - widgets-glyphs. toolkit specifics forwarded to lwlib. - (x_button_instantiate): new function for instantiating - widgets-glyph buttons. - (console_type_create_glyphs_x): register update_subwindow. - (image_instantiator_format_create_glyphs_x): register widget and - button types. - - * event-msw.c (mswindows_wnd_proc): remove redundant variable. - - * event-Xt.c (x_event_to_emacs_event): call handle_focus_event_1 - when we get a button press in case we do not have the focus. - (handle_focus_event_1): set the keyboard focus to the text widget - if we do not have it. - - * dialog-x.c (dbox_descriptor_to_widget_value): use new gui_item - functions. - -1999-06-24 SL Baur <steve@miho.m17n.org> - - * syntax.c (scan_words): Restore non-Mule code. - (word_constituent_p): Restore. - -1999-06-23 Olivier Galibert <galibert@pobox.com> - - * config.h.in: Add missing #undef *_USER_DEFINED. - -1999-06-23 SL Baur <steve@miho.m17n.org> - - * lisp.h (set_bit_vector_bit): Force promotion to unsigned long - int (fixes a 64-bit problem). - - * chartab.c (word_boundary_p): Use EQ not == for lisp_object - comparison. - -1999-03-23 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * paths.h.in (PATH_DOC): Made doc-directory configurable. - -1999-06-22 Olivier Galibert <galibert@pobox.com> - - * lrecord.h: Added basic external description system. - - * symbols.c: Added symbol, symbol-value-buffer-local, - symbol-value-lisp-magic and symbol-value-varalias description. - * mule-charset.c: Added charset description. - * marker.c: Added marker description. - * keymap.c: Added keymap description. - * glyphs.c: Added glyph description. - * floatfns.c: Added float description. - * file-coding.c: Added coding-system description. - * extents.c: Added extent description. - * elhash.c: Added hash-table description. - * data.c: Added weak-list desciption. - * chartab.c: Added char-table-entry and char-table description. - * bytecode.c: Added compiled-function description. - * alloc.c: Added cons, vector and string description. - -1999-06-22 Olivier Galibert <galibert@pobox.com> - - * lrecord.h (struct lrecord_header): Reduced size to 4 bytes. - Updated everything to the removal of the "flags" substructure. - - * lisp.h (subr_lheader_initializer): Updated. - * symeval.h (symbol_value_forward_lheader_initializer): Updated. - -1999-06-20 MORIOKA Tomohiko <tomo@etl.go.jp> - - * syntax.c (word_constituent_p): Deleted. - (scan_words): Use `WORD_BOUNDARY_P'. - - * chartab.c (Vword_combining_categories): New variable. - (Vword_separating_categories): Likewise. - (CATEGORYP): New macro. - (CATEGORY_SET): Likewise. - (CATEGORY_MEMBER): Likewise. - (word_boundary_p): New function. - (complex_vars_of_chartab): Set up new variable - `word-combining-categories' and `word-separating-categories'. - -1999-06-18 Olivier Galibert <galibert@pobox.com> - - * lrecord.h: Added description as a placehold in the lrecord - implementation structures. Added the parameter to all constructor - defines. - - * alloc.c: Added placeholders. - * buffer.c: Ditto. - * bytecode.c: Ditto. - * chartab.c: Ditto. - * console.c: Ditto. - * data.c: Ditto. - * database.c: Ditto. - * device.c: Ditto. - * eldap.c: Ditto. - * elhash.c: Ditto. - * eval.c: Ditto. - * event-stream.c: Ditto. - * events.c: Ditto. - * extents.c: Ditto. - * faces.c: Ditto. - * file-coding.c: Ditto. - * floatfns.c: Ditto. - * fns.c: Ditto. - * frame.c: Ditto. - * glyphs.c: Ditto. - * gui-x.c: Ditto. - * keymap.c: Ditto. - * lstream.c: Ditto. - * marker.c: Ditto. - * mule-charset.c: Ditto. - * objects.c: Ditto. - * opaque.c: Ditto. - * process.c: Ditto. - * rangetab.c: Ditto. - * specifier.c: Ditto. - * symbols.c: Ditto. - * toolbar.c: Ditto. - * tooltalk.c: Ditto. - * window.c: Ditto. - -1999-06-22 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.17 is released - -1999-06-13 Oscar Figueiredo <oscar@xemacs.org> - - * config.h.in (HAVE_LDAP_SET_OPTION): New define - (HAVE_LDAP_GET_LDERRNO): Ditto - (HAVE_LDAP_RESULT2ERROR): Ditto - (HAVE_LDAP_PARSE_RESULT): Ditto - (HAVE_UMICH_LDAP): Removed - (HAVE_NS_LDAP): Removed - - * eldap.h (struct Lisp_LDAP): Removed the `livep' member as - suggested by Olivier Galibert - (CHECK_LIVE_LDAP): Test on `ld' instead of `livep' - - * eldap.c: Take the removal of `livep' into account in all the - necessary functions - (signal_ldap_error): Take two additional parameters - Added new finer compilation conditions in order to use - ldap_parse_result or ldap_result2error if available - (Fldap_open): Conform to this new API - (Fldap_search_internal): Ditto - -1999-06-17 SL Baur <steve@miho.m17n.org> - - * data.c (struct int_or_double): Should use EMACS_INT not int. - -1999-06-16 Norbert Koch <n.koch@eai-delta.de> - - * redisplay-msw.c: Run 'ccl_driver' with 'CCL_MODE_ENCODING' as in - redisplay-x.c - -1999-06-12 MORIOKA Tomohiko <tomo@etl.go.jp> - - * redisplay-x.c (separate_textual_runs): Run `ccl_driver' with - `CCL_MODE_ENCODING'. - - * file-coding.c (mule_decode): Run `ccl_driver' with - `CCL_MODE_DECODING'. - (mule_encode): Run `ccl_driver' with `CCL_MODE_ENCODING'. - - * mule-ccl.c (CCL_WRITE_CHAR): Refer `conversion_mode'. - (ccl_driver): Add new argument `conversion_mode'. - (Fccl_execute): Run `ccl_driver' with `CCL_MODE_ENCODING'. - (Fccl_execute_on_string): Likewise [perhaps it is better to add - new optional argument]. - - * mule-ccl.h (CCL_MODE_ENCODING): New macro. - (CCL_MODE_DECODING): New macro. - (ccl_driver): Add new argument `conversion_mode'. - -1999-06-15 SL Baur <steve@miho.m17n.org> - - * mule-charset.c (Fsplit_char): New subr. - (Fchar_octet): delete. - (syms_of_mule_charset): DEFSUBR it. - -1999-06-13 Andy Piper <andy@xemacs.org> - - * menubar.h: update declarations involving gui_items. - - * lisp.h: declare Lisp_Gui_Item. - - * glyphs.h (struct Lisp_Image_Instance): update type of gui_item. - - * glyphs.c (mark_image_instance): modify for new lisp-based gui_items. - (print_image_instance): ditto. - (image_instance_equal): ditto. - (image_instance_hash): ditto. - - * event-msw.c (mswindows_need_event): assert badly_p status. - (mswindows_wnd_proc): modify WM_NOTIFY handling to cope with - callbacks in tree-view and tab-control widgets. - (emacs_mswindows_next_event): modify use of - mswindows_dequeue_dispatch_event. - - * dialog-msw.c (mswindows_popup_dialog_box): modify for new - lisp-based gui_items. - - * glyphs-msw.c (mswindows_update_subwindow): update use of - gui_items. - (mswindows_register_gui_item): new function. - (mswindows_register_gui_item): fix to use lisp gui_items. - (mswindows_widget_instantiate): ditto. - (mswindows_button_instantiate): ditto. - (add_tree_item): new function to recursively add tree view - elements. - (add_tree_item_list): ditto. - (mswindows_tree_instantiate): new function. instantiate tree view - controls. - (add_tab_item): new function to add tabs to a tab control. - (mswindows_tab_instantiate): new function. instantiate tab - controls. - (image_instantiator_format_create_glyphs_mswindows): add tree view - and tab controls. - (vars_of_glyphs_mswindows): ditto. - - * glyphs-widget.c (check_valid_item_list_1): allow nested lists in - item lists. - (check_valid_item_list): ditto. - (initialize_widget_image_instance): fix to use new lisp gui_item. - (widget_instantiate_1): allow the setting of default textwidth in - characters. - (widget_instantiate): change to use new widget_instantiate_1 - signature. - (combo_instantiate): ditto. - (static_instantiate): ditto. - (tab_instantiate): new function for tab widgets. - (image_instantiator_format_create_glyphs_widget): add tab and tree - view widgets. - - * menubar-msw.c (displayable_menu_item): convert to use lisp - gui_items. - (populate_menu_add_item): ditto. - (populate_or_checksum_helper): ditto. - - * menubar.c (menu_parse_submenu_keywords): convert to use lisp - gui_items. - (Fmenu_find_real_submenu): ditto. - - * gui.h (struct Lisp_Gui_Item): make gui_item a lisp oebjct. - - * gui.c (gui_item_add_keyval_pair): gui_items are now lisp - objects, convert functions that use them accordingly. - (gui_item_init): ditto. - (gui_item_active_p): ditto. - (gui_item_selected_p): ditto. - (gui_item_included_p): ditto. - (gui_item_display_flush_left): ditto. - (gui_item_display_flush_right): ditto. - (mark_gui_item): ditto. - (allocate_gui_item): new function to create a gui_item. - (make_gui_item_from_keywords_internal): ditto. create and return a - gui_item as well as setting keywords. - (gui_parse_item_keywords): ditto. - (gui_parse_item_keywords_no_errors): ditto. - (gui_add_item_keywords_to_plist): new function, not yet used. - (gui_item_hash): new function. - (gui_item_id_hash): use gui_item_hash. - (gui_item_equal): new function. - (print_gui_item): new function. - -1999-06-11 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.16 is released - -1999-06-10 Andy Piper <andy@xemacs.org> - - * select-msw.c (mswindows_own_selection): only set the clipboard - if asked. - (mswindows_get_foreign_selection): only get the clipboard if - asked. - (mswindows_disown_selection): only disown the clipboard if asked. - -1999-06-03 MORIOKA Tomohiko <tomo@etl.go.jp> - - * file-coding.c (coding_system_from_mask): Use `raw-text' instead - of `no-conversion'. - (complex_vars_of_mule_coding): Use `raw-text' as the coding-system - of coding-category `no-conversion'. - -1999-06-03 MORIOKA Tomohiko <tomo@etl.go.jp> - - * file-coding.c (Qraw_text): New variable. - (syms_of_mule_coding): Add new symbol `raw-text'. - (complex_vars_of_mule_coding): Add new coding-system `raw-text'; - define coding-system `binary' independently; define coding-system - `no-conversion' as an alias for `raw-text'. - - * file-coding.h (Qraw_text): New variable. - -1999-06-08 SL Baur <steve@xemacs.org> - - * s/decosf4-0.h: Explicitly #undef SYSTEM_MALLOC. - -1999-06-06 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (MIME_LINE_LENGTH): Default to 72, as in mimencode and - base64.el. - (base64_decode_1): Signal errors instead of returning -1. - -1999-06-07 Hrvoje Niksic <hniksic@srce.hr> - - * mule-charset.c (Fmake_char): Update docstring. - -1999-06-07 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fstring_lessp): Actually increment the Bufbyte pointers. - -1999-06-05 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (base64_decode_1): Allow and ignore any non-base64 - characters in input. - -1999-05-27 Olivier Galibert <galibert@pobox.com> - - * emacs.c (Fdump_emacs): Add clear_message() lost with the removal - of report_pure_usage(). - -1999-06-04 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fstring_lessp): Remove O(n^2) under Mule. - -1999-06-04 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.15 is released - -1999-06-01 Hirokazu FUKUI <fukui@atesoft.advantest.co.jp> - - * frame.c (Fset_mouse_position): - (Fset_mouse_pixel_position): - * window.c (Fsplit_window): - (Fmove_to_window_line): - Fix crash when invoking functions with an already-deleted window - argument. - - * indent.c (vertical_motion_1): - (vmotion_pixels): - (Fvertical_motion_pixels): - * window.c (Fwindow_displayed_text_pixel_height): - Fix error message when invoking functions with an already-deleted - window argument. - -1999-06-01 Jan Vroonhof <vroonhof@math.ethz.ch> - - * sysdep.c (request_sigio_on_device): Guard against glibc - 2.1's stub streams implementation. - -1999-06-03 SL Baur <steve@xemacs.org> - - * config.h.in: - * emacs.c: Implement x.y.z version numbers - From Jan Vroonhof <vroonhof@math.ethz.ch> - -1999-05-20 MORIOKA Tomohiko <tomo@etl.go.jp> - - * mule-charset.c (complex_vars_of_mule_charset): Registry of - japanese-jisx0208-1978 should not match with "jisx0208.1983" nor - "jisc6226.1983". - -1999-06-03 SL Baur <steve@xemacs.org> - - * frame-x.c: - * device-x.c: rename session option to wmcommand. - From Oliver Graf <ograf@rhein-zeitung.de> - -1999-05-27 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fsubstring): Don't traverse the same region twice with - charcount_to_bytecount(). - -1999-06-03 SL Baur <steve@steve1.m17n.org> - - * m/alpha.h (SYSTEM_MALLOC): Fix indented preprocessor directive - garbage. - - * s/decosf4-0.h: Defining ORDINARY_LINK here is redundant (and it - doesn't really work as is implied by the commentary). - Don't define SYSTEM_MALLOC so the old GNU malloc can be used. - -1999-06-02 SL Baur <steve@steve1.m17n.org> - - * symsinit.h: Declare vars_of_ntproc. - * emacs.c (main_1): Call it. - - * ntproc.c (syms_of_ntproc): Move variable initializations from - here ... - (vars_of_ntproc): ... to here [new function]. - - * file-coding.c (syms_of_file_coding): Rename. - (vars_of_file_coding): Ditto. - (complex_vars_of_file_coding): Ditto. - - * symsinit.h: Rename *_mule_coding to *_file_coding. - - * emacs.c (main_1): Call them by the proper name. - - * device-msw.c (syms_of_device_mswindows): Move variable - initializations from here ... - (vars_of_device_mswindows): ... to here. - - * chartab.c (vars_of_chartab): New function. - - * symsinit.h: New function, vars_of_chartab. - - * emacs.c (main_1): Call it. - - * mule-canna.c (syms_of_mule_canna): Move CANNA initialization ... - (vars_of_mule_canna): ... to here. - - * mule-ccl.c (vars_of_mule_ccl): New function. Move variable - initializations out of syms_of_mule_ccl. - - * symsinit.h: Declare new function vars_of_mule_ccl. - - * emacs.c (main_1): Call it. - -1999-05-27 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (base64_decode_1): Ignore whitespace. - -1999-05-27 Hrvoje Niksic <hniksic@srce.hr> - - * mule-charset.c (Fmake_char): Strip the eighth bit off ARG1 and - ARG2. - -1999-05-21 Andy Piper <andy@xemacs.org> - - * xselect.c: deleted. - - * symsinit.h: declare select initialisation. - - * select.h: new file. declare commonly used select functions and - variables. - - * select.c: new file. generalised from xselect.c. - (clean_local_selection_data): moved from xselect.c. - (get_local_selection): ditto. device specific pieces called via a - devmeth. - (handle_selection_clear): ditto. - (Fown_selection_internal): renamed and generalised from - Fx_own_selection_internal. moved from xselect.c. - (Fdisown_selection_internal): ditto. - (Fselection_owner_p): ditto. - (Fselection_exists_p): ditto. - (Fget_selection_internal): ditto. - (syms_of_select): new function. QXXXX values moved from xselect.c - (vars_of_select): new function. selection_converter_alist, - lost_selection_hooks moved and renamed from xselect.c - - * select-x.c: renamed from xselect.c. - (x_own_selection): converted to device specific. non-X-specific - bits moved to select.c. - (x_get_foreign_selection): ditto. - (x_disown_selection): ditto. - (x_selection_exists_p): ditto. - (console_type_create_select_x): new function. - - * select-msw.c (mswindows_own_selection): new device method to set - the clipboard when we 'own' the selection. - (mswindows_get_foreign_selection): new device method to get the - clipboard. - (mswindows_disown_selection): new device method to delete the - selection when we 'disown' it. - (console_type_create_select_mswindows): new function. - - * emacs.c (main_1): add select to things to initialise. - - * console.h (struct console_methods): new console methods for - selection. - - * Makefile.in.in (x_objs): xselect.c renamed to select-x.c - -1999-05-20 Hrvoje Niksic <hniksic@srce.hr> - - * print.c (long_to_string): Install a faster version. - -1999-05-16 Andy Piper <andy@xemacs.org> - - * ntproc.c (syms_of_ntproc): default - win32-start-process-share-console to t. - -1999-05-14 Hrvoje Niksic <hniksic@srce.hr> - - * config.h.in: Do it here. - - * bytecode.c: Don't define ERROR_CHECK_TYPECHECK here. - -1999-05-14 Andy Piper <andy@xemacs.org> - - * toolbar-msw.c (mswindows_output_toolbar): hash on something - hashable. - -1999-05-14 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.14 is released - -1999-05-12 Andy Piper <andy@xemacs.org> - - * ntproc.c (sys_spawnve): kludge argv[0] in a MS compatible way. - -1999-05-11 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * emacs.c (Frun_emacs_from_temacs): (re)alloc natgs+2 entries for - run_temacs_argv array -- fixes random memory corruption crash - -1999-05-12 Jan Vroonhof <vroonhof@math.ethz.ch> - - * window.c (Fcurrent_window_configuration): - Save minibuffer height; - - * window.c (set_window_configuration): use it. - -1999-05-10 Robert Pluim <rpluim@bigfoot.com> - - * lisp.h (NNUNGCPRO): fix typo in name of DEBUG_GCPRO version - -1999-04-21 Jan Vroonhof <vroonhof@math.ethz.ch> - - * redisplay.c (redisplay_window): Do not put data - in the line start cache if it is not guaranteed to be correct - -1999-04-02 Jan Vroonhof <vroonhof@math.ethz.ch> - - * window.c (struct window_config): Removed frame - size members. - (window_config_equal): No longer compare frame sizes. - (Fset_window_configuration): Resize old top window to fit in the - current frame directly, no longer use a fake frame resize. - (Fcurrent_window_configuration): No longer save frame size - -1999-05-11 Andy Piper <andy@xemacs.org> - - * ntproc.c (sys_spawnve): actually assign argv[0] instead of the - first character. - -1999-05-10 Hrvoje Niksic <hniksic@srce.hr> - - * sysdep.c (init_system_name): If gethostname gives a proper - domain name, don't look further for one. - -1999-05-09 Hrvoje Niksic <hniksic@srce.hr> - - * symbols.c (Fintern): Avoid frequent XSYMBOL (foo). - (Fintern_soft): Accept a symbol argument. - -1999-05-06 Hrvoje Niksic <hniksic@srce.hr> - - * symbols.c (Fintern): ...do it here. - - * lread.c (read_atom): Don't handle keywords here. - -1999-05-06 Hrvoje Niksic <hniksic@srce.hr> - - * symbols.c (reject_constant_symbols): Just use SYMBOL_IS_KEYWORD. - -1999-05-03 Olivier Galibert <galibert@pobox.com> - - * lisp.h (SYMBOL_IS_KEYWORD): A symbol can be a keyword only if it - is interned in the main obarray. - -1999-04-23 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * menubar-x.c (pre_activate_callback): set accelerator field in - "No menu" entries to nil. Avoid crash in - command_builder_operate_menu_accelerator - -1999-05-03 Olivier Galibert <galibert@pobox.com> - - * symeval.h (symbol_value_forward_lheader_initializer): Ditto. - - * lisp.h (DEFUN): Fix lrecord header initialisation. - -1999-05-02 Andy Piper <andy@xemacs.org> - - * objects-msw.c (mswindows_font_instance_truename): add a ';'. - - * ntproc.c (sys_kill): cast using MS mandated defines. - -1999-04-29 Andy Piper <andy@xemacs.org> - - * m/intel386.h: remove redundant definitions. - - * s/mingw32.h: new header for mingw32. - - * unexnt.c: (open_input_file): function moved to nt.c. - (close_file_data): ditto. - (rva_to_section): function moved to ntproc. - - * symsinit.h: declare syms_of_ntproc(); - - * objects-msw.c (mswindows_font_instance_truename): new function. - - * ntproc.c: remove many warnings. - (_sys_read_ahead): moved from nt.c and made static. - (rva_to_section): moved from unexnt.c but not defined under - mingw32. - (win32_executable_type): implement what we can for mingw32 - headers. - (sys_spawnve): fix bad MULE/GCPRO bug in filename handling. - - * ntheap.h: remove declarations of functions that are now static. - - * ntheap.c: support static heap. - - * nt.h: conditionalise X_OK definition. - - * nt.c: eliminate many warnings and support mingw32. - (open_input_file): function moved from unexnt.c and made static - (close_file_data): ditto. - (_sys_read_ahead): moved to ntproc.c - - * emacs.c: make sure syms_of_ntptroc gets called under windows. - - * console-msw.h: support mingw32. - * getloadavg.c: ditto. - * ntplay.c: ditto. - * sysdep.c: ditto. - * sysdir.h: ditto. - * systime.h: ditto. - * systty.h: ditto. - - * config.h.in: dont turn on DEBUG_ENCAPSULATION by default because - some systems don't have all of the encapsulated system calls. - - * callproc.c: warning elimination. - * dired-msw.c: ditto. - * process-nt.c: ditto. - * realpath.c: ditto. - - * Makefile.in.in: tweak : and ; for building under mswindows. - -1999-04-26 Michael Harnois <mharnois@willinet.net> - - * eldap.c (allocate_ldap): Adapt to the new semantics of - alloc_lcrecord_type(). - -1999-03-16 MORIOKA Tomohiko <tomo@etl.go.jp> - - * file-coding.c (DECODE_HANDLE_END_OF_CONVERSION): fixed. - -1998-09-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * Delete mule-coding.c and mule-coding.h because they are not - used. - -1999-04-22 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * objects.c (print_font_instance): Check for NILP(f->device), - i.e. Vthe_null_font_instance. - (font_instance_truename_internal): ditto. - (Ffont_instance_properties): ditto. - -1999-04-22 Olivier Galibert <galibert@pobox.com> - - * lrecord.h (DECLARE_LRECORD): lrecord_implementation isn't an - array anymore. - -1999-04-22 Hrvoje Niksic <hniksic@srce.hr> - - * Makefile.in.in (tests): Don't mention tests explicitly -- makes - it easier to add new ones. - -1999-04-22 Hrvoje Niksic <hniksic@srce.hr> - - * symbols.c (reject_constant_symbols): Ditto. - (init_symbols_once_early): Ditto. - - * print.c (print_symbol): Don't use ->obarray. - - * symbols.c (Funintern): Ditto. - - * alloc.c (Fmake_symbol): Don't set ->obarray. - - * lisp.h (struct Lisp_Symbol): Removed .obarray field. - - * symbols.c (init_symbols_once_early): Removed - Vpure_uninterned_symbol_table. - (Fintern): Don't store to ->obarray field. - -1999-04-22 Hrvoje Niksic <hniksic@srce.hr> - - * data.c (vars_of_data): Default debug_issue_ebola_notices to 0. - (eq_with_ebola_notice): Remove abracadabra support. - -1999-04-11 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * eldap.c (Fldap_search_internal): Add a new parameter `withdn' to - retrieve the distinguished names of entries - -1999-03-08 Martin Buchholz <martin@xemacs.org> - - * lread.c (read_escape): Make hex escapes read only two hex digits. - -1999-04-05 Olivier Galibert <galibert@pobox.com> - - * Makefile.in.in: Remove puresize-adjust.h and recursive makes. - * make-src-depend: Remove puresize-adjust.h. - * src-headers: Remove puresize-adjust.h. - * config.h.in: Kill everything purespace/gung-ho related. - - * dbxrc: Make gung-ho mandatory. - * gdbinit: Ditto. - - * lrecord.h: Make gung-ho mandatory. Remove pure flag and add - c_readonly and lisp_readonly. Remove implementation arrays. - (C_READONLY_RECORD_HEADER_P): Added. - (LISP_READONLY_RECORD_HEADER_P): Added. - (SET_C_READONLY_RECORD_HEADER): Added. - (SET_LISP_READONLY_RECORD_HEADER): Added. - - * lisp.h: Kill everything purespace/non gung-ho related. - (CHECK_C_WRITEABLE): Added. - (CHECK_LISP_WRITEABLE): Added. - (C_READONLY): Added. - (LISP_READONLY): Added. - - * lisp-union.h: Make gung-ho mandatory. - * lisp-disunion.h: Ditto. - - * alloc.c: Kill everything purespace/non gung-ho related. Fix all - set_lheader_implementation calls. - (c_readonly): Added. - (lisp_readonly): Added. - (make_string_nocopy): Added. - (Fpurecopy): Changed to do nothing. Kept the old documentation - for reference purposes for the next patches. - (sweep_lcrecords_1): Don't free C readonly lcrecords. - (sweep_bit_vectors_1): Don't free C readonly bitvectors. - (SWEEP_FIXED_TYPE_BLOCK): Don't free C readonly lrecords. - - * fns.c: Make gung-ho mandatory. - (Fput): CHECK_IMPURE -> CHECK_LISP_WRITEABLE. - (Fremprop): Ditto. - (Ffillarray): Ditto. - - * data.c: Make gung-ho mandatory. - (pure_write_error): Removed. - (c_write_error): Added. - (lisp_write_error): Added. - (Fsetcar): CHECK_IMPURE -> CHECK_LISP_WRITEABLE. - (Fsetcdr): Ditto. - (Faset): Ditto. - - * symbols.c: Make gung-ho mandatory. make_pure_pname -> - make_string or make_string_nocopy. Fix various - alloc_lcrecord_type. - - * lread.c: Remove everything purespace related. - (Flocate_file_clear_hashing): purified -> c_readonly. - (locate_file): Ditto. - (read_atom): make_pure_pname -> make_string. - - * emacs.c (Frun_emacs_from_temacs): Remove purespace stats - reporting. - (Fdump_emacs): Ditto. - - * print.c (print_internal): Make gung-ho mandatory. - * ntheap.c (sbrk): Ditto. - * mem-limits.h (EXCEEDS_LISP_PTR): Ditto - * symeval.h (symbol_value_forward_lheader_initializer): Ditto. - - * sheap.c (more_static_core): Remove puresize-adjust.h from - message. - - * syntax.c (complex_vars_of_syntax): make_pure_string -> - make_string_nocopy. - * keymap.c (make_keymap): Fix alloc_lcrecord_type. - (vars_of_keymap): make_pure_string -> make_string_nocopy. - * events.c (deinitialize_event): Fix set_lheader_implementation. - (zero_event): Ditto. - * specifier.c (make_specifier_internal): Fix alloc_lcrecord. - * menubar-x.c (set_frame_menubar): Fix alloc_lcrecord_type. - * mule-charset.c (make_charset): Ditto. - * console.c (allocate_console): Ditto. - (complex_vars_of_console): Ditto. - * file-coding.c (allocate_coding_system): Ditto. - * device.c (allocate_device): Ditto - * gui-x.c (gcpro_popup_callbacks): Ditto. - * extents.c (allocate_extent_auxiliary): Ditto. - (allocate_extent_info): Ditto. - (copy_extent): Ditto. - * glyphs.c (allocate_image_instance): Ditto. - (allocate_glyph): Ditto. - * frame.c (allocate_frame_core): Ditto. - * database.c (allocate_database): Ditto. - * tooltalk.c (make_tooltalk_message): Ditto. - (make_tooltalk_pattern): Ditto. - * rangetab.c (Fmake_range_table): Ditto. - (Fcopy_range_table): Ditto. - * process.c (make_process_internal): Ditto. - * chartab.c (Fmake_char_table): Ditto. - (make_char_table_entry): Ditto. - (copy_char_table_entry): Ditto. - (Fcopy_char_table): Ditto. - * elhash.c (make_general_lisp_hash_table): Ditto. - (Fcopy_hash_table): Ditto. - * buffer.c (allocate_buffer): Ditto. - (complex_vars_of_buffer): Ditto. - * event-stream.c (allocate_command_builder): Ditto. - * objects.c (Fmake_color_instance): Ditto. - (Fmake_font_instance): Ditto. - (vars_of_objects): Ditto. - * toolbar.c (update_toolbar_button): Ditto. - * window.c (allocate_window): Ditto. - (make_dummy_parent): Ditto. - (Fcurrent_window_configuration): Fix alloc_lcrecord. - (vars_of_window): Fix make_lcrecord_list. - * faces.c (allocate_face): Fix alloc_lcrecord_type. pure_list -> - Flist. - * lstream.c (Lstream_new): Fix make_lcrecord_list. - * opaque.c (make_opaque): Fix alloc_lrecord. - (make_opaque_list): Fix alloc_lrecord_type. - -1999-04-19 Hrvoje Niksic <hniksic@srce.hr> - - * process.c (Fstart_process_internal): Ditto. - - * ntproc.c (sys_spawnve): Use Vlisp_EXEC_SUFFIXES when calling - locate_file(). - - * glyphs-x.c (x_locate_pixmap_file): Ditto. - - * glyphs-msw.c (mswindows_locate_pixmap_file): Fix call to - locate_file(). - - * emodules.c (vars_of_module): New variable Vmodule_extensions. - (emodules_load): Use it when calling locate_file(). - - * emacs.c (main_1): Use Vlisp_EXEC_SUFFIXES when calling - locate_file(). - - * callproc.c: Vlisp_EXEC_SUFFIXES: New variable. - (vars_of_callproc): Initialize it. - (Fcall_process_internal): Use it when calling locate_file(). - - * alloc.c (disksave_object_finalization): Use - Flocate_file_clear_hashing(). - - * lread.c (Flocate_file_clear_hashing): Clear all hasing when - given `t' as argument. - -1999-04-18 Hrvoje Niksic <hniksic@srce.hr> - - * lread.c (locate_file): Expand `pathel' when appropriate. - (Flocate_file_clear_hashing): Expand path elements. - (Flocate_file_clear_hashing): Use Vlocate_file_hash_table. - - * dired.c (make_directory_hash_table): Create the hash-table only - if the directory open is successful. - - * lread.c (decode_mode_1): New function. - (decode_mode): Ditto. - (Flocate_file): Use them. - (Flocate_file): Expand FILENAME. - (locate_file_map_suffixes): New function. - (locate_file_in_directory_mapper): New function. - (locate_file_in_directory): Use locate_file_in_directory_mapper() - and locate_file_map_suffixes(). - (locate_file_construct_suffixed_files): Use - locate_file_map_suffixes(). - (locate_file_without_hash): Don't GCPRO path. - (Flocate_file_clear_hashing): Use EXTERNAL_LIST_LOOP. - (syms_of_lread): Remove Qlocate_file_hash_table. - (locate_file_find_directory_hash_table): Use - Vlocate_file_hash_table. - (locate_file_refresh_hashing): Ditto. - - * lread.c: Renamed read_objects to Vread_objects. - -1999-04-16 Olivier Galibert <galibert@pobox.com> - - * mule-charset.c: Generally resync with fsf 20.3 charset - interface. - (make_charset): Add long and short name. Use id instead of - leading byte. - (Fmake_charset): Ditto. - (Fmake_reverse_direction_charset): Ditto. - (Fcharset_property): Ditto. - (Fcharset_short_name): Added. - (Fcharset_long_name): Added. - (Fcharset_description): Renamed from charset-doc-string. - (syms_of_mule_charset): Synced symbols. - (complex_vars_of_mule_charset): Synced charsets. - - * mule-charset.h: Removed leading byte (uses id instead), added - short and long name. - -1999-04-15 Hrvoje Niksic <hniksic@srce.hr> - - * file-coding.c (Fdefine_coding_system_alias): New function. - -1999-04-08 Olivier Galibert <galibert@pobox.com> - - * mule-charset.c (complex_vars_of_mule_charset): Allow all iso8859 - and -ascii fonts for displaying ascii instead of iso8859-1 only. - -1998-12-14 Hrvoje Niksic <hniksic@srce.hr> - - * extents.c (set_extent_glyph_1): Make sure that the glyph we - attach to the extent is valid. - -1998-12-12 Hrvoje Niksic <hniksic@srce.hr> - - * dired.c (user_name_completion): Mule-ize. - (user_name_completion): Use xmalloc/xrealloc/xfree. - (user_name_completion): Use DO_REALLOC. - (user_name_completion): Cut down the number of static variables; - use a structure. - (user_name_completion): Username completion is always - case-sensitive. - -1998-12-06 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (base64_decode_1): Remove COUNTER. - (base64_decode_1): Accept CRLF in addition to CR. - (base64_decode_1): Disallow a stray character after final EOF; the - check was probably a remnant of buggy recode code. - -1998-12-05 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (init_provide_once): Provide `base64'. - -1998-12-04 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (XMALLOC_UNBIND): Include SPECCOUNT argument, for clarity. - (Fbase64_encode_region): If buffer is read-only, bail out early. - (Fbase64_decode_region): Ditto. - (Fbase64_encode_region): Initialize SPECCOUNT to pacify the - compiler. - (Fbase64_encode_string): Ditto. - (Fbase64_decode_region): Ditto. - (Fbase64_decode_string): Ditto. - -1998-11-25 Hrvoje Niksic <hniksic@srce.hr> - - * dired.c (Fdirectory_files): Remove redundant code. - -1999-03-05 Philip Aston <philipa@parallax.co.uk> - - * frame-msw.c Make raise-frame restore minimised windows. - -1999-03-05 Philip Aston <philipa@parallax.co.uk> - - * device-msw.c: Fix DEFVAR format - Death to phantom quote, and - add magic newline. - -1999-03-05 Philip Aston <philipa@parallax.co.uk> - - * toolbar-msw.c Consider captions when deciding whether to rebuild - toolbar. This fixes the initial toolbar display for those of us - who don't like captions. These patches applied by Andy Piper. - -1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.13 is released - -1999-03-12 SL Baur <steve@xemacs.org> - - * file-coding.c: Guard ucs table initialization with ifdef MULE. - -1999-03-10 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> - - * file-coding.c: docstring and comment improvements. - (decode_ucs4) flag possible data loss with comment. - -1999-03-10 Martin Buchholz <martin@xemacs.org> - - * file-coding.c (Fset_ucs_char): add CHECK_INT, CHECK_CHAR - (ucs_to_char): - (Fucs_char): - (Fset_char_ucs): - (decode_coding_ucs4): - (encode_coding_ucs4): - (detect_coding_utf8): - (decode_coding_utf8): - (encode_utf8): - (encode_coding_utf8): - Add CHECK_* macros where needed to avoid crashes. - #ifdef out all composite character support using - #ifdef ENABLE_COMPOSITE_CHARS - Use normal XEmacs coding standards. - Fix docstrings. - Remove CODING_STREAM_COMPOSE, CODING_STREAM_DECOMPOSE. - -1998-09-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (make-coding-system): Add description about - `ucs-4' and `utf-8'. - (detection_state): Modify to implement ucs-4 and utf-8. - (detect_coding_type): Likewise. - (detect_coding_ucs4): New implementation. - (detect_coding_utf8): New implementation. - (encode_utf8): fixed. - (syms_of_mule_coding): Rename `ucs4' and `utf8' to `ucs-4' and - `utf-8'. - -1998-09-08 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (mule_char_to_ucs4): Encode 94x94 chars in ISO - 2022 registry to private area. - -1998-09-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (encode_utf8): New function. - (encode_coding_utf8): New implementation. - -1998-09-07 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (ucs_to_mule_table): New variable; abolish - `Vucs_to_mule_table' - (mule_to_ucs_table): renamed from `Vmule_to_ucs_table'. - (set-ucs-char): New function. - (ucs_to_char): New function. - (ucs-char): New function. - (set-char-ucs): New function. - (char-ucs): New function. - (decode_ucs4): Use `ucs_to_char'. - (complex_vars_of_mule_coding): Abolish `ucs-to-mule-table' and - `mule-to-ucs-table'. - -1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * chartab.h: EXFUN `Fget_char_table'. - - * file-coding.c (encode_ucs4): New function. - (encode_coding_ucs4): Use `encode_ucs4'. - -1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (decode_coding_ucs4): New implementation. - -1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (decode_coding_ucs4): fixed. - - * file-coding.c (Vmule_to_ucs_table): New variable. - (mule_char_to_ucs4): New function. - (encode_coding_ucs4): New implementation. - (complex_vars_of_mule_coding): Define variable - `mule-to-ucs-table'. - -1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (decode_coding_utf8): New implementation. - -1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (decode_coding_utf8): fixed. - -1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (Vucs_to_mule_table): New variable. - (decode_ucs4): Refer `Vucs_to_mule_table'. - (complex_vars_of_mule_coding): Define variable - `ucs-to-mule-table'. - -1998-09-04 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * file-coding.c (detect_coding_ucs4): New function (not - implemented yet). - (decode_coding_ucs4): New function. - (encode_coding_ucs4): New function (not implemented yet). - (detect_coding_utf8): New function (not implemented yet). - (decode_coding_utf8): New function. - (encode_coding_utf8): New function (not implemented yet). - (make-coding-system): New type `ucs4' and `utf8'. - (coding-system-type): Likewise. - (detection_state): Add `ucs4' and `utf8'. - (detect_coding_type): Likewise. - (mule_decode): Use `decode_coding_ucs4' and `decode_coding_utf8'. - (mule_encode): Use `encode_coding_ucs4' and `encode_coding_utf8'. - (decode_ucs4): New function (very incomplete). - (syms_of_mule_coding): Add `ucs4' and `utf8'. - - * file-coding.h: Add definitions for UCS-4 and UTF-8. - -1999-03-08 Martin Buchholz <martin@xemacs.org> - - * mule-charset.c: - (non_ascii_valid_char_p): - (lookup_composite_char): - (composite_char_string): - (make-composite-char): - (composite-char-string): - (syms_of_mule_charset): - (complex_vars_of_mule_charset): - * mule-charset.h (LEADING_BYTE_COMPOSITE): - (CHAR_LEADING_BYTE): - (MAKE_CHAR): - * file-coding.h (CODING_STATE_COMPOSITE): - (CODING_STATE_ISO2022_LOCK): - (iso_esc_flag): - (LEADING_BYTE_COMPOSITE): - * file-coding.c (struct iso2022_decoder): - (decoding_closer): - (reset_iso2022): - (parse_iso2022_esc): - (encode_coding_iso2022): - #ifdef out all composite character support using - #ifdef ENABLE_COMPOSITE_CHARS - - * alloc.c: Define lrecord_coding_system only if ! FILE_CODING - -1999-03-04 Takeshi YAMADA <yamada@cslab.kecl.ntt.co.jp> - - * fns.c (Fbase64_encode_string): Calculate `allength' in the same - way of `Fbase64_encode_region'. - -1999-02-18 Katsumi Yamaoka <yamaoka@jpl.org> - - * fns.c (base64_encode_1): Don't add a newline at the tail. - -1999-03-08 Andy Piper <andy@xemacs.org> - - * menubar-msw.c (displayable_menu_item): correct off-by-one & - handling. - -1999-03-07 Martin Buchholz <martin@xemacs.org> - - * console-stream.h (struct stream_console): - * event-unixoid.c (event_stream_unixoid_select_console): - (event_stream_unixoid_unselect_console): - * print.c (Fexternal_debugging_output): - * sysdep.c (reset_one_device): - * console-stream.c (stream_init_console): - (stream_delete_console): - (allocate_stream_console_struct): move into stream_init_console. - (free_stream_console_struct): move into stream_delete_console. - Use `fd' only for file descriptors. - Therefore, rename members of struct stream_console. - - * systime.h: Unix98 says sys/time.h should define select(), but - some systems define that in unistd.h. So include that file always. - - * glyphs.h (MAYBE_IIFORMAT_METH): Don't use leading `_'. Avoid - multiple evaluation of first arg. Do proper do {} while (0) wrapping. - (HAS_IIFORMAT_METH_P): Prevent macro from being used in - non-boolean context - (MAYBE_IIFORMAT_DEVMETH): Use standard internal macro naming convention. - - * EmacsShell.c: - * balloon_help.c: - Add #include <stdio.h>. - Some versions of assert.h use printf() without #include'ing stdio.h - - * free-hook.c (blocktype): Add gcpro5_type to blocktype. - (log_gcpro): Remove unused variable FRAME. - (show_gcprohist): Ansify. - Comment the #endif's - - * frame-x.c (x_delete_frame): Don't use FRAME_X_SHELL_WIDGET(f) - after it's just been XtDestroy'ed! - -1999-02-18 Martin Buchholz <martin@xemacs.org> - - * opaque.c (print_opaque): - (sizeof_opaque): - (equal_opaque): - (hash_opaque): - Egcs 1.1.1 seems to have a bug where - INTP (p->size_or_chain) - will crash XEmacs. Fix by introducing intermediate variable. - - * sound.c (Fdevice_sound_enabled_p): Fix compiler warning. - - * dired.c (Fdirectory_files): - (Ffile_name_completion): - (Ffile_name_all_completions): - (file_name_completion): - - Use `directory' instead of `dirname' to sync with FSF Emacs and - avoid compiler warnings. - - Fix up docstrings so that C variables match documentation. - -1999-03-05 Martin Buchholz <martin@xemacs.org> - - * alloc.c: (garbage_collect_1): Reorg code to make scope of local - variables as small as possible to help out the compiler and the maintainer. - - * alloc.c: (disksave_object_finalization): - Set all the *-load-path variables to - nil, not just load-path itself. This gets the locate-file hash - tables garbage collected BEFORE dump, and has the side effect of - preventing crashes on OSF4.0+egcs. - - * alloc.c: - * gdbinit: - * dbxrc: - - Clean up gdb/dbx debugging support. - - Storing an EMACS_INT in an enum is not 64-bit clean! - - So change the enum to a set of separate variables. - - Add test cases to help debug the debugging support! - - Add `lisp-shadows' and `run-temacs' targets for dbx. - - Both dbx and gdb have been tested now. - -1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.12 is released - -1999-02-16 Kazuyuki IENAGA <ienaga@jsys.co.jp> - - * device-x.c: Support to find best visual without flashing. - -1999-03-02 Paul Keusemann <pkeusem@visi.com> - - * database.c (berkdb_map): Add flags argument to cursor call (must - be 0 according to docs) required for Berkeley DB 2.6.4 and later. - -1999-03-03 Martin Buchholz <martin@xemacs.org> - - * hash.c: - * hash.h: - General cleanup. Get free-hook.c working again. - Remove unused functions: - make_strings_hash_table, copy_hash, expand_hash_table. - - * malloc.c: - * mem-limits.h: - Always use new ANSI-style function prototypes. - - * unexalpha.c (unexec): Never use implicit int. - - * sgiplay.c (close_sound_file): - (play_sound_file): - (restore_audio_port): - (play_sound_data): - (audio_initialize): - (play_internal): - (drain_audio_port): - (write_mulaw_8_chunk): - (write_linear_chunk): - (write_linear_32_chunk): - (initialize_audio_port): - (open_audio_port): - (set_channels): - (set_output_format): - (adjust_audio_volume): - (get_current_volumes): - (parse_snd_header): - Always use new ANSI-style function prototypes. - Use unistd.h for missing prototypes. - - * unexelfsgi.c (round_up): - (find_section): - (unexec): Always use new ANSI-style function prototypes - - * elhash.c (struct Lisp_Hash_Table): rename golden to golden_ratio - - * console.h (struct console_methods): Always use full ANSI prototypes - - * emacs.c (__sti__iflPNGFile_c___): Always use full ANSI prototypes - -1999-03-02 Andy Piper <andy@xemacs.org> - - * event-stream.c (init_event_stream): make sure native mswindows - gets an appropriate event loop. - -1999-02-22 Andy Piper <andy@xemacs.org> - - * frame-msw.c (mswindows_make_frame_visible): use SW_SHOW rather - than SW_SHOWNORMAL to prevent resizing of maximised frames. - (mswindows_raise_frame): remove comment. - -1999-03-01 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.11 is released - -1999-02-25 SL Baur <steve@xemacs.org> - - * mule-charset.c (Qleading_byte): New variable to implement - charset-leading-byte function. - (Fcharset_property): Use it. - (syms_of_mule_charset): Initialize it. - From Kazuyuki IENAGA <ienaga@jsys.co.jp> - -1999-02-17 Kazuo Oishi <oishi@ae.agr.yamaguchi-u.ac.jp> - - * glyphs-x.c (cononvert_EImage_to_XImage): correct - bytes per pixel counting. - -1999-02-15 Andy Piper <andy@xemacs.org> - - * s/cygwin32.h (BROKEN_SIGIO): don't define this as it causes - major lockups. - -1999-02-16 MORIOKA Tomohiko <morioka@jaist.ac.jp> - - * fns.c (Fbase64_encode_string): New optional argument - `NO_LINE_BREAK'. - -1999-02-16 Martin Buchholz <martin@xemacs.org> - - * gdbinit: Fix up commands to run temacs. Add lisp-shadows command. - * alloc.c (xcalloc): undef xcalloc, just like xmalloc - -1999-02-10 Martin Buchholz <martin@xemacs.org> - - * s/bsdos4.h: New file. Port to BSDI BSD/OS 4.0. - * xintrinsic.h: Redo CONST support for X11 R4 compatibility. - -1999-02-05 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.10 is released - -1999-02-02 Gleb Arshinov <gleb@cs.stanford.edu> - - * process-nt.c (nt_send_process): - Fix for process-send-region/process-send-string breaking when size - of the input > 128 chars: change maximum chunk size for process - stream from 512 to 128, thus guaranteeing that ntpipe_shove_writer - succeeds. - -1999-02-02 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.9 is released - -1999-01-30 Martin Buchholz <martin@xemacs.org> - - * bytecode.c (funcall_compiled_function): Call - UNBIND_TO_GCPRO instead of UNBIND_TO_GCPRO_VARIABLES_ONLY. - - * backtrace.h (UNBIND_TO_GCPRO_VARIABLES_ONLY): - #ifdef 0 out unused macro. - -1999-01-27 Martin Buchholz <martin@xemacs.org> - - * gui.c (gui_parse_item_keywords_internal): Make static. - -1999-01-21 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c: add xface support. - (mswindows_xface_instantiate): new function copied from glyphs-x.c - (image_instantiator_format_create_glyphs_mswindows): do device - specific initialisation for xfaces. - (xbm_create_bitmap_from_data): line data must be padded to a word - boundary. - - * glyphs-x.c (xface_validate): moved to glyphs.c - (xface_normalize): ditto. - (xface_possible_dest_types): ditto. - (image_instantiator_format_create_glyphs_x): do device specific - initialisation for xfaces. - - * glyphs.h: declare xface symbol. - - * glyphs.c: move generic xface support here. - (xface_validate): moved from glyphs-x.c - (xface_normalize): ditto. - (xface_possible_dest_types): ditto. - (image_instantiator_format_create): xface declarations moved from - glyphs-x.c. - -1999-01-14 Adrian Aichner <adrian@xemacs.org> - - * event-stream.c (vars_of_event_stream): Fixing documentation. - -1999-01-17 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * glyphs-eimage.c (gif_instantiate): Correct handling of - interlaced gifs to avoid writing past the end of the eimage - buffer. - -1999-01-13 Hrvoje Niksic <hniksic@srce.hr> - - * search.c (Freplace_match): Handle single backslash at end of - NEWTEXT correctly. - -1999-01-12 William M. Perry <wmperry@aventail.com> - - * eldap.c (Fldap_open): slow down interrupts around ldap_open to - avoid connection errors. - -1999-01-12 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_update_line): backout change that - shouldn't have gone ine. - -1999-01-09 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * eldap.c (vars_of_ldap): Do no provide `ldap' here since it may - collide with ldap.el - -1999-01-11 Andy Piper <andy@xemacs.org> - - * redisplay.h (DISPLAY_LINE_HEIGHT): new macro. - (DISPLAY_LINE_YPOS): new macro. - - * redisplay-msw.c (mswindows_output_string): use it. - (mswindows_output_pixmap): ditto. - (mswindows_output_display_block): ditto. - - * redisplay-output.c (redisplay_output_display_block): new - function. just call the devmeth, maybe insert some generic code - here later. - (compare_display_blocks): use it. - (output_display_line): ditto. - (redisplay_unmap_subwindows_maybe): new function. potentially - unmap subwindows in the given area. - - * glyphs.c (reset_subwindow_cachels): unmap subwindows that we are - resetting. - -1999-01-10 J. Kean Johnston <jkj@sco.com> - - * Makefile.in.in: Set value of moduledir - - Changed DUMPENV to include $(MODULEPATH) - - Added install rule to install header files for use by ellcc. - - * config.h.in: Added INHIBIT_SITE_MODULES - - Added HAVE__DLERROR - - Added HAVE_DLFCN_H - - Added DLSYM_NEEDS_UNDERSCORE - - * dll.c: Removed. - - * emodules.c: New file containing dynamic loading code. - - * emodules.h: New file. - - * emacs.c: Added variables Vmodule_directory, - Vsite_module_directory, Vconfigure_module_directory and - Vconfigure_site_module_directory. - - (main_1): Added new variable inhibit_site_modules and command - line options `-no-site-modules' and `--no-site-modules'. - - (main_1): Call syms_of_module() instead of syms_of_dll(). - - (main_1): Call vars_of_module(). - - (vars_of_emacs): Introduce inhibit-site-modules, - module-directory, configure-module-directory, - site-module-directory, and configure-site-module-directory to the - Lisp reader. - - * lisp.h: Declare load_module and list_modules, as well as - Vmodule_directory, Vsite_module_directory, - Vconfigure_module_directory and Vconfigure_site_module_directory. - - * paths.h.in: Added PATH_MODULESEARCH and PATH_SITE_MODULES. - - Added correct support for site-lisp directory. - - * symbols.c (defsubr): Modified to allow modules to add new subrs - after dump time. - - (defsubr_macro): Same. - - (defvar_magick): Only use purespace when not initialized, so - that loaded modules can still add symbols. - - * symsinit.h: Add definitions for syms_of_module(), - vars_of_module(). Removed syms_of_dll(). - - * sysdll.c: Include dlfcn.h if HAVE_DLFCN_H is defined. - - (dll_variable): Take DLSYM_NEEDS_UNDERSCORE into account. - - (dll_error): use _dlerror() if HAVE__DLERROR is defined. - - * s/sco5-shr.h (C_SWITCH_SYSTEM): Correct for modern gcc and - explicitly pass -belf for native cc. - - * s/sco5.h (LIB_GCC): Use -print-libgcc-file-name instead of - hard-coding the library name. - -1999-01-01 <martin@xemacs.org> - - * device-x.c (Fx_set_font_path): - Add proper cast to permit compilation under C++. - - * buffer.c (directory_is_current_directory): - Add proper casts to permit compilation under C++. - -1998-12-30 Damon Lipparelli <lipp@primus.com> - - * event-msw.c (mswindows_wnd_proc): - Fixed failure when building with MSVC 5. - -1998-12-29 Martin Buchholz <martin@xemacs.org> - - * file-coding.c (decode_coding_iso2022): - - Prevent crash when decoding ISO7/Lock detected files - - the usual martin fiddling - -1998-12-29 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c: - glyphs-msw.c: - Fixed failures when building with MSVC. - * unexnt.c (dump_bss_and_heap): - Removed compiler warning by removing bss_data variable. - -1998-12-18 Jim Radford <radford@robby.caltech.edu> - - * device-x.c (Fx_set_font_path, Fx_get_font_path): New functions - so that packages that distribute their own fonts can access them. - -1998-12-28 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_button_instantiate): cope with buttons - that have an image provided. - - * glyphs.h: add Q_image decl. - - * glyphs-widget.c new functionality allowing images in - widgets. - (check_valid_glyph_or_image): new function to validate - glyphs passed in through :image. - (widget_normalize): new function. convert :image parameters into - real glyphs if not already so. - (widget_instantiate_1): mess with size parameters to be similar to - :image if provided. - (syms_of_glyphs_widget): new keyword :image. - (image_instantiator_format_create_glyphs_widget): normalize - buttons and allow :image. - -1998-12-27 Andy Piper <andy@xemacs.org> - - * frame-msw.c (mswindows_init_frame_1): warning elimination. - - * glyphs-widget.c (check_valid_anything): no-op function. - (check_valid_callback): check callbacks in gui_items. - (check_valid_symbol): as it sounds. - (check_valid_string_or_vector): ditto. - (widget_validate): modified for descriptors that are vectors or - sequences of keyword/val pairs. - (widget_instantiate_1): ditto. - (image_instantiator_format_create_glyphs_widget): allow gui_item - keywords in the instantiator. - - * gui.c (gui_parse_item_keywords_internal): renamed from - gui_parse_item_keywords but taking error behaviour. - (gui_parse_item_keywords): use it. - (gui_parse_item_keywords_no_errors): ditto. - (gui_item_add_keyval_pair): add Error_behavior flag and only - signal invalid keywords if required. - - * gui.h: new gui signatures. - - * menubar.c (menu_parse_submenu_keywords): use new - gui_item_add_keyval_pair signature. - - * s/cygwin32.h: modify PTY_ITERATION to eliminate warnings. - -1998-12-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.8 is released. - -1998-12-28 Martin Buchholz <martin@xemacs.org> - - * editfns.c (get_home_directory): - (user-home-directory): Simplify. - - - * callproc.c (child_setup): - - Environment variables were being passed to inferior processes - using internal encoding. - - Convert to external encoding. - - Rename local var `tem' to better name `tail'. - - Use Flength instead of `manual' calculation. - - * buffer.c (kill-buffer): - (record-buffer): - (set-buffer-major-mode): - (current-buffer): - - Fix up parameter names to correspond to docstrings. - - Don't use `bufname' when a buffer will do as well. - - Remove one unneeded GCPRO. - - * buffer.h (initial_directory): - * buffer.c (init_initial_directory): - - use correct conversions between internal and external format. - (directory_is_current_directory): new function - (init_buffer): convert initial_directory to internal format. - - solve crashes when current working directory is non-ASCII. - - * alloc.c (xmalloc): - (xcalloc): - (xrealloc): - - remove stupid casts, since XEmacs requires an ANSI C system. - (lrecord_type_index): replace abort() with more readable assert(). - - (reset_lcrecord_stats): remove. - (sweep_lcrecords_1): - - replace call to reset_lcrecord_stats() with call to xzero(). - -1998-12-27 Martin Buchholz <martin@xemacs.org> - - * process-unix.c (unix_create_process): - - Fix crash invoking program with non-ASCII name. - Try invoking xemacs with SHELL=/bin/sh, then M-x shell. - - Remove unused variable `env'. - - Rename `temp' to better name `save_errno'. - - Reorganize code for clarity. But still too chicken to nuke the - BSD 4.2 support. - -1998-12-24 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.7 is released. - -1998-12-23 Martin Buchholz <martin@xemacs.org> - - * glyphs.c (decode_device_ii_format): - - Fix indentation. - - Use GET_C_STRING_FILENAME_DATA_ALLOCA with char *, not Extbyte *. - - * glyphs-x.c (x_subwindow_instantiate): - - A image instance mask was being assigned to a image instance type! - - X_SUBWINDOW_INSTANCE_DATA (ii) is not an lvalue in C++. - - * glyphs-msw.c (mswindows_initialize_dibitmap_image_instance): - Fix indentation. - * glyphs-x.h: Make indentation consistent. - - * emacs.c (Fdump_emacs): Remove Steve Martin merge artifacts. - - * glyphs-widget.c (check_valid_glyph): Warning suppression. - - Make it static - - #ifdef it out, since it's not actually used yet (FIX THIS!) - - * glyphs-widget.c: - * glyphs.h: - Move declarations of decode_device_ii_format and - decode_image_instantiator_format into glyphs.h where they belong. - -1998-12-22 Martin Buchholz <martin@xemacs.org> - - * frame-x.c (x_delete_frame): Revert part of my changes at the - suggestion of Gunnar Evermann - unfortunately no one really - understands this code. - - * callproc.c (init_callproc): code cleanup. - - * free-hook.c (malloc): - (check_malloc): - (__free_hook): - (__malloc_hook): - (__realloc_hook): - (block_input_malloc): - (block_input_realloc): - * device-x.c (x_delete_device): - * emacs.c (voodoo_free_hook): - * events.c (print_event): - (CHECK_EVENT_TYPE): - (CHECK_EVENT_TYPE2): - (CHECK_EVENT_TYPE3): - Use proper prototypes. - Make C_E_T macros a little faster. - Pedantic fiddly little changes. You really don't care. - -1998-12-22 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_clear_region): make sure that - fg/bg colors get set even when we are in the border area. - -1998-12-13 Martin Buchholz <martin@xemacs.org> - - * console-msw.c: Function definitions follow coding standards - - This prevents e.g. find-tag on Lisp_Event finding DEVENT - -1998-12-11 Martin Buchholz <martin@xemacs.org> - - * events.h (struct timeout_data): - * event-tty.c (tty_timeout_to_emacs_event): - * event-msw.c (mswindows_wm_timer_callback): - * event-Xt.c (Xt_timeout_to_emacs_event): - * event-msw.c (mswindows_cancel_dispatch_event): - Make sure Lisp_Objects inside events are initialized to Qnil, not - Qnull_pointer, which is now illegal. - -1998-12-10 Martin Buchholz <martin@xemacs.org> - - * lisp.h: Fix up prototypes to match alloc.c - -1998-12-08 Martin Buchholz <martin@xemacs.org> - - * windowsnt.h: Remove `support' for using index and rindex - - * filelock.c (current_lock_owner): - - Change uses of index -> strchr, rindex -> strrchr - -1998-12-07 Martin Buchholz <martin@xemacs.org> - - * sysdep.c (set_descriptor_non_blocking): - Since O_NONBLOCK is now always #defined, make use of fcntl - conditional on F_SETFL being defined. - - * console-msw.c (DHEADgER): - (DOPAQUE_DATA): - (DEVENT): - (DCONS): - (DCONSCDR): - (DSTRING): - (DVECTOR): - (DSYMBOL): - (DSYMNAME): - - max_align_t should not be visible to the user of the - XOPAQUE_DATA macro. - - use Bufbyte instead of char - - parens around (FOOP (obj)) are always redundant. - If they were necessary, we should fix the macro instead. - - Always use string_data(foo) instead of foo->data. - - -1998-12-06 Martin Buchholz <martin@xemacs.org> - - * frame-msw.c (mswindows_init_frame_1): - - use make_lisp_hash_table, not Fmake_hash_table - - include elhash.h - - * lisp.h: - * alloc.c (make_vector): remove travesty - (Fmake_vector): - (make_pure_vector): - (pure_cons): - (make_bit_vector_internal): - (make_bit_vector): - (make_bit_vector_from_byte_vector): - (Fmake_bit_vector): - - make vector_equal a little faster. - - Don't use variable name `new'. - - Use size_t instead of EMACS_INT. - - usual Martin-style pointless bit-twiddling. - - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): - Make mapcar faster. In particular, make - (mapc #'identity long-string) - MUCH faster under Mule. - * tests/automated/lisp-tests.el: Test 'em! - - * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded - bytecode. - -1998-12-01 Martin Buchholz <martin@xemacs.org> - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): Always use - Qnil, not NULL, to initialize `null' Lisp_Objects. - -1998-11-29 Hrvoje Niksic <hniksic@srce.hr> - - * specifier.c (display_table_validate): Update. - - * redisplay.c (create_text_block): Use them. - - * glyphs.c (display_table_entry): New function. - (get_display_tables): Ditto. - -1998-12-15 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * eldap.c (toplevel): Mention that eldap.c compiles with - OpenLDAP libs - (Fldap_open): Use `GET_C_STRING_OS_DATA_ALLOCA' - (Fldap_search_internal): Ditto - -1998-12-11 Martin Buchholz <martin@xemacs.org> - - * event-msw.c (mswindows_cancel_dispatch_event): - Gratuitous code prettification - - -1998-12-07 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fnconc): Fix use of wrong_type_argument(). - - * floatfns.c (Ffloat): Fix docstring. - (Ffloat): Fix use of wrong_type_argument(). - (Fabs): Ditto. - (extract_float): Ditto. - (Fceiling): Ditto. - (Fround): Ditto. - (Ftruncate): Ditto. - -1998-12-06 Martin Buchholz <martin@xemacs.org> - - * frame-msw.c (mswindows_init_frame_1): - - use make_lisp_hash_table, not Fmake_hash_table - - include elhash.h - - * lisp.h: - * alloc.c (make_vector): remove travesty - (Fmake_vector): - (make_pure_vector): - (pure_cons): - (make_bit_vector_internal): - (make_bit_vector): - (make_bit_vector_from_byte_vector): - (Fmake_bit_vector): - - make vector_equal a little faster. - - Don't use variable name `new'. - - Use size_t instead of EMACS_INT. - - usual Martin-style pointless bit-twiddling. - - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): - Make mapcar faster. In particular, make - (mapc #'identity long-string) - MUCH faster under Mule. - * tests/automated/lisp-tests.el: Test 'em! - - * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded - bytecode. - -1998-12-02 Didier Verna <didier@xemacs.org> - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): set the - accelerator field to nil for labels. - -1998-12-16 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * menubar-msw.c (displayable_menu_item): - Escape occurrences of '&' and support occurrences of the - '%_' accelerator indicator in menus. - -1998-11-26 Didier Verna <didier@xemacs.org> - - * dired.c (Fdirectory_files): use make_string instead of - make_ext_string on the filename. The conversion external->internal - format is already done in sys_readdir. - -1998-12-15 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * glyphs.c (normalize_image_instantiator): GCPRO instantiator - -1998-12-16 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c - (Belatedly) added Kirill to list of file's authors. - emacs_mswindows_quit_p: Don't process WM_PAINT messages in - quit checking. WM_PAINT messages cause redisplay, but - windows' states are not necessarily stable when this function - gets called. - -1998-12-17 Andy Piper <andy@xemacs.org> - - * strftime.c (zone_name): CONSTify. - -1998-12-15 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_combo_instantiate): ditto. - (mswindows_widget_property): return Qunbound when no property available. - (mswindows_button_property): ditto. - (mswindows_combo_property): ditto. - (mswindows_widget_set_property): ditto. - - * glyphs-widget.c (check_valid_item_list): use properties. - - * glyphs.h (struct Lisp_Image_Instance): we have properties now. - - * glyphs.c (Fset_image_instance_property): allow setting of arbitrary properties. - (Fimage_instance_property): ditto. - * glyphs-widget.c (widget_property): ditto. - (widget_set_property): ditto. - - * frame-msw.c (mswindows_set_frame_pointer): SetCursor() as well - as setting the class cursor so that GC actually changes the - cursor. - - * config.h: don't undef MAIL_USE_POP. - -1998-12-13 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c - (image_instantiator_format_create_glyphs_mswindows): line -> - label. - (mswindows_label_instantiate): ditto. Play with window flags. - (image_instantiator_format_create_glyphs_mswindows): ditto. - (vars_of_glyphs_mswindows): provide Qlabel as we support it now. - - * glyphs-widget.c (widget_instantiate_1): re-jig autosizing to - cope with lines and labels. - (static_instantiate): use widget_instantiate_1. - line -> label. - (image_instantiator_format_create_glyphs_widget): ditto. - -1998-12-10 Andy Piper <andy@xemacs.org> - - * Makefile.in.in (objs): add gui.o - -1998-12-10 Andy Piper <andy@xemacs.org> - - * gui.c: adjust defines of HAVE_POPUPS so that we can build with - no window system. - -1998-12-09 Andy Piper <andy@xemacs.org> - - * glyphs.c (finalize_image_instance): mark glyphs changed when an - image instance is removed so that the subwindow cache gets reset - and thus destroyed images get GC'd. - -1998-12-08 Andy Piper <andy@xemacs.org> - - * gui-msw.c (mswindows_handle_gui_wm_command): call - MARK_SUBWINDOWS_CHANGED. - - * glyphs-msw.c (mswindows_finalize_image_instance): make sure - subwindows really get deleted. - - * redisplay.c: new variable subwindows_changed[_set]. - (redisplay_window): use it. - (redisplay_frame): ditto. - (redisplay_device): ditto. - (redisplay_without_hooks): ditto. - - * device.h (MARK_DEVICE_SUBWINDOWS_CHANGED): new macro for - subwindows redisplay as per glyphs equivalent. - * redisplay.h: ditto. - (MARK_SUBWINDOWS_CHANGED): ditto. - (RESET_CHANGED_SET_FLAGS): ditto. - * frame.h (MARK_FRAME_SUBWINDOWS_CHANGED): ditto. - -1998-12-07 Andy Piper <andy@xemacs.org> - - * frame.c (Fmake_frame): reset subwindow cachels on non-stream - frames. - - * redisplay.c (redisplay_frame): invalidate subwindow cachels. - - * event-msw.c (mswindows_wnd_proc): catch the various WM_CTLCOLOR* - messages and paint widget glyphs as appropriate with their face fg - & bg. - -1998-12-06 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (vars_of_glyphs_mswindows): provide widget types - here rather than in glyphs-widget - do this because we only want - to provide what is really available. - - * glyphs.c (Fimage_instance_property): new function to get the - properties of image instances. wires through to console specific - methods and then to widget specific methods. - (Fset_image_instance_property): ditto but for setting widget properties. - (check_valid_face): make extern so that it can be used elsewhere. - - * glyphs-widget.c (widget_property): new function. gets the - properties of widgets in general and wires the function through to - widget specific ones. - (widget_set_property): ditto but for setting widget properties. - - * glyphs-msw.c (mswindows_combo_instantiate): Add functionality to - add items to the list. Play with window styles a bit to get the - desired effect. - (mswindows_widget_property): break out specific widget properties. - (mswindows_button_property): new function. gets the checked state - of a button. - (mswindows_combo_property): new function. gets the current - selection in the combo box. - (mswindows_widget_set_property): new function. sets specific - properties of specific widgets. - - * glyphs-widget.c (check_valid_item_list): new function. check - that items for a combo-box are just a list of strings. - (combo_validate): new function. check there is an item list. - (widget_instantiate_1): new function. renamed from - widget_instantiate so that we can do slightly different things for - other widgets. - (widget_instantiate): call widget_instantiate_1. - (combo_instantiate): new function to instantiate combo boxes, - defaults height to the pixel height of the number of items in the - box. - (syms_of_glyphs_widget): move widget keywords here. - (image_instantiator_format_create_glyphs_widget): use new combo - functions. - -1998-12-04 Andy Piper <andy@xemacs.org> - - * event-msw.c (mswindows_wnd_proc): mule-ize. - - * glyphs.c (pixmap_to_lisp_data): mule-ize. - - * glyphs-msw.c (extract_xpm_color_names): mule-ize. - (resource_name_to_resource): ditto. - (mswindows_resource_instantiate): ditto. - (mswindows_widget_instantiate): ditto. - (mswindows_widget_set_property): ditto. - - * redisplay-output.c (redisplay_output_subwindow): don't show - subwindows if they are obscured at the edge of the frame, emacs - gets into some sort of redisplay loop otherwise. - - * gui.h: prototype gui_item_selected_p. - - * gui.c (gui_item_selected_p): new function to determine the - selected state of a gui_item. - - * frame.h (struct frame): add subwindows_changed flag. - - * redisplay.c (redisplay_frame): call update_frame_subwindows (). - - * glyphs.c (update_subwindow): new function to update a - subwindow's state. - (update_frame_subwindows): new function to update all the - subwindows on a frame. - - * console.h (struct console_methods): add update_subwindow. - - * glyphs-msw.c (mswindows_widget_property): return selected state - for selected property. - (mswindows_update_subwindow): new function. updates widget glyphs - in redisplay as per menubars or toolbars e.g. selected state. - (console_type_create_glyphs_mswindows): add update_subwindow. - -1998-12-03 Andy Piper <andy@xemacs.org> - - * console-tty.c (syms_of_console_tty): MULE -> FILE_CODING since - tty coding system things are such. - - * glyphs-widget.c (widget_face_font_info): new function for - pulling out height and width metrics for a widget's face. - (widget_text_to_pixel_conversion): calculate pixel sizes of text - for widgets. - - * event-msw.c (mswindows_drain_windows_queue): translate messages - that are destined for subwindows. This makes edit fields interact - with the keyboard correctly. - nuke warnings by #ifndef'ing out stuff not required by msg select(). - - * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): new - macro defining the iiforma without the symbol required by widget. - (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT): use it. - - * general.c (syms_of_general): add Qwidget, Qselected. - - * faces.c (complex_vars_of_faces): add widget face inheriting from - gui-element face. - -1998-11-09 Andy Piper <andy@xemacs.org> - - * window.h (struct window): add a cache of subwindows on a - per-window basis. - - * window.c (mark_window): mark the subwindow_instance_cache. - (allocate_window): initialise the subwindow instance_cache. - - * toolbar-x.c (x_output_toolbar): call redisplay_clear_region - instead of the devmeth. - (x_clear_toolbar): ditto. - - * redisplay-x.c (x_output_display_block): call - redisplay_output_subwindow for subwindows and widgets. - - * redisplay-tty.c (tty_output_display_block): add IMAGE_WIDGET to - types to do nothing for. - - * lisp.h: declare new widget/subwindow symbols. - - * glyphs.c (image_instantiate): cache subwindows on a per-window - basis. - (subwindow_possible_dest_types): new function for subwindow dest - types. - (subwindow_instantiate): generic instantiation of a - subwindow. specialised by device multi-methods. - (Fsubwindowp): moved from glyphs-x.c. adapted for glyph-based - subwindows. - (Fimage_instance_subwindow_id): ditto. - (Fresize_subwindow): ditto. - (Fforce_subwindow_map): ditto. - - * glyphs-x.c (x_print_image_instance): remove subwindow - stuff. Handled genrically in glyphs.c. - (x_image_instance_equal): ditto. - (x_image_instance_hash): ditto. - (x_finalize_image_instance): delete subwindows when required. - (mark_subwindow) (print_subwindow) (finalize_subwindow) - (subwindow_hash) (Fmake_subwindow): deleted because of new, - glyph-based, subwindow implementation. - (Fsubwindow_height) (Fsubwindow_width) (Fsubwindow_xid): aliased - in glyphs.el - (Fsubwindowp) (Fresize_subwindow) (Fforce_subwindow_map): moved to - glyphs.c. - (x_unmap_subwindow): new function to unmap X subwindows. - (x_map_subwindow): new function to map X subwindows. - (x_subwindow_instantiate): new function to instantiate X - subwindows. - (x_resize_subwindow): new function to resize X subwindows. - (console_type_create_glyphs_x): add subwindow functions. - (image_instantiator_format_create_glyphs_x): add device - multi-methods for xpm, xbm and subwindow. - - * glyphs.el (subwindow-xid): old alias for new subwindow functions. - (subwindow-width): ditto. - (subwindow-height): ditto. - - * glyphs-msw.c (mswindows_widget_instantiate): new function for - generally instantiating ms subwindows. Used by - mswindows_*_instantiate. - (mswindows_edit_instantiate): instantiate an edit field on a - mswindows frame. - -1998-11-04 Andy Piper <andy@xemacs.org> - - * symsinit.h: declare new functions. - - * redisplay.h: declare new functions. - - * redisplay-x.c (x_output_display_block): call - redisplay_clear_region rather than x_clear_region. - (x_output_string): ditto. - (x_output_pixmap): ditto. - (x_clear_to_window_end): ditto. - (x_output_eol_cursor): ditto. - (x_clear_region): only do X specific things. other duties handled - in redisplay_clear_region. - - * redisplay-tty.c (tty_clear_region): do tty specific things - some - duties moved to redisplay_clear_region. - - * redisplay-output.c (clear_left_border): use - redisplay_clear_region instead of device method. - (clear_right_border): ditto. - (output_display_line): ditto. - (redisplay_output_subwindow): ditto. - (redisplay_clear_top_of_window): ditto. - (redisplay_clear_region): perform duties previously handled by - device methods. call the appropriate device method at the - end. unmap subwindows if necessary. - - * redisplay-msw.c (mswindows_output_string): use - redisplay_clear_region instead of mswindows_clear_region. - (mswindows_clear_to_window_end): ditto. - (mswindows_output_display_block): output subwindows when required. - (mswindows_clear_region): only do mswindows specific things, - everything else is now handled in redisplay_clear_region. - - * gui.h: add item id hash defines and declare function prototypes. - - * gui.c (mark_gui_item): new function for marking gui_items. - (gui_item_hash): generic hash function for generating command ids - for gui_items. - - * gui-msw.c: new file. - (mswindows_handle_gui_wm_command): new function to handle widget - callbacks. - - * glyphs.h (MAYBE_IIFORMAT_DEVMETH): new function for device - multi-methods. - (IIFORMAT_HAS_SHARED_METHOD): ditto. - (DEFINE_DEVICE_IIFORMAT): ditto. - (INITIALIZE_DEVICE_IIFORMAT): ditto. - (struct Lisp_Image_Instance): add widget and subwindow data plus - appropriate access functions. - - * glyphs.c (decode_device_ii_format): new function for decoding - image instantiator functions based on a device type as well as an - image format. - (decode_image_instantiator_format): just call - decode_device_ii_format with nil device. - (add_entry_to_device_ii_format_list): new function for per device - method instances. - (add_entry_to_image_instantiator_format_list): just call - add_entry_to_device_ii_format_list with nil device. - (check_valid_vector): new function. - (instantiate_image_instantiator): instantiate using per-format - method and then per-format-per-device method (device - multi-methods). signal an error if neither is possible. - (mark_image_instance): cope with subwindows and widgets. - (print_image_instance): ditto. - (image_instance_equal): ditto. - (image_instance_hash): ditto. - (allocate_glyph): ditto. - (glyph_width): ditto. - (glyph_height_internal): ditto. - (xpm_instantiate): removed because of device multi-methods. - (mark_subwindow_cachels): new cachel functions for caching - instantiated subwindows on a per-frame basis. mostly copied from - glyph cachel functions. - (update_subwindow_cachel_data): ditto. - (add_subwindow_cachel): ditto. - (get_subwindow_cachel_index): ditto. - (reset_subwindow_cachels): ditto. - (mark_subwindow_cachels_as_not_updated): ditto. - (unmap_subwindow): generic unmapping of subwindows based on cachel - data. - (map_subwindow): ditto. - (initialize_subwindow_image_instance): generic initialisation of - subwindow data. - (syms_of_glyphs): add widget keywords. - - * glyphs-x.h (struct x_subwindow_data): convert Lisp_Subwindow to - x_subwindow_data. - -1998-11-04 Andy Piper <andy@xemacs.org> - - * glyphs-widget.c: new file for instantiating widget type glyphs. - (widget_possible_dest_types): new general dest type function for - widgets. - (widget_validate): ditto. - (initialize_widget_image_instance): ditto - (widget_instantiate): ditto. Sets up fg/bg, gui_item parsing - before handing on control to device multi-methods. - (syms_of_glyphs_widget): new function. - (image_instantiator_format_create_glyphs_widget): new function, - added placeholders for button, edit, combo, scrollbar - (vars_of_glyphs_widget): new function. - - * glyphs-msw.h (WIDGET_INSTANCE_MSWINDOWS_HANDLE): new define for - storing window ids of widgets. - - * glyphs-msw.c (mswindows_finalize_image_instance): cope with - deletion of widget and subwindow glyphs. - (mswindows_unmap_subwindow): new device function for unmapping - subwindows on a msw frame. - (mswindows_map_subwindow): ditto. - (mswindows_register_image_instance): register instantiated widgets - with the widget hastable. - (mswindows_button_instantiate): instantiate a button type widget - on an msw frame. - (mswindows_subwindow_instantiate): instanttiate a subwindow on a - mswindows frame. - (image_instantiator_format_create_glyphs_mswindows): add device - multi-methods for xbm, xpm, subwindow, edit and button. - - * frame.h (struct frame): add subwindow_cachels dynarr for caching - information about subwindows visible on the current frame. used by - redisplay_clear_region to unmap subwindows as required. - - * frame.c (mark_frame): mark subwindow_cachels. - (allocate_frame_core): instantiate subwindow_cachels. - - * frame-msw.c (mswindows_init_frame_1): instntiate and mark the - widget hashtable. - - * event-msw.c (mswindows_wnd_proc): add call to - mswindows_handle_gui_wm_command to handle widget callbacks. - - * emacs.c (main_1): add calls to glyphs-widget initialisation - routines. - - * console.h (struct console_methods): add - unmap/map_subwindow_method for use be redisplay_clear_region to - map and unmap subwindows. Remove xpm and xbm stuff - now dealt - with by image instantiator multi-methods. Add - resize_subwindow_method. - - * console-stream.c (stream_clear_region): change signature to - match new generic clear region function. - - * Makefile.in.in: add glyphs-widget.o to list of objects. - - * console-msw.h (struct mswindows_frame): add widget hashtable for - wiring command ids to callbacks. - -1998-12-16 Andy Piper <andy@xemacs.org> - - * XEmacs 21.2.6 is released - -1998-12-08 Hrvoje Niksic <hniksic@srce.hr> - - * md5.c (Fmd5): Correctly initiate string input stream. - - * Makefile.in.in (tests): Add md5-tests.el. - -1998-12-06 Martin Buchholz <martin@xemacs.org> - - * lisp.h: - * alloc.c (make_vector): remove travesty - (Fmake_vector): - (make_pure_vector): - (pure_cons): - (make_bit_vector_internal): - (make_bit_vector): - (make_bit_vector_from_byte_vector): - (Fmake_bit_vector): - - make vector_equal a little faster. - - Don't use variable name `new'. - - Use size_t instead of EMACS_INT. - - usual Martin-style pointless bit-twiddling. - - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): - Make mapcar faster. In particular, make - (mapc #'identity long-string) - MUCH faster under Mule. - * tests/automated/lisp-tests.el: Test 'em! - -1998-12-06 Martin Buchholz <martin@xemacs.org> - - * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded - bytecode. - -1998-12-13 Martin Buchholz <martin@xemacs.org> - - * console-msw.c: Function definitions follow coding standards - - This prevents e.g. find-tag on Lisp_Event finding DEVENT - -1998-12-11 Martin Buchholz <martin@xemacs.org> - - * events.h (struct timeout_data): - * event-tty.c (tty_timeout_to_emacs_event): - * event-msw.c (mswindows_wm_timer_callback): - * event-Xt.c (Xt_timeout_to_emacs_event): - * event-msw.c (mswindows_cancel_dispatch_event): - Make sure Lisp_Objects inside events are initialized to Qnil, not - Qnull_pointer, which is now illegal. - -1998-12-10 Martin Buchholz <martin@xemacs.org> - - * lisp.h: Fix up prototypes to match alloc.c - -1998-12-09 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (init_image_instance_from_xbm_inline): don't use - XSETINT for assigning lisp objects. - -1998-12-07 Martin Buchholz <martin@xemacs.org> - - * opaque.h: - * console-msw.c (DHEADER): - (DOPAQUE_DATA): - (DEVENT): - (DCONS): - (DCONSCDR): - (DSTRING): - (DVECTOR): - (DSYMBOL): - (DSYMNAME): - - max_align_t should not be visible to the user of the - XOPAQUE_DATA macro. - - use Bufbyte instead of char - - parens around (FOOP (obj)) are always redundant. - If they were necessary, we should fix the macro instead. - - Always use string_data(foo) instead of foo->data. - -1998-12-07 Martin Buchholz <martin@xemacs.org> - - * sysdep.c (set_descriptor_non_blocking): - Since O_NONBLOCK is now always #defined, make use of fcntl - conditional on F_SETFL being defined. - -1998-12-09 Andy Piper <andy@xemacs.org> - - * menubar-msw.c (mswindows_handle_wm_command): add back in checks - that got removed in the merge - -1998-11-30 Greg Klanderman <greg@alphatech.com> - - * dired.c (vars_of_dired): bugfix for previous conditionalization - of user-name-completion on non- Windows NT. - -1998-12-08 Martin Buchholz <martin@xemacs.org> - - * windowsnt.h: Remove `support' for using index and rindex - - * filelock.c (current_lock_owner): - - Change uses of index -> strchr, rindex -> strrchr - -1998-12-06 Martin Buchholz <martin@xemacs.org> - - * frame-msw.c (mswindows_init_frame_1): - - use make_lisp_hash_table, not Fmake_hash_table - - include elhash.h - -1998-12-05 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.5 is released - -1998-11-30 Martin Buchholz <martin@xemacs.org> - - * xselect.c (receive_incremental_selection): - * xselect.c (x_get_window_property): - * xmu.c (XmuReadBitmapDataFromFile): - * xmu.c (XmuCursorNameToIndex): - * xgccache.c (describe_gc_cache): - * xgccache.c (gc_cache_lookup): - * xgccache.c (free_gc_cache): - * xgccache.c (make_gc_cache): - * window.h: - * window.c (map_windows_1): - * window.c (Fother_window_for_scrolling): - * window.c (window_scroll): - * window.c (change_window_height): - * window.c (Fsplit_window): - * window.c (window_left_gutter_width): - * window.c (window_modeline_height): - * window.c (invalidate_vertical_divider_cache_in_window): - * window.c (window_needs_vertical_divider_1): - * window.c (update_mirror_internal): - * window.c (SET_LAST_FACECHANGE): - * widget.c (Fwidget_plist_member): - * unexec.c (copy_text_and_data): - * unexcw.c (copy_executable_and_dump_data_section): - * tooltalk.doc: - * tooltalk.c (struct Lisp_Tooltalk_Pattern): - * tooltalk.c (struct Lisp_Tooltalk_Message): - * toolbar.h (struct toolbar_button): - * toolbar.c (default_toolbar_visible_p_changed_in_window): - * toolbar.c (recompute_overlaying_specifier): - * toolbar.c (toolbar_validate): - * toolbar.c (toolbar_button_at_pixpos): - * toolbar.c (get_toolbar_coords): - * toolbar.c (update_frame_toolbars): - * toolbar-x.c: - * toolbar-msw.c (mswindows_handle_toolbar_wm_command): - * toolbar-msw.c (mswindows_find_toolbar_pos): - * toolbar-msw.c (mswindows_output_toolbar): - * toolbar-msw.c (mswindows_clear_toolbar): - * toolbar-msw.c: - * systty.h: - * syssignal.h: - * sysproc.h: - * sysfile.h: - * sysdll.c: - * sysdep.h: - * sysdep.c (rmdir): - * sysdep.c (sys_fopen): - * sysdep.c (sys_open): - * sysdep.c (tty_init_sys_modes_on_device): - * sysdep.c (get_eof_char): - * sysdep.c (child_setup_tty): - * sysdep.c (set_descriptor_non_blocking): - * syntax.h: - * syntax.c (scan_words): - * syntax.c: - * symsinit.h: - * symeval.h (struct symbol_value_varalias): - * symeval.h (struct symbol_value_forward): - * symbols.c (syms_of_symbols): - * symbols.c (init_symbols_once_early): - * symbols.c (Fbuilt_in_variable_type): - * symbols.c (Fsymbol_value_in_buffer): - * symbols.c (default_value): - * symbols.c (Fset): - * symbols.c (find_symbol_value_quickly): - * symbols.c (store_symval_forwarding): - * symbols.c (set_default_console_slot_variable): - * symbols.c (set_default_buffer_slot_variable): - * symbols.c (verify_ok_for_buffer_local): - * symbols.c (symbol_is_constant): - * symbols.c (oblookup): - * symbols.c (Funintern): - * symbols.c (Fintern): - * symbols.c (check_obarray): - * sunplay.c: - * specifier.h (struct specifier_methods): - * specifier.h: - * specifier.c (specifier_instance): - * specifier.c (specifier_instance_from_inst_list): - * specifier.c (decode_locale_type): - * specifier.c (specifier_equal): - * specifier.c (finalize_specifier): - * specifier.c (prune_specifiers): - * specifier.c (kill_specifier_buffer_locals): - * sound.c (init_native_sound): - * sound.c: - * signal.c (alarm): - * search.c (Fmatch_data): - * search.c (match_limit): - * search.c (Freplace_match): - * search.c (skip_chars): - * search.c (scan_buffer): - * search.c: - * scrollbar.c (specifier_vars_of_scrollbar): - * scrollbar.c (Fscrollbar_set_hscroll): - * scrollbar.c (vertical_scrollbar_changed_in_window): - * scrollbar.c (release_window_mirror_scrollbars): - * scrollbar.c (free_scrollbar_instance): - * scrollbar-x.c: - * scrollbar-msw.c: - * s/msdos.h (O_BINARY): - * s/linux.h: - * s/freebsd.h (LIBS_TERMCAP): - * regex.c (re_match_2_internal): - * regex.c (compile_extended_range): - * regex.c (POP_FAILURE_POINT): - * regex.c (PUSH_FAILURE_POINT): - * redisplay.h (RESET_CHANGED_SET_FLAGS): - * redisplay.h: - * redisplay.h (struct display_line): - * redisplay.h (struct rune): - * redisplay.c (vars_of_redisplay): - * redisplay.c (redisplay_variable_changed): - * redisplay.c (UPDATE_CACHE_RETURN): - * redisplay.c (validate_line_start_cache): - * redisplay.c (mark_redisplay_structs): - * redisplay.c (mark_glyph_block_dynarr): - * redisplay.c (window_line_number): - * redisplay.c (redisplay_frame): - * redisplay.c (redisplay_window): - * redisplay.c (generate_modeline): - * redisplay.c (create_right_glyph_block): - * redisplay.c (create_left_glyph_block): - * redisplay.c (create_text_block): - * redisplay.c: - * redisplay-x.c (x_output_hline): - * redisplay-x.c (x_output_vertical_divider): - * redisplay-tty.c (tty_output_display_block): - * redisplay-output.c (output_display_line): - * redisplay-output.c: - * redisplay-msw.c (mswindows_output_vertical_divider): - * redisplay-msw.c (mswindows_ring_bell): - * redisplay-msw.c (mswindows_output_cursor): - * redisplay-msw.c: - * rangetab.c: - * ralloc.c: - * puresize.h (RAW_PURESIZE): - * profile.c (syms_of_profile): - * profile.c (Fstart_profiling): - * profile.c (sigprof_handler): - * profile.c: - * procimpl.h: - * process.c (vars_of_process): - * process.c (read_process_output): - * process.c (get_process): - * process.c: - * process-unix.c (unix_open_multicast_group): - * process-unix.c (unix_get_tty_name): - * process-unix.c (unix_send_process): - * process-unix.c (unix_reap_exited_processes): - * process-unix.c (unix_create_process): - * process-unix.c (unix_init_process_io_handles): - * process-unix.c (allocate_pty): - * process-unix.c: - * process-nt.c (nt_open_network_stream): - * process-nt.c (nt_update_status_if_terminated): - * process-nt.c (nt_finalize_process_data): - * process-nt.c: - * print.c (debug_short_backtrace): - * print.c (debug_backtrace): - * print.c (print_symbol): - * print.c (print_internal): - * print.c (print_cons): - * print.c (Fwrite_char): - * print.c (print_prepare): - * print.c (canonicalize_printcharfun): - * print.c (output_string): - * print.c: - * opaque.h: - * opaque.c (allocate_managed_opaque): - * opaque.c: - * offix.c (DndSetData): - * objects.c (face_boolean_create): - * objects.c (font_instantiate): - * objects.c (font_create): - * objects.c (color_create): - * objects.c (finalize_font_instance): - * objects.c (finalize_color_instance): - * objects.c: - * objects-x.c (x_font_instance_truename): - * objects-x.c: - * objects-x.c (x_initialize_font_instance): - * objects-x.c (allocate_nearest_color): - * objects-tty.c (tty_initialize_font_instance): - * objects-tty.c (tty_initialize_color_instance): - * objects-msw.c (mswindows_initialize_color_instance): - * ntproc.c (syms_of_ntproc): - * ntproc.c (Fwin32_set_process_priority): - * ntproc.c (sys_spawnve): - * ntproc.c: - * ntheap.c (get_data_end): - * nt.c (period): - * nt.c: - * nt.c (stat): - * nt.c (generate_inode_val): - * nt.c (sys_rename): - * nas.c: - * mule-wnnfns.c (Fwnn_hinsi_number): - * mule-wnnfns.c (Fwnn_yuragi): - * mule-wnnfns.c (Fwnn_common_learn): - * mule-wnnfns.c (Fwnn_suffix_learn): - * mule-wnnfns.c (Fwnn_prefix_learn): - * mule-wnnfns.c (Fwnn_okuri_learn): - * mule-wnnfns.c (Fwnn_complex_conv): - * mule-wnnfns.c (Fwnn_last_is_first): - * mule-wnnfns.c (Fwnn_bmodify_dict_add): - * mule-wnnfns.c (Fwnn_notrans_dict_add): - * mule-wnnfns.c (Fwnn_fiusr_dict_add): - * mule-wnnfns.c (Fwnn_fisys_dict_add): - * mule-wnnfns.c (Fwnn_hinsi_list): - * mule-wnnfns.c (Fwnn_fuzokugo_set): - * mule-wnnfns.c (Fwnn_dict_search): - * mule-wnnfns.c (Fwnn_word_toroku): - * mule-wnnfns.c (Fwnn_hindo_update): - * mule-wnnfns.c (Fwnn_bunsetu_henkou): - * mule-wnnfns.c (Fwnn_kakutei): - * mule-wnnfns.c (Fwnn_begin_henkan): - * mule-wnnfns.c (Fwnn_dict_comment): - * mule-wnnfns.c (Fwnn_dict_add): - * mule-wnnfns.c (Fwnn_open): - * mule-mcpath.c (mc_getcwd): - * mule-coding.c (vars_of_mule_coding): - * mule-coding.c (convert_to_external_format): - * mule-coding.c (encoding_marker): - * mule-coding.c (decoding_marker): - * mule-coding.c (Fcopy_coding_system): - * mule-coding.c (Fmake_coding_system): - * mule-coding.c (Fcoding_system_list): - * mule-coding.c (Ffind_coding_system): - * mule-coding.c (symbol_to_eol_type): - * mule-coding.c: - * mule-charset.c (complex_vars_of_mule_charset): - * mule-charset.c (vars_of_mule_charset): - * mule-charset.c (Fset_charset_ccl_program): - * mule-charset.c (struct charset_list_closure): - * mule-charset.c (Ffind_charset): - * mule-charset.c (make_charset): - * mule-charset.c (non_ascii_valid_char_p): - * mule-charset.c: - * mule-ccl.c (ccl_driver): - * mule-canna.c (c2mu): - * mule-canna.c (Fcanna_henkan_begin): - * mule-canna.c (Fcanna_parse): - * mule-canna.c (Fcanna_store_yomi): - * mule-canna.c (Fcanna_touroku_string): - * mule-canna.c (Fcanna_initialize): - * minibuf.c: - * menubar.c (menu_parse_submenu_keywords): - * menubar-x.c (make_dummy_xbutton_event): - * menubar-x.c (set_frame_menubar): - * menubar-x.c (menu_item_descriptor_to_widget_value_1): - * menubar-x.c: - * menubar-msw.h: - * menubar-msw.c (mswindows_popup_menu): - * menubar-msw.c (mswindows_update_frame_menubars): - * menubar-msw.c (mswindows_handle_wm_command): - * menubar-msw.c (unsafe_handle_wm_initmenu_1): - * menubar-msw.c (unsafe_handle_wm_initmenupopup_1): - * menubar-msw.c (update_frame_menubar_maybe): - * menubar-msw.c (populate_or_checksum_helper): - * menubar-msw.c (empty_menu): - * menubar-msw.c: - * md5.c: - * marker.c (set_marker_internal): - * marker.c (print_marker): - * malloc.c: - * make-src-depend: - * lstream.c (lisp_buffer_rewinder): - * lstream.c (mark_lstream): - * lrecord.h: - * lrecord.h (struct lrecord_header): - * lread.c (readevalloop): - * lread.c (locate_file): - * lread.c (locate_file_in_directory): - * lread.c (Flocate_file): - * lread.c (load_force_doc_string_unwind): - * lread.c (ebolify_bytecode_constants): - * lread.c: - * lisp.h: - * lisp-union.h: - * lisp-disunion.h: - * linuxplay.c (linux_play_data_or_file): - * linuxplay.c (audio_init): - * line-number.c: - * keymap.h: - * keymap.c (describe_map): - * keymap.c (describe_map_mapper): - * keymap.c (Fdescribe_bindings_internal): - * keymap.c (Fsingle_key_description): - * keymap.c (map_keymap_sorted): - * keymap.c (get_relevant_keymaps): - * keymap.c (Flookup_key): - * keymap.c (raw_lookup_key_mapper): - * keymap.c (Fdefine_key): - * keymap.c (Fevent_matches_key_specifier_p): - * keymap.c (key_desc_list_to_event): - * keymap.c (define_key_parser): - * keymap.c (define_key_check_and_coerce_keysym): - * keymap.c (keymap_submaps): - * keymap.c (keymap_store_internal): - * keymap.c (keymap_delete_inverse_internal): - * keymap.c (keymap_store_inverse_internal): - * keymap.c (print_keymap): - * keymap.c (Lisp_Keymap): - * keymap.c: - * intl.c: - * insdel.c (convert_bufbyte_string_into_emchar_dynarr): - * insdel.c (make_gap): - * input-method-xlib.c (get_XIM_input): - * input-method-xlib.c (XIM_init_frame): - * imgproc.c: - * hash.h: - * hash.c: - * gui.c: - * gui-x.c (button_item_to_widget_value): - * gui-x.c (popup_selection_callback): - * glyphs.h (struct image_instantiator_methods): - * glyphs.c (mark_glyph_cachels): - * glyphs.c (Fglyph_type): - * glyphs.c (image_instantiate): - * glyphs.c (image_create): - * glyphs.c (make_image_instance_1): - * glyphs.c (finalize_image_instance): - * glyphs.c: - * glyphs-x.c (finalize_subwindow): - * glyphs-x.c (xface_validate): - * glyphs-x.c (x_locate_pixmap_file): - * glyphs-x.c (convert_EImage_to_XImage): - * glyphs-msw.c: - * glyphs-msw.c (mswindows_resource_instantiate): - * glyphs-msw.c (xpm_to_eimage): - * glyphs-msw.c (convert_EImage_to_DIBitmap): - * glyphs-eimage.c (tiff_instantiate): - * glyphs-eimage.c (png_instantiate): - * glyphs-eimage.c (struct png_error_struct): - * glyphs-eimage.c (gif_memory_storage): - * glyphs-eimage.c: - * gifrlib.h: - * getloadavg.c (getloadavg): - * getloadavg.c: - * gdbinit: - * free-hook.c (log_gcpro): - * free-hook.c (check_malloc): - * free-hook.c (check_free): - * free-hook.c (ROUND_UP_TO_PAGE): - * free-hook.c: - * frame.h (struct frame): - * frame.h: - * frame.c (change_frame_size_1): - * frame.c (allocate_frame_core): - * frame.c: - * frame-x.c (x_focus_on_frame): - * frame-x.c (x_init_frame_2): - * frame-x.c (x_popup_frame): - * frame-x.c (xemacs_XtPopup): - * frame-x.c: - * frame-x.c (Foffix_start_drag_internal): - * frame-x.c (x_cde_destroy_callback): - * frame-x.c (x_wm_hack_wm_protocols): - * frame-tty.c (tty_frame_visible_p): - * frame-msw.c (mswindows_make_frame_invisible): - * frame-msw.c (mswindows_after_init_frame): - * frame-msw.c (mswindows_init_frame_1): - * fns.c (syms_of_fns): - * fns.c (Fbase64_decode_string): - * fns.c (Fnconc): - * fns.c (Ffillarray): - * fns.c (Fobject_plist): - * fns.c (Fget): - * fns.c (Fcanonicalize_lax_plist): - * fns.c (Fcanonicalize_plist): - * fns.c (Fplist_remprop): - * fns.c (Fplist_get): - * fns.c (advance_plist_pointers): - * fns.c (internal_plist_put): - * fns.c (Fnreverse): - * fns.c (Fremassq): - * fns.c (Felt): - * fns.c (Fsubstring): - * fns.c (Fbvconcat): - * fns.c (Flength): - * fns.c (length_with_bytecode_hack): - * fns.c (print_bit_vector): - * fns.c: - * floatfns.c (Ffloor): - * floatfns.c: - * floatfns.c (in_float_error): - * fileio.c (Ffile_modes): - * fileio.c (Fexpand_file_name): - * fileio.c (Fmake_temp_name): - * fileio.c (Ffile_name_nondirectory): - * fileio.c (Ffile_name_directory): - * file-coding.h: - * file-coding.c (vars_of_mule_coding): - * file-coding.c (convert_to_external_format): - * file-coding.c (encoding_marker): - * file-coding.c (decoding_marker): - * file-coding.c (Fcopy_coding_system): - * file-coding.c (Fmake_coding_system): - * file-coding.c (struct coding_system_list_closure): - * file-coding.c (Ffind_coding_system): - * file-coding.c (symbol_to_eol_type): - * file-coding.c: - * faces.h (struct face_cachel): - * faces.c (vars_of_faces): - * faces.c (face_property_was_changed): - * faces.c (mark_face_cachels): - * faces.c (temporary_faces_list): - * faces.c (struct face_list_closure): - * faces.c: - * extents.h (struct extent): - * extents.c (vars_of_extents): - * extents.c (struct copy_string_extents_1_arg): - * extents.c (add_string_extents_mapper): - * extents.c (Fextent_property): - * extents.c (Fset_extent_property): - * extents.c (symbol_to_glyph_layout): - * extents.c (properties_equal): - * extents.c (print_extent): - * extents.c (print_extent_1): - * extents.c (extent_in_region_p): - * extents.c (gap_array_make_gap): - * extents.c: - * events.h (struct Lisp_Event): - * events.h: - * events.c (Fevent_properties): - * events.c (format_event_object): - * events.c (Fmake_event): - * events.c (event_equal): - * events.c (print_event): - * events.c (mark_event): - * event-stream.c ((read-char) - * event-stream.c (vars_of_event_stream): - * event-stream.c (syms_of_event_stream): - * event-stream.c (Fset_recent_keys_ring_size): - * event-stream.c (Fsit_for): - * event-stream.c (Fnext_event): - * event-stream.c (execute_help_form): - * event-stream.c (maybe_kbd_translate): - * event-stream.c: - * event-msw.c (vars_of_event_mswindows): - * event-msw.c (mswindows_wnd_proc): - * event-msw.c (mswindows_need_event): - * event-msw.c (mswindows_drain_windows_queue): - * event-msw.c (mswindows_pump_outstanding_events): - * event-msw.c: - * event-msw.c (slurp_thread): - * event-msw.c (struct ntpipe_slurp_stream): - * event-msw.c (HANDLE_TO_USID): - * event-Xt.c (emacs_Xt_handle_magic_event): - * event-Xt.c (x_event_to_emacs_event): - * event-Xt.c (x_reset_modifier_mapping): - * event-Xt.c (x_reset_key_mapping): - * event-Xt.c: - * eval.c (syms_of_eval): - * eval.c (warn_when_safe): - * eval.c (warn_when_safe_lispobj): - * eval.c (Fbacktrace_frame): - * eval.c (Fbacktrace): - * eval.c (top_level_set): - * eval.c (unbind_to_hairy): - * eval.c (specbind_magic): - * eval.c (specbind_unwind_wasnt_local): - * eval.c (call2_trapping_errors): - * eval.c (call1_trapping_errors): - * eval.c (catch_them_squirmers_call2): - * eval.c (call0_trapping_errors): - * eval.c (run_hook_trapping_errors): - * eval.c (catch_them_squirmers_eval_in_buffer): - * eval.c (call4_in_buffer): - * eval.c (call3_in_buffer): - * eval.c (call2_in_buffer): - * eval.c (call1_in_buffer): - * eval.c (call0_in_buffer): - * eval.c (run_hook): - * eval.c (run_hook_with_args_in_buffer): - * eval.c (Fapply): - * eval.c (Feval): - * eval.c (do_autoload): - * eval.c (un_autoload): - * eval.c (Fautoload): - * eval.c (Finteractive_p): - * eval.c (Fcommand_execute): - * eval.c (signal_quit): - * eval.c (call_with_suspended_errors): - * eval.c (signal_error): - * eval.c (return_from_signal): - * eval.c (Fcall_with_condition_handler): - * eval.c (run_condition_case_handlers): - * eval.c (condition_case_1): - * eval.c (Funwind_protect): - * eval.c (unwind_to_catch): - * eval.c (internal_catch): - * eval.c (Fmacroexpand_internal): - * eval.c (Fuser_variable_p): - * eval.c (Fdefconst): - * eval.c (Fdefvar): - * eval.c (Ffunction): - * eval.c (signal_call_debugger): - * eval.c (call_debugger): - * eval.c: - * emacs.c (main): - * emacs.c (sort_args): - * emacs.c (main_1): - * elhash.h: - * elhash.c: - * editfns.c (Fencode_time): - * editfns.c (Fdecode_time): - * editfns.c (Fuser_full_name): - * editfns.c: - * editfns.c (save_excursion_restore): - * ecrt0.c: - * dynarr.c: - * doprnt.c (emacs_doprnt_1): - * doc.c (verify_doc_mapper): - * doc.c (Fsnarf_documentation): - * doc.c (Fdocumentation): - * dll.c: - * dired.c (user_name_completion): - * dired.c (Fdirectory_files): - * dialog-x.c: - * dialog-msw.c: - * dgif_lib.c (FreeSavedImages): - * dgif_lib.c (DGifGetImageDesc): - * device.h: - * device.h (struct device): - * device.c (Fselect_device): - * device.c (allocate_device): - * device.c: - * device-x.c (Fx_keysym_on_keyboard_p): - * device-x.c (Fx_valid_keysym_name_p): - * device-x.c (x_IO_error_handler): - * device-x.c (x_delete_device): - * device-x.c (x_finish_init_device): - * device-x.c (x_init_device): - * device-x.c: - * device-msw.c (mswindows_init_device): - * dbxrc: - * database.c (vars_of_database): - * database.c (Fput_database): - * database.c (Fopen_database): - * database.c (berkdb_remove): - * database.c (berkdb_put): - * database.c (Fdatabasep): - * database.c (print_database): - * database.c: - * data.c (vars_of_data): - * data.c (syms_of_data): - * data.c (init_errors_once_early): - * data.c (prune_weak_lists): - * data.c (finish_marking_weak_lists): - * data.c (print_weak_list): - * data.c (Fmod): - * data.c (Fstring_to_number): - * data.c (Fnumber_to_string): - * data.c (Findirect_function): - * data.c (Fsetcdr): - * data.c (Ffloatp): - * data.c (Fsubr_interactive): - * data.c (Farrayp): - * data.c (Fkeywordp): - * data.c (Fnull): - * data.c: - * console.h (CONSOLE_NAME): - * console.h: - * console.c (vars_of_console): - * console.c (Fselect_console): - * console.c: - * console-x.h (DEVICE_X_COLORMAP): - * console-x.h (struct x_device): - * console-x.c (x_device_to_console_connection): - * console-tty.h (CONSOLE_TTY_FINAL_CURSOR_Y): - * console-tty.c (tty_init_console): - * console-tty.c: - * console-msw.h (struct mswindows_frame): - * conslots.h: - * config.h.in: - * cmds.c (internal_self_insert): - * cmds.c (Fforward_line): - * cmds.c (Fforward_char): - * cmds.c: - * cmdloop.c: - * chartab.c (mark_char_table_entry): - * chartab.c: - * casefiddle.c (casify_word): - * callproc.c (child_setup): - * callproc.c (Fcall_process_internal): - * callproc.c: - * callint.c (Fcall_interactively): - * bytecode.h: - * bytecode.c (execute_rare_opcode): - * bytecode.c (execute_optimized_program): - * bytecode.c: - * bufslots.h: - * buffer.h (BUFFER_REALLOC): - * buffer.h (GET_CHARPTR_INT_DATA_ALLOCA): - * buffer.h (GET_CHARPTR_EXT_DATA_ALLOCA): - * buffer.h: - * buffer.h (MAP_INDIRECT_BUFFERS): - * buffer.h (CHECK_LIVE_BUFFER): - * buffer.c (init_initial_directory): - * buffer.c (complex_vars_of_buffer): - * buffer.c (vars_of_buffer): - * buffer.c (finish_init_buffer): - * buffer.c (Fget_file_buffer): - * buffer.c (Fbuffer_list): - * buffer.c (mark_buffer): - * balloon_help.c (balloon_help_move_to_pointer): - * balloon_help.c (show_help): - * balloon_help.c: - * backtrace.h: - * alloc.c (garbage_collect_1): - * alloc.c (sweep_strings): - * alloc.c (sweep_compiled_functions): - * alloc.c (sweep_bit_vectors_1): - * alloc.c (sweep_vectors_1): - * alloc.c (sweep_lcrecords_1): - * alloc.c (tick_lcrecord_stats): - * alloc.c (pure_string_sizeof): - * alloc.c (mark_conses_in_list): - * alloc.c (mark_object): - * alloc.c (report_pure_usage): - * alloc.c (make_pure_float): - * alloc.c (make_pure_string): - * alloc.c (free_managed_lcrecord): - * alloc.c (mark_string): - * alloc.c (noseeum_make_marker): - * alloc.c (allocate_event): - * alloc.c (Fbit_vector): - * alloc.c (Fvector): - * alloc.c (make_float): - * alloc.c (Fmake_list): - * alloc.c (Flist): - * alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC): - * alloc.c (PUT_FIXED_TYPE_ON_FREE_LIST): - * alloc.c (DECLARE_FIXED_TYPE_ALLOC): - * alloc.c (dbg_constants): - * alloc.c (gc_record_type_p): - * alloc.c (free_lcrecord): - * alloc.c (xmalloc): - * alloc.c (NOSEEUM_INCREMENT_CONS_COUNTER): - * abbrev.c: - * Makefile.in.in (mostlyclean): - * Makefile.in.in (external_client_xlib_objs_nonshared): - * Makefile.in.in (temacs_link_args): - * Makefile.in.in (release): - * Makefile.in.in (dnd_objs): - * Makefile.in.in (objs): - * Makefile.in.in (PROGNAME): - * EmacsShell.c: cast strings to (XtPointer) - * EmacsFrame.c: cast strings to (XtPointer) - - mega patch - - rewrite basic lisp functions for speed - - rewrite bytecode interpreter for speed - - rewrite list looping constructs for speed and safety using - tortoise/hare. - - use size_t where appropriate. - - new hashtable implementation - - cleanup implementation of opaques - - opaques can now be purecopy'ed - - move some cl functionality into C for speed. - - remove last remaining VMS support - - spelling fixes - - improve gdb/dbx debugger support - - move pure.c back into alloc.c for performance - - enable report_pure_usage() if --memory-usage-stats - - remove remnants of Energize support (EMACS_BTL, cadillac...) - - don't use symbols with leading `_' or embedded `__' - - globally cleanup duplicated semicolons `;;' - - I give in on %p vs %lx - we use printf("%lx",(long) p) - globally. - - globally replace O_NDELAY with O_NONBLOCK. - - globally replace CDISABLE with _POSIX_VDISABLE. - - use O_RDONLY and O_RDWR instead of magic `0' and `2'. - - define (and maybe use!) STDERR_FILENO and friends. - - add support for macros defined in C - - `when', `unless', `not' and `defalias' now defined in C, - so that they are universally available. - - rename defvar_mumble to defvar_magic - - rename RETURN__ to RETURN_SANS_WARNINGS - - use consistent style of initial caps in error messages - - implement last, butlast, nbutlast, copy-list in C. - - provide typedefs for all struct Lisp_foo types - - Lisp_Objects must be initialized to Qnil rather than 0. - - make sure XEmacs runs (slowly) with always_gc == 1; - - fast and safe LOOP_* macros - - change calls to XSETOBJ to XSETFOO - - replace calls to XSETINT by make_int() - - plug up memory leaks - - use style markobj (foo), not silly ((markobj) (foo)) - - use XFLOAT_DATA (obj) instead of float_data (XFLOAT (obj)) - -1998-12-02 P. E. Jareth Hein <jareth@camelot.co.jp> - - * unexec.c: Changed a #ifndef statement to fix XEmacs on BSDI 3.0 - -1998-11-28 SL Baur <steve@altair.xemacs.org> - - * XEmacs 21.2-beta4 is released. - -1998-11-27 SL Baur <steve@altair.xemacs.org> - - * mule-charset.c (complex_vars_of_mule_charset): Fix graphic - property in control-1 charset. - From Julian Bradfield <jcb@daimi.au.dk> - -1998-11-26 Jan Vroonhof <vroonhof@math.ethz.ch> - - * gui-x.c (button_item_to_widget_value): Ignore :key-sequence - keyword. - Add stub for :label. - - * gui.c (gui_item_add_keyval_pair): ditto. - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): Ignore - :key-sequence keyword. - Add stub for:label. - Support :active for submenus like the Windows code and FSF Emacs. - -1998-11-27 Hrvoje Niksic <hniksic@srce.hr> - - * dired.c (make_directory_hash_table): make_string() is OK because - readdir() Mule-encapsulates. - -1998-11-26 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fbase64_encode_string): Fix docstring. - (Fbase64_decode_string): Ditto. - -1998-11-26 Hrvoje Niksic <hniksic@srce.hr> - - * editfns.c (Ftranslate_region): Use - convert_bufbyte_string_into_emchar_string(). - -1998-11-25 Hrvoje Niksic <hniksic@srce.hr> - - * editfns.c (Ftranslate_region): Accept vectors and char-tables as - well as strings. - (Ftranslate_region): Turn table into an array of Emchars for - larger regions. - -1998-11-25 Hrvoje Niksic <hniksic@srce.hr> - - * chartab.c (Freset_char_table): Fix wrong placement of #endif. - -1998-11-24 Hrvoje Niksic <hniksic@srce.hr> - - * chartab.c (Freset_char_table): Don't blindly fill chartables of - type `char' with nils. - - * chartab.c (canonicalize_char_table_value): Coerce ints to chars - for tables of type `char'. - -1998-11-26 Didier Verna <didier@xemacs.org> - - * 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 <didier@xemacs.org> - - * process-unix.c (unix_create_process): handle properly - Vfile_name_coding_system for converting the program and directory - names. - -1998-11-27 SL Baur <steve@altair.xemacs.org> - - * m/arm.h: New file. - From James LewisMoss <dres@ioa.com> - -1998-11-27 Takeshi Hagiwara <hagiwara@ie.niigata-u.ac.jp> - - * m/mips-nec.h: - Fix the realpath() problem of UnixWare2.1.3. - Patches for NEC's sysv4.2 machine. - -1998-11-25 Hrvoje Niksic <hniksic@srce.hr> - - * dired.c (Fdirectory_files): Remove redundant code. - -1998-11-25 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (free_malloced_ptr): New function. - (XMALLOC_OR_ALLOCA): New macro. - (XMALLOC_UNBIND): Ditto. - (Fbase64_encode_region): Use malloc() for large blocks; arrange it - to be freed in case of non-local exit. - (Fbase64_encode_string): Ditto. - (Fbase64_decode_region): Ditto. - (Fbase64_decode_string): Ditto. - (STORE_BYTE): New macro. - (base64_decode_1): Use it. - -1998-11-25 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (base64_value_to_char): Base64 stuff. - -1998-11-24 Hrvoje Niksic <hniksic@srce.hr> - - * editfns.c (Fbuffer_substring): New function. - - * lisp.h: Declare make_string_from_buffer_no_extents(). - - * insdel.c (make_string_from_buffer_1): New function. - (make_string_from_buffer_no_extents): Ditto. - -1998-11-15 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * linuxplay.c: Including <fcntl.h> instead of <sys/fcntl.h> makes - sound work on AIX with OSS installed. Linux should still work. - -1998-11-03 Andy Piper <andyp@parallax.co.uk> - - * config.h.in: name change for cygwin/version.h - - * configure.in: check for cygwin/version.h now. - - * cygwin32.h: track CYGWIN_DLL_VERSION_MAJOR -> - CYGWIN_VERSION_DLL_MAJOR name change in cygwin b20. - move cygwin32/version.h to cygwin/version.h - -1998-11-03 Olivier Galibert <galibert@pobox.com> - - * lisp.h (struct Lisp_Bit_Vector): Fix declaration of bits from - int to long. - -1998-10-22 Andy Piper <andyp@parallax.co.uk> - - * cygwin32.h: track CYGWIN_DLL_VERSION_MAJOR -> - CYGWIN_VERSION_DLL_MAJOR name change in cygwin b20. - enable BROKEN_SIGIO under b20 to make QUIT work. - -1998-10-22 Andy Piper <andyp@parallax.co.uk> - - * frame-msw.c (mswindows_size_frame_internal): force frame sizing - to fit within the constraints of the screen size. I.e. make the - frame small enough to fit and move it if some of it will be - off-screen. - -1998-10-19 Greg Klanderman <greg@alphatech.com> - - * dired.c: conditionalize inclusion of user-name-completion - primitives on non-Windows NT. The needed functions don't exist on NT. - -1998-11-24 SL Baur <steve@altair.xemacs.org> - - * gifrlib.h: Clean up types for 64 bit compile. - * dgif_lib.c (DGifInitRead): Ditto. - (MakeSavedImage): Ditto. - * emacs.c (decode_path): Ditto. - From Steve Carney <carney@pa.dec.com> - -1998-10-16 William M. Perry <wmperry@aventail.com> - - * glyphs-msw.c (bitmap_table): Fixed typo in builtin bitmaps - (cehckboxes instead of checkboxes). - -1998-10-15 SL Baur <steve@altair.xemacs.org> - - * XEmacs 21.2-beta3 is released. - -1998-10-13 Raymond Toy <toy@rtp.ericsson.se> - - * runemacs.c (WinMain): If the basename is "rungnuclient.exe", run - gnuclient. Otherwise, we run xemacs as we always did. This gets - rid of the annoying DOS window when running gnuclient. - -1998-10-13 Andy Piper <andyp@parallax.co.uk> - - * dragdrop.c (vars_of_dragdrop): rename HAVE_MSWINDOWS -> - HAVE_MS_WINDOWS typo. - -1998-10-13 SL Baur <steve@altair.xemacs.org> - - * process-unix.c (unix_send_process): Set closed flag on writable - pipe after SIGPIPE is received and before we call deactivate_process. - -1998-10-03 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * window.c (Fset_window_start): respect narrowing when - checking wheter start is at the beginning of a line. - (Fset_window_buffer): Ditto - Fixes repeatable crash in VM. - -1998-10-09 SL Baur <steve@altair.xemacs.org> - - * window.c (specifier_vars_of_window): Set default vertical - divider width to 1 on ttys. - -1998-10-08 Martin Buchholz <martin@xemacs.org> - - * alloc.c: - * unexec.c: - * malloc.c: - Add <stddef.h> to get ptrdiff_t declaration - -1998-10-07 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * scrollbar-msw.c: Use the same vertical scrollbar drag hack as - is used for Motif or Lucid scrollbars under X. - -1998-10-08 Pierre Wendling <pw@ebc.vbe.dec.com> - - * m/alpha.h (UNEXEC): quoted to avoid bad expansion when running - `configure' - -1998-10-06 Takeshi Hagiwara <hagiwara@ie.niigata-u.ac.jp> - - * frame-x.c (x_delete_frame): Fix an argument of XtDestroyWidget. - -1998-10-05 Andy Piper <andyp@parallax.co.uk> - - * s/cygwin32.h: more cygwin b20 reorganisation. - -1998-10-01 Raymond Toy <toy@rtp.ericsson.se> - - * nas.c: Added necessary support functions to be able to handle - WAVE files in memory, just like the support for SND files in - memory. - -1998-09-30 SL Baur <steve@altair.xemacs.org> - - * callproc.c (child_setup): Fix spelling typo. - -1998-09-29 SL Baur <steve@altair.xemacs.org> - - * XEmacs 21.2-beta2 is released. - -1998-09-27 P. E. Jareth Hein <jareth@camelot.co.jp> - - * regex.c (re_match_2_internal): Add in code to reset lowest_active_reg - to prevent memory corruption in the case of jumping out of a series of - nested match patterns. This is a rather brute force approach, though. - -1998-09-02 Andy Piper <andyp@parallax.co.uk> - - * config.h.in: ditto. - - * s/cygwin32.h: rearrange declarations to cope with cygwin - b20. Include cygwin32/version.h if it exists. - -1998-09-20 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * device-msw.c (mswindows_init_device): Call new - mswindows_enumerate_fonts() function in objects-msw.c instead - of font_enum_callback_1() to enumerate fonts. - - font_enum_callback_1() and _2() moved to objects-msw.c. - - * faces.c (complex_vars_of_faces): Make the mswindows default - face font fully specified and provide some fallbacks. - - * objects-msw.c: font_enum_callback_1() and _2() moved here - from objects-msw.c. Obtain the enumerated font's character - sets by table lookup instead of using the locale-specific - string provided by Windows. - - New public non-method mswindows_enumerate_fonts() that fills - in the supplied mswindows device's font list. - - mswindows_initialize_font_instance: Use the supplied name - variable instead of f->name when signalling errors. Match font - weights and character sets using lookup tables which handle - spaces instead of by frobbing. - -1998-09-20 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * process-nt.c: Define an arbitrary limit, FRAGMENT_CODE_SIZE, - on the size of code fragments passed to run_in_other_process. - - run_in_other_process(): Use FRAGMENT_CODE_SIZE to determine - the amount of memory to allocate in the other process. - - Removed sigkill_code_end(), sigint_code_end() and - sig_enable_code_end() since they are now redundant. - - send_signal() and enable_child_signals(): Don't try to work - out the end of the code fragments passed to - run_in_other_process() - -1998-09-10 Kazuyuki IENAGA <ienaga@jsys.co.jp> - - * src/s/freebsd.h: Added __ELF__ and compiler/liker flags for - FreeBSD-current. - - * src/unexelf.c: Partially synched with FSF's 20.3. - -1998-09-10 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (signal_after_change): Map across indirect buffers - here, and not in the upper-level functions. - (signal_first_change): Don't check for Armageddon. - (signal_before_change): Map across indirect buffers here. - (prepare_to_modify_buffer): ...and here. - -1998-09-09 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (signal_after_change): Add return value. - (buffer_insert_string_1): Use it. - (buffer_delete_range): Ditto. - (buffer_replace_char): Ditto. - (cancel_multiple_change): Map the indirect buffers. - -1998-09-06 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (init_buffer_text): Remove INDIRECT_P parameter. - (uninit_buffer_text): Ditto. - - * buffer.c (Fmake_indirect_buffer): Implement stricter - error-checking. - -1998-09-04 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (change_function_restore): Reverse order of - function-call and assignment. - (first_change_hook_restore): Ditto. - - * extents.c (mark_extent_auxiliary): Mark them. - (Fset_extent_property): Set them. - (Fextent_property): Get them. - (Fextent_properties): Ditto. - (vars_of_extents): Set their default. - - * extents.h (struct extent_auxiliary): Add before_change_functions - and after_change_functions. - - * insdel.c (signal_before_change): Use it. - (signal_after_change): Ditto. - - * extents.c (report_extent_modification): New function. - - * insdel.c (signal_before_change): Don't check for Armageddon. - (signal_after_change): Ditto. - -1998-09-11 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - - * redisplay.c (redisplay_window): make sure a new starting point - is chosen if it somehow got moved from the beginning of the line - -- this can happen because Fwiden was called recently. - - * window.c (Fset_window_start): set start_at_line_beg correctly - (Fset_window_buffer): Ditto - -1998-09-06 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (init_buffer_text): Remove INDIRECT_P parameter. - (uninit_buffer_text): Ditto. - - * buffer.c (Fmake_indirect_buffer): Implement stricter - error-checking. - -1998-05-14 Jan Vroonhof <vroonhof@math.ethz.ch> - - * emacs.c (main_1): Removed references to *vars_of_filelock. - - * lisp.h: Added Fsystem_name. - - * filelock.c: Replaced by version from FSF 20.2. Now implements - locking by using symlinks which is NFS safe. However keep the - GCPRO's in lock_file and the calls to callx_in_buffer like our old - version (and of course use ansi C, acessor macros, etc). - -1998-09-06 Jan Vroonhof <vroonhof@math.ethz.ch> - - * process-unix.c (unix_create_process): Reset SIGHUP handler to - SIG_DFL. We now try to conserve any inherted SIG_IGN settings - in init_signals_very_early. However these should not be passed - on to children attached to the new pty. - -1998-08-28 Andy Piper <andyp@parallax.co.uk> - - * glyphs-eimage.c (png_instantiate_unwind): clean up eimage after use. - -1998-09-07 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * fileio.c (file-name-directory, file_name_as_directory): - Don't call CORRECT_DIR_SEPS, even when #defined WINDOWSNT. - -1998-09-02 Andy Piper <andyp@parallax.co.uk> - - * emacs.c (main_1): init_ralloc() if initialised and we have REL_ALLOC - - * ralloc.c: uncomment __morecore. - -1998-09-92 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c(winsock_writer): Supply a dummy 4th argument to - WriteFile() to fix a winsock 1.x bug on Win95. - -1998-08-28 Hrvoje Niksic <hniksic@srce.hr> - - * event-Xt.c (emacs_Xt_mapping_action): Check for device being - deleted. - (x_event_to_emacs_event): Ditto. - (emacs_Xt_handle_focus_event): Ditto. - (emacs_Xt_handle_magic_event): Ditto. - - * console-x.h (struct x_device): New flag being_deleted. - (DEVICE_X_BEING_DELETED): New macro. - - * device-x.c (x_IO_error_handler): Throw to top-level instead of - returning. Before doing that, set the being_deleted flag on the - device. - -1998-08-27 Hrvoje Niksic <hniksic@srce.hr> - - * device-x.c (x-seppuku-on-epipe): Removed. - -1998-08-26 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - - * frame-x.c (x_delete_frame): Flush the X output buffer after - calling XtDestroyWidget to ensure that the windows are really - killed right now. - -1998-08-26 Hrvoje Niksic <hniksic@srce.hr> - - * menubar-x.c (my_run_hook): New unused function. - (pre_activate_callback): Use run_hook for Qactivate_menubar_hook, - since we ignore the results of the contained functions anyway. - -1998-08-26 P. E. Jareth Hein <jareth@camelot.co.jp> - - * glyphs-eimage.c (gif_instantiate): Fix a crash in handling - interlaced GIF files that are smaller than 4 lines high... - -1998-08-31 Hrvoje Niksic <hniksic@srce.hr> - - * buffer.c (map_over_sharing_buffers): Deleted. - - * insdel.c (MAP_INDIRECT_BUFFERS): Move to buffer.h. - - * buffer.c (Fkill_buffer): Keep indirect_children updated while - killing them. - -1998-08-31 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (buffer_insert_string_1): Advance the point bytind in - all the buffers. - (buffer_delete_range): Ditto. - - * marker.c (init_buffer_markers): Set point-marker to the value of - point in an indirect buffer. - -1998-08-30 Hrvoje Niksic <hniksic@srce.hr> - - * undo.c (undo_prelude): Test last-undo-buffer against base - buffer. - - * insdel.c (MAP_INDIRECT_BUFFERS): Use it. - - * buffer.h (BUFFER_BASE_BUFFER): New macro. - -1998-08-30 Hrvoje Niksic <hniksic@srce.hr> - - * insdel.c (init_buffer_text): Initialize it here. - - * line-number.c: Address line_number_cache through buffer->text. - - * buffer.c (mark_buffer): Mark line number cache. - - * bufslots.h (line_number_cache): Move to struct buffer_text. - - * insdel.c (buffer_insert_string_1): Propagate signals and changes - across the children buffers. - (buffer_delete_range): Ditto. - (buffer_replace_char): Ditto. - (gap_left): Ditto. - (gap_right): Ditto. - - * insdel.c (MAP_INDIRECT_BUFFERS): New macro. - - * buffer.c (Fmake_indirect_buffer): Uncomment. - -1998-08-31 Hrvoje Niksic <hniksic@srce.hr> - - * macros.c (Fend_kbd_macro): Remove trailing period from error - message. - (Fexecute_kbd_macro): Ditto. - -1998-08-21 Greg Klanderman <greg@alphatech.com> - - * dired.c (Fuser_name_completion): remove optional 2nd argument. - (Fuser_name_completion_1): new function to return uniqueness - indication in addition to the user name completion. - (user_name_completion): change type of `uniq' argument. - -1998-08-19 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * lread.c (vars_of_lread): Removed `source-directory' variable. - -1998-08-22 Hrvoje Niksic <hniksic@srce.hr> - - * fileio.c (Ffile_readable_p): Apply the DOS/Windows logic to - Cygwin. - -1998-08-19 SL Baur <steve@altair.xemacs.org> - - * dired.c (vars_of_dired): Fix misapplied patch. - -1998-08-16 Martin Buchholz <martin@xemacs.org> - - * fns.c (Fremrassq, remrassq_no_quit): - A XCAR that should have been an XCDR turned Fremrassq into Fremassq - -1998-07-17 Didier Verna <didier@xemacs.org> - - * redisplay-x.c (x_get_gc): returns a GC with a FillStipple fill - style as foreground GC for faces that have the `dim' property. - (x_output_string): when the `dim' face property is set, - ensure the gray pixmap has been created, and get a proper - foreground GC to draw the text. - -1998-08-09 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c (mswindows_wnd_proc): Workaround for a Win95 bug: - Manually track the state of the left and right Ctrl and Alt - modifiers. - -1998-08-07 Matt Stupple <matts@tibco.com> - - * ntproc.c: don't wait on char_consumed at thread entry. - Additionally, to get the 'process' marked as finished, ensure - that the CHILD_ACTIVE macro returns false, so before exiting - close char_avail and set it to NULL, and close other handles - to reduce handle leak problems. - -1998-08-09 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * menubar-msw.c (displayable_menu_item): take account of menu - depth when deciding whether to try to display accelerators. - -1998-08-04 Andy Piper <andyp@parallax.co.uk> - - * event-msw.c: use MsgWaitForMultipleObjects if there are no - subprocesses. - - * glyphs-msw.c: fix a couple of potential handle leaks. - -1998-08-04 P. E. Jareth Hein <jareth@camelot.co.jp> - - * dgif_lib.c gif_io.c gifrlib.h: New files to put GIF - *decoding ONLY* back into the core. - * glyphs-eimage.c: Change referenced header file for GIF - reading to point to the incore version. - -1998-07-20 Martin Buchholz <martin@xemacs.org> - - * casefiddle.c (casify_object): - Change algorithm from O(N**2) to O(N). - Code cleanup. - Doc string cleanup. - -1998-07-22 Greg Klanderman <greg@alphatech.com> - - * dired.c (file_name_completion_unwind): don't leak the cons. - -1998-07-20 Greg Klanderman <greg@alphatech.com> - - * dired.c (Fuser_name_completion): new function. - (Fuser_name_all_completions): new function. - (user_name_completion): new function. - (syms_of_dired): 2 new DEFSUBRs. - (vars_of_dired): initialize user name cache vars. - -1998-07-29 P. E. Jareth Hein <jareth@camelot.co.jp> - - * glyphs-eimage.c (png_instantiate): Add proper handling for background - colors taken from the default face. Also correct a thinko in - transparency (not alpha) handling. - -1998-07-23 Martin Buchholz <martin@xemacs.org> - - * s/decosf4-0.h: Use a perfectly ordinary link. Nuke BSD crap. - * unexalpha.c: ANSI C-ize. Clean compiler warnings. - * lread.c (Fload_internal): Be very careful with printfs of - size_t's - * gui-x.c (menu_name_to_accelerator): tolower wants an `int' - argument. - -1998-07-27 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - - * callint.c (Fcall_interactively): GCPRO prompt string before - passing it to Fread_key_sequence - -1998-07-27 SL Baur <steve@altair.xemacs.org> - - * keymap.c (vars_of_keymap): Initialize Vkey_translation_map and - Vvertical_divider_map. - - * mule-canna.c (vars_of_mule_canna): Initialize every symbol to - Qnil or 0, none were initialized prior to this change. - - Rename misnamed `V' prefixed integer variables: - Vcanna_empty_info, Vcanna_through_info, Vcanna_underline, - Vcanna_inhibit_hankakukana, Vcanna_henkan_length, Vcanna_henkan_revPos, - Vcanna_henkan_revLen, Vcanna_ichiran_length, Vcanna_ichiran_revPos, - Vcanna_ichiran_revLen. - - Rename misnamed `V' prefixed integer variables and initialize - properly in the vars_of routine. - Vcanna_mode_AlphaMode, Vcanna_mode_EmptyMode, Vcanna_mode_KigoMode, - Vcanna_mode_YomiMode, Vcanna_mode_JishuMode, Vcanna_mode_TankouhoMode, - Vcanna_mode_IchiranMode, Vcanna_mode_YesNoMode, Vcanna_mode_OnOffMode, - Vcanna_mode_AdjustBunsetsuMode, Vcanna_mode_ChikujiYomiMode, - Vcanna_mode_ChikujiTanMode, Vcanna_mode_HenkanMode, - Vcanna_mode_HenkanNyuryokuMode, Vcanna_mode_ZenHiraHenkanMode, - Vcanna_mode_HanHiraHenkanMode, Vcanna_mode_ZenKataHenkanMode, - Vcanna_mode_HanKataHenkanMode, Vcanna_mode_HanKataHenkanMode, - Vcanna_mode_ZenAlphaHenkanMode, Vcanna_mode_HanAlphaHenkanMode, - Vcanna_mode_ZenHiraKakuteiMode, Vcanna_mode_HanHiraKakuteiMode, - Vcanna_mode_ZenKataKakuteiMode, Vcanna_mode_HanKataKakuteiMode, - Vcanna_mode_ZenAlphaKakuteiMode, Vcanna_mode_HanAlphaKakuteiMode, - Vcanna_mode_HexMode, Vcanna_mode_BushuMode, Vcanna_mode_ExtendMode, - Vcanna_mode_RussianMode, Vcanna_mode_GreekMode, Vcanna_mode_LineMode, - Vcanna_mode_ChangingServerMode, Vcanna_mode_HenkanMethodMode, - Vcanna_mode_DeleteDicMode, Vcanna_mode_TourokuMode, - Vcanna_mode_TourokuEmptyMode, Vcanna_mode_TourokuHinshiMode, - Vcanna_mode_TourokuDicMode, Vcanna_mode_QuotedInsertMode, - Vcanna_mode_BubunMuhenkanMode, Vcanna_mode_MountDicMode, - Vcanna_fn_SelfInsert, Vcanna_fn_FunctionalInsert, - Vcanna_fn_QuotedInsert, Vcanna_fn_JapaneseMode, Vcanna_fn_AlphaMode, - Vcanna_fn_HenkanNyuryokuMode, Vcanna_fn_Forward, Vcanna_fn_Backward, - Vcanna_fn_Next, Vcanna_fn_Prev, Vcanna_fn_BeginningOfLine, - Vcanna_fn_EndOfLine, Vcanna_fn_DeleteNext, Vcanna_fn_DeletePrevious, - Vcanna_fn_KillToEndOfLine, Vcanna_fn_Henkan, Vcanna_fn_Kakutei, - Vcanna_fn_Extend, Vcanna_fn_Shrink, Vcanna_fn_AdjustBunsetsu, - Vcanna_fn_Quit, Vcanna_fn_ConvertAsHex, Vcanna_fn_ConvertAsBushu, - Vcanna_fn_KouhoIchiran, Vcanna_fn_BubunMuhenkan, Vcanna_fn_Zenkaku, - Vcanna_fn_Hankaku, Vcanna_fn_ExtendMode, Vcanna_fn_ToUpper, - Vcanna_fn_Capitalize, Vcanna_fn_ToLower, Vcanna_fn_Hiragana, - Vcanna_fn_Katakana, Vcanna_fn_Romaji, Vcanna_fn_BaseHiragana, - Vcanna_fn_BaseKatakana, Vcanna_fn_BaseEisu, Vcanna_fn_BaseZenkaku, - Vcanna_fn_BaseHankaku, Vcanna_fn_BaseKana, Vcanna_fn_BaseKakutei, - Vcanna_fn_BaseHenkan, Vcanna_fn_BaseHiraKataToggle, - Vcanna_fn_BaseZenHanToggle, Vcanna_fn_BaseKanaEisuToggle, - Vcanna_fn_BaseKakuteiHenkanToggle, Vcanna_fn_BaseRotateForward, - Vcanna_fn_BaseRotateBackward, Vcanna_fn_Touroku, Vcanna_fn_HexMode, - Vcanna_fn_BushuMode, Vcanna_fn_KigouMode, Vcanna_fn_Mark, - Vcanna_fn_TemporalMode, Vcanna_key_Nfer, Vcanna_key_Xfer, - Vcanna_key_Up, Vcanna_key_Left, Vcanna_key_Right, Vcanna_key_Down, - Vcanna_key_Insert, Vcanna_key_Rollup, Vcanna_key_Rolldown, - Vcanna_key_Home, Vcanna_key_Help, Vcanna_key_KP_Key, - Vcanna_key_Shift_Nfer, Vcanna_key_Shift_Xfer, Vcanna_key_Shift_Up, - Vcanna_key_Shift_Left, Vcanna_key_Shift_Right, Vcanna_key_Shift_Down, - Vcanna_key_Cntrl_Nfer, Vcanna_key_Cntrl_Xfer, Vcanna_key_Cntrl_Up, - Vcanna_key_Cntrl_Left, Vcanna_key_Cntrl_Right, Vcanna_key_Cntrl_Down - -1998-07-16 Jan Vroonhof <vroonhof@math.ethz.ch> - - * event-Xt.c (x_to_emacs_keysym): Return nil for modifier keysyms. - (x_event_to_emacs_event): Let x_to_emacs_keysym check for modifier - keys thus no longer considering all keysyms on a key. - -1998-07-19 SL Baur <steve@altair.xemacs.org> - - * XEmacs 21.2-beta1 is released. - -1998-07-12 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * eldap.c (Fldap_search_internal): When converting the list of - attributes to search Copy the final 0 from Lisp strings to C - strings. - Check base, not Vldap_default_base as a a string - -1998-07-13 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * nt.c: Remove Vstdio_str; already defined in console-stream.c. - - * unexnt.c: Unconditionally define bss_start and bss_size, and - ensure that they don't go in the .bss section. - -1998-07-17 Olivier Galibert <galibert@pobox.com> - - * glyphs-x.c (convert_EImage_to_XImage): Fix previous patch (conv - byte order is dependant of the local byte order). - From Takeshi Hagiwara <hagiwara@ie.niigata-u.ac.jp> - -1998-07-18 SL Baur <steve@altair.xemacs.org> - - * glyphs-msw.c (mswindows_resource_normalize): Qresource -> - Qmswindows_resource. - From Jonathan Harris <jhar@tardis.ed.ac.uk> - -1998-07-12 SL Baur <steve@altair.xemacs.org> - - * general.c (syms_of_general): Add defsymbol for Qresource. - - * glyphs-msw.c (vars_of_glyphs_mswindows): Rename Qresource to - Qmswindows_resource. - (TopLevel): Rename 'resource image format to 'mswindows_resource. - (mswindows_resource_validate): Rename. - (mswindows_resource_normalize): Rename. - (mswindows_resource_possible_dest_types): Rename. - (mswindows_resource_instantiate): Rename. - (image_instantiator_format_create_glyphs_mswindows): Replace - `resource' with `mswindows.resource'. - - * XEmacs 21.0-pre5 is released. - -1998-07-10 SL Baur <steve@altair.xemacs.org> - - * mule-wnnfns.c (Fwnn_open): Correctly trap on misdefined Wnn - server type in environment. - Use alloca-ed strings instead of tiny fixed size ones. - -1998-07-09 SL Baur <steve@altair.xemacs.org> - - * XEmacs 21.0-pre4 is released. - -1998-07-01 James N. Potts <jnpotts@plutonium.net> - - * 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 - reportedly cause problems under Win95. - -1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * windowsnt.h: Define DUMP_SEPARATE_SECTION when building with - MSVC >= 5.0. Put emacs init and zero-init data in a special - section of the executable when this is defined. - - * unexnt.c, ntheap.h: - Removed unused find_section() and get_section_size(). - - * unexnt.c: - Fix up the executable's checksum after dumping otherwise the - profiler complains. - When DUMP_SEPARATE_SECTION is defined, don't need to dump - zero-init data separately from init data. Dump emacs data - into a special section of the executable. - When DUMP_SEPARATE_SECTION not defined, dump .bss up to - my_ebss instead of up to the end of bss. - -1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * filelock.c: Removed Vconfigure_lock_directory - already - defined in emacs.c. - - * frame-msw.c: Removed Qinitially_unmapped and Qpopup - already - defined in frame.c and general.c respectively. - - * glyphs-msw.c: Removed Qresource - already defined in - general.c. - -1998-07-05 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * eldap.c (Fldap_search_internal): Docstring fixes - -1998-07-04 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * nt.c (init_environment): Removed unused PRELOAD_WINSOCK, - EMACSDOC and TERM variables. Added EMACSDEBUGPATHS, - EMACSPACKAGEPATH and INFOPATH variables. - Removed unused get_emacs_configuration function. - - * s/windowsnt.h: Don't define EMACS_CONFIGURATION here because - it is now defined at build-time by the makefile. - -1998-07-01 James N. Potts <jnpotts@plutonium.net> - - * 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 - reportedly cause problems under Win95. - -1998-07-05 Andy Piper <andyp@parallax.co.uk> - - * faces.c (complex_vars_of_faces): for the gui-element face don't - fallback to the default face, instead provide reasonable default - fallbacks that were previously hardcoded elsewhere. - -1998-07-06 Olivier Galibert <galibert@pobox.com> - - * glyphs-x.c (convert_EImage_to_XImage): Fix pixel writing problem - when the X server endianness is different than the client's one. - -1998-06-29 Kyle Jones <kyle_jones@wonderworks.com> - - * eval.c (run_hook_with_args_in_buffer): Check - default (non-buffer-local) value of hook for - nil before treating it as a function. Don't initialize - the `globals' variable twice. - -1998-06-24 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * fileio.c: Don't do directory seperator canonicalisation in - substitute-in-file-name because we don't know that the - filename refers to a local file. - -1998-06-24 Adrian Aichner <adrian@xemacs.org> - - * process-nt.c (nt_create_process): Try appending the standard - executable file extensions to the filename if none supplied. - -1998-06-29 SL Baur <steve@altair.xemacs.org> - - * fileio.c (Fsubstitute_in_file_name): Enable double slash notation - for cygwin32. - From Keisuke Mori <ksk@ntts.com> - -1998-06-24 Andy Piper <andyp@parallax.co.uk> - - * toolbar-msw.c (mswindows_output_toolbar): only enable masked - images if we have masks. This handles the xbm case (have masks) - and avoids overuse of resources in the xpm case (generally no masks). - Don't output small toolbars. - -1998-06-29 Kyle Jones <kyle_jones@wonderworks.com> - - * eval.c (run_hook_with_args_in_buffer): Don't treat - the default value of a buffer local hook as a list of - hooks unless it is both a cons and the car of that cons - is not Qlambda. - -1998-06-29 SL Baur <steve@altair.xemacs.org> - - * extents.c: Email address for Ben Wing is ben@xemacs.org. - * process-unix.c: Ditto. - * mule-coding.h: Ditto. - * mule-coding.c: Ditto. - * mule-charset.c: Ditto. - * mule-charset.h: Ditto. - * file-coding.c: Ditto. - * file-coding.h: Ditto. - -1998-06-22 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c: Guard against recursion when freeing - FRAME_MSWINDOWS_TARGET_RECT struture in WM_SIZE processing. - - * frame-msw.c: Don't set WS_VISIBLE attribute on first frame. - Call ShowWindow twice in init_frame_3 to get round runemacs - weirdness. - -1998-06-27 Hrvoje Niksic <hniksic@srce.hr> - - * scrollbar.c (vertical_scrollbar_changed_in_window): Ditto. - - * winslots.h: Rename. - - * window.c (specifier_vars_of_window): Renamed - vertical-divider-draggable-p to vertical-divider-always-visible-p, - as suggested by Ben Wing. - (specifier_vars_of_window): Fix docstrings. - -1998-06-22 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * unexaix.c: Line number information works correctly again. - -1998-06-22 Olivier Galibert <galibert@pobox.com> - - * emacs.c (__sti__iflPNGFile_c___): Added. See comment. Cry. - -1998-06-21 Martin Buchholz <martin@xemacs.org> - - * editfns.c (get_home_directory): ANSIfy. - XEmacs is compilable under C *and* C++. - It's XEmacs, not Xemacs! - -1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * console-msw.h: added a list of fonts to device data. - - * device-msw.c: enumerate list of available fonts in - mswindows_init_device. Free list in mswindows_delete_device. - - * 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. - -1998-06-23 Greg Klanderman <greg@alphatech.com> - - * indent.c (column_at_point): column cache bugfix. - Set last_known_column_point to the buffer position for - which the column was requested, not buffer's point. - - * redisplay.c (decode_mode_spec): for current-column, show - window's point's column, not buffer's point's column. - -1998-06-23 Andy Piper <andyp@parallax.co.uk> - - * menubar-msw.c (mswindows_handle_wm_command): use - enqueue_misc_user event rather than - mswindows_enqueue_msic_user_event to fix customize problems. Add some - checks that X does. - - * console-msw.h: declare mswindows_enqueue_magic_event. - - * event-msw.c (mswindows_enqueue_magic_event): make global. - -1998-06-24 Hrvoje Niksic <hniksic@srce.hr> - - * line-number.c (LINE_NUMBER_FAR): Reverted to 16384. - (buffer_line_number): Use EMACS_INT_MAX instead of random LOTS. - (add_position_to_cache): Use EMACS_INT instead of int. - -1998-06-21 Olivier Galibert <galibert@pobox.com> - - * lisp-disunion.h (XMARKBIT): Have XMARKBIT return something - suitable for an int used as a boolean (btw, C sucks.). - -1998-06-18 Andy Piper <andyp@parallax.co.uk> - - * object-msw.c: remove warnings. - - * device-msw.c: #define wrongly named cygwin structure elements. - - * s/cygwin32.h: define DEMI_BOLD - -1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * redisplay-msw.c: new function mswindows_apply_face_effects. - This is called by output_string and output_cursor to display - underline and strikeout on faces. - -1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * console-msw.h: added a list of fonts to device data. - - * device-msw.c: enumerate list of available fonts in - mswindows_init_device. Free list in mswindows_delete_device. - - * 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. - -1998-06-15 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * objects-msw.c: - Removed compilation warnings from mswindows_string_to_color. - mswindows_list_fonts returns a more general bogus font. - New lisp-visible function mswindows-color-list. - -1998-06-19 David Bush <david.bush@adn.alcatel.com> - - * editfns.c (Fuser_login_name): Modify to user new function - user_login_name. - (user_login_name): C only function to avoid Lisp object overhead - Returns "unknown" instead of nil in Cygwin environment - - * fileio.c (Fexpand_file_name): Treat "~" and "~user" as - equivalent for current user in Cygwin environment. Use new - function user_login_name to get username. - - * lisp.h: Declare user_login_name - -1998-06-18 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * unexaix.c (make_hdr): Fixed bias computations so debugging info - works again. - Some other insignificant nitpicks. - -1998-06-18 Andy Piper <andyp@parallax.co.uk> - - * toolbar-msw.c (mswindows_output_toolbar): specify ILC_MASK when - creating the image list and make sure he bk color is transparent. - -1998-06-18 Jan Vroonhof <vroonhof@math.ethz.ch> - - * event-Xt.c (emacs_Xt_remove_timeout): Also remove timeout from - completed_timeouts. The timer could have expired. - -1998-06-17 Andy Piper <andyp@parallax.co.uk> - - * console-msw.h: move XEMACS_RECT_WH inside frame - 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): - 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 - parameters not just if init is finished - WM_SIZE happens too - early for some specs. (mswindows_size_frame_internal): new - function abstracted from mswindows_set_frame_properties. - (Vmswindows_use_system_frame_size_defaults): - new variable controls whether to allow the system to pick frame - size defaults, defaults to nil. - - * event-msw.c: in WM_SIZE use mswindows_size_frame_internal rather - than duplicated code. - -1998-06-15 Colin Rafferty <colin@xemacs.org> - - * Makefile.in.in: Made EXTW_LINK expand properly. - -1998-06-12 Martin Buchholz <martin@xemacs.org> - - * redisplay.c (vars_of_redisplay): default value of - column-number-start-at-one should be NIL! - -1998-06-11 Martin Buchholz <martin@xemacs.org> - - * casefiddle.c: - (upcase-initials "fooBar") ==> "FooBar" instead of "Foobar" - -1998-06-05 Hrvoje Niksic <hniksic@srce.hr> - - * eldap.c (Fldap_search_internal): Use build_ext_string instead of - build_string to avoid crashes under Mule. - -1998-06-13 Andy Piper <andyp@parallax.co.uk> - - * ntplay.c (play_sound_data_1): don't delete the sound data until - the next sound is played and the previous one finished. - -1998-06-10 Samuel Mikes <smikes@alumni.hmc.edu> - - * fileio.c (directory-sep-char): Escape backslashes. - -1998-06-10 Hrvoje Niksic <hniksic@srce.hr> - - * event-stream.c: Fix docstring reference. - -1998-06-12 Hrvoje Niksic <hniksic@srce.hr> - - * alloc.c (make_float): Remove useless initialization of `next' - field. - (make_pure_float): Ditto. - - * lisp.h (struct Lisp_Float): Rename `next' to `__unused__next'. - -1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> - - * fileio.c (Fmake_directory_internal): Remove conditionals - on WINDOWSNT when calling mkdir. - - * ntproc.c: Deleted the following unused functions: - register_child, reap_subprocess, sys_wait. - - * nt.c (sys_rename): Ifzeroed this implementation. - Deleted the following unused functions: - sys_access, sys_chdir, sys_chmod, sys_creat, sys_link, sys_mkdir, - sys_mktemp, sys_rmdir, sys_unlink, sys_close, sys_dup, sys_dup2, - sys_read, sys_write. - Merger sys_fopen and sys_open with sysdep.c implementation. - - * sysdep.c: Removed MS-DOS code. - (sys_rename): Deal with Microsoft rename weirdness. - (sys_open): Implemented for Windows. - (sys_fopen): Ditto. - (sys_mkdir): Ditto. - -1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> - - * buffer.c (complex_vars_of_buffer): Removed %t description from - the docstring. - -1998-06-04 Rick Rankin <Rick_Rankin-P15254@email.mot.com> - - * scrollbar-msw.c: initialize the cbSize element of the - SCROLLINFO struct before calling SetScrollInfo. WinNT seems - to ignore the value of cbSize, but Win95 (and I presume Win98) - appear to want it set to sizeof(SCROLLINFO). - -1998-06-04 Kirill M. Katsnelson <kkm@kis.ru> - - * event-stream.c: Defined Qcancel_mode_internal. - (syms_of_event_stream): defsymbol'ed it. - - * events.h: Externed it. - - * event-msw.c (mswindows_wnd_proc, WM_CANCELMODE): Added this handler. - -1998-06-04 Oliver Graf <ograf@fga.de> - - * frame-x.c (x_cde_destroy_callback): free the data - (cde-start-drag-internal) corrected root position, 21.1 needs this - hardcoded in Button events - (offix-start-drag-internal) corrected root position - -1998-06-03 Kirill M. Katsnelson <kkm@kis.ru> - - * process-nt.c (signal_cannot_launch): Use signal_simple_error() - instead of error(). - -1998-06-03 Kirill M. Katsnelson <kkm@kis.ru> - - * dialog-msw.c (button_width): Removed `inline' from the function - declaration. - -1998-06-03 Rick Rankin <Rick_Rankin-P15254@email.mot.com> - - * frame-msw.c: add WS_VISIBLE flag to the first frame created. - Note that adding this flag to subsequent frames causes problems. - -1998-06-03 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - - * glyphs-eimage.c (png_instantiate) move 'struct - png_memory_storage tbr' out of nested block to avoid dangling - reference - -1998-06-02 Andy Piper <andyp@parallax.co.uk> - - * faces.h: - * faces.c: rename 3d-object -> gui-element. add toolbar face which - inherits from gui-element. - - * glyphs-msw.c: use DIBitmaps for xbm bitmaps to be consistent - with existing code, generate masks correctly. - -1998-06-03 P. E. Jareth Hein <jareth@camelot-soft.com> - - * glyphs-eimage.c: Changed included header for gifs to use - Gifreader instead of giflib. - - * glyphs-x.c: removed the image-related functions that were - moved into glyphs-eimage. - -1998-06-02 David Bush <david.bush@adnb.alcatel.com> - - * glyphs.c (bitmap_to_lisp_data) Define XFree to be free - if built without X Windows support. - -1998-06-02 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (Fconcat): Synch docstring with new reality. - -1998-06-03 SL Baur <steve@altair.xemacs.org> - - * frame.c: Remove reference to msdos.h (which is going away). - Suggested by Hrvoje Niksic and Kirill Katsnelson. - -1998-06-02 P. E. Jareth Hein <jareth@camelot-soft.com> - - * glyphs-eimage.c (jpeg_instantiate): Fix handling of - grayscale images/ - - -1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - - * events.h: Fixed commentary about misc-user scrollbar events. - - * scrollbar-x.c (x_update_vertical_scrollbar_callback): Use frame - object as an event channel, instead of window object. - (x_update_horizontal_scrollbar_callback): Ditto. - -1998-05-29 Andy Piper <andyp@parallax.co.uk> - - * ntplay.c (play_sound_data_1) new function. convert alloca data - to malloc if necessary. - (play_sound_file): if the file is not in our path then convert to - data and play. - -1998-06-01 SL Baur <steve@altair.xemacs.org> - - * mule-mcpath.c (mc_chdir): Reverse parameters in call to memcpy. - * msdos.c (Frecent_doskeys): Ditto. - - * unexalpha.c (unexec): Reverse parameters in call to memcpy. - Suggested by Reggie Perry <perry@zso.dec.com> - - * buffer.h: Eliminate size in declaration. - -1998-06-01 Olivier Galibert <galibert@pobox.com> - - * unexelfsgi.c (unexec): Cleanup n/nn and remove useless kludge. - -1998-06-01 Kirill M. Katsnelson <kkm@kis.ru> - - * gui.c (gui_item_init): Changed the default value for config member - from Qunbound to Qnil. - -1998-06-01 Greg Klanderman <greg@alphatech.com> - - * indent.c (vmotion_pixels): Don't #define abs(). - -1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - - * s/windowsnt.h: Defined popen and pclose to be _popen and _pclose - respectively. - -1998-05-30 Andy Piper <andyp@parallax.co.uk> - - * glyphs.h: add xbm declarations. - - * console.h: add xbm_instantiate_method device method. - - * glyphs.c (check_valid_xbm_inline) (xbm_validate) - (bitmap_to_lisp_data) (xbm_mask_file_munging) (xbm_normalize) - (xbm_possible_dest_types): moved here from glyphs-x.c. use - locate_pixmap_file device method and read_bitmap_data_from_file - instead of XmuReadBitmapDataFromFile. - (xbm_instatntiate): make a device method. - - * glyphs-x.c: see glyphs.c changes. (read_bitmap_data_from_file) - new function that just calls XmuReadBitmapDataFromFile. - (x_xbm_instatntiate): device method from xbm_instantiate. - - * glyphs-msw.c (read_bitmap_data) (NextInt) - (read_bitmap_data_from_file): new functions copied from Xmu - sources. - (xbm_create_bitmap_from_data) from Ben <ben@666.com> convert - inline data to an mswindows bitmap. - (init_image_instance_from_xbm_inline) (xbm_instantiate_1) - (mswindows_xbm_instantiate): mswindows-ized versions of the X - functions. - -1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - - * window.c (specifier_vars_of_window): Renamed `has_modeline-p' to - `modeline-visible-p'. - Declared specifier lisp variables at the beginning oh the file - as static. - - * procimpl.h (struct process_methods): Changed semantics of - create_process method so it accepts lisp strings instead of - char pointers. - - * process.c (Fstart_process_internal): Moved building of - unix style argv from here to process-unix.c, ... - - * process-unix.c (unix_create_process): ... right here. - - * process-nt.c (nt_create_process): Changed this function to - support new semantics, so avoided a GC problem. - - * events.c (Fmake_event): Document misc-user events properties. - (Fmake_event): Do not allow arbitrary objects for channel property - of misc-user events. - (Fmake_event): Change misc-user event validation: it is function - which is required, not button. - - * event-msw.c (mswindows_user_event_p): Recognize misc user events as - user events. - (mswindows_enqueue_misc_user_event): Added function. - (mswindows_bump_queue): Removed function. - (mswindows_enqueue_magic_event): Support NULL HWND parameter. - (mswindows_wnd_proc, WM_CLOSE): Use mswindows_enqueue_misc_user_event(). - (mswindows_wnd_proc, WM_EXITSIZEMOVE): Ditto. - (emacs_mswindows_handle_magic_event): Handle XM_BUMPQUEUE, by doing - really nothing, which is my personal favorite thing. - - * console-msw.h: Removed prototype for mswindows_bump_queue(). - Added prototype for mswindows_enqueue_misc_user_event(). - - * menubar-msw.c (mswindows_handle_wm_command): Use - mswindows_enqueue_misc_user_event(). - - * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. - - * dialog-msw.c (dialog_proc): Ditto. - - * scrollbar-msw.c (mswindows_handle_scrollbar_event): Ditto. - (mswindows_handle_scrollbar_event): Use frame, not window, for misc - user events channel. - -1998-05-29 Greg Klanderman <greg@alphatech.com> - - * window.c (Fwindow_displayed_text_pixel_height): was relying on - incorrect semantics of vmotion_pixels which has been fixed. don't - use it anymore as it can't easily be used. - - * indent.c (vmotion_pixels): fix off by one bug moving up. also - the motion was reported incorrectly if you tried to go past end of - buffer. - -1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - - * toolbar.h: Removed misleading commentary, as Martin suggested. - -1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - - * lisp.h: Extern Qactivate_menubar_hook. - - * menubar-msw.c (unsafe_handle_wm_initmenu_1): Pass correct value to - run_hook (). - -1998-05-29 Andy Piper <andyp@parallax.co.uk> - - * glyphs-msw.c: use BPLINE macro. - - * select-msw.c (mswindows-selection-exists-p) - (mswindows-delete-selection): doc string fixes. - - * toolbar-msw.c (mswindows_output_toolbar): make disabled buttons - unpressable. warning elimination. - -1998-05-28 Martin Buchholz <martin@xemacs.org> - - * alloc.c (dbg_constants): - * dbxrc: - * gdbinit: - Remove toolbar_data debugging code, since that lrecord has - also been removed. - -Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> - - * alloc.c: zap cached value of (user-home-directory), so that - it's not undumped. - - * buffer.c: From init_buffer(), separated out code that - determined the initial directory for the *scratch* buffer, and - put them into a function called "init_initial_directory()". - The initial directory is now available as a global "char *" - called initial_directory. - - * buffer.h: Added extern entries for initial_directory[] and - init_initial_directory(). - - * editfns.c: added new elisp function "user-home-directory", - which basically returns getenv("HOME"), but attempts to use - other values if $HOME isn't set.This may have to be tweaked in - the future as, under Unix, "/" is used if $HOME isn't set (this - probably should be set to the current directory). To support - this, a new C function, "get_home_directory()", now exists, - which returns the "home directory", as a "char *" string. - - * emacs.c: Rearrange NT initialization order so that - environment/registry variables will be properly entered into - Vprocess_environment. - - * fileio.c: replaced egetenv("HOME") with calls to the new - get_home_directory(). - - * lisp.h: Added function prototypes for uncache_home_directory() - and get_home_directory(), along with lisp prototypes for - Fuser_home_directory() and friends. - - * nt.c: replaced getenv("HOME") with calls to the new - get_home_directory(). - - * sysfile.h: for WINDOWSNT, #include <direct.h>, to suppress - warnings about getcwd(), etc. not having prototypes. - -1998-05-28 Kirill M. Katsnelson <kkm@kis.ru> - - * process-nt.c (send_signal): Emulate SIGHUP. - (validate_signal_number): Ditto. - - * event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Unconditionally - remove MOD_SHIFT from ASCII characters. - (mswindows_wnd_proc, WM_KEYDOWN): Do not activate the menubar when - F10 is pressed. - -1998-05-24 Oliver Graf <ograf@fga.de> - - * frame-x.c (cde-start-drag-internal): added filename and multi- - data transfers - (x_cde_convert_callback) dito - -1998-05-26 Oliver Graf <ograf@fga.de> - - * frame-x.c: include event-mod.h also with CDE - (x_cde_convert_callback) made the thing working - (cde-start-drag-internal) also debugging - -1998-05-25 Hans Guenter Weigand <hgweigand@wiesbaden.netsurf.de> - - * m/sparc.h: - * getloadavg.c: - * malloc.c: - * unexec.c: - * mem-limits.h: - - add __OpenBSD__ where __NetBSD__ was found. - - TODO: replace platform-specific conditional compilation by - feature tests in configure.in. - -1998-05-15 Greg Klanderman <greg@alphatech.com> - - * window.c (Fwindow_displayed_text_pixel_height): New function. - (syms_of_window): DEFSUBR it. - - * indent.c (Fvertical_motion_pixels): New function - request - movement in pixels. - (vmotion_pixels): helper. - (syms_of_indent): DEFSUBR. - * lisp.h: declaration for vmotion_pixels(). - - * indent.c (Fvertical_motion): Add optional third argument PIXELS, - to request returning motion in pixels. - (Fvertical_motion_pixels): Remove, functionality merged into - Fvertical_motion. - * window.c (window_scroll): call Fvertical_motion with 3 arguments. - (Fmove_to_window_line): ditto. - * lisp.h: Change declaration for Fvertical_motion. - - * window.c: rename window-text-pixel-{height,width,edges} to - window-text-area-pixel-*. - -1998-05-26 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - - * tooltalk.c (vars_of_tooltalk) added staticpro for - Tooltalk_Message_plist_str and Tooltalk_Pattern_plist_str - -1998-05-27 Andy Piper <andyp@parallax.co.uk> - - * faces.c: create a new 3d_object_face, make modeline and - vertical_divider faces fallback to this rather than the default. - -1998-05-21 Andy Piper <andyp@parallax.co.uk> - - * s/cygwin32.h: define charsets for cygwin. - -1998-05-25 Andy Piper <andyp@parallax.co.uk> - - * toolbar-msw.c (mswindows_output_toolbar): fix up button sizes - and coordinates. resize bitmaps if we have already settled on a - different size. - - * glyphs-msw.c (xpm_to_eimage): add ';' for mswindows compiler. - -1998-05-25 Hrvoje Niksic <hniksic@srce.hr> - - * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. - - * menubar-msw.c (mswindows_handle_wm_command): Ditto. - - * gui.h: Ditto. - - * gui-x.c (popup_selection_callback): Ditto. - - * dialog-msw.c (dialog_proc): get_callback -> get_gui_callback. - - * gui.c (get_callback): Renamed to get_gui_callback. - -1998-05-17 Martin Buchholz <martin@xemacs.org> - - * glyphs.h: order rearrangement. - - * device-tty.c (tty_asynch_device_change): Warning suppression. - * device-x.c (x_device_system_metrics): Warning suppression. - Make Doc strings consistent with coding standards. - -1998-05-24 Martin Buchholz <martin@xemacs.org> - - * general.c: multiple definition of `Qicon'. general.c seems - like a good home for Qicon. - -1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> - - * This patch is to fix compilation warnings under Windows. - - * s/windowsnt.h: Encapsulate getpid with sys_getpid. - Added prototypes for FSF inherited functions, with which XEmacs is - sprinkled thoroughly. - Removed some #if 0 code. Bracketed some more definitions, probably - related to Visual C versions prior to 4 (we do not support them). - - * sysfloat.h (logb): Finally, get logb() prototyped. - - * sysfile.h: Added Windows specific includes. - Removed old Windows specific code bracketed with #if 0. - - * sysdep.h: Added prototype for xrealpath(). - - * sysdep.c (sys_getpid): Added function, to support '95 negative pids. - - * symsinit.h: Added prototypes for syms_of_dired_mswindows, - vars_of_dired_mswindows and init_ntproc (Grrr). - - * realpath.c: Added Windows specific include files. - (xrealpath): Conditionalized declaration of some auto variables on - S_IFLNK, to avoid warnings. - - * ntproc.c: Disabled some compiler warnings. This file is going to - die, so I have not cleaned it up much. - (set_process_dir): Const parameter. - (Fwin32_short_file_name): Down CHECK_* macros to one argument. - (Fwin32_long_file_name): Ditto. - (Fwin32_set_process_priority): Ditto. Why didn't I remove these - three functions? - - * nt.h: Added prototypes for set_process_dir and convert_time. - - * nt.c: More include files. - (getpwnam): Consted char* argument. - (get_emacs_configuration): Const return value. - (opendir): Const argument. - (stat): Casted converstion long->short. - (stat): Removed ad hoc and questionable support for non-MSC compile. - (sys_pipe): Removed unused auto variable. - (_sys_read_ahead): Removed calls to DebPrint. - (sys_read): Ditto, in 2 places. - (term_ntproc): Added unused int parameter to signal handler, to - avoid a warning when compiling a call to signal(). - (msw_sigset): Properly return old signandler or NULL instead of void. - - * floatfns.c (Flogb): Casted arguments to unary minus to signed. - - * gmalloc.c (morecore): Ditto. - (_free_internal): Ditto. - - * lread.c (parse_integer): Ditto. - - * dired-msw.c: Added several include files. - - * cmdloop.c (Fcommand_loop_1): Added Microsoft C to the Big List - of Compilers to Shut Up. - - * callproc.c: Added #includes to suppress warnings under Windows. - (init_callproc): Removed #if0'ed code and unused variables. - -1998-05-25 Andy Piper <andyp@parallax.co.uk> - - * device-msw.c (mswindows_device_system_metrics): do planes in a - way consistent with X. - - * glyphs-msw.c (mswindows_initialize_image_instance_mask): don't - use SetPixel, use DIBits functions. - (xpm_to_eimage): frob colors more closely like xpm deos. - - * toolbar-msw.c: only resize bitmaps when shrinking. Adjust look - to be closer to X version. - - * event-msw.c: use tooltip string directly. - - * redisplay-msw.c: reinstate Kirill's bg pixmap change. - - * objects-msw.c: frob rgb colors that only Kyle uses. - - * dialog-msw.c (button_width): INLINE -> inline. - -1998-05-23 SL Baur <steve@altair.xemacs.org> - - * getloadavg.c (getloadavg): Fix typo. - -1998-05-23 Kirill M. Katsnelson <kkm@kis.ru> - - * objects-msw.c (mswindows_initialize_font_instance): Added support - for font character sets. - Replaced 'XXX' with '####' in comments throughout the file. - -1998-05-23 Kirill M. Katsnelson <kkm@kis.ru> - - * emacs.c (main_1): Added calls to vars_of_dialog_mswindows() and - console_type_create_dialog_mswindows(), to initialize Windows dialog - support. - - * symsinit.h: Prototyped the above functions. - - * dialog-x.c (x_popup_dialog_box): Moved dialog descriptor consistency - checks to dialog.c... - - * dialog.c (Fpopup_dialog_box): ...right here. Added more checks: a - device must support dialog boxes, and the descriptor must supply at - least one button. - - * dialog-msw.c: New file, dialogs for Windows. - -1998-05-21 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - - * eldap.c (ldap_search_unwind): Return Qnil instead of nothing - (Fldap_search_internal): Removed unused variable `err' - - * eldap.h: Moved Lisp_LDAP declaration here instead of using a - forward declaration - -1998-05-17 Martin Buchholz <martin@xemacs.org> - - * eldap.h: eldap.[ch] should never be used unless HAVE_LDAP is - defined. Therefore there is no need to handle the case when - HAVE_LDAP is undefined. Similarily, there is no reason to have - any code wrapped within `#ifdef emacs', since this code is only - useful within an emacs. This simplifies the code significantly. - - * inline.c: Include eldap.h only if HAVE_LDAP. - * inline.c: Don't bother including TT_C_H_PATH, since tooltalk.h - already does that. - -1998-05-21 Kirill M. Katsnelson <kkm@kis.ru> - - * unexnt.c (copy_executable_and_dump_data_section): Suppress - printing dump stats when building without DEBUG_XEMACS. - (dump_bss_and_heap): Ditto. - -1998-05-21 Andy Piper <andyp@parallax.co.uk> - - * gnuclient.c: don't suppress window system if there is no display - and we are running under mswindows. send 'mswindows device type if - we are in this situation. - -1998-05-20 Andy Piper <andyp@parallax.co.uk> - - * general.c: - * lisp.h: Qbitmap, Qcursor, Qicon moved here from glyphs-msw.c. - - * glyphs-msw.c: change cursor imgae type name to resource. Fix - some nits. - -1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> - - * EmacsFrame.c (Xt_StringToScrollBarPlacement): Added support for - {top,bottom}-{left,right} values in addition to - {top,bottom}_{left,right}. - -1998-05-18 Hrvoje Niksic <hniksic@srce.hr> - - * fileio.c (Fmake_temp_name): Remove unreached code. - - * process-nt.c (validate_signal_number): Use - signal_simple_error(). - -1998-05-19 Martin Buchholz <martin@xemacs.org> - - * unexhp9k800.c: - * sound.c (vars_of_sound): - * sysdep.c (reset_sigio_on_device): - * window.c (window_bottom_gutter_height): - unexhp9k800.c:258: warning: implicit declaration of function - `calculate_checksum' - sound.c:604: warning: implicit declaration of function `vars_of_hpplay' - sysdep.c:1012: warning: unused variable `owner' - window.c:993: warning: `window_right_toolbar_width' defined but not used - -1998-05-19 Andy Piper <andyp@parallax.co.uk> - - * glyphs-msw.c (mswindows_create_resized_mask) - (mswindows_create_resized_bitmap): new funnctions split out from - mswindows_resize_dibitmap_instance. - - * glyphs-msw.h: declare new resize functions. - - * toolbar-msw.c (mswindows_output_toolbar): use new bitmap resize - functions so that the original bitmaps are preserved. - - * sheap.c: fixup static heap exhausted error to avoid FAQs. - - * redisplay-msw.c (mswindows_output_blank): fixup brush from bg - color if we are trying to output 0 depth bg pixmap. - - * scrollbar-msw.c: warning elimination. - -1998-05-18 Martin Buchholz <martin@xemacs.org> - - * frame-x.c (x_update_frame_external_traits): Start preprocessor - directives in column 1. - - * search.c (skip_chars): Avoid using xzero with arrays, since some - compilers get confused by the construct &array. - -1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - - * objects-msw.h: - * objects-msw.c: Changed the charset value for a new font from - "don't care" to "ansi". - - * glyphs-msw.c (convert_EImage_to_DIBitmap): Warnings fix. - -1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - - * event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Do not clear shift - modifier on control chars. - Use IsCharAlpha() instead of isaplha(). - -1998-05-19 Kazuyuki IENAGA <ienaga@jsys.co.jp> - - * s/freebsd.h: FreeBSD 2.2.6 now supports setlocale(LC_ALL, ""). - -1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - - * objects-msw.c (mswindows_initialize_font_instance): Use ANSI - charset when creating font. - (mswindows_initialize_color_instance): Do not create brush along - with a color. - (mswindows_finalize_color_instance): Do not delete it then. - - * objects-msw.h (struct mswindows_color_instance_data): Removed - brush slot, and corresponding accessor macro. - -1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - - * toolbar.c: Removed toolbar_data lrecord implementation. - (mark_frame_toolbar_buttons_dirty): Replase usage of toolbar_data - with toolbar_buttons (via FRAME_TOOLBAR_BUTTONS). - (compute_frame_toolbar_buttons): Ditto. - (CHECK_TOOLBAR): Ditto. - (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 - marked changed in set_frame_selected_window() in frame.c - Added check for changed toolbars geometry. - (compute_frame_toolbars_data): Removed unused second parameter; - Adjusted callers of this static function throughout the file. - (init_frame_toolbars): Initialize current_toolbar_size. - (update_frame_toolbars): Use DEVICE_SUPPORTS_TOOLBARS_P instead of - what is its current expansion, for clarity. - (init_frame_toolbars): Ditto. - (init_device_toolbars): Ditto. - (init_global_toolbars): Ditto. - - * toolbar.h: Removed definition of toolbar_data lrecord. - Added accessor macros FRAME_TOOLBAR_BUTTONS and - FRAME_CURRENT_TOOLBAR_SIZE. - Added macro DEVICE_SUPPORTS_TOOLBARS_P. - - * toolbar-x.c (x_output_toolbar): The same change as in - toolbar-msw.c - (x_output_toolbar): Ditto. - (x_redraw_exposed_toolbar): Ditto. - - * toolbar-msw.c (mswindows_output_toolbar): Retrieve current - buttons from toolbar_buttons using FRAME_TOOLBAR_BUTTONS macro. - (mswindows_output_toolbar): Ditto. - (mswindows_output_toolbar): Ditto. - - * frame.c (mark_frame): Removed marking of arrays, according to - frameslots.h change. - (nuke_all_frame_slots): Ditto. - (set_frame_selected_window): Mark toolbars changed when - last_nonminibuf_window changes. - - * frame.h (struct frame): Moved some slots to frameslots.h. - Added current_toolbar_size array. - Changed references from toolbar_data to toolbar_buttons in macros - FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE, - FRAME_RAW_THEORETICAL_TOOLBAR_SIZE and - FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH. - - * frameslots.h: Added macro MARKED_SLOT_ARRAY a la winslots.h - Moved arrays of lisp objects here from frame.h: toolbar_size, - toolbar_visible_p, toolbar_border_width. - Removed toolbar_data slot and added toolbar_buttons. - -1998-05-17 Kirill M. Katsnelson <kkm@kis.ru> - - * symsinit.h: Externed syms_of_process_nt() - - * emacs.c (main_1): Call syms_of_process_nt() - - * process-nt.c: Quote process arguments by a call to Lisp function - `nt-quote-process-args'. - (syms_of_process_nt): New function. - (nt_send_process): Flush data stream after each write, to avoid - leaving buffered data. - (nt_send_process): When blocked on process output, wait for - process to slurp more for progressively increasing time intervals. - -1998-05-17 Martin Buchholz <martin@xemacs.org> - - * window.c (have_undivided_common_edge): Make file-local function - static. - (map_windows): Return 0 if all map functions successful. - Fix typos. - - * winslots.h: Use unlikely names for local variables in macros to - avoid shadowing warnings. - -1998-05-17 Andy Piper <andyp@parallax.co.uk> - - * toolbar-msw.c (mswindows_output_toolbar): hash on toolbar width - so that we re-output if the toolbar size has changed. - -1998-05-17 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * s/aix4-2.h (ALIGN_DATA_RELOC): Undefined to support new unexaix.c. - - * s/aix3-1.h (ALIGN_DATA_RELOC): Defined to support new unexaix.c. - - * unexaix.c: Massive cleanup and support of AIX 4.2 (and hopefully - greater). - -1998-05-16 Kirill M. Katsnelson <kkm@kis.ru> - - * glyphs-msw.c: Defined OEMRESOURCE before including windows.h to - get bitmap manifest constants defined. - - * console-msw.h: Include system files in angle brackets, not in - quotes. - - * window.c (specifier_vars_of_window): Fixed a typo in - `vertical-divider-line-width' docstirng. - -1998-05-16 Olivier Galibert <galibert@pobox.com> - - * line-number.c (delete_invalidate_line_number_cache): Use an - EMACS_INT. - (buffer_line_number): Remove dangerous, plain wrong when using - 64bits emacs ints, cast. - - * insdel.c (buffer_delete_range): Use an EMACS_INT. - - * cmds.c (Fforward_line): Use EMACS_INTs. - - * search.c (bi_scan_buffer): Change to use EMACS_INTs. - (scan_buffer): Ditto. - (bi_find_next_newline_no_quit): Remove useless cast. - (find_next_newline_no_quit): Ditto. - (find_next_newline): Ditto. - (find_before_next_newline): Use an EMACS_INT. - - * lisp.h: Change scan_buffer to pass EMACS_INTs. - -1998-05-16 Hrvoje Niksic <hniksic@srce.hr> - - * menubar-msw.c (mswindows_handle_wm_command): Ditto. - - * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. - - * gui-x.c (popup_selection_callback): Use it. - - * gui.h (get_callback): Declare it. - - * gui.c (get_callback): New function. - -1998-05-15 SL Baur <steve@altair.xemacs.org> - - * window.c (have_undivided_common_edge): Guard scrollbar specific - stuff. - (window_needs_vertical_divider_1): Ditto. - -1998-05-16 Hrvoje Niksic <hniksic@srce.hr> - - * emacs.c (decode_path): Eliminate compiler warning. - (Fdecode_path): Renamed to Fsplit_path. - (Fsplit_string_by_char): New function. - -1998-05-14 Damon Lipparelli <lipp@primus.com> - - * winslots.h: close comment - -1998-05-16 Kirill M. Katsnelson <kkm@kis.ru> - - * callproc.c: Removed declared and unused variable Qbuffer_file_type. - - * bufslots.h: Removed buffer_file_type slot. - - * buffer.c (complex_vars_of_buffer): Removed buffer_file_type from - buffer local flags. - (complex_vars_of_buffer): Removed buffer-file-type variable and - its default reference. - -1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - - * faces.c (complex_vars_of_faces): Defined - Vvertical_divider_face. - (vars_of_faces): Staticpro it. - - * faces.h: Externed Vvertical_divider_face. - - * redisplay-x.c (x_output_vertical_divider): Use - Vvertical_divider_face to draw the divider instead of modeline - face. - - * redisplay-msw.c (mswindows_output_vertical_divider): Draw - divider face using Vvertical_divider_face background. - Fix drawing spacing gaps around the divider. - -1998-05-14 Didier Verna <didier@xemacs.org> - - * redisplay-x.c (x_output_vertical_divider): removed hard-wired - values for the vertical divider line width and spacing. Use the - cached values from the window structure instead. - (x_divider_width): ditto. - - * window.c (specifier_vars_of_window): new specifiers: - vertical-divier -line-width and -spacing. - (vertical_divider_global_width_changed): formerly known as - vertical_divider_shadow_thickness_changed. - - * winslots.h: new slots: vertical_specifier _line_width and - _spacing. Plus corrected a comment typo. - -1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - - * window.h: Declared window_divider_width(). - - * console-stream.c (stream_divider_width): Removed method. - (console_type_create_stream): And declaration for it. - - * redisplay.c (pixel_to_glyph_translation): Use - window_divider_width() instead of divider_width redisplay method. - (pixel_to_glyph_translation): Fix top divider edge calculation - when scrollbar is on top. - - * window.c (window_divider_width): New function, an outphaser for - divider_width redisplay method. - (window_right_gutter_width): Use it. - (specifier_vars_of_window): For vertical-divider-{spacing,line-width} - specifiers, set fallback values differently on TTYs, and document - the behavior of these on TTYs in the docstrings. - - * scrollbar.c (update_scrollbar_instance): Use - window_divider_width() instead of divider_width redisplay method. - - * console.h (struct console_methods): Removed divider_width_method. - - * redisplay-tty.c (tty_divider_width): Removed device method. - (console_type_create_redisplay_tty): Removed definition for it. - (tty_output_vertical_divider): Respect the value returned by - window_divider_width thus divider line width specification. - - * redisplay-msw.c (mswindows_divider_width): Removed device method. - (console_type_create_redisplay_mswindows): Removed definition for it. - (mswinodws_output_vertical_divider): Respect the value returned by - window_divider_width thus divider line width specification. - -1998-05-15 Andy Piper <andyp@parallax.co.uk> - - * toolbar-msw.c: guess toolbar frame size a bit more accurately. - -1998-05-15 Andy Piper <andyp@parallax.co.uk> - - * glyphs-msw.c: resource loading implementation. - (cursor_normalize): new function. - (cursor_validate): ditto. - (cursor_instantiate): ditto. - (cursor_name_to_resource): ditto. - (cursor_possible_dest_types): ditto. - (check_valid_symbol): ditto. - (check_valid_string_or_int): ditto. - -1998-05-14 Martin Buchholz <martin@xemacs.org> - - * sysdep.c (tty_init_sys_modes_on_device): Treat VSUSP just like - VINTR and VQUIT. - - * process-unix.c (process_signal_char): Use VSUSP instead of - non-standard VSWTCH. Always prefer VSUSP to VSWTCH. - -1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - - * specifier.c (specifier_instance): Change locale precedence of - instantiation so window locale has higher priority than buffer - locale. - (Fspecifier_instance): Reflect this in docstring. - (Fadd_spec_list_to_specifier): Ditto. - (Fadd_spec_to_specifier): Ditto. - (Fremove_specifier): Ditto. - -1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - - ** Dialog separation into a device method from Andy Piper - - * emacs.c (main_1): Call console_type_create_dialog_x(). - - * dialog-x.c (x_popup_dialog_box): Old Fpopup_dialog_box converted - into this device method. - (console_type_create_dialog_x): New function. - - * dialog.c (Fpopup_dialog_box): New function. - (syms_of_dialog): Defsubr it. - - * console.h (struct console_methods): Declared - popup_dialog_box_method(). - - * symsinit.h: Defined console_type_create_dialog_{x,mswindows} - -1998-05-14 Oliver Graf <ograf@fga.de> - - * dragdrop.c (vars_of_dragdrop): dragdrop-protocols created - * frame-x.c (x_cde_transfer_callback): checked for merge errors - -1998-05-13 Oliver Graf <ograf@fga.de> - - * dragdrop.c (vars_of_dragdrop): provide dragdrop-api - -1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - - * console.h (device_metrics): Removed dbcs, input-method-editor - and right-to-left metrics. - - * device.c (Fdevice_system_metric): Ditto. - (Fdevice_system_metrics): Ditto. - (syms_of_device): Ditto. - (Fdevice_system_metric): Swapped DEVICE and METRIC parameters back - again. - -1998-05-14 Hrvoje Niksic <hniksic@srce.hr> - - * line-number.h (mark_line_number_cache): Remove unused - declaration. - - * line-number.c (LINE_NUMBER_FAR): Increase to 32768. - (get_nearest_line_number): Simplify. - (add_position_to_cache): Make the old marker point nowhere. - -1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - - ** Renamed window-divider-map => vertical-divider-map - and event-over-divider-p => event-over-vertical-divider-p, - in the following files/functions: - * events.h: - * events.c (Fevent_over_divider_p): - * keymap.c (get_relevant_keymaps): - (vars_of_keymap): - - * redisplay.h (OVER_V_DIVIDER): Renamed so from OVER_DIVIDER. - - * redisplay.c (pixel_to_glyph_translation): Use OVER_V_DIVIDER. - -1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - - * window.c (vertical_divider_changed_in_window): Renamed so. - (specifier_vars_of_window): Defined Vvertical_divider_draggable_p. - (window_needs_vertical_divider_1): Decide whether we need it based - on the value of the above specifier. If separators are unwanted, - put them only if there's no scrollbar between this window and its - right neighbor. - (have_undivided_common_edge): New function, helper for the above. - (window_needs_vertical_divider): Return either a cached value, - or clauclate and cache one. - (invalidate_vertical_divider_cache_in_window): Implemented. - (map_windows): Changed return type to int, return the value from - MAPFUN. - - * window.h: Prototype invalidate_vertical_divider_cache_in_window. - (struct window): Added need_vertical_divider_p and - need_vertical_divider_valid_p. - - * winslots.h: Added vertical_divider_draggable_p slot. - - * scrollbar.c (vertical_scrollbar_changed_in_window): Implemented. - (specifier_vars_of_scrollbar): Used it in all vertical specifiers. - - * frame.c (invalidate_vertical_divider_cache_in_frame): New function. - - * frame.h (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): Call - invalidate_vertical_divider_cache_in_frame(). - Prototype it. - -1998-05-14 Andy Piper <andyp@parallax.co.uk> - - * toolbar-msw.c: provide correct parameters to TB_SETROWS. - - * glyphs-msw.c (mswindows_initialize_image_instance_mask): size - masks correctly and don't select 0. - -1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - - * winslots.h: New file, declaration of some struct window and - struct saved_window members. - - * window.h (struct window): Include it, with required preprocessor - magic. - - * window.c (mark_window): Ditto. - (allocate_window): Ditto. - (struct saved_window): Ditto. - (mark_window_config): Ditto. - (saved_window_equal): Ditto. - (Fset_window_configuration): Ditto. - -1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - - * redisplay-msw.c (mswindows_output_vertical_divider): Syntax fix. - -1998-05-12 Didier Verna <didier@xemacs.org> - - * 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 <didier@xemacs.org> - - * console.h (struct console_methods): the divider_width console - method now requires a struct window * argument. - - * redisplay-x.c (x_divider_width): ditto. Plus remove - X_DIVIDER_WIDTH, X_DIVIDER_SHADOW_THICKNESS. - (x_output_vertical_divider): give a depressed look when the shadow - thickness is negative. - - * console-stream.c (stream_divider_width): pass a struct window * - argument. - - * redisplay-tty.c (tty_divider_width): ditto. - - * window.c (window_right_gutter_width): totdi. - - * redisplay.c (generate_modeline): ittod. - - * scrollbar.c (update_scrollbar_instance): ttido. - - * redisplay-msw.c (mswindows_divider_width): ottid. - WARNING: this enables to compile, but the feature is not functional. - - * window.h (struct window): new field - vertical_divider_shadow_thickness. - - * window.c (specifier_vars_of_window): new specifier - vertical-divider-shadow-thickness. - (vertical_divider_shadow_thickness_changed): new function to - inform redisplay that the window has changed. - (mark_window): handle new field vertical_divider_shadow_thickness - from struct window. - (allocate_window): ditto. - (saved_window_equal): toddi. - (Fset_window_configuration): totid. - (save_window_save): ttdio. - (struct saved_window): new field vertical_divider_shadow_thickness. - -1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - - * device-msw.c (mswindows_device_system_metrics): Support a deluge - of metrics. - -1998-05-12 Oliver Graf <ograf@fga.de> - - * frame-x.c (x_cde_transfer_callback): fixed for the new protocol - * event-Xt.c (x_event_to_emacs_event): C++ compability - -1998-05-14 Hrvoje Niksic <hniksic@srce.hr> - - * emacs.c (Fdecode_path): Default SEPCHAR to value of - path-separator. - -1998-05-14 Hrvoje Niksic <hniksic@srce.hr> - - * emacs.c (vars_of_emacs): Do it here; change the meaning of - Vpath_separator. - - * fileio.c (vars_of_fileio): Don't define Vpath_separator here. - -1998-05-14 Hrvoje Niksic <hniksic@srce.hr> - - * emacs.c (decode_path_1): New function. - (decode_path): Use it. - (Fdecode_path): Renamed from Fdecode_path_internal; use - decode_path_1. - -1998-05-12 Hrvoje Niksic <hniksic@srce.hr> - - * macros.c (Fzap_last_kbd_macro_event): New function. - (Fend_kbd_macro): Remove REMOVE_LAST kludge. - -1998-05-10 Andy Piper <andyp@parallax.co.uk> - - * redisplay-msw.c (mswindows_output_dibitmap_region): make sure - multiple bitmaps are output vertically as well as horizontally. - * (mswindows_output_dibitmap): don't cope with bitmap boundaries - crossing lines this is handled by - mswindows_output_dibitmap_region. - -1998-05-12 Martin Buchholz <martin@xemacs.org> - - * inline.c: Include eldap.h - - * menubar-x.c (x_update_frame_menubar_internal): - Remove: unused variable `container' - -1998-05-11 Martin Buchholz <martin@xemacs.org> - - * s/aix4.h: Allow AIX 4.3 XEmacs to compile cleanly. - Unfortunately, the resulting temacs still cannot dump. - - * symbols.c (symbol_is_constant): - (verify_ok_for_buffer_local): - -Wswitch Warning suppression - add default case to switches. - - * redisplay.c (decode_mode_spec): Remove unused variables, - Replace Fcoding_system_property (codesys, Qmnemonic) with - XCODING_SYSTEM_MNEMONIC (codesys); - Fcoding_system_property is for users. - - * buffer.c: - * fileio.c: - * lread.c: - * xselect.c: - Change empty docstrings into no doc strings at all. - Fix bogus FSF-format docstrings. - - * extents.c: - Standardize docstrings. - - * floatfns.c: - Explain problems with matherr. - - * glyphs.c: make DEFUNs etags-readable, i.e. single-line - - * syssignal.h: - if BROKEN_SIGIO, then SIGIO wants to be undefined. - if SIGIO and not SIGPOLL, SIGPOLL wants to be SIGIO.\ - Fix the weird resultant interaction (causes windows problems) - - * gdbinit: - * dbxrc: - Take new EMACSBOOTSTRAPLOADPATH into account. - Update documentation strings - - * Makefile.in.in: - - Adjust for luser's CDPATH being set to something weird. - - Take into account bash 2.02's tendency to print the cwd when - using CDPATH. Always use `cd ./foo' instead of `cd foo'. - - fix the run-temacs target to use $(DUMPENV) - - fix the run-puremacs target to use $(DUMPENV) - - fix the `depend' target to properly $(RM) the right files - - Generate a better TAGS file for XEmacs' lisp code using - hand-crafted regexps. - - Use standard coding conventions for modules/Makefile.in - -1998-05-12 Didier Verna <didier@xemacs.org> - - * redisplay.c: removed the scrolling modeline code that didn't - make it for 21.0. To be continued ... - -1998-05-13 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - - * emacs.c (Fdecode_path_internal): Removed bogus handling of nil - and empty string inputs. - -1998-05-12 Hrvoje Niksic <hniksic@srce.hr> - - * redisplay-x.c (x_output_vertical_divider): Fixed typo. - -1998-05-10 Oliver Graf <ograf@fga.de> - - * event-stream.c (enqueue_misc_user_event_pos): created - * lisp.h (enqueue_misc_user_event_pos): prototype added - * frame-x.c (x_cde_transfer_callback): debug code plus API changes - * emacs.c: call vars_of_dragdrop - * dragdrop.c (vars_of_dragdrop): provide dragdrop - -1998-05-11 Oliver Graf <ograf@fga.de> - - * frame-x.c (x_cde_transfer_callback): return at correct pos - * event-Xt.c (x_event_to_emacs_event): changed format of drop - object for MIME (see comment in dragdrop.c) - * dragdrop.c: API change documented in comment - removed provide of dragdrop [is provided by dragdrop.el] - -1998-05-12 Kirill M. Katsnelson <kkm@kis.ru> - - * window.c (window_needs_vertical_divider): Enable vertical - dividers for every non-rightmost window. - (window_left_gutter_width): Left gutter consists of mythical - toolbar and a virtual scrollbar. - (window_right_gutter_width): The right one may have a divider - also. - - * scrollbar.c (update_scrollbar_instance): Position vertical - scrollbar left to divider if the latter present. - - * redisplay.h: Declared OVER_DIVIER constant. - - * redisplay.c (pixel_to_glyph_translation): Handle OVER_DIVIDER - case. - - * redisplay-x.c (x_output_vertical_divider): Output divider along - the right side of the window, down to window bottom. Swapped - foreground and background colors so it is visible by default. - - * redisplay-tty.c (tty_output_vertical_divider): Uncondiionally - stick the divider to the right window side. - - * redisplay-msw.c (mswindows_redisplay_deadbox_maybe): Fixed - deadbox painting. - (mswindows_divider_width): Ask system for user preferred value. - (mswindows_output_vertical_divider): Always output the divider on - the right side of a window, down to bottom. - - * keymap.c (get_relevant_keymaps): Route mouse button events which - happened over a window divider through window-divider-map. - (Fkey_binding): Documented that in the docstring. - Defined the variable Vwindow_divider_map. - - * events.c (Fevent_over_divider_p): Added this function. - - * events.h: EXFUNed it. - -1998-05-12 Kirill M. Katsnelson <kkm@kis.ru> - - * toolbar.c (update_frame_toolbars): Re-layout frame windows if - toolbar geometry is suspected to change. - -1998-05-11 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * src/device-msw.c - * src/event-msw.c - Condition dnd and dde code on HAVE_DRAGNDROP. - -1998-05-11 Hrvoje Niksic <hniksic@srce.hr> - - * events.c (format_event_object): Print space as SPC etc. - -1998-05-11 Hrvoje Niksic <hniksic@srce.hr> - - * print.c (print_internal): In the default case, abort() if - ERROR_CHECK_TYPECHECK. - - * fileio.c (Fmake_temp_name): Doc fix. - -1998-05-10 Hrvoje Niksic <hniksic@srce.hr> - - * xgccache.c (describe_gc_cache): Define only if DEBUG_XEMACS. - - * undo.c (Fprimitive_undo): Fixed typo. - -1998-05-11 Hrvoje Niksic <hniksic@srce.hr> - - * fns.c (concat): Signal error on integer argument. - -1998-05-10 Kirill M. Katsnelson <kkm@kis.ru> - - * console.h (device_metrics): Prefixed each constatnt with DM_ - - * device.c: (Fdevice_system_metric): Renamed so from plural form - (metrics); Changed parameters order and added DEFAULT parameter; - Unabbreviated some metric constants; Fixed and untabified doc string. - (Fdevice_system_metrics): Added. Returns a plist of all provided - metrics. - - * device-msw.c (mswindows_device_system_metrics): Renamed - device_metrics enum constants. - Return Qunbound instead of Qnil. - - * device-tty.c (tty_device_system_metrics): Ditto. - - * device-x.c (x_device_system_metrics): Ditto. - -1998-05-10 Andy Piper <andyp@parallax.co.uk> - - * redisplay-msw.c: implement background pixmaps (really!). Make - sure bg color is transparent if we have bg pmaps. - * (mswindows_output_string) (mswindows_clear_region): output bg - pmap if required. - * (mswindows_output_dibitmap_region): new function. - * (mswindows_output_dibitmap): output offset pixmaps, blt masks in - the bg color rather than transparently. - - * toolbar-msw.c: use masks if they exist. - - * glyphs-msw.c: set up masks correctly. - - * event-msw.c: typedef SOCKET if cygwin and not msg select(). - -1998-05-10 Hrvoje Niksic <hniksic@srce.hr> - - * regex.c (re_match_2_internal): Check for quit. - -1998-05-10 Hrvoje Niksic <hniksic@srce.hr> - - * frame.c (Ffocus_frame): New function. diff -r 12e008d41344 -r 697ef44129c6 src/EmacsFrame.c --- a/src/EmacsFrame.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsFrame.c Mon Aug 13 11:20:41 2007 +0200 @@ -57,141 +57,110 @@ #undef XtOffset #define XtOffset(p_type,field) \ ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) -#define offset(field) XtOffset (EmacsFrame, emacs_frame.field) +#define offset(field) XtOffset(EmacsFrame, emacs_frame.field) static XtResource resources[] = { - { XtNgeometry, XtCGeometry, - XtRString, sizeof (String), - offset (geometry), XtRString, (XtPointer) 0 }, - { XtNiconic, XtCIconic, - XtRBoolean, sizeof (Boolean), - offset (iconic), XtRImmediate, (XtPointer) False }, + {XtNgeometry, XtCGeometry, XtRString, sizeof(String), + offset (geometry), XtRString, (XtPointer) 0}, + {XtNiconic, XtCIconic, XtRBoolean, sizeof(Boolean), + offset (iconic), XtRImmediate, (XtPointer) False}, - { XtNemacsFrame, XtCEmacsFrame, - XtRPointer, sizeof (XtPointer), - offset (frame), XtRImmediate, 0 }, - { XtNmenubar, XtCMenubar, - XtRBoolean, sizeof (Boolean), - offset (menubar_p), XtRImmediate, (XtPointer) True }, - { XtNinitiallyUnmapped, XtCInitiallyUnmapped, - XtRBoolean, sizeof (Boolean), - offset (initially_unmapped), XtRImmediate, (XtPointer) False }, - { XtNminibuffer, XtCMinibuffer, - XtRBoolean, sizeof (Boolean), - offset (minibuffer), XtRImmediate, (XtPointer) True }, - { XtNunsplittable, XtCUnsplittable, - XtRBoolean, sizeof (Boolean), - offset (unsplittable), XtRImmediate, (XtPointer) False }, - { XtNinternalBorderWidth, XtCInternalBorderWidth, - XtRInt, sizeof (int), - offset (internal_border_width), XtRImmediate, (XtPointer)4 }, + {XtNemacsFrame, XtCEmacsFrame, XtRPointer, sizeof (XtPointer), + offset (frame), XtRImmediate, 0}, + {XtNmenubar, XtCMenubar, XtRBoolean, sizeof (Boolean), + offset (menubar_p), XtRImmediate, (XtPointer) True}, + {XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, sizeof (Boolean), + offset (initially_unmapped), XtRImmediate, (XtPointer) False}, + {XtNminibuffer, XtCMinibuffer, XtRBoolean, sizeof (Boolean), + offset (minibuffer), XtRImmediate, (XtPointer) True}, + {XtNunsplittable, XtCUnsplittable, XtRBoolean, sizeof (Boolean), + offset (unsplittable), XtRImmediate, (XtPointer) False}, + {XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, sizeof (int), + offset (internal_border_width), XtRImmediate, (XtPointer)4}, #ifdef HAVE_SCROLLBARS - { XtNscrollBarWidth, XtCScrollBarWidth, - XtRInt, sizeof (int), - offset (scrollbar_width), XtRImmediate, (XtPointer)-1 }, - { XtNscrollBarHeight, XtCScrollBarHeight, - XtRInt, sizeof (int), - offset (scrollbar_height), XtRImmediate, (XtPointer)-1 }, - { XtNscrollBarPlacement, XtCScrollBarPlacement, - XtRScrollBarPlacement, sizeof (unsigned char), - offset (scrollbar_placement), XtRImmediate, + {XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, sizeof (int), + offset (scrollbar_width), XtRImmediate, (XtPointer)-1}, + {XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, sizeof (int), + offset (scrollbar_height), XtRImmediate, (XtPointer)-1}, + {XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement, + sizeof(unsigned char), offset(scrollbar_placement), XtRImmediate, #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ defined (LWLIB_SCROLLBARS_ATHENA3D) - (XtPointer) XtBOTTOM_RIGHT + (XtPointer) XtBOTTOM_RIGHT #else - (XtPointer) XtBOTTOM_LEFT + (XtPointer) XtBOTTOM_LEFT #endif }, #endif /* HAVE_SCROLLBARS */ - #ifdef HAVE_TOOLBARS - { XtNtopToolBarHeight, XtCTopToolBarHeight, - XtRInt, sizeof (int), - offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 }, - { XtNbottomToolBarHeight, XtCBottomToolBarHeight, - XtRInt, sizeof (int), - offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 }, - { XtNleftToolBarWidth, XtCLeftToolBarWidth, - XtRInt, sizeof (int), - offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 }, - { XtNrightToolBarWidth, XtCRightToolBarWidth, - XtRInt, sizeof (int), - offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 }, - { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, - XtRInt, sizeof (int), - offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, - { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, - XtRInt, sizeof (int), - offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, - { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, - XtRInt, sizeof (int), - offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, - { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, - XtRInt, sizeof (int), - offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, - { XtNtopToolBarShadowColor, XtCTopToolBarShadowColor, - XtRPixel, sizeof (Pixel), - offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" }, - { XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor, - XtRPixel, sizeof (Pixel), - offset (bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" }, - { XtNbackgroundToolBarColor, XtCBackgroundToolBarColor, - XtRPixel, sizeof (Pixel), - offset (background_toolbar_pixel), XtRImmediate, (XtPointer)-1 }, - { XtNforegroundToolBarColor, XtCForegroundToolBarColor, - XtRPixel, sizeof (Pixel), - offset (foreground_toolbar_pixel), XtRImmediate, (XtPointer)-1 }, - { XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap, - XtRPixmap, sizeof (Pixmap), - offset (top_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None }, - { XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap, - XtRPixmap, sizeof (Pixmap), - offset (bottom_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None }, - { XtNtoolBarShadowThickness, XtCToolBarShadowThickness, - XtRDimension, sizeof (Dimension), - offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 }, + {XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, sizeof (int), + offset (top_toolbar_height), XtRImmediate, (XtPointer)-1}, + {XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, sizeof (int), + offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1}, + {XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, sizeof (int), + offset (left_toolbar_width), XtRImmediate, (XtPointer)-1}, + {XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, sizeof (int), + offset (right_toolbar_width), XtRImmediate, (XtPointer)-1}, + {XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, + sizeof (int), + offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1}, + {XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, + sizeof (int), + offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1}, + {XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt, + sizeof (int), + offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1}, + {XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt, + sizeof (int), + offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1}, + {XtNtopToolBarShadowColor, XtCTopToolBarShadowColor, XtRPixel, sizeof(Pixel), + offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000"}, + {XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor, XtRPixel, + sizeof(Pixel), offset(bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000"}, + {XtNbackgroundToolBarColor, XtCBackgroundToolBarColor, XtRPixel, + sizeof(Pixel), offset(background_toolbar_pixel), XtRImmediate, + (XtPointer)-1}, + {XtNforegroundToolBarColor, XtCForegroundToolBarColor, XtRPixel, + sizeof(Pixel), offset(foreground_toolbar_pixel), XtRImmediate, + (XtPointer)-1}, + {XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap, XtRPixmap, + sizeof (Pixmap), offset(top_toolbar_shadow_pixmap), XtRImmediate, + (XtPointer)None}, + {XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap, XtRPixmap, + sizeof (Pixmap), offset(bottom_toolbar_shadow_pixmap), XtRImmediate, + (XtPointer)None}, + {XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension, + sizeof (Dimension), offset (toolbar_shadow_thickness), XtRImmediate, + (XtPointer)2}, #endif /* HAVE_TOOLBARS */ - - { XtNinterline, XtCInterline, - XtRInt, sizeof (int), - offset (interline), XtRImmediate, (XtPointer)0 }, + {XtNinterline, XtCInterline, XtRInt, sizeof (int), + offset (interline), XtRImmediate, (XtPointer)0}, { #ifdef I18N4 - XtNfontSet, XtCFontSet, - XtRFontSet, sizeof (XFontSet), + XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet), #else - XtNfont, XtCFont, - XtRFontStruct, sizeof (XFontStruct *), + XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), #endif offset(font), XtRImmediate, (XtPointer)0 }, - { XtNforeground, XtCForeground, - XtRPixel, sizeof (Pixel), - offset(foreground_pixel), XtRString, (XtPointer) "Black" }, - { XtNbackground, XtCBackground, - XtRPixel, sizeof (Pixel), - offset(background_pixel), XtRString, (XtPointer) "Gray80" }, - { XtNcursorColor, XtCForeground, - XtRPixel, sizeof (Pixel), - offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" }, - { XtNbarCursor, XtCBarCursor, - XtRBoolean, sizeof (Boolean), - offset (bar_cursor), XtRImmediate, (XtPointer)0 }, - { XtNvisualBell, XtCVisualBell, - XtRBoolean, sizeof (Boolean), - offset (visual_bell), XtRImmediate, (XtPointer)0 }, - { XtNbellVolume, XtCBellVolume, - XtRInt, sizeof (int), - offset (bell_volume), XtRImmediate, (XtPointer)0 }, - { XtNuseBackingStore, XtCUseBackingStore, - XtRBoolean, sizeof (Boolean), - offset (use_backing_store), XtRImmediate, (XtPointer)0 }, - { XtNpreferredWidth, XtCPreferredWidth, - XtRDimension, sizeof (Dimension), - offset (preferred_width), XtRImmediate, (XtPointer)0 }, - { XtNpreferredHeight, XtCPreferredHeight, - XtRDimension, sizeof (Dimension), - offset (preferred_height), XtRImmediate, (XtPointer)0 }, + {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), + offset(foreground_pixel), XtRString, (XtPointer) "Black"}, + {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel), + offset(background_pixel), XtRString, (XtPointer) "Gray80"}, + {XtNcursorColor, XtCForeground, XtRPixel, sizeof(Pixel), + offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground"}, + {XtNbarCursor, XtCBarCursor, XtRBoolean, sizeof (Boolean), + offset (bar_cursor), XtRImmediate, (XtPointer)0}, + {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof (Boolean), + offset (visual_bell), XtRImmediate, (XtPointer)0}, + {XtNbellVolume, XtCBellVolume, XtRInt, sizeof (int), + offset (bell_volume), XtRImmediate, (XtPointer)0}, + {XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, sizeof (Boolean), + offset (use_backing_store), XtRImmediate, (XtPointer)0}, + {XtNpreferredWidth, XtCPreferredWidth, XtRDimension, sizeof (Dimension), + offset (preferred_width), XtRImmediate, (XtPointer)0}, + {XtNpreferredHeight, XtCPreferredHeight, XtRDimension, sizeof (Dimension), + offset (preferred_height), XtRImmediate, (XtPointer)0}, }; #undef offset @@ -222,7 +191,7 @@ /* superclass */ &widgetClassRec, #endif /* class_name */ "EmacsFrame", - /* widget_size */ sizeof (EmacsFrameRec), + /* widget_size */ sizeof(EmacsFrameRec), /* class_initialize */ EmacsFrameClassInitialize, /* class_part_initialize */ 0, /* class_inited */ FALSE, @@ -232,7 +201,7 @@ /* actions */ emacsFrameActionsTable, /* num_actions */ XtNumber (emacsFrameActionsTable), /* resources */ resources, - /* resource_count */ XtNumber (resources), + /* resource_count */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, @@ -580,7 +549,7 @@ } /* Xt string-to-scrollbar-placement converter */ -/* #### Convert this to a `new-style' converter (See XtAddTypeConverter) */ +/* ### Convert this to a `new-style' converter (See XtAddTypeConverter) */ /* This variable cannot be a stack variable. */ static unsigned char cvt_string_scrollbar_placement; diff -r 12e008d41344 -r 697ef44129c6 src/EmacsFrame.h --- a/src/EmacsFrame.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsFrame.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_EmacsFrame_h_ -#define INCLUDED_EmacsFrame_h_ +#ifndef _EmacsFrame_h +#define _EmacsFrame_h #ifndef XtNminibuffer #define XtNminibuffer "minibuffer" @@ -347,4 +347,4 @@ void EmacsFrameRecomputeCellSize (Widget widget); void EmacsFrameSetCharSize (Widget widget, int rows, int cols); -#endif /* INCLUDED_EmacsFrame_h_ */ +#endif /* _EmacsFrame_h */ diff -r 12e008d41344 -r 697ef44129c6 src/EmacsFrameP.h --- a/src/EmacsFrameP.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsFrameP.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_EmacsFrameP_h_ -#define INCLUDED_EmacsFrameP_h_ +#ifndef _EmacsFrameP_h +#define _EmacsFrameP_h #include "xintrinsicp.h" #include <X11/CoreP.h> @@ -109,4 +109,6 @@ extern EmacsFrameClassRec emacsFrameClassRec; /* class pointer */ -#endif /* INCLUDED_EmacsFrameP_h_ */ + + +#endif /* _EmacsFrameP_h */ diff -r 12e008d41344 -r 697ef44129c6 src/EmacsManager.c --- a/src/EmacsManager.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsManager.c Mon Aug 13 11:20:41 2007 +0200 @@ -37,15 +37,12 @@ static XtResource resources[] = { #define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field) - { XtNresizeCallback, XtCCallback, - XtRCallback, sizeof (XtCallbackList), - offset(resize_callback), XtRImmediate, (XtPointer) 0 }, - { XtNqueryGeometryCallback, XtCCallback, - XtRCallback, sizeof (XtCallbackList), - offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 }, - { XtNuserData, XtCUserData, - XtRPointer, sizeof (XtPointer), - offset(user_data), XtRImmediate, (XtPointer) 0 }, + { XtNresizeCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), + offset(resize_callback), XtRImmediate, (XtPointer) 0 }, + { XtNqueryGeometryCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), + offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 }, + { XtNuserData, XtCUserData, XtRPointer, sizeof(XtPointer), + offset(user_data), XtRImmediate, (XtPointer) 0 }, }; /**************************************************************** @@ -74,7 +71,7 @@ /* superclass */ (WidgetClass) &compositeClassRec, #endif /* class_name */ "EmacsManager", - /* widget_size */ sizeof (EmacsManagerRec), + /* widget_size */ sizeof(EmacsManagerRec), /* class_initialize */ ClassInitialize, /* class_part_init */ NULL, /* class_inited */ FALSE, @@ -150,17 +147,17 @@ { EmacsManagerWidget emw = (EmacsManagerWidget) w; EmacsManagerQueryGeometryStruct struc; - int request_mode = request->request_mode; + int mask = request->request_mode & (CWWidth | CWHeight); - struc.request_mode = request_mode; - struc.proposed_width = (request_mode & CWWidth) ? request->width : 0; - struc.proposed_height = (request_mode & CWHeight) ? request->height : 0; + struc.request_mode = mask; + if (mask & CWWidth) struc.proposed_width = request->width; + if (mask & CWHeight) struc.proposed_height = request->height; XtCallCallbackList (w, emw->emacs_manager.query_geometry_callback, &struc); reply->request_mode = CWWidth | CWHeight; reply->width = struc.proposed_width; reply->height = struc.proposed_height; - if (((request_mode & CWWidth) && (request->width != reply->width)) || - ((request_mode & CWHeight) && (request->height != reply->height))) + if (((mask & CWWidth) && (request->width != reply->width)) || + ((mask & CWHeight) && (request->height != reply->height))) return XtGeometryAlmost; return XtGeometryYes; } @@ -180,21 +177,23 @@ GeometryManager (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) { /* Sure, any changes are fine. */ +#define COPY(field, mask) \ + if (request->request_mode & mask) w->core.field = request->field -#ifdef LWLIB_MENUBARS_MOTIF /* The Motif menubar will merrily request a new size every time a child is added or deleted. Blow it off because it doesn't know what it's talking about. */ - if (XtClass (w) != xmRowColumnWidgetClass) +#ifdef LWLIB_MENUBARS_MOTIF + if (!(XtClass (w) == xmRowColumnWidgetClass)) #endif /* LWLIB_MENUBARS_MOTIF */ { - if (request->request_mode & CWWidth) w->core.width = request->width; - if (request->request_mode & CWHeight) w->core.height = request->height; + COPY (width, CWWidth); + COPY (height, CWHeight); } - if (request->request_mode & CWBorderWidth) - w->core.border_width = request->border_width; - if (request->request_mode & CWX) w->core.x = request->x; - if (request->request_mode & CWY) w->core.y = request->y; + COPY (border_width, CWBorderWidth); + COPY (x, CWX); + COPY (y, CWY); +#undef COPY return XtGeometryYes; } @@ -204,13 +203,13 @@ { if (!XtIsRealized (w)) { - XtWidgetGeometry request, reply; + XtWidgetGeometry req, repl; /* find out how big we'd like to be ... */ - request.request_mode = 0; - XtQueryGeometry (w, &request, &reply); - EmacsManagerChangeSize (w, reply.width, reply.height); + req.request_mode = 0; + XtQueryGeometry (w, &req, &repl); + EmacsManagerChangeSize (w, repl.width, repl.height); } } diff -r 12e008d41344 -r 697ef44129c6 src/EmacsManager.h --- a/src/EmacsManager.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsManager.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_EmacsManager_h_ -#define INCLUDED_EmacsManager_h_ +#ifndef _EmacsManager_h +#define _EmacsManager_h #ifndef XtNresizeCallback #define XtNresizeCallback "resizeCallback" @@ -59,4 +59,4 @@ void EmacsManagerChangeSize (Widget w, Dimension width, Dimension height); -#endif /* INCLUDED_EmacsManager_h_ */ +#endif /* _EmacsManager_h */ diff -r 12e008d41344 -r 697ef44129c6 src/EmacsManagerP.h --- a/src/EmacsManagerP.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsManagerP.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_EmacsManagerP_h_ -#define INCLUDED_EmacsManagerP_h_ +#ifndef _EmacsManagerP_h +#define _EmacsManagerP_h #include "xintrinsicp.h" @@ -65,4 +65,4 @@ extern EmacsManagerClassRec emacsManagerClassRec; /* class pointer */ -#endif /* INCLUDED_EmacsManagerP_h_ */ +#endif /* _EmacsManagerP_h */ diff -r 12e008d41344 -r 697ef44129c6 src/EmacsShell-sub.c --- a/src/EmacsShell-sub.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsShell-sub.c Mon Aug 13 11:20:41 2007 +0200 @@ -137,32 +137,26 @@ the default values for X and Y, for no obvious reason. This causes Shell to indicate that the defaults of (0,0) were program-specified, instead of letting the WM do what it wants. */ - { XtNx, XtCPosition, - XtRPosition, sizeof (Position), - coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE }, - { XtNy, XtCPosition, - XtRPosition, sizeof (Position), - coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE }, + {XtNx, XtCPosition, XtRPosition, sizeof(Position), + coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE}, + {XtNy, XtCPosition, XtRPosition, sizeof(Position), + coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE}, #endif - { XtNwidthCells, XtCWidthCells, - XtRInt, sizeof (int), - offset (width_cells), XtRImmediate, (XtPointer)0 }, - { XtNheightCells, XtCHeightCells, - XtRInt, sizeof (int), - offset (height_cells), XtRImmediate, (XtPointer)0 }, - { XtNminWidthCells, XtCMinWidthCells, - XtRInt, sizeof (int), - offset (min_width_cells), XtRImmediate, (XtPointer)0 }, - { XtNminHeightCells, XtCMinHeightCells, - XtRInt, sizeof (int), - offset (min_height_cells), XtRImmediate, (XtPointer)0 }, + { XtNwidthCells, XtCWidthCells, XtRInt, sizeof(int), + offset (width_cells), XtRImmediate, (XtPointer)0}, + { XtNheightCells, XtCHeightCells, XtRInt, sizeof(int), + offset (height_cells), XtRImmediate, (XtPointer)0}, + { XtNminWidthCells, XtCMinWidthCells, XtRInt, sizeof(int), + offset (min_width_cells), XtRImmediate, (XtPointer)0}, + { XtNminHeightCells, XtCMinHeightCells, XtRInt, sizeof(int), + offset (min_height_cells), XtRImmediate, (XtPointer)0}, }; static CompositeClassExtensionRec compositeClassExtRec = { NULL, NULLQUARK, XtCompositeExtensionVersion, - sizeof (CompositeClassExtensionRec), + sizeof(CompositeClassExtensionRec), TRUE, }; @@ -170,7 +164,7 @@ NULL, NULLQUARK, XtShellExtensionVersion, - sizeof (ShellClassExtensionRec), + sizeof(ShellClassExtensionRec), RootGeometryManager }; @@ -180,7 +174,7 @@ */ /* superclass */ (WidgetClass) &SUPERCLASS_CLASS_REC, /* class_name */ (String) EMACS_SHELL_CLASS_NAME, - /* size */ sizeof (EMACS_SHELL_REC), + /* size */ sizeof(EMACS_SHELL_REC), /* Class Initializer */ NULL, /* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */ /* Class init'ed ? */ FALSE, diff -r 12e008d41344 -r 697ef44129c6 src/EmacsShell.h --- a/src/EmacsShell.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsShell.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Written by Ben Wing, May, 1994. */ -#ifndef INCLUDED_EmacsShell_h_ -#define INCLUDED_EmacsShell_h_ +#ifndef _EmacsShell_h +#define _EmacsShell_h #ifndef XtNwidthCells #define XtNwidthCells "widthCells" @@ -68,4 +68,4 @@ void EmacsShellSetPositionUserSpecified (Widget gw); void EmacsShellSmashIconicHint (Widget shell, int iconic_p); -#endif /* INCLUDED_EmacsShell_h_ */ +#endif /* _EmacsShell_h */ diff -r 12e008d41344 -r 697ef44129c6 src/EmacsShellP.h --- a/src/EmacsShellP.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/EmacsShellP.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Written by Ben Wing, May, 1994. */ -#ifndef INCLUDED_EmacsShellP_h_ -#define INCLUDED_EmacsShellP_h_ +#ifndef _EmacsShellP_h +#define _EmacsShellP_h #include "xintrinsic.h" #include <X11/ShellP.h> @@ -99,4 +99,4 @@ /* class pointer */ extern TransientEmacsShellClassRec transientEmacsShellClassRec; -#endif /* INCLUDED_EmacsShellP_h_ */ +#endif /* _EmacsShellP_h */ diff -r 12e008d41344 -r 697ef44129c6 src/ExternalClient.c --- a/src/ExternalClient.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ExternalClient.c Mon Aug 13 11:20:41 2007 +0200 @@ -46,7 +46,7 @@ #include "extw-Xt.h" #ifdef TOOLTALK -#include TT_C_H_FILE +#include TT_C_H_PATH #endif /* This is the client widget, used to communicate with an ExternalShell @@ -77,30 +77,24 @@ static XtResource resources[] = { #define offset(field) XtOffset(ExternalClientWidget, externalClient.field) - { XtNshellTimeout, XtCShellTimeout, - XtRInt, sizeof (int), - offset(shell_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT }, - { XtNdeadShell, XtCDeadShell, - XtRBoolean, sizeof (Boolean), - offset(dead_shell), XtRImmediate, (XtPointer)False }, + { XtNshellTimeout, XtCShellTimeout, XtRInt, sizeof(int), + offset(shell_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT}, + { XtNdeadShell, XtCDeadShell, XtRBoolean, sizeof(Boolean), + offset(dead_shell), XtRImmediate, (XtPointer)False}, #ifdef EXTW_USES_MOTIF - { XmNnavigationType, XmCNavigationType, - XmRNavigationType, sizeof (XmNavigationType), - XtOffset (ExternalClientWidget, primitive.navigation_type), - XtRImmediate, (XtPointer)XmTAB_GROUP }, + { XmNnavigationType, XmCNavigationType, XmRNavigationType, + sizeof(XmNavigationType), XtOffset(ExternalClientWidget, + primitive.navigation_type), XtRImmediate, + (XtPointer)XmTAB_GROUP}, #endif - { XtNemacsProcID, XtCEmacsProcID, - XtRString, sizeof (String), - offset(emacs_procid), XtRImmediate, (XtPointer)NULL }, - { XtNshellReadyCallback, XtCCallback, - XtRCallback, sizeof (XtCallbackList), - offset(shell_ready_callback), XtRImmediate, (XtPointer)NULL }, - { XtNshellName, XtCShellName, - XtRString, sizeof (String), - offset(shell_name), XtRImmediate, (XtPointer)NULL }, - { XtNuseToolTalk, XtCUseToolTalk, - XtRBoolean, sizeof (Boolean), - offset(use_tooltalk), XtRImmediate, (XtPointer)False } + { XtNemacsProcID, XtCEmacsProcID, XtRString, sizeof(String), + offset(emacs_procid), XtRImmediate, (XtPointer)NULL}, + { XtNshellReadyCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), + offset(shell_ready_callback), XtRImmediate, (XtPointer)NULL}, + { XtNshellName, XtCShellName, XtRString, sizeof(String), + offset(shell_name), XtRImmediate, (XtPointer)NULL}, + { XtNuseToolTalk, XtCUseToolTalk, XtRBoolean, sizeof(Boolean), + offset(use_tooltalk), XtRImmediate, (XtPointer)False} }; static XtActionsRec actions[] = { @@ -120,13 +114,13 @@ /* superclass */ (WidgetClass) &coreClassRec, #endif /* class_name */ "ExternalClient", - /* size */ sizeof (ExternalClientRec), + /* size */ sizeof(ExternalClientRec), /* Class Initializer */ NULL, /* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */ /* Class init'ed ? */ FALSE, /* initialize */ externalClientInitialize, /* initialize_notify */ NULL, - /* realize */ externalClientRealize, + /* realize */ externalClientRealize, /* actions */ actions, /* num_actions */ XtNumber (actions), /* resources */ resources, @@ -140,9 +134,9 @@ /* resize */ XtInheritResize, /* expose */ NULL, /* set_values */ NULL, /* XtInheritSetValues, */ - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ NULL, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, /* accept_focus */ NULL, /* intrinsics version */ XtVersion, /* callback offsets */ NULL, @@ -192,7 +186,7 @@ -- BPW */ - + XtOverrideTranslations (new, XtParseTranslationTable ("None<Key>Tab:\n" "<FocusIn>:focusIn()\n" @@ -201,7 +195,7 @@ "<Leave>:leave()\n")); #endif - + XtAddEventHandler (new, 0, TRUE, EventHandler, (XtPointer) NULL); ecw->externalClient.shell_ready = False; @@ -220,7 +214,7 @@ tt_callback(Tt_message m, Tt_pattern p) { ExternalClientWidget ecw = (ExternalClientWidget)tt_message_user (m, 0); - + switch (tt_message_state(m)) { case TT_FAILED: @@ -232,7 +226,7 @@ ecw->externalClient.shell_ready_callback, NULL); break; } - + tt_message_destroy (m); return TT_CALLBACK_PROCESSED; } @@ -247,7 +241,7 @@ tt_message_class_set (m, TT_REQUEST); tt_message_arg_add (m, TT_IN, "string", name); tt_message_iarg_add (m, TT_IN, "int", win); - tt_message_arg_add (m, TT_OUT, "string", NULL); + tt_message_arg_add (m, TT_OUT, "string", NULL); tt_message_user_set (m, 0, (void *)ecw); tt_message_callback_add (m, tt_callback); if (ecw->externalClient.emacs_procid) @@ -267,8 +261,8 @@ externalClientRealize (Widget w, XtValueMask *vm, XSetWindowAttributes *attrs) { ExternalClientWidget ecw = (ExternalClientWidget)w; - -#ifdef EXTW_USES_MOTIF + +#ifdef EXTW_USES_MOTIF (*xmPrimitiveWidgetClass->core_class.realize) (w, vm, attrs); #else (*coreWidgetClass->core_class.realize) (w, vm, attrs); @@ -284,7 +278,7 @@ XSync (XtDisplay (w), False); send_tooltalk_handshake (ecw, XtWindow (w), XtName (w)); } -#endif +#endif } @@ -320,7 +314,7 @@ { struct ww_list *w1, *w2; Widget wid = 0; - + for (w1=ww_list, w2=w1->next; w2; w1=w2, w2=w2->next) if (w2->win == win) { @@ -372,7 +366,7 @@ XSetWindowAttributes xswa; XtValueMask mask; Widget wid = (Widget) w; - + w->externalClient.shell_ready = False; XtRemoveEventHandler (wid, w->externalClient.event_mask, FALSE, MaskableEventHandler, (XtPointer) NULL); @@ -385,7 +379,7 @@ my_error_handler (Display *display, XErrorEvent *xev) { Widget wid; - + if (xev->error_code != BadWindow) goto call_old; wid = remove_ww (xev->resourceid); @@ -394,7 +388,7 @@ end_connection ((ExternalClientWidget) wid); return 0; } - + call_old: return error_old_handler (display, xev); } @@ -405,7 +399,7 @@ /* closure and continue_to_dispatch unused */ { ExternalClientWidget w = (ExternalClientWidget) wid; - + if (w->externalClient.shell_ready) { if (event->type == KeyPress || event->type == KeyRelease || @@ -427,7 +421,7 @@ XSync (XtDisplay (wid), 0); /* make sure that any BadWindow errors (meaning the server died) get handled before XSendEvent is called again. */ - + } } @@ -437,7 +431,7 @@ /* closure and continue_to_dispatch unused */ { ExternalClientWidget w = (ExternalClientWidget) wid; - + if (w->core.window != event->xany.window) { XtAppErrorMsg (XtWidgetToApplicationContext (wid), @@ -446,41 +440,41 @@ (String *)NULL, (Cardinal *)NULL); return; } - + if (event->type == ClientMessage && event->xclient.message_type == a_EXTW_NOTIFY && event->xclient.data.l[0] == extw_shell_send) switch (event->xclient.data.l[1]) { - + case extw_notify_qg: /* shell is alive again. */ - + w->externalClient.dead_shell = False; break; - + case extw_notify_gm: { XtWidgetGeometry xwg, xwg_return; XtGeometryResult result; - + extw_get_geometry_value (XtDisplay (wid), XtWindow (wid), a_EXTW_GEOMETRY_MANAGER, &xwg); result = XtMakeGeometryRequest (wid, &xwg, &xwg_return); - + extw_send_geometry_value (XtDisplay (wid), XtWindow (wid), a_EXTW_GEOMETRY_MANAGER, extw_notify_gm, result == XtGeometryAlmost ? &xwg_return : NULL, result); break; } - + case extw_notify_init: w->externalClient.shell_ready = True; w->externalClient.event_window = event->xclient.data.l[2]; w->externalClient.event_mask = event->xclient.data.l[3]; add_ww (w->externalClient.event_window, (Widget) w); - + XtAddEventHandler (wid, w->externalClient.event_mask, FALSE, MaskableEventHandler, (XtPointer) NULL); #ifdef EXTW_USES_MOTIF @@ -493,12 +487,12 @@ 0, 0); #endif break; - + case extw_notify_end: end_connection (w); remove_ww (w->externalClient.event_window); break; - + case extw_notify_set_focus: #ifdef EXTW_USES_MOTIF XmProcessTraversal (wid, XmTRAVERSE_CURRENT); @@ -506,7 +500,7 @@ XtSetKeyboardFocus (wid, None); #endif break; - + } } @@ -514,7 +508,7 @@ Widget wid; { ExternalClientWidget w = (ExternalClientWidget)wid; - + NOTIFY(w, extw_notify_end, 0, 0, 0); } @@ -527,14 +521,14 @@ unsigned long request_num; Display *display = XtDisplay(gw); XtWidgetGeometry req = *request; /* don't modify caller's structure */ - + if (!XtIsRealized((Widget)w) || !w->externalClient.shell_ready) return XtGeometryYes; - + if (w->externalClient.dead_shell == TRUE) /* The shell is sick. */ return XtGeometryNo; - + req.sibling = None; req.request_mode &= ~CWSibling; request_num = NextRequest(display); @@ -560,7 +554,7 @@ Cardinal *num_params) { ExternalClientWidget ecw = (ExternalClientWidget) w; - + if (event->xfocus.send_event && !ecw->externalClient.has_focus) { ecw->externalClient.has_focus = True; NOTIFY(ecw, extw_notify_focus_in, 0, 0, 0); @@ -574,7 +568,7 @@ Cardinal *num_params) { ExternalClientWidget ecw = (ExternalClientWidget) w; - + if (event->xfocus.send_event && ecw->externalClient.has_focus) { ecw->externalClient.has_focus = False; NOTIFY(ecw, extw_notify_focus_out, 0, 0, 0); @@ -588,7 +582,7 @@ Cardinal *num_params) { ExternalClientWidget ecw = (ExternalClientWidget) w; - + if ( #ifdef EXTW_USES_MOTIF _XmGetFocusPolicy (w) != XmEXPLICIT && @@ -607,7 +601,7 @@ Cardinal *num_params) { ExternalClientWidget ecw = (ExternalClientWidget) w; - + if ( #ifdef EXTW_USES_MOTIF _XmGetFocusPolicy (w) != XmEXPLICIT && diff -r 12e008d41344 -r 697ef44129c6 src/ExternalClient.h --- a/src/ExternalClient.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ExternalClient.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_ExternalClient_h_ -#define INCLUDED_ExternalClient_h_ +#ifndef _ExternalClient_h +#define _ExternalClient_h #ifndef XtNshellTimeout #define XtNshellTimeout "shellTimeout" @@ -71,4 +71,4 @@ void ExternalClientInitialize (Display *display, Window win); void ExternalClientEventHandler (Display *display, Window win, XEvent *event); -#endif /* INCLUDED_ExternalClient_h_ */ +#endif /* _ExternalClient_h */ diff -r 12e008d41344 -r 697ef44129c6 src/ExternalClientP.h --- a/src/ExternalClientP.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ExternalClientP.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_ExternalClientP_h_ -#define INCLUDED_ExternalClientP_h_ +#ifndef _ExternalClientP_h +#define _ExternalClientP_h #include "ExternalClient.h" #ifdef EXTW_USES_MOTIF @@ -63,4 +63,4 @@ extern ExternalClientClassRec externalClientClassRec; /* class pointer */ -#endif /* INCLUDED_ExternalClientP_h_ */ +#endif /* _ExternalClientP_h */ diff -r 12e008d41344 -r 697ef44129c6 src/ExternalShell.c --- a/src/ExternalShell.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ExternalShell.c Mon Aug 13 11:20:41 2007 +0200 @@ -171,22 +171,19 @@ static XtResource resources[] = { #define offset(field) XtOffset(ExternalShellWidget, externalShell.field) - { XtNwindow, XtCWindow, - XtRWindow, sizeof (Window), - offset (external_window), XtRImmediate, (XtPointer)0 }, - { XtNclientTimeout, XtCClientTimeout, - XtRInt, sizeof (int), - offset(client_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT }, - { XtNdeadClient, XtCDeadClient, - XtRBoolean, sizeof (Boolean), - offset(dead_client), XtRImmediate, (XtPointer)False }, + { XtNwindow, XtCWindow, XtRWindow, sizeof (Window), + offset (external_window), XtRImmediate, (XtPointer)0}, + { XtNclientTimeout, XtCClientTimeout, XtRInt, sizeof(int), + offset(client_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT}, + { XtNdeadClient, XtCDeadClient, XtRBoolean, sizeof(Boolean), + offset(dead_client), XtRImmediate, (XtPointer)False}, }; static CompositeClassExtensionRec compositeClassExtRec = { NULL, NULLQUARK, XtCompositeExtensionVersion, - sizeof (CompositeClassExtensionRec), + sizeof(CompositeClassExtensionRec), TRUE, }; @@ -194,7 +191,7 @@ NULL, NULLQUARK, XtShellExtensionVersion, - sizeof (ShellClassExtensionRec), + sizeof(ShellClassExtensionRec), ExternalShellRootGeometryManager }; @@ -204,7 +201,7 @@ */ /* superclass */ (WidgetClass) &shellClassRec, /* class_name */ "ExternalShell", - /* size */ sizeof (ExternalShellRec), + /* size */ sizeof(ExternalShellRec), /* Class Initializer */ NULL, /* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */ /* Class init'ed ? */ FALSE, @@ -224,9 +221,9 @@ /* resize */ XtInheritResize, /* expose */ NULL, /* set_values */ NULL, /* XtInheritSetValues, */ - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ NULL, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, /* accept_focus */ NULL, /* intrinsics version */ XtVersion, /* callback offsets */ NULL, @@ -322,7 +319,7 @@ case extw_notify_focus_in: { XFocusChangeEvent evnt; - + evnt.type = FocusIn; evnt.serial = LastKnownRequestProcessed (XtDisplay (wid)); evnt.send_event = True; @@ -337,10 +334,10 @@ #endif break; } - + case extw_notify_focus_out: { XFocusChangeEvent evnt; - + evnt.type = FocusOut; evnt.serial = LastKnownRequestProcessed (XtDisplay (wid)); evnt.send_event = True; @@ -371,11 +368,11 @@ int x, y, win_gravity = -1, flag; XSizeHints hints; Window win = w->externalShell.external_window; - + { Window dummy_root; unsigned int dummy_bd_width, dummy_depth, width, height; - + /* determine the existing size of the window. */ XGetGeometry(XtDisplay(W), win, &dummy_root, &x, &y, &width, &height, &dummy_bd_width, &dummy_depth); @@ -469,8 +466,8 @@ w->core.background_pixmap = (*childP)->core.background_pixmap; } else { - attr->background_pixel = - w->core.background_pixel = + attr->background_pixel = + w->core.background_pixel = (*childP)->core.background_pixel; } break; diff -r 12e008d41344 -r 697ef44129c6 src/ExternalShell.h --- a/src/ExternalShell.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ExternalShell.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Written by Ben Wing, September 1993. */ -#ifndef INCLUDED_ExternalShell_h_ -#define INCLUDED_ExternalShell_h_ +#ifndef _ExternalShell_h +#define _ExternalShell_h #ifndef XtNwindow #define XtNwindow "window" @@ -54,4 +54,4 @@ #define is_external_shell(w) (XtClass (w) == externalShellWidgetClass) -#endif /* INCLUDED_ExternalShell_h_ */ +#endif /* _ExternalShell_h */ diff -r 12e008d41344 -r 697ef44129c6 src/ExternalShellP.h --- a/src/ExternalShellP.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ExternalShellP.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Written by Ben Wing, September 1993. */ -#ifndef INCLUDED_ExternalShellP_h_ -#define INCLUDED_ExternalShellP_h_ +#ifndef _ExternalShellP_h +#define _ExternalShellP_h #include "xintrinsic.h" #include <X11/ShellP.h> @@ -56,4 +56,4 @@ extern ExternalShellClassRec externalShellClassRec; /* class pointer */ -#endif /* INCLUDED_ExternalShellP_h_ */ +#endif /* _ExternalShellP_h */ diff -r 12e008d41344 -r 697ef44129c6 src/Makefile.in.in --- a/src/Makefile.in.in Mon Aug 13 11:19:22 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 11:20:41 2007 +0200 @@ -25,20 +25,7 @@ PROGNAME=@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} +all: ${PROGNAME} .PHONY : all release dump-elc dump-elcs all-elc all-elcs lint ## For performance and consistency, no built-in rules. @@ -86,6 +73,8 @@ 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 @@ -109,13 +98,16 @@ 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 @@ -125,7 +117,7 @@ cd ../lwlib && $(RECURSIVE_MAKE) x_objs=balloon_help.o balloon-x.o 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 + glyphs-x.o objects-x.o redisplay-x.o xgccache.o xselect.o #ifdef AIX4 LIBI18N = -li18n @@ -134,14 +126,10 @@ X11_libs = $(LIBI18N) #endif /* HAVE_X_WINDOWS */ -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#ifdef HEAP_IN_DATA sheap_obj=sheap.o #endif -#if defined(MINGW) || defined(CYGWIN) -res_obj=xemacs_res.o -#endif - ## -Demacs is needed to make some files produce the correct version ## for use in Emacs. @@ -188,14 +176,14 @@ event-stream.o extents.o faces.o\ fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o font-lock.o\ frame.o general.o glyphs.o glyphs-eimage.o glyphs-widget.o\ - gui.o gutter.o $(gui_objs) hash.o imgproc.o indent.o insdel.o intl.o\ + gui.o $(gui_objs) hash.o imgproc.o indent.o insdel.o intl.o\ keymap.o $(RTC_patch_objs) line-number.o lread.o lstream.o\ 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 $(sheap_obj) signal.o sound.o\ specifier.o strftime.o symbols.o syntax.o sysdep.o\ - undo.o $(x_objs) widget.o window.o $(res_obj) + undo.o $(x_objs) widget.o window.o obj_rtl = $(objs:.o=.c.rtl) @@ -248,37 +236,37 @@ # define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output extw_link_beg = $(CC) -shared extw_link_mid = -Xlinker -z -Xlinker text -o -extw_link_end = +extw_link_end = ## I cannot figure out how to do shared a.out libraries, so just punt. # elif !defined (LINUX) || defined (__ELF__) # define EXTW_LINK(objs, output) $(CC) -shared objs -o output extw_link_beg = $(CC) -shared extw_link_mid = -o -extw_link_end = +extw_link_end = # endif # elif defined (USG5) # if defined (IRIX) # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output -extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations -extw_link_mid = -o -extw_link_end = +extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations +extw_link_mid = -o +extw_link_end = # else /* not IRIX */ # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output extw_link_beg = $(CC) -G extw_link_mid = -z text -o -extw_link_end = +extw_link_end = # endif /* not IRIX */ # else /* not USG5 */ # if defined (DEC_ALPHA) && defined (OSF1) # define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES) -extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d -extw_link_mid = -o +extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d +extw_link_mid = -o extw_link_end = $(LIBES) # else /* !(DEC_ALPHA && OSF1) */ # define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output extw_link_beg = $(LD) -dc extw_link_mid = -assert pure-text -o -extw_link_end = +extw_link_end = # endif /* !(DEC_ALPHA && OSF1) */ # endif /* not USG5 */ @@ -321,50 +309,52 @@ mo_file = ${mo_dir}emacs.mo #endif -temacs_loadup = ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el +#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 dump_temacs = ${temacs_loadup} dump run_temacs = ${temacs_loadup} run-temacs -debug_temacs = gdb ${EXE_TARGET} -release: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} +release: temacs ${libsrc}DOC $(mo_file) ${other_files} #ifdef CANNOT_DUMP - ln ${EXE_TARGET} ${PROGNAME} + ln temacs ${PROGNAME} #else +#ifdef HAVE_SHM -if [ -w ${srcdir}/../lisp ]; then \ - w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/inc-vers; \ + w=`pwd`; cd ${srcdir} && $${w}/temacs -nl -batch -l ${srcdir}/../lisp/inc-vers; \ else true; fi - -./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el dump + -$(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) */ touch release #endif /* ! defined (CANNOT_DUMP) */ -${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp -#ifdef HEAP_IN_DATA - @$(RM) $@ && touch SATISFIED +${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp + @$(RM) $@ -${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) $@ - ${dump_temacs} @echo "Testing for Lisp shadows ..." @./${PROGNAME} -batch -vanilla -f list-load-path-shadows -#endif -fastdump: ${EXE_TARGET} - @$(RM) ${DUMP_TARGET} && touch SATISFIED +fastdump: temacs + @$(RM) ${PROGNAME} && touch SATISFIED -${dump_temacs} @./${PROGNAME} -batch -vanilla -f list-load-path-shadows FRC.update-elc.stamp : -update-elc.stamp : ${EXE_TARGET} FRC.update-elc.stamp +update-elc.stamp : temacs FRC.update-elc.stamp @touch NOBYTECOMPILE - ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el + ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \ $(RM) NOBYTECOMPILE @@ -383,16 +373,16 @@ cd ../dynodump && $(RECURSIVE_MAKE) #endif /* DYNODUMP */ -${libsrc}DOC: ${EXE_TARGET} update-elc.stamp +${libsrc}DOC: temacs update-elc.stamp $(RM) ${libsrc}DOC; \ - ${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/make-docfile.el -- \ + ${DUMPENV} ./temacs -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: ${EXE_TARGET} - -${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el +dump-elcs: temacs + -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el all-elc all-elcs: cd .. && $(RECURSIVE_MAKE) all-elc @@ -426,9 +416,6 @@ #endif /* I18N3 */ -${libsrc}make-dump-id: - cd ${libsrc} && $(RECURSIVE_MAKE) make-dump-id - ${libsrc}make-docfile: cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile @@ -442,26 +429,20 @@ $(LINT.c) $(LINTFILES) ## end of Lint Section -link_deps=\ +temacs_deps=\ $(start_files) ${objs} ${otherobjs}\ $(lwlib_deps) $(dynodump_deps) -temacs_deps=\ - $(link_deps) $(ID_FILE) +temacs_link_args=\ + ${start_flags} ${ldflags}\ + -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES} -temacs_link_args=\ - ${start_flags} ${ldflags} -I${srcdir} \ - -o $@ ${start_files} ${objs} ${otherobjs} ${ID_FILE} ${LIBES} - -${EXE_TARGET}: $(temacs_deps) +temacs: $(temacs_deps) $(LD) $(temacs_link_args) -dump-id.c: ${libsrc}make-dump-id ${link_deps} - ${libsrc}make-dump-id - .PHONY : run-temacs -run-temacs: ${EXE_TARGET} +run-temacs: temacs -${run_temacs} ## We have automated tests!! @@ -486,8 +467,8 @@ rtc_patch_area -o $@ rtcmacs: $(temacs_deps) rtc_patch.o - $(RM) ${EXE_TARGET}; $(RECURSIVE_MAKE) ${EXE_TARGET} RTC_patch_objs=rtc_patch.o - mv ${EXE_TARGET} rtcmacs + $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o + mv temacs rtcmacs .PHONY: run-rtcmacs run-rtcmacs: rtcmacs @@ -500,25 +481,17 @@ runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \ run' rtcmacs -debug-temacs: ${EXE_TARGET} - -${debug_temacs} - ## Purify, Quantify, PureCoverage are software quality products from ## Rational, formerly Pure Atria, formerly Pure Software. ## ## Purify PURIFY_PROG = purify -PURIFY_FLAGS =\ -#ifdef PDUMP - -search-mmaps=yes\ -#endif - -chain-length=32 -ignore-signals=SIGPOLL -threads=yes\ - -cache-dir=./purecache -always-use-cache-dir=yes - +PURIFY_FLAGS = -chain-length=32 -ignore-signals=SIGPOLL -threads=yes \ + -cache-dir=./purecache -always-use-cache-dir=yes -pointer-mask=0x0fffffff PURIFY_LIBS = -lpthread puremacs: $(temacs_deps) $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS) - cp $@ ${EXE_TARGET} + cp $@ temacs ## Quantify #ifdef QUANTIFY @@ -530,7 +503,7 @@ quantmacs: $(temacs_deps) $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args) - cp $@ ${EXE_TARGET} + cp $@ temacs #endif /* QUANTIFY */ @@ -687,16 +660,12 @@ #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. */ @@ -759,8 +728,5 @@ FRC.depend: depend: FRC.depend cd ${srcdir} && $(RM) depend.tmp && \ - perl ./make-src-depend > depend.tmp && \ - if cmp -s depend depend.tmp; \ - then $(RM) depend.tmp; \ - else $(RM) depend && mv depend.tmp depend; \ - fi + perl make-src-depend > depend.tmp && \ + $(RM) depend && mv depend.tmp depend diff -r 12e008d41344 -r 697ef44129c6 src/README --- a/src/README Mon Aug 13 11:19:22 2007 +0200 +++ b/src/README Mon Aug 13 11:20:41 2007 +0200 @@ -44,6 +44,9 @@ 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 12e008d41344 -r 697ef44129c6 src/abbrev.c --- a/src/abbrev.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/abbrev.c Mon Aug 13 11:20:41 2007 +0200 @@ -77,9 +77,9 @@ struct abbrev_match_mapper_closure { struct buffer *buf; - Lisp_Char_Table *chartab; + struct Lisp_Char_Table *chartab; Charcount point, maxlen; - Lisp_Symbol *found; + struct Lisp_Symbol *found; }; /* For use by abbrev_match(): Match SYMBOL's name against buffer text @@ -91,8 +91,8 @@ struct abbrev_match_mapper_closure *closure = (struct abbrev_match_mapper_closure *)arg; Charcount abbrev_length; - Lisp_Symbol *sym = XSYMBOL (symbol); - Lisp_String *abbrev; + struct Lisp_Symbol *sym = XSYMBOL (symbol); + struct Lisp_String *abbrev; /* symbol_value should be OK here, because abbrevs are not expected to contain any SYMBOL_MAGIC stuff. */ @@ -147,7 +147,7 @@ /* Match the buffer text against names of symbols in obarray. Returns the matching symbol, or 0 if not found. */ -static Lisp_Symbol * +static struct Lisp_Symbol * abbrev_match (struct buffer *buf, Lisp_Object obarray) { struct abbrev_match_mapper_closure closure; @@ -175,7 +175,7 @@ This speed difference should be unnoticeable, though. I have tested the degenerated cases of thousands of abbrevs being defined, and abbrev_match() was still fast enough for normal operation. */ -static Lisp_Symbol * +static struct Lisp_Symbol * abbrev_oblookup (struct buffer *buf, Lisp_Object obarray) { Bufpos wordstart, wordend; @@ -222,11 +222,10 @@ because of consistency with abbrev_match. */ if (wordend < point) return 0; + if (wordend <= wordstart) + return 0; } - if (wordend <= wordstart) - return 0; - p = word = (Bufbyte *) alloca (MAX_EMCHAR_LEN * (wordend - wordstart)); for (idx = wordstart; idx < wordend; idx++) { @@ -282,10 +281,10 @@ Bufpos point; /* position of point */ Bufpos abbrev_start; /* position of abbreviation beginning */ - Lisp_Symbol *(*fun) (struct buffer *, Lisp_Object); + struct Lisp_Symbol *(*fun) (struct buffer *, Lisp_Object); - Lisp_Symbol *abbrev_symbol; - Lisp_String *abbrev_string; + struct Lisp_Symbol *abbrev_symbol; + struct Lisp_String *abbrev_string; Lisp_Object expansion, count, hook; Charcount abbrev_length; int lccount, uccount; diff -r 12e008d41344 -r 697ef44129c6 src/alloc.c --- a/src/alloc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/alloc.c Mon Aug 13 11:20:41 2007 +0200 @@ -36,13 +36,12 @@ 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 (moved to dumper.c) + og: Killed the purespace. */ #include <config.h> #include "lisp.h" -#include "alloc.h" #include "backtrace.h" #include "buffer.h" #include "bytecode.h" @@ -57,20 +56,25 @@ #include "redisplay.h" #include "specifier.h" #include "sysfile.h" -#include "sysdep.h" #include "window.h" -#include "console-stream.h" + +#include <stddef.h> #ifdef DOUG_LEA_MALLOC #include <malloc.h> #endif -#ifdef PDUMP -#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 @@ -156,7 +160,7 @@ /* "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 @@ -172,6 +176,10 @@ /* Non-zero means we're in the process of doing the dump */ int purify_flag; +#ifdef HEAP_IN_DATA +extern void sheap_adjust_h(); +#endif + #ifdef ERROR_CHECK_TYPECHECK Error_behavior ERROR_ME, ERROR_ME_NOT, ERROR_ME_WARN; @@ -181,13 +189,13 @@ int c_readonly (Lisp_Object obj) { - return POINTER_TYPE_P (XTYPE (obj)) && C_READONLY (obj); + return POINTER_TYPE_P (XGCTYPE (obj)) && C_READONLY (obj); } int lisp_readonly (Lisp_Object obj) { - return POINTER_TYPE_P (XTYPE (obj)) && LISP_READONLY (obj); + return POINTER_TYPE_P (XGCTYPE (obj)) && LISP_READONLY (obj); } @@ -216,7 +224,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; @@ -252,7 +260,10 @@ /* like malloc and realloc but check for no memory left, and block input. */ +#ifdef xmalloc #undef xmalloc +#endif + void * xmalloc (size_t size) { @@ -262,7 +273,10 @@ return val; } +#ifdef xcalloc #undef xcalloc +#endif + static void * xcalloc (size_t nelem, size_t elsize) { @@ -278,7 +292,10 @@ return xcalloc (size, sizeof (char)); } +#ifdef xrealloc #undef xrealloc +#endif + void * xrealloc (void *block, size_t size) { @@ -337,20 +354,24 @@ #endif /* !ERROR_CHECK_GC */ +#ifdef xstrdup #undef xstrdup +#endif + char * -xstrdup (const char *str) +xstrdup (CONST char *str) { int len = strlen (str) + 1; /* for stupid terminating 0 */ void *val = xmalloc (len); if (val == 0) return 0; - return (char *) memcpy (val, str, len); + memcpy (val, str, len); + return (char *) val; } #ifdef NEED_STRDUP char * -strdup (const char *s) +strdup (CONST char *s) { return xstrdup (s); } @@ -360,31 +381,31 @@ static void * allocate_lisp_storage (size_t size) { - return xmalloc (size); + void *p = xmalloc (size); + return p; } -/* 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. */ +/* 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. + */ 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; - 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))); +#ifdef ERROR_CHECK_GC + if (implementation->static_size == 0) + assert (implementation->size_in_bytes_method); + else + assert (implementation->static_size == size); +#endif 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++; @@ -443,20 +464,57 @@ 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)); } } + +/* This must not be called -- it just serves as for EQ test + * If lheader->implementation->finalizer is this_marks_a_marked_record, + * then lrecord has been marked by the GC sweeper + * header->implementation is put back to its correct value by + * sweep_records */ +void +this_marks_a_marked_record (void *dummy0, int dummy1) +{ + abort (); +} + +/* 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, void (*markobj) (Lisp_Object)) +{ + abort (); + return Qnil; +} + +/* XGCTYPE for records */ +int +gc_record_type_p (Lisp_Object frob, CONST struct lrecord_implementation *type) +{ + CONST struct lrecord_implementation *imp; + + if (XGCTYPE (frob) != Lisp_Type_Record) + return 0; + + imp = XRECORD_LHEADER_IMPLEMENTATION (frob); + return imp == type; +} + /************************************************************************/ /* Debugger support */ /************************************************************************/ /* Give gdb/dbx enough information to decode Lisp Objects. We make sure certain symbols are always defined, so gdb doesn't complain - about expressions in src/.gdbinit. See src/.gdbinit or src/.dbxrc - to see how this is used. */ + about expressions in src/gdbinit. See src/gdbinit or src/dbxrc to + see how this is used. */ EMACS_UINT dbg_valmask = ((1UL << VALBITS) - 1) << GCBITS; EMACS_UINT dbg_typemask = (1UL << GCTYPEBITS) - 1; @@ -467,6 +525,33 @@ 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 + +#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; @@ -512,9 +597,9 @@ pointer to the actual string data, which is stored in structures of type struct string_chars_block. Each string_chars_block consists of a pointer to a struct Lisp_String, followed by the data for that - string, followed by another pointer to a Lisp_String, followed by - the data for that string, etc. At GC time, the data in these - blocks is compacted by searching sequentially through all the + string, followed by another pointer to a struct Lisp_String, + followed by the data for that string, etc. At GC time, the data in + these blocks is compacted by searching sequentially through all the blocks and compressing out any holes created by unmarked strings. Strings that are more than a certain size (bigger than the size of a string_chars_block, although something like half as big might @@ -628,7 +713,8 @@ varies depending on type) of them already on the list. This way, we ensure that an object that gets freed will remain free for the next 1000 (or whatever) times that - an object of that type is allocated. */ + an object of that type is allocated. +*/ #ifndef MALLOC_OVERHEAD #ifdef GNU_MALLOC @@ -648,7 +734,7 @@ This is called when a relocatable block is freed in ralloc.c. */ void refill_memory_reserve (void); void -refill_memory_reserve (void) +refill_memory_reserve () { if (breathing_space == 0) breathing_space = (char *) malloc (4096 - MALLOC_OVERHEAD); @@ -787,18 +873,12 @@ 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) \ - (ALIASING_VOIDPP_DEREFERENCE (ptr) == (void *) INVALID_POINTER_VALUE) + (* (void **) ptr == (void *) INVALID_POINTER_VALUE) #define MARK_STRUCT_AS_FREE(ptr) \ - (ALIASING_VOIDPP_DEREFERENCE (ptr) = (void *) INVALID_POINTER_VALUE) + (* (void **) ptr = (void *) INVALID_POINTER_VALUE) #define MARK_STRUCT_AS_NOT_FREE(ptr) \ - (ALIASING_VOIDPP_DEREFERENCE (ptr) = 0) + (* (void **) ptr = 0) #ifdef ERROR_CHECK_GC @@ -863,41 +943,34 @@ /* Cons allocation */ /************************************************************************/ -DECLARE_FIXED_TYPE_ALLOC (cons, Lisp_Cons); +DECLARE_FIXED_TYPE_ALLOC (cons, struct Lisp_Cons); /* conses are used and freed so often that we set this really high */ /* #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_cons 20000 */ #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_cons 2000 static Lisp_Object -mark_cons (Lisp_Object obj) +mark_cons (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - if (NILP (XCDR (obj))) + if (GC_NILP (XCDR (obj))) return XCAR (obj); - mark_object (XCAR (obj)); + markobj (XCAR (obj)); return XCDR (obj); } static int cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth) { - depth++; - while (internal_equal (XCAR (ob1), XCAR (ob2), depth)) + while (internal_equal (XCAR (ob1), XCAR (ob2), depth + 1)) { ob1 = XCDR (ob1); ob2 = XCDR (ob2); if (! CONSP (ob1) || ! CONSP (ob2)) - return internal_equal (ob1, ob2, depth); + return internal_equal (ob1, ob2, depth + 1); } return 0; } -static const struct lrecord_description cons_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Cons, car) }, - { XD_LISP_OBJECT, offsetof (Lisp_Cons, cdr) }, - { XD_END } -}; - DEFINE_BASIC_LRECORD_IMPLEMENTATION ("cons", cons, mark_cons, print_cons, 0, cons_equal, @@ -907,8 +980,7 @@ * handle conses. */ 0, - cons_description, - Lisp_Cons); + struct Lisp_Cons); DEFUN ("cons", Fcons, 2, 2, 0, /* Create a new cons, give it CAR and CDR as components, and return it. @@ -917,10 +989,10 @@ { /* This cannot GC. */ Lisp_Object val; - Lisp_Cons *c; - - ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&c->lheader, &lrecord_cons); + struct Lisp_Cons *c; + + ALLOCATE_FIXED_TYPE (cons, struct Lisp_Cons, c); + set_lheader_implementation (&(c->lheader), &lrecord_cons); XSETCONS (val, c); c->car = car; c->cdr = cdr; @@ -934,10 +1006,10 @@ noseeum_cons (Lisp_Object car, Lisp_Object cdr) { Lisp_Object val; - Lisp_Cons *c; - - NOSEEUM_ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&c->lheader, &lrecord_cons); + struct Lisp_Cons *c; + + NOSEEUM_ALLOCATE_FIXED_TYPE (cons, struct Lisp_Cons, c); + set_lheader_implementation (&(c->lheader), &lrecord_cons); XSETCONS (val, c); XCAR (val) = car; XCDR (val) = cdr; @@ -1024,9 +1096,9 @@ { Lisp_Object val = Qnil; - size_t size = XINT (length); - - while (size--) + int size = XINT (length); + + while (size-- > 0) val = Fcons (init, val); return val; } @@ -1039,22 +1111,17 @@ #ifdef LISP_FLOAT_TYPE -DECLARE_FIXED_TYPE_ALLOC (float, Lisp_Float); +DECLARE_FIXED_TYPE_ALLOC (float, struct Lisp_Float); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_float 1000 Lisp_Object make_float (double float_value) { Lisp_Object val; - Lisp_Float *f; - - ALLOCATE_FIXED_TYPE (float, Lisp_Float, f); - - /* Avoid dump-time `uninitialized memory read' purify warnings. */ - if (sizeof (struct lrecord_header) + sizeof (double) != sizeof (*f)) - xzero (*f); - - set_lheader_implementation (&f->lheader, &lrecord_float); + struct Lisp_Float *f; + + ALLOCATE_FIXED_TYPE (float, struct Lisp_Float, f); + set_lheader_implementation (&(f->lheader), &lrecord_float); float_data (f) = float_value; XSETFLOAT (val, f); return val; @@ -1068,22 +1135,22 @@ /************************************************************************/ static Lisp_Object -mark_vector (Lisp_Object obj) +mark_vector (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lisp_Vector *ptr = XVECTOR (obj); int len = vector_length (ptr); int i; for (i = 0; i < len - 1; i++) - mark_object (ptr->contents[i]); + markobj (ptr->contents[i]); return (len > 0) ? ptr->contents[len - 1] : Qnil; } static size_t -size_vector (const void *lheader) +size_vector (CONST void *lheader) { - return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, contents, - ((Lisp_Vector *) lheader)->size); + return STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, + ((Lisp_Vector *) lheader)->size); } static int @@ -1103,26 +1170,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) }, - { XD_END } -}; - DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, mark_vector, print_vector, 0, vector_equal, - vector_hash, - vector_description, + /* + * No `hash' method needed for + * vectors. internal_hash + * knows how to handle vectors. + */ + 0, size_vector, Lisp_Vector); /* #### should allocate `small' vectors from a frob-block */ @@ -1130,7 +1186,7 @@ make_vector_internal (size_t sizei) { /* no vector_next */ - size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei); + size_t sizem = STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei); Lisp_Vector *p = (Lisp_Vector *) alloc_lcrecord (sizem, &lrecord_vector); p->size = sizei; @@ -1289,13 +1345,13 @@ static Lisp_Object all_bit_vectors; /* #### should allocate `small' bit vectors from a frob-block */ -static Lisp_Bit_Vector * +static struct Lisp_Bit_Vector * make_bit_vector_internal (size_t sizei) { size_t num_longs = BIT_VECTOR_LONG_STORAGE (sizei); - size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, num_longs); + size_t sizem = STRETCHY_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"); @@ -1311,7 +1367,7 @@ Lisp_Object make_bit_vector (size_t length, Lisp_Object init) { - Lisp_Bit_Vector *p = make_bit_vector_internal (length); + struct Lisp_Bit_Vector *p = make_bit_vector_internal (length); size_t num_longs = BIT_VECTOR_LONG_STORAGE (length); CHECK_BIT (init); @@ -1399,7 +1455,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; @@ -1483,7 +1539,7 @@ f->constants = constants; CHECK_NATNUM (stack_depth); - f->stack_depth = (unsigned short) XINT (stack_depth); + f->stack_depth = XINT (stack_depth); #ifdef COMPILED_FUNCTION_ANNOTATION_HACK if (!NILP (Vcurrent_compiled_function_annotation)) @@ -1495,7 +1551,7 @@ struct gcpro gcpro1; GCPRO1 (fun); /* don't let fun get reaped */ Vload_file_name_internal_the_purecopy = - Ffile_name_nondirectory (Vload_file_name_internal); + Fpurecopy (Ffile_name_nondirectory (Vload_file_name_internal)); f->annotated = Vload_file_name_internal_the_purecopy; UNGCPRO; } @@ -1531,7 +1587,7 @@ /* Symbol allocation */ /************************************************************************/ -DECLARE_FIXED_TYPE_ALLOC (symbol, Lisp_Symbol); +DECLARE_FIXED_TYPE_ALLOC (symbol, struct Lisp_Symbol); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_symbol 1000 DEFUN ("make-symbol", Fmake_symbol, 1, 1, 0, /* @@ -1541,12 +1597,12 @@ (name)) { Lisp_Object val; - Lisp_Symbol *p; + struct Lisp_Symbol *p; CHECK_STRING (name); - ALLOCATE_FIXED_TYPE (symbol, Lisp_Symbol, p); - set_lheader_implementation (&p->lheader, &lrecord_symbol); + ALLOCATE_FIXED_TYPE (symbol, struct Lisp_Symbol, p); + set_lheader_implementation (&(p->lheader), &lrecord_symbol); p->name = XSTRING (name); p->plist = Qnil; p->value = Qunbound; @@ -1570,7 +1626,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); @@ -1590,17 +1646,17 @@ /* Event allocation */ /************************************************************************/ -DECLARE_FIXED_TYPE_ALLOC (event, Lisp_Event); +DECLARE_FIXED_TYPE_ALLOC (event, struct Lisp_Event); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_event 1000 Lisp_Object allocate_event (void) { Lisp_Object val; - Lisp_Event *e; - - ALLOCATE_FIXED_TYPE (event, Lisp_Event, e); - set_lheader_implementation (&e->lheader, &lrecord_event); + struct Lisp_Event *e; + + ALLOCATE_FIXED_TYPE (event, struct Lisp_Event, e); + set_lheader_implementation (&(e->lheader), &lrecord_event); XSETEVENT (val, e); return val; @@ -1611,7 +1667,7 @@ /* Marker allocation */ /************************************************************************/ -DECLARE_FIXED_TYPE_ALLOC (marker, Lisp_Marker); +DECLARE_FIXED_TYPE_ALLOC (marker, struct Lisp_Marker); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_marker 1000 DEFUN ("make-marker", Fmake_marker, 0, 0, 0, /* @@ -1620,10 +1676,10 @@ ()) { Lisp_Object val; - Lisp_Marker *p; - - ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&p->lheader, &lrecord_marker); + struct Lisp_Marker *p; + + ALLOCATE_FIXED_TYPE (marker, struct Lisp_Marker, p); + set_lheader_implementation (&(p->lheader), &lrecord_marker); p->buffer = 0; p->memind = 0; marker_next (p) = 0; @@ -1637,10 +1693,10 @@ noseeum_make_marker (void) { Lisp_Object val; - Lisp_Marker *p; - - NOSEEUM_ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&p->lheader, &lrecord_marker); + struct Lisp_Marker *p; + + NOSEEUM_ALLOCATE_FIXED_TYPE (marker, struct Lisp_Marker, p); + set_lheader_implementation (&(p->lheader), &lrecord_marker); p->buffer = 0; p->memind = 0; marker_next (p) = 0; @@ -1668,17 +1724,17 @@ This new method makes things somewhat bigger, but it is MUCH safer. */ -DECLARE_FIXED_TYPE_ALLOC (string, Lisp_String); +DECLARE_FIXED_TYPE_ALLOC (string, struct Lisp_String); /* strings are used and freed quite often */ /* #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_string 10000 */ #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_string 1000 static Lisp_Object -mark_string (Lisp_Object obj) +mark_string (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_String *ptr = XSTRING (obj); - - if (CONSP (ptr->plist) && EXTENT_INFOP (XCAR (ptr->plist))) + struct Lisp_String *ptr = XSTRING (obj); + + if (GC_CONSP (ptr->plist) && GC_EXTENT_INFOP (XCAR (ptr->plist))) flush_cached_extent_info (XCAR (ptr->plist)); return ptr->plist; } @@ -1691,74 +1747,20 @@ !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len)); } -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 } -}; - -/* 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); +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, + struct Lisp_String); /* String blocks contain this many useful bytes. */ #define STRING_CHARS_BLOCK_SIZE \ @@ -1776,29 +1778,34 @@ unsigned char string_chars[STRING_CHARS_BLOCK_SIZE]; }; -static struct string_chars_block *first_string_chars_block; -static struct string_chars_block *current_string_chars_block; +struct string_chars_block *first_string_chars_block; +struct string_chars_block *current_string_chars_block; /* If SIZE is the length of a string, this returns how many bytes * the string occupies in string_chars_block->string_chars * (including alignment padding). */ -#define STRING_FULLSIZE(size) \ - ALIGN_SIZE (((size) + 1 + sizeof (Lisp_String *)),\ - ALIGNOF (Lisp_String *)) +#define STRING_FULLSIZE(s) \ + ALIGN_SIZE (((s) + 1 + sizeof (struct Lisp_String *)),\ + ALIGNOF (struct Lisp_String *)) #define BIG_STRING_FULLSIZE_P(fullsize) ((fullsize) >= STRING_CHARS_BLOCK_SIZE) #define BIG_STRING_SIZE_P(size) (BIG_STRING_FULLSIZE_P (STRING_FULLSIZE(size))) +#define CHARS_TO_STRING_CHAR(x) \ + ((struct string_chars *) \ + (((char *) (x)) - (slot_offset (struct string_chars, chars[0])))) + + struct string_chars { - Lisp_String *string; + struct Lisp_String *string; unsigned char chars[1]; }; struct unused_string_chars { - Lisp_String *string; + struct Lisp_String *string; EMACS_INT fullsize; }; @@ -1813,14 +1820,19 @@ } static struct string_chars * -allocate_string_chars_struct (Lisp_String *string_it_goes_with, +allocate_string_chars_struct (struct Lisp_String *string_it_goes_with, EMACS_INT fullsize) { struct string_chars *s_chars; - if (fullsize <= - (countof (current_string_chars_block->string_chars) - - current_string_chars_block->pos)) + /* Allocate the string's actual data */ + if (BIG_STRING_FULLSIZE_P (fullsize)) + { + s_chars = (struct string_chars *) xmalloc (fullsize); + } + else if (fullsize <= + (countof (current_string_chars_block->string_chars) + - current_string_chars_block->pos)) { /* This string can fit in the current string chars block */ s_chars = (struct string_chars *) @@ -1852,20 +1864,21 @@ Lisp_Object make_uninit_string (Bytecount length) { - Lisp_String *s; + struct Lisp_String *s; + struct string_chars *s_chars; EMACS_INT fullsize = STRING_FULLSIZE (length); Lisp_Object val; - assert (length >= 0 && fullsize > 0); + if ((length < 0) || (fullsize <= 0)) + abort (); /* Allocate the string header */ - ALLOCATE_FIXED_TYPE (string, Lisp_String, s); - set_lheader_implementation (&s->lheader, &lrecord_string); - - set_string_data (s, BIG_STRING_FULLSIZE_P (fullsize) - ? xnew_array (Bufbyte, length + 1) - : allocate_string_chars_struct (s, fullsize)->chars); - + ALLOCATE_FIXED_TYPE (string, struct Lisp_String, s); + set_lheader_implementation (&(s->lheader), &lrecord_string); + + s_chars = allocate_string_chars_struct (s, fullsize); + + set_string_data (s, &(s_chars->chars[0])); set_string_length (s, length); s->plist = Qnil; @@ -1886,9 +1899,8 @@ */ void -resize_string (Lisp_String *s, Bytecount pos, Bytecount delta) +resize_string (struct Lisp_String *s, Bytecount pos, Bytecount delta) { - Bytecount oldfullsize, newfullsize; #ifdef VERIFY_STRING_CHARS_INTEGRITY verify_string_chars_integrity (); #endif @@ -1907,62 +1919,47 @@ } #endif /* ERROR_CHECK_BUFPOS */ + if (pos >= 0 && delta < 0) + /* If DELTA < 0, the functions below will delete the characters + before POS. We want to delete characters *after* POS, however, + so convert this to the appropriate form. */ + pos += -delta; + if (delta == 0) /* simplest case: no size change. */ return; - - if (pos >= 0 && delta < 0) - /* If DELTA < 0, the functions below will delete the characters - before POS. We want to delete characters *after* POS, however, - so convert this to the appropriate form. */ - pos += -delta; - - oldfullsize = STRING_FULLSIZE (string_length (s)); - newfullsize = STRING_FULLSIZE (string_length (s) + delta); - - if (BIG_STRING_FULLSIZE_P (oldfullsize)) + else { - if (BIG_STRING_FULLSIZE_P (newfullsize)) + Bytecount oldfullsize = STRING_FULLSIZE (string_length (s)); + Bytecount newfullsize = STRING_FULLSIZE (string_length (s) + delta); + + if (oldfullsize == newfullsize) { - /* Both strings are big. We can just realloc(). - But careful! If the string is shrinking, we have to - memmove() _before_ realloc(), and if growing, we have to - memmove() _after_ realloc() - otherwise the access is - illegal, and we might crash. */ - Bytecount len = string_length (s) + 1 - pos; - - if (delta < 0 && pos >= 0) - memmove (string_data (s) + pos + delta, string_data (s) + pos, len); - set_string_data (s, (Bufbyte *) xrealloc (string_data (s), - string_length (s) + delta + 1)); - if (delta > 0 && pos >= 0) - memmove (string_data (s) + pos + delta, string_data (s) + pos, len); - } - else /* String has been demoted from BIG_STRING. */ - { - Bufbyte *new_data = - allocate_string_chars_struct (s, newfullsize)->chars; - Bufbyte *old_data = string_data (s); - + /* next simplest case; size change but the necessary + allocation size won't change (up or down; code somewhere + depends on there not being any unused allocation space, + modulo any alignment constraints). */ if (pos >= 0) { - memcpy (new_data, old_data, pos); - memcpy (new_data + pos + delta, old_data + pos, - string_length (s) + 1 - pos); + Bufbyte *addroff = pos + string_data (s); + + memmove (addroff + delta, addroff, + /* +1 due to zero-termination. */ + string_length (s) + 1 - pos); } - set_string_data (s, new_data); - xfree (old_data); } - } - else /* old string is small */ - { - if (oldfullsize == newfullsize) + else if (BIG_STRING_FULLSIZE_P (oldfullsize) && + BIG_STRING_FULLSIZE_P (newfullsize)) { - /* special case; size change but the necessary - allocation size won't change (up or down; code - somewhere depends on there not being any unused - allocation space, modulo any alignment - constraints). */ + /* next simplest case; the string is big enough to be malloc()ed + itself, so we just realloc. + + It's important not to let the string get below the threshold + for making big strings and still remain malloc()ed; if that + were the case, repeated calls to this function on the same + string could result in memory leakage. */ + set_string_data (s, (Bufbyte *) xrealloc (string_data (s), + newfullsize)); if (pos >= 0) { Bufbyte *addroff = pos + string_data (s); @@ -1974,52 +1971,58 @@ } else { - Bufbyte *old_data = string_data (s); - Bufbyte *new_data = - BIG_STRING_FULLSIZE_P (newfullsize) - ? xnew_array (Bufbyte, string_length (s) + delta + 1) - : allocate_string_chars_struct (s, newfullsize)->chars; - + /* worst case. We make a new string_chars struct and copy + the string's data into it, inserting/deleting the delta + in the process. The old string data will either get + freed by us (if it was malloc()ed) or will be reclaimed + in the normal course of garbage collection. */ + struct string_chars *s_chars = + allocate_string_chars_struct (s, newfullsize); + Bufbyte *new_addr = &(s_chars->chars[0]); + Bufbyte *old_addr = string_data (s); if (pos >= 0) { - memcpy (new_data, old_data, pos); - memcpy (new_data + pos + delta, old_data + pos, + memcpy (new_addr, old_addr, pos); + memcpy (new_addr + pos + delta, old_addr + pos, string_length (s) + 1 - pos); } - set_string_data (s, new_data); - - { - /* We need to mark this chunk of the string_chars_block - as unused so that compact_string_chars() doesn't - freak. */ - struct string_chars *old_s_chars = (struct string_chars *) - ((char *) old_data - offsetof (struct string_chars, chars)); - /* Sanity check to make sure we aren't hosed by strange - alignment/padding. */ - assert (old_s_chars->string == s); - MARK_STRUCT_AS_FREE (old_s_chars); - ((struct unused_string_chars *) old_s_chars)->fullsize = - oldfullsize; - } + set_string_data (s, new_addr); + if (BIG_STRING_FULLSIZE_P (oldfullsize)) + xfree (old_addr); + else + { + /* We need to mark this chunk of the string_chars_block + as unused so that compact_string_chars() doesn't + freak. */ + struct string_chars *old_s_chars = + (struct string_chars *) ((char *) old_addr - + sizeof (struct Lisp_String *)); + /* Sanity check to make sure we aren't hosed by strange + alignment/padding. */ + assert (old_s_chars->string == s); + MARK_STRUCT_AS_FREE (old_s_chars); + ((struct unused_string_chars *) old_s_chars)->fullsize = + oldfullsize; + } } - } - - set_string_length (s, string_length (s) + delta); - /* If pos < 0, the string won't be zero-terminated. - Terminate now just to make sure. */ - string_data (s)[string_length (s)] = '\0'; - - if (pos >= 0) - { - Lisp_Object string; - - XSETSTRING (string, s); - /* We also have to adjust all of the extent indices after the - place we did the change. We say "pos - 1" because - adjust_extents() is exclusive of the starting position - passed to it. */ - adjust_extents (string, pos - 1, string_length (s), - delta); + + set_string_length (s, string_length (s) + delta); + /* If pos < 0, the string won't be zero-terminated. + Terminate now just to make sure. */ + string_data (s)[string_length (s)] = '\0'; + + if (pos >= 0) + { + Lisp_Object string; + + XSETSTRING (string, s); + /* We also have to adjust all of the extent indices after the + place we did the change. We say "pos - 1" because + adjust_extents() is exclusive of the starting position + passed to it. */ + adjust_extents (string, pos - 1, string_length (s), + delta); + } } #ifdef VERIFY_STRING_CHARS_INTEGRITY @@ -2030,7 +2033,7 @@ #ifdef MULE void -set_string_char (Lisp_String *s, Charcount i, Emchar c) +set_string_char (struct Lisp_String *s, Charcount i, Emchar c) { Bufbyte newstr[MAX_EMCHAR_LEN]; Bytecount bytoff = charcount_to_bytecount (string_data (s), i); @@ -2063,7 +2066,7 @@ memset (XSTRING_DATA (val), XCHAR (init), XSTRING_LENGTH (val)); else { - size_t i; + int i; Bufbyte *ptr = XSTRING_DATA (val); for (i = XINT (length); i; i--) @@ -2103,7 +2106,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; @@ -2120,41 +2123,40 @@ /* 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, - Lisp_Object coding_system) +make_ext_string (CONST Extbyte *contents, EMACS_INT length, + enum external_data_format fmt) { - Lisp_Object string; - TO_INTERNAL_FORMAT (DATA, (contents, length), - LISP_STRING, string, - coding_system); - return string; + Bufbyte *intstr; + Bytecount intlen; + + GET_CHARPTR_INT_DATA_ALLOCA (contents, length, fmt, intstr, intlen); + return make_string (intstr, intlen); } 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, enum external_data_format fmt) { /* Some strlen's crash and burn if passed null. */ - return make_ext_string ((const Extbyte *) str, (str ? strlen(str) : 0), - coding_system); + return make_ext_string ((CONST Extbyte *) str, (str ? strlen(str) : 0), fmt); } 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; + struct Lisp_String *s; Lisp_Object val; /* Make sure we find out about bad make_string_nocopy's when they happen */ @@ -2163,8 +2165,8 @@ #endif /* Allocate the string header */ - ALLOCATE_FIXED_TYPE (string, Lisp_String, s); - set_lheader_implementation (&s->lheader, &lrecord_string); + ALLOCATE_FIXED_TYPE (string, struct Lisp_String, s); + set_lheader_implementation (&(s->lheader), &lrecord_string); SET_C_READONLY_RECORD_HEADER (&s->lheader); s->plist = Qnil; set_string_data (s, (Bufbyte *)contents); @@ -2187,7 +2189,7 @@ It works like this: 1) Create an lcrecord-list object using make_lcrecord_list(). - This is often done at initialization. Remember to staticpro_nodump + This is often done at initialization. Remember to staticpro this object! The arguments to make_lcrecord_list() are the same as would be passed to alloc_lcrecord(). 2) Instead of calling alloc_lcrecord(), call allocate_managed_lcrecord() @@ -2208,7 +2210,7 @@ */ static Lisp_Object -mark_lcrecord_list (Lisp_Object obj) +mark_lcrecord_list (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct lcrecord_list *list = XLCRECORD_LIST (obj); Lisp_Object chain = list->free; @@ -2219,23 +2221,22 @@ struct free_lcrecord_header *free_header = (struct free_lcrecord_header *) lheader; - 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) - ); +#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 */ MARK_RECORD_HEADER (lheader); chain = free_header->chain; @@ -2246,10 +2247,10 @@ DEFINE_LRECORD_IMPLEMENTATION ("lcrecord-list", lcrecord_list, mark_lcrecord_list, internal_object_printer, - 0, 0, 0, 0, struct lcrecord_list); + 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); @@ -2273,21 +2274,23 @@ (struct free_lcrecord_header *) XPNTR (val); #ifdef ERROR_CHECK_GC - struct lrecord_header *lheader = &free_header->lcheader.lheader; + struct lrecord_header *lheader = + (struct lrecord_header *) free_header; + CONST struct lrecord_implementation *implementation + = LHEADER_IMPLEMENTATION (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 (! LHEADER_IMPLEMENTATION (lheader)->basic_p); + assert (!implementation->basic_p); /* Only free lcrecords should be here. */ assert (free_header->lcheader.free); /* The type of the lcrecord must be right. */ - assert (LHEADER_IMPLEMENTATION (lheader) == list->implementation); + assert (implementation == list->implementation); /* So must the size. */ - assert (LHEADER_IMPLEMENTATION (lheader)->static_size == 0 || - LHEADER_IMPLEMENTATION (lheader)->static_size == list->size); + assert (implementation->static_size == 0 + || implementation->static_size == list->size); #endif /* ERROR_CHECK_GC */ - list->free = free_header->chain; free_header->lcheader.free = 0; return val; @@ -2308,16 +2311,19 @@ struct lcrecord_list *list = XLCRECORD_LIST (lcrecord_list); struct free_lcrecord_header *free_header = (struct free_lcrecord_header *) XPNTR (lcrecord); - struct lrecord_header *lheader = &free_header->lcheader.lheader; - const struct lrecord_implementation *implementation + struct lrecord_header *lheader = + (struct lrecord_header *) free_header; + 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. */ - gc_checking_assert ((implementation->size_in_bytes_method ? - implementation->size_in_bytes_method (lheader) : - implementation->static_size) - == list->size); + 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 */ if (implementation->finalizer) implementation->finalizer (lheader, 0); @@ -2341,164 +2347,85 @@ return obj; } + /************************************************************************/ /* Garbage Collection */ /************************************************************************/ -/* 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. */ -#define MODULE_DEFINABLE_TYPE_COUNT 32 -const struct lrecord_implementation *lrecord_implementations_table[lrecord_type_count + MODULE_DEFINABLE_TYPE_COUNT]; - -/* 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); +/* 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) struct gcpro *gcprolist; /* 415 used Mly 29-Jun-93 */ /* 1327 used slb 28-Feb-98 */ -/* 1328 used og 03-Oct-99 (moving slowly, heh?) */ #ifdef HAVE_SHLIB #define NSTATICS 4000 #else #define NSTATICS 2000 #endif - -/* Not "static" because used by dumper.c */ -Lisp_Object *staticvec[NSTATICS]; -int staticidx; +/* Not "static" because of linker lossage on some systems */ +Lisp_Object *staticvec[NSTATICS] + /* Force it into data space! */ + = {0}; +static int staticidx; /* Put an entry in staticvec, pointing at the variable whose address is given */ void staticpro (Lisp_Object *varaddress) { - /* #### This is now a dubious assert() since this routine may be called */ - /* by Lisp attempting to load a DLL. */ - assert (staticidx < countof (staticvec)); + if (staticidx >= countof (staticvec)) + /* #### This is now a dubious abort() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ + abort (); staticvec[staticidx++] = varaddress; } - -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) -{ - /* #### 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; -} - - -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) -{ - 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]; -int pdump_wireidx; - -/* Put an entry in pdump_wirevec, pointing at the variable whose address is given - */ -void -pdump_wire (Lisp_Object *varaddress) -{ - assert (pdump_wireidx < countof (pdump_wirevec)); - pdump_wirevec[pdump_wireidx++] = varaddress; -} - - -Lisp_Object *pdump_wirevec_list[50]; -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) -{ - 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. */ -void +static void mark_object (Lisp_Object obj) { tail_recurse: +#ifdef ERROR_CHECK_GC + assert (! (GC_EQ (obj, Qnull_pointer))); +#endif /* Checks we used to perform */ /* if (EQ (obj, Qnull_pointer)) return; */ /* if (!POINTER_TYPE_P (XGCTYPE (obj))) return; */ /* if (PURIFIED (XPNTR (obj))) return; */ - if (XTYPE (obj) == Lisp_Type_Record) + if (XGCTYPE (obj) == Lisp_Type_Record) { struct lrecord_header *lheader = XRECORD_LHEADER (obj); - - 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)) +#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)) { + CONST struct lrecord_implementation *implementation = + LHEADER_IMPLEMENTATION (lheader); MARK_RECORD_HEADER (lheader); - - if (RECORD_MARKER (lheader)) +#ifdef ERROR_CHECK_GC + if (!implementation->basic_p) + assert (! ((struct lcrecord_header *) lheader)->free); +#endif + if (implementation->marker) { - obj = RECORD_MARKER (lheader) (obj); - if (!NILP (obj)) goto tail_recurse; + obj = implementation->marker (obj, mark_object); + if (!GC_NILP (obj)) goto tail_recurse; } } } @@ -2537,6 +2464,24 @@ /* 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 @@ -2549,23 +2494,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) { - unsigned int type_index = h->type; + CONST struct lrecord_implementation *implementation = + LHEADER_IMPLEMENTATION (h); + int type_index = lrecord_type_index (implementation); if (((struct lcrecord_header *) h)->free) { - gc_checking_assert (!free_p); + assert (!free_p); lcrecord_stats[type_index].instances_on_free_list++; } else { - 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); + 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++; @@ -2603,10 +2548,9 @@ for (header = *prev; header; header = header->next) { struct lrecord_header *h = &(header->lheader); - - GC_CHECK_LHEADER_INVARIANTS (h); - - if (! MARKED_RECORD_HEADER_P (h) && ! header->free) + if (!C_READONLY_RECORD_HEADER_P(h) + && !MARKED_RECORD_HEADER_P (h) + && ! (header->free)) { if (LHEADER_IMPLEMENTATION (h)->finalizer) LHEADER_IMPLEMENTATION (h)->finalizer (h, 0); @@ -2616,13 +2560,13 @@ for (header = *prev; header; ) { struct lrecord_header *h = &(header->lheader); - if (MARKED_RECORD_HEADER_P (h)) + if (C_READONLY_RECORD_HEADER_P(h) || MARKED_RECORD_HEADER_P (h)) { - if (! C_READONLY_RECORD_HEADER_P (h)) + if (MARKED_RECORD_HEADER_P (h)) UNMARK_RECORD_HEADER (h); num_used++; /* total_size += n->implementation->size_in_bytes (h);*/ - /* #### May modify header->next on a C_READONLY lcrecord */ + /* ### May modify header->next on a C_READONLY lcrecord */ prev = &(header->next); header = *prev; tick_lcrecord_stats (h, 0); @@ -2657,17 +2601,17 @@ { Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector); int len = v->size; - if (MARKED_RECORD_P (bit_vector)) + if (C_READONLY_RECORD_HEADER_P(&(v->lheader)) || MARKED_RECORD_P (bit_vector)) { - if (! C_READONLY_RECORD_HEADER_P(&(v->lheader))) + if (MARKED_RECORD_P (bit_vector)) UNMARK_RECORD_HEADER (&(v->lheader)); total_size += len; total_storage += MALLOC_OVERHEAD + - FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, - BIT_VECTOR_LONG_STORAGE (len)); + STRETCHY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, + BIT_VECTOR_LONG_STORAGE (len)); num_used++; - /* #### May modify next on a C_READONLY bitvector */ + /* ### May modify next on a C_READONLY bitvector */ prev = &(bit_vector_next (v)); bit_vector = *prev; } @@ -2716,7 +2660,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); \ @@ -2771,7 +2715,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); \ @@ -2827,12 +2771,12 @@ #define UNMARK_cons(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_cons(ptr) - SWEEP_FIXED_TYPE_BLOCK (cons, Lisp_Cons); + SWEEP_FIXED_TYPE_BLOCK (cons, struct Lisp_Cons); } /* Explicitly free a cons cell. */ void -free_cons (Lisp_Cons *ptr) +free_cons (struct Lisp_Cons *ptr) { #ifdef ERROR_CHECK_GC /* If the CAR is not an int, then it will be a pointer, which will @@ -2846,7 +2790,7 @@ #endif /* ERROR_CHECK_GC */ #ifndef ALLOC_NO_POOLS - FREE_FIXED_TYPE_WHEN_NOT_IN_GC (cons, Lisp_Cons, ptr); + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (cons, struct Lisp_Cons, ptr); #endif /* ALLOC_NO_POOLS */ } @@ -2902,7 +2846,7 @@ #define UNMARK_float(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_float(ptr) - SWEEP_FIXED_TYPE_BLOCK (float, Lisp_Float); + SWEEP_FIXED_TYPE_BLOCK (float, struct Lisp_Float); } #endif /* LISP_FLOAT_TYPE */ @@ -2912,7 +2856,7 @@ #define UNMARK_symbol(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_symbol(ptr) - SWEEP_FIXED_TYPE_BLOCK (symbol, Lisp_Symbol); + SWEEP_FIXED_TYPE_BLOCK (symbol, struct Lisp_Symbol); } static void @@ -2930,7 +2874,7 @@ #define UNMARK_event(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_event(ptr) - SWEEP_FIXED_TYPE_BLOCK (event, Lisp_Event); + SWEEP_FIXED_TYPE_BLOCK (event, struct Lisp_Event); } static void @@ -2943,18 +2887,22 @@ unchain_marker (tem); \ } while (0) - SWEEP_FIXED_TYPE_BLOCK (marker, Lisp_Marker); + SWEEP_FIXED_TYPE_BLOCK (marker, struct Lisp_Marker); } /* Explicitly free a marker. */ void -free_marker (Lisp_Marker *ptr) +free_marker (struct Lisp_Marker *ptr) { +#ifdef ERROR_CHECK_GC /* Perhaps this will catch freeing an already-freed marker. */ - gc_checking_assert (ptr->lheader.type = lrecord_type_marker); + Lisp_Object temmy; + XSETMARKER (temmy, ptr); + assert (GC_MARKERP (temmy)); +#endif /* ERROR_CHECK_GC */ #ifndef ALLOC_NO_POOLS - FREE_FIXED_TYPE_WHEN_NOT_IN_GC (marker, Lisp_Marker, ptr); + FREE_FIXED_TYPE_WHEN_NOT_IN_GC (marker, struct Lisp_Marker, ptr); #endif /* ALLOC_NO_POOLS */ } @@ -2975,7 +2923,7 @@ { struct string_chars *s_chars = (struct string_chars *) &(sb->string_chars[pos]); - Lisp_String *string; + struct Lisp_String *string; int size; int fullsize; @@ -3026,7 +2974,7 @@ struct string_chars *from_s_chars = (struct string_chars *) &(from_sb->string_chars[from_pos]); struct string_chars *to_s_chars; - Lisp_String *string; + struct Lisp_String *string; int size; int fullsize; @@ -3052,7 +3000,8 @@ size = string_length (string); fullsize = STRING_FULLSIZE (size); - gc_checking_assert (! BIG_STRING_FULLSIZE_P (fullsize)); + if (BIG_STRING_FULLSIZE_P (fullsize)) + abort (); /* Just skip it if it isn't marked. */ if (! MARKED_RECORD_HEADER_P (&(string->lheader))) @@ -3110,11 +3059,11 @@ static int debug_string_purity; static void -debug_string_purity_print (Lisp_String *p) +debug_string_purity_print (struct Lisp_String *p) { Charcount i; Charcount s = string_char_length (p); - stderr_out ("\""); + putc ('\"', stderr); for (i = 0; i < s; i++) { Emchar ch = string_char (p, i); @@ -3136,26 +3085,24 @@ int num_small_used = 0, num_small_bytes = 0, num_bytes = 0; int debug = debug_string_purity; -#define UNMARK_string(ptr) do { \ - Lisp_String *p = (ptr); \ - size_t size = string_length (p); \ - UNMARK_RECORD_HEADER (&(p->lheader)); \ - num_bytes += size; \ - if (!BIG_STRING_SIZE_P (size)) \ - { \ - num_small_bytes += size; \ - num_small_used++; \ - } \ - if (debug) \ - debug_string_purity_print (p); \ - } while (0) -#define ADDITIONAL_FREE_string(ptr) do { \ - size_t size = string_length (ptr); \ - if (BIG_STRING_SIZE_P (size)) \ - xfree (ptr->data); \ - } while (0) - - SWEEP_FIXED_TYPE_BLOCK (string, Lisp_String); +#define UNMARK_string(ptr) \ + do { struct Lisp_String *p = (ptr); \ + int size = string_length (p); \ + UNMARK_RECORD_HEADER (&(p->lheader)); \ + num_bytes += size; \ + if (!BIG_STRING_SIZE_P (size)) \ + { num_small_bytes += size; \ + num_small_used++; \ + } \ + if (debug) debug_string_purity_print (p); \ + } while (0) +#define ADDITIONAL_FREE_string(p) \ + do { int size = string_length (p); \ + if (BIG_STRING_SIZE_P (size)) \ + xfree_1 (CHARS_TO_STRING_CHAR (string_data (p))); \ + } while (0) + + SWEEP_FIXED_TYPE_BLOCK (string, struct Lisp_String); gc_count_num_short_string_in_use = num_small_used; gc_count_string_total_size = num_bytes; @@ -3164,21 +3111,24 @@ /* I hate duplicating all this crap! */ -int +static int marked_p (Lisp_Object obj) { +#ifdef ERROR_CHECK_GC + assert (! (GC_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; */ /* if (PURIFIED (XPNTR (obj))) return 1; */ - if (XTYPE (obj) == Lisp_Type_Record) + if (XGCTYPE (obj) == Lisp_Type_Record) { struct lrecord_header *lheader = XRECORD_LHEADER (obj); - - GC_CHECK_LHEADER_INVARIANTS (lheader); - - return MARKED_RECORD_HEADER_P (lheader); +#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); } return 1; } @@ -3242,9 +3192,6 @@ sweep_events (); -#ifdef PDUMP - pdump_objects_unmark (); -#endif } /* Clearing for disksave. */ @@ -3259,7 +3206,7 @@ results of old evaluation don't look like potential problems. But first we set some notable variables to nil and do one more GC, to turn those strings into garbage. - */ + */ /* Yeah, this list is pretty ad-hoc... */ Vprocess_environment = Qnil; @@ -3295,11 +3242,10 @@ int count = sizeof (scb->string_chars) - scb->pos; assert (count >= 0 && count < STRING_CHARS_BLOCK_SIZE); - if (count != 0) - { - /* from the block's fill ptr to the end */ - memset ((scb->string_chars + scb->pos), 0, count); - } + if (count != 0) { + /* from the block's fill ptr to the end */ + memset ((scb->string_chars + scb->pos), 0, count); + } } } @@ -3396,7 +3342,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, @@ -3447,8 +3393,6 @@ int i; for (i = 0; i < staticidx; i++) mark_object (*(staticvec[i])); - for (i = 0; i < staticidx_nodump; i++) - mark_object (*(staticvec_nodump[i])); } { /* GCPRO() */ @@ -3493,8 +3437,8 @@ } } - mark_redisplay (); - mark_profiling_info (); + mark_redisplay (mark_object); + mark_profiling_info (mark_object); /* OK, now do the after-mark stuff. This is for things that are only marked when something else is marked (e.g. weak hash tables). @@ -3503,18 +3447,18 @@ weak hash table, the former one might get marked. So we have to iterate until nothing more gets marked. */ - while (finish_marking_weak_hash_tables () > 0 || - finish_marking_weak_lists () > 0) + while (finish_marking_weak_hash_tables (marked_p, mark_object) > 0 || + finish_marking_weak_lists (marked_p, mark_object) > 0) ; /* And prune (this needs to be called after everything else has been marked and before we do any sweeping). */ /* #### this is somewhat ad-hoc and should probably be an object method */ - prune_weak_hash_tables (); - prune_weak_lists (); - prune_specifiers (); - prune_syntax_tables (); + prune_weak_hash_tables (marked_p); + prune_weak_lists (marked_p); + prune_specifiers (marked_p); + prune_syntax_tables (marked_p); gc_sweep (); @@ -3548,7 +3492,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); @@ -3574,7 +3518,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 @@ -3608,17 +3552,17 @@ garbage_collect_1 (); - for (i = 0; i < lrecord_type_count; i++) + for (i = 0; i < last_lrecord_type_index_assigned; 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; @@ -3719,7 +3663,6 @@ return make_int (consing_since_gc); } -#if 0 DEFUN ("memory-limit", Fmemory_limit, 0, 0, "", /* Return the address of the last byte Emacs has allocated, divided by 1024. This may be helpful in debugging Emacs's memory usage. @@ -3729,7 +3672,7 @@ { return make_int ((EMACS_INT) sbrk (0) / 1024); } -#endif + int @@ -3883,9 +3826,36 @@ /* Initialization */ void -reinit_alloc_once_early (void) +init_alloc_once_early (void) { + int iii; + + 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); + gc_generation_number[0] = 0; + /* purify_flag 1 is correct even if CANNOT_DUMP. + * loadup.el will set to nil at end. */ + purify_flag = 1; breathing_space = 0; XSETINT (all_bit_vectors, 0); /* Qzero may not be set yet. */ XSETINT (Vgc_message, 0); @@ -3911,11 +3881,7 @@ init_event_alloc (); ignore_malloc_warnings = 0; - - staticidx_nodump = 0; - dumpstructidx = 0; - pdump_wireidx = 0; - + staticidx = 0; consing_since_gc = 0; #if 1 gc_cons_threshold = 500000; /* XEmacs change */ @@ -3944,25 +3910,6 @@ #endif /* ERROR_CHECK_TYPECHECK */ } -void -init_alloc_once_early (void) -{ - reinit_alloc_once_early (); - - { - 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; -} - int pure_bytes_used = 0; void @@ -3992,9 +3939,7 @@ DEFSUBR (Fmake_marker); DEFSUBR (Fpurecopy); DEFSUBR (Fgarbage_collect); -#if 0 DEFSUBR (Fmemory_limit); -#endif DEFSUBR (Fconsing_since_gc); } @@ -4072,7 +4017,8 @@ image instance) in the domain of the selected frame, the mouse pointer will change instead of this message being printed. */ ); - Vgc_message = build_string (gc_default_message); + Vgc_message = make_string_nocopy ((CONST Bufbyte *) gc_default_message, + countof (gc_default_message) - 1); DEFVAR_LISP ("gc-pointer-glyph", &Vgc_pointer_glyph /* Pointer glyph used to indicate that a garbage collection is in progress. diff -r 12e008d41344 -r 697ef44129c6 src/alloc.h --- a/src/alloc.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* Allocations header - Copyright (C) 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_alloc_h_ -#define INCLUDED_alloc_h_ - -struct pdump_dumpstructinfo -{ - void *data; - const struct struct_description *desc; -}; - -struct pdump_dumpopaqueinfo -{ - void *data; - size_t size; -}; - -/* staticpro structures */ -extern Lisp_Object *staticvec[]; -extern int staticidx; - -/* dumpstruct structures */ -extern struct pdump_dumpstructinfo dumpstructvec[]; -extern int dumpstructidx; - -/* dumpopaque structures */ -extern struct pdump_dumpopaqueinfo dumpopaquevec[]; -extern int dumpopaqueidx; - -/* pdump_wire structures */ -extern Lisp_Object *pdump_wirevec[]; -extern int pdump_wireidx; - -/* pdump_wire_list structures */ -extern Lisp_Object *pdump_wirevec_list[]; -extern int pdump_wireidx_list; - -#endif /* INCLUDED_alloc_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/alloca.c --- a/src/alloca.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/alloca.c Mon Aug 13 11:20:41 2007 +0200 @@ -86,7 +86,7 @@ # endif #endif -#ifndef NULL +#ifndef WINDOWSNT #define NULL 0 #endif @@ -103,7 +103,7 @@ #ifndef emacs #define malloc xmalloc #endif -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT extern pointer malloc (); #else extern void *malloc(); diff -r 12e008d41344 -r 697ef44129c6 src/backtrace.h --- a/src/backtrace.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/backtrace.h Mon Aug 13 11:20:41 2007 +0200 @@ -30,8 +30,8 @@ Mly (probably) or JWZ: Some changes. */ -#ifndef INCLUDED_backtrace_h_ -#define INCLUDED_backtrace_h_ +#ifndef _XEMACS_BACKTRACE_H_ +#define _XEMACS_BACKTRACE_H_ #include <setjmp.h> @@ -158,7 +158,7 @@ Lisp_Object SB_symbol = (symbol_object); \ Lisp_Object SB_newval = (value_object); \ Lisp_Object SB_oldval; \ - Lisp_Symbol *SB_sym; \ + struct Lisp_Symbol *SB_sym; \ \ SPECPDL_RESERVE (1); \ \ @@ -168,7 +168,7 @@ \ if (!SYMBOL_VALUE_MAGIC_P (SB_oldval) || UNBOUNDP (SB_oldval)) \ { \ - /* #### the following test will go away when we have a constant \ + /* ### the following test will go away when we have a constant \ symbol magic object */ \ if (EQ (SB_symbol, Qnil) || \ EQ (SB_symbol, Qt) || \ @@ -197,7 +197,7 @@ #define SPECBIND_FAST_UNSAFE(symbol_object, value_object) do { \ Lisp_Object SFU_symbol = (symbol_object); \ Lisp_Object SFU_newval = (value_object); \ - Lisp_Symbol *SFU_sym = XSYMBOL (SFU_symbol); \ + struct Lisp_Symbol *SFU_sym = XSYMBOL (SFU_symbol); \ Lisp_Object SFU_oldval = SFU_sym->value; \ if (!SYMBOL_VALUE_MAGIC_P (SFU_oldval) || UNBOUNDP (SFU_oldval)) \ { \ @@ -230,7 +230,7 @@ int UNBIND_TO_count = (count); \ while (specpdl_depth_counter != UNBIND_TO_count) \ { \ - Lisp_Symbol *sym; \ + struct Lisp_Symbol *sym; \ --specpdl_ptr; \ --specpdl_depth_counter; \ \ @@ -255,7 +255,7 @@ int UNBIND_TO_count = (count); \ while (specpdl_depth_counter != UNBIND_TO_count) \ { \ - Lisp_Symbol *sym; \ + struct Lisp_Symbol *sym; \ --specpdl_ptr; \ --specpdl_depth_counter; \ \ @@ -288,7 +288,7 @@ int UNBIND_TO_count = (count); \ while (specpdl_depth_counter != UNBIND_TO_count) \ { \ - Lisp_Symbol *sym; \ + struct Lisp_Symbol *sym; \ --specpdl_ptr; \ --specpdl_depth_counter; \ \ @@ -315,7 +315,7 @@ #define FSET_FAST_UNSAFE(sym, newval) do { \ Lisp_Object FFU_sym = (sym); \ Lisp_Object FFU_newval = (newval); \ - Lisp_Symbol *FFU_symbol = XSYMBOL (FFU_sym); \ + struct Lisp_Symbol *FFU_symbol = XSYMBOL (FFU_sym); \ Lisp_Object FFU_oldval = FFU_symbol->value; \ if (!SYMBOL_VALUE_MAGIC_P (FFU_oldval) || UNBOUNDP (FFU_oldval)) \ FFU_symbol->value = FFU_newval; \ @@ -323,4 +323,4 @@ Fset (FFU_sym, FFU_newval); \ } while (0) -#endif /* INCLUDED_backtrace_h_ */ +#endif /* _XEMACS_BACKTRACE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/balloon-x.c --- a/src/balloon-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/balloon-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -29,10 +29,10 @@ #include "balloon_help.h" -/* #### start of hack */ +/* ### 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; @@ -99,7 +99,7 @@ } } -/* #### end of hack */ +/* ### end of hack */ DEFUN ("show-balloon-help", Fshow_balloon_help, 1, 1, 0, /* Show balloon help. diff -r 12e008d41344 -r 697ef44129c6 src/balloon_help.c --- a/src/balloon_help.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/balloon_help.c Mon Aug 13 11:20:41 2007 +0200 @@ -44,7 +44,7 @@ #include "balloon_help.h" -#ifndef max +#ifndef WINDOWSNT #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 12e008d41344 -r 697ef44129c6 src/balloon_help.h --- a/src/balloon_help.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/balloon_help.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_balloon_help_h_ -#define INCLUDED_balloon_help_h_ +#ifndef BALLOON_HELP_H +#define BALLOON_HELP_H #include "xintrinsic.h" @@ -29,8 +29,8 @@ 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); -#endif /* INCLUDED_balloon_help_h_ */ +#endif /* BALLOON_HELP_H */ diff -r 12e008d41344 -r 697ef44129c6 src/bitmaps.h --- a/src/bitmaps.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/bitmaps.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ JWZ (?): 1992?. */ -#ifndef INCLUDED_bitmaps_h_ -#define INCLUDED_bitmaps_h_ +#ifndef _XEMACS_BITMAPS_H_ +#define _XEMACS_BITMAPS_H_ #if 0 /* A gnu, like on the back of the emacs manual, for icons. */ @@ -164,4 +164,4 @@ 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00}; #endif -#endif /* INCLUDED_bitmaps_h_ */ +#endif /* _XEMACS_BITMAPS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/blocktype.h --- a/src/blocktype.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/blocktype.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,8 +26,8 @@ Ben Wing: December 1994, for 19.12. */ -#ifndef INCLUDED_blocktype_h_ -#define INCLUDED_blocktype_h_ +#ifndef _XEMACS_BLOCKTYPE_H_ +#define _XEMACS_BLOCKTYPE_H_ #define Blocktype_declare(type) \ type *free; \ @@ -42,4 +42,4 @@ (structype *) Blocktype_newf (sizeof(*(((structype *) NULL)->free))) #define Blocktype_alloc(b) (Blocktype_allocf (b), (b)->tempel) -#endif /* INCLUDED_blocktype_h_ */ +#endif /* _XEMACS_BLOCKTYPE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/broken-sun.h --- a/src/broken-sun.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/broken-sun.h Mon Aug 13 11:20:41 2007 +0200 @@ -25,8 +25,8 @@ /* Sun's standard and GCC's header files leave out prototypes for all sorts of functions. */ -#ifndef INCLUDED_broken_sun_h_ -#define INCLUDED_broken_sun_h_ +#ifndef _XEMACS_BROKEN_SUN_H_ +#define _XEMACS_BROKEN_SUN_H_ #ifdef __GNUC__ #include <stdlib.h> @@ -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 <stdio.h> /* 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 </usr/include/sys/types.h> 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,10 +158,10 @@ /*********************** 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); #endif /* __GNUC__ */ -#endif /* INCLUDED_broken_sun_h_ */ +#endif /* _XEMACS_BROKEN_SUN_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/buffer.c --- a/src/buffer.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/buffer.c Mon Aug 13 11:20:41 2007 +0200 @@ -74,17 +74,12 @@ #include "elhash.h" #include "extents.h" #include "faces.h" -#ifdef FILE_CODING -#include "file-coding.h" -#endif #include "frame.h" #include "insdel.h" -#include "lstream.h" #include "process.h" /* for kill_buffer_processes */ #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 */ @@ -101,7 +96,6 @@ Setting the default value also goes through the alist of buffers and stores into each buffer that does not say it has a local value. */ Lisp_Object Vbuffer_defaults; -static void *buffer_defaults_saved_slots; /* This structure marks which slots in a buffer have corresponding default values in Vbuffer_defaults. @@ -139,7 +133,6 @@ /* This structure holds the names of symbols whose values may be buffer-local. It is indexed and accessed in the same way as the above. */ static Lisp_Object Vbuffer_local_symbols; -static void *buffer_local_symbols_saved_slots; /* Alist of all buffer names vs the buffers. */ /* This used to be a variable, but is no longer, @@ -196,6 +189,7 @@ Lisp_Object Qdefault_directory; Lisp_Object Qkill_buffer_hook; +Lisp_Object Qbuffer_file_name, Qbuffer_undo_list; Lisp_Object Qrename_auto_save_file; @@ -226,7 +220,7 @@ } static Lisp_Object -mark_buffer (Lisp_Object obj) +mark_buffer (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct buffer *buf = XBUFFER (obj); @@ -235,13 +229,13 @@ undo_threshold, undo_high_threshold); -#define MARKED_SLOT(x) mark_object (buf->x) +#define MARKED_SLOT(x) ((void) (markobj (buf->x))); #include "bufslots.h" #undef MARKED_SLOT - mark_object (buf->extent_info); + markobj (buf->extent_info); if (buf->text) - mark_object (buf->text->line_number_cache); + markobj (buf->text->line_number_cache); /* Don't mark normally through the children slot. (Actually, in this case, it doesn't matter.) */ @@ -282,7 +276,7 @@ because all buffers have `kill-buffer' applied to them before they disappear, and the children removal happens then. */ DEFINE_LRECORD_IMPLEMENTATION ("buffer", buffer, - mark_buffer, print_buffer, 0, 0, 0, 0, + mark_buffer, print_buffer, 0, 0, 0, struct buffer); DEFUN ("bufferp", Fbufferp, 1, 1, 0, /* @@ -567,7 +561,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; @@ -1027,7 +1021,6 @@ /* 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); @@ -1187,7 +1180,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)) @@ -1221,13 +1214,15 @@ /* Then run the hooks. */ run_hook (Qkill_buffer_hook); - - /* 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); - +#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 */ unbind_to (speccount, Qnil); UNGCPRO; b = XBUFFER (buf); /* Hypothetical relocating GC. */ @@ -1303,13 +1298,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. */ @@ -1411,7 +1406,6 @@ XCDR (prev) = XCDR (XCDR (prev)); XCDR (lynk) = f->buffer_alist; f->buffer_alist = lynk; - return Qnil; } @@ -1480,6 +1474,20 @@ 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 @@ -1611,8 +1619,6 @@ If BUFFER is nil or omitted, bury the current buffer. Also, if BUFFER is nil or omitted, remove the current buffer from the selected window if it is displayed there. -Because of this, you may need to specify (current-buffer) as -BUFFER when calling from minibuffer. If BEFORE is non-nil, it specifies a buffer before which BUFFER will be placed, instead of being placed at the end. */ @@ -1792,359 +1798,9 @@ #endif /* MEMORY_USAGE_STATS */ - -/************************************************************************/ -/* Implement TO_EXTERNAL_FORMAT, TO_INTERNAL_FORMAT */ -/************************************************************************/ - -/* This implementation should probably be elsewhere, but it can't be - in file-coding.c since that file is only available if FILE_CODING - is defined. */ -#ifdef FILE_CODING -static int -coding_system_is_binary (Lisp_Object coding_system) -{ - Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system); - return - (CODING_SYSTEM_TYPE (cs) == CODESYS_NO_CONVERSION && - CODING_SYSTEM_EOL_TYPE (cs) == EOL_LF && - EQ (CODING_SYSTEM_POST_READ_CONVERSION (cs), Qnil) && - EQ (CODING_SYSTEM_PRE_WRITE_CONVERSION (cs), Qnil)); -} -#else -#define coding_system_is_binary(coding_system) 1 -#endif - -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; - -static Lisp_Object -dfc_convert_to_external_format_reset_in_use (Lisp_Object value) -{ - dfc_convert_to_external_format_in_use = XINT (value); - return Qnil; -} - -static Lisp_Object -dfc_convert_to_internal_format_reset_in_use (Lisp_Object value) -{ - dfc_convert_to_internal_format_in_use = XINT (value); - return Qnil; -} - -void -dfc_convert_to_external_format (dfc_conversion_type source_type, - dfc_conversion_data *source, -#ifdef FILE_CODING - Lisp_Object coding_system, -#endif - dfc_conversion_type sink_type, - dfc_conversion_data *sink) -{ - int count = specpdl_depth (); - Extbyte_dynarr *conversion_out_dynarr; - - type_checking_assert - (((source_type == DFC_TYPE_DATA) || - (source_type == DFC_TYPE_LISP_LSTREAM && LSTREAMP (source->lisp_object)) || - (source_type == DFC_TYPE_LISP_STRING && STRINGP (source->lisp_object))) - && - ((sink_type == DFC_TYPE_DATA) || - (sink_type == DFC_TYPE_LISP_LSTREAM && LSTREAMP (source->lisp_object)))); - - record_unwind_protect (dfc_convert_to_external_format_reset_in_use, - 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 - - /* 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 - garbage collection, and this could be problematic if the source - is a lisp string. */ - if (source_type != DFC_TYPE_LISP_LSTREAM && - sink_type != DFC_TYPE_LISP_LSTREAM && - coding_system_is_binary (coding_system)) - { - const Bufbyte *ptr; - Bytecount len; - - if (source_type == DFC_TYPE_LISP_STRING) - { - ptr = XSTRING_DATA (source->lisp_object); - len = XSTRING_LENGTH (source->lisp_object); - } - else - { - ptr = (Bufbyte *) source->data.ptr; - len = source->data.len; - } - -#ifdef MULE - { - const Bufbyte *end; - for (end = ptr + len; ptr < end;) - { - Bufbyte c = - (BYTE_ASCII_P (*ptr)) ? *ptr : - (*ptr == LEADING_BYTE_CONTROL_1) ? (*(ptr+1) - 0x20) : - (*ptr == LEADING_BYTE_LATIN_ISO8859_1) ? (*(ptr+1)) : - '~'; - - Dynarr_add (conversion_out_dynarr, (Extbyte) c); - INC_CHARPTR (ptr); - } - bufpos_checking_assert (ptr == end); - } -#else - Dynarr_add_many (conversion_out_dynarr, ptr, len); -#endif - - } - else - { - Lisp_Object streams_to_delete[3]; - int delete_count = 0; - Lisp_Object instream, outstream; - Lstream *reader, *writer; - struct gcpro gcpro1, gcpro2; - - if (source_type == DFC_TYPE_LISP_LSTREAM) - instream = source->lisp_object; - else if (source_type == DFC_TYPE_DATA) - streams_to_delete[delete_count++] = instream = - make_fixed_buffer_input_stream (source->data.ptr, source->data.len); - else - { - type_checking_assert (source_type == DFC_TYPE_LISP_STRING); - streams_to_delete[delete_count++] = instream = - make_lisp_string_input_stream (source->lisp_object, 0, -1); - } - - if (sink_type == DFC_TYPE_LISP_LSTREAM) - outstream = sink->lisp_object; - else - { - type_checking_assert (sink_type == DFC_TYPE_DATA); - streams_to_delete[delete_count++] = outstream = - make_dynarr_output_stream - ((unsigned_char_dynarr *) conversion_out_dynarr); - } - -#ifdef FILE_CODING - streams_to_delete[delete_count++] = outstream = - make_encoding_output_stream (XLSTREAM (outstream), coding_system); -#endif - - reader = XLSTREAM (instream); - writer = XLSTREAM (outstream); - /* decoding_stream will gc-protect outstream */ - GCPRO2 (instream, outstream); - - while (1) - { - ssize_t size_in_bytes; - char tempbuf[1024]; /* some random amount */ - - size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf)); - - if (size_in_bytes == 0) - break; - else if (size_in_bytes < 0) - error ("Error converting to external format"); - - size_in_bytes = Lstream_write (writer, tempbuf, size_in_bytes); - - if (size_in_bytes <= 0) - error ("Error converting to external format"); - } - - /* Closing writer will close any stream at the other end of writer. */ - Lstream_close (writer); - Lstream_close (reader); - UNGCPRO; - - /* The idea is that this function will create no garbage. */ - while (delete_count) - Lstream_delete (XLSTREAM (streams_to_delete [--delete_count])); - } - - unbind_to (count, Qnil); - - if (sink_type != DFC_TYPE_LISP_LSTREAM) - { - sink->data.len = Dynarr_length (conversion_out_dynarr); - Dynarr_add (conversion_out_dynarr, 0); - sink->data.ptr = Dynarr_atp (conversion_out_dynarr, 0); - } -} - -void -dfc_convert_to_internal_format (dfc_conversion_type source_type, - dfc_conversion_data *source, -#ifdef FILE_CODING - Lisp_Object coding_system, -#endif - dfc_conversion_type sink_type, - dfc_conversion_data *sink) -{ - int count = specpdl_depth (); - Bufbyte_dynarr *conversion_in_dynarr; - - type_checking_assert - ((source_type == DFC_TYPE_DATA || - source_type == DFC_TYPE_LISP_LSTREAM) - && - (sink_type == DFC_TYPE_DATA || - sink_type == DFC_TYPE_LISP_LSTREAM)); - - record_unwind_protect (dfc_convert_to_internal_format_reset_in_use, - 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 - - if (source_type != DFC_TYPE_LISP_LSTREAM && - sink_type != DFC_TYPE_LISP_LSTREAM && - coding_system_is_binary (coding_system)) - { -#ifdef MULE - const Bufbyte *ptr = (const Bufbyte *) source->data.ptr; - Bytecount len = source->data.len; - const Bufbyte *end = ptr + len; - - for (; ptr < end; ptr++) - { - Extbyte c = *ptr; - - if (BYTE_ASCII_P (c)) - Dynarr_add (conversion_in_dynarr, c); - else if (BYTE_C1_P (c)) - { - Dynarr_add (conversion_in_dynarr, LEADING_BYTE_CONTROL_1); - Dynarr_add (conversion_in_dynarr, c + 0x20); - } - else - { - Dynarr_add (conversion_in_dynarr, LEADING_BYTE_LATIN_ISO8859_1); - Dynarr_add (conversion_in_dynarr, c); - } - } -#else - Dynarr_add_many (conversion_in_dynarr, source->data.ptr, source->data.len); -#endif - } - else - { - Lisp_Object streams_to_delete[3]; - int delete_count = 0; - Lisp_Object instream, outstream; - Lstream *reader, *writer; - struct gcpro gcpro1, gcpro2; - - if (source_type == DFC_TYPE_LISP_LSTREAM) - instream = source->lisp_object; - else - { - type_checking_assert (source_type == DFC_TYPE_DATA); - streams_to_delete[delete_count++] = instream = - make_fixed_buffer_input_stream (source->data.ptr, source->data.len); - } - - if (sink_type == DFC_TYPE_LISP_LSTREAM) - outstream = sink->lisp_object; - else - { - type_checking_assert (sink_type == DFC_TYPE_DATA); - streams_to_delete[delete_count++] = outstream = - make_dynarr_output_stream - ((unsigned_char_dynarr *) conversion_in_dynarr); - } - -#ifdef FILE_CODING - streams_to_delete[delete_count++] = outstream = - make_decoding_output_stream (XLSTREAM (outstream), coding_system); -#endif - - reader = XLSTREAM (instream); - writer = XLSTREAM (outstream); - /* outstream will gc-protect its sink stream, if necessary */ - GCPRO2 (instream, outstream); - - while (1) - { - ssize_t size_in_bytes; - char tempbuf[1024]; /* some random amount */ - - size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf)); - - if (size_in_bytes == 0) - break; - else if (size_in_bytes < 0) - error ("Error converting to internal format"); - - size_in_bytes = Lstream_write (writer, tempbuf, size_in_bytes); - - if (size_in_bytes <= 0) - error ("Error converting to internal format"); - } - - /* Closing writer will close any stream at the other end of writer. */ - Lstream_close (writer); - Lstream_close (reader); - UNGCPRO; - - /* The idea is that this function will create no garbage. */ - while (delete_count) - Lstream_delete (XLSTREAM (streams_to_delete [--delete_count])); - } - - unbind_to (count, Qnil); - - if (sink_type != DFC_TYPE_LISP_LSTREAM) - { - sink->data.len = Dynarr_length (conversion_in_dynarr); - Dynarr_add (conversion_in_dynarr, 0); /* remember to zero-terminate! */ - sink->data.ptr = Dynarr_atp (conversion_in_dynarr, 0); - } -} - - 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"); @@ -2160,6 +1816,8 @@ defsymbol (&Qbefore_change_function, "before-change-function"); defsymbol (&Qafter_change_function, "after-change-function"); + defsymbol (&Qbuffer_file_name, "buffer-file-name"); + defsymbol (&Qbuffer_undo_list, "buffer-undo-list"); defsymbol (&Qdefault_directory, "default-directory"); defsymbol (&Qget_file_buffer, "get-file-buffer"); @@ -2212,31 +1870,20 @@ "Attempt to modify a protected field", Qerror); } -void -reinit_vars_of_buffer (void) -{ - 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; - current_buffer = 0; -} - /* initialize the buffer routines */ void vars_of_buffer (void) { /* This function can GC */ - reinit_vars_of_buffer (); - staticpro (&QSFundamental); staticpro (&QSscratch); - - QSFundamental = build_string ("Fundamental"); - QSscratch = build_string (DEFER_GETTEXT ("*scratch*")); + staticpro (&Vbuffer_alist); + + QSFundamental = Fpurecopy (build_string ("Fundamental")); + QSscratch = Fpurecopy (build_string (DEFER_GETTEXT ("*scratch*"))); + + Vbuffer_alist = Qnil; + current_buffer = 0; DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook /* List of hooks to be run before killing local variables in a buffer. @@ -2371,27 +2018,15 @@ /* 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 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 \ - }; \ - \ + 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 }; \ { \ int offset = ((char *)symbol_value_forward_forward (&I_hate_C) - \ (char *)&buffer_local_flags); \ @@ -2428,21 +2063,21 @@ b->indirect_children = Qnil; b->own_text.line_number_cache = Qnil; -#define MARKED_SLOT(x) b->x = zap +#define MARKED_SLOT(x) b->x = (zap); #include "bufslots.h" #undef MARKED_SLOT } -static void -common_init_complex_vars_of_buffer (void) +void +complex_vars_of_buffer (void) { /* Make sure all markable slots in buffer_defaults are initialized reasonably, so mark_buffer won't choke. */ struct buffer *defs = alloc_lcrecord_type (struct buffer, &lrecord_buffer); struct buffer *syms = alloc_lcrecord_type (struct buffer, &lrecord_buffer); - staticpro_nodump (&Vbuffer_defaults); - staticpro_nodump (&Vbuffer_local_symbols); + staticpro (&Vbuffer_defaults); + staticpro (&Vbuffer_local_symbols); XSETBUFFER (Vbuffer_defaults, defs); XSETBUFFER (Vbuffer_local_symbols, syms); @@ -2558,56 +2193,10 @@ buffer_local_flags.buffer_file_coding_system = make_int (1<<14); #endif - /* #### Warning: 1<<31 is the largest number currently allowable + /* #### Warning: 1<<28 is the largest number currently allowable due to the XINT() handling of this value. With some rearrangement you can get 3 more bits. */ } -} - -#define BUFFER_SLOTS_SIZE (offsetof (struct buffer, BUFFER_SLOTS_LAST_NAME) - offsetof (struct buffer, BUFFER_SLOTS_FIRST_NAME) + sizeof (Lisp_Object)) -#define BUFFER_SLOTS_COUNT (BUFFER_SLOTS_SIZE / sizeof (Lisp_Object)) - -void -reinit_complex_vars_of_buffer (void) -{ - struct buffer *defs, *syms; - - common_init_complex_vars_of_buffer (); - - defs = XBUFFER (Vbuffer_defaults); - syms = XBUFFER (Vbuffer_local_symbols); - memcpy (&defs->BUFFER_SLOTS_FIRST_NAME, - buffer_defaults_saved_slots, - BUFFER_SLOTS_SIZE); - memcpy (&syms->BUFFER_SLOTS_FIRST_NAME, - buffer_local_symbols_saved_slots, - BUFFER_SLOTS_SIZE); -} - - -static const struct lrecord_description buffer_slots_description_1[] = { - { XD_LISP_OBJECT_ARRAY, 0, BUFFER_SLOTS_COUNT }, - { XD_END } -}; - -static const struct struct_description buffer_slots_description = { - BUFFER_SLOTS_SIZE, - buffer_slots_description_1 -}; - -void -complex_vars_of_buffer (void) -{ - struct buffer *defs, *syms; - - common_init_complex_vars_of_buffer (); - - defs = XBUFFER (Vbuffer_defaults); - syms = XBUFFER (Vbuffer_local_symbols); - buffer_defaults_saved_slots = &defs->BUFFER_SLOTS_FIRST_NAME; - buffer_local_symbols_saved_slots = &syms->BUFFER_SLOTS_FIRST_NAME; - dumpstruct (&buffer_defaults_saved_slots, &buffer_slots_description); - dumpstruct (&buffer_local_symbols_saved_slots, &buffer_slots_description); DEFVAR_BUFFER_DEFAULTS ("default-modeline-format", modeline_format /* Default value of `modeline-format' for buffers that don't override it. @@ -2660,31 +2249,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, symbol, glyph, generic specifier, list or cons cell. -For a symbol, its value is processed (but it is ignored if t or nil). +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). 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.) 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. + 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. 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) @@ -3099,49 +2688,39 @@ } } -#ifndef WIN32_NATIVE /* Is PWD another name for `.' ? */ static int -directory_is_current_directory (Extbyte *pwd) +directory_is_current_directory (char *pwd) { Bufbyte *pwd_internal; - Bytecount pwd_internal_len; struct stat dotstat, pwdstat; - TO_INTERNAL_FORMAT (DATA, (pwd, strlen ((char *)pwd) + 1), - ALLOCA, (pwd_internal, pwd_internal_len), - Qfile_name); + GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA (pwd, pwd_internal); return (IS_DIRECTORY_SEP (*pwd_internal) && stat ((char *) pwd_internal, &pwdstat) == 0 && stat (".", &dotstat) == 0 && dotstat.st_ino == pwdstat.st_ino && dotstat.st_dev == pwdstat.st_dev - && pwd_internal_len < MAXPATHLEN); + && (int) strlen ((char *) pwd_internal) < MAXPATHLEN); } -#endif void init_initial_directory (void) { /* This function can GC */ -#ifndef WIN32_NATIVE - Extbyte *pwd; -#endif + char *pwd; 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 + if ((pwd = getenv ("PWD")) != NULL && directory_is_current_directory (pwd)) - strcpy (initial_directory, (char *) pwd); - else -#endif - if (getcwd (initial_directory, MAXPATHLEN) == NULL) - fatal ("`getcwd' failed: %s\n", strerror (errno)); + strcpy (initial_directory, pwd); + else 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 @@ -3156,8 +2735,16 @@ } } -#ifdef CORRECT_DIR_SEPS - CORRECT_DIR_SEPS (initial_directory); + /* 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); #endif } @@ -3169,7 +2756,7 @@ Fset_buffer (Fget_buffer_create (QSscratch)); current_buffer->directory = - build_ext_string (initial_directory, Qfile_name); + build_ext_string (initial_directory, FORMAT_FILENAME); #if 0 /* FSFmacs */ /* #### is this correct? */ diff -r 12e008d41344 -r 697ef44129c6 src/buffer.h --- a/src/buffer.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/buffer.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,8 +29,8 @@ Ben Wing: almost completely rewritten for Mule, 19.12. */ -#ifndef INCLUDED_buffer_h_ -#define INCLUDED_buffer_h_ +#ifndef _XEMACS_BUFFER_H_ +#define _XEMACS_BUFFER_H_ #ifdef MULE #include "mule-charset.h" @@ -166,7 +166,7 @@ /* The markers that refer to this buffer. This is actually a single marker -- successive elements in its marker `chain' are the other markers referring to this buffer */ - Lisp_Marker *markers; + struct Lisp_Marker *markers; /* The buffer's extent info. This is its own type, an extent-info object (done this way for ease in marking / finalizing). */ @@ -198,7 +198,7 @@ int modtime; /* the value of text->modiff at the last auto-save. */ - long auto_save_modified; + int auto_save_modified; /* The time at which we detected a failure to auto-save, Or -1 if we didn't have a failure. */ @@ -219,6 +219,7 @@ #define XBUFFER(x) XRECORD (x, buffer, struct buffer) #define XSETBUFFER(x, p) XSETRECORD (x, p, buffer) #define BUFFERP(x) RECORDP (x, buffer) +#define GC_BUFFERP(x) GC_RECORDP (x, buffer) #define CHECK_BUFFER(x) CHECK_RECORD (x, buffer) #define CONCHECK_BUFFER(x) CONCHECK_RECORD (x, buffer) @@ -408,9 +409,6 @@ #define REAL_INC_CHARPTR(ptr) \ ((void) ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr)))) -#define REAL_INC_CHARBYTIND(ptr,pos) \ - (pos += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr))) - #define REAL_DEC_CHARPTR(ptr) do { \ (ptr)--; \ } while (!VALID_CHARPTR_P (ptr)) @@ -421,14 +419,9 @@ REAL_INC_CHARPTR (ptr); \ } while (0) -#define INC_CHARBYTIND(ptr,pos) do { \ - ASSERT_VALID_CHARPTR (ptr); \ - REAL_INC_CHARBYTIND (ptr,pos); \ -} 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)); \ @@ -436,7 +429,6 @@ } while (0) #else /* ! ERROR_CHECK_BUFPOS */ -#define INC_CHARBYTIND(ptr,pos) REAL_INC_CHARBYTIND (ptr,pos) #define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr) #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr) #endif /* ! ERROR_CHECK_BUFPOS */ @@ -470,10 +462,9 @@ /* section of internally-formatted text */ /* -------------------------------------------------------------- */ -INLINE_HEADER const Bufbyte * -charptr_n_addr (const Bufbyte *ptr, Charcount offset); -INLINE_HEADER const Bufbyte * -charptr_n_addr (const Bufbyte *ptr, Charcount offset) +INLINE CONST Bufbyte *charptr_n_addr (CONST Bufbyte *ptr, Charcount offset); +INLINE CONST Bufbyte * +charptr_n_addr (CONST Bufbyte *ptr, Charcount offset) { return ptr + charcount_to_bytecount (ptr, offset); } @@ -488,21 +479,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_HEADER Emchar charptr_emchar (const Bufbyte *ptr); -INLINE_HEADER Emchar -charptr_emchar (const Bufbyte *ptr) +INLINE Emchar charptr_emchar (CONST Bufbyte *ptr); +INLINE Emchar +charptr_emchar (CONST Bufbyte *ptr) { return BYTE_ASCII_P (*ptr) ? simple_charptr_emchar (ptr) : non_ascii_charptr_emchar (ptr); } -INLINE_HEADER Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x); -INLINE_HEADER Bytecount +INLINE Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x); +INLINE Bytecount set_charptr_emchar (Bufbyte *ptr, Emchar x) { return !CHAR_MULTIBYTE_P (x) ? @@ -510,10 +501,9 @@ non_ascii_set_charptr_emchar (ptr, x); } -INLINE_HEADER Bytecount -charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); -INLINE_HEADER Bytecount -charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2) +INLINE Bytecount charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2); +INLINE Bytecount +charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2) { return BYTE_ASCII_P (*ptr) ? simple_charptr_copy_char (ptr, ptr2) : @@ -540,8 +530,8 @@ int non_ascii_valid_char_p (Emchar ch); -INLINE_HEADER int valid_char_p (Emchar ch); -INLINE_HEADER int +INLINE int valid_char_p (Emchar ch); +INLINE int valid_char_p (Emchar ch) { return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch); @@ -559,8 +549,8 @@ #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); -INLINE_HEADER Emchar +INLINE Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); +INLINE Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj) { assert (CHAR_OR_CHAR_INTP (obj)); @@ -569,7 +559,7 @@ #else -#define XCHAR_OR_CHAR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj)) +#define XCHAR_OR_CHAR_INT(obj) (CHARP ((obj)) ? XCHAR ((obj)) : XINT ((obj))) #endif @@ -624,25 +614,25 @@ /*----------------------------------------------------------------------*/ /* Convert the address of a byte in the buffer into a position. */ -INLINE_HEADER Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); -INLINE_HEADER Bytind +INLINE Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr); +INLINE Bytind BI_BUF_PTR_BYTE_POS (struct buffer *buf, Bufbyte *ptr) { - return (ptr - buf->text->beg + 1 - - ((ptr - buf->text->beg + 1) > buf->text->gpt - ? buf->text->gap_size : 0)); + return ((ptr) - (buf)->text->beg + 1 + - ((ptr - (buf)->text->beg + 1) > (buf)->text->gpt + ? (buf)->text->gap_size : 0)); } #define BUF_PTR_BYTE_POS(buf, ptr) \ bytind_to_bufpos (buf, BI_BUF_PTR_BYTE_POS (buf, ptr)) /* Address of byte at position POS in buffer. */ -INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); -INLINE_HEADER Bufbyte * +INLINE Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos); +INLINE Bufbyte * BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos) { - return (buf->text->beg + - ((pos >= buf->text->gpt ? (pos + buf->text->gap_size) : pos) + return ((buf)->text->beg + + ((pos >= (buf)->text->gpt ? (pos + (buf)->text->gap_size) : pos) - 1)); } @@ -650,12 +640,12 @@ BI_BUF_BYTE_ADDRESS (buf, bufpos_to_bytind (buf, pos)) /* Address of byte before position POS in buffer. */ -INLINE_HEADER Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); -INLINE_HEADER Bufbyte * +INLINE Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos); +INLINE Bufbyte * BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos) { - return (buf->text->beg + - ((pos > buf->text->gpt ? (pos + buf->text->gap_size) : pos) + return ((buf)->text->beg + + ((pos > (buf)->text->gpt ? (pos + (buf)->text->gap_size) : pos) - 2)); } @@ -666,32 +656,32 @@ /* Converting between byte indices and memory indices */ /*----------------------------------------------------------------------*/ -INLINE_HEADER int valid_memind_p (struct buffer *buf, Memind x); -INLINE_HEADER int +INLINE int valid_memind_p (struct buffer *buf, Memind x); +INLINE int valid_memind_p (struct buffer *buf, Memind x) { - return ((x >= 1 && x <= (Memind) buf->text->gpt) || - (x > (Memind) (buf->text->gpt + buf->text->gap_size) && - x <= (Memind) (buf->text->z + buf->text->gap_size))); + return ((x >= 1 && x <= (Memind) (buf)->text->gpt) || + (x > (Memind) ((buf)->text->gpt + (buf)->text->gap_size) && + x <= (Memind) ((buf)->text->z + (buf)->text->gap_size))); } -INLINE_HEADER Memind bytind_to_memind (struct buffer *buf, Bytind x); -INLINE_HEADER Memind +INLINE Memind bytind_to_memind (struct buffer *buf, Bytind x); +INLINE Memind bytind_to_memind (struct buffer *buf, Bytind x) { - return (Memind) ((x > buf->text->gpt) ? (x + buf->text->gap_size) : x); + return (Memind) ((x > (buf)->text->gpt) ? (x + (buf)->text->gap_size) : x); } -INLINE_HEADER Bytind memind_to_bytind (struct buffer *buf, Memind x); -INLINE_HEADER Bytind +INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x); +INLINE Bytind memind_to_bytind (struct buffer *buf, Memind x) { #ifdef ERROR_CHECK_BUFPOS assert (valid_memind_p (buf, x)); #endif - return (Bytind) ((x > (Memind) buf->text->gpt) ? - x - buf->text->gap_size : + return (Bytind) ((x > (Memind) (buf)->text->gpt) ? + x - (buf)->text->gap_size : x); } @@ -904,16 +894,16 @@ VALIDATE_BYTIND_BACKWARD (buf, x); \ } while (0) -INLINE_HEADER Bytind prev_bytind (struct buffer *buf, Bytind x); -INLINE_HEADER Bytind +INLINE Bytind prev_bytind (struct buffer *buf, Bytind x); +INLINE Bytind prev_bytind (struct buffer *buf, Bytind x) { DEC_BYTIND (buf, x); return x; } -INLINE_HEADER Bytind next_bytind (struct buffer *buf, Bytind x); -INLINE_HEADER Bytind +INLINE Bytind next_bytind (struct buffer *buf, Bytind x); +INLINE Bytind next_bytind (struct buffer *buf, Bytind x) { INC_BYTIND (buf, x); @@ -975,8 +965,8 @@ extern short three_to_one_table[]; -INLINE_HEADER int real_bufpos_to_bytind (struct buffer *buf, Bufpos x); -INLINE_HEADER int +INLINE int real_bufpos_to_bytind (struct buffer *buf, Bufpos x); +INLINE int real_bufpos_to_bytind (struct buffer *buf, Bufpos x) { if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax) @@ -987,8 +977,8 @@ return bufpos_to_bytind_func (buf, x); } -INLINE_HEADER int real_bytind_to_bufpos (struct buffer *buf, Bytind x); -INLINE_HEADER int +INLINE int real_bytind_to_bufpos (struct buffer *buf, Bytind x); +INLINE int real_bytind_to_bufpos (struct buffer *buf, Bytind x) { if (x >= buf->text->mule_bytmin && x <= buf->text->mule_bytmax) @@ -1040,277 +1030,305 @@ #define BUF_CHARPTR_COPY_CHAR(buf, pos, str) \ BI_BUF_CHARPTR_COPY_CHAR (buf, bufpos_to_bytind (buf, pos), str) + + /************************************************************************/ -/* */ -/* Converting between internal and external format */ -/* */ +/* */ +/* working with externally-formatted data */ +/* */ /************************************************************************/ -/* - All client code should use only the two macros - - TO_EXTERNAL_FORMAT (source_type, source, sink_type, sink, coding_system) - TO_INTERNAL_FORMAT (source_type, source, sink_type, sink, coding_system) - - Typical use is - - TO_EXTERNAL_FORMAT (DATA, (ptr, len), - LISP_BUFFER, buffer, - Qfile_name); - - The source or sink can be specified in one of these ways: - - DATA, (ptr, len), // input data is a fixed buffer of size len - ALLOCA, (ptr, len), // output data is in a alloca()ed buffer of size len - MALLOC, (ptr, len), // output data is in a malloc()ed buffer of size len - C_STRING_ALLOCA, ptr, // equivalent to ALLOCA (ptr, len_ignored) on output. - C_STRING_MALLOC, ptr, // equivalent to MALLOC (ptr, len_ignored) on output. - C_STRING, ptr, // equivalent to DATA, (ptr, strlen (ptr) + 1) on input - LISP_STRING, string, // input or output is a Lisp_Object of type string - LISP_BUFFER, buffer, // output is written to (point) in lisp buffer - LISP_LSTREAM, lstream, // input or output is a Lisp_Object of type lstream - LISP_OPAQUE, object, // input or output is a Lisp_Object of type opaque - - When specifying the sink, use lvalues, since the macro will assign to them, - except when the sink is an lstream or a lisp buffer. - - The macros accept the kinds of sources and sinks appropriate for - internal and external data representation. See the type_checking_assert - macros below for the actual allowed types. - - Since some sources and sinks use one argument (a Lisp_Object) to - specify them, while others take a (pointer, length) pair, we use - some C preprocessor trickery to allow pair arguments to be specified - by parenthesizing them, as in the examples above. - - Anything prefixed by dfc_ (`data format conversion') is private. - They are only used to implement these macros. - - Using C_STRING* is appropriate for using with external APIs that take - null-terminated strings. For internal data, we should try to be - '\0'-clean - i.e. allow arbitrary data to contain embedded '\0'. - - Sometime in the future we might allow output to C_STRING_ALLOCA or - C_STRING_MALLOC _only_ with TO_EXTERNAL_FORMAT(), not - TO_INTERNAL_FORMAT(). */ -#define TO_EXTERNAL_FORMAT(source_type, source, sink_type, sink, coding_system) \ -do { \ - dfc_conversion_type dfc_simplified_source_type; \ - dfc_conversion_type dfc_simplified_sink_type; \ - dfc_conversion_data dfc_source; \ - dfc_conversion_data dfc_sink; \ - \ - type_checking_assert \ - ((DFC_TYPE_##source_type == DFC_TYPE_DATA || \ - DFC_TYPE_##source_type == DFC_TYPE_C_STRING || \ - DFC_TYPE_##source_type == DFC_TYPE_LISP_STRING || \ - DFC_TYPE_##source_type == DFC_TYPE_LISP_OPAQUE || \ - DFC_TYPE_##source_type == DFC_TYPE_LISP_LSTREAM) \ - && \ - (DFC_TYPE_##sink_type == DFC_TYPE_ALLOCA || \ - DFC_TYPE_##sink_type == DFC_TYPE_MALLOC || \ - DFC_TYPE_##sink_type == DFC_TYPE_C_STRING_ALLOCA || \ - DFC_TYPE_##sink_type == DFC_TYPE_C_STRING_MALLOC || \ - DFC_TYPE_##sink_type == DFC_TYPE_LISP_LSTREAM || \ - DFC_TYPE_##sink_type == DFC_TYPE_LISP_OPAQUE)); \ - \ - DFC_SOURCE_##source_type##_TO_ARGS (source); \ - DFC_SINK_##sink_type##_TO_ARGS (sink); \ - \ - DFC_CONVERT_TO_EXTERNAL_FORMAT (dfc_simplified_source_type, &dfc_source, \ - coding_system, \ - dfc_simplified_sink_type, &dfc_sink); \ - \ - DFC_##sink_type##_USE_CONVERTED_DATA (sink); \ -} while (0) - -#define TO_INTERNAL_FORMAT(source_type, source, sink_type, sink, coding_system) \ -do { \ - dfc_conversion_type dfc_simplified_source_type; \ - dfc_conversion_type dfc_simplified_sink_type; \ - dfc_conversion_data dfc_source; \ - dfc_conversion_data dfc_sink; \ - \ - type_checking_assert \ - ((DFC_TYPE_##source_type == DFC_TYPE_DATA || \ - DFC_TYPE_##source_type == DFC_TYPE_C_STRING || \ - DFC_TYPE_##source_type == DFC_TYPE_LISP_OPAQUE || \ - DFC_TYPE_##source_type == DFC_TYPE_LISP_LSTREAM) \ - && \ - (DFC_TYPE_##sink_type == DFC_TYPE_ALLOCA || \ - DFC_TYPE_##sink_type == DFC_TYPE_MALLOC || \ - DFC_TYPE_##sink_type == DFC_TYPE_C_STRING_ALLOCA || \ - DFC_TYPE_##sink_type == DFC_TYPE_C_STRING_MALLOC || \ - DFC_TYPE_##sink_type == DFC_TYPE_LISP_STRING || \ - DFC_TYPE_##sink_type == DFC_TYPE_LISP_LSTREAM || \ - DFC_TYPE_##sink_type == DFC_TYPE_LISP_BUFFER)); \ - \ - DFC_SOURCE_##source_type##_TO_ARGS (source); \ - DFC_SINK_##sink_type##_TO_ARGS (sink); \ - \ - DFC_CONVERT_TO_INTERNAL_FORMAT (dfc_simplified_source_type, &dfc_source, \ - coding_system, \ - dfc_simplified_sink_type, &dfc_sink); \ - \ - DFC_##sink_type##_USE_CONVERTED_DATA (sink); \ -} while (0) +/* Sometimes strings need to be converted into one or another + external format, for passing to a library function. (Note + that we encapsulate and automatically convert the arguments + of some functions, but not others.) At times this conversion + also has to go the other way -- i.e. when we get external- + format strings back from a library function. +*/ #ifdef FILE_CODING -#define DFC_CONVERT_TO_EXTERNAL_FORMAT dfc_convert_to_external_format -#define DFC_CONVERT_TO_INTERNAL_FORMAT dfc_convert_to_internal_format -#else -/* ignore coding_system argument */ -#define DFC_CONVERT_TO_EXTERNAL_FORMAT(a, b, coding_system, c, d) \ - dfc_convert_to_external_format (a, b, c, d) -#define DFC_CONVERT_TO_INTERNAL_FORMAT(a, b, coding_system, c, d) \ - dfc_convert_to_internal_format (a, b, c, d) -#endif - -typedef union -{ - struct { const void *ptr; size_t len; } data; - Lisp_Object lisp_object; -} dfc_conversion_data; - -enum dfc_conversion_type -{ - DFC_TYPE_DATA, - DFC_TYPE_ALLOCA, - DFC_TYPE_MALLOC, - DFC_TYPE_C_STRING, - DFC_TYPE_C_STRING_ALLOCA, - DFC_TYPE_C_STRING_MALLOC, - DFC_TYPE_LISP_STRING, - DFC_TYPE_LISP_LSTREAM, - DFC_TYPE_LISP_OPAQUE, - DFC_TYPE_LISP_BUFFER -}; -typedef enum dfc_conversion_type dfc_conversion_type; /* 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(). */ -void -dfc_convert_to_external_format (dfc_conversion_type source_type, - dfc_conversion_data *source, -#ifdef FILE_CODING - Lisp_Object coding_system, -#endif - dfc_conversion_type sink_type, - dfc_conversion_data *sink); -void -dfc_convert_to_internal_format (dfc_conversion_type source_type, - dfc_conversion_data *source, -#ifdef FILE_CODING - Lisp_Object coding_system, -#endif - dfc_conversion_type sink_type, - dfc_conversion_data *sink); -/* CPP Trickery */ -#define DFC_CPP_CAR(x,y) (x) -#define DFC_CPP_CDR(x,y) (y) + these functions are not used *very* carefully. Under normal + circumstances, do not call these functions; call the front ends + below. */ + +Extbyte *convert_to_external_format (CONST Bufbyte *ptr, + Bytecount len, + Extcount *len_out, + enum external_data_format fmt); +Bufbyte *convert_from_external_format (CONST Extbyte *ptr, + Extcount len, + Bytecount *len_out, + enum external_data_format fmt); + +#else /* ! MULE */ + +#define convert_to_external_format(ptr, len, len_out, fmt) \ + (*(len_out) = (int) (len), (Extbyte *) (ptr)) +#define convert_from_external_format(ptr, len, len_out, fmt) \ + (*(len_out) = (Bytecount) (len), (Bufbyte *) (ptr)) + +#endif /* ! MULE */ + +/* In all of the following macros we use the following general principles: + + -- Functions that work with charptr's accept two sorts of charptr's: + + a) Pointers to memory with a length specified. The pointer will be + fundamentally of type `unsigned char *' (although labelled + as `Bufbyte *' for internal-format data and `Extbyte *' for + external-format data) and the length will be fundamentally of + type `int' (although labelled as `Bytecount' for internal-format + data and `Extcount' for external-format data). The length is + always a count in bytes. + b) Zero-terminated pointers; no length specified. The pointer + is of type `char *', whether the data pointed to is internal-format + or external-format. These sorts of pointers are available for + convenience in working with C library functions and literal + strings. In general you should use these sorts of pointers only + to interface to library routines and not for general manipulation, + as you are liable to lose embedded nulls and such. This could + be a big problem for routines that want Unicode-formatted data, + which is likely to have lots of embedded nulls in it. + (In the real world, though, external Unicode data will be UTF-8, + which will not have embedded nulls and is ASCII-compatible - martin) + + -- Functions that work with Lisp strings accept strings as Lisp Objects + (as opposed to the `struct Lisp_String *' for some of the other + string accessors). This is for convenience in working with the + functions, as otherwise you will almost always have to call + XSTRING() on the object. + + -- Functions that work with charptr's are not guaranteed to copy + their data into alloca()ed space. Functions that work with + Lisp strings are, however. The reason is that Lisp strings can + be relocated any time a GC happens, and it could happen at some + rather unexpected times. The internal-external conversion is + rarely done in time-critical functions, and so the slight + extra time required for alloca() and copy is well-worth the + safety of knowing your string data won't be relocated out from + under you. + */ + -/* Convert `source' to args for dfc_convert_to_*_format() */ -#define DFC_SOURCE_DATA_TO_ARGS(val) do { \ - dfc_source.data.ptr = DFC_CPP_CAR val; \ - dfc_source.data.len = DFC_CPP_CDR val; \ - dfc_simplified_source_type = DFC_TYPE_DATA; \ -} while (0) -#define DFC_SOURCE_C_STRING_TO_ARGS(val) do { \ - dfc_source.data.len = \ - strlen ((char *) (dfc_source.data.ptr = (val))); \ - dfc_simplified_source_type = DFC_TYPE_DATA; \ +/* Maybe convert charptr's data into ext-format and store the result in + alloca()'ed space. + + You may wonder why this is written in this fashion and not as a + function call. With a little trickery it could certainly be + written this way, but it won't work because of those DAMN GCC WANKERS + who couldn't be bothered to handle alloca() properly on the x86 + architecture. (If you put a call to alloca() in the argument to + a function call, the stack space gets allocated right in the + middle of the arguments to the function call and you are unbelievably + hosed.) */ + +#ifdef MULE + +#define GET_CHARPTR_EXT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ +{ \ + Bytecount gceda_len_in = (Bytecount) (len); \ + Extcount gceda_len_out; \ + CONST Bufbyte *gceda_ptr_in = (ptr); \ + Extbyte *gceda_ptr_out = \ + convert_to_external_format (gceda_ptr_in, gceda_len_in, \ + &gceda_len_out, fmt); \ + /* If the new string is identical to the old (will be the case most \ + of the time), just return the same string back. This saves \ + on alloca()ing, which can be useful on C alloca() machines and \ + on stack-space-challenged environments. */ \ + \ + if (gceda_len_in == gceda_len_out && \ + !memcmp (gceda_ptr_in, gceda_ptr_out, gceda_len_out)) \ + { \ + (ptr_out) = (Extbyte *) gceda_ptr_in; \ + } \ + else \ + { \ + (ptr_out) = (Extbyte *) alloca (1 + gceda_len_out); \ + memcpy ((void *) ptr_out, gceda_ptr_out, 1 + gceda_len_out); \ + } \ + (len_out) = gceda_len_out; \ } while (0) -#define DFC_SOURCE_LISP_STRING_TO_ARGS(val) do { \ - Lisp_Object dfc_slsta = (val); \ - type_checking_assert (STRINGP (dfc_slsta)); \ - dfc_source.lisp_object = dfc_slsta; \ - dfc_simplified_source_type = DFC_TYPE_LISP_STRING; \ + +#else /* ! MULE */ + +#define GET_CHARPTR_EXT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ +{ \ + (ptr_out) = (Extbyte *) (ptr); \ + (len_out) = (Extcount) (len); \ } while (0) -#define DFC_SOURCE_LISP_LSTREAM_TO_ARGS(val) do { \ - Lisp_Object dfc_sllta = (val); \ - type_checking_assert (LSTREAMP (dfc_sllta)); \ - dfc_source.lisp_object = dfc_sllta; \ - dfc_simplified_source_type = DFC_TYPE_LISP_LSTREAM; \ -} while (0) -#define DFC_SOURCE_LISP_OPAQUE_TO_ARGS(val) do { \ - Lisp_Opaque *dfc_slota = XOPAQUE (val); \ - dfc_source.data.ptr = OPAQUE_DATA (dfc_slota); \ - dfc_source.data.len = OPAQUE_SIZE (dfc_slota); \ - dfc_simplified_source_type = DFC_TYPE_DATA; \ + +#endif /* ! MULE */ + +#define GET_C_CHARPTR_EXT_DATA_ALLOCA(ptr, fmt, ptr_out) do \ +{ \ + Extcount gcceda_ignored_len; \ + CONST Bufbyte *gcceda_ptr_in = (CONST Bufbyte *) (ptr); \ + Extbyte *gcceda_ptr_out; \ + \ + GET_CHARPTR_EXT_DATA_ALLOCA (gcceda_ptr_in, \ + strlen ((char *) gcceda_ptr_in), \ + fmt, \ + gcceda_ptr_out, \ + gcceda_ignored_len); \ + (ptr_out) = (char *) gcceda_ptr_out; \ } while (0) -/* Convert `sink' to args for dfc_convert_to_*_format() */ -#define DFC_SINK_ALLOCA_TO_ARGS(val) \ - dfc_simplified_sink_type = DFC_TYPE_DATA -#define DFC_SINK_C_STRING_ALLOCA_TO_ARGS(val) \ - dfc_simplified_sink_type = DFC_TYPE_DATA -#define DFC_SINK_MALLOC_TO_ARGS(val) \ - dfc_simplified_sink_type = DFC_TYPE_DATA -#define DFC_SINK_C_STRING_MALLOC_TO_ARGS(val) \ - dfc_simplified_sink_type = DFC_TYPE_DATA -#define DFC_SINK_LISP_STRING_TO_ARGS(val) \ - dfc_simplified_sink_type = DFC_TYPE_DATA -#define DFC_SINK_LISP_OPAQUE_TO_ARGS(val) \ - dfc_simplified_sink_type = DFC_TYPE_DATA -#define DFC_SINK_LISP_LSTREAM_TO_ARGS(val) do { \ - Lisp_Object dfc_sllta = (val); \ - type_checking_assert (LSTREAMP (dfc_sllta)); \ - dfc_sink.lisp_object = dfc_sllta; \ - dfc_simplified_sink_type = DFC_TYPE_LISP_LSTREAM; \ +#define GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_BINARY, ptr_out) +#define GET_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, ptr_out, len_out) + +#define GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_FILENAME, ptr_out) +#define GET_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, ptr_out, len_out) + +#define GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_CTEXT, ptr_out) +#define GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, ptr_out, len_out) + +/* Maybe convert external charptr's data into internal format and store + the result in alloca()'ed space. + + You may wonder why this is written in this fashion and not as a + function call. With a little trickery it could certainly be + written this way, but it won't work because of those DAMN GCC WANKERS + who couldn't be bothered to handle alloca() properly on the x86 + architecture. (If you put a call to alloca() in the argument to + a function call, the stack space gets allocated right in the + middle of the arguments to the function call and you are unbelievably + hosed.) */ + +#ifdef MULE + +#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ +{ \ + Extcount gcida_len_in = (Extcount) (len); \ + Bytecount gcida_len_out; \ + CONST Extbyte *gcida_ptr_in = (ptr); \ + Bufbyte *gcida_ptr_out = \ + convert_from_external_format (gcida_ptr_in, gcida_len_in, \ + &gcida_len_out, fmt); \ + /* If the new string is identical to the old (will be the case most \ + of the time), just return the same string back. This saves \ + on alloca()ing, which can be useful on C alloca() machines and \ + on stack-space-challenged environments. */ \ + \ + if (gcida_len_in == gcida_len_out && \ + !memcmp (gcida_ptr_in, gcida_ptr_out, gcida_len_out)) \ + { \ + (ptr_out) = (Bufbyte *) gcida_ptr_in; \ + } \ + else \ + { \ + (ptr_out) = (Extbyte *) alloca (1 + gcida_len_out); \ + memcpy ((void *) ptr_out, gcida_ptr_out, 1 + gcida_len_out); \ + } \ + (len_out) = gcida_len_out; \ } while (0) -#define DFC_SINK_LISP_BUFFER_TO_ARGS(val) do { \ - struct buffer *dfc_slbta = XBUFFER (val); \ - dfc_sink.lisp_object = \ - make_lisp_buffer_output_stream \ - (dfc_slbta, BUF_PT (dfc_slbta), 0); \ - dfc_simplified_sink_type = DFC_TYPE_LISP_LSTREAM; \ + +#else /* ! MULE */ + +#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \ +{ \ + (ptr_out) = (Bufbyte *) (ptr); \ + (len_out) = (Bytecount) (len); \ } 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_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_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 { \ - void * dfc_sink_ret = alloca (dfc_sink.data.len + 1); \ - memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 1); \ - (sink) = (char *) dfc_sink_ret; \ +#endif /* ! MULE */ + +#define GET_C_CHARPTR_INT_DATA_ALLOCA(ptr, fmt, ptr_out) do \ +{ \ + Bytecount gccida_ignored_len; \ + CONST Extbyte *gccida_ptr_in = (CONST Extbyte *) (ptr); \ + Bufbyte *gccida_ptr_out; \ + \ + GET_CHARPTR_INT_DATA_ALLOCA (gccida_ptr_in, \ + strlen ((char *) gccida_ptr_in), \ + fmt, \ + gccida_ptr_out, \ + gccida_ignored_len); \ + (ptr_out) = gccida_ptr_out; \ } while (0) -#define DFC_C_STRING_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); \ - (sink) = (char *) dfc_sink_ret; \ + +#define GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_BINARY, ptr_out) +#define GET_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, ptr_out, len_out) + +#define GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_FILENAME, ptr_out) +#define GET_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, ptr_out, len_out) + +#define GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, ptr_out) \ + GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_CTEXT, ptr_out) +#define GET_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, len, ptr_out, len_out) \ + GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, ptr_out, len_out) + + +/* Maybe convert Lisp string's data into ext-format and store the result in + alloca()'ed space. + + You may wonder why this is written in this fashion and not as a + function call. With a little trickery it could certainly be + written this way, but it won't work because of those DAMN GCC WANKERS + who couldn't be bothered to handle alloca() properly on the x86 + architecture. (If you put a call to alloca() in the argument to + a function call, the stack space gets allocated right in the + middle of the arguments to the function call and you are unbelievably + hosed.) */ + +#define GET_STRING_EXT_DATA_ALLOCA(s, fmt, ptr_out, len_out) do \ +{ \ + Extcount gseda_len_out; \ + struct Lisp_String *gseda_s = XSTRING (s); \ + Extbyte * gseda_ptr_out = \ + convert_to_external_format (string_data (gseda_s), \ + string_length (gseda_s), \ + &gseda_len_out, fmt); \ + (ptr_out) = (Extbyte *) alloca (1 + gseda_len_out); \ + memcpy ((void *) ptr_out, gseda_ptr_out, 1 + gseda_len_out); \ + (len_out) = gseda_len_out; \ } while (0) -#define DFC_LISP_STRING_USE_CONVERTED_DATA(sink) \ - sink = make_string ((Bufbyte *) dfc_sink.data.ptr, dfc_sink.data.len) -#define DFC_LISP_OPAQUE_USE_CONVERTED_DATA(sink) \ - sink = make_opaque (dfc_sink.data.ptr, dfc_sink.data.len) -#define DFC_LISP_LSTREAM_USE_CONVERTED_DATA(sink) /* data already used */ -#define DFC_LISP_BUFFER_USE_CONVERTED_DATA(sink) \ - Lstream_delete (XLSTREAM (dfc_sink.lisp_object)) + + +#define GET_C_STRING_EXT_DATA_ALLOCA(s, fmt, ptr_out) do \ +{ \ + Extcount gcseda_ignored_len; \ + Extbyte *gcseda_ptr_out; \ + \ + GET_STRING_EXT_DATA_ALLOCA (s, fmt, gcseda_ptr_out, \ + gcseda_ignored_len); \ + (ptr_out) = (char *) gcseda_ptr_out; \ +} while (0) + +#define GET_STRING_BINARY_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, ptr_out, len_out) +#define GET_C_STRING_BINARY_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, ptr_out) -/* Someday we might want to distinguish between Qnative and Qfile_name - by using coding-system aliases, but for now it suffices to have - these be identical. Qnative can be used as the coding_system - argument to TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */ -#define Qnative Qfile_name +#define GET_STRING_FILENAME_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, ptr_out, len_out) +#define GET_C_STRING_FILENAME_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, ptr_out) -#ifdef HAVE_MS_WINDOWS -/* #### kludge!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - Remove this as soon as my Mule code is integrated. */ -#define Qmswindows_tstr Qnative -#endif +#define GET_STRING_OS_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, ptr_out, len_out) +#define GET_C_STRING_OS_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, ptr_out) + +#define GET_STRING_CTEXT_DATA_ALLOCA(s, ptr_out, len_out) \ + GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, ptr_out, len_out) +#define GET_C_STRING_CTEXT_DATA_ALLOCA(s, ptr_out) \ + GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, ptr_out) + + /************************************************************************/ /* */ @@ -1415,7 +1433,7 @@ #define POINT_MARKER_P(marker) \ (XMARKER (marker)->buffer != 0 && \ - EQ (marker, XMARKER (marker)->buffer->point_marker)) + EQ ((marker), XMARKER (marker)->buffer->point_marker)) #define BUF_MARKERS(buf) ((buf)->markers) @@ -1542,8 +1560,8 @@ #ifdef REL_ALLOC -char *r_alloc (unsigned char **, size_t); -char *r_re_alloc (unsigned char **, size_t); +char *r_alloc (unsigned char **, unsigned long); +char *r_re_alloc (unsigned char **, unsigned long); void r_alloc_free (unsigned char **); #define BUFFER_ALLOC(data, size) \ @@ -1576,17 +1594,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, @@ -1682,7 +1700,7 @@ set_string_char (XSTRING (table), (Charcount) ch1, ch2) #ifdef MULE -# define MAKE_MIRROR_TRT_TABLE() make_opaque (OPAQUE_CLEAR, 256) +# define MAKE_MIRROR_TRT_TABLE() make_opaque (256, 0) # define MIRROR_TRT_TABLE_AS_STRING(table) ((Bufbyte *) XOPAQUE_DATA (table)) # define MIRROR_TRT_TABLE_CHAR_1(table, ch) \ ((Emchar) (MIRROR_TRT_TABLE_AS_STRING (table)[ch])) @@ -1712,8 +1730,8 @@ TRT_TABLE_AS_STRING (buf->case_eqv_table) #endif -INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); -INLINE_HEADER Emchar +INLINE Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); +INLINE Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c) { return IN_TRT_TABLE_DOMAIN (c) ? TRT_TABLE_CHAR_1 (trt, c) : c; @@ -1725,8 +1743,8 @@ /* 1 if CH is upper case. */ -INLINE_HEADER int UPPERCASEP (struct buffer *buf, Emchar ch); -INLINE_HEADER int +INLINE int UPPERCASEP (struct buffer *buf, Emchar ch); +INLINE int UPPERCASEP (struct buffer *buf, Emchar ch) { return DOWNCASE_TABLE_OF (buf, ch) != ch; @@ -1734,8 +1752,8 @@ /* 1 if CH is lower case. */ -INLINE_HEADER int LOWERCASEP (struct buffer *buf, Emchar ch); -INLINE_HEADER int +INLINE int LOWERCASEP (struct buffer *buf, Emchar ch); +INLINE int LOWERCASEP (struct buffer *buf, Emchar ch) { return (UPCASE_TABLE_OF (buf, ch) != ch && @@ -1744,8 +1762,8 @@ /* 1 if CH is neither upper nor lower case. */ -INLINE_HEADER int NOCASEP (struct buffer *buf, Emchar ch); -INLINE_HEADER int +INLINE int NOCASEP (struct buffer *buf, Emchar ch); +INLINE int NOCASEP (struct buffer *buf, Emchar ch) { return UPCASE_TABLE_OF (buf, ch) == ch; @@ -1753,8 +1771,8 @@ /* Upcase a character, or make no change if that cannot be done. */ -INLINE_HEADER Emchar UPCASE (struct buffer *buf, Emchar ch); -INLINE_HEADER Emchar +INLINE Emchar UPCASE (struct buffer *buf, Emchar ch); +INLINE Emchar UPCASE (struct buffer *buf, Emchar ch) { return (DOWNCASE_TABLE_OF (buf, ch) == ch) ? UPCASE_TABLE_OF (buf, ch) : ch; @@ -1768,4 +1786,4 @@ #define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch) -#endif /* INCLUDED_buffer_h_ */ +#endif /* _XEMACS_BUFFER_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/bufslots.h --- a/src/bufslots.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/bufslots.h Mon Aug 13 11:20:41 2007 +0200 @@ -32,10 +32,6 @@ definition. In the garbage collector this file is included after defining MARKED_SLOT(x) to be mark_object(buffer->x). */ -#ifndef BUFFER_SLOTS_FIRST_NAME -#define BUFFER_SLOTS_FIRST_NAME name -#endif - /* The name of this buffer. */ MARKED_SLOT (name); @@ -239,11 +235,6 @@ /* A hash table that maps from a "generic extent" (an extent in `modeline-format') into a buffer-specific extent. */ MARKED_SLOT (modeline_extent_table); - -#ifndef BUFFER_SLOTS_LAST_NAME -#define BUFFER_SLOTS_LAST_NAME modeline_extent_table -#endif - #if 0 /* FSFmacs */ /* This is silly and stupid */ /* These are so we don't have to recompile everything diff -r 12e008d41344 -r 697ef44129c6 src/bytecode.c --- a/src/bytecode.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/bytecode.c Mon Aug 13 11:20:41 2007 +0200 @@ -28,7 +28,7 @@ FSF: long ago. -hacked on by jwz@jwz.org 1991-06 +hacked on by jwz@netscape.com 1991-06 o added a compile-time switch to turn on simple sanity checking; o put back the obsolete byte-codes for error-detection; o added a new instruction, unbind_all, which I will use for @@ -56,6 +56,9 @@ #include "opaque.h" #include "syntax.h" +#include <stddef.h> +#include <limits.h> + EXFUN (Ffetch_bytecode, 1); Lisp_Object Qbyte_code, Qcompiled_functionp, Qinvalid_byte_code; @@ -214,15 +217,21 @@ 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); extern Lisp_Object Qand_rest, Qand_optional; +/* Define ERROR_CHECK_BYTE_CODE to enable some minor sanity checking. + Useful for debugging the byte compiler. */ +#ifdef DEBUG_XEMACS +#define ERROR_CHECK_BYTE_CODE +#endif + /* Define BYTE_CODE_METER to enable generation of a byte-op usage histogram. This isn't defined in FSF Emacs and isn't defined in XEmacs v19. */ /* #define BYTE_CODE_METER */ @@ -233,17 +242,21 @@ Lisp_Object Vbyte_code_meter, Qbyte_code_meter; int byte_metering_on; -static void -meter_code (Opcode prev_opcode, Opcode this_opcode) -{ - if (byte_metering_on) - { - Lisp_Object *p = XVECTOR_DATA (XVECTOR_DATA (Vbyte_code_meter)[this_opcode]); - p[0] = INT_PLUS1 (p[0]); - if (prev_opcode) - p[prev_opcode] = INT_PLUS1 (p[prev_opcode]); - } -} +#define METER_2(code1, code2) \ + XINT (XVECTOR_DATA (XVECTOR_DATA (Vbyte_code_meter)[(code1)])[(code2)]) + +#define METER_1(code) METER_2 (0, (code)) + +#define METER_CODE(last_code, this_code) do { \ + if (byte_metering_on) \ + { \ + if (METER_1 (this_code) != ((1<<VALBITS)-1)) \ + METER_1 (this_code)++; \ + if (last_code \ + && METER_2 (last_code, this_code) != ((1<<VALBITS)-1)) \ + METER_2 (last_code, this_code)++; \ + } \ +} while (0) #endif /* BYTE_CODE_METER */ @@ -253,12 +266,12 @@ { retry: - if (INTP (obj)) return make_int (- XINT (obj)); #ifdef LISP_FLOAT_TYPE if (FLOATP (obj)) return make_float (- XFLOAT_DATA (obj)); #endif if (CHARP (obj)) return make_int (- ((int) XCHAR (obj))); if (MARKERP (obj)) return make_int (- ((int) marker_position (obj))); + if (INTP (obj)) return make_int (- XINT (obj)); obj = wrong_type_argument (Qnumber_char_or_marker_p, obj); goto retry; @@ -292,7 +305,7 @@ #ifdef LISP_FLOAT_TYPE { - EMACS_INT ival1, ival2; + int ival1, ival2; if (INTP (obj1)) ival1 = XINT (obj1); else if (CHARP (obj1)) ival1 = XCHAR (obj1); @@ -336,7 +349,7 @@ } #else /* !LISP_FLOAT_TYPE */ { - EMACS_INT ival1, ival2; + int ival1, ival2; if (INTP (obj1)) ival1 = XINT (obj1); else if (CHARP (obj1)) ival1 = XCHAR (obj1); @@ -365,7 +378,7 @@ bytecode_arithop (Lisp_Object obj1, Lisp_Object obj2, Opcode opcode) { #ifdef LISP_FLOAT_TYPE - EMACS_INT ival1, ival2; + int ival1, ival2; int float_p; retry: @@ -427,7 +440,7 @@ return make_float (dval1); } #else /* !LISP_FLOAT_TYPE */ - EMACS_INT ival1, ival2; + int ival1, ival2; retry: @@ -525,10 +538,6 @@ } wrong_number_of_arguments: - /* The actual printed compiled_function object is incomprehensible. - Check the backtrace to see if we can get a more meaningful symbol. */ - if (EQ (fun, indirect_function (*backtrace_list->function, 0))) - fun = *backtrace_list->function; return Fsignal (Qwrong_number_of_arguments, list2 (fun, make_int (nargs))); } @@ -594,12 +603,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 (); @@ -641,7 +650,7 @@ #ifdef BYTE_CODE_METER prev_opcode = this_opcode; this_opcode = opcode; - meter_code (prev_opcode, this_opcode); + METER_CODE (prev_opcode, this_opcode); #endif switch (opcode) @@ -684,7 +693,7 @@ do_varset: { Lisp_Object symbol = constants_data[n]; - Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); + struct Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); Lisp_Object old_value = symbol_ptr->value; Lisp_Object new_value = POP; if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value)) @@ -705,7 +714,7 @@ do_varbind: { Lisp_Object symbol = constants_data[n]; - Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); + struct Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); Lisp_Object old_value = symbol_ptr->value; Lisp_Object new_value = POP; if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value)) @@ -758,7 +767,6 @@ opcode == Bunbind+6 ? READ_UINT_1 : READ_UINT_2)); break; - case Bgoto: JUMP; break; @@ -996,11 +1004,11 @@ } case Bsub1: - TOP = INTP (TOP) ? INT_MINUS1 (TOP) : Fsub1 (TOP); + TOP = INTP (TOP) ? make_int (XINT (TOP) - 1) : Fsub1 (TOP); break; case Badd1: - TOP = INTP (TOP) ? INT_PLUS1 (TOP) : Fadd1 (TOP); + TOP = INTP (TOP) ? make_int (XINT (TOP) + 1) : Fadd1 (TOP); break; @@ -1054,7 +1062,7 @@ Lisp_Object arg2 = POP; Lisp_Object arg1 = TOP; TOP = INTP (arg1) && INTP (arg2) ? - INT_PLUS (arg1, arg2) : + make_int (XINT (arg1) + XINT (arg2)) : bytecode_arithop (arg1, arg2, opcode); break; } @@ -1064,7 +1072,7 @@ Lisp_Object arg2 = POP; Lisp_Object arg1 = TOP; TOP = INTP (arg1) && INTP (arg2) ? - INT_MINUS (arg1, arg2) : + make_int (XINT (arg1) - XINT (arg2)) : bytecode_arithop (arg1, arg2, opcode); break; } @@ -1107,6 +1115,7 @@ break; } + case Bset: { Lisp_Object arg = POP; @@ -1219,7 +1228,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) @@ -1489,7 +1498,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); @@ -1605,14 +1614,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. */ @@ -1621,13 +1630,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; @@ -1892,7 +1901,8 @@ program, &program_length, &varbind_count); f->specpdl_depth = XINT (Flength (f->arglist)) + varbind_count; f->instructions = - make_opaque (program, program_length * sizeof (Opbyte)); + Fpurecopy (make_opaque (program_length * sizeof (Opbyte), + (CONST void *) program)); } assert (OPAQUEP (f->instructions)); @@ -1978,15 +1988,15 @@ static Lisp_Object -mark_compiled_function (Lisp_Object obj) +mark_compiled_function (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (obj); - mark_object (f->instructions); - mark_object (f->arglist); - mark_object (f->doc_and_interactive); + markobj (f->instructions); + markobj (f->arglist); + markobj (f->doc_and_interactive); #ifdef COMPILED_FUNCTION_ANNOTATION_HACK - mark_object (f->annotated); + markobj (f->annotated); #endif /* tail-recurse on constants */ return f->constants; @@ -2020,23 +2030,11 @@ internal_hash (f->constants, depth + 1)); } -static const struct lrecord_description compiled_function_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, instructions) }, - { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, constants) }, - { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, arglist) }, - { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, doc_and_interactive) }, -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, annotated) }, -#endif - { XD_END } -}; - DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, mark_compiled_function, print_compiled_function, 0, compiled_function_equal, compiled_function_hash, - compiled_function_description, Lisp_Compiled_Function); DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /* @@ -2067,13 +2065,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) { @@ -2350,8 +2348,10 @@ /* v18 or v19 bytecode file. Need to Ebolify. */ if (f->flags.ebolified && VECTORP (XCDR (tem))) ebolify_bytecode_constants (XCDR (tem)); - f->instructions = XCAR (tem); - f->constants = XCDR (tem); + /* VERY IMPORTANT to purecopy here!!!!! + See load_force_doc_string_unwind. */ + f->instructions = Fpurecopy (XCAR (tem)); + f->constants = Fpurecopy (XCDR (tem)); return function; } abort (); @@ -2408,8 +2408,6 @@ void syms_of_bytecode (void) { - INIT_LRECORD_IMPLEMENTATION (compiled_function); - deferror (&Qinvalid_byte_code, "invalid-byte-code", "Invalid byte code", Qerror); defsymbol (&Qbyte_code, "byte-code"); diff -r 12e008d41344 -r 697ef44129c6 src/bytecode.h --- a/src/bytecode.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/bytecode.h Mon Aug 13 11:20:41 2007 +0200 @@ -27,8 +27,8 @@ Jon Reid: some changes for I18N3 (domain, etc), for 19.8. */ -#ifndef INCLUDED_bytecode_h_ -#define INCLUDED_bytecode_h_ +#ifndef _XEMACS_BYTECODE_H_ +#define _XEMACS_BYTECODE_H_ /* Meanings of slots in a Lisp_Compiled_Function. Don't use these! For backward compatibility only. */ @@ -93,6 +93,7 @@ Lisp_Compiled_Function) #define XSETCOMPILED_FUNCTION(x, p) XSETRECORD (x, p, compiled_function) #define COMPILED_FUNCTIONP(x) RECORDP (x, compiled_function) +#define GC_COMPILED_FUNCTIONP(x) GC_RECORDP (x, compiled_function) #define CHECK_COMPILED_FUNCTION(x) CHECK_RECORD (x, compiled_function) #define CONCHECK_COMPILED_FUNCTION(x) CONCHECK_RECORD (x, compiled_function) @@ -119,5 +120,5 @@ neither - : (* 559 0) = 0 = 3530 */ -#endif /* INCLUDED_bytecode_h_ */ +#endif /* _XEMACS_BYTECODE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/callint.c --- a/src/callint.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/callint.c Mon Aug 13 11:20:41 2007 +0200 @@ -56,8 +56,11 @@ Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; #endif -Lisp_Object QletX, Qsave_excursion; +Lisp_Object Qlet, QletX, Qsave_excursion; +Lisp_Object Qcurrent_prefix_arg; + +Lisp_Object Quser_variable_p; Lisp_Object Qread_from_minibuffer; Lisp_Object Qread_file_name; Lisp_Object Qread_directory_name; @@ -167,8 +170,8 @@ static Lisp_Object quotify_args (Lisp_Object expr) { - Lisp_Object tail; - Lisp_Cons *ptr; + REGISTER Lisp_Object tail; + REGISTER struct Lisp_Cons *ptr; for (tail = expr; CONSP (tail); tail = ptr->cdr) { ptr = XCONS (tail); @@ -193,8 +196,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 +244,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 +428,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 +489,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 +498,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 +568,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 +583,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 +912,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); @@ -992,7 +995,10 @@ defsymbol (&Qevents_to_keys, "events-to-keys"); defsymbol (&Qcommand_debug_status, "command-debug-status"); defsymbol (&Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); + defsymbol (&Quser_variable_p, "user-variable-p"); + defsymbol (&Qcurrent_prefix_arg, "current-prefix-arg"); + defsymbol (&Qlet, "let"); defsymbol (&QletX, "let*"); defsymbol (&Qsave_excursion, "save-excursion"); #if 0 /* ill-conceived */ diff -r 12e008d41344 -r 697ef44129c6 src/callproc.c --- a/src/callproc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/callproc.c Mon Aug 13 11:20:41 2007 +0200 @@ -41,19 +41,20 @@ #include "syssignal.h" /* Always include before systty.h */ #include "systty.h" -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #define _P_NOWAIT 1 /* from process.h */ +#include <windows.h> #include "nt.h" #endif -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* 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 /* WIN32_NATIVE */ +#endif /* DOS_NT */ Lisp_Object Vshell_file_name; @@ -67,14 +68,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 Windows, delete the temporary file on any kind of termination. + On MSDOS, 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. */ @@ -101,7 +102,7 @@ static Lisp_Object call_process_cleanup (Lisp_Object fdpid) { - int fd = XINT (Fcar (fdpid)); + int fd = XINT (Fcar (fdpid)); int pid = XINT (Fcdr (fdpid)); if (!call_process_exited && @@ -113,18 +114,7 @@ /* #### "c-G" -- need non-consing Single-key-description */ message ("Waiting for process to die...(type C-g again to kill it instantly)"); -#ifdef WIN32_NATIVE - { - HANDLE pHandle = OpenProcess (PROCESS_ALL_ACCESS, 0, pid); - if (pHandle == NULL) - warn_when_safe (Qprocess, Qwarning, - "cannot open process (PID %d) for cleanup", pid); - else - wait_for_termination (pHandle); - } -#else wait_for_termination (pid); -#endif /* "Discard" the unwind protect. */ XCAR (fdpid) = Qnil; @@ -152,7 +142,7 @@ } #endif /* unused */ -DEFUN ("old-call-process-internal", Fold_call_process_internal, 1, MANY, 0, /* +DEFUN ("call-process-internal", Fcall_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,15 +170,12 @@ Lisp_Object infile, buffer, current_dir, display, path; int fd[2]; int filefd; -#ifdef WIN32_NATIVE - HANDLE pHandle; -#endif int pid; char buf[16384]; char *bufptr = buf; int bufsize = 16384; int speccount = specpdl_depth (); - struct gcpro gcpro1, gcpro2, gcpro3; + struct gcpro gcpro1, gcpro2; char **new_argv = alloca_array (char *, max (2, nargs - 2)); /* File to use for stderr in the child. @@ -235,7 +222,7 @@ NUNGCPRO; } - GCPRO2 (current_dir, path); + GCPRO1 (current_dir); if (nargs >= 2 && ! NILP (args[1])) { @@ -250,7 +237,7 @@ UNGCPRO; - GCPRO3 (infile, current_dir, path); /* Fexpand_file_name might trash it */ + GCPRO2 (infile, current_dir); /* Fexpand_file_name might trash it */ if (nargs >= 3) { @@ -300,8 +287,8 @@ CHECK_STRING (args[i]); new_argv[i - 3] = (char *) XSTRING_DATA (args[i]); } + new_argv[nargs - 3] = 0; } - new_argv[max(nargs - 3,1)] = 0; if (NILP (path)) report_file_error ("Searching for program", Fcons (args[0], Qnil)); @@ -348,14 +335,14 @@ fd_error = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY); else if (STRINGP (error_file)) { - fd_error = open ((const char *) XSTRING_DATA (error_file), -#ifdef WIN32_NATIVE + fd_error = open ((CONST char *) XSTRING_DATA (error_file), +#ifdef DOS_NT O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, S_IREAD | S_IWRITE -#else /* not WIN32_NATIVE */ +#else /* not DOS_NT */ O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, CREAT_MODE -#endif /* not WIN32_NATIVE */ +#endif /* not DOS_NT */ ); } @@ -369,27 +356,10 @@ } fork_error = Qnil; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT pid = child_setup (filefd, fd1, fd_error, new_argv, (char *) XSTRING_DATA (current_dir)); - if (!INTP (buffer)) - { - /* OpenProcess() as soon after child_setup as possible. It's too - late once the process terminated. */ - pHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); -#if 0 - if (pHandle == NULL) - { - /* #### seems to cause crash in unbind_to(...) below. APA */ - warn_when_safe (Qprocess, Qwarning, - "cannot open process to wait for"); - } -#endif - } - /* Close STDERR into the parent process. We no longer need it. */ - if (fd_error >= 0) - close (fd_error); -#else /* not WIN32_NATIVE */ +#else /* not WINDOWSNT */ pid = fork (); if (pid == 0) @@ -410,7 +380,7 @@ if (fd_error >= 0) close (fd_error); -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ environ = save_environ; @@ -424,14 +394,12 @@ if (!NILP (fork_error)) signal_error (Qfile_error, fork_error); -#ifndef WIN32_NATIVE if (pid < 0) { if (fd[0] >= 0) close (fd[0]); report_file_error ("Doing fork", Qnil); } -#endif if (INTP (buffer)) { @@ -482,7 +450,7 @@ nread = 0; while (nread < bufsize - 1024) { - ssize_t this_read + int this_read = Lstream_read (XLSTREAM (instream), bufptr + nread, bufsize - nread); @@ -501,12 +469,10 @@ if (nread == 0) break; -#if 0 -#ifdef WIN32_NATIVE +#ifdef DOS_NT /* Until we pull out of MULE things like make_decoding_input_stream(), we do the following which is less elegant. --marcpa */ - /* We did. -- kkm */ { int lf_count = 0; if (NILP (Vbinary_process_output)) { @@ -514,7 +480,6 @@ } } #endif -#endif total_read += nread; @@ -542,11 +507,7 @@ QUIT; /* Wait for it to terminate, unless it already has. */ -#ifdef WIN32_NATIVE - wait_for_termination (pHandle); -#else wait_for_termination (pid); -#endif /* Don't kill any children that the subprocess may have left behind when exiting. */ @@ -602,48 +563,31 @@ a decent error from within the child, this should be verified as an executable directory by the parent. */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT 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 WIN32_NATIVE +#ifdef WINDOWSNT int cpid; HANDLE handles[4]; -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ #ifdef SET_EMACS_PRIORITY if (emacs_priority != 0) nice (- emacs_priority); #endif - /* 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) +#if !defined (NO_SUBPROCESSES) && !defined (WINDOWSNT) /* 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. @@ -701,10 +645,9 @@ { char **ep = env; char *envvar_external; + Bufbyte *envvar_internal = XSTRING_DATA (XCAR (tail)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (tail), - C_STRING_ALLOCA, envvar_external, - Qfile_name); + GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (envvar_internal, envvar_external); /* See if envvar_external duplicates any string already in the env. If so, don't put it in. @@ -738,10 +681,10 @@ *new_env = 0; } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT prepare_standard_handles (in, out, err, handles); set_process_dir (current_dir); -#else /* not WIN32_NATIVE */ +#else /* not WINDOWSNT */ /* 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 @@ -772,22 +715,22 @@ for (fd=3; fd<=64; fd++) close (fd); } -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ #ifdef vipc something missing here; #endif /* vipc */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* 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 WIN32_NATIVE */ +#else /* not WINDOWSNT */ /* 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. */ @@ -796,11 +739,11 @@ stdout_out ("Can't exec program %s\n", new_argv[0]); _exit (1); -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ } static int -getenv_internal (const Bufbyte *var, +getenv_internal (CONST Bufbyte *var, Bytecount varlen, Bufbyte **value, Bytecount *valuelen) @@ -814,12 +757,12 @@ if (STRINGP (entry) && XSTRING_LENGTH (entry) > varlen && XSTRING_BYTE (entry, varlen) == '=' -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* NT environment variables are case insensitive. */ && ! memicmp (XSTRING_DATA (entry), var, varlen) -#else /* not WIN32_NATIVE */ +#else /* not WINDOWSNT */ && ! memcmp (XSTRING_DATA (entry), var, varlen) -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ ) { *value = XSTRING_DATA (entry) + (varlen + 1); @@ -863,12 +806,12 @@ /* A version of getenv that consults process_environment, easily callable from C. */ char * -egetenv (const char *var) +egetenv (CONST char *var) { 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; @@ -886,17 +829,19 @@ char **envp; Vprocess_environment = Qnil; for (envp = environ; envp && *envp; envp++) - Vprocess_environment = - Fcons (build_ext_string (*envp, Qfile_name), Vprocess_environment); + { + Vprocess_environment = Fcons (build_ext_string (*envp, FORMAT_OS), + Vprocess_environment); + } } { /* Initialize shell-file-name from environment variables or best guess. */ -#ifdef WIN32_NATIVE - const char *shell = egetenv ("COMSPEC"); +#ifdef WINDOWSNT + CONST char *shell = egetenv ("COMSPEC"); if (!shell) shell = "\\WINNT\\system32\\cmd.exe"; -#else /* not WIN32_NATIVE */ - const char *shell = egetenv ("SHELL"); +#else /* not WINDOWSNT */ + CONST char *shell = egetenv ("SHELL"); if (!shell) shell = "/bin/sh"; #endif @@ -923,7 +868,7 @@ void syms_of_callproc (void) { - DEFSUBR (Fold_call_process_internal); + DEFSUBR (Fcall_process_internal); DEFSUBR (Fgetenv); } @@ -931,7 +876,7 @@ vars_of_callproc (void) { /* This function can GC */ -#ifdef WIN32_NATIVE +#ifdef DOS_NT DEFVAR_LISP ("binary-process-input", &Vbinary_process_input /* *If non-nil then new subprocesses are assumed to take binary input. */ ); @@ -941,7 +886,7 @@ *If non-nil then new subprocesses are assumed to produce binary output. */ ); Vbinary_process_output = Qnil; -#endif /* WIN32_NATIVE */ +#endif /* DOS_NT */ DEFVAR_LISP ("shell-file-name", &Vshell_file_name /* *File name to load inferior shells from. diff -r 12e008d41344 -r 697ef44129c6 src/casefiddle.c --- a/src/casefiddle.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/casefiddle.c Mon Aug 13 11:20:41 2007 +0200 @@ -47,7 +47,8 @@ if (STRINGP (obj)) { - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *syntax_table = + XCHAR_TABLE (buf->mirror_syntax_table); Bufbyte *storage = alloca_array (Bufbyte, XSTRING_LENGTH (obj) * MAX_EMCHAR_LEN); Bufbyte *newp = storage; @@ -155,7 +156,7 @@ /* This function can GC */ REGISTER Bufpos i; Bufpos start, end; - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); int mccount; Emchar oldc, c; int wordp = 0, wordp_prev; diff -r 12e008d41344 -r 697ef44129c6 src/casetab.c --- a/src/casetab.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/casetab.c Mon Aug 13 11:20:41 2007 +0200 @@ -42,13 +42,14 @@ #include "buffer.h" #include "opaque.h" -Lisp_Object Qcase_tablep; +Lisp_Object Qcase_table_p; Lisp_Object Vascii_downcase_table, Vascii_upcase_table; Lisp_Object Vascii_canon_table, Vascii_eqv_table; #ifdef MULE Lisp_Object Vmirror_ascii_downcase_table, Vmirror_ascii_upcase_table; Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_eqv_table; #endif +Lisp_Object Qtranslate_table; static void compute_trt_inverse (Lisp_Object trt, Lisp_Object inverse); @@ -80,7 +81,7 @@ REGISTER Lisp_Object tem; while (tem = Fcase_table_p (obj), NILP (tem)) - obj = wrong_type_argument (Qcase_tablep, obj); + obj = wrong_type_argument (Qcase_table_p, obj); return (obj); } @@ -189,8 +190,7 @@ set_case_table (Lisp_Object table, int standard) { Lisp_Object down, up, canon, eqv, tail = table; - struct buffer *buf = - standard ? XBUFFER(Vbuffer_defaults) : current_buffer; + struct buffer *buf = current_buffer; check_case_table (table); @@ -243,17 +243,19 @@ Vmirror_ascii_eqv_table = make_mirror_trt_table (eqv); #endif } - buf->downcase_table = down; - buf->upcase_table = up; - buf->case_canon_table = canon; - buf->case_eqv_table = eqv; + else + { + 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; } @@ -287,7 +289,8 @@ void syms_of_casetab (void) { - defsymbol (&Qcase_tablep, "case-table-p"); + defsymbol (&Qcase_table_p, "case-table-p"); + defsymbol (&Qtranslate_table, "translate-table"); DEFSUBR (Fcase_table_p); DEFSUBR (Fcurrent_case_table); @@ -307,13 +310,6 @@ staticpro (&Vascii_canon_table); staticpro (&Vascii_eqv_table); -#ifdef MULE - staticpro (&Vmirror_ascii_downcase_table); - staticpro (&Vmirror_ascii_upcase_table); - staticpro (&Vmirror_ascii_canon_table); - staticpro (&Vmirror_ascii_eqv_table); -#endif - tem = MAKE_TRT_TABLE (); Vascii_downcase_table = tem; Vascii_canon_table = tem; diff -r 12e008d41344 -r 697ef44129c6 src/chartab.c --- a/src/chartab.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/chartab.c Mon Aug 13 11:20:41 2007 +0200 @@ -2,8 +2,6 @@ Copyright (C) 1992, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1995, 1996 Ben Wing. - Copyright (C) 1995, 1997, 1999 Electrotechnical Laboratory, JAPAN. - Licensed to the Free Software Foundation. This file is part of XEmacs. @@ -52,9 +50,6 @@ Lisp_Object Qcategory_table_value_p; Lisp_Object Vstandard_category_table; - -/* Variables to determine word boundary. */ -Lisp_Object Vword_combining_categories, Vword_separating_categories; #endif /* MULE */ @@ -95,14 +90,14 @@ #ifdef MULE static Lisp_Object -mark_char_table_entry (Lisp_Object obj) +mark_char_table_entry (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj); int i; for (i = 0; i < 96; i++) { - mark_object (cte->level2[i]); + markobj (cte->level2[i]); } return Qnil; } @@ -110,8 +105,8 @@ static int char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Char_Table_Entry *cte1 = XCHAR_TABLE_ENTRY (obj1); - Lisp_Char_Table_Entry *cte2 = XCHAR_TABLE_ENTRY (obj2); + struct Lisp_Char_Table_Entry *cte1 = XCHAR_TABLE_ENTRY (obj1); + struct Lisp_Char_Table_Entry *cte2 = XCHAR_TABLE_ENTRY (obj2); int i; for (i = 0; i < 96; i++) @@ -124,35 +119,29 @@ static unsigned long char_table_entry_hash (Lisp_Object obj, int depth) { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj); return internal_array_hash (cte->level2, 96, depth); } -static const struct lrecord_description char_table_entry_description[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table_Entry, level2), 96 }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("char-table-entry", char_table_entry, mark_char_table_entry, internal_object_printer, 0, char_table_entry_equal, char_table_entry_hash, - char_table_entry_description, - Lisp_Char_Table_Entry); + struct Lisp_Char_Table_Entry); #endif /* MULE */ static Lisp_Object -mark_char_table (Lisp_Object obj) +mark_char_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Char_Table *ct = XCHAR_TABLE (obj); + struct Lisp_Char_Table *ct = XCHAR_TABLE (obj); int i; for (i = 0; i < NUM_ASCII_CHARS; i++) - mark_object (ct->ascii[i]); + markobj (ct->ascii[i]); #ifdef MULE for (i = 0; i < NUM_LEADING_BYTES; i++) - mark_object (ct->level1[i]); + markobj (ct->level1[i]); #endif return ct->mirror_table; } @@ -162,18 +151,18 @@ and prune_weak_hash_tables(). */ void -prune_syntax_tables (void) +prune_syntax_tables (int (*obj_marked_p) (Lisp_Object)) { Lisp_Object rest, prev = Qnil; for (rest = Vall_syntax_tables; - !NILP (rest); + !GC_NILP (rest); rest = XCHAR_TABLE (rest)->next_table) { - if (! marked_p (rest)) + if (! obj_marked_p (rest)) { /* This table is garbage. Remove it from the list. */ - if (NILP (prev)) + if (GC_NILP (prev)) Vall_syntax_tables = XCHAR_TABLE (rest)->next_table; else XCHAR_TABLE (prev)->next_table = @@ -241,7 +230,7 @@ static void print_chartab_charset_row (Lisp_Object charset, int row, - Lisp_Char_Table_Entry *cte, + struct Lisp_Char_Table_Entry *cte, Lisp_Object printcharfun) { int i; @@ -289,7 +278,7 @@ static void print_chartab_two_byte_charset (Lisp_Object charset, - Lisp_Char_Table_Entry *cte, + struct Lisp_Char_Table_Entry *cte, Lisp_Object printcharfun) { int i; @@ -319,7 +308,7 @@ static void print_char_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Char_Table *ct = XCHAR_TABLE (obj); + struct Lisp_Char_Table *ct = XCHAR_TABLE (obj); char buf[200]; sprintf (buf, "#s(char-table type %s data (", @@ -377,7 +366,7 @@ } else { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (ann); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (ann); if (XCHARSET_DIMENSION (charset) == 1) print_chartab_charset_row (charset, -1, cte, printcharfun); else @@ -393,8 +382,8 @@ static int char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Char_Table *ct1 = XCHAR_TABLE (obj1); - Lisp_Char_Table *ct2 = XCHAR_TABLE (obj2); + struct Lisp_Char_Table *ct1 = XCHAR_TABLE (obj1); + struct Lisp_Char_Table *ct2 = XCHAR_TABLE (obj2); int i; if (CHAR_TABLE_TYPE (ct1) != CHAR_TABLE_TYPE (ct2)) @@ -416,7 +405,7 @@ static unsigned long char_table_hash (Lisp_Object obj, int depth) { - Lisp_Char_Table *ct = XCHAR_TABLE (obj); + struct Lisp_Char_Table *ct = XCHAR_TABLE (obj); unsigned long hashval = internal_array_hash (ct->ascii, NUM_ASCII_CHARS, depth); #ifdef MULE @@ -426,21 +415,10 @@ return hashval; } -static const struct lrecord_description char_table_description[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, ascii), NUM_ASCII_CHARS }, -#ifdef MULE - { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, level1), NUM_LEADING_BYTES }, -#endif - { XD_LISP_OBJECT, offsetof (Lisp_Char_Table, mirror_table) }, - { XD_LO_LINK, offsetof (Lisp_Char_Table, next_table) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("char-table", char_table, mark_char_table, print_char_table, 0, char_table_equal, char_table_hash, - char_table_description, - Lisp_Char_Table); + struct Lisp_Char_Table); DEFUN ("char-table-p", Fchar_table_p, 1, 1, 0, /* Return non-nil if OBJECT is a char table. @@ -543,7 +521,7 @@ } void -fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) +fill_char_table (struct Lisp_Char_Table *ct, Lisp_Object value) { int i; @@ -563,7 +541,7 @@ */ (table)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; CHECK_CHAR_TABLE (table); ct = XCHAR_TABLE (table); @@ -599,11 +577,11 @@ */ (type)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; Lisp_Object obj; enum char_table_type ty = symbol_to_char_table_type (type); - ct = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); + ct = alloc_lcrecord_type (struct Lisp_Char_Table, &lrecord_char_table); ct->type = ty; if (ty == CHAR_TABLE_TYPE_SYNTAX) { @@ -631,8 +609,9 @@ { Lisp_Object obj; int i; - Lisp_Char_Table_Entry *cte = - alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry); + struct Lisp_Char_Table_Entry *cte = + alloc_lcrecord_type (struct Lisp_Char_Table_Entry, + &lrecord_char_table_entry); for (i = 0; i < 96; i++) cte->level2[i] = initval; @@ -644,11 +623,12 @@ static Lisp_Object copy_char_table_entry (Lisp_Object entry) { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry); Lisp_Object obj; int i; - Lisp_Char_Table_Entry *ctenew = - alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry); + struct Lisp_Char_Table_Entry *ctenew = + alloc_lcrecord_type (struct Lisp_Char_Table_Entry, + &lrecord_char_table_entry); for (i = 0; i < 96; i++) { @@ -672,13 +652,13 @@ */ (old_table)) { - Lisp_Char_Table *ct, *ctnew; + struct Lisp_Char_Table *ct, *ctnew; Lisp_Object obj; int i; CHECK_CHAR_TABLE (old_table); ct = XCHAR_TABLE (old_table); - ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); + ctnew = alloc_lcrecord_type (struct Lisp_Char_Table, &lrecord_char_table); ctnew->type = ct->type; for (i = 0; i < NUM_ASCII_CHARS; i++) @@ -707,13 +687,7 @@ ctnew->mirror_table = Fcopy_char_table (ct->mirror_table); else ctnew->mirror_table = ct->mirror_table; - ctnew->next_table = Qnil; XSETCHAR_TABLE (obj, ctnew); - if (ctnew->type == CHAR_TABLE_TYPE_SYNTAX) - { - ctnew->next_table = Vall_syntax_tables; - Vall_syntax_tables = obj; - } return obj; } @@ -733,7 +707,7 @@ #else /* MULE */ else if (VECTORP (range)) { - Lisp_Vector *vec = XVECTOR (range); + struct Lisp_Vector *vec = XVECTOR (range); Lisp_Object *elts = vector_data (vec); if (vector_length (vec) != 2) signal_simple_error ("Length of charset row vector must be 2", @@ -773,7 +747,7 @@ /* called from CHAR_TABLE_VALUE(). */ Lisp_Object -get_non_ascii_char_table_value (Lisp_Char_Table *ct, int leading_byte, +get_non_ascii_char_table_value (struct Lisp_Char_Table *ct, int leading_byte, Emchar c) { Lisp_Object val; @@ -784,7 +758,7 @@ val = ct->level1[leading_byte - MIN_LEADING_BYTE]; if (CHAR_TABLE_ENTRYP (val)) { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); val = cte->level2[byte1 - 32]; if (CHAR_TABLE_ENTRYP (val)) { @@ -801,7 +775,7 @@ #endif /* MULE */ Lisp_Object -get_char_table (Emchar ch, Lisp_Char_Table *ct) +get_char_table (Emchar ch, struct Lisp_Char_Table *ct) { #ifdef MULE { @@ -821,7 +795,7 @@ val = ct->level1[lb]; if (CHAR_TABLE_ENTRYP (val)) { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); val = cte->level2[byte1 - 32]; if (CHAR_TABLE_ENTRYP (val)) { @@ -846,7 +820,7 @@ */ (ch, table)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; CHECK_CHAR_TABLE (table); ct = XCHAR_TABLE (table); @@ -861,7 +835,7 @@ */ (range, table, multi)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; struct chartab_range rainj; if (CHAR_OR_CHAR_INTP (range)) @@ -1046,7 +1020,7 @@ /* Assign VAL to all characters in RANGE in char table CT. */ void -put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, +put_char_table (struct Lisp_Char_Table *ct, struct chartab_range *range, Lisp_Object val) { switch (range->type) @@ -1079,7 +1053,7 @@ case CHARTAB_RANGE_ROW: { - Lisp_Char_Table_Entry *cte; + struct Lisp_Char_Table_Entry *cte; int lb = XCHARSET_LEADING_BYTE (range->charset) - MIN_LEADING_BYTE; /* make sure that there is a separate entry for the row. */ if (!CHAR_TABLE_ENTRYP (ct->level1[lb])) @@ -1103,7 +1077,7 @@ ct->ascii[byte1 + 128] = val; else { - Lisp_Char_Table_Entry *cte; + struct Lisp_Char_Table_Entry *cte; int lb = XCHARSET_LEADING_BYTE (charset) - MIN_LEADING_BYTE; /* make sure that there is a separate entry for the row. */ if (!CHAR_TABLE_ENTRYP (ct->level1[lb])) @@ -1154,7 +1128,7 @@ */ (range, val, table)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; struct chartab_range rainj; CHECK_CHAR_TABLE (table); @@ -1169,7 +1143,7 @@ /* Map FN over the ASCII chars in CT. */ static int -map_over_charset_ascii (Lisp_Char_Table *ct, +map_over_charset_ascii (struct Lisp_Char_Table *ct, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg) @@ -1199,7 +1173,7 @@ /* Map FN over the Control-1 chars in CT. */ static int -map_over_charset_control_1 (Lisp_Char_Table *ct, +map_over_charset_control_1 (struct Lisp_Char_Table *ct, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg) @@ -1225,7 +1199,7 @@ CTE specifies the char table entry for CHARSET. */ static int -map_over_charset_row (Lisp_Char_Table_Entry *cte, +map_over_charset_row (struct Lisp_Char_Table_Entry *cte, Lisp_Object charset, int row, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), @@ -1265,7 +1239,7 @@ static int -map_over_other_charset (Lisp_Char_Table *ct, int lb, +map_over_other_charset (struct Lisp_Char_Table *ct, int lb, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg) @@ -1288,7 +1262,7 @@ } { - Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); + struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); int charset94_p = (XCHARSET_CHARS (charset) == 94); int start = charset94_p ? 33 : 32; int stop = charset94_p ? 127 : 128; @@ -1322,7 +1296,7 @@ becomes the return value of map_char_table(). */ int -map_char_table (Lisp_Char_Table *ct, +map_char_table (struct Lisp_Char_Table *ct, struct chartab_range *range, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), @@ -1449,7 +1423,7 @@ */ (function, table, range)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; struct slow_map_char_table_arg slarg; struct gcpro gcpro1, gcpro2; struct chartab_range rainj; @@ -1617,7 +1591,7 @@ unsigned int designator, unsigned int not) { REGISTER Lisp_Object temp; - Lisp_Char_Table *ctbl; + struct Lisp_Char_Table *ctbl; #ifdef ERROR_CHECK_TYPECHECK if (NILP (Fcategory_table_p (table))) signal_simple_error ("Expected category table", table); @@ -1735,80 +1709,13 @@ return CATEGORY_TABLE_VALUEP (obj) ? Qt : Qnil; } - -#define CATEGORYP(x) \ - (CHARP (x) && XCHAR (x) >= 0x20 && XCHAR (x) <= 0x7E) - -#define CATEGORY_SET(c) \ - (get_char_table(c, XCHAR_TABLE(current_buffer->category_table))) - -/* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. - The faster version of `!NILP (Faref (category_set, category))'. */ -#define CATEGORY_MEMBER(category, category_set) \ - (bit_vector_bit(XBIT_VECTOR (category_set), category - 32)) - -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. - Use the macro WORD_BOUNDARY_P instead of calling this function - directly. */ - -int word_boundary_p (Emchar c1, Emchar c2); -int -word_boundary_p (Emchar c1, Emchar c2) -{ - Lisp_Object category_set1, category_set2; - Lisp_Object tail; - int default_result; - -#if 0 - if (COMPOSITE_CHAR_P (c1)) - c1 = cmpchar_component (c1, 0, 1); - if (COMPOSITE_CHAR_P (c2)) - c2 = cmpchar_component (c2, 0, 1); -#endif - - if (EQ (CHAR_CHARSET (c1), CHAR_CHARSET (c2))) - { - tail = Vword_separating_categories; - default_result = 0; - } - else - { - tail = Vword_combining_categories; - default_result = 1; - } - - category_set1 = CATEGORY_SET (c1); - if (NILP (category_set1)) - return default_result; - category_set2 = CATEGORY_SET (c2); - if (NILP (category_set2)) - return default_result; - - for (; CONSP (tail); tail = XCONS (tail)->cdr) - { - Lisp_Object elt = XCONS(tail)->car; - - if (CONSP (elt) - && CATEGORYP (XCONS (elt)->car) - && CATEGORYP (XCONS (elt)->cdr) - && CATEGORY_MEMBER (XCHAR (XCONS (elt)->car), category_set1) - && CATEGORY_MEMBER (XCHAR (XCONS (elt)->cdr), category_set2)) - return !default_result; - } - return default_result; -} #endif /* MULE */ 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"); @@ -1843,14 +1750,8 @@ DEFSUBR (Fcategory_table_value_p); #endif /* MULE */ -} - -void -vars_of_chartab (void) -{ /* DO NOT staticpro this. It works just like Vweak_hash_tables. */ Vall_syntax_tables = Qnil; - pdump_wire_list (&Vall_syntax_tables); } void @@ -1874,50 +1775,5 @@ Vstandard_category_table = Qnil; Vstandard_category_table = Fcopy_category_table (Qnil); staticpro (&Vstandard_category_table); - - DEFVAR_LISP ("word-combining-categories", &Vword_combining_categories /* -List of pair (cons) of categories to determine word boundary. - -Emacs treats a sequence of word constituent characters as a single -word (i.e. finds no word boundary between them) iff they belongs to -the same charset. But, exceptions are allowed in the following cases. - -(1) The case that characters are in different charsets is controlled -by the variable `word-combining-categories'. - -Emacs finds no word boundary between characters of different charsets -if they have categories matching some element of this list. - -More precisely, if an element of this list is a cons of category CAT1 -and CAT2, and a multibyte character C1 which has CAT1 is followed by -C2 which has CAT2, there's no word boundary between C1 and C2. - -For instance, to tell that ASCII characters and Latin-1 characters can -form a single word, the element `(?l . ?l)' should be in this list -because both characters have the category `l' (Latin characters). - -(2) The case that character are in the same charset is controlled by -the variable `word-separating-categories'. - -Emacs find a word boundary between characters of the same charset -if they have categories matching some element of this list. - -More precisely, if an element of this list is a cons of category CAT1 -and CAT2, and a multibyte character C1 which has CAT1 is followed by -C2 which has CAT2, there's a word boundary between C1 and C2. - -For instance, to tell that there's a word boundary between Japanese -Hiragana and Japanese Kanji (both are in the same charset), the -element `(?H . ?C) should be in this list. -*/ ); - - Vword_combining_categories = Qnil; - - DEFVAR_LISP ("word-separating-categories", &Vword_separating_categories /* -List of pair (cons) of categories to determine word boundary. -See the documentation of the variable `word-combining-categories'. -*/ ); - - Vword_separating_categories = Qnil; #endif /* MULE */ } diff -r 12e008d41344 -r 697ef44129c6 src/chartab.h --- a/src/chartab.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/chartab.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,8 +24,8 @@ This file was written independently of the FSF implementation, and is not compatible. */ -#ifndef INCLUDED_chartab_h_ -#define INCLUDED_chartab_h_ +#ifndef _MULE_CHARTAB_H +#define _MULE_CHARTAB_H /************************************************************************/ /* Char Tables */ @@ -37,6 +37,15 @@ #ifdef MULE +DECLARE_LRECORD (char_table_entry, struct Lisp_Char_Table_Entry); +#define XCHAR_TABLE_ENTRY(x) \ + XRECORD (x, char_table_entry, struct Lisp_Char_Table_Entry) +#define XSETCHAR_TABLE_ENTRY(x, p) XSETRECORD (x, p, char_table_entry) +#define CHAR_TABLE_ENTRYP(x) RECORDP (x, char_table_entry) +#define GC_CHAR_TABLE_ENTRYP(x) GC_RECORDP (x, char_table_entry) +/* #define CHECK_CHAR_TABLE_ENTRY(x) CHECK_RECORD (x, char_table_entry) + char table entries should never escape to Lisp */ + struct Lisp_Char_Table_Entry { struct lcrecord_header header; @@ -46,18 +55,21 @@ variable-size and add an offset value into this structure. */ Lisp_Object level2[96]; }; -typedef struct Lisp_Char_Table_Entry Lisp_Char_Table_Entry; - -DECLARE_LRECORD (char_table_entry, Lisp_Char_Table_Entry); -#define XCHAR_TABLE_ENTRY(x) \ - XRECORD (x, char_table_entry, Lisp_Char_Table_Entry) -#define XSETCHAR_TABLE_ENTRY(x, p) XSETRECORD (x, p, char_table_entry) -#define CHAR_TABLE_ENTRYP(x) RECORDP (x, char_table_entry) -/* #define CHECK_CHAR_TABLE_ENTRY(x) CHECK_RECORD (x, char_table_entry) - char table entries should never escape to Lisp */ #endif /* MULE */ +DECLARE_LRECORD (char_table, struct Lisp_Char_Table); +#define XCHAR_TABLE(x) \ + XRECORD (x, char_table, struct Lisp_Char_Table) +#define XSETCHAR_TABLE(x, p) XSETRECORD (x, p, char_table) +#define CHAR_TABLEP(x) RECORDP (x, char_table) +#define GC_CHAR_TABLEP(x) GC_RECORDP (x, char_table) +#define CHECK_CHAR_TABLE(x) CHECK_RECORD (x, char_table) +#define CONCHECK_CHAR_TABLE(x) CONCHECK_RECORD (x, char_table) + +#define CHAR_TABLE_TYPE(ct) ((ct)->type) +#define XCHAR_TABLE_TYPE(ct) CHAR_TABLE_TYPE (XCHAR_TABLE (ct)) + enum char_table_type { CHAR_TABLE_TYPE_GENERIC, @@ -117,28 +129,17 @@ Lisp_Object mirror_table; Lisp_Object next_table; /* DO NOT mark through this. */ }; -typedef struct Lisp_Char_Table Lisp_Char_Table; - -DECLARE_LRECORD (char_table, Lisp_Char_Table); -#define XCHAR_TABLE(x) XRECORD (x, char_table, Lisp_Char_Table) -#define XSETCHAR_TABLE(x, p) XSETRECORD (x, p, char_table) -#define CHAR_TABLEP(x) RECORDP (x, char_table) -#define CHECK_CHAR_TABLE(x) CHECK_RECORD (x, char_table) -#define CONCHECK_CHAR_TABLE(x) CONCHECK_RECORD (x, char_table) - -#define CHAR_TABLE_TYPE(ct) ((ct)->type) -#define XCHAR_TABLE_TYPE(ct) CHAR_TABLE_TYPE (XCHAR_TABLE (ct)) #ifdef MULE -Lisp_Object get_non_ascii_char_table_value (Lisp_Char_Table *ct, - int leading_byte, - Emchar c); +Lisp_Object get_non_ascii_char_table_value (struct Lisp_Char_Table *ct, + int leading_byte, + Emchar c); -INLINE_HEADER Lisp_Object -CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch); -INLINE_HEADER Lisp_Object -CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch) +INLINE Lisp_Object +CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (struct Lisp_Char_Table *ct, Emchar ch); +INLINE Lisp_Object +CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (struct Lisp_Char_Table *ct, Emchar ch) { unsigned char lb = CHAR_LEADING_BYTE (ch); if (!CHAR_TABLE_ENTRYP ((ct)->level1[lb - MIN_LEADING_BYTE])) @@ -158,9 +159,6 @@ #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, @@ -179,16 +177,16 @@ int row; }; -void fill_char_table (Lisp_Char_Table *ct, Lisp_Object value); -void put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, +void fill_char_table (struct Lisp_Char_Table *ct, Lisp_Object value); +void put_char_table (struct Lisp_Char_Table *ct, struct chartab_range *range, Lisp_Object val); -Lisp_Object get_char_table (Emchar, Lisp_Char_Table *); -int map_char_table (Lisp_Char_Table *ct, +Lisp_Object get_char_table (Emchar, struct Lisp_Char_Table *); +int map_char_table (struct Lisp_Char_Table *ct, struct chartab_range *range, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg); -void prune_syntax_tables (void); +void prune_syntax_tables (int (*obj_marked_p) (Lisp_Object)); EXFUN (Fcopy_char_table, 1); EXFUN (Fmake_char_table, 1); @@ -233,4 +231,4 @@ #endif /* MULE */ -#endif /* INCLUDED_chartab_h_ */ +#endif /* _MULE_CHARTAB_H */ diff -r 12e008d41344 -r 697ef44129c6 src/cm.c --- a/src/cm.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/cm.c Mon Aug 13 11:20:41 2007 +0200 @@ -33,8 +33,14 @@ #define EXPENSIVE 2000 -EXTERN_C char *tgoto (const char *cm, int hpos, int vpos); -EXTERN_C int tputs (const char *, int, void (*)(int)); +#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 static void cmgoto_for_real (struct console *c, int row, int col); diff -r 12e008d41344 -r 697ef44129c6 src/cm.h --- a/src/cm.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/cm.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* #### Chuck -- This file should be deleted. I'm not deleting it yet because there might be something you want out of it. */ -#ifndef INCLUDED_cm_h_ -#define INCLUDED_cm_h_ +#ifndef _XEMACS_CM_H_ +#define _XEMACS_CM_H_ /* Holds the minimum and maximum costs for the parametrized capabilities. */ struct parmcap @@ -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) */ @@ -181,4 +181,4 @@ void Wcm_clear (void); int Wcm_init (void); -#endif /* INCLUDED_cm_h_ */ +#endif /* _XEMACS_CM_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/cmdloop.c --- a/src/cmdloop.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/cmdloop.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,6 +40,9 @@ /* Current depth in recursive edits. */ int command_loop_level; +/* Total number of times command_loop has read a key sequence. */ +int num_input_keys; + #ifndef LISP_COMMAND_LOOP /* Form to evaluate (if non-nil) when Emacs is started. */ Lisp_Object Vtop_level; @@ -121,10 +124,6 @@ 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)); } @@ -522,8 +521,8 @@ like the real thing. This is slightly bogus, but it's in here for compatibility with Emacs 18. It's not even clear what the "right thing" is. */ - if (!((STRINGP (Vexecuting_macro) || VECTORP (Vexecuting_macro)) - && XINT (Flength (Vexecuting_macro)) == 1)) + if (!(((STRINGP (Vexecuting_macro) || VECTORP (Vexecuting_macro)) + && XINT (Flength (Vexecuting_macro)) == 1))) Vlast_command = Qt; #ifndef LISP_COMMAND_LOOP @@ -537,7 +536,7 @@ focus is selected. */ if (focus_follows_mouse) investigate_frame_change (); - + /* Make sure the current window's buffer is selected. */ { Lisp_Object selected_window = Fselected_window (Qnil); diff -r 12e008d41344 -r 697ef44129c6 src/cmds.c --- a/src/cmds.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/cmds.c Mon Aug 13 11:20:41 2007 +0200 @@ -41,9 +41,6 @@ /* 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). @@ -330,7 +327,7 @@ REGISTER enum syntaxcode synt; REGISTER Emchar c2; Lisp_Object overwrite; - Lisp_Char_Table *syntax_table; + struct Lisp_Char_Table *syntax_table; struct buffer *buf = current_buffer; int tab_width; @@ -399,9 +396,7 @@ #endif /* FSFmacs */ } } - if ((CHAR_TABLEP (Vauto_fill_chars) - ? !NILP (XCHAR_TABLE_VALUE_UNSAFE (Vauto_fill_chars, c1)) - : (c1 == ' ' || c1 == '\n')) + if ((c1 == ' ' || c1 == '\n') && !noautofill && !NILP (buf->auto_fill_function)) { @@ -503,12 +498,4 @@ 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 12e008d41344 -r 697ef44129c6 src/commands.h --- a/src/commands.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/commands.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_commands_h_ -#define INCLUDED_commands_h_ +#ifndef _XEMACS_COMMANDS_H_ +#define _XEMACS_COMMANDS_H_ #if 0 /* FSFmacs */ #define Ctl(c) ((c)&037) @@ -125,4 +125,4 @@ extern Lisp_Object Vthis_command_keys; /* event-stream.c */ -#endif /* INCLUDED_commands_h_ */ +#endif /* _XEMACS_COMMANDS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/config.h.in --- a/src/config.h.in Mon Aug 13 11:19:22 2007 +0200 +++ b/src/config.h.in Mon Aug 13 11:20:41 2007 +0200 @@ -26,7 +26,6 @@ #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 @@ -39,17 +38,15 @@ #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 @@ -64,7 +61,6 @@ /* The version info from version.sh. Used in #pragma ident in emacs.c */ #undef EMACS_MAJOR_VERSION #undef EMACS_MINOR_VERSION -#undef EMACS_PATCH_LEVEL #undef EMACS_BETA_VERSION #undef EMACS_VERSION #undef XEMACS_CODENAME @@ -73,24 +69,12 @@ #undef INFODOCK_MINOR_VERSION #undef INFODOCK_BUILD_VERSION -/* Make all functions from all IEEE Stds 1003.[123] available. */ -#undef _POSIX_C_SOURCE - -/* Make all 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 @@ -179,8 +163,6 @@ #undef THIS_IS_X11R5 #undef THIS_IS_X11R6 -#undef HAVE_XCONVERTCASE - /* Where do we find bitmaps? */ #undef BITMAPDIR @@ -201,31 +183,30 @@ /* 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_MACH_MACH_H +#undef HAVE_SYS_STROPTS_H +#undef HAVE_SYS_TIMEB_H +#undef HAVE_SYS_TIME_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_MACH_MACH_H -#undef HAVE_SYS_PARAM_H -#undef HAVE_SYS_PSTAT_H -#undef HAVE_SYS_STROPTS_H -#undef HAVE_SYS_TIME_H -#undef HAVE_SYS_TIMEB_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_ULIMIT_H -#undef HAVE_UNISTD_H -#undef HAVE_UTIME_H - -#undef HAVE_SYS_WAIT_H -#undef HAVE_LIBINTL_H -#undef HAVE_X11_XLOCALE_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 @@ -285,14 +266,11 @@ #undef HAVE_FPATHCONF #undef HAVE_FREXP #undef HAVE_FTIME -#undef HAVE_GETADDRINFO #undef HAVE_GETHOSTNAME -#undef HAVE_GETNAMEINFO #undef HAVE_GETPAGESIZE #undef HAVE_GETTIMEOFDAY #undef HAVE_GETWD #undef HAVE_GETCWD -#undef HAVE_GETPT #undef HAVE_LOGB #undef HAVE_LRAND48 #undef HAVE_MATHERR @@ -315,7 +293,6 @@ #undef HAVE_SIGPROCMASK #undef HAVE_SIGSETJMP #undef HAVE_SNPRINTF -#undef HAVE_STPCPY #undef HAVE_STRCASECMP #undef HAVE_STRERROR #undef HAVE_TZSET @@ -328,11 +305,6 @@ #undef HAVE_SOCKADDR_SUN_LEN #undef HAVE_MULTICAST #undef HAVE_SYSVIPC -#undef HAVE_LOCKF -#undef HAVE_FLOCK -#undef HAVE_FSYNC -#undef HAVE_FTRUNCATE -#undef HAVE_UMASK #undef SYSV_SYSTEM_DIR #undef NONSYSTEM_DIR_LIBRARY @@ -377,26 +349,17 @@ /* 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_FILE +#undef DB_H_PATH /* Do we have either DBM or Berkeley DB database support? */ #undef HAVE_DATABASE /* Do we have LDAP support? */ #undef HAVE_LDAP -/* Does the library define ldap_set_option () ? */ -#undef HAVE_LDAP_SET_OPTION -/* Does the library define ldap_get_lderrno () ? */ -#undef HAVE_LDAP_GET_LDERRNO -/* Does the library define ldap_result2error () ? */ -#undef HAVE_LDAP_RESULT2ERROR -/* 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 we have the LDAP library of the University of Michigan ? */ +#undef HAVE_UMICH_LDAP +/* Do we have Netscape LDAP SDK library */ +#undef HAVE_NS_LDAP /* Do you have the Xauth library present? This will add some extra functionality to gnuserv. */ @@ -408,8 +371,8 @@ /* Compile in support for ncurses? */ #undef HAVE_NCURSES /* Full #include file paths for ncurses' curses.h and term.h. */ -#undef CURSES_H_FILE -#undef TERM_H_FILE +#undef CURSES_H_PATH +#undef TERM_H_PATH /* Define USE_ASSERTIONS if you want the abort() to be changed to assert(). If the assertion fails, assert_failed() will be called. This is @@ -425,45 +388,18 @@ /* Check the entire extent structure of a buffer each time an extent change is done, and do other extent-related checks. */ #undef ERROR_CHECK_EXTENTS - /* Make sure that all X... macros are dereferencing the correct type, and that all XSET... macros (as much as possible) are setting the correct type of structure. Highly recommended for all development work. */ #undef ERROR_CHECK_TYPECHECK -#ifdef ERROR_CHECK_TYPECHECK -#define type_checking_assert(assertion) assert (assertion) -#else -#define type_checking_assert(assertion) -#endif - /* Make sure valid buffer positions are passed to BUF_* macros. */ #undef ERROR_CHECK_BUFPOS -#ifdef ERROR_CHECK_BUFPOS -#define bufpos_checking_assert(assertion) assert (assertion) -#else -#define bufpos_checking_assert(assertion) -#endif - /* 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 -/* Minor sanity checking of the bytecode interpreter. Useful for - 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 @@ -517,8 +453,8 @@ /* Compile in generic Drag'n'Drop API */ #undef HAVE_DRAGNDROP -/* Compile in support for proper handling of WM_COMMAND. */ -#undef HAVE_WMCOMMAND +/* Compile in support for proper session-management. */ +#undef HAVE_SESSION /* Define this if you want Mule support (multi-byte character support). There may be some performance penalty, although it should be small @@ -543,28 +479,15 @@ /* Enable special GNU Make features in the Makefiles. */ #undef USE_GNU_MAKE -/* 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 +/* 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 /* Defined by AC_C_CONST in configure.in */ #undef const -/* Allow the source to use standard types. Include these before the - s&m files so that they can use them. */ -#undef ssize_t -#undef size_t -#undef pid_t -#undef mode_t -#undef off_t -#undef uid_t -#undef gid_t -#undef socklen_t +#define CONST const /* If defined, use unions instead of ints. A few systems (DEC Alpha) seem to require this, probably because something with the int @@ -617,6 +540,14 @@ #define SIGRETURN return #endif +/* Allow the source to use standard types */ +#undef size_t +#undef pid_t +#undef mode_t +#undef off_t +#undef uid_t +#undef gid_t + /* Define DYNODUMP if it is necessary to properly dump on this system. Currently this is only Solaris 2.x, for x < 6. */ #undef DYNODUMP @@ -630,7 +561,7 @@ "SUNWaudmo" package.) */ #undef HAVE_NATIVE_SOUND /* Native sound may be provided via soundcard.h, in various directories */ -#undef SOUNDCARD_H_FILE +#undef SOUNDCARD_H_PATH /* Compile in support for NAS (Network Audio System)? NAS_NO_ERROR_JUMP means that the NAS libraries don't include some @@ -638,16 +569,13 @@ #undef HAVE_NAS_SOUND #undef NAS_NO_ERROR_JUMP -/* Compile in support for ESD (Enlightened Sound Daemon)? */ -#undef HAVE_ESD_SOUND - /* Compile in support for SunPro usage-tracking code? */ #undef USAGE_TRACKING /* Compile in support for Tooltalk? */ #undef TOOLTALK /* tt_c.h might be in "Tt" or "desktop" subdirectories */ -#undef TT_C_H_FILE +#undef TT_C_H_PATH /* Toolkits used by lwlib for various widgets... */ #undef LWLIB_USES_MOTIF @@ -661,17 +589,12 @@ #undef LWLIB_DIALOGS_MOTIF #undef LWLIB_DIALOGS_ATHENA #undef LWLIB_DIALOGS_ATHENA3D -#undef LWLIB_TABS_LUCID -#undef LWLIB_WIDGETS_MOTIF -#undef LWLIB_WIDGETS_ATHENA -#undef HAVE_ATHENA_3D /* Other things that can be disabled by configure. */ #undef HAVE_MENUBARS #undef HAVE_SCROLLBARS #undef HAVE_DIALOGS #undef HAVE_TOOLBARS -#undef HAVE_WIDGETS #if defined (HAVE_MENUBARS) || defined (HAVE_DIALOGS) @@ -765,6 +688,10 @@ # 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 @@ -788,35 +715,38 @@ #define LONG_LONG_BITS (SIZEOF_LONG_LONG * BITS_PER_CHAR) #define VOID_P_BITS (SIZEOF_VOID_P * BITS_PER_CHAR) -/* 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. */ - +#ifndef NOT_C_CODE +#ifdef __cplusplus +#define HAVE_INLINE 1 +#define INLINE inline +#else /* not C++ */ /* Does the keyword `inline' exist? */ +#undef HAVE_INLINE #undef inline -#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 +# 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 */ -#ifndef NOT_C_CODE /* Actually means C or C++ */ -# if defined (__cplusplus) +#if defined (__cplusplus) && !defined (NOT_C_CODE) /* 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 class c_class +#define new c_new +#define this c_this +#define catch c_catch +#endif /* C++ */ /* Strictly speaking, only int or unsigned int are valid types in a bitfield. In practice, we would like to use enums as bitfields. @@ -848,25 +778,25 @@ /* Should movemail use hesiod for getting POP server host? */ #undef HESIOD /* Determine type of mail locking. */ -#undef MAIL_LOCK_LOCKF -#undef MAIL_LOCK_FLOCK -#undef MAIL_LOCK_DOT -#undef MAIL_LOCK_LOCKING -#undef MAIL_LOCK_MMDF +/* Play preprocessor games so that configure options override s&m files */ +#undef REAL_MAIL_USE_LOCKF +#undef REAL_MAIL_USE_FLOCK +#undef MAIL_USE_LOCKF +#undef MAIL_USE_FLOCK +#ifdef REAL_MAIL_USE_FLOCK +#define MAIL_USE_FLOCK +#endif +#ifdef REAL_MAIL_USE_LOCKF +#define MAIL_USE_LOCKF +#endif -#undef PREFIX_USER_DEFINED -#undef EXEC_PREFIX_USER_DEFINED -#undef MODULEDIR_USER_DEFINED -#undef SITEMODULEDIR_USER_DEFINED -#undef DOCDIR_USER_DEFINED #undef LISPDIR_USER_DEFINED #undef PACKAGE_PATH_USER_DEFINED #undef SITELISPDIR_USER_DEFINED #undef ARCHLIBDIR_USER_DEFINED #undef ETCDIR_USER_DEFINED +#undef LOCKDIR_USER_DEFINED #undef INFODIR_USER_DEFINED #undef INFOPATH_USER_DEFINED -#undef PDUMP - #endif /* _SRC_CONFIG_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/conslots.h --- a/src/conslots.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/conslots.h Mon Aug 13 11:20:41 2007 +0200 @@ -25,10 +25,6 @@ definition. In the garbage collector this file is included after defining MARKED_SLOT(x) to be mark_object(console->x). */ -#ifndef CONSOLE_SLOTS_FIRST_NAME -#define CONSOLE_SLOTS_FIRST_NAME name -#endif - /* Name of this console, for resourcing and printing purposes. If not explicitly given, it's initialized in a console-specific manner. */ @@ -97,7 +93,4 @@ Initialized by the terminal-specific lisp files. */ MARKED_SLOT (function_key_map); -#ifndef CONSOLE_SLOTS_LAST_NAME -#define CONSOLE_SLOTS_LAST_NAME function_key_map -#endif diff -r 12e008d41344 -r 697ef44129c6 src/console-msw.c --- a/src/console-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ /* Console functions for mswindows. - Copyright (C) 1996, 2000 Ben Wing. + Copyright (C) 1996 Ben Wing. This file is part of XEmacs. @@ -29,53 +29,11 @@ #include <config.h> #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 */ -/************************************************************************/ static int mswindows_initially_selected_for_input (struct console *con) @@ -83,469 +41,7 @@ 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) -{ - /* Do not allow more than one mswindows device, by explicitly - requiring that CONNECTION is nil, the only allowed connection in - Windows. */ - if (!NILP (connection)) - { - if (ERRB_EQ (errb, ERROR_ME)) - signal_simple_error - ("Invalid (non-nil) connection for mswindows device/console", - connection); - else - return Qunbound; - } - - return Qnil; -} - -static Lisp_Object -mswindows_canonicalize_device_connection (Lisp_Object connection, - Error_behavior errb) -{ - return mswindows_canonicalize_console_connection (connection, errb); -} - -void -mswindows_hide_console (void) -{ - ShowWindow (mswindows_get_console_hwnd (), SW_HIDE); -} - -void -mswindows_show_console (void) -{ - HWND hwnd = mswindows_get_console_hwnd (); - ShowWindow (hwnd, SW_SHOWNA); - - /* I tried to raise the window to the top without activating - it, but this fails. Apparently Windows just doesn't like - having the active window not be on top. So instead, we - at least put it just below our own window, where part of it - will likely be seen. */ - SetWindowPos (hwnd, GetForegroundWindow (), 0, 0, 0, 0, - SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING | - SWP_NOACTIVATE); -} - -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; -} - - -#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 (noninteractive) - return Qcancel; - - if (!CONSP (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); -} /************************************************************************/ @@ -555,42 +51,6 @@ void syms_of_console_mswindows (void) { - 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 @@ -603,19 +63,10 @@ /* CONSOLE_HAS_METHOD (mswindows, mark_console); */ CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input); /* CONSOLE_HAS_METHOD (mswindows, delete_console); */ - CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); - CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); +/* CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); */ +/* CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); */ /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ - - INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); -} - -void -reinit_console_type_create_mswindows (void) -{ - REINITIALIZE_CONSOLE_TYPE (mswindows); - REINITIALIZE_CONSOLE_TYPE (msprinter); } void @@ -623,3 +74,68 @@ { 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; +} + +struct Lisp_Event * +DEVENT (Lisp_Object obj) +{ + return EVENTP (obj) ? XEVENT (obj) : NULL; +} + +struct Lisp_Cons * +DCONS (Lisp_Object obj) +{ + return CONSP (obj) ? XCONS (obj) : NULL; +} + +struct 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; +} + +struct Lisp_Vector * +DVECTOR (Lisp_Object obj) +{ + return VECTORP (obj) ? XVECTOR (obj) : NULL; +} + +struct 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 diff -r 12e008d41344 -r 697ef44129c6 src/console-msw.h --- a/src/console-msw.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-msw.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,24 +29,46 @@ Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. */ -#ifndef INCLUDED_console_msw_h_ -#define INCLUDED_console_msw_h_ +#ifndef _XEMACS_CONSOLE_MSW_H_ +#define _XEMACS_CONSOLE_MSW_H_ #include "console.h" -#include "syswindows.h" -#include "syscommctrl.h" +#ifdef CONST /* I suspect this is safe */ +#undef CONST +#endif +#include <windows.h> +#include <ddeml.h> /* DDE management library */ +#if !defined (__CYGWIN32__) && !defined(__MINGW32__) +#include <shellapi.h> /* FileManager/Explorer drag and drop */ +#include <commctrl.h> +#endif #ifdef HAVE_XPM #include <X11/xpm.h> #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" /* - * Consoles + * Console */ DECLARE_CONSOLE_TYPE (mswindows); @@ -56,105 +78,44 @@ int infd, outfd; }; -DECLARE_CONSOLE_TYPE (msprinter); /* - * 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 accomodate, 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 + * Device */ #define MSW_FONTSIZE (LF_FACESIZE*4+12) +struct mswindows_font_enum +{ + char fontname[MSW_FONTSIZE]; + struct mswindows_font_enum *next; +}; + struct mswindows_device { - Lisp_Object fontlist; /* List of strings, device fonts */ - HDC hcdc; /* Compatible DC */ - DWORD update_tick; /* Used when device is modified through - Windows mwssages, see WM_DISPLAYCHANGE - in event-msw.c */ + int logpixelsx, logpixelsy; + int planes, cells; + int horzres, vertres; /* Size in pixels */ + int horzsize, vertsize; /* Size in mm */ + int bitspixel; + struct mswindows_font_enum *fontlist; }; #define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows) -#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, hcdc; /* Printer and the comp. DCs */ - HANDLE hprinter; - char* name; - Lisp_Object devmode; - Lisp_Object fontlist; -}; - -#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_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 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 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) /* - * Frames + * Frame */ typedef struct { @@ -172,8 +133,8 @@ /* DC for this win32 window */ HDC hdc; - /* Used with DeferWindowPos */ - HDWP hdwp; + /* compatible DC for bitmap operations */ + HDC cdc; /* Time of last click event, for button 2 emul */ DWORD last_click_time; @@ -193,7 +154,7 @@ unsigned int menu_checksum; /* Widget glyphs attached to this frame. See glyphs-msw.c */ - Lisp_Object widget_hash_table1, widget_hash_table2, widget_hash_table3; + Lisp_Object widget_hash_table; /* Frame title hash value. See frame-msw.c */ unsigned int title_checksum; @@ -209,7 +170,6 @@ 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 */ /* Geometry, in characters, as specified by proplist during frame creation. Memebers are set to -1 for unspecified */ @@ -220,15 +180,12 @@ #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_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_WIDGET_HASH_TABLE(f) \ + (FRAME_MSWINDOWS_DATA (f)->widget_hash_table) #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) @@ -247,31 +204,6 @@ #define XWL_COUNT 1 /* Number of LONGs that we use */ #define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT*4) -/* - * Printer frame, aka printer job - */ - -struct msprinter_frame -{ - int left_margin, top_margin, /* All in twips */ - right_margin, bottom_margin; - int charheight, charwidth; /* As per proplist or -1 if not gven */ - 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) -#define FRAME_MSPRINTER_LEFT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->left_margin) -#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_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started) -#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 @@ -292,15 +224,11 @@ /* win32 "Windows" procedure */ LRESULT WINAPI mswindows_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -LRESULT WINAPI mswindows_control_wnd_proc (HWND hwnd, - UINT msg, WPARAM wParam, - LPARAM lParam); void mswindows_redraw_exposed_area (struct frame *f, int x, int y, int width, int height); void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest); -HWND mswindows_get_selected_frame_hwnd (void); -void mswindows_enqueue_magic_event (HWND hwnd, UINT msg); +void mswindows_enqueue_magic_event (HWND hwnd, UINT message); /* win32 DDE management library */ #define MSWINDOWS_DDE_ITEM_OPEN "Open" @@ -309,62 +237,25 @@ 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_cancel_dispatch_event (struct 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); -COLORREF mswindows_string_to_color (const char *name); -USID emacs_mswindows_create_stream_pair (void* inhandle, void* outhandle, - Lisp_Object* instream, - Lisp_Object* outstream, - int flags); -USID emacs_mswindows_delete_stream_pair (Lisp_Object instream, - Lisp_Object outstream); - #ifdef HAVE_WIN32_PROCESSES -HANDLE get_nt_process_handle (Lisp_Process *p); +HANDLE get_nt_process_handle (struct Lisp_Process *p); #endif 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); +void mswindows_enumerate_fonts (struct device *d); -#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, LPARAM id); - -int mswindows_windows9x_p (void); - - -void mswindows_output_last_error (char *frob); - -#endif /* INCLUDED_console_msw_h_ */ +#endif /* _XEMACS_CONSOLE_MSW_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/console-stream.c --- a/src/console-stream.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-stream.c Mon Aug 13 11:20:41 2007 +0200 @@ -69,9 +69,7 @@ { CHECK_STRING (tty); stream_con->in = stream_con->out = stream_con->err = - /* #### We don't currently do coding-system translation on - this descriptor. */ - fopen ((char *) XSTRING_DATA (tty), READ_PLUS_TEXT); + fopen ((char *) XSTRING_DATA (tty), "r+"); if (!stream_con->in) error ("Unable to open tty %s", XSTRING_DATA (tty)); } @@ -173,7 +171,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; } @@ -203,6 +201,16 @@ } 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, @@ -211,6 +219,16 @@ } 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, @@ -218,6 +236,11 @@ { } +static void +stream_clear_frame (struct frame *f) +{ +} + static int stream_flash (struct device *d) { @@ -262,20 +285,19 @@ 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); } void -reinit_console_type_create_stream (void) -{ - REINITIALIZE_CONSOLE_TYPE (stream); -} - -void vars_of_console_stream (void) { DEFVAR_LISP ("terminal-console", &Vterminal_console /* @@ -298,9 +320,8 @@ staticpro (&Vstdio_str); } -#ifndef PDUMP void -init_console_stream (int reinit) +init_console_stream (void) { /* This function can GC */ if (!initialized) @@ -318,25 +339,3 @@ event_stream_select_console (XCONSOLE (Vterminal_console)); } } - -#else - -void -init_console_stream (int reinit) -{ - /* This function can GC */ - 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); - if (noninteractive) - event_stream_select_console (XCONSOLE (Vterminal_console)); - } -} -#endif diff -r 12e008d41344 -r 697ef44129c6 src/console-stream.h --- a/src/console-stream.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-stream.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_console_stream_h_ -#define INCLUDED_console_stream_h_ +#ifndef _XEMACS_CONSOLE_STREAM_H_ +#define _XEMACS_CONSOLE_STREAM_H_ #include "console.h" @@ -40,8 +40,6 @@ #define CONSOLE_STREAM_DATA(con) CONSOLE_TYPE_DATA (con, stream) -extern Lisp_Object Vterminal_console, Vterminal_frame, Vterminal_device; - Lisp_Object stream_semi_canonicalize_console_connection(Lisp_Object, Error_behavior); Lisp_Object stream_canonicalize_console_connection(Lisp_Object, @@ -50,4 +48,4 @@ Error_behavior); Lisp_Object stream_canonicalize_device_connection(Lisp_Object, Error_behavior); -#endif /* INCLUDED_console_stream_h_ */ +#endif /* _XEMACS_CONSOLE_STREAM_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/console-tty.c --- a/src/console-tty.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-tty.c Mon Aug 13 11:20:41 2007 +0200 @@ -32,18 +32,16 @@ #include "faces.h" #include "frame.h" #include "lstream.h" -#include "glyphs.h" #include "sysdep.h" #include "sysfile.h" #ifdef FILE_CODING #include "file-coding.h" #endif +#ifdef HAVE_GPM +#include "gpmevent.h" +#endif DEFINE_CONSOLE_TYPE (tty); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); Lisp_Object Qterminal_type; Lisp_Object Qcontrolling_process; @@ -115,18 +113,22 @@ 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 FILE_CODING +#ifdef MULE tty_con->instream = make_decoding_input_stream (XLSTREAM (tty_con->instream), - Fget_coding_system (Qkeyboard)); + Fget_coding_system (Vkeyboard_coding_system)); Lstream_set_character_mode (XLSTREAM (tty_con->instream)); tty_con->outstream = make_encoding_output_stream (XLSTREAM (tty_con->outstream), - Fget_coding_system (Qterminal)); -#endif /* FILE_CODING */ + Fget_coding_system (Vterminal_coding_system)); +#endif /* MULE */ tty_con->terminal_type = terminal_type; tty_con->controlling_process = controlling_process; +#ifdef HAVE_GPM + connect_to_gpm (con); +#endif + if (NILP (CONSOLE_NAME (con))) CONSOLE_NAME (con) = Ffile_name_nondirectory (tty); { @@ -159,12 +161,12 @@ } static void -tty_mark_console (struct console *con) +tty_mark_console (struct console *con, void (*markobj) (Lisp_Object)) { struct tty_console *tty_con = CONSOLE_TTY_DATA (con); - mark_object (tty_con->terminal_type); - mark_object (tty_con->instream); - mark_object (tty_con->outstream); + markobj (tty_con->terminal_type); + markobj (tty_con->instream); + markobj (tty_con->outstream); } static int @@ -253,7 +255,7 @@ { set_decoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream), - Fget_coding_system (NILP (codesys) ? Qkeyboard : codesys)); + Fget_coding_system (NILP (codesys) ? Vkeyboard_coding_system : codesys)); return Qnil; } @@ -277,13 +279,11 @@ { set_encoding_stream_coding_system (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream), - Fget_coding_system (NILP (codesys) ? Qterminal : codesys)); - /* Redraw tty */ - face_property_was_changed (Vdefault_face, Qfont, Qtty); + Fget_coding_system (NILP (codesys) ? Vterminal_coding_system : codesys)); return Qnil; } -/* #### Move this function to lisp */ +/* ### Move this function to lisp */ DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system, 0, 2, 0, /* Set the input and output coding systems of tty console CONSOLE to CODESYS. @@ -367,21 +367,6 @@ } void -reinit_console_type_create_tty (void) -{ - REINITIALIZE_CONSOLE_TYPE (tty); -} - -void -image_instantiator_format_create_glyphs_tty (void) -{ - IIFORMAT_VALID_CONSOLE (tty, nothing); - IIFORMAT_VALID_CONSOLE (tty, string); - IIFORMAT_VALID_CONSOLE (tty, formatted_string); - IIFORMAT_VALID_CONSOLE (tty, inherit); -} - -void vars_of_console_tty (void) { Fprovide (Qtty); diff -r 12e008d41344 -r 697ef44129c6 src/console-tty.h --- a/src/console-tty.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-tty.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,8 +29,8 @@ have more than one device on a TTY console, the output stuff will have to get separated out. */ -#ifndef INCLUDED_console_tty_h_ -#define INCLUDED_console_tty_h_ +#ifndef _XEMACS_CONSOLE_TTY_H_ +#define _XEMACS_CONSOLE_TTY_H_ #include "console.h" #include "syssignal.h" /* Always include before systty.h */ @@ -41,6 +41,9 @@ struct tty_console { int infd, outfd; +#ifdef HAVE_GPM + int mouse_fd; +#endif Lisp_Object instream, outstream; Lisp_Object terminal_type; Lisp_Object controlling_process; @@ -93,31 +96,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 +128,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 */ @@ -200,6 +203,9 @@ unsigned int is_stdio :1; }; +#ifdef HAVE_GPM +#define CONSOLE_TTY_MOUSE_FD(c) (CONSOLE_TTY_DATA (c)->mouse_fd) +#endif #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty) #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x) #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y) @@ -289,4 +295,4 @@ Error_behavior errb); struct console * tty_find_console_from_fd (int fd); -#endif /* INCLUDED_console_tty_h_ */ +#endif /* _XEMACS_CONSOLE_TTY_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/console-x.c --- a/src/console-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -102,7 +102,7 @@ static Lisp_Object get_display_arg_connection (void) { - const char *disp_name; + CONST char *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 @@ -140,12 +140,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, FORMAT_CTEXT); free_argc_argv (argv); return conn; } else - return build_ext_string (XDisplayName (0), Qctext); + return build_ext_string (XDisplayName (0), FORMAT_CTEXT); } /* "semi-canonicalize" means convert to a nicer form for printing, but @@ -181,7 +181,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), + else if (!strncmp ((CONST char *) XSTRING_DATA (connection), "unix:", 5)) connection = concat2 (build_string ("localhost:"), Fsubstring (connection, make_int (5), Qnil)); @@ -260,7 +260,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 ((CONST char *) XSTRING_DATA (connection) + hostname_length + display_length); connection = x_canonicalize_console_connection (connection, errb); @@ -280,9 +280,3 @@ CONSOLE_HAS_METHOD (x, initially_selected_for_input); } - -void -reinit_console_type_create_x (void) -{ - REINITIALIZE_CONSOLE_TYPE (x); -} diff -r 12e008d41344 -r 697ef44129c6 src/console-x.h --- a/src/console-x.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console-x.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,8 +29,8 @@ multi-device work by Chuck Thompson). */ -#ifndef INCLUDED_console_x_h_ -#define INCLUDED_console_x_h_ +#ifndef _XEMACS_CONSOLE_X_H_ +#define _XEMACS_CONSOLE_X_H_ #ifdef HAVE_X_WINDOWS @@ -95,7 +95,7 @@ Atom Xatom_WM_TAKE_FOCUS; Atom Xatom_WM_STATE; - /* allocated in Xatoms_of_select_x in xselect.c */ + /* allocated in Xatoms_of_xselect in xselect.c */ Atom Xatom_CLIPBOARD; Atom Xatom_TIMESTAMP; Atom Xatom_TEXT; @@ -213,7 +213,7 @@ #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_xselect in xselect.c */ #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) @@ -381,7 +381,7 @@ extern Lisp_Object Vdefault_x_device; /* Number of pixels below each line. */ -extern int x_interline_space; /* #### implement me */ +extern int x_interline_space; extern int x_selection_timeout; @@ -398,14 +398,14 @@ void x_handle_selection_clear (XSelectionClearEvent *event); void x_handle_property_notify (XPropertyEvent *event); -void Xatoms_of_select_x (struct device *d); +void Xatoms_of_xselect (struct device *d); void Xatoms_of_objects_x (struct device *d); void x_wm_set_shell_iconic_p (Widget shell, int iconic_p); 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); @@ -419,15 +419,16 @@ int start_pixpos, int width, face_index findex, int cursor, int cursor_start, int cursor_width, int cursor_height); -void x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, - int x, int y, int xoffset, int yoffset, - int width, int height, +void x_output_x_pixmap (struct frame *f, struct Lisp_Image_Instance *p, + int x, int y, int clip_x, int clip_y, + int clip_width, int clip_height, int width, + int height, int pixmap_offset, unsigned long fg, unsigned long bg, GC override_gc); void x_output_shadows (struct frame *f, int x, int y, int width, int height, GC top_shadow_gc, GC bottom_shadow_gc, GC background_gc, - int shadow_thickness, int edges); + int shadow_thickness); void x_generate_shadow_pixels (struct frame *f, unsigned long *top_shadow, unsigned long *bottom_shadow, @@ -438,10 +439,10 @@ void x_init_modifier_mapping (struct device *d); #define X_ERROR_OCCURRED(dpy, body) \ - (expect_x_error (dpy), body, x_error_occurred_p (dpy)) + (expect_x_error ((dpy)), (body), x_error_occurred_p (dpy)) #define HANDLING_X_ERROR(dpy, body) \ - (expect_x_error (dpy), body, signal_if_x_error (dpy, 0)) + ( expect_x_error ((dpy)), (body), signal_if_x_error ((dpy), 0)) void Initialize_Locale (void); @@ -492,5 +493,4 @@ extern Lisp_Object Vx_initial_argv_list; /* #### ugh! */ #endif /* HAVE_X_WINDOWS */ - -#endif /* INCLUDED_console_x_h_ */ +#endif /* _XEMACS_DEVICE_X_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/console.c --- a/src/console.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console.c Mon Aug 13 11:20:41 2007 +0200 @@ -53,7 +53,6 @@ list of consoles and stores into each console that does not say it has a local value. */ Lisp_Object Vconsole_defaults; -static void *console_defaults_saved_slots; /* This structure marks which slots in a console have corresponding default values in console_defaults. @@ -70,7 +69,7 @@ consoles. If a slot is -1, then there is a DEFVAR_CONSOLE_LOCAL for it - as well as a default value which is used to initialize newly-created + as well as a default value which is used to initialize newly-created consoles and as a reset-value when local-vars are killed. If a slot is -2, there is no DEFVAR_CONSOLE_LOCAL for it. @@ -88,7 +87,6 @@ /* This structure holds the names of symbols whose values may be console-local. It is indexed and accessed in the same way as the above. */ static Lisp_Object Vconsole_local_symbols; -static void *console_local_symbols_saved_slots; DEFINE_CONSOLE_TYPE (dead); @@ -98,19 +96,19 @@ static Lisp_Object -mark_console (Lisp_Object obj) +mark_console (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct console *con = XCONSOLE (obj); -#define MARKED_SLOT(x) mark_object (con->x) +#define MARKED_SLOT(x) ((void) (markobj (con->x))); #include "conslots.h" #undef MARKED_SLOT /* Can be zero for Vconsole_defaults, Vconsole_local_symbols */ if (con->conmeths) { - mark_object (con->conmeths->symbol); - MAYBE_CONMETH (con, mark_console, (con)); + markobj (con->conmeths->symbol); + MAYBE_CONMETH (con, mark_console, (con, markobj)); } return Qnil; @@ -129,7 +127,7 @@ sprintf (buf, "#<%s-console", !CONSOLE_LIVE_P (con) ? "dead" : CONSOLE_TYPE_NAME (con)); write_c_string (buf, printcharfun); - if (CONSOLE_LIVE_P (con) && !NILP (CONSOLE_CONNECTION (con))) + if (CONSOLE_LIVE_P (con)) { write_c_string (" on ", printcharfun); print_internal (CONSOLE_CONNECTION (con), printcharfun, 1); @@ -139,7 +137,7 @@ } DEFINE_LRECORD_IMPLEMENTATION ("console", console, - mark_console, print_console, 0, 0, 0, 0, + mark_console, print_console, 0, 0, 0, struct console); static struct console * @@ -355,24 +353,16 @@ semi_canonicalize_console_connection (struct console_methods *meths, Lisp_Object name, Error_behavior errb) { - if (HAS_CONTYPE_METH_P (meths, semi_canonicalize_console_connection)) - return CONTYPE_METH (meths, semi_canonicalize_console_connection, - (name, errb)); - else - return CONTYPE_METH_OR_GIVEN (meths, canonicalize_console_connection, - (name, errb), name); + return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_console_connection, + (name, errb), name); } static Lisp_Object canonicalize_console_connection (struct console_methods *meths, Lisp_Object name, Error_behavior errb) { - if (HAS_CONTYPE_METH_P (meths, canonicalize_console_connection)) - return CONTYPE_METH (meths, canonicalize_console_connection, - (name, errb)); - else - return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_console_connection, - (name, errb), name); + return CONTYPE_METH_OR_GIVEN (meths, canonicalize_console_connection, + (name, errb), name); } static Lisp_Object @@ -496,7 +486,7 @@ /* Do it this way so that the console list is in order of creation */ Vconsole_list = nconc2 (Vconsole_list, Fcons (console, Qnil)); - if (CONMETH_OR_GIVEN (con, initially_selected_for_input, (con), 0)) + if (CONMETH (con, initially_selected_for_input, (con))) event_stream_select_console (con); UNGCPRO; @@ -886,9 +876,7 @@ Extcount count; Extbyte *p; - TO_EXTERNAL_FORMAT (LISP_STRING, stuffstring, - ALLOCA, (p, count), - Qkeyboard); + GET_STRING_EXT_DATA_ALLOCA (stuffstring, FORMAT_KEYBOARD, p, count); while (count-- > 0) stuff_char (XCONSOLE (Vcontrolling_terminal), *p++); stuff_char (XCONSOLE (Vcontrolling_terminal), '\n'); @@ -1073,8 +1061,6 @@ void syms_of_console (void) { - INIT_LRECORD_IMPLEMENTATION (console); - DEFSUBR (Fvalid_console_type_p); DEFSUBR (Fconsole_type_list); DEFSUBR (Fcdfw_console); @@ -1110,45 +1096,10 @@ defsymbol (&Qsuspend_resume_hook, "suspend-resume-hook"); } -static const struct lrecord_description cte_description_1[] = { - { XD_LISP_OBJECT, offsetof (console_type_entry, symbol) }, - { XD_STRUCT_PTR, offsetof (console_type_entry, meths), 1, &console_methods_description }, - { XD_END } -}; - -static const struct struct_description cte_description = { - sizeof (console_type_entry), - cte_description_1 -}; - -static const struct lrecord_description cted_description_1[] = { - XD_DYNARR_DESC (console_type_entry_dynarr, &cte_description), - { XD_END } -}; - -const struct struct_description cted_description = { - sizeof (console_type_entry_dynarr), - cted_description_1 -}; - -static const struct lrecord_description console_methods_description_1[] = { - { XD_LISP_OBJECT, offsetof (struct console_methods, symbol) }, - { XD_LISP_OBJECT, offsetof (struct console_methods, predicate_symbol) }, - { XD_LISP_OBJECT, offsetof (struct console_methods, image_conversion_list) }, - { XD_END } -}; - -const struct struct_description console_methods_description = { - sizeof (struct console_methods), - console_methods_description_1 -}; - - void console_type_create (void) { the_console_type_entry_dynarr = Dynarr_new (console_type_entry); - dumpstruct(&the_console_type_entry_dynarr, &cted_description); Vconsole_type_list = Qnil; staticpro (&Vconsole_type_list); @@ -1163,19 +1114,8 @@ } void -reinit_vars_of_console (void) -{ - staticpro_nodump (&Vconsole_list); - Vconsole_list = Qnil; - staticpro_nodump (&Vselected_console); - Vselected_console = Qnil; -} - -void vars_of_console (void) { - reinit_vars_of_console (); - DEFVAR_LISP ("create-console-hook", &Vcreate_console_hook /* Function or functions to call when a console is created. One argument, the newly-created console. @@ -1191,33 +1131,26 @@ */ ); Vdelete_console_hook = Qnil; + staticpro (&Vconsole_list); + Vconsole_list = Qnil; + staticpro (&Vselected_console); + Vselected_console = Qnil; + #ifdef HAVE_WINDOW_SYSTEM Fprovide (intern ("window-system")); #endif } /* 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 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 \ - }; \ - \ + 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 }; \ { \ int offset = ((char *)symbol_value_forward_forward (&I_hate_C) \ - (char *)&console_local_flags); \ @@ -1251,13 +1184,13 @@ { zero_lcrecord (con); -#define MARKED_SLOT(x) con->x = zap +#define MARKED_SLOT(x) con->x = (zap); #include "conslots.h" #undef MARKED_SLOT } -static void -common_init_complex_vars_of_console (void) +void +complex_vars_of_console (void) { /* Make sure all markable slots in console_defaults are initialized reasonably, so mark_console won't choke. @@ -1265,8 +1198,8 @@ struct console *defs = alloc_lcrecord_type (struct console, &lrecord_console); struct console *syms = alloc_lcrecord_type (struct console, &lrecord_console); - staticpro_nodump (&Vconsole_defaults); - staticpro_nodump (&Vconsole_local_symbols); + staticpro (&Vconsole_defaults); + staticpro (&Vconsole_local_symbols); XSETCONSOLE (Vconsole_defaults, defs); XSETCONSOLE (Vconsole_local_symbols, syms); @@ -1321,53 +1254,6 @@ currently allowable due to the XINT() handling of this value. With some rearrangement you can get 4 more bits. */ } -} - - -#define CONSOLE_SLOTS_SIZE (offsetof (struct console, CONSOLE_SLOTS_LAST_NAME) - offsetof (struct console, CONSOLE_SLOTS_FIRST_NAME) + sizeof (Lisp_Object)) -#define CONSOLE_SLOTS_COUNT (CONSOLE_SLOTS_SIZE / sizeof (Lisp_Object)) - -void -reinit_complex_vars_of_console (void) -{ - struct console *defs, *syms; - - common_init_complex_vars_of_console (); - - defs = XCONSOLE (Vconsole_defaults); - syms = XCONSOLE (Vconsole_local_symbols); - memcpy (&defs->CONSOLE_SLOTS_FIRST_NAME, - console_defaults_saved_slots, - CONSOLE_SLOTS_SIZE); - memcpy (&syms->CONSOLE_SLOTS_FIRST_NAME, - console_local_symbols_saved_slots, - CONSOLE_SLOTS_SIZE); -} - - -static const struct lrecord_description console_slots_description_1[] = { - { XD_LISP_OBJECT_ARRAY, 0, CONSOLE_SLOTS_COUNT }, - { XD_END } -}; - -static const struct struct_description console_slots_description = { - CONSOLE_SLOTS_SIZE, - console_slots_description_1 -}; - -void -complex_vars_of_console (void) -{ - struct console *defs, *syms; - - common_init_complex_vars_of_console (); - - defs = XCONSOLE (Vconsole_defaults); - syms = XCONSOLE (Vconsole_local_symbols); - console_defaults_saved_slots = &defs->CONSOLE_SLOTS_FIRST_NAME; - console_local_symbols_saved_slots = &syms->CONSOLE_SLOTS_FIRST_NAME; - dumpstruct (&console_defaults_saved_slots, &console_slots_description); - dumpstruct (&console_local_symbols_saved_slots, &console_slots_description); DEFVAR_CONSOLE_DEFAULTS ("default-function-key-map", function_key_map /* Default value of `function-key-map' for consoles that don't override it. @@ -1398,7 +1284,7 @@ */ ); #ifdef HAVE_TTY - /* #### Should this somehow go to TTY data? How do we make it + /* ### Should this somehow go to TTY data? How do we make it accessible from Lisp, then? */ DEFVAR_CONSOLE_LOCAL ("tty-erase-char", tty_erase_char /* The ERASE character as set by the user with stty. @@ -1407,14 +1293,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 keyboard macro is being defined. Don't set this! +Non-nil while a console macro is being defined. Don't set this! */ ); DEFVAR_CONSOLE_LOCAL ("last-kbd-macro", last_kbd_macro /* -Last keyboard macro defined, as a vector of events; nil if none defined. +Last kbd macro defined, as a vector of events; nil if none defined. */ ); DEFVAR_CONSOLE_LOCAL ("prefix-arg", prefix_arg /* diff -r 12e008d41344 -r 697ef44129c6 src/console.h --- a/src/console.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/console.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_console_h_ -#define INCLUDED_console_h_ +#ifndef _XEMACS_CONSOLE_H_ +#define _XEMACS_CONSOLE_H_ /* Devices and consoles are similar entities. The idea is that a console represents a physical keyboard/mouse/other-input-source @@ -55,23 +55,20 @@ DM_font_menubar, DM_font_dialog, DM_size_cursor, DM_size_scrollbar, DM_size_menu, DM_size_toolbar, DM_size_toolbar_button, DM_size_toolbar_border, DM_size_icon, DM_size_icon_small, DM_size_device, - DM_size_workspace, DM_offset_workspace, DM_size_device_mm, DM_device_dpi, - DM_num_bit_planes, DM_num_color_cells, DM_mouse_buttons, DM_swap_buttons, - DM_show_sounds, DM_slow_device, DM_security + DM_size_workspace, DM_size_device_mm, DM_device_dpi, DM_num_bit_planes, + DM_num_color_cells, DM_mouse_buttons, DM_swap_buttons, DM_show_sounds, + DM_slow_device, DM_security }; -extern const struct struct_description cted_description; -extern const struct struct_description console_methods_description; - 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; /* console methods */ void (*init_console_method) (struct console *, Lisp_Object props); - void (*mark_console_method) (struct console *); + void (*mark_console_method) (struct console *, void (*)(Lisp_Object)); int (*initially_selected_for_input_method) (struct console *); void (*delete_console_method) (struct console *); Lisp_Object (*semi_canonicalize_console_connection_method) @@ -89,24 +86,10 @@ void (*init_device_method) (struct device *, Lisp_Object props); void (*finish_init_device_method) (struct device *, Lisp_Object props); void (*delete_device_method) (struct device *); - void (*mark_device_method) (struct device *); + void (*mark_device_method) (struct device *, void (*)(Lisp_Object)); 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, - 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; @@ -115,7 +98,7 @@ void (*init_frame_3_method) (struct frame *); void (*after_init_frame_method) (struct frame *, int first_on_device, int first_on_console); - void (*mark_frame_method) (struct frame *); + void (*mark_frame_method) (struct frame *, void (*)(Lisp_Object)); void (*delete_frame_method) (struct frame *); void (*focus_on_frame_method) (struct frame *); void (*raise_frame_method) (struct frame *); @@ -144,13 +127,12 @@ 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); @@ -161,57 +143,48 @@ int, int, int, int, Lisp_Object, Lisp_Object, Lisp_Object); void (*clear_frame_method) (struct frame *); - 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 *); + void (*output_begin_method) (struct device *); + void (*output_end_method) (struct device *); int (*flash_method) (struct device *); void (*ring_bell_method) (struct device *, int volume, int pitch, int duration); void (*frame_redraw_cursor_method) (struct frame *f); void (*set_final_cursor_coords_method) (struct frame *, int, int); - void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int, - int, enum edge_style); - void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance, - struct display_box *db, struct display_glyph_area *dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int offset_bitmap); - void (*output_string_method) (struct window *w, struct display_line *dl, - Emchar_dynarr *buf, int xpos, int xoffset, - int start_pixpos, int width, face_index findex, - int cursor, int cursor_start, int cursor_width, - int cursor_height); + /* color methods */ - int (*initialize_color_instance_method) (Lisp_Color_Instance *, + int (*initialize_color_instance_method) (struct Lisp_Color_Instance *, Lisp_Object name, Lisp_Object device, Error_behavior errb); - void (*mark_color_instance_method) (Lisp_Color_Instance *); - void (*print_color_instance_method) (Lisp_Color_Instance *, + void (*mark_color_instance_method) (struct Lisp_Color_Instance *, + void (*)(Lisp_Object)); + void (*print_color_instance_method) (struct Lisp_Color_Instance *, Lisp_Object printcharfun, int escapeflag); - void (*finalize_color_instance_method) (Lisp_Color_Instance *); - int (*color_instance_equal_method) (Lisp_Color_Instance *, - Lisp_Color_Instance *, + void (*finalize_color_instance_method) (struct Lisp_Color_Instance *); + int (*color_instance_equal_method) (struct Lisp_Color_Instance *, + struct Lisp_Color_Instance *, int depth); - unsigned long (*color_instance_hash_method) (Lisp_Color_Instance *, + unsigned long (*color_instance_hash_method) (struct Lisp_Color_Instance *, int depth); - Lisp_Object (*color_instance_rgb_components_method) (Lisp_Color_Instance *); + Lisp_Object (*color_instance_rgb_components_method) + (struct Lisp_Color_Instance *); int (*valid_color_name_p_method) (struct device *, Lisp_Object color); /* font methods */ - int (*initialize_font_instance_method) (Lisp_Font_Instance *, + int (*initialize_font_instance_method) (struct Lisp_Font_Instance *, Lisp_Object name, Lisp_Object device, Error_behavior errb); - void (*mark_font_instance_method) (Lisp_Font_Instance *); - void (*print_font_instance_method) (Lisp_Font_Instance *, + void (*mark_font_instance_method) (struct Lisp_Font_Instance *, + void (*)(Lisp_Object)); + void (*print_font_instance_method) (struct Lisp_Font_Instance *, Lisp_Object printcharfun, int escapeflag); - void (*finalize_font_instance_method) (Lisp_Font_Instance *); - Lisp_Object (*font_instance_truename_method) (Lisp_Font_Instance *, + void (*finalize_font_instance_method) (struct Lisp_Font_Instance *); + Lisp_Object (*font_instance_truename_method) (struct Lisp_Font_Instance *, Error_behavior errb); - Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *); + Lisp_Object (*font_instance_properties_method) (struct Lisp_Font_Instance *); Lisp_Object (*list_fonts_method) (Lisp_Object pattern, Lisp_Object device); Lisp_Object (*find_charset_font_method) (Lisp_Object device, @@ -219,31 +192,29 @@ 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); /* image methods */ - void (*mark_image_instance_method) (Lisp_Image_Instance *); - void (*print_image_instance_method) (Lisp_Image_Instance *, + void (*mark_image_instance_method) (struct Lisp_Image_Instance *, + void (*)(Lisp_Object)); + void (*print_image_instance_method) (struct Lisp_Image_Instance *, Lisp_Object printcharfun, int escapeflag); - void (*finalize_image_instance_method) (Lisp_Image_Instance *); - void (*unmap_subwindow_method) (Lisp_Image_Instance *); - 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 (*update_widget_method) (Lisp_Image_Instance *); - int (*image_instance_equal_method) (Lisp_Image_Instance *, - Lisp_Image_Instance *, + void (*finalize_image_instance_method) (struct Lisp_Image_Instance *); + void (*unmap_subwindow_method) (struct Lisp_Image_Instance *); + void (*map_subwindow_method) (struct Lisp_Image_Instance *, int x, int y); + void (*resize_subwindow_method) (struct Lisp_Image_Instance *, int w, int h); + void (*update_subwindow_method) (struct Lisp_Image_Instance *); + int (*image_instance_equal_method) (struct Lisp_Image_Instance *, + struct Lisp_Image_Instance *, int depth); - unsigned long (*image_instance_hash_method) (Lisp_Image_Instance *, + unsigned long (*image_instance_hash_method) (struct Lisp_Image_Instance *, int depth); - void (*init_image_instance_from_eimage_method) (Lisp_Image_Instance *ii, + void (*init_image_instance_from_eimage_method) (struct Lisp_Image_Instance *ii, int width, int height, - int slices, unsigned char *eimage, int dest_mask, Lisp_Object instantiator, @@ -301,18 +272,8 @@ /* * Constants returned by device_implementation_flags_method */ - /* Set when device uses pixel-based geometry */ -#define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L - -/* Indicates that the device is a printer */ -#define XDEVIMPF_IS_A_PRINTER 0x00000002L - -/* Do not automatically redisplay this device */ -#define XDEVIMPF_NO_AUTO_REDISPLAY 0x00000004L - -/* Do not delete the device when last frame's gone */ -#define XDEVIMPF_FRAMELESS_OK 0x00000008L +#define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) @@ -379,29 +340,17 @@ type##_console_methods = xnew_and_zero (struct console_methods); \ type##_console_methods->name = obj_name; \ type##_console_methods->symbol = Q##type; \ - defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \ + defsymbol (&type##_console_methods->predicate_symbol, pred_sym); \ add_entry_to_console_type_list (Q##type, type##_console_methods); \ type##_console_methods->image_conversion_list = Qnil; \ - staticpro_nodump (&type##_console_methods->image_conversion_list); \ - dumpstruct (&type##_console_methods, &console_methods_description); \ + staticpro (&type##_console_methods->image_conversion_list); \ } while (0) -#define REINITIALIZE_CONSOLE_TYPE(type) do { \ - staticpro_nodump (&type##_console_methods->predicate_symbol); \ - staticpro_nodump (&type##_console_methods->image_conversion_list); \ -} while (0) - - /* Declare that console-type TYPE has method M; used in initialization routines */ #define CONSOLE_HAS_METHOD(type, m) \ (type##_console_methods->m##_method = type##_##m) -/* Declare that console-type TYPE inherits method M - implementation from console-type FROMTYPE */ -#define CONSOLE_INHERITS_METHOD(type, fromtype, m) \ - (type##_console_methods->m##_method = fromtype##_##m) - struct console { struct lcrecord_header header; @@ -447,6 +396,7 @@ #define XCONSOLE(x) XRECORD (x, console, struct console) #define XSETCONSOLE(x, p) XSETRECORD (x, p, console) #define CONSOLEP(x) RECORDP (x, console) +#define GC_CONSOLEP(x) GC_RECORDP (x, console) #define CHECK_CONSOLE(x) CHECK_RECORD (x, console) #define CONCHECK_CONSOLE(x) CONCHECK_RECORD (x, console) @@ -464,9 +414,9 @@ #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER struct console * +INLINE struct console * error_check_console_type (struct console *con, Lisp_Object sym); -INLINE_HEADER struct console * +INLINE struct console * error_check_console_type (struct console *con, Lisp_Object sym) { assert (EQ (CONSOLE_TYPE (con), sym)); @@ -603,4 +553,4 @@ void set_console_last_nonminibuf_frame (struct console *con, Lisp_Object frame); -#endif /* INCLUDED_console_h_ */ +#endif /* _XEMACS_CONSOLE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/data.c --- a/src/data.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/data.c Mon Aug 13 11:20:41 2007 +0200 @@ -50,14 +50,14 @@ 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 Qintegerp, Qnatnump, Qsymbolp, Qkeywordp; Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; Lisp_Object Qconsp, Qsubrp; Lisp_Object Qcharacterp, Qstringp, Qarrayp, Qsequencep, Qvectorp; Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qbufferp; Lisp_Object Qinteger_or_char_p, Qinteger_char_or_marker_p; -Lisp_Object Qnumberp, Qnumber_char_or_marker_p; -Lisp_Object Qbit_vectorp, Qbitp, Qcdr; +Lisp_Object Qnumberp, Qnumber_or_marker_p, Qnumber_char_or_marker_p; +Lisp_Object Qbit_vectorp, Qbitp, Qcons, Qkeyword, Qcdr, Qignore; Lisp_Object Qfloatp; @@ -147,7 +147,7 @@ } void -check_int_range (EMACS_INT val, EMACS_INT min, EMACS_INT max) +check_int_range (int val, int min, int max) { if (val < min || val > max) args_out_of_range_3 (make_int (val), make_int (min), make_int (max)); @@ -160,8 +160,8 @@ /* On a few machines, XINT can only be done by calling this. */ /* XEmacs: only used by m/convex.h */ -EMACS_INT sign_extend_lisp_int (EMACS_INT num); -EMACS_INT +int sign_extend_lisp_int (EMACS_INT num); +int sign_extend_lisp_int (EMACS_INT num) { if (num & (1L << (VALBITS - 1))) @@ -357,7 +357,7 @@ */ (subr)) { - const char *prompt; + CONST char *prompt; CHECK_SUBR (subr); prompt = XSUBR (subr)->prompt; return prompt ? list2 (Qinteractive, build_string (prompt)) : Qnil; @@ -615,6 +615,7 @@ if (!CONSP (conscell)) conscell = wrong_type_argument (Qconsp, conscell); + CHECK_LISP_WRITEABLE (conscell); XCAR (conscell) = newcar; return newcar; } @@ -627,6 +628,7 @@ if (!CONSP (conscell)) conscell = wrong_type_argument (Qconsp, conscell); + CHECK_LISP_WRITEABLE (conscell); XCDR (conscell) = newcdr; return newcdr; } @@ -660,7 +662,7 @@ } if (errorp && UNBOUNDP (hare)) - return signal_void_function_error (object); + signal_void_function_error (object); return hare; } @@ -687,7 +689,7 @@ */ (array, index_)) { - EMACS_INT idx; + int idx; retry: @@ -741,7 +743,7 @@ */ (array, index_, newval)) { - EMACS_INT idx; + int idx; retry: @@ -755,6 +757,8 @@ if (idx < 0) goto range_error; + CHECK_LISP_WRITEABLE (array); + if (VECTORP (array)) { if (idx >= XVECTOR_LENGTH (array)) goto range_error; @@ -795,7 +799,7 @@ int int_p; union { - EMACS_INT ival; + int ival; double dval; } c; } int_or_double; @@ -835,7 +839,7 @@ } } -static EMACS_INT +static int integer_char_or_marker_to_int (Lisp_Object obj) { retry: @@ -1064,7 +1068,7 @@ p++; #ifdef LISP_FLOAT_TYPE - if (isfloat_string (p) && b == 10) + if (isfloat_string (p)) return make_float (atof (p)); #endif /* LISP_FLOAT_TYPE */ @@ -1412,8 +1416,8 @@ */ (num1, num2)) { - EMACS_INT ival1 = integer_char_or_marker_to_int (num1); - EMACS_INT ival2 = integer_char_or_marker_to_int (num2); + int ival1 = integer_char_or_marker_to_int (num1); + int ival2 = integer_char_or_marker_to_int (num2); if (ival2 == 0) Fsignal (Qarith_error, Qnil); @@ -1464,7 +1468,7 @@ } #endif /* LISP_FLOAT_TYPE */ { - EMACS_INT ival; + int ival; if (iod2.c.ival == 0) goto divide_by_zero; ival = iod1.c.ival % iod2.c.ival; @@ -1566,7 +1570,7 @@ static Lisp_Object encode_weak_list_type (enum weak_list_type type); static Lisp_Object -mark_weak_list (Lisp_Object obj) +mark_weak_list (Lisp_Object obj, void (*markobj) (Lisp_Object)) { return Qnil; /* nichts ist gemarkt */ } @@ -1619,16 +1623,9 @@ return result; } -static const struct lrecord_description weak_list_description[] = { - { XD_LISP_OBJECT, offsetof (struct weak_list, list) }, - { XD_LO_LINK, offsetof (struct weak_list, next_weak) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, mark_weak_list, print_weak_list, 0, weak_list_equal, weak_list_hash, - weak_list_description, struct weak_list); /* -- we do not mark the list elements (either the elements themselves @@ -1648,19 +1645,20 @@ */ int -finish_marking_weak_lists (void) +finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object), + void (*markobj) (Lisp_Object)) { Lisp_Object rest; int did_mark = 0; for (rest = Vall_weak_lists; - !NILP (rest); + !GC_NILP (rest); rest = XWEAK_LIST (rest)->next_weak) { Lisp_Object rest2; enum weak_list_type type = XWEAK_LIST (rest)->type; - if (! marked_p (rest)) + if (! obj_marked_p (rest)) /* The weak list is probably garbage. Ignore it. */ continue; @@ -1668,7 +1666,7 @@ /* We need to be trickier since we're inside of GC; use CONSP instead of !NILP in case of user-visible imperfect lists */ - CONSP (rest2); + GC_CONSP (rest2); rest2 = XCDR (rest2)) { Lisp_Object elem; @@ -1683,7 +1681,7 @@ (either because of an external pointer or because of a previous call to this function), and likewise for all the rest of the elements in the list, so we can stop now. */ - if (marked_p (rest2)) + if (obj_marked_p (rest2)) break; elem = XCAR (rest2); @@ -1691,19 +1689,19 @@ switch (type) { case WEAK_LIST_SIMPLE: - if (marked_p (elem)) + if (obj_marked_p (elem)) need_to_mark_cons = 1; break; case WEAK_LIST_ASSOC: - if (!CONSP (elem)) + if (!GC_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))) + else if (obj_marked_p (XCAR (elem)) && + obj_marked_p (XCDR (elem))) { need_to_mark_cons = 1; /* We still need to mark elem, because it's @@ -1713,13 +1711,13 @@ break; case WEAK_LIST_KEY_ASSOC: - if (!CONSP (elem)) + if (!GC_CONSP (elem)) { /* just leave bogus elements there */ need_to_mark_cons = 1; need_to_mark_elem = 1; } - else if (marked_p (XCAR (elem))) + else if (obj_marked_p (XCAR (elem))) { need_to_mark_cons = 1; /* We still need to mark elem and XCDR (elem); @@ -1729,30 +1727,13 @@ break; case WEAK_LIST_VALUE_ASSOC: - if (!CONSP (elem)) + if (!GC_CONSP (elem)) { /* just leave bogus elements there */ need_to_mark_cons = 1; need_to_mark_elem = 1; } - else if (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; - - 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))) + else if (obj_marked_p (XCDR (elem))) { need_to_mark_cons = 1; /* We still need to mark elem and XCAR (elem); @@ -1765,23 +1746,23 @@ abort (); } - if (need_to_mark_elem && ! marked_p (elem)) + if (need_to_mark_elem && ! obj_marked_p (elem)) { - mark_object (elem); + markobj (elem); did_mark = 1; } /* We also need to mark the cons that holds the elem or - assoc-pair. We do *not* want to call (mark_object) here + assoc-pair. We do *not* want to call (markobj) here because that will mark the entire list; we just want to mark the cons itself. */ if (need_to_mark_cons) { - Lisp_Cons *c = XCONS (rest2); - if (!CONS_MARKED_P (c)) + struct Lisp_Cons *ptr = XCONS (rest2); + if (!CONS_MARKED_P (ptr)) { - MARK_CONS (c); + MARK_CONS (ptr); did_mark = 1; } } @@ -1789,9 +1770,9 @@ /* In case of imperfect list, need to mark the final cons because we're not removing it */ - if (!NILP (rest2) && ! marked_p (rest2)) + if (!GC_NILP (rest2) && ! obj_marked_p (rest2)) { - mark_object (rest2); + markobj (rest2); did_mark = 1; } } @@ -1800,18 +1781,18 @@ } void -prune_weak_lists (void) +prune_weak_lists (int (*obj_marked_p) (Lisp_Object)) { Lisp_Object rest, prev = Qnil; for (rest = Vall_weak_lists; - !NILP (rest); + !GC_NILP (rest); rest = XWEAK_LIST (rest)->next_weak) { - if (! (marked_p (rest))) + if (! (obj_marked_p (rest))) { /* This weak list itself is garbage. Remove it from the list. */ - if (NILP (prev)) + if (GC_NILP (prev)) Vall_weak_lists = XWEAK_LIST (rest)->next_weak; else XWEAK_LIST (prev)->next_weak = @@ -1827,7 +1808,7 @@ /* We need to be trickier since we're inside of GC; use CONSP instead of !NILP in case of user-visible imperfect lists */ - CONSP (rest2);) + GC_CONSP (rest2);) { /* It suffices to check the cons for marking, regardless of the type of weak list: @@ -1838,10 +1819,10 @@ have been marked in finish_marking_weak_lists(). -- otherwise, it's not marked and should disappear. */ - if (! marked_p (rest2)) + if (! obj_marked_p (rest2)) { /* bye bye :-( */ - if (NILP (prev2)) + if (GC_NILP (prev2)) XWEAK_LIST (rest)->list = XCDR (rest2); else XCDR (prev2) = XCDR (rest2); @@ -1882,7 +1863,7 @@ if (go_tortoise) tortoise = XCDR (tortoise); go_tortoise = !go_tortoise; - if (EQ (rest2, tortoise)) + if (GC_EQ (rest2, tortoise)) break; } } @@ -1901,7 +1882,6 @@ 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 */ @@ -1916,7 +1896,6 @@ 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 (); } @@ -1955,8 +1934,6 @@ 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)) { @@ -2097,15 +2074,17 @@ void syms_of_data (void) { - INIT_LRECORD_IMPLEMENTATION (weak_list); - + defsymbol (&Qcons, "cons"); + defsymbol (&Qkeyword, "keyword"); defsymbol (&Qquote, "quote"); defsymbol (&Qlambda, "lambda"); + defsymbol (&Qignore, "ignore"); defsymbol (&Qlistp, "listp"); defsymbol (&Qtrue_list_p, "true-list-p"); defsymbol (&Qconsp, "consp"); defsymbol (&Qsubrp, "subrp"); defsymbol (&Qsymbolp, "symbolp"); + defsymbol (&Qkeywordp, "keywordp"); defsymbol (&Qintegerp, "integerp"); defsymbol (&Qcharacterp, "characterp"); defsymbol (&Qnatnump, "natnump"); @@ -2122,6 +2101,7 @@ 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_or_marker_p, "number-or-marker-p"); defsymbol (&Qnumber_char_or_marker_p, "number-char-or-marker-p"); defsymbol (&Qcdr, "cdr"); defsymbol (&Qweak_listp, "weak-list-p"); @@ -2220,7 +2200,6 @@ { /* This must not be staticpro'd */ Vall_weak_lists = Qnil; - pdump_wire_list (&Vall_weak_lists); #ifdef DEBUG_XEMACS DEFVAR_BOOL ("debug-issue-ebola-notices", &debug_issue_ebola_notices /* diff -r 12e008d41344 -r 697ef44129c6 src/database.c --- a/src/database.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/database.c Mon Aug 13 11:20:41 2007 +0200 @@ -53,7 +53,7 @@ #endif /* WE_DONT_NEED_QUADS */ #endif /* HAVE_INTTYPES_H */ #endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */ -#include DB_H_FILE /* Berkeley db's header file */ +#include DB_H_PATH /* Berkeley db's header file */ #ifndef DB_VERSION_MAJOR # define DB_VERSION_MAJOR 1 #endif /* DB_VERSION_MAJOR */ @@ -75,6 +75,9 @@ Lisp_Object Qdatabasep; +struct Lisp_Database; +typedef struct Lisp_Database Lisp_Database; + typedef struct { Lisp_Object (*get_subtype) (Lisp_Database *); @@ -110,6 +113,7 @@ #define XDATABASE(x) XRECORD (x, database, Lisp_Database) #define XSETDATABASE(x, p) XSETRECORD (x, p, database) #define DATABASEP(x) RECORDP (x, database) +#define GC_DATABASEP(x) GC_RECORDP (x, database) #define CHECK_DATABASE(x) CHECK_RECORD (x, database) #define CONCHECK_DATABASE(x) CONCHECK_RECORD (x, database) #define DATABASE_LIVE_P(x) (x->live_p) @@ -144,10 +148,12 @@ } static Lisp_Object -mark_database (Lisp_Object obj) +mark_database (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lisp_Database *db = XDATABASE (obj); - return db->fname; + + markobj (db->fname); + return Qnil; } static void @@ -189,7 +195,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("database", database, mark_database, print_database, - finalize_database, 0, 0, 0, + finalize_database, 0, 0, Lisp_Database); DEFUN ("close-database", Fclose_database, 1, 1, 0, /* @@ -486,7 +492,7 @@ status == 0; status = dbp->seq (dbp, &keydatum, &valdatum, R_NEXT)) { - /* #### Needs mule-izing */ + /* ### Needs mule-izing */ key = make_string ((Bufbyte *) keydatum.data, keydatum.size); val = make_string ((Bufbyte *) valdatum.data, valdatum.size); call2 (func, key, val); @@ -499,12 +505,12 @@ status = dbp->cursor (dbp, NULL, &dbcp, 0); #else status = dbp->cursor (dbp, NULL, &dbcp); -#endif +#endif for (status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_FIRST); status == 0; status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_NEXT)) { - /* #### Needs mule-izing */ + /* ### Needs mule-izing */ key = make_string ((Bufbyte *) keydatum.data, keydatum.size); val = make_string ((Bufbyte *) valdatum.data, valdatum.size); call2 (func, key, val); @@ -578,9 +584,7 @@ file = Fexpand_file_name (file, Qnil); UNGCPRO; - TO_EXTERNAL_FORMAT (LISP_STRING, file, - C_STRING_ALLOCA, filename, - Qfile_name); + GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (XSTRING_DATA (file), filename); if (NILP (access_)) { @@ -759,8 +763,6 @@ void syms_of_database (void) { - INIT_LRECORD_IMPLEMENTATION (database); - defsymbol (&Qdatabasep, "databasep"); #ifdef HAVE_DBM defsymbol (&Qdbm, "dbm"); diff -r 12e008d41344 -r 697ef44129c6 src/database.h --- a/src/database.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/database.h Mon Aug 13 11:20:41 2007 +0200 @@ -18,13 +18,12 @@ 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_ -#define INCLUDED_database_h_ +#ifndef _XEMACS_DATABASE_H +#define _XEMACS_DATABASE_H -typedef struct Lisp_Database Lisp_Database; -DECLARE_LRECORD (database, Lisp_Database); +DECLARE_LRECORD (database, struct Lisp_Database); -#endif /* INCLUDED_database_h_ */ +#endif diff -r 12e008d41344 -r 697ef44129c6 src/dbxrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dbxrc Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,362 @@ +# -*- ksh -*- +# Copyright (C) 1998 Free Software Foundation, Inc. + +# This file is part of XEmacs. + +# XEmacs is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. + +# XEmacs is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +# You should have received a copy of the GNU General Public License +# along with XEmacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Author: Martin Buchholz + +# You can use this file to debug XEmacs using Sun WorkShop's dbx. +# Add the contents of this file to $HOME/.dbxrc or +# Source the contents of this file with something like: +# if test -r ./dbxrc; then . ./dbxrc; fi + +# Some functions defined here require a running process, but most +# don't. Considerable effort has been expended to this end. + +# See also the comments in gdbinit. + +# See also the question of the XEmacs FAQ, titled +# "How to Debug an XEmacs problem with a debugger". + +ignore POLL +ignore IO + +document lbt << 'end' +Usage: lbt +Print the current Lisp stack trace. +Requires a running xemacs process. +end + +function lbt { + call debug_backtrace() +} + +document ldp << 'end' +Usage: ldp lisp_object +Print a Lisp Object value using the Lisp printer. +Requires a running xemacs process. +end + +function ldp { + call debug_print ($1); +} + +# A bug in dbx prevents string variables from having values beginning with `-'!! +function XEmacsInit { + function ToInt { eval "$1=\$[(int) $1]"; } + ToInt dbg_USE_UNION_TYPE + ToInt Lisp_Type_Int + ToInt Lisp_Type_Char + ToInt Lisp_Type_Cons + ToInt Lisp_Type_String + ToInt Lisp_Type_Vector + ToInt Lisp_Type_Symbol + ToInt Lisp_Type_Record + ToInt dbg_valbits + ToInt dbg_gctypebits + function ToLong { eval "$1=\$[(unsigned long) $1]"; } + ToLong dbg_valmask + ToLong dbg_typemask + xemacs_initted=yes +} + +function printvar { + for i in $*; do eval "echo $i=\$$i"; done +} + +document decode_object << 'end' +Usage: decode_object lisp_object +Extract implementation information from a Lisp Object. +Defines variables $val, $type and $imp. +end + +# Various dbx bugs cause ugliness in following code +function decode_object { + if test -z "$xemacs_initted"; then XEmacsInit; fi; + if test $dbg_USE_UNION_TYPE = 1; then + # Repeat after me... dbx sux, dbx sux, dbx sux... + # Allow both `pobj Qnil' and `pobj 0x82746834' to work + case $(whatis $1) in + *Lisp_Object*) obj="$[(unsigned long)(($1).i)]";; + *) obj="$[(unsigned long)($1)]";; + esac + else + obj="$[(unsigned long)($1)]"; + fi + if test $[(int)($obj & 1)] = 1; then + # It's an int + val=$[(long)(((unsigned long long)$obj) >> 1)] + type=$Lisp_Type_Int + else + type=$[(int)(((void*)$obj) & $dbg_typemask)] + if test $type = $Lisp_Type_Char; then + val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)] + else + # It's a record pointer + val=$[(void*)$obj] + if test "$val" = "(nil)"; then type=null_pointer; fi + fi + fi + + if test $type = $Lisp_Type_Record; then + typeset lheader="((struct lrecord_header *) $val)" + imp=$[(void*)(lrecord_implementations_table[$lheader->type])] + else + imp="0xdeadbeef" + fi + # printvar obj val type imp +} + +function xint { + decode_object "$*" + print (long) ($val) +} + +function xtype { + 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]" + fi +} + +function lisp-shadows { + run -batch -vanilla -f list-load-path-shadows +} + +function environment-to-run-temacs { + unset EMACSLOADPATH + export EMACSBOOTSTRAPLOADPATH=../lisp/:.. + export EMACSBOOTSTRAPMODULEPATH=../modules/:.. +} + +document run-temacs << 'end' +Usage: run-temacs +Run temacs interactively, like xemacs. +Use this with debugging tools (like purify) that cannot deal with dumping, +or when temacs builds successfully, but xemacs does not. +end + +function run-temacs { + environment-to-run-temacs + run -batch -l ../lisp/loadup.el run-temacs -q +} + +document update-elc << 'end' +Usage: update-elc +Run the core lisp byte compilation part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end + +function update-elc { + environment-to-run-temacs + run -batch -l ../lisp/update-elc.el +} + + +function dump-temacs { + environment-to-run-temacs + run -batch -l ../lisp/loadup.el dump +} + +document dump-temacs << 'end' +Usage: dump-temacs +Run the dumping part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end + +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 +} + +document pobj << 'end' +Usage: pobj lisp_object +Print the internal C structure of a underlying Lisp Object. +end + +function pobj { + decode_object $1 + if test $type = $Lisp_Type_Int; then + print -f"Integer: %d" $val + elif test $type = $Lisp_Type_Char; then + if test $[$val > 32 && $val < 128] = 1; then + print -f"Char: %c" $val + 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_list; then + pstruct Lisp_Opaque_List + 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 "$type" = "null_pointer"; then + echo "Lisp Object is a null pointer!!" + else + echo "Unknown Lisp Object type" + print $1 + 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 + +function dp_core { + print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core +} + +# Barf! +function print_shell { + print *(`frame-x.c`TopLevelShellRec*) (((struct `frame-x.c`x_frame*) (((struct `frame-x.c`frame*) (Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget) +} + +# ------------------------------------------------------------- +# functions to test the debugging support itself. +# If you change this file, make sure the following still work... +# ------------------------------------------------------------- +function test_xtype { + function doit { echo -n "$1: "; xtype "$1"; } + test_various_objects +} + +function test_pobj { + function doit { echo '==============================='; echo -n "$1: "; pobj "$1"; } + test_various_objects +} + +function test_various_objects { + doit Vemacs_major_version + doit Vhelp_char + doit Qnil + doit Qunbound + doit Vobarray + doit Vall_weak_lists + doit Vxemacs_codename +} diff -r 12e008d41344 -r 697ef44129c6 src/debug.c --- a/src/debug.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/debug.c Mon Aug 13 11:20:41 2007 +0200 @@ -39,43 +39,44 @@ * 4. Add a FROB line for it in xemacs_debug_loop. */ -static Lisp_Object Qredisplay, Qbuffers, Qfaces, Qwindows, Qframes, Qdevices; +Lisp_Object Qredisplay, Qbuffers, Qfaces; +Lisp_Object Qwindows, Qframes, Qdevices; struct debug_classes active_debug_classes; enum debug_loop { - X_ADD, - X_DELETE, - X_LIST, - X_ACTIVE, - X_INIT, - X_VALIDATE, - X_TYPE, - X_SETTYPE + ADD, + DELETE, + LIST, + ACTIVE, + INIT, + VALIDATE, + TYPE, + SETTYPE }; static Lisp_Object xemacs_debug_loop (enum debug_loop op, Lisp_Object class, Lisp_Object type) { - int flag = (op == X_ADD) ? 1 : 0; + int flag = (op == ADD) ? 1 : 0; Lisp_Object retval = Qnil; #define FROB(item) \ - if (op == X_LIST || op == X_ACTIVE || op == X_INIT || EQ (class, Q##item)) \ + if (op == LIST || op == ACTIVE || op == INIT || EQ (class, Q##item)) \ { \ - if (op == X_ADD || op == X_DELETE || op == X_INIT) \ + if (op == ADD || op == DELETE || op == INIT) \ active_debug_classes.item = flag; \ - else if (op == X_LIST \ - || (op == X_ACTIVE && active_debug_classes.item)) \ + else if (op == LIST \ + || (op == ACTIVE && active_debug_classes.item)) \ retval = Fcons (Q##item, retval); \ - else if (op == X_VALIDATE) \ + else if (op == VALIDATE) \ return Qt; \ - else if (op == X_SETTYPE) \ + else if (op == SETTYPE) \ active_debug_classes.types_of_##item = XINT (type); \ - else if (op == X_TYPE) \ + else if (op == TYPE) \ retval = make_int (active_debug_classes.types_of_##item); \ - if (op == X_INIT) active_debug_classes.types_of_##item = VALBITS; \ + if (op == INIT) active_debug_classes.types_of_##item = VALBITS; \ } FROB (redisplay); @@ -96,12 +97,12 @@ */ (class)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("No such debug class exists"); else - xemacs_debug_loop (X_ADD, class, Qnil); + xemacs_debug_loop (ADD, class, Qnil); - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("delete-debug-class-to-check", Fdelete_debug_class_to_check, 1, 1, 0, /* @@ -109,12 +110,12 @@ */ (class)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("No such debug class exists"); else - xemacs_debug_loop (X_DELETE, class, Qnil); + xemacs_debug_loop (DELETE, class, Qnil); - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("debug-classes-being-checked", Fdebug_classes_being_checked, 0, 0, 0, /* @@ -122,7 +123,7 @@ */ ()) { - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("debug-classes-list", Fdebug_classes_list, 0, 0, 0, /* @@ -130,7 +131,7 @@ */ ()) { - return (xemacs_debug_loop (X_LIST, Qnil, Qnil)); + return (xemacs_debug_loop (LIST, Qnil, Qnil)); } DEFUN ("set-debug-classes-to-check", Fset_debug_classes_to_check, 1, 1, 0, /* @@ -147,14 +148,14 @@ valid, reject the entire list without doing anything. */ LIST_LOOP (rest, classes ) { - if (NILP (xemacs_debug_loop (X_VALIDATE, XCAR (rest), Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, XCAR (rest), Qnil))) error ("Invalid object in class list"); } LIST_LOOP (rest, classes) Fadd_debug_class_to_check (XCAR (rest)); - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("set-debug-class-types-to-check", Fset_debug_class_types_to_check, 2, 2, 0, /* @@ -165,12 +166,12 @@ (class, type)) { CHECK_INT (type); - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("Invalid debug class"); - xemacs_debug_loop (X_SETTYPE, class, type); + xemacs_debug_loop (SETTYPE, class, type); - return (xemacs_debug_loop (X_TYPE, class, Qnil)); + return (xemacs_debug_loop (TYPE, class, Qnil)); } DEFUN ("debug-types-being-checked", Fdebug_types_being_checked, 1, 1, 0, /* @@ -178,10 +179,10 @@ */ (class)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("Invalid debug class"); - return (xemacs_debug_loop (X_TYPE, class, Qnil)); + return (xemacs_debug_loop (TYPE, class, Qnil)); } void @@ -193,6 +194,7 @@ defsymbol (&Qwindows, "windows"); defsymbol (&Qframes, "frames"); defsymbol (&Qdevices, "devices"); + /* defsymbol (&Qbyte_code, "byte-code"); in bytecode.c */ DEFSUBR (Fadd_debug_class_to_check); DEFSUBR (Fdelete_debug_class_to_check); @@ -204,17 +206,11 @@ } void -reinit_vars_of_debug (void) +vars_of_debug (void) { /* If you need to have any classes active early on in startup, then the flags should be set here. All functions called by this function are "allowed" according to emacs.c. */ - xemacs_debug_loop (X_INIT, Qnil, Qnil); + xemacs_debug_loop (INIT, Qnil, Qnil); } - -void -vars_of_debug (void) -{ - reinit_vars_of_debug (); -} diff -r 12e008d41344 -r 697ef44129c6 src/debug.h --- a/src/debug.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/debug.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Written by Chuck Thompson */ -#ifndef INCLUDED_debug_h_ -#define INCLUDED_debug_h_ +#ifndef _XEMACS_DEBUG_H_ +#define _XEMACS_DEBUG_H_ #define DEBUG_STDERR 1 #define DEBUG_ABORT 2 @@ -53,6 +53,8 @@ unsigned int types_of_byte_code; }; +extern Lisp_Object Qbuffers, Qdevices, Qfaces, Qframes, Qredisplay, Qwindows; + extern struct debug_classes active_debug_classes; #define DASSERT(class, desired_type, action, assertion) do \ @@ -76,4 +78,4 @@ #endif /* !DEBUG_XEMACS */ -#endif /* INCLUDED_debug_h_ */ +#endif /* _XEMACS_DEBUG_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/depend --- a/src/depend Mon Aug 13 11:19:22 2007 +0200 +++ b/src/depend Mon Aug 13 11:20:41 2007 +0200 @@ -8,35 +8,34 @@ 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 objects-msw.h objects.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 +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 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 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 menubar.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 +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 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) buffer.h bufslots.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 mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.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 +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 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 +select-msw.o: $(LISP_H) conslots.h console-msw.h console.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.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 #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 sysdll.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h +device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h 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 gutter.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 +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 file-coding.h frame.h frameslots.h glyphs-x.h glyphs.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 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 keymap.h lisp-disunion.h lisp-union.h lrecord.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 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 +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 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 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 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 #endif #ifdef HAVE_DATABASE @@ -45,7 +44,7 @@ #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-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-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 @@ -62,11 +61,11 @@ 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) 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 lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h +alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.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 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 +buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.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 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 @@ -77,89 +76,84 @@ 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-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 gpmevent.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.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 +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 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 -dumper.o: $(LISP_H) alloc.h conslots.h console-stream.h console.h dump-id.h dumper.h elhash.h lisp-disunion.h lisp-union.h lrecord.h specifier.h symeval.h symsinit.h sysfile.h dynarr.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.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 +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 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 dump-id.h dumper.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 +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h redisplay.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.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 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 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) 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 lisp-disunion.h lisp-union.h lrecord.h lstream.h macros.h menubar.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 -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 +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 opaque.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 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 gpmevent.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 gutter.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 +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 +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 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 +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 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 +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 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 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 +gif_io.o: gifrlib.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 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 +glyphs.o: $(LISP_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 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) buffer.h bufslots.h bytecode.h elhash.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.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 +gpmevent.o: $(LISP_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 symeval.h symsinit.h sysdep.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 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 nativesound.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 postgresql.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 +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 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 nativesound.h symeval.h symsinit.h sysfile.h syssignal.h +linuxplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.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 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 keymap.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 +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 +nt.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h symeval.h symsinit.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 nativesound.h symeval.h symsinit.h sysfile.h -ntproc.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.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 +ntplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h +ntproc.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h process.h symeval.h symsinit.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 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 -postgresql.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h postgresql.h symeval.h symsinit.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 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) conslots.h console-msw.h console.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 +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 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 @@ -168,22 +162,21 @@ 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 +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 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 +scrollbar.o: $(LISP_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 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 nativesound.h redisplay.h symeval.h symsinit.h sysdep.h xintrinsic.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 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 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 sunOS-fix.o: config.h -sunplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nativesound.h symeval.h symsinit.h sysdep.h syssignal.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 @@ -191,7 +184,6 @@ 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 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 tparam.o: config.h @@ -213,6 +205,7 @@ 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 +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 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 xmu.o: config.h +xselect.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 scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h xintrinsic.h diff -r 12e008d41344 -r 697ef44129c6 src/device-msw.c --- a/src/device-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/device-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -34,20 +34,11 @@ #include "console-msw.h" #include "console-stream.h" -#include "objects-msw.h" #include "events.h" #include "faces.h" #include "frame.h" #include "sysdep.h" -/* #### Andy, these includes might break cygwin compilation - kkm*/ -#include <commdlg.h> -#include <winspool.h> - -#if !(defined (CYGWIN) || defined(MINGW)) -# include <objbase.h> /* For CoInitialize */ -#endif - /* win32 DDE management library globals */ #ifdef HAVE_DRAGNDROP DWORD mswindows_dde_mlid; @@ -66,19 +57,27 @@ 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 */ /************************************************************************/ static Lisp_Object -build_syscolor_string (int idx) +build_syscolor_string (int index) { - return (idx < 0 ? Qnil : mswindows_color_to_string (GetSysColor (idx))); + DWORD clr; + char buf[16]; + + if (index < 0) + return Qnil; + + clr = GetSysColor (index); + sprintf (buf, "#%02X%02X%02X", + GetRValue (clr), + GetGValue (clr), + GetBValue (clr)); + return build_string (buf); } static Lisp_Object @@ -99,16 +98,10 @@ index2 < 0 ? Qnil : make_int (GetSystemMetrics (index2))); } -static Lisp_Object -build_devicecaps_cons (HDC hdc, int index1, int index2) -{ - return Fcons (index1 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index1)), - index2 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index2))); -} /************************************************************************/ -/* display methods */ +/* methods */ /************************************************************************/ static void @@ -125,9 +118,20 @@ d->device_data = xnew_and_zero (struct mswindows_device); hdc = CreateCompatibleDC (NULL); assert (hdc!=NULL); - DEVICE_MSWINDOWS_HCDC(d) = hdc; - DEVICE_MSWINDOWS_FONTLIST (d) = mswindows_enumerate_fonts (hdc); - DEVICE_MSWINDOWS_UPDATE_TICK (d) = GetTickCount (); + 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); + DeleteDC (hdc); + + mswindows_enumerate_fonts (d); /* Register the main window class */ wc.cbSize = sizeof (WNDCLASSEX); @@ -135,9 +139,7 @@ wc.lpfnWndProc = (WNDPROC) mswindows_wnd_proc; wc.cbClsExtra = 0; 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 @@ -146,21 +148,10 @@ wc.lpszMenuName = NULL; wc.lpszClassName = XEMACS_CLASS; - wc.hIconSm = (HICON) LoadImage (GetModuleHandle (NULL), XEMACS_CLASS, + wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS, IMAGE_ICON, 16, 16, 0); RegisterClassEx (&wc); - -#ifdef HAVE_WIDGETS - xzero (wc); - /* Register the main window class */ - wc.cbSize = sizeof (WNDCLASSEX); - wc.lpfnWndProc = (WNDPROC) mswindows_control_wnd_proc; - wc.lpszClassName = XEMACS_CONTROL_CLASS; - wc.hInstance = NULL; - RegisterClassEx (&wc); -#endif - -#if defined (HAVE_TOOLBARS) || defined (HAVE_WIDGETS) +#ifdef HAVE_TOOLBARS InitCommonControls (); #endif } @@ -171,20 +162,13 @@ /* 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); + 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_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); @@ -194,83 +178,65 @@ static void mswindows_delete_device (struct device *d) { + struct mswindows_font_enum *fontlist, *next; + + fontlist = DEVICE_MSWINDOWS_FONTLIST (d); + while (fontlist) + { + next = fontlist->next; + free (fontlist); + fontlist = next; + } + #ifdef HAVE_DRAGNDROP - 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); + DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_REGISTER); DdeUninitialize (mswindows_dde_mlid); - -# if !(defined(CYGWIN) || defined(MINGW)) - CoUninitialize (); -# endif #endif - DeleteDC (DEVICE_MSWINDOWS_HCDC(d)); - xfree (d->device_data); -} - -void -mswindows_get_workspace_coords (RECT *rc) -{ - SystemParametersInfo (SPI_GETWORKAREA, 0, rc, 0); -} - -static void -mswindows_mark_device (struct device *d) -{ - mark_object (DEVICE_MSWINDOWS_FONTLIST (d)); + free (d->device_data); } static Lisp_Object 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 (GetDeviceCaps (hdc, HORZRES)), - make_int (GetDeviceCaps (hdc, VERTRES))); - break; - case DM_device_dpi: - return Fcons (make_int (GetDeviceCaps (hdc, LOGPIXELSX)), - make_int (GetDeviceCaps (hdc, LOGPIXELSY))); + return Fcons (make_int (DEVICE_MSWINDOWS_HORZRES(d)), + make_int (DEVICE_MSWINDOWS_VERTRES(d))); break; case DM_size_device_mm: - return Fcons (make_int (GetDeviceCaps (hdc, HORZSIZE)), - make_int (GetDeviceCaps (hdc, VERTSIZE))); + return Fcons (make_int (DEVICE_MSWINDOWS_HORZSIZE(d)), + make_int (DEVICE_MSWINDOWS_VERTSIZE(d))); 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 (GetDeviceCaps (hdc, BITSPIXEL)); + return make_int (DEVICE_MSWINDOWS_BITSPIXEL(d)); break; case DM_num_color_cells: - /* #### 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)); + return make_int (DEVICE_MSWINDOWS_CELLS(d)); break; /*** Colors ***/ -#define FROB(met, fore, back) \ +#define FROB(met, index1, index2) \ case DM_##met: \ - return build_syscolor_cons (fore, back); + return build_syscolor_cons (index1, index2); - 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_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); FROB (color_desktop, -1, COLOR_DESKTOP); FROB (color_workspace, -1, COLOR_APPWORKSPACE); #undef FROB @@ -290,18 +256,10 @@ case DM_size_workspace: { RECT rc; - mswindows_get_workspace_coords (&rc); + SystemParametersInfo (SPI_GETWORKAREA, 0, &rc, 0); 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: @@ -334,864 +292,15 @@ /************************************************************************/ -/* printer helpers */ -/************************************************************************/ - -static void -signal_open_printer_error (struct device *d) -{ - signal_simple_error ("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); -} - - -/************************************************************************/ -/* printer methods */ -/************************************************************************/ - -static void -msprinter_init_device (struct device *d, Lisp_Object props) -{ - char* printer_name; - DEVMODE *pdm; - size_t dm_size; - - d->device_data = xnew_and_zero (struct msprinter_device); - - 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; - - 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); - - /* Determinie 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 -msprinter_device_system_metrics (struct device *d, - enum device_metrics m) -{ - switch (m) - { - /* Device sizes - pixel and mm */ -#define FROB(met, index1, index2) \ - case DM_##met: \ - return build_devicecaps_cons \ - (DEVICE_MSPRINTER_HDC(d), index1, index2); - - FROB (size_device, PHYSICALWIDTH, PHYSICALHEIGHT); - FROB (size_device_mm, HORZSIZE, VERTSIZE); - FROB (size_workspace, HORZRES, VERTRES); - FROB (offset_workspace, PHYSICALOFFSETX, PHYSICALOFFSETY); - FROB (device_dpi, LOGPIXELSX, LOGPIXELSY); -#undef FROB - - 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 (GetDeviceCaps (DEVICE_MSPRINTER_HDC(d), BITSPIXEL)); - - case DM_num_color_cells: /* Prnters are non-palette devices */ - case DM_slow_device: /* Animation would be a really bad idea */ - case DM_security: /* Not provided by windows */ - return Qzero; - } - - /* Do not know such property */ - return Qunbound; -} - -static void -msprinter_mark_device (struct device *d) -{ - mark_object (DEVICE_MSPRINTER_FONTLIST (d)); - mark_object (DEVICE_MSPRINTER_DEVMODE (d)); -} - -static unsigned int -msprinter_device_implementation_flags (void) -{ - return ( XDEVIMPF_PIXEL_GEOMETRY - | XDEVIMPF_IS_A_PRINTER - | XDEVIMPF_NO_AUTO_REDISPLAY - | XDEVIMPF_FRAMELESS_OK ); -} - -/************************************************************************/ -/* printer Lisp subroutines */ -/************************************************************************/ - -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) -{ - /* 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); - - /* #### 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); - } - - 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)); - } -} - -static void -ensure_not_printing (struct device *d) -{ - if (!NILP (DEVICE_FRAME_LIST (d))) - { - Lisp_Object device; - XSETDEVICE (device, d); - signal_simple_error ("Cannot change settings while print job is active", - device); - } -} - -static Lisp_Devmode * -decode_devmode (Lisp_Object dev) -{ - if (DEVMODEP (dev)) - return XDEVMODE (dev); - else - { - struct device* d = decode_device (dev); - Lisp_Object device; - XSETDEVICE (device, d); - CHECK_MSPRINTER_DEVICE (device); - ensure_not_printing (d); - return XDEVMODE (DEVICE_MSPRINTER_DEVMODE (d)); - } -} - -/* - * DEV can be either a printer or devmode - * PRINT_P is non-zero for the Print dialog, zero for the - * Page Setup dialog - */ -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; - } -} - -DEFUN ("msprinter-print-setup-dialog", Fmsprinter_print_setup_dialog, 1, 1, 0, /* -Invoke Windows standard Printer Setup dialog. -This dialog is usually invoked when the user selects the Printer Setup -command. - -DEVICE must be either an 'msprinter device, or a printer settings -object. The function brings up the Printer 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 `msprinter-print-dialog' and `msprinter-page-setup-dialog'. -*/ - (device)) -{ - return print_dialog_worker (device, 0); -} - -DEFUN ("msprinter-print-dialog", Fmsprinter_print_dialog, 1, 1, 0, /* -Invoke 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. - -DEVICE must be either an 'msprinter device, or a printer settings -object. 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 `msprinter-setup-print-dialog' and -`msprinter-page-setup-dialog'. -*/ - (device)) -{ - return print_dialog_worker (device, 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)) - signal_simple_error ("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)); -} - -DEFUN ("msprinter-page-setup-dialog", Fmsprinter_page_setup_dialog, 1, 2, 0, /* -Invoke Windows standard Page Setup dialog. -This dialog is usually invoked in response to 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 -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. - -DEVICE must be either an 'msprinter device, or a printer settings -object. 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. - -PLIST is 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 `msprinter-print-setup-dialog' and `msprinter-print-dialog'. -*/ - (device, plist)) -{ - 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)) -{ - 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)) - signal_simple_error ("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) - signal_simple_error ("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 stirage 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 cuttent - 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 #<msprinter-settings 0x%x>", - dm->header.uid); - write_c_string ("#<msprinter-settings", printcharfun); - if (dm->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); - signal_simple_error ( - "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); - - 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)) - signal_simple_error ("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. */ - - dm->dmDriverExtra = 0; - dm->dmDeviceName[0] = '\0'; - - if (ldm->printer_name) - xfree (ldm->printer_name); - - return Qnil; -} - - -/************************************************************************/ /* initialization */ /************************************************************************/ void syms_of_device_mswindows (void) { - INIT_LRECORD_IMPLEMENTATION (devmode); - - DEFSUBR (Fmsprinter_print_setup_dialog); - DEFSUBR (Fmsprinter_print_dialog); - DEFSUBR (Fmsprinter_page_setup_dialog); - DEFSUBR (Fmsprinter_get_settings); - DEFSUBR (Fmsprinter_select_settings); - DEFSUBR (Fmsprinter_apply_settings); - DEFSUBR (Fmsprinter_settings_copy); - DEFSUBR (Fmsprinter_settings_despecialize); - defsymbol (&Qinit_pre_mswindows_win, "init-pre-mswindows-win"); defsymbol (&Qinit_post_mswindows_win, "init-post-mswindows-win"); -} -void -console_type_create_device_mswindows (void) -{ - CONSOLE_HAS_METHOD (mswindows, init_device); - CONSOLE_HAS_METHOD (mswindows, finish_init_device); - CONSOLE_HAS_METHOD (mswindows, mark_device); - CONSOLE_HAS_METHOD (mswindows, delete_device); - CONSOLE_HAS_METHOD (mswindows, device_system_metrics); - CONSOLE_HAS_METHOD (mswindows, device_implementation_flags); - - CONSOLE_HAS_METHOD (msprinter, init_device); - CONSOLE_HAS_METHOD (msprinter, mark_device); - CONSOLE_HAS_METHOD (msprinter, delete_device); - CONSOLE_HAS_METHOD (msprinter, device_system_metrics); - CONSOLE_HAS_METHOD (msprinter, device_implementation_flags); -} - - -void -vars_of_device_mswindows (void) -{ DEFVAR_LISP ("mswindows-downcase-file-names", &Vmswindows_downcase_file_names /* Non-nil means convert all-upper case file names to lower case. This applies when performing completions and file name expansion. @@ -1206,3 +315,19 @@ */ ); Vmswindows_get_true_file_attributes = Qnil; } + +void +console_type_create_device_mswindows (void) +{ + CONSOLE_HAS_METHOD (mswindows, init_device); + CONSOLE_HAS_METHOD (mswindows, finish_init_device); +/* CONSOLE_HAS_METHOD (mswindows, mark_device); */ + CONSOLE_HAS_METHOD (mswindows, delete_device); + CONSOLE_HAS_METHOD (mswindows, device_system_metrics); + CONSOLE_HAS_METHOD (mswindows, device_implementation_flags); +} + +void +vars_of_device_mswindows (void) +{ +} diff -r 12e008d41344 -r 697ef44129c6 src/device-tty.c --- a/src/device-tty.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/device-tty.c Mon Aug 13 11:20:41 2007 +0200 @@ -38,6 +38,10 @@ #include "syssignal.h" /* for SIGWINCH */ +#ifdef HAVE_GPM +#include <gpm.h> +#endif + #include <errno.h> Lisp_Object Qinit_pre_tty_win, Qinit_post_tty_win; @@ -151,6 +155,15 @@ CONSOLE_TTY_DATA (con)->width = width; CONSOLE_TTY_DATA (con)->height = height; +#ifdef HAVE_GPM + /* We need to tell GPM how big our screen is now + ** I am pretty sure the GPM library will get incredibly confused + ** if you try to connect to more than one mouse-capable device, + ** so I don't think it will cause any more damage in that case. + */ + gpm_mx = width; + gpm_my = height; +#endif for (tail = DEVICE_FRAME_LIST (d); !NILP (tail); tail = XCDR (tail)) diff -r 12e008d41344 -r 697ef44129c6 src/device-x.c --- a/src/device-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/device-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -50,10 +50,6 @@ #include "sysfile.h" #include "systime.h" -#if defined(HAVE_SHLIB) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D) -#include "sysdll.h" -#endif /* HAVE_SHLIB and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ - #ifdef HAVE_OFFIX_DND #include "offix.h" #endif @@ -391,8 +387,8 @@ vi_out [i].depth == 1 || vi_out [i].depth == 8) #endif - - /* SGI has 30-bit deep visuals. Ignore them. + + /* SGI has 30-bit deep visuals. Ignore them. (We only have 24-bit data anyway.) */ && (vi_out [i].depth <= 24) @@ -460,9 +456,9 @@ Widget app_shell; int argc; char **argv; - const char *app_class; - const char *app_name; - const char *disp_name; + 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,78 +466,6 @@ /* */ int best_visual_found = 0; -#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 - * to look for symbols that shouldn't be there and refusing to run if they - * are seems a less toxic idea than having XEmacs crash when we try and - * use a subclass of a widget that has changed size. - * - * It's ugly, I know, and not going to work everywhere. It seems better to - * do our damnedest to try and tell the user what to expect rather than - * simply blow up though. - * - * All the ThreeD variants I have access to define the following function - * symbols in the shared library. The flat Xaw library does not define them: - * - * Xaw3dComputeBottomShadowRGB - * Xaw3dComputeTopShadowRGB - * - * So far only Linux has shown this problem. This seems to be portable to - * all the distributions (certainly all the ones I checked - Debian and - * Redhat) - * - * This will only work, sadly, with dlopen() -- the other dynamic linkers - * are simply not capable of doing what is needed. :/ - */ - - { - /* Get a dll handle to the main process. */ - dll_handle xaw_dll_handle = dll_open (NULL); - - /* Did that fail? If so, continue without error. - * We could die here but, well, that's unfriendly and all -- plus I feel - * better about some crashing somewhere rather than preventing a perfectly - * good configuration working just because dll_open failed. - */ - if (xaw_dll_handle != NULL) - { - /* Look for the Xaw3d function */ - dll_func xaw_function_handle = - dll_function (xaw_dll_handle, "Xaw3dComputeTopShadowRGB"); - - /* If we found it, warn the user in big, nasty, unfriendly letters */ - if (xaw_function_handle != NULL) - { - warn_when_safe (Qdevice, Qerror, "\n" -"It seems that XEmacs is built dynamically linked to the flat Athena widget\n" -"library but it finds a 3D Athena variant with the same name at runtime.\n" -"\n" -"This WILL cause your XEmacs process to dump core at some point.\n" -"You should not continue to use this binary without resolving this issue.\n" -"\n" -"This can be solved with the xaw-wrappers package under Debian\n" -"(register XEmacs as incompatible with all 3d widget sets, see\n" -"update-xaw-wrappers(8) and .../doc/xaw-wrappers/README.packagers). It\n" -"can be verified by checking the runtime path in /etc/ld.so.conf and by\n" -"using `ldd /path/to/xemacs' under other Linux distributions. One\n" -"solution is to use LD_PRELOAD or LD_LIBRARY_PATH to force ld.so to\n" -"load the flat Athena widget library instead of the aliased 3D widget\n" -"library (see ld.so(8) for use of these environment variables).\n\n" - ); - - } - - /* Otherwise release the handle to the library - * No error catch here; I can't think of a way to recover anyhow. - */ - dll_close (xaw_dll_handle); - } - } -#endif /* HAVE_SHLIB and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */ - - XSETDEVICE (device, d); display = DEVICE_CONNECTION (d); @@ -549,9 +473,7 @@ make_argc_argv (Vx_initial_argv_list, &argc, &argv); - TO_EXTERNAL_FORMAT (LISP_STRING, display, - C_STRING_ALLOCA, disp_name, - Qctext); + GET_C_STRING_CTEXT_DATA_ALLOCA (display, disp_name); /* * Break apart the old XtOpenDisplay call into XOpenDisplay and @@ -573,9 +495,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); + GET_C_STRING_CTEXT_DATA_ALLOCA (Vx_emacs_application_class, app_class); else { app_class = (NILP (Vx_emacs_application_class) && @@ -609,17 +529,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); + GET_C_STRING_FILENAME_DATA_ALLOCA(Vx_app_defaults_directory, data_dir); path = (char *)alloca (strlen (data_dir) + strlen (locale) + 7); sprintf (path, "%s%s/Emacs", data_dir, locale); if (!access (path, R_OK)) @@ -627,9 +545,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); + GET_C_STRING_FILENAME_DATA_ALLOCA (Vdata_directory, data_dir); path = (char *)alloca (strlen (data_dir) + 13 + strlen (locale) + 7); sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale); if (!access (path, R_OK)) @@ -650,10 +566,8 @@ XtGetApplicationNameAndClass (dpy, (char **) &app_name, (char **) &app_class); /* search for a matching visual if requested by the user, or setup the display default */ { - int resource_name_length = max (sizeof (".emacsVisual"), - sizeof (".privateColormap")); - char *buf1 = alloca_array (char, strlen (app_name) + resource_name_length); - char *buf2 = alloca_array (char, strlen (app_class) + resource_name_length); + char *buf1 = (char *)alloca (strlen (app_name) + 17); + char *buf2 = (char *)alloca (strlen (app_class) + 17); char *type; XrmValue value; @@ -661,14 +575,13 @@ sprintf (buf2, "%s.EmacsVisual", app_class); if (XrmGetResource (XtDatabase (dpy), buf1, buf2, &type, &value) == True) { - int cnt = 0; - int vis_class = PseudoColor; + int cnt = 0, vis_class = PseudoColor; XVisualInfo vinfo; - char *str = (char*) value.addr; + char *res, *str = (char*)value.addr; -#define CHECK_VIS_CLASS(visual_class) \ - else if (memcmp (str, #visual_class, sizeof (#visual_class) - 1) == 0) \ - cnt = sizeof (#visual_class) - 1, vis_class = visual_class +#define CHECK_VIS_CLASS(class) \ + else if (strncmp (str, #class, sizeof (#class) - 1) == 0) \ + cnt = sizeof (#class) - 1, vis_class = class if (1) ; @@ -681,7 +594,8 @@ if (cnt) { - depth = atoi (str + cnt); + res = str + cnt; + depth = atoi (res); if (depth == 0) { stderr_out ("Invalid Depth specification in %s... ignoring...\n", str); @@ -739,7 +653,7 @@ else { /* We have to create a matching colormap anyway... - #### think about using standard colormaps (need the Xmu libs?) */ + ### think about using standard colormaps (need the Xmu libs?) */ cmap = XCreateColormap(dpy, RootWindow(dpy, screen), visual, AllocNone); XInstallColormap(dpy, cmap); } @@ -782,7 +696,7 @@ XtRealizeWidget (app_shell); } -#ifdef HAVE_WMCOMMAND +#ifdef HAVE_SESSION { int new_argc; char **new_argv; @@ -790,7 +704,7 @@ XSetCommand (XtDisplay (app_shell), XtWindow (app_shell), new_argv, new_argc); free_argc_argv (new_argv); } -#endif /* HAVE_WMCOMMAND */ +#endif /* HAVE_SESSION */ #ifdef HAVE_OFFIX_DND @@ -814,7 +728,7 @@ DEVICE_X_GC_CACHE (d) = make_gc_cache (dpy, XtWindow(app_shell)); DEVICE_X_GRAY_PIXMAP (d) = None; Xatoms_of_device_x (d); - Xatoms_of_select_x (d); + Xatoms_of_xselect (d); Xatoms_of_objects_x (d); x_init_device_class (d); @@ -829,10 +743,10 @@ } static void -x_mark_device (struct device *d) +x_mark_device (struct device *d, void (*markobj) (Lisp_Object)) { - mark_object (DEVICE_X_WM_COMMAND_FRAME (d)); - mark_object (DEVICE_X_DATA (d)->x_keysym_map_hash_table); + markobj (DEVICE_X_WM_COMMAND_FRAME (d)); + markobj (DEVICE_X_DATA (d)->x_keysym_map_hash_table); } @@ -913,10 +827,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", @@ -1362,7 +1276,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, unless NOERROR is t, in which case no warning is issued. + instead. The resource names passed to this function are looked up relative to the locale. @@ -1421,7 +1335,7 @@ found. If the third arg is `string', a string is returned, and if it is `integer', an integer is returned. If the third arg is `boolean', then the returned value is the list (t) for true, (nil) for false, and is nil to -mean ``unspecified''. +mean ``unspecified.'' */ (name, class, type, locale, device, no_error)) { @@ -1684,19 +1598,17 @@ */ (keysym)) { - const char *keysym_ext; + CONST char *keysym_ext; CHECK_STRING (keysym); - TO_EXTERNAL_FORMAT (LISP_STRING, keysym, - C_STRING_ALLOCA, keysym_ext, - Qctext); + GET_C_STRING_CTEXT_DATA_ALLOCA (keysym, keysym_ext); return XStringToKeysym (keysym_ext) ? Qt : Qnil; } DEFUN ("x-keysym-hash-table", Fx_keysym_hash_table, 0, 1, 0, /* -Return a hash table containing a key for all keysyms on DEVICE. -DEVICE must be an X11 display device. See `x-keysym-on-keyboard-p'. +Return a hash table which contains a hash key for all keysyms which +name keys on the keyboard. See `x-keysym-on-keyboard-p'. */ (device)) { @@ -1838,7 +1750,7 @@ So long as the keyboard is grabbed, all keyboard events will be delivered to emacs -- it is not possible for other X clients to eavesdrop on them. Ungrab the keyboard with `x-ungrab-keyboard' (use an unwind-protect). -Returns t if the grab is successful, nil otherwise. +Returns t if the grab was successful; nil otherwise. */ (device)) { @@ -1890,16 +1802,15 @@ { 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) signal_simple_error ("Can't get X font path", device); while (ndirs_return--) - font_path = Fcons (build_ext_string (directories[ndirs_return], - Qfile_name), - font_path); + font_path = Fcons (build_ext_string (directories[ndirs_return], + FORMAT_FILENAME), font_path); return font_path; } @@ -1922,7 +1833,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 +1842,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); + GET_C_STRING_FILENAME_DATA_ALLOCA (XCAR (path_entry), directories[i++]); } expect_x_error (dpy); @@ -1984,43 +1893,29 @@ } void -reinit_console_type_create_device_x (void) -{ - /* Initialize variables to speed up X resource interactions */ - const char *valid_resource_chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - while (*valid_resource_chars) - valid_resource_char_p[(unsigned int) (*valid_resource_chars++)] = 1; - - name_char_dynarr = Dynarr_new (char); - class_char_dynarr = Dynarr_new (char); -} - -void console_type_create_device_x (void) { - reinit_console_type_create_device_x (); CONSOLE_HAS_METHOD (x, init_device); CONSOLE_HAS_METHOD (x, finish_init_device); CONSOLE_HAS_METHOD (x, mark_device); CONSOLE_HAS_METHOD (x, delete_device); CONSOLE_HAS_METHOD (x, device_system_metrics); -} -void -reinit_vars_of_device_x (void) -{ - error_expected = 0; - error_occurred = 0; + { + /* Initialize variables to speed up X resource interactions */ + CONST char *valid_resource_chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + while (*valid_resource_chars) + valid_resource_char_p[(unsigned int) (*valid_resource_chars++)] = 1; - in_resource_setting = 0; + name_char_dynarr = Dynarr_new (char); + class_char_dynarr = Dynarr_new (char); + } } void vars_of_device_x (void) { - reinit_vars_of_device_x (); - DEFVAR_LISP ("x-emacs-application-class", &Vx_emacs_application_class /* The X application class of the XEmacs process. This controls, among other things, the name of the `app-defaults' file @@ -2063,4 +1958,9 @@ staticpro (&Vdefault_x_device); Vdefault_x_device = Qnil; + + error_expected = 0; + error_occurred = 0; + + in_resource_setting = 0; } diff -r 12e008d41344 -r 697ef44129c6 src/device.c --- a/src/device.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/device.c Mon Aug 13 11:20:41 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 @@ -68,45 +68,46 @@ Qfont_menubar, Qfont_dialog, Qsize_cursor, Qsize_scrollbar, Qsize_menu, Qsize_toolbar, Qsize_toolbar_button, Qsize_toolbar_border, Qsize_icon, Qsize_icon_small, Qsize_device, - Qsize_workspace, Qoffset_workspace, Qsize_device_mm, Qdevice_dpi, - Qnum_bit_planes, Qnum_color_cells, Qmouse_buttons, Qswap_buttons, - Qshow_sounds, Qslow_device, Qsecurity; + Qsize_workspace, Qsize_device_mm, Qdevice_dpi, Qnum_bit_planes, + Qnum_color_cells, Qmouse_buttons, Qswap_buttons, Qshow_sounds, + Qslow_device, Qsecurity; Lisp_Object Qdevicep, Qdevice_live_p; +Lisp_Object Qdelete_device; Lisp_Object Qcreate_device_hook; Lisp_Object Qdelete_device_hook; Lisp_Object Vdevice_class_list; static Lisp_Object -mark_device (Lisp_Object obj) +mark_device (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct device *d = XDEVICE (obj); - mark_object (d->name); - mark_object (d->connection); - mark_object (d->canon_connection); - mark_object (d->console); - mark_object (d->selected_frame); - mark_object (d->frame_with_focus_real); - mark_object (d->frame_with_focus_for_hooks); - mark_object (d->frame_that_ought_to_have_focus); - mark_object (d->device_class); - mark_object (d->user_defined_tags); - mark_object (d->pixel_to_glyph_cache.obj1); - mark_object (d->pixel_to_glyph_cache.obj2); + markobj (d->name); + markobj (d->connection); + markobj (d->canon_connection); + markobj (d->console); + markobj (d->selected_frame); + markobj (d->frame_with_focus_real); + markobj (d->frame_with_focus_for_hooks); + markobj (d->frame_that_ought_to_have_focus); + markobj (d->device_class); + markobj (d->user_defined_tags); + markobj (d->pixel_to_glyph_cache.obj1); + markobj (d->pixel_to_glyph_cache.obj2); - mark_object (d->color_instance_cache); - mark_object (d->font_instance_cache); + markobj (d->color_instance_cache); + markobj (d->font_instance_cache); #ifdef MULE - mark_object (d->charset_font_cache); + markobj (d->charset_font_cache); #endif - mark_object (d->image_instance_cache); + markobj (d->image_instance_cache); if (d->devmeths) { - mark_object (d->devmeths->symbol); - MAYBE_DEVMETH (d, mark_device, (d)); + markobj (d->devmeths->symbol); + MAYBE_DEVMETH (d, mark_device, (d, markobj)); } return (d->frame_list); @@ -125,7 +126,7 @@ sprintf (buf, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" : DEVICE_TYPE_NAME (d)); write_c_string (buf, printcharfun); - if (DEVICE_LIVE_P (d) && !NILP (DEVICE_CONNECTION (d))) + if (DEVICE_LIVE_P (d)) { write_c_string (" on ", printcharfun); print_internal (DEVICE_CONNECTION (d), printcharfun, 1); @@ -135,7 +136,7 @@ } DEFINE_LRECORD_IMPLEMENTATION ("device", device, - mark_device, print_device, 0, 0, 0, 0, + mark_device, print_device, 0, 0, 0, struct device); int @@ -386,24 +387,16 @@ semi_canonicalize_device_connection (struct console_methods *meths, Lisp_Object name, Error_behavior errb) { - if (HAS_CONTYPE_METH_P (meths, semi_canonicalize_device_connection)) - return CONTYPE_METH (meths, semi_canonicalize_device_connection, - (name, errb)); - else - return CONTYPE_METH_OR_GIVEN (meths, canonicalize_device_connection, - (name, errb), name); + return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_device_connection, + (name, errb), name); } static Lisp_Object canonicalize_device_connection (struct console_methods *meths, Lisp_Object name, Error_behavior errb) { - if (HAS_CONTYPE_METH_P (meths, canonicalize_device_connection)) - return CONTYPE_METH (meths, canonicalize_device_connection, - (name, errb)); - else - return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_device_connection, - (name, errb), name); + return CONTYPE_METH_OR_GIVEN (meths, canonicalize_device_connection, + (name, errb), name); } static Lisp_Object @@ -891,7 +884,6 @@ MARK_FRAME_GLYPHS_CHANGED (f); MARK_FRAME_SUBWINDOWS_CHANGED (f); MARK_FRAME_TOOLBARS_CHANGED (f); - MARK_FRAME_GUTTERS_CHANGED (f); f->menubar_changed = 1; } } @@ -920,15 +912,6 @@ return make_int (DEVICE_BAUD_RATE (decode_device (device))); } -DEFUN ("device-printer-p", Fdevice_printer_p, 0, 1, 0, /* -Return t if DEVICE is a printer, nil if it is a display. DEVICE defaults -to selected device if omitted, and must be live if specified. -*/ - (device)) -{ - return DEVICE_PRINTER_P (decode_device (device)) ? Qt : Qnil; -} - DEFUN ("device-system-metric", Fdevice_system_metric, 1, 3, 0, /* Get a metric for DEVICE as provided by the system. @@ -984,14 +967,11 @@ size-toolbar-border Toolbar border width and height. size-icon Icon dimensions. 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 - 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, in pixels. +size-device Device screen size in pixels. +size-workspace Workspace size in pixels. This can be less than the + above if window manager has decorations which + effectively shrink the area remaining for application + windows. size-device-mm Device screen size in millimeters. device-dpi Device resolution, in dots per inch. num-bit-planes Integer, number of device bit planes. @@ -1048,7 +1028,6 @@ FROB (size_icon_small); FROB (size_device); FROB (size_workspace); - FROB (offset_workspace); FROB (size_device_mm); FROB (device_dpi); FROB (num_bit_planes); @@ -1111,7 +1090,6 @@ FROB (size_icon_small); FROB (size_device); FROB (size_workspace); - FROB (offset_workspace); FROB (size_device_mm); FROB (device_dpi); FROB (num_bit_planes); @@ -1200,12 +1178,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. */ -#ifdef SIGWINCH +#ifndef WINDOWSNT EMACS_BLOCK_SIGNAL (SIGWINCH); #endif if (old_asynch_device_change_pending == asynch_device_change_pending) asynch_device_change_pending = 0; -#ifdef SIGWINCH +#ifndef WINDOWSNT EMACS_UNBLOCK_SIGNAL (SIGWINCH); #endif } @@ -1245,8 +1223,6 @@ void syms_of_device (void) { - INIT_LRECORD_IMPLEMENTATION (device); - DEFSUBR (Fvalid_device_class_p); DEFSUBR (Fdevice_class_list); @@ -1271,10 +1247,10 @@ DEFSUBR (Fset_device_baud_rate); DEFSUBR (Fdevice_baud_rate); DEFSUBR (Fdomain_device_type); - DEFSUBR (Fdevice_printer_p); defsymbol (&Qdevicep, "devicep"); defsymbol (&Qdevice_live_p, "device-live-p"); + defsymbol (&Qdelete_device, "delete-device"); defsymbol (&Qcreate_device_hook, "create-device-hook"); defsymbol (&Qdelete_device_hook, "delete-device-hook"); @@ -1311,7 +1287,6 @@ defsymbol (&Qsize_icon_small, "size-icon-small"); defsymbol (&Qsize_device, "size-device"); defsymbol (&Qsize_workspace, "size-workspace"); - defsymbol (&Qoffset_workspace, "offset-workspace"); defsymbol (&Qsize_device_mm, "size-device-mm"); defsymbol (&Qnum_bit_planes, "num-bit-planes"); defsymbol (&Qnum_color_cells, "num-color-cells"); @@ -1324,18 +1299,8 @@ } void -reinit_vars_of_device (void) -{ - staticpro_nodump (&Vdefault_device); - Vdefault_device = Qnil; - asynch_device_change_pending = 0; -} - -void vars_of_device (void) { - reinit_vars_of_device (); - DEFVAR_LISP ("create-device-hook", &Vcreate_device_hook /* Function or functions to call when a device is created. One argument, the newly-created device. @@ -1351,6 +1316,11 @@ */ ); Vdelete_device_hook = Qnil; + staticpro (&Vdefault_device); + Vdefault_device = Qnil; + + asynch_device_change_pending = 0; + Vdevice_class_list = list3 (Qcolor, Qgrayscale, Qmono); staticpro (&Vdevice_class_list); diff -r 12e008d41344 -r 697ef44129c6 src/device.h --- a/src/device.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/device.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,8 +24,8 @@ /* Written by Chuck Thompson and Ben Wing. */ -#ifndef INCLUDED_device_h_ -#define INCLUDED_device_h_ +#ifndef _XEMACS_DEVICE_H_ +#define _XEMACS_DEVICE_H_ #include "console.h" @@ -168,13 +168,11 @@ unsigned int frame_changed :1; unsigned int glyphs_changed :1; unsigned int subwindows_changed :1; - unsigned int subwindows_state_changed :1; unsigned int icon_changed :1; unsigned int menubar_changed :1; unsigned int modeline_changed :1; unsigned int point_changed :1; unsigned int size_changed :1; - unsigned int gutter_changed :1; unsigned int toolbar_changed :1; unsigned int windows_changed :1; unsigned int windows_structure_changed :1; @@ -221,6 +219,7 @@ #define XDEVICE(x) XRECORD (x, device, struct device) #define XSETDEVICE(x, p) XSETRECORD (x, p, device) #define DEVICEP(x) RECORDP (x, device) +#define GC_DEVICEP(x) GC_RECORDP (x, device) #define CHECK_DEVICE(x) CHECK_RECORD (x, device) #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device) @@ -238,16 +237,16 @@ #define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER struct device * +INLINE struct device * error_check_device_type (struct device *d, Lisp_Object sym); -INLINE_HEADER struct device * +INLINE struct device * error_check_device_type (struct device *d, Lisp_Object sym) { assert (EQ (DEVICE_TYPE (d), sym)); return d; } # define DEVICE_TYPE_DATA(d, type) \ - ((struct type##_device *) error_check_device_type (d, Q##type)->device_data) + ((struct type##_device *) (error_check_device_type (d, Q##type))->device_data) #else # define DEVICE_TYPE_DATA(d, type) \ ((struct type##_device *) (d)->device_data) @@ -270,47 +269,6 @@ (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. */ @@ -335,7 +293,6 @@ EXFUN (Fdevice_console, 1); EXFUN (Fdevice_name, 1); -EXFUN (Ffind_device, 2); EXFUN (Fmake_device, 3); EXFUN (Fselected_device, 1); @@ -390,15 +347,9 @@ #define MARK_DEVICE_SUBWINDOWS_CHANGED(d) \ ((void) (subwindows_changed = (d)->subwindows_changed = 1)) -#define MARK_DEVICE_SUBWINDOWS_STATE_CHANGED(d) \ - ((void) (subwindows_state_changed = (d)->subwindows_state_changed = 1)) - #define MARK_DEVICE_TOOLBARS_CHANGED(d) \ ((void) (toolbar_changed = (d)->toolbar_changed = 1)) -#define MARK_DEVICE_GUTTERS_CHANGED(d) \ - ((void) (gutter_changed = (d)->gutter_changed = 1)) - #define MARK_DEVICE_SIZE_CHANGED(d) \ ((void) (size_changed = (d)->size_changed = 1)) @@ -410,14 +361,6 @@ MARK_DEVICE_FACES_CHANGED (mdffc_d); \ } while (0) -#define MARK_DEVICE_FRAMES_GLYPHS_CHANGED(d) do { \ - struct device *mdffc_d = (d); \ - Lisp_Object frmcons; \ - DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ - XFRAME (XCAR (frmcons))->glyphs_changed = 1; \ - MARK_DEVICE_GLYPHS_CHANGED (mdffc_d); \ -} while (0) - #define MARK_DEVICE_FRAME_CHANGED(d) \ ((void) (frame_changed = (d)->frame_changed = 1)) @@ -427,8 +370,6 @@ #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 @@ -464,4 +405,4 @@ Lisp_Object domain_device_type (Lisp_Object domain); int window_system_pixelated_geometry (Lisp_Object domain); -#endif /* INCLUDED_device_h_ */ +#endif /* _XEMACS_DEVICE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/dgif_lib.c --- a/src/dgif_lib.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dgif_lib.c Mon Aug 13 11:20:41 2007 +0200 @@ -11,10 +11,23 @@ * 19 Feb 98 - Version 1.2 by Jareth Hein (Support for user specified I/O) * ******************************************************************************/ -#include <config.h> -#include "lisp.h" +#ifdef __MSDOS__ +#include <io.h> +#include <alloc.h> +#include <stdlib.h> +#include <sys\stat.h> +#else +#include <sys/types.h> +#include <sys/stat.h> +#endif /* __MSDOS__ */ -#include "sysfile.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif #include "gifrlib.h" @@ -39,11 +52,11 @@ FILE *f; if ((f = fopen(FileName, -#ifdef WIN32_NATIVE +#ifdef __MSDOS__ "rb" #else "r" -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ )) == NULL) GifInternError(GifFile, D_GIF_ERR_OPEN_FAILED); @@ -60,13 +73,13 @@ { FILE *f; -#ifdef WIN32_NATIVE +#ifdef __MSDOS__ 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 /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ GifStdIOInit(GifFile, f, -1); DGifInitRead(GifFile); @@ -264,11 +277,11 @@ if (!LineLen) LineLen = GifFile->Image.Width; -#if defined(WIN32_NATIVE) || defined(__GNUC__) +#if defined(__MSDOS__) || defined(__GNUC__) if ((Private->PixelCount -= LineLen) > 0xffff0000UL) #else if ((Private->PixelCount -= LineLen) > 0xffff0000) -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } @@ -297,11 +310,11 @@ GifInternError(GifFile, D_GIF_ERR_NOT_READABLE); } -#if defined(WIN32_NATIVE) || defined(__GNUC__) +#if defined(__MSDOS__) || defined(__GNUC__) if (--Private->PixelCount > 0xffff0000UL) #else if (--Private->PixelCount > 0xffff0000) -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } diff -r 12e008d41344 -r 697ef44129c6 src/dialog-msw.c --- a/src/dialog-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dialog-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -110,6 +110,12 @@ #define ID_ITEM_BIAS 32 +typedef struct gui_item struct_gui_item; +typedef struct +{ + Dynarr_declare (struct gui_item); +} struct_gui_item_dynarr; + /* Dialog procedure */ static BOOL CALLBACK dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) @@ -159,28 +165,8 @@ Charcount length = XSTRING_CHAR_LENGTH (string); LPWSTR uni_string; - TO_EXTERNAL_FORMAT (LISP_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); -} - -/* 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); + GET_C_CHARPTR_EXT_DATA_ALLOCA (XSTRING_DATA (string), + FORMAT_OS, mbcs_string); uni_string = alloca_array (WCHAR, length + 1); length = MultiByteToWideChar (CP_ACP, 0, mbcs_string, -1, uni_string, sizeof(WCHAR) * (length + 1)); @@ -214,7 +200,7 @@ static void mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc) { - Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object); + struct_gui_item_dynarr *dialog_items = Dynarr_new (struct_gui_item); unsigned_char_dynarr *template = Dynarr_new (unsigned_char); unsigned int button_row_width = 0; unsigned int text_width, text_height; @@ -237,10 +223,11 @@ { if (!NILP (XCAR (item_cons))) { - Lisp_Object gitem = gui_parse_item_keywords (XCAR (item_cons)); + struct gui_item gitem; + gui_item_init (&gitem); + gui_parse_item_keywords (XCAR (item_cons), &gitem); Dynarr_add (dialog_items, gitem); - button_row_width += button_width (XGUI_ITEM (gitem)->name) - + X_BUTTON_MARGIN; + button_row_width += button_width (gitem.name) + X_BUTTON_MARGIN; } } if (Dynarr_length (dialog_items) == 0) @@ -363,11 +350,10 @@ for (i = 0; i < Dynarr_length (dialog_items); ++i) { - Lisp_Object* gui_item = Dynarr_atp (dialog_items, i); - Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item); + struct gui_item *pgui_item = Dynarr_atp (dialog_items, i); item_tem.style = (WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON - | (gui_item_active_p (*gui_item) ? 0 : WS_DISABLED)); + | (gui_item_active_p (pgui_item) ? 0 : WS_DISABLED)); item_tem.cx = button_width (pgui_item->name); /* Item ids are indices into dialog_items plus offset, to avoid having items by reserved ids (IDOK, IDCANCEL) */ @@ -381,21 +367,7 @@ Dynarr_add_many (template, &button_class_id, sizeof (button_class_id)); /* Next thing to add is control text, as Unicode string */ - { - 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); - } + push_lisp_string_as_unicode (template, pgui_item->name); /* Specify 0 length creation data. */ Dynarr_add_many (template, &zeroes, 2); @@ -418,8 +390,7 @@ 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; + XVECTOR_DATA (vector) [i] = Dynarr_atp (dialog_items, i)->callback; /* Woof! Everything is ready. Pop pop pop in now! */ if (!CreateDialogIndirectParam (NULL, diff -r 12e008d41344 -r 697ef44129c6 src/dialog-x.c --- a/src/dialog-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dialog-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -44,28 +44,22 @@ widget_value *wv; int got_some; wv = xmalloc_widget_value (); - wv->name = xstrdup ("value"); + wv->name = (char *) "value"; got_some = lw_get_some_values (id, wv); if (got_some) { Lisp_Object text_field_callback; char *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 (cons3 (Qnil, - list2 (text_field_callback, - build_string (text_field_value)), - Qnil)); + void *tmp = LISP_TO_VOID (list2 (text_field_callback, + build_string (text_field_value))); popup_selection_callback (0, id, (XtPointer) tmp); + xfree (text_field_value); } } - /* This code tried to optimize, newing/freeing. This is generally - unsafe so we will alwats strdup and always use - free_widget_value_tree. */ - free_widget_value_tree (wv); + free_widget_value (wv); } static void @@ -106,7 +100,7 @@ lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), FRAME_X_TEXT_WIDGET (f)); } -static const char * const button_names [] = { +static CONST char * CONST button_names [] = { "button1", "button2", "button3", "button4", "button5", "button6", "button7", "button8", "button9", "button10" }; @@ -126,7 +120,7 @@ widget_value *prev = 0, *kids = 0; int n = 0; int count = specpdl_depth (); - Lisp_Object wv_closure, gui_item; + Lisp_Object wv_closure; CHECK_CONS (desc); CHECK_STRING (XCAR (desc)); @@ -150,7 +144,7 @@ wv_closure = make_opaque_ptr (kids); record_unwind_protect (widget_value_unwind, wv_closure); - prev->name = xstrdup ("message"); + prev->name = (char *) "message"; prev->value = xstrdup (name); prev->enabled = 1; @@ -169,11 +163,9 @@ CHECK_VECTOR (button); wv = xmalloc_widget_value (); - gui_item = gui_parse_item_keywords (button); - if (!button_item_to_widget_value (Qdialog, - gui_item, wv, allow_text_p, 1, 0)) + if (!button_item_to_widget_value (button, wv, allow_text_p, 1)) { - free_widget_value_tree (wv); + free_widget_value (wv); continue; } @@ -185,9 +177,8 @@ 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]); + wv->value = xstrdup (wv->name); /* what a mess... */ + wv->name = (char *) button_names [n]; if (partition_seen) rbuttons++; @@ -210,7 +201,7 @@ widget_value *dbox; sprintf (tmp_dbox_name, "%c%dBR%d", type, lbuttons + rbuttons, rbuttons); dbox = xmalloc_widget_value (); - dbox->name = xstrdup (tmp_dbox_name); + dbox->name = tmp_dbox_name; dbox->contents = kids; /* No more need to free the half-filled-in structures. */ diff -r 12e008d41344 -r 697ef44129c6 src/dialog.c --- a/src/dialog.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dialog.c Mon Aug 13 11:20:41 2007 +0200 @@ -21,6 +21,9 @@ /* Synched up with: Not in FSF. */ +/* #### There ain't nothin' here because dialog boxes have not been + properly abstracted yet. */ + #include <config.h> #include "lisp.h" #include "frame.h" @@ -45,11 +48,6 @@ 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'. @@ -59,7 +57,8 @@ 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 dialog box buttons is `:active'. +*/ (dbox_desc)) { struct frame *f = selected_frame (); @@ -73,8 +72,7 @@ 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); + signal_simple_error ("Dialog descriptor must supply at least one button", dbox_desc); DEVMETH (d, popup_dialog_box, (f, dbox_desc)); diff -r 12e008d41344 -r 697ef44129c6 src/dired-msw.c --- a/src/dired-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dired-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -76,9 +76,11 @@ #include "regex.h" #include "sysdir.h" +#include "sysfile.h" #include "sysproc.h" -#include "sysfile.h" +#include <windows.h> +#include <limits.h> #include <time.h> #include <winsock.h> /* To make nt.h happy */ diff -r 12e008d41344 -r 697ef44129c6 src/dired.c --- a/src/dired.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dired.c Mon Aug 13 11:20:41 2007 +0200 @@ -23,16 +23,16 @@ #include <config.h> #include "lisp.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" -#include "buffer.h" -#include "commands.h" -#include "elhash.h" -#include "regex.h" -#include "opaque.h" Lisp_Object Vcompletion_ignored_extensions; Lisp_Object Qdirectory_files; @@ -303,11 +303,11 @@ CHECK_STRING (file); -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* Filename completion on Windows ignores case, since Windows filesystems do. */ specbind (Qcompletion_ignore_case, Qt); -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ #ifdef FILE_SYSTEM_CASE file = FILE_SYSTEM_CASE (file); @@ -508,7 +508,7 @@ /* The *pwent() functions do not exist on NT */ -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT static Lisp_Object user_name_completion (Lisp_Object user, int all_flag, @@ -542,7 +542,9 @@ (user)) { int uniq; - Lisp_Object completed = user_name_completion (user, 0, &uniq); + Lisp_Object completed; + + completed = user_name_completion (user, 0, &uniq); return Fcons (completed, uniq ? Qt : Qnil); } @@ -555,15 +557,8 @@ return user_name_completion (user, 1, NULL); } -struct user_name -{ - Bufbyte *ptr; - size_t len; -}; - -struct user_cache -{ - struct user_name *user_names; +struct user_cache { + char **data; int length; int size; EMACS_TIME last_rebuild_time; @@ -575,26 +570,27 @@ { int i; for (i = 0; i < cache->length; i++) - xfree (cache->user_names[i].ptr); - xfree (cache->user_names); - xzero (*cache); + xfree (cache->data[i]); + xfree (cache->data); } static Lisp_Object -user_name_completion_unwind (Lisp_Object cache_incomplete_p) +user_name_completion_unwind (Lisp_Object locative) { - endpwent (); - speed_up_interrupts (); + int interrupted = !NILP (XCAR (locative)); - if (! NILP (XCAR (cache_incomplete_p))) - free_user_cache (&user_cache); - - free_cons (XCONS (cache_incomplete_p)); + if (interrupted) + { + endpwent (); + speed_up_interrupts (); + free_user_cache (&user_cache); + } + free_cons (XCONS (locative)); return Qnil; } -#define USER_CACHE_TTL (24*60*60) /* Time to live: 1 day, in seconds */ +#define USER_CACHE_REBUILD (24*60*60) /* 1 day, in seconds */ static Lisp_Object user_name_completion (Lisp_Object user, int all_flag, int *uniq) @@ -603,6 +599,7 @@ int matchcount = 0; Lisp_Object bestmatch = Qnil; Charcount bestmatchsize = 0; + int speccount = specpdl_depth (); Charcount user_name_length; EMACS_TIME t; int i; @@ -617,42 +614,41 @@ /* Cache user name lookups because it tends to be quite slow. * Rebuild the cache occasionally to catch changes */ EMACS_GET_TIME (t); - if (user_cache.user_names && + if (user_cache.data && (EMACS_SECS (t) - EMACS_SECS (user_cache.last_rebuild_time) - > USER_CACHE_TTL)) - free_user_cache (&user_cache); + > USER_CACHE_REBUILD)) + { + free_user_cache (&user_cache); + xzero (user_cache); + } - if (!user_cache.user_names) + if (!user_cache.data) { struct passwd *pwd; - Lisp_Object cache_incomplete_p = noseeum_cons (Qt, Qnil); - int speccount = specpdl_depth (); - + Lisp_Object locative = noseeum_cons (Qt, Qnil); slow_down_interrupts (); setpwent (); - record_unwind_protect (user_name_completion_unwind, cache_incomplete_p); + record_unwind_protect (user_name_completion_unwind, locative); while ((pwd = getpwent ())) { + Bufbyte *pwuser; QUIT; - DO_REALLOC (user_cache.user_names, user_cache.size, - user_cache.length + 1, struct user_name); - TO_INTERNAL_FORMAT (C_STRING, pwd->pw_name, - MALLOC, - (user_cache.user_names[user_cache.length].ptr, - user_cache.user_names[user_cache.length].len), - Qnative); - user_cache.length++; + DO_REALLOC (user_cache.data, user_cache.size, + user_cache.length + 1, char *); + GET_C_CHARPTR_INT_DATA_ALLOCA (pwd->pw_name, FORMAT_OS, pwuser); + user_cache.data[user_cache.length++] = xstrdup (pwuser); } - XCAR (cache_incomplete_p) = Qnil; - unbind_to (speccount, Qnil); - + endpwent (); + speed_up_interrupts (); + XCAR (locative) = Qnil; + unbind_to (speccount, Qnil); /* free locative cons */ EMACS_GET_TIME (user_cache.last_rebuild_time); } for (i = 0; i < user_cache.length; i++) { - Bufbyte *u_name = user_cache.user_names[i].ptr; - Bytecount len = user_cache.user_names[i].len; + Bufbyte *u_name = user_cache.data[i]; + Bytecount len = strlen ((char *) u_name); /* scmp() works in chars, not bytes, so we have to compute this: */ Charcount cclen = bytecount_to_charcount (u_name, len); @@ -707,11 +703,11 @@ return Qt; return Fsubstring (bestmatch, Qzero, make_int (bestmatchsize)); } -#endif /* ! defined WIN32_NATIVE */ +#endif /* ! defined WINDOWSNT */ Lisp_Object -make_directory_hash_table (const char *path) +make_directory_hash_table (CONST char *path) { DIR *d; if ((d = opendir (path))) @@ -796,7 +792,7 @@ directory = Ffile_name_directory (filename); #endif -#if 0 /* #### shouldn't this apply to WIN32_NATIVE and maybe CYGWIN? */ +#ifdef MSDOS { char *tmpnam = (char *) XSTRING_DATA (Ffile_name_nondirectory (filename)); int l = strlen (tmpnam); @@ -810,7 +806,7 @@ s.st_mode |= S_IEXEC; } } -#endif +#endif /* MSDOS */ switch (s.st_mode & S_IFMT) { @@ -873,7 +869,7 @@ DEFSUBR (Fdirectory_files); DEFSUBR (Ffile_name_completion); DEFSUBR (Ffile_name_all_completions); -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT DEFSUBR (Fuser_name_completion); DEFSUBR (Fuser_name_completion_1); DEFSUBR (Fuser_name_all_completions); diff -r 12e008d41344 -r 697ef44129c6 src/doc.c --- a/src/doc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/doc.c Mon Aug 13 11:20:41 2007 +0200 @@ -138,7 +138,7 @@ } /* #### mrb: following STILL completely broken */ - return_me = make_ext_string ((Bufbyte *) buffer, to - buffer, Qbinary); + return_me = make_ext_string ((Bufbyte *) buffer, to - buffer, FORMAT_BINARY); done: if (buffer != buf) /* We must have allocated buffer above */ @@ -284,7 +284,7 @@ else if (COMPILED_FUNCTIONP (fun)) { Lisp_Object tem; - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); + struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); if (! (f->flags.documentationp)) return Qnil; tem = compiled_function_documentation (f); @@ -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", @@ -573,7 +573,8 @@ { /* Compiled-Function objects sometimes have slots for it. */ - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); + struct Lisp_Compiled_Function *f = + XCOMPILED_FUNCTION (fun); /* This compiled-function object must have a slot for the docstring, since we've found a @@ -639,7 +640,7 @@ kludgily_ignore_lost_doc_p (Lisp_Object sym) { # define kludge_prefix "ad-Orig-" - Lisp_String *name = XSYMBOL (sym)->name; + struct Lisp_String *name = XSYMBOL (sym)->name; return (string_length (name) > (Bytecount) (sizeof (kludge_prefix)) && !strncmp ((char *) string_data (name), kludge_prefix, sizeof (kludge_prefix) - 1)); @@ -683,7 +684,7 @@ } else if (COMPILED_FUNCTIONP (fun)) { - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); + struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); if (! (f->flags.documentationp)) doc = -1; else @@ -885,7 +886,7 @@ case '{': case '<': { - /* #### jump to label `subst_string|subst' crosses + /* ### jump to label `subst_string|subst' crosses initialization of `buffer|_buf' */ Lisp_Object buffer; struct buffer *buf_; diff -r 12e008d41344 -r 697ef44129c6 src/doprnt.c --- a/src/doprnt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/doprnt.c Mon Aug 13 11:20:41 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); @@ -386,7 +386,7 @@ if (strchr (int_converters, ch)) { if (spec->h_flag) - arg.i = va_arg (vargs, int /* short */); + arg.i = va_arg (vargs, short); else if (spec->l_flag) arg.l = va_arg (vargs, long); else @@ -395,7 +395,7 @@ else if (strchr (unsigned_int_converters, ch)) { if (spec->h_flag) - arg.ui = va_arg (vargs, unsigned int /* unsigned short */); + arg.ui = va_arg (vargs, unsigned short); else if (spec->l_flag) arg.ul = va_arg (vargs, unsigned long); else @@ -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) @@ -538,7 +538,7 @@ else { Lisp_Object obj = largs[spec->argnum - 1]; - Lisp_String *ls; + struct Lisp_String *ls; if (ch == 'S') { @@ -657,21 +657,16 @@ 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 (constructed_spec + strlen (constructed_spec), - "%c", ch); - sprintf (text_to_print, constructed_spec, arg.d); - } + 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 @@ -679,12 +674,6 @@ } 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 @@ -708,9 +697,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; @@ -743,7 +732,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, ...) { @@ -760,7 +749,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) { @@ -774,9 +763,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); @@ -785,7 +774,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, ...) { @@ -807,7 +796,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, ...) { @@ -830,7 +819,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) { @@ -853,9 +842,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 (); @@ -873,7 +862,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 12e008d41344 -r 697ef44129c6 src/dragdrop.h --- a/src/dragdrop.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dragdrop.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_dragdrop_h_ -#define INCLUDED_dragdrop_h_ +#ifndef _XEMACS_DRAGDROP_H_ +#define _XEMACS_DRAGDROP_H_ /* Drag'n'Drop data types known by XEmacs */ extern Lisp_Object Qdragdrop_MIME; @@ -37,4 +37,4 @@ /* emacs interface */ void syms_of_dragdrop (void); -#endif /* INCLUDED_dragdrop_h_ */ +#endif /* _XEMACS_DRAGDROP_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/dump-id.h --- a/src/dump-id.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -#ifndef INCLUDED_dump_id_h_ -#define INCLUDED_dump_id_h_ - -extern unsigned int dump_id; - -#endif diff -r 12e008d41344 -r 697ef44129c6 src/dumper.c --- a/src/dumper.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1378 +0,0 @@ -/* 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 <config.h> -#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 <sys/mman.h> -#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; i<rt->count; 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; i<pdump_struct_table.count; i++) - if (pdump_struct_table.list[i].sdesc == sdesc) - return &pdump_struct_table.list[i].list; - - if (pdump_struct_table.size <= pdump_struct_table.count) - { - if (pdump_struct_table.size == -1) - pdump_struct_table.size = 10; - else - pdump_struct_table.size = pdump_struct_table.size * 2; - pdump_struct_table.list = (pdump_struct_list_elmt *) - xrealloc (pdump_struct_table.list, - pdump_struct_table.size * sizeof (pdump_struct_list_elmt)); - } - pdump_struct_table.list[pdump_struct_table.count].list.first = 0; - pdump_struct_table.list[pdump_struct_table.count].list.align = 8; - pdump_struct_table.list[pdump_struct_table.count].list.count = 0; - pdump_struct_table.list[pdump_struct_table.count].sdesc = sdesc; - - return &pdump_struct_table.list[pdump_struct_table.count++].list; -} - -static struct -{ - struct lrecord_header *obj; - int position; - int offset; -} backtrace[65536]; - -static int depth; - -static void pdump_backtrace (void) -{ - int i; - stderr_out ("pdump backtrace :\n"); - for (i=0;i<depth;i++) - { - if (!backtrace[i].obj) - stderr_out (" - ind. (%d, %d)\n", backtrace[i].position, backtrace[i].offset); - else - { - stderr_out (" - %s (%d, %d)\n", - LHEADER_IMPLEMENTATION (backtrace[i].obj)->name, - 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; i<count; i++) - { - pdump_register_sub (((char *)data) + sdesc->size*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; i<count; i++) - { - char *cur = ((char *)pdump_buf) + i*size; - restart: - for (pos = 0; desc[pos].type != XD_END; pos++) - { - void *rdata = cur + desc[pos].offset; - switch (desc[pos].type) - { - case XD_SPECIFIER_END: - desc = ((const Lisp_Specifier *)(elmt->obj))->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; j<num; j++) - ((EMACS_INT *)rdata)[j] = pdump_qnil->save_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; j<num; j++) - { - Lisp_Object *pobj = ((Lisp_Object *)rdata) + j; - if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) - *(EMACS_INT *)pobj = - pdump_get_entry (XRECORD_LHEADER (*pobj))->save_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, XTYPE (*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<num; j++) - { - Lisp_Object *pobj = (Lisp_Object *) rdata + j; - - if (POINTER_TYPE_P (XTYPE (*pobj)) - && ! EQ (*pobj, Qnull_pointer)) - XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta); - } - break; - } - case XD_DOC_STRING: - { - EMACS_INT str = *(EMACS_INT *)rdata; - if (str > 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; i<lrecord_type_count; 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; i<pdump_struct_table.count; i++) - if (pdump_struct_table.list[i].list.align == align) - { - elmt = pdump_struct_table.list[i].list.first; - idesc = pdump_struct_table.list[i].sdesc->description; - 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; i<staticidx; i++) - { - Lisp_Object obj = *staticvec[i]; - if (POINTER_TYPE_P (XTYPE (obj))) - reloc[i] = pdump_get_entry (XRECORD_LHEADER (obj))->save_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; i<dumpstructidx; i++) - { - EMACS_INT adr; - write (pdump_fd, &(dumpstructvec[i].data), sizeof (void *)); - adr = pdump_get_entry (*(void **)(dumpstructvec[i].data))->save_offset; - write (pdump_fd, &adr, sizeof (adr)); - } -} - -static void -pdump_dump_opaquevec (void) -{ - int i; - for (i=0; i<dumpopaqueidx; i++) - { - write (pdump_fd, &(dumpopaquevec[i]), sizeof (dumpopaquevec[i])); - write (pdump_fd, dumpopaquevec[i].data, dumpopaquevec[i].size); - } -} - -static void -pdump_dump_itable (void) -{ - write (pdump_fd, lrecord_implementations_table, lrecord_type_count*sizeof (lrecord_implementations_table[0])); -} - -static void -pdump_dump_rtables (void) -{ - int i, j; - pdump_entry_list_elmt *elmt; - pdump_reloc_table rt; - - for (i=0; i<lrecord_type_count; 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; i<pdump_struct_table.count; i++) - { - elmt = pdump_struct_table.list[i].list.first; - rt.desc = pdump_struct_table.list[i].sdesc->description; - 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; j<elmt->count; 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; i<pdump_wireidx; i++) - { - EMACS_INT obj = pdump_get_entry (XRECORD_LHEADER (*(pdump_wirevec[i])))->save_offset; - write (pdump_fd, &pdump_wirevec[i], sizeof (pdump_wirevec[i])); - write (pdump_fd, &obj, sizeof (obj)); - } - - for (i=0; i<pdump_wireidx_list; i++) - { - Lisp_Object obj = *(pdump_wirevec_list[i]); - pdump_entry_list_elmt *elmt; - EMACS_INT res; - - for (;;) - { - const struct lrecord_description *desc; - int pos; - elmt = pdump_get_entry (XRECORD_LHEADER (obj)); - if (elmt) - break; - desc = XRECORD_LHEADER_IMPLEMENTATION (obj)->description; - 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; i<lrecord_type_count; 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; i<staticidx; i++) - pdump_register_object (*staticvec[i]); - for (i=0; i<pdump_wireidx; i++) - pdump_register_object (*pdump_wirevec[i]); - - none = 1; - for (i=0; i<lrecord_type_count; i++) - if (pdump_alert_undump_object[i]) - { - if (none) - printf ("Undumpable types list :\n"); - none = 0; - printf (" - %s (%d)\n", lrecord_implementations_table[i]->name, pdump_alert_undump_object[i]); - } - if (!none) - return; - - for (i=0; i<dumpstructidx; i++) - pdump_register_struct (*(void **)(dumpstructvec[i].data), dumpstructvec[i].desc, 1); - - memcpy (hd.signature, DUMP_SIGNATURE, DUMP_SIGNATURE_LEN); - hd.id = dump_id; - hd.reloc_address = 0; - hd.nb_staticpro = staticidx; - hd.nb_structdmp = dumpstructidx; - hd.nb_opaquedmp = dumpopaqueidx; - - cur_offset = 256; - max_size = 0; - - pdump_scan_by_alignment (pdump_allocate_offset); - pdump_qnil = pdump_get_entry (XRECORD_LHEADER (Qnil)); - - pdump_buf = xmalloc (max_size); - /* Avoid use of the `open' macro. We want the real function. */ -#undef open - pdump_fd = open (EMACS_PROGNAME ".dmp", - O_WRONLY | O_CREAT | O_TRUNC | OPEN_BINARY, 0666); - hd.stab_offset = (cur_offset + 3) & ~3; - - write (pdump_fd, &hd, sizeof (hd)); - lseek (pdump_fd, 256, SEEK_SET); - - pdump_scan_by_alignment (pdump_dump_data); - - lseek (pdump_fd, hd.stab_offset, SEEK_SET); - - pdump_dump_staticvec (); - pdump_dump_structvec (); - pdump_dump_opaquevec (); - pdump_dump_itable (); - pdump_dump_rtables (); - pdump_dump_wired (); - - close (pdump_fd); - free (pdump_buf); - - free (pdump_hash); - - Vterminal_console = t_console; - Vterminal_frame = t_frame; - Vterminal_device = t_device; -} - -static int pdump_load_check (void) -{ - return (!memcmp (((dump_header *)pdump_start)->signature, 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; i<staticidx; i++) - { - Lisp_Object obj = PDUMP_READ (p, Lisp_Object); - if (POINTER_TYPE_P (XTYPE (obj))) - XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta); - *staticvec[i] = obj; - } - - /* Put back the dumpstructs */ - for (i=0; i<((dump_header *)pdump_start)->nb_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; i<count; i++) - { - Lisp_Object *var = PDUMP_READ (p, Lisp_Object *); - Lisp_Object obj = PDUMP_READ (p, Lisp_Object); - - if (POINTER_TYPE_P (XTYPE (obj))) - XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta); - - *var = obj; - } - - /* Final cleanups */ - /* reorganize hash tables */ - p = pdump_rt_list; - for (;;) - { - pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); - if (!rt.desc) - break; - if (rt.desc == hash_table_description) - { - for (i=0; i < rt.count; i++) - pdump_reorganize_hash_table (PDUMP_READ (p, Lisp_Object)); - break; - } else - p += sizeof (Lisp_Object) * rt.count; - } - - /* Put back noninteractive1 to its real value */ - noninteractive1 = noninteractive; - - return 1; -} - -#ifdef WIN32_NATIVE -/* Free the mapped file if we decide we don't want it after all */ -static void pdump_file_unmap(void) -{ - UnmapViewOfFile (pdump_start); - CloseHandle (pdump_hFile); - CloseHandle (pdump_hMap); -} - -static int pdump_file_get(const char *path) -{ - - pdump_hFile = CreateFile (path, - GENERIC_READ + GENERIC_WRITE, /* Required for copy on write */ - 0, /* Not shared */ - NULL, /* Not inheritable */ - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); /* No template file */ - if (pdump_hFile == INVALID_HANDLE_VALUE) - return 0; - - pdump_length = GetFileSize (pdump_hFile, NULL); - pdump_hMap = CreateFileMapping (pdump_hFile, - NULL, /* No security attributes */ - PAGE_WRITECOPY, /* Copy on write */ - 0, /* Max size, high half */ - 0, /* Max size, low half */ - NULL); /* Unnamed */ - if (pdump_hMap == INVALID_HANDLE_VALUE) - return 0; - - pdump_start = MapViewOfFile (pdump_hMap, - FILE_MAP_COPY, /* Copy on write */ - 0, /* Start at zero */ - 0, - 0); /* Map all of it */ - pdump_free = pdump_file_unmap; - return 1; -} - -/* pdump_resource_free is called (via the pdump_free pointer) to release - any resources allocated by pdump_resource_get. Since the Windows API - specs specifically state that you don't need to (and shouldn't) free the - resources allocated by FindResource, LoadResource, and LockResource this - routine does nothing. */ -static void pdump_resource_free (void) -{ -} - -static int pdump_resource_get (void) -{ - HRSRC hRes; /* Handle to dump resource */ - HRSRC hResLoad; /* Handle to loaded dump resource */ - - /* See Q126630 which describes how Windows NT and 95 trap writes to - resource sections and duplicate the page to allow the write to proceed. - It also describes how to make the resource section read/write (and hence - private to each process). Doing this avoids the exceptions and related - overhead, but causes the resource section to be private to each process - that is running XEmacs. Since the resource section contains little - other than the dumped data, which should be private to each process, we - make the whole resource section read/write so we don't have to copy it. */ - - hRes = FindResource (NULL, MAKEINTRESOURCE(101), "DUMP"); - if (hRes == NULL) - return 0; - - /* Found it, use the data in the resource */ - hResLoad = LoadResource (NULL, hRes); - if (hResLoad == NULL) - return 0; - - pdump_start = LockResource (hResLoad); - if (pdump_start == NULL) - return 0; - - pdump_free = pdump_resource_free; - pdump_length = SizeofResource (NULL, hRes); - if (pdump_length <= sizeof(dump_header)) - { - pdump_start = 0; - return 0; - } - - return 1; -} - -#else /* !WIN32_NATIVE */ - -static void *pdump_mallocadr; - -static void pdump_file_free(void) -{ - xfree (pdump_mallocadr); -} - -#ifdef HAVE_MMAP -static void pdump_file_unmap(void) -{ - munmap (pdump_start, pdump_length); -} -#endif - -static int pdump_file_get(const char *path) -{ - int fd = open (path, O_RDONLY | OPEN_BINARY); - if (fd<0) - return 0; - - pdump_length = lseek (fd, 0, SEEK_END); - if (pdump_length < sizeof (dump_header)) - { - close (fd); - return 0; - } - - lseek (fd, 0, SEEK_SET); - -#ifdef HAVE_MMAP - pdump_start = (char *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); - if (pdump_start != MAP_FAILED) - { - pdump_free = pdump_file_unmap; - close (fd); - return 1; - } -#endif - - pdump_mallocadr = xmalloc(pdump_length+255); - pdump_free = pdump_file_free; - pdump_start = (char *)((255 + (unsigned long)pdump_mallocadr) & ~255); - read (pdump_fd, pdump_start, pdump_length); - - close (pdump_fd); - return 1; -} -#endif /* !WIN32_NATIVE */ - - -static int pdump_file_try(char *exe_path) -{ - char *w; - - w = exe_path + strlen(exe_path); - do - { - sprintf (w, "-%s-%08x.dmp", EMACS_VERSION, dump_id); - if (pdump_file_get (exe_path)) - { - if (pdump_load_check ()) - return 1; - pdump_free(); - } - - sprintf (w, "-%08x.dmp", dump_id); - if (pdump_file_get (exe_path)) - { - if (pdump_load_check ()) - return 1; - pdump_free(); - } - - sprintf (w, ".dmp"); - if (pdump_file_get (exe_path)) - { - if (pdump_load_check ()) - return 1; - pdump_free(); - } - - do - w--; - while (w>exe_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 12e008d41344 -r 697ef44129c6 src/dumper.h --- a/src/dumper.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* 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 12e008d41344 -r 697ef44129c6 src/dynarr.c --- a/src/dynarr.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dynarr.c Mon Aug 13 11:20:41 2007 +0200 @@ -101,27 +101,15 @@ Use the following global variable: Dynarr_min_size - Minimum allowable size for a dynamic array when it is resized. + Minimum allowable size for a dynamic array when it is resized. The + default is 32 and does not normally need to be changed. */ #include <config.h> #include "lisp.h" -static int Dynarr_min_size = 8; - -static void -Dynarr_realloc (Dynarr *dy, int new_size) -{ - if (DUMPEDP (dy->base)) - { - void *new_base = malloc (new_size); - memcpy (new_base, dy->base, dy->max > new_size ? new_size : dy->max); - dy->base = new_base; - } - else - dy->base = xrealloc (dy->base, new_size); -} +int Dynarr_min_size = 1; void * Dynarr_newf (int elsize) @@ -150,14 +138,14 @@ /* Don't do anything if the array is already big enough. */ if (newsize > dy->max) { - Dynarr_realloc (dy, newsize*dy->elsize); + dy->base = xrealloc (dy->base, newsize*dy->elsize); dy->max = newsize; } } /* 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; @@ -198,10 +186,9 @@ { Dynarr *dy = (Dynarr *) d; - if (dy->base && !DUMPEDP (dy->base)) + if (dy->base) xfree (dy->base); - if(!DUMPEDP (dy)) - xfree (dy); + xfree (dy); } #ifdef MEMORY_USAGE_STATS diff -r 12e008d41344 -r 697ef44129c6 src/editfns.c --- a/src/editfns.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/editfns.c Mon Aug 13 11:20:41 2007 +0200 @@ -28,6 +28,9 @@ #include <config.h> #include "lisp.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include "buffer.h" #include "commands.h" @@ -42,7 +45,6 @@ #include "systime.h" #include "sysdep.h" #include "syspwd.h" -#include "sysfile.h" /* for getcwd */ /* Some static data, and a function to initialize it for each run */ @@ -63,6 +65,8 @@ Lisp_Object Vuser_full_name; EXFUN (Fuser_full_name, 1); +char *get_system_name (void); + Lisp_Object Qformat; Lisp_Object Qpoint, Qmark, Qregion_beginning, Qregion_end; @@ -93,7 +97,7 @@ if ((p = getenv ("NAME"))) /* I don't think it's the right thing to do the ampersand modification on NAME. Not that it matters anymore... -hniksic */ - Vuser_full_name = build_ext_string (p, Qnative); + Vuser_full_name = build_ext_string (p, FORMAT_OS); else Vuser_full_name = Fuser_full_name (Qnil); } @@ -128,7 +132,7 @@ */ (str)) { - Lisp_String *p; + struct Lisp_String *p; CHECK_STRING (str); p = XSTRING (str); @@ -437,8 +441,7 @@ DEFUN ("point-min", Fpoint_min, 0, 1, 0, /* Return the minimum permissible value of point in BUFFER. -This is 1, unless narrowing (a buffer restriction) -is in effect, in which case it may be greater. +This is 1, unless narrowing (a buffer restriction) is in effect. If BUFFER is nil, the current buffer is assumed. */ (buffer)) @@ -449,8 +452,7 @@ DEFUN ("point-min-marker", Fpoint_min_marker, 0, 1, 0, /* Return a marker to the minimum permissible value of point in BUFFER. -This is the beginning, unless narrowing (a buffer restriction) -is in effect, in which case it may be greater. +This is the beginning, unless narrowing (a buffer restriction) is in effect. If BUFFER is nil, the current buffer is assumed. */ (buffer)) @@ -462,7 +464,7 @@ DEFUN ("point-max", Fpoint_max, 0, 1, 0, /* Return the maximum permissible value of point in BUFFER. This is (1+ (buffer-size)), unless narrowing (a buffer restriction) -is in effect, in which case it may be less. +is in effect, in which case it is less. If BUFFER is nil, the current buffer is assumed. */ (buffer)) @@ -472,9 +474,9 @@ } DEFUN ("point-max-marker", Fpoint_max_marker, 0, 1, 0, /* -Return a marker to the maximum permissible value of point in BUFFER. +Return a marker to the maximum permissible value of point BUFFER. This is (1+ (buffer-size)), unless narrowing (a buffer restriction) -is in effect, in which case it may be less. +is in effect, in which case it is less. If BUFFER is nil, the current buffer is assumed. */ (buffer)) @@ -563,11 +565,11 @@ } DEFUN ("char-after", Fchar_after, 0, 2, 0, /* -Return the character at position POS in BUFFER. -POS is an integer or a marker. +Return character in BUFFER at position POS. +POS is an integer or a buffer pointer. If POS is out of range, the value is nil. +If BUFFER is nil, the current buffer is assumed. if POS is nil, the value of point is assumed. -If BUFFER is nil, the current buffer is assumed. */ (pos, buffer)) { @@ -581,17 +583,17 @@ } DEFUN ("char-before", Fchar_before, 0, 2, 0, /* -Return the character preceding position POS in BUFFER. -POS is an integer or a marker. +Return character in BUFFER before position POS. +POS is an integer or a buffer pointer. If POS is out of range, the value is nil. +If BUFFER is nil, the current buffer is assumed. if POS is nil, the value of point is assumed. -If BUFFER is nil, the current buffer is assumed. */ (pos, buffer)) { struct buffer *b = decode_buffer (buffer, 1); - Bufpos n = (NILP (pos) ? BUF_PT (b) : - get_buffer_pos_char (b, pos, GB_NO_ERROR_IF_BAD)); + Bufpos n = ((NILP (pos) ? BUF_PT (b) : + get_buffer_pos_char (b, pos, GB_NO_ERROR_IF_BAD))); n--; @@ -603,26 +605,26 @@ DEFUN ("temp-directory", Ftemp_directory, 0, 0, 0, /* Return the pathname to the directory to use for temporary files. -On MS Windows, this is obtained from the TEMP or TMP environment variables, +On NT/MSDOS, 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(WIN32_NATIVE) +#if defined(WINDOWSNT) || defined(MSDOS) tmpdir = getenv ("TEMP"); if (!tmpdir) tmpdir = getenv ("TMP"); if (!tmpdir) tmpdir = "/"; -#else /* WIN32_NATIVE */ +#else /* WINDOWSNT || MSDOS */ tmpdir = getenv ("TMPDIR"); if (!tmpdir) tmpdir = "/tmp"; #endif - return build_ext_string (tmpdir, Qfile_name); + return build_ext_string (tmpdir, FORMAT_FILENAME); } DEFUN ("user-login-name", Fuser_login_name, 0, 1, 0, /* @@ -636,17 +638,17 @@ (uid)) { char *returned_name; - uid_t local_uid; + int local_uid; if (!NILP (uid)) { CHECK_INT (uid); - local_uid = XINT (uid); - returned_name = user_login_name (&local_uid); + local_uid = XINT(uid); + returned_name = user_login_name(&local_uid); } else { - returned_name = user_login_name (NULL); + returned_name = user_login_name(NULL); } /* #### - I believe this should return nil instead of "unknown" when pw==0 pw=0 is indicated by a null return from user_login_name @@ -662,12 +664,14 @@ corresponds to a nil argument to Fuser_login_name. */ char* -user_login_name (uid_t *uid) +user_login_name (int *uid) { + struct passwd *pw = NULL; + /* uid == NULL to return name of this user */ if (uid != NULL) { - struct passwd *pw = getpwuid (*uid); + pw = getpwuid (*uid); return pw ? pw->pw_name : NULL; } else @@ -678,7 +682,7 @@ char *user_name = getenv ("LOGNAME"); if (!user_name) user_name = getenv ( -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT "USERNAME" /* it's USERNAME on NT */ #else "USER" @@ -688,8 +692,8 @@ return (user_name); else { - struct passwd *pw = getpwuid (geteuid ()); -#ifdef CYGWIN + pw = getpwuid (geteuid ()); +#ifdef __CYGWIN32__ /* Since the Cygwin environment may not have an /etc/passwd, return "unknown" instead of the null if the username cannot be determined. @@ -713,7 +717,14 @@ 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; } @@ -754,13 +765,11 @@ 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. */ - TO_EXTERNAL_FORMAT (LISP_STRING, user_name, - C_STRING_ALLOCA, user_name_ext, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (user_name, user_name_ext); slow_down_interrupts (); pw = (struct passwd *) getpwnam (user_name_ext); speed_up_interrupts (); @@ -769,16 +778,16 @@ /* #### - 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) ? Qnil : make_ext_string ((Extbyte *) p, (q ? q - p : strlen (p)), - Qnative)); + FORMAT_OS)); #ifdef AMPERSAND_FULL_NAME if (!NILP (tem)) @@ -803,7 +812,7 @@ return tem; } -static Extbyte *cached_home_directory; +static char *cached_home_directory; void uncache_home_directory (void) @@ -812,42 +821,29 @@ of a few bytes */ } -/* !!#### not Mule correct. */ - /* Returns the home directory, in external format */ -Extbyte * +char * 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 ((cached_home_directory = getenv("HOME")) == NULL) { -#if defined(WIN32_NATIVE) - char *homedrive, *homepath; +#if defined(WINDOWSNT) && !defined(__CYGWIN32__) + char *homedrive, *homepath; if ((homedrive = getenv("HOMEDRIVE")) != NULL && (homepath = getenv("HOMEPATH")) != NULL) { cached_home_directory = - (Extbyte *) xmalloc (strlen (homedrive) + - strlen (homepath) + 1); - sprintf((char *) cached_home_directory, "%s%s", - homedrive, - homepath); + (char *) xmalloc(strlen(homedrive) + strlen(homepath) + 1); + sprintf(cached_home_directory, "%s%s", homedrive, homepath); } else { -# 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. */ +# if 1 /* * Use the current directory. * This preserves the existing XEmacs behavior, but is different @@ -855,31 +851,31 @@ */ if (initial_directory[0] != '\0') { - cached_home_directory = (Extbyte*) initial_directory; + cached_home_directory = initial_directory; } else { /* This will probably give the wrong value */ - cached_home_directory = (Extbyte*) getcwd (NULL, 0); + cached_home_directory = getcwd (NULL, 0); } # else /* * This is NT Emacs behavior */ - cached_home_directory = (Extbyte *) "C:\\"; + cached_home_directory = "C:\\"; output_home_warning = 1; # endif } -#else /* !WIN32_NATIVE */ +#else /* !WINDOWSNT */ /* * Unix, typically. * Using "/" isn't quite right, but what should we do? * We probably should try to extract pw_dir from /etc/passwd, * before falling back to this. */ - cached_home_directory = (Extbyte *) "/"; + cached_home_directory = "/"; output_home_warning = 1; -#endif /* !WIN32_NATIVE */ +#endif /* !WINDOWSNT */ } if (initialized && output_home_warning) { @@ -900,11 +896,11 @@ */ ()) { - Extbyte *path = get_home_directory (); + char *path = get_home_directory (); return path == NULL ? Qnil : Fexpand_file_name (Fsubstitute_in_file_name - (build_ext_string ((char *) path, Qfile_name)), + (build_ext_string (path, FORMAT_FILENAME)), Qnil); } @@ -916,6 +912,14 @@ return Fcopy_sequence (Vsystem_name); } +/* For the benefit of callers who don't want to include lisp.h. + Caller must free! */ +char * +get_system_name (void) +{ + return xstrdup ((char *) XSTRING_DATA (Vsystem_name)); +} + DEFUN ("emacs-pid", Femacs_pid, 0, 0, 0, /* Return the process ID of Emacs, as an integer. */ @@ -1004,9 +1008,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, /* @@ -1036,8 +1040,6 @@ %p is replaced by AM or PM, as appropriate. %r is a synonym for "%I:%M:%S %p". %R is a synonym for "%H:%M". -%s is replaced by the time in seconds since 00:00:00, Jan 1, 1970 (a - nonstandard extension) %S is replaced by the second (00-60). %t is a synonym for "\\t". %T is a synonym for "%H:%M:%S". @@ -1073,10 +1075,10 @@ 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); + return build_ext_string (buf, FORMAT_BINARY); /* If buffer was too small, make it bigger. */ size *= 2; } @@ -1230,14 +1232,14 @@ strncpy (buf, tem, 24); buf[24] = 0; - return build_ext_string (buf, Qbinary); + return build_ext_string (buf, FORMAT_BINARY); } #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); @@ -1824,7 +1826,7 @@ mc_count = begin_multiple_change (buf, pos, stop); if (STRINGP (table)) { - Lisp_String *stable = XSTRING (table); + struct Lisp_String *stable = XSTRING (table); Charcount size = string_char_length (stable); #ifdef MULE /* Under Mule, string_char(n) is O(n), so for large tables or @@ -1904,7 +1906,7 @@ && (XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_GENERIC || XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_CHAR)) { - Lisp_Char_Table *ctable = XCHAR_TABLE (table); + struct Lisp_Char_Table *ctable = XCHAR_TABLE (table); for (; pos < stop && (oc = BUF_FETCH_CHAR (buf, pos), 1); pos++) { @@ -2238,16 +2240,17 @@ ? Qt : Qnil; } -DEFUN ("char=", Fchar_Equal, 2, 2, 0, /* +DEFUN ("char=", Fchar_Equal, 2, 3, 0, /* Return t if two characters match, case is significant. Both arguments must be characters (i.e. NOT integers). +The optional buffer argument is for symmetry and is ignored. */ - (c1, c2)) + (c1, c2, buffer)) { CHECK_CHAR_COERCE_INT (c1); CHECK_CHAR_COERCE_INT (c2); - return EQ (c1, c2) ? Qt : Qnil; + return XCHAR(c1) == XCHAR(c2) ? Qt : Qnil; } #if 0 /* Undebugged FSFmacs code */ diff -r 12e008d41344 -r 697ef44129c6 src/eldap.c --- a/src/eldap.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/eldap.c Mon Aug 13 11:20:41 2007 +0200 @@ -26,8 +26,8 @@ conforming to the API defined in RFC 1823. It has been tested with: - UMich LDAP 3.3 (http://www.umich.edu/~dirsvcs/ldap/) - - OpenLDAP 1.2 (http://www.openldap.org/) - - Netscape's LDAP SDK (http://developer.netscape.com/) */ + - OpenLDAP 1.0.3 (http://www.openldap.org/) + - Netscape's LDAP SDK 1.0 (http://developer.netscape.com/) */ #include <config.h> @@ -40,6 +40,14 @@ #include "eldap.h" +#ifdef HAVE_NS_LDAP +# define HAVE_LDAP_SET_OPTION 1 +# define HAVE_LDAP_GET_ERRNO 1 +#else +# undef HAVE_LDAP_SET_OPTION +# undef HAVE_LDAP_GET_ERRNO +#endif + static int ldap_default_port; static Lisp_Object Vldap_default_base; @@ -47,43 +55,30 @@ Lisp_Object Qldapp; /* ldap-open plist keywords */ -static Lisp_Object Qport, Qauth, Qbinddn, Qpasswd, Qderef, Qtimelimit, Qsizelimit; +extern Lisp_Object Qport, Qauth, Qbinddn, Qpasswd, Qderef, Qtimelimit, + Qsizelimit; /* Search scope limits */ -static Lisp_Object Qbase, Qonelevel, Qsubtree; +extern Lisp_Object Qbase, Qonelevel, Qsubtree; /* Authentication methods */ -static Lisp_Object Qkrbv41, Qkrbv42; +extern 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; - +extern Lisp_Object Qnever, Qalways, Qfind; /************************************************************************/ /* Utility Functions */ /************************************************************************/ static void -signal_ldap_error (LDAP *ld, LDAPMessage *res, int ldap_err) +signal_ldap_error (LDAP *ld) { - if (ldap_err <= 0) - { -#if defined HAVE_LDAP_PARSE_RESULT - int err; - ldap_err = ldap_parse_result (ld, res, - &err, - NULL, NULL, NULL, NULL, 0); - if (ldap_err == LDAP_SUCCESS) - ldap_err = err; -#elif defined HAVE_LDAP_GET_LDERRNO - ldap_err = ldap_get_lderrno (ld, NULL, NULL); -#elif defined HAVE_LDAP_RESULT2ERROR - ldap_err = ldap_result2error (ld, res, 0); +#ifdef HAVE_LDAP_GET_ERRNO + signal_simple_error + ("LDAP error", + build_string (ldap_err2string (ldap_get_lderrno (ld, NULL, NULL)))); #else - ldap_err = ld->ld_errno; + signal_simple_error ("LDAP error", + build_string (ldap_err2string (ld->ld_errno))); #endif - } - signal_simple_error ("LDAP error", - build_string (ldap_err2string (ldap_err))); } @@ -92,7 +87,7 @@ /************************************************************************/ static Lisp_Object -make_ldap (Lisp_LDAP *ldap) +make_ldap (struct Lisp_LDAP *ldap) { Lisp_Object lisp_ldap; XSETLDAP (lisp_ldap, ldap); @@ -100,7 +95,7 @@ } static Lisp_Object -mark_ldap (Lisp_Object obj) +mark_ldap (Lisp_Object obj, void (*markobj) (Lisp_Object)) { return XLDAP (obj)->host; } @@ -110,7 +105,7 @@ { char buf[32]; - Lisp_LDAP *ldap = XLDAP (obj); + struct Lisp_LDAP *ldap = XLDAP (obj); if (print_readably) error ("printing unreadable object #<ldap %s>", @@ -118,39 +113,40 @@ write_c_string ("#<ldap ", printcharfun); print_internal (ldap->host, printcharfun, 1); - if (!ldap->ld) + if (!ldap->livep) write_c_string ("(dead) ",printcharfun); sprintf (buf, " 0x%x>", (unsigned int)ldap); write_c_string (buf, printcharfun); } -static Lisp_LDAP * +static struct Lisp_LDAP * allocate_ldap (void) { - Lisp_LDAP *ldap = alloc_lcrecord_type (Lisp_LDAP, &lrecord_ldap); + struct Lisp_LDAP *ldap = + alloc_lcrecord_type (struct Lisp_LDAP, &lrecord_ldap); ldap->ld = NULL; ldap->host = Qnil; + ldap->livep = 0; return ldap; } static void finalize_ldap (void *header, int for_disksave) { - Lisp_LDAP *ldap = (Lisp_LDAP *) header; + struct Lisp_LDAP *ldap = (struct Lisp_LDAP *) header; if (for_disksave) signal_simple_error ("Can't dump an emacs containing LDAP objects", make_ldap (ldap)); - if (ldap->ld) + if (ldap->livep) ldap_unbind (ldap->ld); - ldap->ld = NULL; } DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap, mark_ldap, print_ldap, finalize_ldap, - NULL, NULL, 0, Lisp_LDAP); + NULL, NULL, struct Lisp_LDAP); @@ -182,7 +178,7 @@ (ldap)) { CHECK_LDAP (ldap); - return (XLDAP (ldap))->ld ? Qt : Qnil; + return (XLDAP (ldap))->livep ? Qt : Qnil; } /************************************************************************/ @@ -207,7 +203,7 @@ (host, plist)) { /* This function can GC */ - Lisp_LDAP *ldap; + struct Lisp_LDAP *ldap; LDAP *ld; int ldap_port = 0; int ldap_auth = LDAP_AUTH_SIMPLE; @@ -250,17 +246,13 @@ else if (EQ (keyword, Qbinddn)) { CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, - C_STRING_ALLOCA, ldap_binddn, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, ldap_binddn); } /* Password */ else if (EQ (keyword, Qpasswd)) { CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, - C_STRING_ALLOCA, ldap_passwd, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, ldap_passwd); } /* Deref */ else if (EQ (keyword, Qderef)) @@ -307,21 +299,16 @@ #ifdef HAVE_LDAP_SET_OPTION - if ((err = ldap_set_option (ld, LDAP_OPT_DEREF, - (void *)&ldap_deref)) != LDAP_SUCCESS) - signal_ldap_error (ld, NULL, err); - if ((err = ldap_set_option (ld, LDAP_OPT_TIMELIMIT, - (void *)&ldap_timelimit)) != LDAP_SUCCESS) - signal_ldap_error (ld, NULL, err); - if ((err = ldap_set_option (ld, LDAP_OPT_SIZELIMIT, - (void *)&ldap_sizelimit)) != LDAP_SUCCESS) - signal_ldap_error (ld, NULL, err); - 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); + if (ldap_set_option (ld, LDAP_OPT_DEREF, (void *)&ldap_deref) != LDAP_SUCCESS) + signal_ldap_error (ld); + if (ldap_set_option (ld, LDAP_OPT_TIMELIMIT, + (void *)&ldap_timelimit) != LDAP_SUCCESS) + signal_ldap_error (ld); + if (ldap_set_option (ld, LDAP_OPT_SIZELIMIT, + (void *)&ldap_sizelimit) != LDAP_SUCCESS) + signal_ldap_error (ld); + if (ldap_set_option (ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON) != LDAP_SUCCESS) + signal_ldap_error (ld); #else /* not HAVE_LDAP_SET_OPTION */ ld->ld_deref = ldap_deref; ld->ld_timelimit = ldap_timelimit; @@ -331,11 +318,12 @@ #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))); @@ -343,6 +331,7 @@ ldap = allocate_ldap (); ldap->ld = ld; ldap->host = host; + ldap->livep = 1; return make_ldap (ldap); } @@ -354,11 +343,11 @@ */ (ldap)) { - Lisp_LDAP *lldap; + struct Lisp_LDAP *lldap; CHECK_LIVE_LDAP (ldap); lldap = XLDAP (ldap); ldap_unbind (lldap->ld); - lldap->ld = NULL; + lldap->livep = 0; return Qnil; } @@ -373,6 +362,7 @@ struct berval **vals; }; + static Lisp_Object ldap_search_unwind (Lisp_Object unwind_obj) { @@ -385,12 +375,7 @@ return Qnil; } -/* 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, /* +DEFUN ("ldap-search-internal", Fldap_search_internal, 2, 7, 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. @@ -401,14 +386,13 @@ 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 prepended with +If WITHDN is non-nil each entry in the result will be prepennded 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, verbose)) + (ldap, filter, base, scope, attrs, attrsonly, withdn)) { /* This function can GC */ @@ -426,11 +410,10 @@ int speccount = specpdl_depth (); - Lisp_Object list = Qnil; - Lisp_Object entry = Qnil; - Lisp_Object result = Qnil; + Lisp_Object list, entry, result; struct gcpro gcpro1, gcpro2, gcpro3; + list = entry = result = Qnil; GCPRO3 (list, entry, result); unwind.res = NULL; @@ -477,9 +460,7 @@ { Lisp_Object current = XCAR (attrs); CHECK_STRING (current); - TO_EXTERNAL_FORMAT (LISP_STRING, current, - C_STRING_ALLOCA, ldap_attributes[i], - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (current, ldap_attributes[i]); ++i; } ldap_attributes[i] = NULL; @@ -490,14 +471,14 @@ /* Perform the search */ if (ldap_search (ld, - NILP (base) ? (char *) "" : (char *) XSTRING_DATA (base), + NILP (base) ? "" : (char *) XSTRING_DATA (base), ldap_scope, - NILP (filter) ? (char *) "" : (char *) XSTRING_DATA (filter), + NILP (filter) ? "" : (char *) XSTRING_DATA (filter), ldap_attributes, NILP (attrsonly) ? 0 : 1) - == -1) + == -1) { - signal_ldap_error (ld, NULL, 0); + signal_ldap_error (ld); } /* Ensure we don't exit without cleaning up */ @@ -507,8 +488,10 @@ /* 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; @@ -518,30 +501,31 @@ 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. */ - if (! NILP (verbose)) - message ("Parsing ldap results... %d", matches); + message ("Parsing ldap results... %d", matches); entry = Qnil; /* Get the DN if required */ if (! NILP (withdn)) { dn = ldap_get_dn (ld, e); if (dn == NULL) - signal_ldap_error (ld, e, 0); - entry = Fcons (build_ext_string (dn, Qnative), Qnil); + { + signal_ldap_error (ld); + } + entry = Fcons (build_ext_string (dn, FORMAT_OS), Qnil); } for (a= ldap_first_attribute (ld, e, &ptr); a != NULL; a = ldap_next_attribute (ld, e, ptr) ) { - list = Fcons (build_ext_string (a, Qnative), Qnil); + list = Fcons (build_ext_string (a, FORMAT_OS), Qnil); unwind.vals = ldap_get_values_len (ld, e, a); if (unwind.vals != NULL) { for (i = 0; unwind.vals[i] != NULL; i++) { - list = Fcons (make_ext_string ((Extbyte *) unwind.vals[i]->bv_val, + list = Fcons (make_ext_string (unwind.vals[i]->bv_val, unwind.vals[i]->bv_len, - Qnative), + FORMAT_OS), list); } } @@ -555,285 +539,43 @@ 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 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 (rc == -1) - signal_ldap_error (ld, unwind.res, (unwind.res==NULL) ? ld->ld_errno : 0); - -#if defined HAVE_LDAP_RESULT2ERROR + { + signal_ldap_error (ld); + } rc = ldap_result2error (ld, unwind.res, 0); -#endif -#endif - - if (rc != LDAP_SUCCESS) - signal_ldap_error (ld, NULL, rc); + if ((rc != LDAP_SUCCESS) && + (rc != LDAP_SIZELIMIT_EXCEEDED)) + { + signal_ldap_error (ld); + } ldap_msgfree (unwind.res); unwind.res = (LDAPMessage *)NULL; - /* #### See above for calling message(). */ - if (! NILP (verbose)) - message ("Parsing ldap results... done"); + 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]); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (current), - C_STRING_ALLOCA, 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)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (current), - C_STRING_ALLOCA, 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"); - defsymbol (&Qbinddn, "binddn"); - defsymbol (&Qpasswd, "passwd"); - defsymbol (&Qderef, "deref"); - defsymbol (&Qtimelimit, "timelimit"); - defsymbol (&Qsizelimit, "sizelimit"); - defsymbol (&Qbase, "base"); - defsymbol (&Qonelevel, "onelevel"); - defsymbol (&Qsubtree, "subtree"); - defsymbol (&Qkrbv41, "krbv41"); - defsymbol (&Qkrbv42, "krbv42"); - 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_basic); - DEFSUBR (Fldap_add); - DEFSUBR (Fldap_modify); - DEFSUBR (Fldap_delete); + DEFSUBR (Fldap_search_internal); } void diff -r 12e008d41344 -r 697ef44129c6 src/eldap.h --- a/src/eldap.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/eldap.h Mon Aug 13 11:20:41 2007 +0200 @@ -18,8 +18,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef INCLUDED_eldap_h_ -#define INCLUDED_eldap_h_ +#ifndef _XEMACS_ELDAP_H_ +#define _XEMACS_ELDAP_H_ #include <lber.h> #include <ldap.h> @@ -37,20 +37,22 @@ LDAP *ld; /* Name of the host we connected to */ Lisp_Object host; + /* Status of the LDAP connection. */ + int livep; }; -typedef struct Lisp_LDAP Lisp_LDAP; -DECLARE_LRECORD (ldap, Lisp_LDAP); -#define XLDAP(x) XRECORD (x, ldap, Lisp_LDAP) +DECLARE_LRECORD (ldap, struct Lisp_LDAP); +#define XLDAP(x) XRECORD (x, ldap, struct Lisp_LDAP) #define XSETLDAP(x, p) XSETRECORD (x, p, ldap) #define LDAPP(x) RECORDP (x, ldap) +#define GC_LDAPP(x) GC_RECORDP (x, ldap) #define CHECK_LDAP(x) CHECK_RECORD (x, ldap) #define CONCHECK_LDAP(x) CONCHECK_RECORD (x, ldap) #define CHECK_LIVE_LDAP(ldap) do { \ CHECK_LDAP (ldap); \ - if (!XLDAP (ldap)->ld) \ + if (!XLDAP (ldap)->livep) \ signal_simple_error ("Attempting to access closed LDAP connection", \ ldap); \ } while (0) @@ -62,21 +64,12 @@ Lisp_Object Fldap_open (Lisp_Object host, Lisp_Object ldap_plist); Lisp_Object Fldap_close (Lisp_Object ldap); -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); +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); -#endif /* INCLUDED_eldap_h_ */ +#endif /* _XEMACS_ELDAP_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/elhash.c --- a/src/elhash.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/elhash.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,16 +27,11 @@ #include "bytecode.h" #include "elhash.h" -Lisp_Object Qhash_tablep; -static Lisp_Object Qhashtable, Qhash_table; -static Lisp_Object Qweakness, Qvalue, Qkey_value; +Lisp_Object Qhash_tablep, Qhashtable, Qhash_table; +Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qnon_weak; 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, Qkey_value_weak; -static Lisp_Object Qnon_weak, Q_type; +static Lisp_Object Q_size, Q_test, Q_type, Q_rehash_size, Q_rehash_threshold; typedef struct hentry { @@ -56,27 +51,26 @@ hash_table_hash_function_t hash_function; hash_table_test_function_t test_function; hentry *hentries; - enum hash_table_weakness weakness; + enum hash_table_type type; /* whether and how this hash table is weak */ Lisp_Object next_weak; /* Used to chain together all of the weak hash tables. Don't mark through this. */ }; +typedef struct Lisp_Hash_Table Lisp_Hash_Table; #define HENTRY_CLEAR_P(hentry) ((*(EMACS_UINT*)(&((hentry)->key))) == 0) -#define CLEAR_HENTRY(hentry) \ - ((*(EMACS_UINT*)(&((hentry)->key))) = 0, \ - (*(EMACS_UINT*)(&((hentry)->value))) = 0) +#define CLEAR_HENTRY(hentry) ((*(EMACS_UINT*)(&((hentry)->key))) = 0) #define HASH_TABLE_DEFAULT_SIZE 16 #define HASH_TABLE_DEFAULT_REHASH_SIZE 1.3 #define HASH_TABLE_MIN_SIZE 10 -#define HASH_CODE(key, ht) \ -((((ht)->hash_function ? (ht)->hash_function (key) : LISP_HASH (key)) \ - * (ht)->golden_ratio) \ - % (ht)->size) +#define HASH_CODE(key, ht) \ + (((((ht)->hash_function ? (ht)->hash_function (key) : LISP_HASH (key)) \ + * (ht)->golden_ratio) \ + % (ht)->size)) #define KEYS_EQUAL_P(key1, key2, testfun) \ - (EQ (key1, key2) || ((testfun) && (testfun) (key1, key2))) + (EQ ((key1), (key2)) || ((testfun) && (testfun) ((key1), (key2)))) #define LINEAR_PROBING_LOOP(probe, entries, size) \ for (; \ @@ -123,7 +117,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, @@ -196,29 +190,29 @@ static Lisp_Object -mark_hash_table (Lisp_Object obj) +mark_hash_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lisp_Hash_Table *ht = XHASH_TABLE (obj); /* If the hash table is weak, we don't want to mark the keys and values (we scan over them after everything else has been marked, and mark or remove them as necessary). */ - if (ht->weakness == HASH_TABLE_NON_WEAK) + if (ht->type == HASH_TABLE_NON_WEAK) { hentry *e, *sentinel; for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) { - mark_object (e->key); - mark_object (e->value); + markobj (e->key); + markobj (e->value); } } return Qnil; } /* Equality of hash tables. Two hash tables are equal when they are of - the same weakness and test function, they have the same number of + the same type and test function, they have the same number of elements, and for each key in the hash table, the values are `equal'. This is similar to Common Lisp `equalp' of hash tables, with the @@ -235,7 +229,7 @@ hentry *e, *sentinel; if ((ht1->test_function != ht2->test_function) || - (ht1->weakness != ht2->weakness) || + (ht1->type != ht2->type) || (ht1->count != ht2->count)) return 0; @@ -253,16 +247,6 @@ 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. @@ -272,15 +256,12 @@ #s(hash-table size 2 data (key1 value1 key2 value2)) - The supported hash table structure keywords and their values are: - `test' (eql (or nil), eq or equal) - `size' (a natnum or nil) - `rehash-size' (a float) - `rehash-threshold' (a float) - `weakness' (nil, t, key or value) - `data' (a list) + The supported keywords are `type' (non-weak (or nil), weak, + key-weak and value-weak), `test' (eql (or nil), eq or equal), + `size' (a natnum or nil) and `data' (a list). - If `print-readably' is nil, then a simpler syntax is used, for example + If `print-readably' is non-nil, then a simpler syntax is used; for + instance: #<hash-table size 2/13 data (key1 value1 key2 value2) 0x874d> @@ -326,6 +307,16 @@ write_c_string (print_readably ? "#s(hash-table" : "#<hash-table", printcharfun); + if (ht->type != HASH_TABLE_NON_WEAK) + { + sprintf (buf, " type %s", + (ht->type == HASH_TABLE_WEAK ? "weak" : + ht->type == HASH_TABLE_KEY_WEAK ? "key-weak" : + ht->type == HASH_TABLE_VALUE_WEAK ? "value-weak" : + "you-d-better-not-see-this")); + write_c_string (buf, printcharfun); + } + /* These checks have a kludgy look to them, but they are safe. Due to nature of hashing, you cannot use arbitrary test functions anyway. */ @@ -349,17 +340,6 @@ write_c_string (buf, printcharfun); } - 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_KEY_VALUE_WEAK ? "key-value" : - "you-d-better-not-see-this")); - write_c_string (buf, printcharfun); - } - if (ht->count) print_hash_table_data (ht, printcharfun); @@ -384,29 +364,11 @@ } } -static const struct lrecord_description hentry_description_1[] = { - { XD_LISP_OBJECT, offsetof (hentry, key) }, - { XD_LISP_OBJECT, offsetof (hentry, value) }, - { XD_END } -}; - -static const struct struct_description hentry_description = { - sizeof (hentry), - hentry_description_1 -}; - -const struct lrecord_description hash_table_description[] = { - { XD_SIZE_T, offsetof (Lisp_Hash_Table, size) }, - { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT(0, 1), &hentry_description }, - { XD_LO_LINK, offsetof (Lisp_Hash_Table, next_weak) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("hash-table", hash_table, mark_hash_table, print_hash_table, finalize_hash_table, - hash_table_equal, hash_table_hash, - hash_table_description, + /* #### Implement hash_table_hash()! */ + hash_table_equal, 0, Lisp_Hash_Table); static Lisp_Hash_Table * @@ -424,25 +386,37 @@ /************************************************************************/ /* Creation of hash tables, without error-checking. */ +static double +hash_table_rehash_threshold (Lisp_Hash_Table *ht) +{ + return + ht->rehash_threshold > 0.0 ? ht->rehash_threshold : + ht->size > 4096 && !ht->test_function ? 0.7 : 0.6; +} + static void compute_hash_table_derived_values (Lisp_Hash_Table *ht) { ht->rehash_count = (size_t) - ((double) ht->size * ht->rehash_threshold); + ((double) ht->size * hash_table_rehash_threshold (ht)); ht->golden_ratio = (size_t) ((double) ht->size * (.6180339887 / (double) sizeof (Lisp_Object))); } Lisp_Object -make_general_lisp_hash_table (enum hash_table_test test, - size_t size, - double rehash_size, - double rehash_threshold, - enum hash_table_weakness weakness) +make_general_lisp_hash_table (size_t size, + enum hash_table_type type, + enum hash_table_test test, + double rehash_size, + double rehash_threshold) { Lisp_Object hash_table; Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table); + ht->type = type; + ht->rehash_size = rehash_size; + ht->rehash_threshold = rehash_threshold; + switch (test) { case HASH_TABLE_EQ: @@ -464,21 +438,15 @@ abort (); } - ht->weakness = weakness; - - ht->rehash_size = - rehash_size > 1.0 ? rehash_size : HASH_TABLE_DEFAULT_REHASH_SIZE; - - ht->rehash_threshold = - rehash_threshold > 0.0 ? rehash_threshold : - size > 4096 && !ht->test_function ? 0.7 : 0.6; - + if (ht->rehash_size <= 0.0) + ht->rehash_size = HASH_TABLE_DEFAULT_REHASH_SIZE; if (size < HASH_TABLE_MIN_SIZE) size = HASH_TABLE_MIN_SIZE; - ht->size = hash_table_size ((size_t) (((double) size / ht->rehash_threshold) - + 1.0)); + if (rehash_threshold < 0.0) + rehash_threshold = 0.75; + ht->size = + hash_table_size ((size_t) ((double) size / hash_table_rehash_threshold (ht)) + 1); ht->count = 0; - compute_hash_table_derived_values (ht); /* We leave room for one never-occupied sentinel hentry at the end. */ @@ -492,7 +460,7 @@ XSETHASH_TABLE (hash_table, ht); - if (weakness == HASH_TABLE_NON_WEAK) + if (type == HASH_TABLE_NON_WEAK) ht->next_weak = Qunbound; else ht->next_weak = Vall_weak_hash_tables, Vall_weak_hash_tables = hash_table; @@ -502,10 +470,11 @@ Lisp_Object make_lisp_hash_table (size_t size, - enum hash_table_weakness weakness, + enum hash_table_type type, enum hash_table_test test) { - return make_general_lisp_hash_table (test, size, -1.0, -1.0, weakness); + return make_general_lisp_hash_table (size, type, test, + HASH_TABLE_DEFAULT_REHASH_SIZE, -1.0); } /* Pretty reading of hash tables. @@ -538,44 +507,30 @@ } static int -hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value, - Error_behavior errb) +hash_table_type_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, Qkey_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, Qkey_value_weak)) return 1; if (EQ (value, Qvalue_weak)) return 1; - maybe_signal_simple_error ("Invalid hash table weakness", + maybe_signal_simple_error ("Invalid hash table type", value, Qhash_table, errb); return 0; } -static enum hash_table_weakness -decode_hash_table_weakness (Lisp_Object obj) +static enum hash_table_type +decode_hash_table_type (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, Qkey_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, Qkey_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); + signal_simple_error ("Invalid hash table type", obj); return HASH_TABLE_NON_WEAK; /* not reached */ } @@ -607,7 +562,7 @@ static int hash_table_rehash_size_validate (Lisp_Object keyword, Lisp_Object value, - Error_behavior errb) + Error_behavior errb) { if (!FLOATP (value)) { @@ -696,11 +651,11 @@ { Lisp_Object hash_table; Lisp_Object test = Qnil; + Lisp_Object type = Qnil; Lisp_Object size = Qnil; + Lisp_Object data = Qnil; Lisp_Object rehash_size = Qnil; Lisp_Object rehash_threshold = Qnil; - Lisp_Object weakness = Qnil; - Lisp_Object data = Qnil; while (!NILP (plist)) { @@ -709,23 +664,22 @@ value = XCAR (plist); plist = XCDR (plist); if (EQ (key, Qtest)) test = value; + else if (EQ (key, Qtype)) type = value; else if (EQ (key, Qsize)) size = value; + else if (EQ (key, Qdata)) data = value; else if (EQ (key, Qrehash_size)) rehash_size = value; else if (EQ (key, Qrehash_threshold)) rehash_threshold = value; - else if (EQ (key, Qweakness)) weakness = value; - else if (EQ (key, Qdata)) data = value; - else if (EQ (key, Qtype))/*obsolete*/ weakness = value; else abort (); } /* Create the hash table. */ hash_table = make_general_lisp_hash_table - (decode_hash_table_test (test), - decode_hash_table_size (size), + (decode_hash_table_size (size), + decode_hash_table_type (type), + decode_hash_table_test (test), decode_hash_table_rehash_size (rehash_size), - decode_hash_table_rehash_threshold (rehash_threshold), - decode_hash_table_weakness (weakness)); + decode_hash_table_rehash_threshold (rehash_threshold)); /* I'm not sure whether this can GC, but better safe than sorry. */ { @@ -752,20 +706,17 @@ struct structure_type *st; st = define_structure_type (structure_name, 0, hash_table_instantiate); + define_structure_type_keyword (st, Qsize, hash_table_size_validate); define_structure_type_keyword (st, Qtest, hash_table_test_validate); - define_structure_type_keyword (st, Qsize, hash_table_size_validate); + define_structure_type_keyword (st, Qtype, hash_table_type_validate); + define_structure_type_keyword (st, Qdata, hash_table_data_validate); define_structure_type_keyword (st, Qrehash_size, hash_table_rehash_size_validate); define_structure_type_keyword (st, Qrehash_threshold, hash_table_rehash_threshold_validate); - define_structure_type_keyword (st, Qweakness, hash_table_weakness_validate); - define_structure_type_keyword (st, Qdata, hash_table_data_validate); - - /* obsolete as of 19990901 in xemacs-21.2 */ - define_structure_type_keyword (st, Qtype, hash_table_weakness_validate); } /* Create a built-in Lisp structure type named `hash-table'. We make #s(hashtable ...) equivalent to #s(hash-table ...), - for backward compatibility. + for backward comptabibility. This is called from emacs.c. */ void structure_type_create_hash_table (void) @@ -790,24 +741,17 @@ DEFUN ("make-hash-table", Fmake_hash_table, 0, MANY, 0, /* Return a new empty hash table object. Use Common Lisp style keywords to specify hash table properties. - (make-hash-table &key test size rehash-size rehash-threshold weakness) + (make-hash-table &key :size :test :type :rehash-size :rehash-threshold) + +Keyword :size specifies the number of keys likely to be inserted. +This number of entries can be inserted without enlarging the hash table. Keyword :test can be `eq', `eql' (default) or `equal'. Comparison between keys is done using this function. If speed is important, consider using `eq'. When storing strings in the hash table, you will likely need to use `equal'. -Keyword :size specifies the number of keys likely to be inserted. -This number of entries can be inserted without enlarging the hash table. - -Keyword :rehash-size must be a float greater than 1.0, and specifies -the factor by which to increase the size of the hash table when enlarging. - -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', `value' -or `key-value'. +Keyword :type can be `non-weak' (default), `weak', `key-weak' or `value-weak'. 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 @@ -828,53 +772,57 @@ hash table if the value is pointed to by something other than a weak hash table, even if the key is not. -A key-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. +Keyword :rehash-size must be a float greater than 1.0, and specifies +the factor by which to increase the size of the hash table when enlarging. + +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. + */ (int nargs, Lisp_Object *args)) { - int i = 0; + int j = 0; + Lisp_Object size = Qnil; + Lisp_Object type = Qnil; Lisp_Object test = Qnil; - Lisp_Object size = Qnil; Lisp_Object rehash_size = Qnil; Lisp_Object rehash_threshold = Qnil; - Lisp_Object weakness = Qnil; - while (i + 1 < nargs) + while (j < nargs) { - Lisp_Object keyword = args[i++]; - Lisp_Object value = args[i++]; + Lisp_Object keyword, value; - if (EQ (keyword, Q_test)) test = value; - else if (EQ (keyword, Q_size)) size = value; + keyword = args[j++]; + if (!KEYWORDP (keyword)) + signal_simple_error ("Invalid hash table property keyword", keyword); + if (j == nargs) + signal_simple_error ("Hash table property requires a value", keyword); + + value = args[j++]; + + if (EQ (keyword, Q_size)) size = value; + else if (EQ (keyword, Q_type)) type = value; + else if (EQ (keyword, Q_test)) test = value; else if (EQ (keyword, Q_rehash_size)) rehash_size = value; else if (EQ (keyword, Q_rehash_threshold)) rehash_threshold = value; - else if (EQ (keyword, Q_weakness)) weakness = value; - else if (EQ (keyword, Q_type))/*obsolete*/ weakness = value; else signal_simple_error ("Invalid hash table property keyword", keyword); } - if (i < nargs) - signal_simple_error ("Hash table property requires a value", args[i]); - #define VALIDATE_VAR(var) \ if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME); + VALIDATE_VAR (size); + VALIDATE_VAR (type); VALIDATE_VAR (test); - VALIDATE_VAR (size); VALIDATE_VAR (rehash_size); VALIDATE_VAR (rehash_threshold); - VALIDATE_VAR (weakness); return make_general_lisp_hash_table - (decode_hash_table_test (test), - decode_hash_table_size (size), + (decode_hash_table_size (size), + decode_hash_table_type (type), + decode_hash_table_test (test), decode_hash_table_rehash_size (rehash_size), - decode_hash_table_rehash_threshold (rehash_threshold), - decode_hash_table_weakness (weakness)); + decode_hash_table_rehash_threshold (rehash_threshold)); } DEFUN ("copy-hash-table", Fcopy_hash_table, 1, 1, 0, /* @@ -883,7 +831,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); @@ -903,22 +851,29 @@ } static void -resize_hash_table (Lisp_Hash_Table *ht, size_t new_size) +enlarge_hash_table (Lisp_Hash_Table *ht) { - hentry *old_entries, *new_entries, *sentinel, *e; - size_t old_size; + hentry *old_entries, *new_entries, *old_sentinel, *new_sentinel, *e; + size_t old_size, new_size; old_size = ht->size; - ht->size = new_size; + new_size = ht->size = + hash_table_size ((size_t) ((double) old_size * ht->rehash_size)); old_entries = ht->hentries; - ht->hentries = xnew_array_and_zero (hentry, new_size + 1); + ht->hentries = xnew_array (hentry, new_size + 1); new_entries = ht->hentries; + old_sentinel = old_entries + old_size; + new_sentinel = new_entries + new_size; + + for (e = new_entries; e <= new_sentinel; e++) + CLEAR_HENTRY (e); + compute_hash_table_derived_values (ht); - for (e = old_entries, sentinel = e + old_size; e < sentinel; e++) + for (e = old_entries; e < old_sentinel; e++) if (!HENTRY_CLEAR_P (e)) { hentry *probe = new_entries + HASH_CODE (e->key, ht); @@ -927,44 +882,11 @@ *probe = *e; } - if (!DUMPEDP (old_entries)) - xfree (old_entries); -} - -/* After a hash table has been saved to disk and later restored by the - portable dumper, it contains the same objects, but their addresses - and thus their HASH_CODEs have changed. */ -void -pdump_reorganize_hash_table (Lisp_Object hash_table) -{ - const Lisp_Hash_Table *ht = xhash_table (hash_table); - hentry *new_entries = xnew_array_and_zero (hentry, ht->size + 1); - hentry *e, *sentinel; - - for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) - { - hentry *probe = new_entries + HASH_CODE (e->key, ht); - LINEAR_PROBING_LOOP (probe, new_entries, ht->size) - ; - *probe = *e; - } - - memcpy (ht->hentries, new_entries, ht->size * sizeof (hentry)); - - xfree (new_entries); -} - -static void -enlarge_hash_table (Lisp_Hash_Table *ht) -{ - size_t new_size = - hash_table_size ((size_t) ((double) ht->size * ht->rehash_size)); - resize_hash_table (ht, new_size); + xfree (old_entries); } 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; @@ -983,7 +905,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; @@ -1016,8 +938,7 @@ remhash_1 (Lisp_Hash_Table *ht, hentry *entries, hentry *probe) { size_t size = ht->size; - CLEAR_HENTRY (probe); - probe++; + CLEAR_HENTRY (probe++); ht->count--; LINEAR_PROBING_LOOP (probe, entries, size) @@ -1078,6 +999,30 @@ return make_int (xhash_table (hash_table)->count); } +DEFUN ("hash-table-size", Fhash_table_size, 1, 1, 0, /* +Return the size of HASH-TABLE. +This is the current number of slots in HASH-TABLE, whether occupied or not. +*/ + (hash_table)) +{ + return make_int (xhash_table (hash_table)->size); +} + +DEFUN ("hash-table-type", Fhash_table_type, 1, 1, 0, /* +Return the type of HASH-TABLE. +This can be one of `non-weak', `weak', `key-weak' or `value-weak'. +*/ + (hash_table)) +{ + switch (xhash_table (hash_table)->type) + { + 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; + } +} + DEFUN ("hash-table-test", Fhash_table_test, 1, 1, 0, /* Return the test function of HASH-TABLE. This can be one of `eq', `eql' or `equal'. @@ -1091,15 +1036,6 @@ Qeq); } -DEFUN ("hash-table-size", Fhash_table_size, 1, 1, 0, /* -Return the size of HASH-TABLE. -This is the current number of slots in HASH-TABLE, whether occupied or not. -*/ - (hash_table)) -{ - return make_int (xhash_table (hash_table)->size); -} - DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size, 1, 1, 0, /* Return the current rehash size of HASH-TABLE. This is a float greater than 1.0; the factor by which HASH-TABLE @@ -1117,40 +1053,7 @@ */ (hash_table)) { - return make_float (xhash_table (hash_table)->rehash_threshold); -} - -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'. -*/ - (hash_table)) -{ - switch (xhash_table (hash_table)->weakness) - { - case HASH_TABLE_WEAK: return Qt; - case HASH_TABLE_KEY_WEAK: return Qkey; - case HASH_TABLE_KEY_VALUE_WEAK: return Qkey_value; - case HASH_TABLE_VALUE_WEAK: return Qvalue; - default: return Qnil; - } -} - -/* obsolete as of 19990901 in xemacs-21.2 */ -DEFUN ("hash-table-type", Fhash_table_type, 1, 1, 0, /* -Return the type of HASH-TABLE. -This can be one of `non-weak', `weak', `key-weak' or `value-weak'. -*/ - (hash_table)) -{ - switch (xhash_table (hash_table)->weakness) - { - case HASH_TABLE_WEAK: return Qweak; - case HASH_TABLE_KEY_WEAK: return Qkey_weak; - case HASH_TABLE_KEY_VALUE_WEAK: return Qkey_value_weak; - case HASH_TABLE_VALUE_WEAK: return Qvalue_weak; - default: return Qnon_weak; - } + return make_float (hash_table_rehash_threshold (xhash_table (hash_table))); } /************************************************************************/ @@ -1165,8 +1068,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)) @@ -1191,8 +1094,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)) @@ -1233,69 +1136,53 @@ /************************************************************************/ /* 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 -finish_marking_weak_hash_tables (void) +finish_marking_weak_hash_tables (int (*obj_marked_p) (Lisp_Object), + void (*markobj) (Lisp_Object)) { Lisp_Object hash_table; int did_mark = 0; for (hash_table = Vall_weak_hash_tables; - !NILP (hash_table); + !GC_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)) + if (! obj_marked_p (hash_table)) /* The hash table is probably garbage. Ignore it. */ continue; /* 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. */ - switch (ht->weakness) +#define MARK_OBJ(obj) \ +do { if (!obj_marked_p (obj)) markobj (obj), did_mark = 1; } while (0) + + switch (ht->type) { case HASH_TABLE_KEY_WEAK: for (; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) - if (marked_p (e->key)) + if (obj_marked_p (e->key)) MARK_OBJ (e->value); break; case HASH_TABLE_VALUE_WEAK: for (; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) - if (marked_p (e->value)) + if (obj_marked_p (e->value)) MARK_OBJ (e->key); break; - case HASH_TABLE_KEY_VALUE_WEAK: - for (; e < sentinel; e++) - if (!HENTRY_CLEAR_P (e)) - { - if (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)) - if (!CONSP (e->key) || marked_p (XCAR (e->key))) + if (!CONSP (e->key) || obj_marked_p (XCAR (e->key))) { MARK_OBJ (e->key); MARK_OBJ (e->value); @@ -1305,7 +1192,7 @@ case HASH_TABLE_VALUE_CAR_WEAK: for (; e < sentinel; e++) if (!HENTRY_CLEAR_P (e)) - if (!CONSP (e->value) || marked_p (XCAR (e->value))) + if (!CONSP (e->value) || obj_marked_p (XCAR (e->value))) { MARK_OBJ (e->key); MARK_OBJ (e->value); @@ -1321,17 +1208,17 @@ } void -prune_weak_hash_tables (void) +prune_weak_hash_tables (int (*obj_marked_p) (Lisp_Object)) { Lisp_Object hash_table, prev = Qnil; for (hash_table = Vall_weak_hash_tables; - !NILP (hash_table); + !GC_NILP (hash_table); hash_table = XHASH_TABLE (hash_table)->next_weak) { - if (! marked_p (hash_table)) + if (! obj_marked_p (hash_table)) { /* This hash table itself is garbage. Remove it from the list. */ - if (NILP (prev)) + if (GC_NILP (prev)) Vall_weak_hash_tables = XHASH_TABLE (hash_table)->next_weak; else XHASH_TABLE (prev)->next_weak = XHASH_TABLE (hash_table)->next_weak; @@ -1340,7 +1227,7 @@ { /* Now, scan over all the pairs. Remove all of the pairs in which the key or value, or both, is unmarked - (depending on the weakness of the hash table). */ + (depending on the type of weak hash table). */ Lisp_Hash_Table *ht = XHASH_TABLE (hash_table); hentry *entries = ht->hentries; hentry *sentinel = entries + ht->size; @@ -1350,7 +1237,7 @@ if (!HENTRY_CLEAR_P (e)) { again: - if (!marked_p (e->key) || !marked_p (e->value)) + if (!obj_marked_p (e->key) || !obj_marked_p (e->value)) { remhash_1 (ht, entries, e); if (!HENTRY_CLEAR_P (e)) @@ -1369,13 +1256,12 @@ internal_array_hash (Lisp_Object *arr, int size, int depth) { int i; - hashcode_t hash = 0; - depth++; + unsigned long hash = 0; if (size <= 5) { for (i = 0; i < size; i++) - hash = HASH2 (hash, internal_hash (arr[i], depth)); + hash = HASH2 (hash, internal_hash (arr[i], depth + 1)); return hash; } @@ -1383,7 +1269,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)); + hash = HASH2 (hash, internal_hash (arr[i*size/5], depth + 1)); return hash; } @@ -1416,9 +1302,16 @@ { 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); @@ -1427,15 +1320,6 @@ return LISP_HASH (obj); } -DEFUN ("sxhash", Fsxhash, 1, 1, 0, /* -Return a hash value for OBJECT. -(equal obj1 obj2) implies (= (sxhash obj1) (sxhash obj2)). -*/ - (object)) -{ - return make_int (internal_hash (object, 0)); -} - #if 0 xxDEFUN ("internal-hash-value", Finternal_hash_value, 1, 1, 0, /* Hash value of OBJECT. For debugging. @@ -1444,7 +1328,7 @@ (object)) { /* This function is pretty 32bit-centric. */ - hashcode_t hash = internal_hash (object, 0); + unsigned long hash = internal_hash (object, 0); return Fcons (hash >> 16, hash & 0xffff); } #endif @@ -1457,8 +1341,6 @@ void syms_of_elhash (void) { - INIT_LRECORD_IMPLEMENTATION (hash_table); - DEFSUBR (Fhash_table_p); DEFSUBR (Fmake_hash_table); DEFSUBR (Fcopy_hash_table); @@ -1468,13 +1350,11 @@ DEFSUBR (Fclrhash); DEFSUBR (Fmaphash); DEFSUBR (Fhash_table_count); - DEFSUBR (Fhash_table_test); DEFSUBR (Fhash_table_size); DEFSUBR (Fhash_table_rehash_size); DEFSUBR (Fhash_table_rehash_threshold); - DEFSUBR (Fhash_table_weakness); - DEFSUBR (Fhash_table_type); /* obsolete */ - DEFSUBR (Fsxhash); + DEFSUBR (Fhash_table_type); + DEFSUBR (Fhash_table_test); #if 0 DEFSUBR (Finternal_hash_value); #endif @@ -1482,24 +1362,18 @@ defsymbol (&Qhash_tablep, "hash-table-p"); defsymbol (&Qhash_table, "hash-table"); defsymbol (&Qhashtable, "hashtable"); - defsymbol (&Qweakness, "weakness"); - defsymbol (&Qvalue, "value"); - defsymbol (&Qkey_value, "key-value"); + defsymbol (&Qweak, "weak"); + defsymbol (&Qkey_weak, "key-weak"); + defsymbol (&Qvalue_weak, "value-weak"); + defsymbol (&Qnon_weak, "non-weak"); defsymbol (&Qrehash_size, "rehash-size"); defsymbol (&Qrehash_threshold, "rehash-threshold"); - defsymbol (&Qweak, "weak"); /* obsolete */ - defsymbol (&Qkey_weak, "key-weak"); /* obsolete */ - defsymbol (&Qkey_value_weak, "key-value-weak"); /* obsolete */ - defsymbol (&Qvalue_weak, "value-weak"); /* obsolete */ - defsymbol (&Qnon_weak, "non-weak"); /* obsolete */ - + defkeyword (&Q_size, ":size"); defkeyword (&Q_test, ":test"); - defkeyword (&Q_size, ":size"); + defkeyword (&Q_type, ":type"); defkeyword (&Q_rehash_size, ":rehash-size"); defkeyword (&Q_rehash_threshold, ":rehash-threshold"); - defkeyword (&Q_weakness, ":weakness"); - defkeyword (&Q_type, ":type"); /* obsolete */ } void @@ -1507,5 +1381,4 @@ { /* This must NOT be staticpro'd */ Vall_weak_hash_tables = Qnil; - pdump_wire_list (&Vall_weak_hash_tables); } diff -r 12e008d41344 -r 697ef44129c6 src/elhash.h --- a/src/elhash.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/elhash.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,25 +20,23 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_elhash_h_ -#define INCLUDED_elhash_h_ +#ifndef _XEMACS_ELHASH_H_ +#define _XEMACS_ELHASH_H_ -typedef struct Lisp_Hash_Table Lisp_Hash_Table; +DECLARE_LRECORD (hash_table, struct Lisp_Hash_Table); -DECLARE_LRECORD (hash_table, Lisp_Hash_Table); - -#define XHASH_TABLE(x) XRECORD (x, hash_table, Lisp_Hash_Table) +#define XHASH_TABLE(x) XRECORD (x, hash_table, struct Lisp_Hash_Table) #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table) #define HASH_TABLEP(x) RECORDP (x, hash_table) +#define GC_HASH_TABLEP(x) GC_RECORDP (x, hash_table) #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table) #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table) -enum hash_table_weakness +enum hash_table_type { 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 @@ -51,8 +49,6 @@ HASH_TABLE_EQUAL }; -extern const struct lrecord_description hash_table_description[]; - EXFUN (Fcopy_hash_table, 1); EXFUN (Fhash_table_count, 1); EXFUN (Fgethash, 3); @@ -66,14 +62,15 @@ typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value, void* extra_arg); -Lisp_Object make_general_lisp_hash_table (enum hash_table_test test, - size_t size, - double rehash_size, + +Lisp_Object make_general_lisp_hash_table (size_t size, + enum hash_table_type type, + enum hash_table_test test, double rehash_threshold, - enum hash_table_weakness weakness); + double rehash_size); Lisp_Object make_lisp_hash_table (size_t size, - enum hash_table_weakness weakness, + enum hash_table_type type, enum hash_table_test test); void elisp_maphash (maphash_function_t function, @@ -82,9 +79,8 @@ void elisp_map_remhash (maphash_function_t predicate, Lisp_Object hash_table, void *extra_arg); -int finish_marking_weak_hash_tables (void); -void prune_weak_hash_tables (void); +int finish_marking_weak_hash_tables (int (*obj_marked_p) (Lisp_Object), + void (*markobj) (Lisp_Object)); +void prune_weak_hash_tables (int (*obj_marked_p) (Lisp_Object)); -void pdump_reorganize_hash_table (Lisp_Object); - -#endif /* INCLUDED_elhash_h_ */ +#endif /* _XEMACS_ELHASH_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/emacs.c --- a/src/emacs.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/emacs.c Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,6 @@ 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. @@ -23,141 +22,6 @@ /* 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 <config.h> 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 @@ -172,7 +36,6 @@ #include "console.h" #include "process.h" #include "redisplay.h" -#include "frame.h" #include "sysdep.h" #include "syssignal.h" /* Always include before systty.h */ @@ -180,15 +43,6 @@ #include "sysfile.h" #include "systime.h" -#ifdef PDUMP -#include "dump-id.h" -#include "dumper.h" -#endif - -#ifndef SEPCHAR -#define SEPCHAR ':' -#endif - #ifdef QUANTIFY #include <quantify.h> #endif @@ -203,21 +57,23 @@ #endif #ifdef TOOLTALK -#include TT_C_H_FILE +#include TT_C_H_PATH #endif -#if defined (WIN32_NATIVE) -#include "nt.h" +#ifdef APOLLO +#ifndef APOLLO_SR10 +#include <default_acl.h> +#endif +#endif + +#if defined (WINDOWSNT) +#include <windows.h> #endif /* For PATH_EXEC */ #include <paths.h> -#if defined (HEAP_IN_DATA) && !defined(PDUMP) -void report_sheap_usage (int die_if_pure_storage_exceeded); -#endif - -#if !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC) +#if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC extern void *(*__malloc_hook)(size_t); extern void *(*__realloc_hook)(void *, size_t); extern void (*__free_hook)(void *); @@ -255,7 +111,6 @@ /* Version numbers and strings */ Lisp_Object Vemacs_major_version; Lisp_Object Vemacs_minor_version; -Lisp_Object Vemacs_patch_level; Lisp_Object Vemacs_beta_version; Lisp_Object Vxemacs_codename; #ifdef INFODOCK @@ -291,11 +146,10 @@ Lisp_Object Vdoc_directory, Vconfigure_doc_directory; Lisp_Object Vconfigure_lock_directory; Lisp_Object Vdata_directory_list; -Lisp_Object Vconfigure_info_directory; +Lisp_Object Vinfo_directory, Vconfigure_info_directory; Lisp_Object Vsite_directory, Vconfigure_site_directory; Lisp_Object Vconfigure_info_path; Lisp_Object Vinternal_error_checking; -Lisp_Object Vmail_lock_methods, Vconfigure_mail_lock_method; Lisp_Object Vpath_separator; /* The default base directory XEmacs is installed under. */ @@ -306,10 +160,8 @@ priority. */ int emacs_priority; -/* 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 */ +/* 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. */ int running_asynch_code; /* If non-zero, a window-system was specified on the command line. */ @@ -318,7 +170,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. */ @@ -360,16 +212,12 @@ /* 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 int initial_argc; +char **initial_argv; +int initial_argc; static void sort_args (int argc, char **argv); @@ -379,126 +227,35 @@ extern Lisp_Object Vlisp_EXEC_SUFFIXES; - -/* 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; -} +/* 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); /* Handle bus errors, illegal instruction, etc. */ SIGTYPE fatal_error_signal (int sig) { - fatal_error_in_progress++; - preparing_for_armageddon = 1; - - ensure_no_quitting_from_now_on (); - + fatal_error_code = sig; + signal (sig, SIG_DFL); /* Unblock the signal so that if the same signal gets sent in the code below, we avoid a deadlock. */ - 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) + EMACS_UNBLOCK_SIGNAL (fatal_error_code); + + /* If fatal error occurs in code below, avoid infinite recursion. */ + if (! fatal_error_in_progress) { - 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 <= 2) - { - shut_down_emacs (sig, Qnil, 1); + fatal_error_in_progress = dont_check_for_quit = 1; + shut_down_emacs (sig, Qnil); 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]; @@ -511,96 +268,65 @@ # endif } /* Signal the same code; this time it will really be fatal. */ - kill (getpid (), sig); + kill (getpid (), fatal_error_code); SIGRETURN; } - -#ifdef _MSC_VER - -static DWORD -mswindows_handle_hardware_exceptions (DWORD code) + + +DOESNT_RETURN +fatal (CONST char *fmt, ...) { - 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; + 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); } -#endif /* _MSC_VER */ - - +/* #### 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; +} #ifdef SIGDANGER @@ -632,13 +358,13 @@ { if (i == 0 || i > skip_args) { -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT if (i == 0) { /* Do not trust to what crt0 has stuffed into argv[0] */ char full_exe_path [MAX_PATH]; GetModuleFileName (NULL, full_exe_path, MAX_PATH); - result = Fcons (build_ext_string (full_exe_path, Qfile_name), + result = Fcons (build_ext_string (full_exe_path, FORMAT_FILENAME), result); #if defined(HAVE_SHLIB) (void)dll_init(full_exe_path); @@ -646,8 +372,7 @@ } else #endif - result = Fcons (build_ext_string (argv [i], Qfile_name), - result); + result = Fcons (build_ext_string (argv [i], FORMAT_FILENAME), result); } } return result; @@ -671,12 +396,10 @@ for (i = 0, next = argv_list; i < n; i++, next = XCDR (next)) { - const char *temp; + CONST char *temp; CHECK_STRING (XCAR (next)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (next), - C_STRING_ALLOCA, temp, - Qnative); + GET_C_STRING_EXT_DATA_ALLOCA (XCAR (next), FORMAT_OS, temp); (*argv) [i] = xstrdup (temp); } (*argv) [n] = 0; @@ -730,6 +453,15 @@ # 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 @@ -810,8 +542,7 @@ extern int malloc_cookie; #endif -#if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \ - && !defined (DOUG_LEA_MALLOC)) +#if !defined(SYSTEM_MALLOC) && !defined(HAVE_LIBMCHECK) /* Make sure that any libraries we link against haven't installed a hook for a gmalloc of a potentially incompatible version. */ /* If we're using libmcheck, the hooks have already been initialized, */ @@ -819,7 +550,7 @@ __malloc_hook = NULL; __realloc_hook = NULL; __free_hook = NULL; -#endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */ +#endif /* not SYSTEM_MALLOC */ noninteractive = 0; @@ -833,7 +564,7 @@ * But hey, it solves all NS related memory problems, so who's * complaining? */ if (initialized && malloc_jumpstart (malloc_cookie) != 0) - stderr_out ("malloc jumpstart failed!\n"); + fprintf (stderr, "malloc jumpstart failed!\n"); #endif /* NeXT */ /* @@ -851,7 +582,23 @@ sort_args (argc, argv); -#if defined (WIN32_NATIVE) || defined (_SCO_DS) + /* 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) environ = envp; #endif @@ -865,6 +612,15 @@ clearerr (stdin); +#ifdef APOLLO +#ifndef APOLLO_SR10 + /* If USE_DOMAIN_ACLS environment variable exists, + use ACLs rather than UNIX modes. */ + if (egetenv ("USE_DOMAIN_ACLS")) + default_acl (USE_DEFACL); +#endif +#endif /* APOLLO */ + #if defined (HAVE_MMAP) && defined (REL_ALLOC) /* ralloc can only be used if using the GNU memory allocator. */ init_ralloc (); @@ -884,6 +640,15 @@ 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); @@ -900,17 +665,6 @@ 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; @@ -932,12 +686,6 @@ } } - /* 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; @@ -1102,28 +850,6 @@ We try to do things in an order that minimizes the non-obvious dependencies between functions. */ - /* purify_flag 1 is correct even if CANNOT_DUMP. - * loadup.el will set to nil at end. */ - - purify_flag = 0; -#ifdef PDUMP - if (restart) - initialized = 1; - else if (nodumpfile) { - initialized = 0; - purify_flag = 1; - } else { - initialized = pdump_load (argv[0]); - if (initialized) - run_temacs_argc = -1; - else - purify_flag = 1; - } -#else - if (!initialized) - purify_flag = 1; -#endif - if (!initialized) { /* Initialize things so that new Lisp objects @@ -1135,7 +861,7 @@ /* Initialize Qnil, Qt, Qunbound, and the obarray. After this, symbols can be - interned. This depends on init_alloc_once_early(). */ + interned. This depends on init_alloc_once(). */ init_symbols_once_early (); /* Declare the basic symbols pertaining to errors, @@ -1150,7 +876,6 @@ The *only* thing that the syms_of_*() functions are allowed to do is call one of the following three functions: - INIT_LRECORD_IMPLEMENTATION() defsymbol() defsubr() (i.e. DEFSUBR) deferror() @@ -1161,6 +886,9 @@ syms_of_abbrev (); syms_of_alloc (); +#ifdef HAVE_X_WINDOWS + syms_of_balloon_x (); +#endif syms_of_buffer (); syms_of_bytecode (); syms_of_callint (); @@ -1174,7 +902,6 @@ syms_of_data (); #ifdef DEBUG_XEMACS syms_of_debug (); - syms_of_tests (); #endif /* DEBUG_XEMACS */ syms_of_device (); #ifdef HAVE_DIALOGS @@ -1208,8 +935,9 @@ 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 (); - syms_of_gutter (); +#endif syms_of_indent (); syms_of_intl (); syms_of_keymap (); @@ -1242,7 +970,6 @@ syms_of_rangetab (); syms_of_redisplay (); syms_of_search (); - syms_of_select (); syms_of_signal (); syms_of_sound (); syms_of_specifier (); @@ -1265,7 +992,6 @@ #endif #ifdef HAVE_X_WINDOWS - syms_of_balloon_x (); syms_of_device_x (); #ifdef HAVE_DIALOGS syms_of_dialog_x (); @@ -1276,15 +1002,10 @@ #ifdef HAVE_MENUBARS syms_of_menubar_x (); #endif - syms_of_select_x (); + syms_of_xselect (); #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) syms_of_gui_x (); #endif -#ifdef HAVE_XIM -#ifdef XIM_XLIB - syms_of_input_method_xlib (); -#endif -#endif /* HAVE_XIM */ #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_MS_WINDOWS @@ -1294,7 +1015,6 @@ syms_of_objects_mswindows (); syms_of_select_mswindows (); syms_of_glyphs_mswindows (); - syms_of_gui_mswindows (); #ifdef HAVE_MENUBARS syms_of_menubar_mswindows (); #endif @@ -1304,7 +1024,7 @@ #ifdef HAVE_MSW_C_DIRED syms_of_dired_mswindows (); #endif -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT syms_of_ntproc (); #endif #endif /* HAVE_MS_WINDOWS */ @@ -1315,7 +1035,7 @@ syms_of_mule_charset (); #endif #ifdef FILE_CODING - syms_of_file_coding (); + syms_of_mule_coding (); #endif #ifdef MULE #ifdef HAVE_WNN @@ -1356,14 +1076,6 @@ syms_of_eldap (); #endif -#ifdef HAVE_GPM - syms_of_gpmevent (); -#endif - -#ifdef HAVE_POSTGRESQL - syms_of_postgresql (); -#endif - /* Now create the subtypes for the types that have them. We do this before the vars_*() because more symbols may get initialized here. */ @@ -1395,7 +1107,6 @@ console_type_create_device_x (); console_type_create_frame_x (); console_type_create_glyphs_x (); - console_type_create_select_x (); #ifdef HAVE_MENUBARS console_type_create_menubar_x (); #endif @@ -1419,7 +1130,6 @@ console_type_create_objects_mswindows (); console_type_create_redisplay_mswindows (); console_type_create_glyphs_mswindows (); - console_type_create_select_mswindows (); # ifdef HAVE_SCROLLBARS console_type_create_scrollbar_mswindows (); # endif @@ -1447,7 +1157,6 @@ specifier_type_create (); specifier_type_create_image (); - specifier_type_create_gutter (); specifier_type_create_objects (); #ifdef HAVE_TOOLBARS specifier_type_create_toolbar (); @@ -1483,9 +1192,6 @@ image_instantiator_format_create (); image_instantiator_format_create_glyphs_eimage (); image_instantiator_format_create_glyphs_widget (); -#ifdef HAVE_TTY - image_instantiator_format_create_glyphs_tty (); -#endif #ifdef HAVE_X_WINDOWS image_instantiator_format_create_glyphs_x (); #endif /* HAVE_X_WINDOWS */ @@ -1503,7 +1209,7 @@ lstream_type_create (); #ifdef FILE_CODING - lstream_type_create_file_coding (); + lstream_type_create_mule_coding (); #endif #if defined (HAVE_MS_WINDOWS) && !defined(HAVE_MSG_SELECT) lstream_type_create_mswindows_selectable (); @@ -1534,7 +1240,7 @@ staticpro() Fprovide(symbol) intern() - Fput() + pure_put() xmalloc() defsymbol(), if it's absolutely necessary and you're sure that the symbol isn't referenced anywhere else in the initialization @@ -1544,9 +1250,10 @@ using a global variable that has been initialized earlier on in the same function - Any of the object-creating functions in alloc.c: e.g. + Any of the object-creating functions on alloc.c: e.g. make_pure_*() + Fpurecopy() make_string() build_string() make_vector() @@ -1556,6 +1263,7 @@ Fcons() listN() make_opaque_ptr() + make_opaque_long() perhaps a few others. */ @@ -1563,23 +1271,21 @@ /* Now allow Fprovide() statements to be made. */ init_provide_once (); - /* Do that before any specifier creation (esp. vars_of_glyphs()) */ - vars_of_specifier (); - vars_of_abbrev (); vars_of_alloc (); +#ifdef HAVE_X_WINDOWS + vars_of_balloon_x (); +#endif vars_of_buffer (); vars_of_bytecode (); vars_of_callint (); vars_of_callproc (); - vars_of_chartab (); vars_of_cmdloop (); vars_of_cmds (); vars_of_console (); vars_of_data (); #ifdef DEBUG_XEMACS vars_of_debug (); - vars_of_tests (); #endif vars_of_console_stream (); vars_of_device (); @@ -1617,8 +1323,9 @@ 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 (); - vars_of_gutter (); +#endif vars_of_indent (); vars_of_insdel (); vars_of_intl (); @@ -1644,10 +1351,6 @@ #ifdef HAVE_SHLIB vars_of_module (); #endif -#ifdef WIN32_NATIVE - vars_of_nt (); - vars_of_ntproc (); -#endif vars_of_objects (); vars_of_print (); @@ -1670,8 +1373,8 @@ vars_of_scrollbar (); #endif vars_of_search (); - vars_of_select (); vars_of_sound (); + vars_of_specifier (); vars_of_symbols (); vars_of_syntax (); #ifdef HAVE_TOOLBARS @@ -1687,7 +1390,6 @@ #endif #ifdef HAVE_X_WINDOWS - vars_of_balloon_x (); vars_of_device_x (); #ifdef HAVE_DIALOGS vars_of_dialog_x (); @@ -1698,14 +1400,14 @@ vars_of_menubar_x (); #endif vars_of_objects_x (); - vars_of_select_x (); + vars_of_xselect (); #ifdef HAVE_SCROLLBARS vars_of_scrollbar_x (); #endif #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) vars_of_gui_x (); #endif -#endif /* HAVE_X_WINDOWS */ +#endif #ifdef HAVE_MS_WINDOWS vars_of_device_mswindows (); @@ -1730,11 +1432,10 @@ #ifdef MULE vars_of_mule (); - vars_of_mule_ccl (); vars_of_mule_charset (); #endif #ifdef FILE_CODING - vars_of_file_coding (); + vars_of_mule_coding (); #endif #ifdef MULE #ifdef HAVE_WNN @@ -1757,14 +1458,6 @@ vars_of_eldap (); #endif -#ifdef HAVE_POSTGRESQL - vars_of_postgresql(); -#endif - -#ifdef HAVE_GPM - vars_of_gpmevent (); -#endif - /* Now initialize any specifier variables. We do this later because it has some dependence on the vars initialized above. @@ -1780,7 +1473,6 @@ */ specifier_vars_of_glyphs (); - specifier_vars_of_gutter (); #ifdef HAVE_MENUBARS specifier_vars_of_menubar (); #endif @@ -1814,8 +1506,8 @@ earlier. The second may also depend on the first. */ complex_vars_of_mule_charset (); #endif -#ifdef FILE_CODING - complex_vars_of_file_coding (); +#if defined(FILE_CODING) + complex_vars_of_mule_coding (); #endif /* This calls allocate_glyph(), which creates specifiers @@ -1896,118 +1588,8 @@ garbage_collect_1 (); } #endif -#ifdef PDUMP - } else if (!restart) { - reinit_alloc_once_early (); - reinit_symbols_once_early (); - reinit_opaque_once_early (); - - reinit_console_type_create_stream (); -#ifdef HAVE_TTY - reinit_console_type_create_tty (); -#endif -#ifdef HAVE_X_WINDOWS - reinit_console_type_create_x (); - reinit_console_type_create_device_x (); -#endif -#ifdef HAVE_MS_WINDOWS - reinit_console_type_create_mswindows (); -#endif - - reinit_specifier_type_create (); - reinit_specifier_type_create_image (); - reinit_specifier_type_create_gutter (); - reinit_specifier_type_create_objects (); -#ifdef HAVE_TOOLBARS - reinit_specifier_type_create_toolbar (); -#endif - - structure_type_create (); - - structure_type_create_chartab (); - structure_type_create_faces (); - structure_type_create_rangetab (); - structure_type_create_hash_table (); - - lstream_type_create (); -#ifdef FILE_CODING - lstream_type_create_file_coding (); -#endif -#if defined (HAVE_MS_WINDOWS) && !defined(HAVE_MSG_SELECT) - lstream_type_create_mswindows_selectable (); -#endif -#ifdef HAVE_UNIX_PROCESSES - process_type_create_unix (); -#endif -#ifdef HAVE_WIN32_PROCESSES - process_type_create_nt (); -#endif - - reinit_vars_of_buffer (); - reinit_vars_of_console (); -#ifdef DEBUG_XEMACS - reinit_vars_of_debug (); -#endif - reinit_vars_of_device (); - reinit_vars_of_eval (); -#ifdef HAVE_X_WINDOWS - reinit_vars_of_event_Xt (); -#endif -#if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) - reinit_vars_of_event_tty (); -#endif -#ifdef HAVE_MS_WINDOWS - reinit_vars_of_event_mswindows (); -#endif - 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 (); - reinit_vars_of_insdel (); - reinit_vars_of_lread (); - reinit_vars_of_lstream (); - reinit_vars_of_minibuf (); -#ifdef HAVE_SHLIB - reinit_vars_of_module (); -#endif - reinit_vars_of_objects (); - reinit_vars_of_print (); - reinit_vars_of_search (); - reinit_vars_of_undo (); - reinit_vars_of_window (); - -#ifdef HAVE_MS_WINDOWS - reinit_vars_of_frame_mswindows (); -#endif - -#ifdef HAVE_X_WINDOWS - reinit_vars_of_device_x (); -#ifdef HAVE_SCROLLBARS - reinit_vars_of_scrollbar_x (); -#endif -#ifdef HAVE_MENUBARS - reinit_vars_of_menubar_x (); -#endif - reinit_vars_of_select_x (); -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) - reinit_vars_of_gui_x (); -#endif -#endif /* HAVE_X_WINDOWS */ - -#if defined(MULE) && defined(HAVE_WNN) - reinit_vars_of_mule_wnn (); -#endif - - reinit_complex_vars_of_buffer (); - reinit_complex_vars_of_console (); - reinit_complex_vars_of_minibuf (); -#endif /* PDUMP */ } - /* CONGRATULATIONS!!! We have successfully initialized the Lisp engine. */ @@ -2032,7 +1614,7 @@ init_initial_directory(); /* get the directory to use for the "*scratch*" buffer, etc. */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* * For Win32, call init_environment() now, so that environment/registry * variables will be properly entered into Vprocess_environment. @@ -2047,16 +1629,21 @@ 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_buffer (); /* Set default directory of *scratch* buffer */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT init_ntproc(); #endif init_redisplay (); /* Determine terminal type. init_sys_modes uses results */ - init_frame (); init_event_stream (); /* Set up so we can get user input. */ init_macros (); /* set up so we can run macros. */ init_editfns (); /* Determine the name of the user we're running as */ @@ -2070,7 +1657,7 @@ #ifdef HAVE_TTY init_device_tty (); #endif - init_console_stream (restart); /* Create the first console */ + init_console_stream (); /* Create the first console */ /* try to get the actual pathname of the exec file we are running */ if (!restart) @@ -2106,7 +1693,7 @@ Vinvocation_directory = Ffile_name_directory (Vinvocation_directory); } -#if defined(HAVE_SHLIB) && !defined(WIN32_NATIVE) +#if defined(HAVE_SHLIB) && !defined(WINDOWSNT) /* 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. */ @@ -2164,18 +1751,17 @@ struct standard_args { - const char *name; - const char *longname; + CONST char * CONST name; + CONST char * CONST longname; int priority; int nargs; }; -static const struct standard_args standard_args[] = +static struct standard_args standard_args[] = { /* Handled by main_1 above: */ - { "-sd", "--show-dump-id", 105, 0 }, - { "-t", "--terminal", 100, 1 }, - { "-nd", "--no-dump-file", 95, 0 }, + { "-nl", "--no-shared-memory", 100, 0 }, + { "-t", "--terminal", 95, 1 }, { "-nw", "--no-windows", 90, 0 }, { "-batch", "--batch", 85, 0 }, { "-debug-paths", "--debug-paths", 82, 0 }, @@ -2370,6 +1956,14 @@ 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 @@ -2397,11 +1991,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); @@ -2412,17 +2006,16 @@ /* Need to convert the orig_invoc_name and all of the arguments to external format. */ - TO_EXTERNAL_FORMAT (LISP_STRING, orig_invoc_name, - ALLOCA, (wampum, namesize), - Qnative); + GET_STRING_EXT_DATA_ALLOCA (orig_invoc_name, FORMAT_OS, wampum, + namesize); namesize++; for (ac = 0, total_len = namesize; ac < nargs; ac++) { CHECK_STRING (args[ac]); - TO_EXTERNAL_FORMAT (LISP_STRING, args[ac], - ALLOCA, (wampum_all[ac], wampum_all_len[ac]), - Qnative); + GET_STRING_EXT_DATA_ALLOCA (args[ac], FORMAT_OS, + wampum_all[ac], + wampum_all_len[ac]); wampum_all_len[ac]++; total_len += wampum_all_len[ac]; } @@ -2444,9 +2037,6 @@ unbind_to (0, Qnil); /* this closes loadup.el */ purify_flag = 0; run_temacs_argc = nargs + 1; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) - report_sheap_usage (0); -#endif LONGJMP (run_temacs_catch, 1); return Qnil; /* not reached; warning suppression */ } @@ -2455,16 +2045,6 @@ 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; @@ -2540,7 +2120,7 @@ 06/20/96 robertl@dgii.com */ { - extern char **_environ; + extern char *_environ; if ((unsigned) environ == 0) environ=_environ; } @@ -2560,7 +2140,7 @@ int rc = malloc_set_state (malloc_state_ptr); if (rc != 0) { - stderr_out ("malloc_set_state failed, rc = %d\n", rc); + fprintf (stderr, "malloc_set_state failed, rc = %d\n", rc); abort (); } #if 0 @@ -2582,14 +2162,6 @@ 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 */ } @@ -2604,13 +2176,9 @@ { /* Disable all calls to free() when XEmacs is exiting and it doesn't */ /* matter. */ - __free_hook = -#ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */ - (__typeof__ (__free_hook)) + __free_hook = voodoo_free_hook; +} #endif - voodoo_free_hook; -} -#endif /* GNU_MALLOC */ DEFUN ("kill-emacs", Fkill_emacs, 0, 1, "P", /* Exit the XEmacs job and kill it. Ask for confirmation, without argument. @@ -2634,7 +2202,9 @@ if (!preparing_for_armageddon && !noninteractive) run_hook (Qkill_emacs_hook); - ensure_no_quitting_from_now_on (); + /* make sure no quitting from now on!! */ + dont_check_for_quit = 1; + Vinhibit_quit = Qt; if (!preparing_for_armageddon) { @@ -2648,7 +2218,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 @@ -2662,25 +2232,13 @@ UNGCPRO; -#ifdef HAVE_MS_WINDOWS - /* If we displayed a message on the console and we're exiting due to - init error, then we must allow the user to see this message. */ - if (mswindows_message_outputted && INTP (arg) && XINT (arg) != 0) - Fmswindows_message_box (build_string ("Initialization error"), - Qnil, Qnil); -#endif - - shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0); + shut_down_emacs (0, ((STRINGP (arg)) ? arg : Qnil)); #if defined(GNU_MALLOC) - __free_hook = -#ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */ - (__typeof__ (__free_hook)) + __free_hook = voodoo_free_hook; #endif - voodoo_free_hook; -#endif - - exit (INTP (arg) ? XINT (arg) : 0); + + exit ((INTP (arg)) ? XINT (arg) : 0); /* NOTREACHED */ return Qnil; /* I'm sick of the compiler warning */ } @@ -2693,73 +2251,59 @@ If SIG is a signal number, print a message for it. - 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. */ + This is called by fatal signal handlers, X protocol error handlers, + and Fkill_emacs. */ static void -shut_down_emacs (int sig, Lisp_Object stuff, int no_auto_save) +shut_down_emacs (int sig, Lisp_Object stuff) { /* This function can GC */ /* Prevent running of hooks and other non-essential stuff from now on. */ preparing_for_armageddon = 1; - ensure_no_quitting_from_now_on (); + /* In case frames or windows are screwed up, avoid assertion + failures here */ + Vinhibit_quit = Qt; #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. */ - /* Steve writes the following: - - [[I'm not removing the code entirely, yet. We have run up against + /* 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]] - - 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 */ + be able to get more problems fixed so I'm disabling this. -slb */ + Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */ +#endif fflush (stdout); reset_all_consoles (); if (sig && sig != SIGTERM) { - if (sig == -1) - stderr_out ("\nFatal error.\n\n"); - else - stderr_out ("\nFatal error (%d).\n\n", sig); + stderr_out ("\nFatal error (%d).\n", sig); stderr_out ("Your files have been auto-saved.\n" "Use `M-x recover-session' to recover them.\n" "\n" - "If you have access to the PROBLEMS file that came with your\n" - "version of XEmacs, please check to see if your crash is described\n" - "there, as there may be a workaround available.\n" #ifdef INFODOCK - "Otherwise, please report this bug by selecting `Report-Bug'\n" - "in the InfoDock menu.\n" + "Please report this bug by selecting `Report-Bug' in the InfoDock\n" + "menu.\n" #else - "Otherwise, please report this bug by running the send-pr\n" - "script included with XEmacs, or selecting `Send Bug Report'\n" - "from the help menu.\n" + "Please report this bug by running the send-pr script included\n" + "with XEmacs, or selecting `Send Bug Report' from the help menu.\n" "As a last resort send ordinary email to `crashes@xemacs.org'.\n" #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" @@ -2768,22 +2312,19 @@ "directory in which you started the editor, or maybe in your home\n" "directory), and type\n" "\n" - " gdb " -#endif - ); -#ifndef _MSC_VER + " gdb "); { - const char *name; + CONST char *name; char *dir = 0; /* Now try to determine the actual path to the executable, to try to make the backtrace-determination process as foolproof as possible. */ - if (STRINGP (Vinvocation_name)) + if (GC_STRINGP (Vinvocation_name)) name = (char *) XSTRING_DATA (Vinvocation_name); else name = "xemacs"; - if (STRINGP (Vinvocation_directory)) + if (GC_STRINGP (Vinvocation_directory)) dir = (char *) XSTRING_DATA (Vinvocation_directory); if (!dir || dir[0] != '/') stderr_out ("`which %s`", name); @@ -2798,7 +2339,6 @@ "(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); @@ -2821,11 +2361,50 @@ #ifndef CANNOT_DUMP - -#if !defined(PDUMP) || !defined(SYSTEM_MALLOC) +/* Nothing like this can be implemented on an Apollo. + What a loss! */ + extern char my_edata[]; + +#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, /* @@ -2866,12 +2445,6 @@ opurify = purify_flag; purify_flag = 0; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) - report_sheap_usage (1); -#endif - - clear_message (); - fflush (stderr); fflush (stdout); @@ -2886,27 +2459,29 @@ 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); - + GET_C_STRING_FILENAME_DATA_ALLOCA (intoname, intoname_ext); if (STRINGP (symname)) - TO_EXTERNAL_FORMAT (LISP_STRING, symname, - C_STRING_ALLOCA, symname_ext, - Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (symname, symname_ext); else symname_ext = 0; garbage_collect_1 (); - -#ifdef PDUMP - pdump (); -#else - #ifdef DOUG_LEA_MALLOC malloc_state_ptr = malloc_get_state (); #endif @@ -2920,29 +2495,34 @@ #ifdef DOUG_LEA_MALLOC free (malloc_state_ptr); #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) @@ -2962,32 +2542,33 @@ } /* The same as the above, except PATH is an external C string (it is - converted using Qfile_name), and sepchar is hardcoded to SEPCHAR + converted as FORMAT_FILENAME), and sepchar is hardcoded to SEPCHAR (':' or whatever). */ Lisp_Object -decode_path (const char *path) +decode_path (CONST char *path) { - Bytecount newlen; + int len; Bufbyte *newpath; if (!path) return Qnil; - TO_INTERNAL_FORMAT (C_STRING, path, ALLOCA, (newpath, newlen), Qfile_name); - + GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA (path, newpath); + + len = strlen ((const char *) newpath); /* #### Does this make sense? It certainly does for decode_env_path(), but it looks dubious here. Does any code depend on decode_path("") returning nil instead of an empty string? */ - if (!newlen) + if (!len) return Qnil; - return split_string_by_emchar_1 (newpath, newlen, SEPCHAR); + return split_string_by_emchar_1 (newpath, (Bytecount)len, SEPCHAR); } 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) @@ -3049,75 +2630,17 @@ #ifdef USE_ASSERTIONS /* This highly dubious kludge ... shut up Jamie, I'm tired of your slagging. */ -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) +DOESNT_RETURN +assert_failed (CONST char *file, int line, CONST char *expr) { - /* 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) + 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) abort (); #endif - in_assert_failed = 0; } #endif /* USE_ASSERTIONS */ @@ -3156,7 +2679,11 @@ 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); @@ -3227,7 +2754,7 @@ DEFVAR_LISP ("system-configuration", &Vsystem_configuration /* String naming the configuration XEmacs was built for. */ ); - Vsystem_configuration = build_string (EMACS_CONFIGURATION); + Vsystem_configuration = Fpurecopy (build_string (EMACS_CONFIGURATION)); #ifndef EMACS_CONFIG_OPTIONS # define EMACS_CONFIG_OPTIONS "UNKNOWN" @@ -3235,7 +2762,8 @@ DEFVAR_LISP ("system-configuration-options", &Vsystem_configuration_options /* String containing the configuration options XEmacs was built with. */ ); - Vsystem_configuration_options = build_string (EMACS_CONFIG_OPTIONS); + Vsystem_configuration_options = Fpurecopy (build_string + (EMACS_CONFIG_OPTIONS)); DEFVAR_LISP ("emacs-major-version", &Vemacs_major_version /* Major version number of this version of Emacs, as an integer. @@ -3253,20 +2781,7 @@ */ ); Vemacs_minor_version = make_int (EMACS_MINOR_VERSION); - DEFVAR_LISP ("emacs-patch-level", &Vemacs_patch_level /* -The patch level of this version of Emacs, as an integer. -The value is non-nil if this version of XEmacs is part of a series of -stable XEmacsen, but has bug fixes applied. -Warning: this variable does not exist in FSF Emacs or in XEmacs versions -earlier than 21.1.1 -*/ ); -#ifdef EMACS_PATCH_LEVEL - Vemacs_patch_level = make_int (EMACS_PATCH_LEVEL); -#else - Vemacs_patch_level = Qnil; -#endif - - DEFVAR_LISP ("emacs-beta-version", &Vemacs_beta_version /* + DEFVAR_LISP ("emacs-beta-version", &Vemacs_beta_version /* Beta number of this version of Emacs, as an integer. The value is nil if this is an officially released version of XEmacs. Warning: this variable does not exist in FSF Emacs or in XEmacs versions @@ -3301,7 +2816,7 @@ #ifndef XEMACS_CODENAME #define XEMACS_CODENAME "Noname" #endif - Vxemacs_codename = build_string (XEMACS_CODENAME); + Vxemacs_codename = Fpurecopy (build_string (XEMACS_CODENAME)); DEFVAR_BOOL ("noninteractive", &noninteractive1 /* Non-nil means XEmacs is running without interactive terminal. @@ -3353,8 +2868,6 @@ 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 @@ -3377,50 +2890,7 @@ 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. -This is a list of symbols. Each of the symbols is one of the -following: dot, lockf, flock, locking, mmdf. -*/ ); - { - Vmail_lock_methods = Qnil; - Vmail_lock_methods = Fcons (intern ("dot"), Vmail_lock_methods); -#ifdef HAVE_LOCKF - Vmail_lock_methods = Fcons (intern ("lockf"), Vmail_lock_methods); -#endif -#ifdef HAVE_FLOCK - Vmail_lock_methods = Fcons (intern ("flock"), Vmail_lock_methods); -#endif -#ifdef HAVE_MMDF - Vmail_lock_methods = Fcons (intern ("mmdf"), Vmail_lock_methods); -#endif -#ifdef HAVE_LOCKING - 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. -*/ ); - { -#if defined(MAIL_LOCK_FLOCK) && defined(HAVE_FLOCK) - Vconfigure_mail_lock_method = intern("flock"); -#elif defined(MAIL_LOCK_LOCKF) && defined(HAVE_LOCKF) - Vconfigure_mail_lock_method = intern("lockf"); -#elif defined(MAIL_LOCK_MMDF) && defined(HAVE_MMDF) - Vconfigure_mail_lock_method = intern("mmdf"); -#elif defined(MAIL_LOCK_LOCKING) && defined(HAVE_LOCKING) - Vconfigure_mail_lock_method = intern("locking"); -#else - Vconfigure_mail_lock_method = intern("dot"); -#endif - } + Vinternal_error_checking = Fpurecopy (Vinternal_error_checking); DEFVAR_LISP ("path-separator", &Vpath_separator /* The directory separator in search paths, as a string. @@ -3519,8 +2989,7 @@ *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 -functions `locate-data-file' and `locate-data-directory' and the variable -`data-directory-list'. +function `locate-data-directory' and the variable `data-directory-list'. */ ); Vdata_directory = Qnil; @@ -3541,6 +3010,19 @@ */ ); 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. */ ); @@ -3635,7 +3117,7 @@ #endif } -#if defined(__sgi) && !defined(PDUMP) +#ifdef __sgi /* 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 diff -r 12e008d41344 -r 697ef44129c6 src/emodules.c --- a/src/emodules.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/emodules.c Mon Aug 13 11:20:41 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); @@ -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; @@ -213,9 +213,9 @@ * not previously loaded. */ if (modules == (emodules_list *)0) - modules = (emodules_list *) xmalloc (sizeof (emodules_list)); + modules = (emodules_list *)xmalloc (sizeof(emodules_list)); modnum++; - modules = (emodules_list *) xrealloc (modules, modnum * sizeof (emodules_list)); + modules = xrealloc (modules, modnum * sizeof(emodules_list)); fs = modnum - 1; memset (&modules[fs], 0, sizeof(emodules_list)); @@ -304,14 +304,14 @@ * 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); @@ -478,11 +478,11 @@ } 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_Subr *subr; + Lisp_Object sym = oblookup (Vobarray, (CONST Bufbyte *)symname, len); + struct 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; @@ -526,18 +526,8 @@ } void -reinit_vars_of_module (void) -{ - emodules_depth = 0; - modules = (emodules_list *)0; - modnum = 0; -} - -void vars_of_module (void) { - reinit_vars_of_module (); - DEFVAR_LISP ("module-version", &Vmodule_version /* Emacs dynamic loading mechanism version, as a string. @@ -547,7 +537,7 @@ 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. */ ); - Vmodule_version = build_string (EMODULES_VERSION); + Vmodule_version = Fpurecopy (build_string (EMODULES_VERSION)); DEFVAR_BOOL ("load-modules-quietly", &load_modules_quietly /* *Set to t if module loading is to be silent. @@ -585,6 +575,9 @@ staticpro (&Vmodule_extensions); load_modules_quietly = 0; + emodules_depth = 0; + modules = (emodules_list *)0; + modnum = 0; Vmodule_load_path = Qnil; Fprovide (intern ("modules")); } diff -r 12e008d41344 -r 697ef44129c6 src/emodules.h --- a/src/emodules.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/emodules.h Mon Aug 13 11:20:41 2007 +0200 @@ -64,7 +64,7 @@ * 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 @@ -75,11 +75,12 @@ * 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) #endif /* EMODULES_GATHER_VERSION */ #endif /* EMODULES_HDR */ + diff -r 12e008d41344 -r 697ef44129c6 src/esd.c --- a/src/esd.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* esd.c - play a sound over ESD - -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. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "lisp.h" -#include "miscplay.h" - -#include <esd.h> - -#include <unistd.h> -#include <fcntl.h> -#include <stdio.h> -#include <errno.h> -#include <string.h> - -/* the name given to ESD - I think this should identify ourselves */ -#define ESD_NAME "xemacs" - -int esd_play_sound_file(char *file, int vol); -int esd_play_sound_file(char *file, int vol) -{ /* #### FIXME: vol is ignored */ - return esd_play_file(ESD_NAME, file, 0); -} - -int esd_play_sound_data(unsigned char *data, size_t length, int vol); -int esd_play_sound_data(unsigned char *data, size_t length, int vol) -{ /* #### FIXME: vol is ignored */ - size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); - size_t (*sndcnv)(void **dayta,size_t *sz,void **); - fmtType ffmt; - int fmt,speed,tracks; - unsigned char *pptr,*optr,*cptr,*sptr; - ssize_t wrtn; - size_t crtn; - size_t prtn; - int flags, sock; - - /* analyze_format needs at least this many bytes to work with */ - if (length < HEADERSZ) - return 0; - - ffmt = analyze_format(data,&fmt,&speed,&tracks,&parsesndfile); - - if (ffmt != fmtRaw && ffmt != fmtSunAudio && ffmt != fmtWave) { - message(GETTEXT("audio: Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)")); - return 0; - } - - /* convert header information into ESD flags */ - flags = ESD_STREAM|ESD_PLAY; - sndcnv = sndcnvnop; - switch (fmt) - { - case AFMT_MU_LAW: - sndcnv = sndcnvULaw_2linear; - flags |= ESD_BITS8; - break; - case AFMT_S8: - sndcnv = sndcnv2unsigned; /* ESD needs unsigned bytes */ - case AFMT_U8: - flags |= ESD_BITS8; - break; - case AFMT_S16_BE: - sndcnv = sndcnv16swap; /* ESD wants little endian */ - case AFMT_S16_LE: - flags |= ESD_BITS16; - break; - default: - message(GETTEXT("audio: byte format %d unimplemented"), fmt); - return 0; - } - switch (tracks) - { - case 1: flags |= ESD_MONO; break; - case 2: flags |= ESD_STEREO; break; - default: - message(GETTEXT("audio: %d channels - only 1 or 2 supported"), tracks); - return 0; - } - - sock = esd_play_stream(flags, speed, NULL, "xemacs"); - if (sock < 0) - return 0; - - reset_parsestate(); - - for (pptr = data; (prtn = parsesndfile((void **)&pptr,&length, - (void **)&optr)) > 0; ) - for (cptr = optr; (crtn = sndcnv((void **)&cptr,&prtn, - (void **)&sptr)) > 0; ) { - if ((wrtn = write(sock,sptr,crtn)) < 0) { - message(GETTEXT("audio: write error (%s)"), strerror(errno)); - goto END_OF_PLAY; - } - if (wrtn != crtn) { - message(GETTEXT("audio: only wrote %d of %d bytes"), wrtn, crtn); - goto END_OF_PLAY; - } - } - - if (ffmt == fmtWave) - parse_wave_complete(); - -END_OF_PLAY: - /* Now cleanup all used resources */ - - close(sock); - return 1; -} diff -r 12e008d41344 -r 697ef44129c6 src/eval.c --- a/src/eval.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/eval.c Mon Aug 13 11:20:41 2007 +0200 @@ -73,11 +73,12 @@ a SUBR with more than 8 arguments, use max_args == MANY. See the DEFUN macro in lisp.h) */ #define PRIMITIVE_FUNCALL(rv, fn, av, ac) do { \ - void (*PF_fn)(void) = (void (*)(void)) fn; \ + void (*PF_fn)() = (void (*)()) (fn); \ Lisp_Object *PF_av = (av); \ switch (ac) \ { \ - default:rv = PRIMITIVE_FUNCALL_1(PF_fn, PF_av, 0); break; \ + default: abort(); \ + case 0: rv = PRIMITIVE_FUNCALL_1(PF_fn, PF_av, 0); break; \ case 1: rv = PRIMITIVE_FUNCALL_1(PF_fn, PF_av, 1); break; \ case 2: rv = PRIMITIVE_FUNCALL_1(PF_fn, PF_av, 2); break; \ case 3: rv = PRIMITIVE_FUNCALL_1(PF_fn, PF_av, 3); break; \ @@ -143,6 +144,10 @@ /* 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: @@ -165,7 +170,7 @@ int max_specpdl_size; /* Depth in Lisp evaluations and function calls. */ -static int lisp_eval_depth; +int lisp_eval_depth; /* Maximum allowed depth in Lisp evaluations and function calls. */ int max_lisp_eval_depth; @@ -263,16 +268,10 @@ static Lisp_Object Vcondition_handlers; -#define DEFEND_AGAINST_THROW_RECURSION - -#ifdef DEFEND_AGAINST_THROW_RECURSION +#if 0 /* no longer used */ /* Used for error catching purposes by throw_or_bomb_out */ static int throw_level; -#endif - -#ifdef ERROR_CHECK_TYPECHECK -void check_error_state_sanity (void); -#endif +#endif /* unused */ /************************************************************************/ @@ -283,10 +282,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) ? "#<special-form " : "#<subr "; - const char *name = subr_name (subr); - const char *trailer = subr->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); @@ -296,15 +295,9 @@ write_c_string (trailer, printcharfun); } -static const struct lrecord_description subr_description[] = { - { XD_DOC_STRING, offsetof (Lisp_Subr, doc) }, - { XD_END } -}; - -DEFINE_BASIC_LRECORD_IMPLEMENTATION ("subr", subr, - 0, print_subr, 0, 0, 0, - subr_description, - Lisp_Subr); +DEFINE_LRECORD_IMPLEMENTATION ("subr", subr, + this_one_is_unmarkable, print_subr, 0, 0, 0, + Lisp_Subr); /************************************************************************/ /* Entering the debugger */ @@ -1011,6 +1004,8 @@ static Lisp_Object define_function (Lisp_Object name, Lisp_Object defn) { + if (purify_flag) + defn = Fpurecopy (defn); Ffset (name, defn); LOADHIST_ATTACH (name); return name; @@ -1057,7 +1052,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 recognizes it. + This means that M-x set-variable and M-x edit-options recognize it. If INITVALUE is missing, SYMBOL's value is not set. In lisp-interaction-mode defvar is treated as defconst. @@ -1083,7 +1078,14 @@ if (!NILP (args = XCDR (args))) { Lisp_Object doc = XCAR (args); +#if 0 /* FSFmacs */ + /* #### We should probably do this but it might be dangerous */ + if (purify_flag) + doc = Fpurecopy (doc); Fput (sym, Qvariable_documentation, doc); +#else + pure_put (sym, Qvariable_documentation, doc); +#endif if (!NILP (args = XCDR (args))) error ("too many arguments"); } @@ -1091,7 +1093,7 @@ #ifdef I18N3 if (!NILP (Vfile_domain)) - Fput (sym, Qvariable_domain, Vfile_domain); + pure_put (sym, Qvariable_domain, Vfile_domain); #endif LOADHIST_ATTACH (sym); @@ -1107,7 +1109,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 recognizes it. + This means that M-x set-variable and M-x edit-options recognize 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 @@ -1131,14 +1133,21 @@ if (!NILP (args = XCDR (args))) { Lisp_Object doc = XCAR (args); +#if 0 /* FSFmacs */ + /* #### We should probably do this but it might be dangerous */ + if (purify_flag) + doc = Fpurecopy (doc); Fput (sym, Qvariable_documentation, doc); +#else + pure_put (sym, Qvariable_documentation, doc); +#endif if (!NILP (args = XCDR (args))) error ("too many arguments"); } #ifdef I18N3 if (!NILP (Vfile_domain)) - Fput (sym, Qvariable_domain, Vfile_domain); + pure_put (sym, Qvariable_domain, Vfile_domain); #endif LOADHIST_ATTACH (sym); @@ -1158,7 +1167,7 @@ return ((INTP (documentation) && XINT (documentation) < 0) || - (STRINGP (documentation) && + ((STRINGP (documentation)) && (string_byte (XSTRING (documentation), 0) == '*')) || /* If (STRING . INTEGER), a negative integer means a user variable. */ @@ -1306,9 +1315,6 @@ c.val = (*func) (arg); if (threw) *threw = 0; catchlist = c.next; -#ifdef ERROR_CHECK_TYPECHECK - check_error_state_sanity (); -#endif return c.val; } @@ -1365,25 +1371,19 @@ 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; -#ifdef DEFEND_AGAINST_THROW_RECURSION +#if 0 /* no longer used */ throw_level = 0; #endif LONGJMP (c->jmp, 1); @@ -1393,7 +1393,7 @@ throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p, Lisp_Object sig, Lisp_Object data) { -#ifdef DEFEND_AGAINST_THROW_RECURSION +#if 0 /* die if we recurse more than is reasonable */ if (++throw_level > 20) abort(); @@ -1493,7 +1493,7 @@ static Lisp_Object condition_bind_unwind (Lisp_Object loser) { - Lisp_Cons *victim; + struct Lisp_Cons *victim; /* ((handler-fun . handler-args) ... other handlers) */ Lisp_Object tem = XCAR (loser); @@ -1515,7 +1515,7 @@ static Lisp_Object condition_case_unwind (Lisp_Object loser) { - Lisp_Cons *victim; + struct Lisp_Cons *victim; /* ((<unbound> . clauses) ... other handlers */ victim = XCONS (XCAR (loser)); @@ -1646,9 +1646,6 @@ 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); @@ -1865,8 +1862,6 @@ { /* 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 (); } @@ -2052,25 +2047,16 @@ for (;;) Fsignal (sig, data); } -#ifdef ERROR_CHECK_TYPECHECK -void -check_error_state_sanity (void) + +static Lisp_Object +call_with_suspended_errors_1 (Lisp_Object opaque_arg) { - 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)); + 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; } -#endif static Lisp_Object restore_current_warning_class (Lisp_Object warning_class) @@ -2086,25 +2072,6 @@ 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: @@ -2127,8 +2094,8 @@ { va_list vargs; int speccount; - Lisp_Object kludgy_args[23]; - Lisp_Object *args = kludgy_args + 3; + Lisp_Object kludgy_args[22]; + Lisp_Object *args = kludgy_args + 2; int i; Lisp_Object no_error; @@ -2170,7 +2137,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. @@ -2181,6 +2148,12 @@ 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; @@ -2192,7 +2165,6 @@ 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); @@ -2253,13 +2225,13 @@ /* dump an error message; called like printf */ DOESNT_RETURN -error (const char *fmt, ...) +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); @@ -2268,7 +2240,7 @@ } void -maybe_error (Lisp_Object class, Error_behavior errb, const char *fmt, ...) +maybe_error (Lisp_Object class, Error_behavior errb, CONST char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2278,7 +2250,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); @@ -2287,13 +2259,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); @@ -2303,7 +2275,7 @@ Lisp_Object maybe_continuable_error (Lisp_Object class, Error_behavior errb, - const char *fmt, ...) + CONST char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2313,7 +2285,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); @@ -2330,13 +2302,13 @@ 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: */ @@ -2347,13 +2319,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: */ @@ -2374,13 +2346,13 @@ */ 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); @@ -2390,7 +2362,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; @@ -2400,7 +2372,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); @@ -2409,13 +2381,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); @@ -2425,7 +2397,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; @@ -2435,7 +2407,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); @@ -2452,7 +2424,7 @@ 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, @@ -2460,7 +2432,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) { @@ -2473,7 +2445,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, @@ -2481,7 +2453,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) { @@ -2509,48 +2481,47 @@ /* Used in core lisp functions for efficiency */ -Lisp_Object +void signal_void_function_error (Lisp_Object function) { - return Fsignal (Qvoid_function, list1 (function)); + Fsignal (Qvoid_function, list1 (function)); } -Lisp_Object +static void signal_invalid_function_error (Lisp_Object function) { - return Fsignal (Qinvalid_function, list1 (function)); + Fsignal (Qinvalid_function, list1 (function)); } -Lisp_Object +static void signal_wrong_number_of_arguments_error (Lisp_Object function, int nargs) { - return Fsignal (Qwrong_number_of_arguments, - list2 (function, make_int (nargs))); + Fsignal (Qwrong_number_of_arguments, list2 (function, make_int (nargs))); } /* Used in list traversal macros for efficiency. */ -DOESNT_RETURN +void signal_malformed_list_error (Lisp_Object list) { - signal_error (Qmalformed_list, list1 (list)); + Fsignal (Qmalformed_list, list1 (list)); } -DOESNT_RETURN +void signal_malformed_property_list_error (Lisp_Object list) { - signal_error (Qmalformed_property_list, list1 (list)); + Fsignal (Qmalformed_property_list, list1 (list)); } -DOESNT_RETURN +void signal_circular_list_error (Lisp_Object list) { - signal_error (Qcircular_list, list1 (list)); + Fsignal (Qcircular_list, list1 (list)); } -DOESNT_RETURN +void signal_circular_property_list_error (Lisp_Object list) { - signal_error (Qcircular_property_list, list1 (list)); + Fsignal (Qcircular_property_list, list1 (list)); } /************************************************************************/ @@ -2662,7 +2633,7 @@ { Fsignal (Qwrong_type_argument, Fcons (Qcommandp, - (EQ (cmd, final) + ((EQ (cmd, final)) ? list1 (cmd) : list2 (cmd, final)))); return Qnil; @@ -2780,10 +2751,11 @@ file = Fsymbol_name (Fintern (file, Qnil)); } - return Ffset (function, Fcons (Qautoload, list4 (file, - docstring, - interactive, - type))); + return Ffset (function, + Fpurecopy (Fcons (Qautoload, list4 (file, + docstring, + interactive, + type)))); } Lisp_Object @@ -2870,7 +2842,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 @@ -2983,7 +2955,7 @@ if (max_args == UNEVALLED) /* Optimize for the common case */ { backtrace.evalargs = 0; - val = (((Lisp_Object (*) (Lisp_Object)) subr_function (subr)) + val = (((Lisp_Object (*) (Lisp_Object)) (subr_function (subr))) (original_args)); } else if (nargs <= max_args) @@ -3037,7 +3009,7 @@ backtrace.args = args; backtrace.nargs = nargs; - val = (((Lisp_Object (*) (int, Lisp_Object *)) subr_function (subr)) + val = (((Lisp_Object (*) (int, Lisp_Object *)) (subr_function (subr))) (nargs, args)); UNGCPRO; @@ -3045,7 +3017,7 @@ else { wrong_number_of_arguments: - val = signal_wrong_number_of_arguments_error (original_fun, nargs); + signal_wrong_number_of_arguments_error (fun, nargs); } } else if (COMPILED_FUNCTIONP (fun)) @@ -3133,7 +3105,7 @@ else /* ! (SUBRP (fun) || COMPILED_FUNCTIONP (fun) || CONSP (fun)) */ { invalid_function: - val = signal_invalid_function_error (fun); + signal_invalid_function_error (fun); } lisp_eval_depth--; @@ -3208,15 +3180,14 @@ int max_args = subr->max_args; Lisp_Object spacious_args[SUBR_MAX_ARGS]; + if (fun_nargs < subr->min_args) + goto wrong_number_of_arguments; + if (fun_nargs == max_args) /* Optimize for the common case */ { funcall_subr: FUNCALL_SUBR (val, subr, fun_args, max_args); } - else if (fun_nargs < subr->min_args) - { - goto wrong_number_of_arguments; - } else if (fun_nargs < max_args) { Lisp_Object *p = spacious_args; @@ -3232,7 +3203,8 @@ } else if (max_args == MANY) { - val = SUBR_FUNCTION (subr, MANY) (fun_nargs, fun_args); + val = ((Lisp_Object (*) (int, Lisp_Object *)) (subr_function (subr))) + (fun_nargs, fun_args); } else if (max_args == UNEVALLED) /* Can't funcall a special form */ { @@ -3241,7 +3213,7 @@ else { wrong_number_of_arguments: - val = signal_wrong_number_of_arguments_error (fun, fun_nargs); + signal_wrong_number_of_arguments_error (fun, fun_nargs); } } else if (COMPILED_FUNCTIONP (fun)) @@ -3268,12 +3240,12 @@ } else if (UNBOUNDP (fun)) { - val = signal_void_function_error (args[0]); + signal_void_function_error (args[0]); } else { invalid_function: - val = signal_invalid_function_error (fun); + signal_invalid_function_error (fun); } lisp_eval_depth--; @@ -3315,11 +3287,9 @@ if (SUBRP (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); + return function_min_args_p ? + Fsubr_min_args (function): + Fsubr_max_args (function); } else if (COMPILED_FUNCTIONP (function)) { @@ -3351,7 +3321,7 @@ else { invalid_function: - return signal_invalid_function_error (function); + return Fsignal (Qinvalid_function, list1 (function)); } { @@ -3538,10 +3508,10 @@ return unbind_to (speccount, Fprogn (body)); wrong_number_of_arguments: - return signal_wrong_number_of_arguments_error (fun, nargs); + return Fsignal (Qwrong_number_of_arguments, list2 (fun, make_int (nargs))); invalid_function: - return signal_invalid_function_error (fun); + return Fsignal (Qinvalid_function, list1 (fun)); } @@ -3657,9 +3627,8 @@ } else { - struct gcpro gcpro1, gcpro2, gcpro3; - Lisp_Object globals = Qnil; - GCPRO3 (sym, val, globals); + struct gcpro gcpro1, gcpro2; + GCPRO2 (sym, val); for (; CONSP (val) && ((cond == RUN_HOOKS_TO_COMPLETION) @@ -3671,7 +3640,7 @@ { /* t indicates this hook has a local binding; it means to run the global binding too. */ - globals = Fdefault_value (sym); + Lisp_Object globals = Fdefault_value (sym); if ((! CONSP (globals) || EQ (XCAR (globals), Qlambda)) && ! NILP (globals)) @@ -4179,7 +4148,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; @@ -4222,7 +4191,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(); @@ -4238,14 +4207,14 @@ /* gc_currently_forbidden = 1; Currently no reason to do this; */ cons = noseeum_cons (buffer, form); - opaque = (warning_string ? make_opaque_ptr ((void *)warning_string) : Qnil); + opaque = (warning_string ? make_opaque_ptr (warning_string) : Qnil); GCPRO2 (cons, opaque); /* Qerror not Qt, so you can get a backtrace */ tem = condition_case_1 (Qerror, catch_them_squirmers_eval_in_buffer, cons, caught_a_squirmer, opaque); free_cons (XCONS (cons)); - if (OPAQUE_PTRP (opaque)) + if (OPAQUEP (opaque)) free_opaque_ptr (opaque); UNGCPRO; @@ -4262,7 +4231,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; @@ -4278,13 +4247,13 @@ speccount = specpdl_depth(); specbind (Qinhibit_quit, Qt); - opaque = (warning_string ? make_opaque_ptr ((void *)warning_string) : Qnil); + opaque = (warning_string ? make_opaque_ptr (warning_string) : Qnil); GCPRO1 (opaque); /* Qerror not Qt, so you can get a backtrace */ tem = condition_case_1 (Qerror, catch_them_squirmers_run_hook, hook_symbol, caught_a_squirmer, opaque); - if (OPAQUE_PTRP (opaque)) + if (OPAQUEP (opaque)) free_opaque_ptr (opaque); UNGCPRO; @@ -4295,7 +4264,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) { @@ -4314,7 +4283,7 @@ specbind (Qinhibit_quit, Qt); cons = noseeum_cons (hook_symbol, - warning_string ? make_opaque_ptr ((void *)warning_string) + warning_string ? make_opaque_ptr (warning_string) : Qnil); GCPRO1 (cons); /* Qerror not Qt, so you can get a backtrace */ @@ -4325,7 +4294,7 @@ allow_quit_safe_run_hook_caught_a_squirmer : safe_run_hook_caught_a_squirmer, cons); - if (OPAQUE_PTRP (XCDR (cons))) + if (OPAQUEP (XCDR (cons))) free_opaque_ptr (XCDR (cons)); free_cons (XCONS (cons)); UNGCPRO; @@ -4341,7 +4310,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; @@ -4360,12 +4329,12 @@ specbind (Qinhibit_quit, Qt); /* gc_currently_forbidden = 1; Currently no reason to do this; */ - opaque = (warning_string ? make_opaque_ptr ((void *)warning_string) : Qnil); + opaque = (warning_string ? make_opaque_ptr (warning_string) : Qnil); /* Qerror not Qt, so you can get a backtrace */ tem = condition_case_1 (Qerror, catch_them_squirmers_call0, function, caught_a_squirmer, opaque); - if (OPAQUE_PTRP (opaque)) + if (OPAQUEP (opaque)) free_opaque_ptr (opaque); UNGCPRO; @@ -4388,7 +4357,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(); @@ -4410,12 +4379,12 @@ /* gc_currently_forbidden = 1; Currently no reason to do this; */ cons = noseeum_cons (function, object); - opaque = (warning_string ? make_opaque_ptr ((void *)warning_string) : Qnil); + opaque = (warning_string ? make_opaque_ptr (warning_string) : Qnil); /* Qerror not Qt, so you can get a backtrace */ tem = condition_case_1 (Qerror, catch_them_squirmers_call1, cons, caught_a_squirmer, opaque); - if (OPAQUE_PTRP (opaque)) + if (OPAQUEP (opaque)) free_opaque_ptr (opaque); free_cons (XCONS (cons)); UNGCPRO; @@ -4425,7 +4394,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(); @@ -4446,12 +4415,12 @@ /* gc_currently_forbidden = 1; Currently no reason to do this; */ cons = list3 (function, object1, object2); - opaque = (warning_string ? make_opaque_ptr ((void *)warning_string) : Qnil); + opaque = (warning_string ? make_opaque_ptr (warning_string) : Qnil); /* Qerror not Qt, so you can get a backtrace */ tem = condition_case_1 (Qerror, catch_them_squirmers_call2, cons, caught_a_squirmer, opaque); - if (OPAQUE_PTRP (opaque)) + if (OPAQUEP (opaque)) free_opaque_ptr (opaque); free_list (cons); UNGCPRO; @@ -4504,7 +4473,7 @@ { Lisp_Object current = Fcurrent_buffer (); Lisp_Object symbol = specpdl_ptr->symbol; - Lisp_Cons *victim = XCONS (ovalue); + struct Lisp_Cons *victim = XCONS (ovalue); Lisp_Object buf = get_buffer (victim->car, 0); ovalue = victim->cdr; @@ -4639,13 +4608,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; @@ -4658,7 +4627,7 @@ { /* We checked symbol for validity when we specbound it, so only need to call Fset if symbol has magic value. */ - Lisp_Symbol *sym = XSYMBOL (specpdl_ptr->symbol); + struct Lisp_Symbol *sym = XSYMBOL (specpdl_ptr->symbol); if (!SYMBOL_VALUE_MAGIC_P (sym->value)) sym->value = specpdl_ptr->old_value; else @@ -4784,7 +4753,7 @@ DEFUN ("backtrace", Fbacktrace, 0, 2, "", /* Print a trace of Lisp function calls currently active. -Optional arg STREAM specifies the output stream to send the backtrace to, +Option arg STREAM specifies the output stream to send the backtrace to, and defaults to the value of `standard-output'. Optional second arg DETAILED means show places where currently active variable bindings, catches, condition-cases, and unwind-protects were made as well as @@ -4827,8 +4796,8 @@ if (!NILP (detailed) && catches && catches->backlist == backlist) { int catchpdl = catches->pdlcount; - if (speccount > catchpdl - && specpdl[catchpdl].func == condition_case_unwind) + if (specpdl[catchpdl].func == condition_case_unwind + && speccount > catchpdl) /* This is a condition-case catchpoint */ catchpdl = catchpdl + 1; @@ -4899,8 +4868,8 @@ Fprin1 (backlist->args[i], stream); } } - write_c_string (")\n", stream); } + write_c_string (")\n", stream); backlist = backlist->next; } } @@ -4978,13 +4947,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); @@ -5001,8 +4970,6 @@ void syms_of_eval (void) { - INIT_LRECORD_IMPLEMENTATION (subr); - defsymbol (&Qinhibit_quit, "inhibit-quit"); defsymbol (&Qautoload, "autoload"); defsymbol (&Qdebug_on_error, "debug-on-error"); @@ -5086,28 +5053,8 @@ } void -reinit_vars_of_eval (void) -{ - preparing_for_armageddon = 0; - in_warnings = 0; - Qunbound_suspended_errors_tag = make_opaque_ptr (&Qunbound_suspended_errors_tag); - staticpro_nodump (&Qunbound_suspended_errors_tag); - - specpdl_size = 50; - specpdl = xnew_array (struct specbinding, specpdl_size); - /* XEmacs change: increase these values. */ - max_specpdl_size = 3000; - max_lisp_eval_depth = 500; -#ifdef DEFEND_AGAINST_THROW_RECURSION - throw_level = 0; -#endif -} - -void vars_of_eval (void) { - reinit_vars_of_eval (); - DEFVAR_INT ("max-specpdl-size", &max_specpdl_size /* Limit on number of Lisp variable bindings & unwind-protects before error. */ ); @@ -5209,10 +5156,13 @@ */ ); Vdebugger = Qnil; + preparing_for_armageddon = 0; + staticpro (&Vpending_warnings); Vpending_warnings = Qnil; - pdump_wire (&Vpending_warnings_tail); - Vpending_warnings_tail = Qnil; + Vpending_warnings_tail = Qnil; /* no need to protect this */ + + in_warnings = 0; staticpro (&Vautoload_queue); Vautoload_queue = Qnil; @@ -5225,5 +5175,18 @@ staticpro (&Vcurrent_error_state); Vcurrent_error_state = Qnil; /* errors as normal */ + Qunbound_suspended_errors_tag = make_opaque_long (0); + staticpro (&Qunbound_suspended_errors_tag); + + specpdl_size = 50; + specpdl_depth_counter = 0; + 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 */ + throw_level = 0; +#endif + reinit_eval (); } diff -r 12e008d41344 -r 697ef44129c6 src/event-Xt.c --- a/src/event-Xt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 11:20:41 2007 +0200 @@ -65,9 +65,19 @@ #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 handle_focus_event_1 (struct frame *f, int in_p); +static void enqueue_Xt_dispatch_event (Lisp_Object event); static struct event_stream *Xt_event_stream; @@ -86,6 +96,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; #endif @@ -96,7 +108,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 @@ -108,7 +120,7 @@ static Lisp_Object x_keysym_to_emacs_keysym (KeySym keysym, int simple_p); void emacs_Xt_mapping_action (Widget w, XEvent *event); -void debug_process_finalization (Lisp_Process *p); +void debug_process_finalization (struct Lisp_Process *p); void emacs_Xt_event_handler (Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch); @@ -162,204 +174,6 @@ use a pop-up-window instead.) */ -/* For every key on the keyboard that has a known character correspondence, - we define the ascii-character property of the keysym, and make the - default binding for the key be self-insert-command. - - The following magic is basically intimate knowledge of X11/keysymdef.h. - The keysym mappings defined by X11 are based on the iso8859 standards, - except for Cyrillic and Greek. - - In a non-Mule world, a user can still have a multi-lingual editor, by doing - (set-face-font "...-iso8859-2" (current-buffer)) - for all their Latin-2 buffers, etc. */ - -static Lisp_Object -x_keysym_to_character (KeySym keysym) -{ -#ifdef MULE - Lisp_Object charset = Qzero; -#define USE_CHARSET(var,cs) \ - ((var) = CHARSET_BY_LEADING_BYTE (LEADING_BYTE_##cs)) -#else -#define USE_CHARSET(var,lb) -#endif /* MULE */ - int code = 0; - - if ((keysym & 0xff) < 0xa0) - return Qnil; - - switch (keysym >> 8) - { - case 0: /* ASCII + Latin1 */ - USE_CHARSET (charset, LATIN_ISO8859_1); - code = keysym & 0x7f; - break; - case 1: /* Latin2 */ - USE_CHARSET (charset, LATIN_ISO8859_2); - code = keysym & 0x7f; - break; - case 2: /* Latin3 */ - USE_CHARSET (charset, LATIN_ISO8859_3); - code = keysym & 0x7f; - break; - case 3: /* Latin4 */ - USE_CHARSET (charset, LATIN_ISO8859_4); - code = keysym & 0x7f; - break; - case 4: /* Katakana */ - USE_CHARSET (charset, KATAKANA_JISX0201); - if ((keysym & 0xff) > 0xa0) - code = keysym & 0x7f; - break; - case 5: /* Arabic */ - USE_CHARSET (charset, ARABIC_ISO8859_6); - code = keysym & 0x7f; - break; - case 6: /* Cyrillic */ - { - static unsigned char const cyrillic[] = /* 0x20 - 0x7f */ - {0x00, 0x72, 0x73, 0x71, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x00, 0x7e, 0x7f, - 0x70, 0x22, 0x23, 0x21, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x00, 0x2e, 0x2f, - 0x6e, 0x50, 0x51, 0x66, 0x54, 0x55, 0x64, 0x53, - 0x65, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, - 0x5f, 0x6f, 0x60, 0x61, 0x62, 0x63, 0x56, 0x52, - 0x6c, 0x6b, 0x57, 0x68, 0x6d, 0x69, 0x67, 0x6a, - 0x4e, 0x30, 0x31, 0x46, 0x34, 0x35, 0x44, 0x33, - 0x45, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, - 0x3f, 0x4f, 0x40, 0x41, 0x42, 0x43, 0x36, 0x32, - 0x4c, 0x4b, 0x37, 0x48, 0x4d, 0x49, 0x47, 0x4a}; - USE_CHARSET (charset, CYRILLIC_ISO8859_5); - code = cyrillic[(keysym & 0x7f) - 0x20]; - break; - } - case 7: /* Greek */ - { - static unsigned char const greek[] = /* 0x20 - 0x7f */ - {0x00, 0x36, 0x38, 0x39, 0x3a, 0x5a, 0x00, 0x3c, - 0x3e, 0x5b, 0x00, 0x3f, 0x00, 0x00, 0x35, 0x2f, - 0x00, 0x5c, 0x5d, 0x5e, 0x5f, 0x7a, 0x40, 0x7c, - 0x7d, 0x7b, 0x60, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x53, 0x00, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x73, 0x72, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - USE_CHARSET (charset, GREEK_ISO8859_7); - code = greek[(keysym & 0x7f) - 0x20]; - break; - } - case 8: /* Technical */ - break; - case 9: /* Special */ - break; - case 10: /* Publishing */ - break; - case 11: /* APL */ - break; - case 12: /* Hebrew */ - USE_CHARSET (charset, HEBREW_ISO8859_8); - code = keysym & 0x7f; - break; - case 13: /* Thai */ - /* #### This needs to deal with character composition. */ - USE_CHARSET (charset, THAI_TIS620); - code = keysym & 0x7f; - break; - case 14: /* Korean Hangul */ - break; - case 19: /* Latin 9 - ISO8859-15 - unsupported charset. */ - break; - case 32: /* Currency */ - break; - default: - break; - } - - if (code == 0) - return Qnil; - -#ifdef MULE - return make_char (MAKE_CHAR (charset, code, 0)); -#else - return make_char (code + 0x80); -#endif -} - -/* #### The way that keysym correspondence to characters should work: - - a Lisp_Event should contain a keysym AND a character slot. - - keybindings are tried with the keysym. If no binding can be found, - and there is a corresponding character, call self-insert-command. - - #### Nuke x-iso8859-1.el. - #### Nuke the Qascii_character property. - #### Nuke Vcharacter_set_property. -*/ -static void -maybe_define_x_key_as_self_inserting_character (KeySym keysym, Lisp_Object symbol) -{ - Lisp_Object character = x_keysym_to_character (keysym); - - if (CHARP (character)) - { - extern Lisp_Object Vcurrent_global_map; - extern Lisp_Object Qascii_character; - Fput (symbol, Qascii_character, character); - if (NILP (Flookup_key (Vcurrent_global_map, symbol, Qnil))) - Fdefine_key (Vcurrent_global_map, symbol, Qself_insert_command); - } -} - -static void -x_has_keysym (KeySym keysym, Lisp_Object hash_table, int with_modifiers) -{ - KeySym upper_lower[2]; - int j; - - if (keysym < 0x80) /* Optimize for ASCII keysyms */ - return; - - /* 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'. */ -#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++) - { - char *name; - keysym = upper_lower[j]; - - name = XKeysymToString (keysym); - if (name) - { - /* X guarantees NAME to be in the Host Portable Character Encoding */ - Lisp_Object sym = x_keysym_to_emacs_keysym (keysym, 0); - Lisp_Object new_value = with_modifiers ? Qt : Qsans_modifiers; - Lisp_Object old_value = Fgethash (sym, hash_table, Qnil); - - if (! EQ (old_value, new_value) - && ! (EQ (old_value, Qsans_modifiers) && - EQ (new_value, Qt))) - { - maybe_define_x_key_as_self_inserting_character (keysym, sym); - Fputhash (build_ext_string (name, Qbinary), new_value, hash_table); - Fputhash (sym, new_value, hash_table); - } - } - } -} - static void x_reset_key_mapping (struct device *d) { @@ -397,18 +211,34 @@ if (keysym[0] == NoSymbol) continue; - x_has_keysym (keysym[0], hash_table, 0); + { + char *name = XKeysymToString (keysym[0]); + Lisp_Object sym = x_keysym_to_emacs_keysym (keysym[0], 0); + if (name) + { + Fputhash (build_string (name), Qsans_modifiers, hash_table); + Fputhash (sym, Qsans_modifiers, hash_table); + } + } for (j = 1; j < keysyms_per_code; j++) { if (keysym[j] != keysym[0] && keysym[j] != NoSymbol) - x_has_keysym (keysym[j], hash_table, 1); + { + char *name = XKeysymToString (keysym[j]); + Lisp_Object sym = x_keysym_to_emacs_keysym (keysym[j], 0); + if (name && NILP (Fgethash (sym, hash_table, Qnil))) + { + Fputhash (build_string (name), Qt, hash_table); + Fputhash (sym, Qt, hash_table); + } + } } } } -static const char * +static CONST char * index_to_name (int indice) { switch (indice) @@ -563,7 +393,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; @@ -977,8 +807,7 @@ len = XmImMbLookupString (XtWindowToWidget (event->display, event->window), event, bufptr, bufsiz, &keysym, &status); #else /* XIM_XLIB */ - if (xic) - len = XmbLookupString (xic, event, bufptr, bufsiz, &keysym, &status); + len = XmbLookupString (xic, event, bufptr, bufsiz, &keysym, &status); #endif /* HAVE_XIM */ #ifdef DEBUG_XEMACS @@ -1029,9 +858,10 @@ Lstream *istr; struct gcpro gcpro1, gcpro2; - fb_instream = make_fixed_buffer_input_stream (bufptr, len); - - /* #### Use Fget_coding_system (Vcomposed_input_coding_system) */ + fb_instream = + make_fixed_buffer_input_stream ((unsigned char *) bufptr, len); + + /* ### Use Fget_coding_system (Vcomposed_input_coding_system) */ instream = make_decoding_input_stream (XLSTREAM (fb_instream), Fget_coding_system (Qundecided)); @@ -1042,7 +872,7 @@ while ((ch = Lstream_get_emchar (istr)) != EOF) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event *ev = XEVENT (emacs_event); + struct Lisp_Event *ev = XEVENT (emacs_event); ev->channel = DEVICE_CONSOLE (d); ev->event_type = key_press_event; ev->timestamp = event->time; @@ -1089,7 +919,7 @@ } static int -x_event_to_emacs_event (XEvent *x_event, Lisp_Event *emacs_event) +x_event_to_emacs_event (XEvent *x_event, struct Lisp_Event *emacs_event) { Display *display = x_event->xany.display; struct device *d = get_device_from_display (display); @@ -1111,7 +941,7 @@ case ButtonPress: case ButtonRelease: { - int modifiers = 0; + unsigned int modifiers = 0; int shift_p, lock_p; Bool key_event_p = (x_event->type == KeyPress); unsigned int *state = @@ -1138,11 +968,11 @@ x_handle_sticky_modifiers (x_event, d); - 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 & 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; /* Ignore the Caps_Lock key if: - any other modifiers are down, so that Caps_Lock doesn't @@ -1155,7 +985,7 @@ lock_p = *state & LockMask; if (shift_p || lock_p) - modifiers |= XEMACS_MOD_SHIFT; + modifiers |= MOD_SHIFT; if (key_event_p) { @@ -1187,7 +1017,7 @@ ! (CHAR_OR_CHAR_INTP (keysym) && keysym_obeys_caps_lock_p ((KeySym) XCHAR_OR_CHAR_INT (keysym), d))) - modifiers &= (~XEMACS_MOD_SHIFT); + modifiers &= (~MOD_SHIFT); /* If this key contains two distinct keysyms, that is, "shift" generates a different keysym than the @@ -1199,13 +1029,13 @@ in the modifiers slot. Neither the characters "a", "A", "2", nor "@" normally have the shift bit set. However, "F1" normally does. */ - if (modifiers & XEMACS_MOD_SHIFT) + if (modifiers & 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 &= ~XEMACS_MOD_SHIFT; + modifiers &= ~MOD_SHIFT; } emacs_event->event_type = key_press_event; emacs_event->timestamp = ev->time; @@ -1216,7 +1046,6 @@ { XButtonEvent *ev = &x_event->xbutton; struct frame *frame = x_window_to_frame (d, ev->window); - if (! frame) return 0; /* not for us */ XSETFRAME (emacs_event->channel, frame); @@ -1229,11 +1058,7 @@ emacs_event->event.button.button = ev->button; emacs_event->event.button.x = ev->x; emacs_event->event.button.y = ev->y; - /* because we don't seem to get a FocusIn event for button clicks - when a widget-glyph is selected we will assume that we want the - focus if a button gets pressed. */ - if (x_event->type == ButtonPress) - handle_focus_event_1 (frame, 1); + } } break; @@ -1242,7 +1067,7 @@ { XMotionEvent *ev = &x_event->xmotion; struct frame *frame = x_window_to_frame (d, ev->window); - int modifiers = 0; + unsigned int modifiers = 0; XMotionEvent event2; if (! frame) @@ -1271,12 +1096,12 @@ emacs_event->timestamp = ev->time; emacs_event->event.motion.x = ev->x; emacs_event->event.motion.y = ev->y; - if (ev->state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; - if (ev->state & ControlMask) modifiers |= XEMACS_MOD_CONTROL; - if (ev->state & xd->MetaMask) modifiers |= XEMACS_MOD_META; - 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 & 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; /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ emacs_event->event.motion.modifiers = modifiers; @@ -1292,9 +1117,7 @@ #ifdef HAVE_OFFIX_DND if (DndIsDropMessage(x_event)) { - unsigned int state; - int modifiers = 0; - unsigned int button=0; + unsigned int state, modifiers = 0, button=0; struct frame *frame = x_any_window_to_frame (d, ev->window); Extbyte *data; unsigned long size, dtype; @@ -1313,12 +1136,12 @@ state=DndDragButtons(x_event); - 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 & 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 & Button5Mask) button = Button5; if (state & Button4Mask) button = Button4; @@ -1361,7 +1184,7 @@ make_string ((Bufbyte *)"8bit", 4), make_ext_string ((Extbyte *)data, strlen((char *)data), - Qctext) ) ); + FORMAT_CTEXT) ) ); break; case DndMIME: /* we have to parse this in some way to extract @@ -1374,7 +1197,7 @@ l_type = Qdragdrop_MIME; l_dndlist = list1 ( make_ext_string ((Extbyte *)data, strlen((char *)data), - Qbinary) ); + FORMAT_BINARY) ); break; case DndFile: case DndDir: @@ -1395,7 +1218,7 @@ and escaping again will break them (cause % is unsave) */ l_dndlist = list1 ( make_ext_string ((Extbyte *)data, strlen ((char *)data), - Qfile_name) ); + FORMAT_FILENAME) ); l_type = Qdragdrop_URL; break; default: /* Unknown, RawData and any other type */ @@ -1403,7 +1226,7 @@ make_string ((Bufbyte *)"8bit", 4), make_ext_string ((Extbyte *)data, size, - Qbinary) ) ); + FORMAT_BINARY) ) ); l_type = Qdragdrop_MIME; break; } @@ -1452,7 +1275,6 @@ 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; @@ -1482,12 +1304,10 @@ static void handle_focus_event_1 (struct frame *f, int in_p) { -#if XtSpecificationRelease > 5 - Widget focus_widget = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f)); -#endif #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))); @@ -1499,26 +1319,7 @@ Actually, we half handle it: we handle it as far as changing the box cursor for redisplay, but we don't call any hooks or do any select-frame stuff until after the sit-for. - - Unfortunately native widgets break the model because they grab - the keyboard focus and nothing sets it back again. I cannot find - any reasonable way to do this elsewhere so we assert here that - the keyboard focus is on the emacs text widget. Menus and dialogs - 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 - click in the frame. Why is this? */ - if (in_p -#if XtSpecificationRelease > 5 - && FRAME_X_TEXT_WIDGET (f) != focus_widget -#endif - ) - { - lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), - FRAME_X_TEXT_WIDGET (f)); - } - /* do the generic event-stream stuff. */ + */ { Lisp_Object frm; Lisp_Object conser; @@ -1603,7 +1404,7 @@ /* Bleagh!!!!!! Apparently some window managers (e.g. MWM) send synthetic MapNotify events when a window is first - created, EVEN IF IT'S CREATED ICONIFIED OR INVISIBLE. + created, EVENT IF IT'S CREATED ICONIFIED OR INVISIBLE. Or something like that. We initially tried a different solution below, but that ran into a different window- manager bug. @@ -1711,26 +1512,7 @@ } 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) +emacs_Xt_handle_magic_event (struct Lisp_Event *emacs_event) { /* This function can GC */ XEvent *event = &emacs_event->event.magic.underlying_x_event; @@ -1758,13 +1540,8 @@ break; case Expose: - if (!check_for_ignored_expose (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height) - && - !find_matching_subwindow (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height)) - x_redraw_exposed_area (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height); + x_redraw_exposed_area (f, event->xexpose.x, event->xexpose.y, + event->xexpose.width, event->xexpose.height); break; case GraphicsExpose: /* This occurs when an XCopyArea's source area was @@ -1802,7 +1579,6 @@ case FocusIn: case FocusOut: - #ifdef EXTERNAL_WIDGET /* External widget lossage: Ben said: YUCK. The only way to make focus changes work properly is to @@ -1842,9 +1618,6 @@ #endif break; - case CreateNotify: - break; - default: break; } @@ -1860,14 +1633,14 @@ /* Xt interval id's might not fit into an int (they're pointers, as it happens), so we need to provide a conversion list. */ -static struct Xt_timeout +struct Xt_timeout { int id; XtIntervalId interval_id; struct Xt_timeout *next; } *pending_timeouts, *completed_timeouts; -static struct Xt_timeout_blocktype +struct Xt_timeout_blocktype { Blocktype_declare (struct Xt_timeout); } *the_Xt_timeout_blocktype; @@ -1974,7 +1747,7 @@ } static void -Xt_timeout_to_emacs_event (Lisp_Event *emacs_event) +Xt_timeout_to_emacs_event (struct Lisp_Event *emacs_event) { struct Xt_timeout *timeout = completed_timeouts; assert (timeout); @@ -2141,7 +1914,7 @@ } static void -emacs_Xt_select_process (Lisp_Process *p) +emacs_Xt_select_process (struct Lisp_Process *p) { Lisp_Object process; int infd = event_stream_unixoid_select_process (p); @@ -2151,7 +1924,7 @@ } static void -emacs_Xt_unselect_process (Lisp_Process *p) +emacs_Xt_unselect_process (struct Lisp_Process *p) { int infd = event_stream_unixoid_unselect_process (p); @@ -2180,7 +1953,7 @@ If we've still got pointers to it in this file, we're gonna lose hard. */ void -debug_process_finalization (Lisp_Process *p) +debug_process_finalization (struct Lisp_Process *p) { #if 0 /* #### */ int i; @@ -2200,27 +1973,25 @@ } static void -Xt_process_to_emacs_event (Lisp_Event *emacs_event) +Xt_process_to_emacs_event (struct Lisp_Event *emacs_event) { int i; + Lisp_Object process; assert (process_events_occurred > 0); - for (i = 0; i < MAXDESC; i++) { - Lisp_Object process = filedesc_with_input[i]; + process = filedesc_with_input[i]; if (PROCESSP (process)) - { - filedesc_with_input[i] = Qnil; - process_events_occurred--; - /* process events have nil as channel */ - emacs_event->event_type = process_event; - emacs_event->timestamp = 0; /* #### */ - emacs_event->event.process.process = process; - return; - } + break; } - abort (); + assert (i < MAXDESC); + filedesc_with_input[i] = Qnil; + process_events_occurred--; + /* process events have nil as channel */ + emacs_event->event_type = process_event; + emacs_event->timestamp = 0; /* #### */ + emacs_event->event.process.process = process; } static void @@ -2228,6 +1999,9 @@ { Lisp_Object console; int infd; +#ifdef HAVE_GPM + int mousefd; +#endif if (CONSOLE_X_P (con)) return; /* X consoles are automatically selected for when we @@ -2235,6 +2009,22 @@ infd = event_stream_unixoid_select_console (con); XSETCONSOLE (console, con); select_filedesc (infd, console); +#ifdef HAVE_GPM + /* On a stream device (ie: noninteractive), bad things can happen. */ + if (EQ (CONSOLE_TYPE (con), Qtty)) { + mousefd = CONSOLE_TTY_MOUSE_FD (con); + /* We check filedesc_to_what_closure[fd] here because if you run + ** XEmacs from a TTY, it will fire up GPM, select the mouse fd, then + ** if you run gnuattach to connect to another TTY, it will fire up + ** GPM again, and try to reselect the mouse fd. GPM uses the same + ** fd for every connection apparently, and select_filedesc will + ** fail its assertion if we try to select it twice. + */ + if ((mousefd >= 0) && !filedesc_to_what_closure[mousefd]) { + select_filedesc (mousefd, console); + } + } +#endif } static void @@ -2242,6 +2032,9 @@ { Lisp_Object console; int infd; +#ifdef HAVE_GPM + int mousefd; +#endif if (CONSOLE_X_P (con)) return; /* X consoles are automatically selected for when we @@ -2249,6 +2042,15 @@ infd = event_stream_unixoid_unselect_console (con); XSETCONSOLE (console, con); unselect_filedesc (infd); +#ifdef HAVE_GPM + /* On a stream device (ie: noninteractive), bad things can happen. */ + if (EQ (CONSOLE_TYPE (con), Qtty)) { + mousefd = CONSOLE_TTY_MOUSE_FD (con); + if (mousefd >= 0) { + unselect_filedesc (mousefd); + } + } +#endif } /* read an event from a tty, if one is available. Returns non-zero @@ -2260,7 +2062,7 @@ to be deleted.) */ static int -Xt_tty_to_emacs_event (Lisp_Event *emacs_event) +Xt_tty_to_emacs_event (struct Lisp_Event *emacs_event) { int i; @@ -2306,12 +2108,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, 1); + strlen (buf), FORMAT_TERMINAL); } stderr_out ("\n"); } -static const char * +static CONST char * XEvent_mode_to_string (int mode) { switch (mode) @@ -2324,7 +2126,7 @@ } } -static const char * +static CONST char * XEvent_detail_to_string (int detail) { switch (detail) @@ -2340,7 +2142,7 @@ } } -static const char * +static CONST char * XEvent_visibility_to_string (int state) { switch (state) @@ -2509,7 +2311,7 @@ static Lisp_Object dispatch_event_queue, dispatch_event_queue_tail; -void +static void enqueue_Xt_dispatch_event (Lisp_Object event) { enqueue_event (event, &dispatch_event_queue, &dispatch_event_queue_tail); @@ -2545,7 +2347,7 @@ } static void -emacs_Xt_next_event (Lisp_Event *emacs_event) +emacs_Xt_next_event (struct Lisp_Event *emacs_event) { we_didnt_get_an_event: @@ -2930,10 +2732,10 @@ the '#if 0'. Note, however, that I got "unknown structure" errors when I tried this. */ XtConvertArgRec Const colorConvertArgs[] = { - { XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), - sizeof (Screen *) }, - { XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap), - sizeof (Colormap) } + {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), + sizeof(Screen *)}, + {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap), + sizeof(Colormap)} }; #endif @@ -3075,42 +2877,6 @@ /************************************************************************/ -/* 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 */ /************************************************************************/ @@ -3119,15 +2885,20 @@ { defsymbol (&Qkey_mapping, "key-mapping"); defsymbol (&Qsans_modifiers, "sans-modifiers"); - defsymbol (&Qself_insert_command, "self-insert-command"); } void -reinit_vars_of_event_Xt (void) +vars_of_event_Xt (void) { + dispatch_event_queue = Qnil; + staticpro (&dispatch_event_queue); + dispatch_event_queue_tail = Qnil; + + /* this function only makes safe calls */ + init_what_input_once (); + 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; @@ -3140,23 +2911,14 @@ Xt_event_stream->create_stream_pair_cb = emacs_Xt_create_stream_pair; Xt_event_stream->delete_stream_pair_cb = emacs_Xt_delete_stream_pair; - the_Xt_timeout_blocktype = Blocktype_new (struct Xt_timeout_blocktype); - - last_quit_check_signal_tick_count = 0; - - /* this function only makes safe calls */ - init_what_input_once (); -} - -void -vars_of_event_Xt (void) -{ - reinit_vars_of_event_Xt (); - - dispatch_event_queue = Qnil; - staticpro (&dispatch_event_queue); - 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. @@ -3174,6 +2936,10 @@ */ ); x_debug_events = 0; #endif + + the_Xt_timeout_blocktype = Blocktype_new (struct Xt_timeout_blocktype); + + last_quit_check_signal_tick_count = 0; } /* This mess is a hack that patches the shell widget to treat visual inheritance @@ -3220,7 +2986,7 @@ XSetErrorHandler (x_error_handler); XSetIOErrorHandler (x_IO_error_handler); -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT XtAppAddInput (Xt_app_con, signal_event_pipe[0], (XtPointer) (XtInputReadMask /* | XtInputExceptMask */), Xt_what_callback, 0); @@ -3237,8 +3003,6 @@ 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 12e008d41344 -r 697ef44129c6 src/event-msw.c --- a/src/event-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/event-msw.c Mon Aug 13 11:20:41 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, 2000 Ben Wing. + Copyright (C) 1996 Ben Wing. Copyright (C) 1997 Jonathan Harris. This file is part of XEmacs. @@ -41,7 +41,6 @@ #endif #ifdef HAVE_MENUBARS -# include "menubar.h" # include "menubar-msw.h" #endif @@ -57,8 +56,6 @@ #include "lstream.h" #include "process.h" #include "redisplay.h" -#include "select.h" -#include "window.h" #include "sysproc.h" #include "syswait.h" #include "systime.h" @@ -69,16 +66,12 @@ #ifdef HAVE_MSG_SELECT #include "sysfile.h" #include "console-tty.h" -#elif defined(CYGWIN) +#elif defined(__CYGWIN32__) typedef unsigned int SOCKET; #endif #include <io.h> #include <errno.h> -#if !(defined(CYGWIN) || defined(MINGW)) -# include <shlobj.h> /* For IShellLink */ -#endif - #ifdef HAVE_MENUBARS #define ADJR_MENUFLAG TRUE #else @@ -92,16 +85,20 @@ /* Timer ID used for button2 emulation */ #define BUTTON_2_TIMER_ID 1 +extern Lisp_Object +mswindows_get_toolbar_button_text (struct frame* f, int command_id); +extern Lisp_Object +mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id); +extern Lisp_Object +mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, WORD id); + static Lisp_Object mswindows_find_frame (HWND hwnd); static Lisp_Object mswindows_find_console (HWND hwnd); -static Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods, - int extendedp); +static Lisp_Object mswindows_key_to_emacs_keysym(int mswindows_key, int mods); static int mswindows_modifier_state (BYTE* keymap, 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; @@ -132,7 +129,6 @@ /* 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; @@ -144,16 +140,11 @@ /* These are Lisp integers; see DEFVARS in this file for description. */ int mswindows_dynamic_frame_resize; -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 mswindows_debug_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; @@ -187,11 +178,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 */ @@ -202,7 +193,7 @@ }; #define MAX_SLURP_STREAMS 32 -struct ntpipe_slurp_stream_shared_data +struct ntpipe_slurp_stream_shared_data shared_data_block[MAX_SLURP_STREAMS]={{0}}; struct ntpipe_slurp_stream @@ -230,7 +221,7 @@ } static struct ntpipe_slurp_stream_shared_data* -slurper_allocate_shared_data (void) +slurper_allocate_shared_data() { int i=0; for (i=0; i<MAX_SLURP_STREAMS; i++) @@ -274,7 +265,7 @@ /* Now we got something to notify caller, either a byte or an error/eof indication. Before we do, allow internal pipe - buffer to accumulate little bit more data. + buffer to accumulate little bit more data. Reader function pulses this event before waiting for a character, to avoid pipe delay, and to get the byte immediately. */ @@ -363,11 +354,11 @@ return s->thread_data->hev_caller; } -static ssize_t +static int ntpipe_slurp_reader (Lstream *stream, unsigned char *data, size_t size) { /* This function must be called from the main thread only */ - struct ntpipe_slurp_stream_shared_data* s = + struct ntpipe_slurp_stream_shared_data* s = NTPIPE_SLURP_STREAM_DATA(stream)->thread_data; if (!s->die_p) @@ -376,7 +367,7 @@ /* Disallow pipe read delay for the thread: we need a character ASAP */ SetEvent (s->hev_unsleep); - + /* Check if we have a character ready. Give it a short delay, for the thread to awake from pipe delay, just ion case*/ wait_result = WaitForSingleObject (s->hev_caller, 2); @@ -427,7 +418,7 @@ ReadFile (s->hpipe, data, min (bytes_available, size), &bytes_read, NULL); } - + /* Now we can unblock thread, so it attempts to read more */ SetEvent (s->hev_thread); return bytes_read + 1; @@ -436,11 +427,11 @@ return 0; } -static int +static int ntpipe_slurp_closer (Lstream *stream) { /* This function must be called from the main thread only */ - struct ntpipe_slurp_stream_shared_data* s = + struct ntpipe_slurp_stream_shared_data* s = NTPIPE_SLURP_STREAM_DATA(stream)->thread_data; /* Force thread to stop */ @@ -471,13 +462,13 @@ #define NTPIPE_SHOVE_STREAM_DATA(stream) \ LSTREAM_TYPE_DATA (stream, ntpipe_shove) -#define MAX_SHOVE_BUFFER_SIZE 512 - +#define MAX_SHOVE_BUFFER_SIZE 128 + struct ntpipe_shove_stream { LPARAM user_data; /* Any user data stored in the stream object */ HANDLE hev_thread; /* Our thread blocks on this, signaled by caller */ - /* This is an auto-reset object. */ + /* This is an auto-reset object. */ HANDLE hpipe; /* Pipe write end handle. */ HANDLE hthread; /* Reader thread handle. */ char buffer[MAX_SHOVE_BUFFER_SIZE]; /* Buffer being written */ @@ -499,24 +490,21 @@ for (;;) { - DWORD bytes_written; + DWORD bytes_written; /* Block on event and wait for a job */ InterlockedIncrement (&s->idle_p); WaitForSingleObject (s->hev_thread, INFINITE); - /* Write passed buffer if any */ - if (s->size > 0) + if (s->die_p) + break; + + /* Write passed buffer */ + if (!WriteFile (s->hpipe, s->buffer, s->size, &bytes_written, NULL) + || bytes_written != s->size) { - 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; + s->error_p = TRUE; + InterlockedIncrement (&s->die_p); } if (s->die_p) @@ -539,7 +527,7 @@ s->hpipe = hpipe; s->user_data = param; - /* Create reader thread. This could fail, so do not + /* Create reader thread. This could fail, so do not create the event until thread is created */ s->hthread = CreateThread (NULL, 0, shove_thread, (LPVOID)s, CREATE_SUSPENDED, &thread_id_unused); @@ -549,15 +537,6 @@ 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,7 +556,7 @@ } #endif -static ssize_t +static int ntpipe_shove_writer (Lstream *stream, const unsigned char *data, size_t size) { struct ntpipe_shove_stream* s = NTPIPE_SHOVE_STREAM_DATA(stream); @@ -598,9 +577,6 @@ /* Start output */ InterlockedDecrement (&s->idle_p); SetEvent (s->hev_thread); - /* Give it a chance to run -- this dramatically improves performance - of things like crypt. */ - (void) SwitchToThread (); return size; } @@ -619,18 +595,14 @@ /* Force thread stop */ InterlockedIncrement (&s->die_p); - /* 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. */ + /* Close pipe handle, possibly breaking it */ + CloseHandle (s->hpipe); + + /* Thread will end upon unblocking */ 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 */ @@ -660,8 +632,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 long bufsize; /* Number of bytes last read */ - unsigned long bufpos; /* Position in buffer for next fetch */ + unsigned int bufsize; /* Number of bytes last read */ + unsigned int 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 */ @@ -693,7 +665,7 @@ str->eof_p = 1; } -static ssize_t +static int winsock_reader (Lstream *stream, unsigned char *data, size_t size) { struct winsock_stream *str = WINSOCK_STREAM_DATA (stream); @@ -726,7 +698,7 @@ return 0; if (str->error_p) return -1; - + /* Return as much of buffer as we have */ size = min (size, (size_t) (str->bufsize - str->bufpos)); memcpy (data, (void*)((BYTE*)str->buffer + str->bufpos), size); @@ -739,8 +711,8 @@ return size; } -static ssize_t -winsock_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +winsock_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct winsock_stream *str = WINSOCK_STREAM_DATA (stream); @@ -767,7 +739,7 @@ if (size == 0) return 0; - + { ResetEvent (str->ov.hEvent); @@ -813,7 +785,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); @@ -881,7 +853,7 @@ /************************************************************************/ static int -mswindows_user_event_p (Lisp_Event* sevt) +mswindows_user_event_p (struct Lisp_Event* sevt) { return (sevt->event_type == key_press_event || sevt->event_type == button_press_event @@ -889,18 +861,18 @@ || sevt->event_type == misc_user_event); } -/* +/* * Add an emacs event to the proper dispatch queue */ -void +static void mswindows_enqueue_dispatch_event (Lisp_Object event) { int user_p = mswindows_user_event_p (XEVENT(event)); enqueue_event (event, - user_p ? &mswindows_u_dispatch_event_queue : - &mswindows_s_dispatch_event_queue, + user_p ? &mswindows_u_dispatch_event_queue : + &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); @@ -917,11 +889,10 @@ Lisp_Object object) { Lisp_Object event = Fmake_event (Qnil, Qnil); - Lisp_Event* e = XEVENT (event); + struct Lisp_Event* e = XEVENT (event); e->event_type = misc_user_event; e->channel = channel; - e->timestamp = GetTickCount (); e->event.misc.function = function; e->event.misc.object = object; @@ -929,24 +900,24 @@ } void -mswindows_enqueue_magic_event (HWND hwnd, UINT msg) +mswindows_enqueue_magic_event (HWND hwnd, UINT message) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event* event = XEVENT (emacs_event); + struct Lisp_Event* event = XEVENT (emacs_event); event->channel = hwnd ? mswindows_find_frame (hwnd) : Qnil; event->timestamp = GetMessageTime(); event->event_type = magic_event; - EVENT_MSWINDOWS_MAGIC_TYPE (event) = msg; + EVENT_MSWINDOWS_MAGIC_TYPE (event) = message; mswindows_enqueue_dispatch_event (emacs_event); } static void -mswindows_enqueue_process_event (Lisp_Process* p) +mswindows_enqueue_process_event (struct Lisp_Process* p) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event* event = XEVENT (emacs_event); + struct Lisp_Event* event = XEVENT (emacs_event); Lisp_Object process; XSETPROCESS (process, p); @@ -958,30 +929,27 @@ } static void -mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where, - DWORD when) +mswindows_enqueue_mouse_button_event (HWND hwnd, UINT message, POINTS where, 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); - - mswindows_handle_sticky_modifiers (0, 0, downp, 0); - event->channel = mswindows_find_frame (hwnd); + struct Lisp_Event* event = XEVENT(emacs_event); + + 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); + (message==WM_LBUTTONDOWN || message==WM_LBUTTONUP) ? 1 : + ((message==WM_RBUTTONDOWN || message==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 (downp) + + if (message==WM_LBUTTONDOWN || message==WM_MBUTTONDOWN || + message==WM_RBUTTONDOWN) { event->event_type = button_press_event; SetCapture (hwnd); @@ -998,7 +966,7 @@ event->event_type = button_release_event; ReleaseCapture (); } - + mswindows_enqueue_dispatch_event (emacs_event); } @@ -1006,7 +974,7 @@ mswindows_enqueue_keypress_event (HWND hwnd, Lisp_Object keysym, int mods) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event* event = XEVENT(emacs_event); + struct Lisp_Event* event = XEVENT(emacs_event); event->channel = mswindows_find_console(hwnd); event->timestamp = GetMessageTime(); @@ -1021,19 +989,19 @@ * Give a preference to user events over non-user ones. */ static Lisp_Object -mswindows_dequeue_dispatch_event (void) +mswindows_dequeue_dispatch_event () { Lisp_Object event; - Lisp_Event* sevt; + struct Lisp_Event* sevt; assert (!NILP(mswindows_u_dispatch_event_queue) || !NILP(mswindows_s_dispatch_event_queue)); event = dequeue_event ( - NILP(mswindows_u_dispatch_event_queue) ? - &mswindows_s_dispatch_event_queue : + 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); @@ -1058,22 +1026,22 @@ */ Lisp_Object -mswindows_cancel_dispatch_event (Lisp_Event *match) +mswindows_cancel_dispatch_event (struct Lisp_Event *match) { Lisp_Object event; Lisp_Object previous_event = Qnil; int user_p = mswindows_user_event_p (match); - Lisp_Object* head = user_p ? &mswindows_u_dispatch_event_queue : - &mswindows_s_dispatch_event_queue; - Lisp_Object* tail = user_p ? &mswindows_u_dispatch_event_queue_tail : - &mswindows_s_dispatch_event_queue_tail; + Lisp_Object* head = user_p ? &mswindows_u_dispatch_event_queue : + &mswindows_s_dispatch_event_queue; + Lisp_Object* tail = user_p ? &mswindows_u_dispatch_event_queue_tail : + &mswindows_s_dispatch_event_queue_tail; assert (match->event_type == timeout_event || match->event_type == key_press_event); EVENT_CHAIN_LOOP (event, *head) { - Lisp_Event *e = XEVENT (event); + struct Lisp_Event *e = XEVENT (event); if ((e->event_type == match->event_type) && ((e->event_type == timeout_event) ? (e->event.timeout.interval_id == match->event.timeout.interval_id) : @@ -1088,7 +1056,7 @@ if (EQ (*tail, event)) *tail = previous_event; } - + return event; } previous_event = event; @@ -1129,7 +1097,7 @@ if (ix < 0) return; - mswindows_waitable_handles [ix] = + mswindows_waitable_handles [ix] = mswindows_waitable_handles [--mswindows_waitable_count]; } #endif /* HAVE_MSG_SELECT */ @@ -1153,7 +1121,7 @@ { Lisp_Object tmp; - ++mswindows_in_modal_loop; + ++mswindows_in_modal_loop; tmp = condition_case_1 (Qt, bfun, barg, mswindows_modal_loop_error_handler, Qnil); @@ -1177,7 +1145,7 @@ } /* - * This is an unsafe part of event pump, guarded by + * This is an unsafe part of event pump, guarded by * condition_case. See mswindows_pump_outstanding_events */ static Lisp_Object @@ -1201,7 +1169,7 @@ Fdeallocate_event (event); UNGCPRO; - + /* Qt becomes return value of mswindows_pump_outstanding_events once we get here */ return Qt; @@ -1249,69 +1217,33 @@ Lisp_Object result = Qt; struct gcpro gcpro1; 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; } -/* - * KEYBOARD_ONLY_P is set to non-zero when we are called from - * QUITP, and are interesting in keyboard messages only. - */ -static void -mswindows_drain_windows_queue (void) +static void +mswindows_drain_windows_queue () { MSG msg; - - /* 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 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 */ - char class_name_buf [sizeof (XEMACS_CLASS) + 2] = ""; - 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) + /* 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 ) { - 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; + TranslateMessage (&msg); } DispatchMessage (&msg); mswindows_unmodalize_signal_maybe (); } } -/* +/* * This is a special flavor of the mswindows_need_event function, * used while in event pump. Actually, there is only kind of events * allowed while in event pump: a timer. An attempt to fetch any @@ -1344,7 +1276,7 @@ /* We'll deadlock if go waiting */ if (mswindows_pending_timers_count == 0) error ("Deadlock due to an attempt to call next-event in a wrong context"); - + /* Fetch and dispatch any pending timers */ GetMessage (&msg, NULL, WM_TIMER, WM_TIMER); DispatchMessage (&msg); @@ -1369,6 +1301,10 @@ return; } + /* Have to drain Windows message queue first, otherwise, we may miss + quit char when called from quit_p */ + mswindows_drain_windows_queue (); + while (NILP (mswindows_u_dispatch_event_queue) && NILP (mswindows_s_dispatch_event_queue)) { @@ -1377,7 +1313,7 @@ SELECT_TYPE temp_mask = input_wait_mask; EMACS_TIME sometime; EMACS_SELECT_TIME select_time_to_block, *pointer_to_this; - + if (badly_p) pointer_to_this = 0; else @@ -1388,10 +1324,9 @@ } active = select (MAXDESC, &temp_mask, 0, 0, pointer_to_this); - + if (active == 0) { - assert (!badly_p); return; /* timeout */ } else if (active > 0) @@ -1400,51 +1335,48 @@ { mswindows_drain_windows_queue (); } - else +#ifdef HAVE_TTY + /* Look for a TTY event */ + for (i = 0; i < MAXDESC-1; i++) { -#ifdef HAVE_TTY - /* Look for a TTY event */ - for (i = 0; i < MAXDESC-1; 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)) { - /* To avoid race conditions (among other things, an infinite - loop when called from Fdiscard_input()), we must return - user events ahead of process events. */ - if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &tty_only_mask)) + struct console *c = tty_find_console_from_fd (i); + Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); + struct Lisp_Event* event = XEVENT (emacs_event); + + assert (c); + if (read_event_from_tty_or_stream_desc (event, c, 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)) - { - mswindows_enqueue_dispatch_event (emacs_event); - return; - } + mswindows_enqueue_dispatch_event (emacs_event); + return; } } + } #endif - /* Look for a process event */ - for (i = 0; i < MAXDESC-1; i++) + /* Look for a process event */ + for (i = 0; i < MAXDESC-1; i++) + { + if (FD_ISSET (i, &temp_mask)) { - if (FD_ISSET (i, &temp_mask)) + if (FD_ISSET (i, &process_only_mask)) { - 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); - } + struct 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); } } } @@ -1463,79 +1395,67 @@ } #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 (); - } - 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); - } - } + 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 */ + struct 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); + } + } #endif - } /* while */ + } /* while */ } /************************************************************************/ /* Event generators */ /************************************************************************/ -/* +/* * Callback procedure for synchronous timer messages */ static void CALLBACK mswindows_wm_timer_callback (HWND hwnd, UINT umsg, UINT id_timer, DWORD dwtime) { Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); - Lisp_Event *event = XEVENT (emacs_event); + struct Lisp_Event *event = XEVENT (emacs_event); if (KillTimer (NULL, id_timer)) --mswindows_pending_timers_count; @@ -1550,7 +1470,7 @@ mswindows_enqueue_dispatch_event (emacs_event); } -/* +/* * Callback procedure for dde messages * * We execute a dde Open("file") by simulating a file drop, so dde support @@ -1561,9 +1481,9 @@ mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, DWORD dwData1, DWORD dwData2) -{ +{ switch (uType) - { + { case XTYP_CONNECT: if (!DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)) return (HDDEDATA)TRUE; @@ -1576,24 +1496,24 @@ { 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)); } - return (HDDEDATA)NULL; + return (HDDEDATA)NULL; case XTYP_EXECUTE: if (!DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)) { DWORD len = DdeGetData (hdata, NULL, 0, 0); - LPBYTE cmd = (LPBYTE) alloca (len+1); + char *cmd = alloca (len+1); char *end; char *filename; struct gcpro gcpro1, gcpro2; Lisp_Object l_dndlist = Qnil; Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); Lisp_Object frmcons, devcons, concons; - Lisp_Event *event = XEVENT (emacs_event); + struct Lisp_Event *event = XEVENT (emacs_event); DdeGetData (hdata, cmd, len, 0); cmd[len] = '\0'; @@ -1625,7 +1545,7 @@ if (*end) return DDE_FNOTPROCESSED; -#ifdef CYGWIN +#ifdef __CYGWIN32__ filename = alloca (cygwin32_win32_to_posix_path_list_buf_size (cmd) + 5); strcpy (filename, "file:"); cygwin32_win32_to_posix_path_list (cmd, filename+5); @@ -1661,1247 +1581,720 @@ UNGCPRO; return (HDDEDATA) DDE_FACK; } - DdeFreeDataHandle (hdata); + DdeFreeDataHandle (hdata); return (HDDEDATA) DDE_FNOTPROCESSED; - default: - return (HDDEDATA) NULL; - } + default: + return (HDDEDATA) NULL; + } } #endif /* - * 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_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. */ Lisp_Object emacs_event = Qnil; Lisp_Object fobj = Qnil; - Lisp_Event *event; + struct Lisp_Event *event; struct frame *frame; struct mswindows_frame* msframe; - assert (!GetWindowLong (hwnd, GWL_USERDATA)); - switch (message_) + switch (message) + { + 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 */ + { + 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); + } + }; + goto defproc; + + 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. */ { - 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_KEYUP: - case WM_SYSKEYUP: - - /* See Win95 comment under WM_KEYDOWN */ + BYTE keymap[256]; + int has_AltGr = mswindows_current_layout_has_AltGr (); + int mods; + Lisp_Object keysym; + + GetKeyboardState (keymap); + mods = mswindows_modifier_state (keymap, has_AltGr); + + /* Handle those keys for which TranslateMessage won't generate a WM_CHAR */ + if (!NILP (keysym = mswindows_key_to_emacs_keysym(wParam, mods))) + mswindows_enqueue_keypress_event (hwnd, keysym, mods); + else + { + 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 [(lParam & 0x1000000) ? VK_RCONTROL : VK_LCONTROL] |= 0x80; + else if (wParam == VK_MENU) + keymap [(lParam & 0x1000000) ? 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; + } + 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 */ + } + /* F10 causes menu activation by default. We do not want this */ + if (wParam != VK_F10) + goto defproc; + 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) { - BYTE keymap[256]; - int should_set_keymap = 0; - -#ifdef DEBUG_XEMACS - if (mswindows_debug_events) + 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), GetMessageTime()); + } + else + { + if (msframe->button2_need_rbutton) { - 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; + msframe->button2_need_rbutton = 0; + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); } - - if (should_set_keymap) - // && (message_ != WM_SYSKEYUP - // || NILP (Vmenu_accelerator_enabled))) - SetKeyboardState (keymap); - + mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP, + MAKEPOINTS (lParam), GetMessageTime()); } - - 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 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. */ + 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 { - 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 (mswindows_debug_events) + if (msframe->button2_need_lbutton) { - stderr_out ("%s wparam=%d lparam=%d\n", - message_ == WM_KEYDOWN ? "WM_KEYDOWN" : "WM_SYSKEYDOWN", - wParam, (int)lParam); - output_alt_keyboard_state (); - } -#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))) { - 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; - } + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + msframe->button2_is_down = 1; } else - memcpy (keymap_sticky, keymap_orig, 256); - - mods = mswindows_modifier_state (keymap_sticky, has_AltGr); - - /* Handle non-printables */ - if (!NILP (keysym = mswindows_key_to_emacs_keysym (wParam, mods, - extendedp))) { - mswindows_enqueue_keypress_event (hwnd, keysym, mods); - if (sticky_changed) - SetKeyboardState (keymap_orig); + 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()); } - else /* Normal keys & modifiers */ + } + 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))) + { + mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, + MAKEPOINTS (lParam), GetMessageTime()); + msframe->button2_is_down = 1; + } + else { - 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 */ + 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()); + } + } + else + { + mswindows_set_chord_timer (hwnd); + msframe->button2_need_lbutton = 1; + 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), 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), GetMessageTime()); - } - else - { - if (msframe->button2_need_rbutton) - { - msframe->button2_need_rbutton = 0; - mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - } - 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) - { - 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) + 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))) { 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; - } - else - { - 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()); - } - } - else - { - mswindows_set_chord_timer (hwnd); - msframe->button2_need_rbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); + SendMessage (hwnd, WM_TIMER, BUTTON_2_TIMER_ID, 0); } - msframe->last_click_time = GetMessageTime(); - break; - - case WM_RBUTTONDOWN: - msframe = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd))); - - if (msframe->button2_need_rbutton) + + 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; + +#ifdef HAVE_TOOLBARS + case WM_NOTIFY: + { + LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; + Lisp_Object btext; + if (tttext->hdr.code == TTN_NEEDTEXT) { - 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))) + /* find out which toolbar */ + frame = XFRAME (mswindows_find_frame (hwnd)); + btext = mswindows_get_toolbar_button_text ( frame, + tttext->hdr.idFrom ); + + tttext->lpszText = NULL; + tttext->hinst = NULL; + + if (!NILP(btext)) { - mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), GetMessageTime()); - msframe->button2_is_down = 1; + /* I think this is safe since the text will only go away + when the toolbar does...*/ + GET_C_STRING_EXT_DATA_ALLOCA (btext, FORMAT_OS, + tttext->lpszText); } - 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()); - } +#if 0 + tttext->uFlags |= TTF_DI_SETITEM; +#endif + } + } + break; +#endif + + case WM_PAINT: + { + PAINTSTRUCT paintStruct; + + frame = XFRAME (mswindows_find_frame (hwnd)); + + BeginPaint (hwnd, &paintStruct); + mswindows_redraw_exposed_area (frame, + paintStruct.rcPaint.left, paintStruct.rcPaint.top, + paintStruct.rcPaint.right, paintStruct.rcPaint.bottom); + EndPaint (hwnd, &paintStruct); + } + 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 { - 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))) + 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)) { - 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)) - { - /* 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); - } -#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); + /* 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 { - 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 (); - } + 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; - - case WM_DISPLAYCHANGE: + } + 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)) { - 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: - { - 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)) + 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) { - 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; + /* 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; } - /* DefWindowProc sends useful WM_GETMINMAXINFO message, and adjusts - window position if the user tries to track window too small */ + + wp->cx = pixwidth; + wp->cy = pixheight; } - 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; + /* 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; #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; + } #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_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; + 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) + && + !NILP (XIMAGE_INSTANCE_WIDGET_FACE (image_instance))) + { + /* 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; #ifdef HAVE_DRAGNDROP - 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, 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<filecount; i++) - { - len = DragQueryFile ((HDROP) wParam, i, NULL, 0); - /* The URLs that we make here aren't correct according to section - * 3.10 of rfc1738 because they're missing the //<host>/ 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); - } - } + case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ + { + UINT filecount, i, len; + POINT point; + char* filename; +#ifdef __CYGWIN32__ + char* fname; #endif - -#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); + 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<filecount; i++) + { + len = DragQueryFile ((HANDLE) wParam, i, NULL, 0); + /* The URLs that we make here aren't correct according to section + * 3.10 of rfc1738 because they're missing the //<host>/ 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); #else - filename = (char *)xmalloc (len+6); - strcat (strcpy (filename, "file:"), fname); - dostounix_filename (filename+5); + filename = (char *)xmalloc (len+6); + strcpy (filename, "file:"); + DragQueryFile ((HANDLE) wParam, i, filename+5, len+1); + dostounix_filename (filename+5); #endif - 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; + 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; + } + break; #endif - defproc: - default: - return DefWindowProc (hwnd, message_, wParam, lParam); - } + defproc: + default: + return DefWindowProc (hwnd, message, wParam, lParam); + } return (0); } @@ -2967,31 +2360,29 @@ /* Returns the state of the modifier keys in the format expected by the * Lisp_Event key_data, button_data and motion_data modifiers member */ -static int -mswindows_modifier_state (BYTE* keymap, int has_AltGr) +int mswindows_modifier_state (BYTE* keymap, int has_AltGr) { int mods = 0; - BYTE keymap2[256]; if (keymap == NULL) { - keymap = keymap2; + keymap = (BYTE*) alloca(256); GetKeyboardState (keymap); has_AltGr = mswindows_current_layout_has_AltGr (); } if (has_AltGr && (keymap [VK_LCONTROL] & 0x80) && (keymap [VK_RMENU] & 0x80)) { - mods |= (keymap [VK_LMENU] & 0x80) ? XEMACS_MOD_META : 0; - mods |= (keymap [VK_RCONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0; + mods |= (keymap [VK_LMENU] & 0x80) ? MOD_META : 0; + mods |= (keymap [VK_RCONTROL] & 0x80) ? MOD_CONTROL : 0; } else { - mods |= (keymap [VK_MENU] & 0x80) ? XEMACS_MOD_META : 0; - mods |= (keymap [VK_CONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0; + mods |= (keymap [VK_MENU] & 0x80) ? MOD_META : 0; + mods |= (keymap [VK_CONTROL] & 0x80) ? MOD_CONTROL : 0; } - mods |= (keymap [VK_SHIFT] & 0x80) ? XEMACS_MOD_SHIFT : 0; + mods |= (keymap [VK_SHIFT] & 0x80) ? MOD_SHIFT : 0; return mods; } @@ -3001,100 +2392,67 @@ * 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 + * XXX I'm not sure that KEYSYM("name") is the best thing to use here. */ -Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods, - int extendedp) +Lisp_Object mswindows_key_to_emacs_keysym(int mswindows_key, int mods) { - if (extendedp) /* Keys not present on a 82 key keyboard */ - { - switch (mswindows_key) - { - case VK_RETURN: return KEYSYM ("kp-enter"); - case VK_PRIOR: return KEYSYM ("prior"); - case VK_NEXT: return KEYSYM ("next"); - case VK_END: return KEYSYM ("end"); - case VK_HOME: return KEYSYM ("home"); - case VK_LEFT: return KEYSYM ("left"); - case VK_UP: return KEYSYM ("up"); - case VK_RIGHT: return KEYSYM ("right"); - case VK_DOWN: return KEYSYM ("down"); - case VK_INSERT: return KEYSYM ("insert"); - case VK_DELETE: return QKdelete; - } - } - else - { - switch (mswindows_key) - { - case VK_BACK: return QKbackspace; - case VK_TAB: return QKtab; - case '\n': return QKlinefeed; - case VK_CLEAR: return KEYSYM ("clear"); - case VK_RETURN: return QKreturn; - case VK_ESCAPE: return QKescape; - case VK_SPACE: return QKspace; - case VK_PRIOR: return KEYSYM ("kp-prior"); - case VK_NEXT: return KEYSYM ("kp-next"); - case VK_END: return KEYSYM ("kp-end"); - case VK_HOME: return KEYSYM ("kp-home"); - case VK_LEFT: return KEYSYM ("kp-left"); - case VK_UP: return KEYSYM ("kp-up"); - case VK_RIGHT: return KEYSYM ("kp-right"); - case VK_DOWN: return KEYSYM ("kp-down"); - case VK_SELECT: return KEYSYM ("select"); - case VK_PRINT: return KEYSYM ("print"); - case VK_EXECUTE: return KEYSYM ("execute"); - case VK_SNAPSHOT: return KEYSYM ("print"); - 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 (""); + switch (mswindows_key) + { + /* First the predefined ones */ + case VK_BACK: return QKbackspace; + case VK_TAB: return QKtab; + case '\n': return QKlinefeed; /* No VK_LINEFEED in winresrc.h */ + case VK_RETURN: return QKreturn; + case VK_ESCAPE: return QKescape; + case VK_SPACE: return QKspace; + case VK_DELETE: return QKdelete; + + /* The rest */ + case VK_CLEAR: return KEYSYM ("clear"); /* Should do ^L ? */ + case VK_PRIOR: return KEYSYM ("prior"); + case VK_NEXT: return KEYSYM ("next"); + case VK_END: return KEYSYM ("end"); + case VK_HOME: return KEYSYM ("home"); + case VK_LEFT: return KEYSYM ("left"); + case VK_UP: return KEYSYM ("up"); + case VK_RIGHT: return KEYSYM ("right"); + case VK_DOWN: return KEYSYM ("down"); + case VK_SELECT: return KEYSYM ("select"); + case VK_PRINT: return KEYSYM ("print"); + case VK_EXECUTE: return KEYSYM ("execute"); + case VK_SNAPSHOT: return KEYSYM ("print"); + case VK_INSERT: return KEYSYM ("insert"); + case VK_HELP: return KEYSYM ("help"); +#if 0 /* XXX What are these supposed to do? */ + 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"); - case VK_NUMPAD3: return KEYSYM ("kp-3"); - case VK_NUMPAD4: return KEYSYM ("kp-4"); - case VK_NUMPAD5: return KEYSYM ("kp-5"); - case VK_NUMPAD6: return KEYSYM ("kp-6"); - case VK_NUMPAD7: return KEYSYM ("kp-7"); - case VK_NUMPAD8: return KEYSYM ("kp-8"); - case VK_NUMPAD9: return KEYSYM ("kp-9"); - case VK_MULTIPLY: return KEYSYM ("kp-multiply"); - case VK_ADD: return KEYSYM ("kp-add"); - case VK_SEPARATOR: return KEYSYM ("kp-separator"); - case VK_SUBTRACT: return KEYSYM ("kp-subtract"); - case VK_DECIMAL: return KEYSYM ("kp-decimal"); - case VK_DIVIDE: return KEYSYM ("kp-divide"); - case VK_F1: return KEYSYM ("f1"); - case VK_F2: return KEYSYM ("f2"); - case VK_F3: return KEYSYM ("f3"); - case VK_F4: return KEYSYM ("f4"); - case VK_F5: return KEYSYM ("f5"); - case VK_F6: return KEYSYM ("f6"); - case VK_F7: return KEYSYM ("f7"); - case VK_F8: return KEYSYM ("f8"); - case VK_F9: return KEYSYM ("f9"); - case VK_F10: return KEYSYM ("f10"); - case VK_F11: return KEYSYM ("f11"); - case VK_F12: return KEYSYM ("f12"); - case VK_F13: return KEYSYM ("f13"); - case VK_F14: return KEYSYM ("f14"); - case VK_F15: return KEYSYM ("f15"); - case VK_F16: return KEYSYM ("f16"); - case VK_F17: return KEYSYM ("f17"); - case VK_F18: return KEYSYM ("f18"); - case VK_F19: return KEYSYM ("f19"); - case VK_F20: return KEYSYM ("f20"); - case VK_F21: return KEYSYM ("f21"); - case VK_F22: return KEYSYM ("f22"); - case VK_F23: return KEYSYM ("f23"); - case VK_F24: return KEYSYM ("f24"); - } - } + case VK_APPS: return KEYSYM ("menu"); + case VK_F1: return KEYSYM ("f1"); + case VK_F2: return KEYSYM ("f2"); + case VK_F3: return KEYSYM ("f3"); + case VK_F4: return KEYSYM ("f4"); + case VK_F5: return KEYSYM ("f5"); + case VK_F6: return KEYSYM ("f6"); + case VK_F7: return KEYSYM ("f7"); + case VK_F8: return KEYSYM ("f8"); + case VK_F9: return KEYSYM ("f9"); + case VK_F10: return KEYSYM ("f10"); + case VK_F11: return KEYSYM ("f11"); + case VK_F12: return KEYSYM ("f12"); + case VK_F13: return KEYSYM ("f13"); + case VK_F14: return KEYSYM ("f14"); + case VK_F15: return KEYSYM ("f15"); + case VK_F16: return KEYSYM ("f16"); + case VK_F17: return KEYSYM ("f17"); + case VK_F18: return KEYSYM ("f18"); + case VK_F19: return KEYSYM ("f19"); + case VK_F20: return KEYSYM ("f20"); + case VK_F21: return KEYSYM ("f21"); + case VK_F22: return KEYSYM ("f22"); + case VK_F23: return KEYSYM ("f23"); + case VK_F24: return KEYSYM ("f24"); + } return Qnil; } @@ -3152,7 +2510,7 @@ static void emacs_mswindows_remove_timeout (int id) { - Lisp_Event match_against; + struct Lisp_Event match_against; Lisp_Object emacs_event; if (KillTimer (NULL, id)) @@ -3188,13 +2546,13 @@ * Return the next event */ static void -emacs_mswindows_next_event (Lisp_Event *emacs_event) +emacs_mswindows_next_event (struct Lisp_Event *emacs_event) { Lisp_Object event, event2; mswindows_need_event (1); - event = mswindows_dequeue_dispatch_event (); + event = mswindows_dequeue_dispatch_event (!NILP(mswindows_u_dispatch_event_queue)); XSETEVENT (event2, emacs_event); Fcopy_event (event, event2); Fdeallocate_event (event); @@ -3204,21 +2562,13 @@ * Handle a magic event off the dispatch queue. */ static void -emacs_mswindows_handle_magic_event (Lisp_Event *emacs_event) +emacs_mswindows_handle_magic_event (struct Lisp_Event *emacs_event) { switch (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event)) { 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: { @@ -3226,19 +2576,18 @@ struct frame *f = XFRAME (frame); int in_p = (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) == WM_SETFOCUS); Lisp_Object conser; - struct gcpro gcpro1; - - /* On focus change, clear all memory of sticky modifiers - to avoid non-intuitive behavior. */ - clear_sticky_modifiers (); + + /* struct gcpro gcpro1; */ + + /* Clear sticky modifiers here (if we had any) */ conser = Fcons (frame, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil)); - GCPRO1 (conser); + /* GCPRO1 (conser); XXX Not necessary? */ 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; @@ -3247,13 +2596,13 @@ case XM_UNMAPFRAME: { Lisp_Object frame = EVENT_CHANNEL (emacs_event); - va_run_hook_with_args (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) + va_run_hook_with_args (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) == XM_MAPFRAME ? - Qmap_frame_hook : Qunmap_frame_hook, + Qmap_frame_hook : Qunmap_frame_hook, 1, frame); } break; - + /* #### What about Enter & Leave */ #if 0 va_run_hook_with_args (in_p ? Qmouse_enter_frame_hook : @@ -3267,7 +2616,7 @@ #ifndef HAVE_MSG_SELECT static HANDLE -get_process_input_waitable (Lisp_Process *process) +get_process_input_waitable (struct Lisp_Process *process) { Lisp_Object instr, outstr, p; XSETPROCESS (p, process); @@ -3278,12 +2627,12 @@ ? 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 } static void -emacs_mswindows_select_process (Lisp_Process *process) +emacs_mswindows_select_process (struct Lisp_Process *process) { HANDLE hev = get_process_input_waitable (process); @@ -3308,7 +2657,7 @@ } static void -emacs_mswindows_unselect_process (Lisp_Process *process) +emacs_mswindows_unselect_process (struct Lisp_Process *process) { /* Process handle is removed in the event loop as soon as it is signaled, so don't bother here about it */ @@ -3342,37 +2691,38 @@ static void emacs_mswindows_quit_p (void) { + MSG msg; + /* Quit cannot happen in modal loop: all program input is dedicated to Windows. */ if (mswindows_in_modal_loop) return; - /* Drain windows queue. This sets up number of quit characters in - the queue */ - mswindows_drain_windows_queue (); + /* Drain windows queue. This sets up number of quit characters in the queue + * (and also processes wm focus change, move, resize, etc messages). + * We don't want to process WM_PAINT messages because this function can be + * called from almost anywhere and the windows' states may be changing. */ + while (PeekMessage (&msg, NULL, 0, WM_PAINT-1, PM_REMOVE) || + PeekMessage (&msg, NULL, WM_PAINT+1, WM_USER-1, PM_REMOVE)) + DispatchMessage (&msg); if (mswindows_quit_chars_count > 0) { /* Yes there's a hidden one... Throw it away */ - Lisp_Event match_against; + struct Lisp_Event match_against; Lisp_Object emacs_event; - int critical_p = 0; match_against.event_type = key_press_event; match_against.event.key.modifiers = FAKE_MOD_QUIT; - while (mswindows_quit_chars_count-- > 0) - { - emacs_event = mswindows_cancel_dispatch_event (&match_against); - assert (!NILP (emacs_event)); - - if (XEVENT(emacs_event)->event.key.modifiers & XEMACS_MOD_SHIFT) - critical_p = 1; - - Fdeallocate_event(emacs_event); - } - - Vquit_flag = critical_p ? Qcritical : Qt; + emacs_event = mswindows_cancel_dispatch_event (&match_against); + assert (!NILP (emacs_event)); + + Vquit_flag = (XEVENT(emacs_event)->event.key.modifiers & MOD_SHIFT + ? Qcritical : Qt); + + Fdeallocate_event(emacs_event); + --mswindows_quit_chars_count; } } @@ -3450,7 +2800,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) @@ -3484,7 +2834,7 @@ If we've still got pointers to it in this file, we're gonna lose hard. */ void -debug_process_finalization (Lisp_Process *p) +debug_process_finalization (struct Lisp_Process *p) { #if 0 /* #### */ Lisp_Object instr, outstr; @@ -3502,17 +2852,26 @@ /************************************************************************/ /* initialization */ /************************************************************************/ - + void -reinit_vars_of_event_mswindows (void) +vars_of_event_mswindows (void) { + mswindows_u_dispatch_event_queue = Qnil; + staticpro (&mswindows_u_dispatch_event_queue); + mswindows_u_dispatch_event_queue_tail = Qnil; + + mswindows_s_dispatch_event_queue = Qnil; + staticpro (&mswindows_s_dispatch_event_queue); + mswindows_s_dispatch_event_queue_tail = Qnil; + + mswindows_error_caught_in_modal_loop = Qnil; + staticpro (&mswindows_error_caught_in_modal_loop); mswindows_in_modal_loop = 0; mswindows_pending_timers_count = 0; 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; @@ -3521,10 +2880,10 @@ mswindows_event_stream->select_console_cb = emacs_mswindows_select_console; mswindows_event_stream->unselect_console_cb = emacs_mswindows_unselect_console; #ifdef HAVE_MSG_SELECT - mswindows_event_stream->select_process_cb = - (void (*)(Lisp_Process*))event_stream_unixoid_select_process; - mswindows_event_stream->unselect_process_cb = - (void (*)(Lisp_Process*))event_stream_unixoid_unselect_process; + mswindows_event_stream->select_process_cb = + (void (*)(struct Lisp_Process*))event_stream_unixoid_select_process; + mswindows_event_stream->unselect_process_cb = + (void (*)(struct Lisp_Process*))event_stream_unixoid_unselect_process; mswindows_event_stream->create_stream_pair_cb = event_stream_unixoid_create_stream_pair; mswindows_event_stream->delete_stream_pair_cb = event_stream_unixoid_delete_stream_pair; #else @@ -3533,50 +2892,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 -} - -void -vars_of_event_mswindows (void) -{ - reinit_vars_of_event_mswindows (); - - mswindows_u_dispatch_event_queue = Qnil; - staticpro (&mswindows_u_dispatch_event_queue); - mswindows_u_dispatch_event_queue_tail = Qnil; - pdump_wire (&mswindows_u_dispatch_event_queue_tail); - - mswindows_s_dispatch_event_queue = Qnil; - staticpro (&mswindows_s_dispatch_event_queue); - mswindows_s_dispatch_event_queue_tail = Qnil; - pdump_wire (&mswindows_s_dispatch_event_queue_tail); - - mswindows_error_caught_in_modal_loop = Qnil; - staticpro (&mswindows_error_caught_in_modal_loop); - - -#ifdef DEBUG_XEMACS - DEFVAR_INT ("mswindows-debug-events", &mswindows_debug_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. -*/ ); - mswindows_debug_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 @@ -3586,8 +2903,8 @@ Default is t on fast machines, nil on slow. */ ); - DEFVAR_INT ("mswindows-mouse-button-tolerance", - &mswindows_mouse_button_tolerance /* +/* The description copied verbatim from nt-emacs. (C) Geoff Voelker */ + 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. @@ -3596,12 +2913,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 @@ -3609,8 +2926,7 @@ 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 @@ -3621,7 +2937,6 @@ mswindows_mouse_button_max_skew_x = 0; mswindows_mouse_button_max_skew_y = 0; mswindows_mouse_button_tolerance = 0; - mswindows_alt_by_itself_activates_menu = 1; } void diff -r 12e008d41344 -r 697ef44129c6 src/event-stream.c --- a/src/event-stream.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 11:20:41 2007 +0200 @@ -23,20 +23,6 @@ /* 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. */ /* @@ -52,6 +38,8 @@ /* 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 <scrollbar-drag> x causes a crash. The command builder should deal only with key and button events. @@ -74,6 +62,14 @@ #include <config.h> #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" @@ -85,7 +81,7 @@ #include "keymap.h" #include "lstream.h" #include "macros.h" /* for defining_keyboard_macro */ -#include "menubar.h" /* #### for evil kludges. */ +#include "opaque.h" #include "process.h" #include "window.h" @@ -106,30 +102,29 @@ Lisp_Object Qundefined_keystroke_sequence; +Lisp_Object Qcommand_execute; + Lisp_Object Qcommand_event_p; /* Hooks to run before and after each command. */ 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; -int modifier_keys_are_sticky; - -#if 0 /* FSF Emacs crap */ +#ifdef ILL_CONCEIVED_HOOK /* 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; @@ -137,7 +132,7 @@ /* Function to call to handle deferred actions, when there are any. */ Lisp_Object Vdeferred_action_function; Lisp_Object Qdeferred_action_function; -#endif /* FSF Emacs crap */ +#endif /* DEFERRED_ACTION_CRAP */ /* Non-nil disable property on a command means do not execute it; call disabled-command-hook's value instead. */ @@ -172,20 +167,13 @@ 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 - last-command for the next command. */ + previous-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; @@ -250,7 +238,29 @@ recent-keys. */ int inhibit_input_event_recording; -Lisp_Object Qself_insert_defer_undo; +/* 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; /* this is in keymap.c */ extern Lisp_Object Fmake_keymap (Lisp_Object name); @@ -279,6 +289,60 @@ /* 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); @@ -321,18 +385,19 @@ XRECORD (x, command_builder, struct command_builder) #define XSETCOMMAND_BUILDER(x, p) XSETRECORD (x, p, command_builder) #define COMMAND_BUILDERP(x) RECORDP (x, command_builder) +#define GC_COMMAND_BUILDERP(x) GC_RECORDP (x, command_builder) #define CHECK_COMMAND_BUILDER(x) CHECK_RECORD (x, command_builder) static Lisp_Object -mark_command_builder (Lisp_Object obj) +mark_command_builder (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct command_builder *builder = XCOMMAND_BUILDER (obj); - mark_object (builder->prefix_events); - mark_object (builder->current_events); - mark_object (builder->most_current_event); - mark_object (builder->last_non_munged_event); - mark_object (builder->munge_me[0].first_mungeable_event); - mark_object (builder->munge_me[1].first_mungeable_event); + markobj (builder->prefix_events); + markobj (builder->current_events); + markobj (builder->most_current_event); + markobj (builder->last_non_munged_event); + markobj (builder->munge_me[0].first_mungeable_event); + markobj (builder->munge_me[1].first_mungeable_event); return builder->console; } @@ -348,7 +413,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("command-builder", command_builder, mark_command_builder, internal_object_printer, - finalize_command_builder, 0, 0, 0, + finalize_command_builder, 0, 0, struct command_builder); static void @@ -444,15 +509,8 @@ 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) +maybe_read_quit_event (struct Lisp_Event *event) { /* A C-g that came from `sigint_happened' will always come from the controlling terminal. If that doesn't exist, however, then the @@ -479,7 +537,7 @@ } void -event_stream_next_event (Lisp_Event *event) +event_stream_next_event (struct Lisp_Event *event) { Lisp_Object event_obj; @@ -523,7 +581,7 @@ } void -event_stream_handle_magic_event (Lisp_Event *event) +event_stream_handle_magic_event (struct Lisp_Event *event) { check_event_stream_ok (EVENT_STREAM_READ); event_stream->handle_magic_event_cb (event); @@ -566,7 +624,7 @@ } void -event_stream_select_process (Lisp_Process *proc) +event_stream_select_process (struct Lisp_Process *proc) { check_event_stream_ok (EVENT_STREAM_PROCESS); if (!get_process_selected_p (proc)) @@ -577,7 +635,7 @@ } void -event_stream_unselect_process (Lisp_Process *proc) +event_stream_unselect_process (struct Lisp_Process *proc) { check_event_stream_ok (EVENT_STREAM_PROCESS); if (get_process_selected_p (proc)) @@ -678,10 +736,7 @@ if (minibuf_level == 0 && echo_keystrokes > 0.0 -#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) - && !x_kludge_lw_menu_active () -#endif - ) + && !lw_menu_active) { if (!no_snooze) { @@ -744,7 +799,7 @@ } else if (CHARP (traduit)) { - Lisp_Event ev2; + struct Lisp_Event ev2; /* This used to call Fcharacter_to_event() directly into EVENT, but that can eradicate timestamps and other such stuff. @@ -930,7 +985,7 @@ used to indicate an absence of a timer. */ static int low_level_timeout_id_tick; -static struct low_level_timeout_blocktype +struct low_level_timeout_blocktype { Blocktype_declare (struct low_level_timeout); } *the_low_level_timeout_blocktype; @@ -1046,40 +1101,38 @@ static int timeout_id_tick; +/* Since timeout structures contain Lisp_Objects, they need to be GC'd + properly. The opaque data type provides a convenient way of doing + this without having to create a new Lisp object, since we can + provide our own mark function. */ + +struct timeout +{ + int id; /* Id we use to identify the timeout over its lifetime */ + int interval_id; /* Id for this particular interval; this may + be different each time the timeout is + signalled.*/ + Lisp_Object function, object; /* Function and object associated + with timeout. */ + EMACS_TIME next_signal_time; /* Absolute time when the timeout + is next going to be signalled. */ + unsigned int resignal_msecs; /* How far after the next timeout + should the one after that + occur? */ +}; + static Lisp_Object pending_timeout_list, pending_async_timeout_list; static Lisp_Object Vtimeout_free_list; static Lisp_Object -mark_timeout (Lisp_Object obj) +mark_timeout (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Timeout *tm = XTIMEOUT (obj); - mark_object (tm->function); + struct timeout *tm = (struct timeout *) XOPAQUE_DATA (obj); + markobj (tm->function); return tm->object; } -/* Should never, ever be called. (except by an external debugger) */ -static void -print_timeout (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - const Lisp_Timeout *t = XTIMEOUT (obj); - char buf[64]; - - sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (timeout) 0x%lx>", - (unsigned long) t); - write_c_string (buf, printcharfun); -} - -static const struct lrecord_description timeout_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Timeout, function) }, - { XD_LISP_OBJECT, offsetof (Lisp_Timeout, object) }, - { XD_END } -}; - -DEFINE_LRECORD_IMPLEMENTATION ("timeout", timeout, - mark_timeout, print_timeout, - 0, 0, 0, timeout_description, Lisp_Timeout); - /* Generate a timeout and return its ID. */ int @@ -1088,8 +1141,8 @@ Lisp_Object function, Lisp_Object object, int async_p) { - Lisp_Object op = allocate_managed_lcrecord (Vtimeout_free_list); - Lisp_Timeout *timeout = XTIMEOUT (op); + Lisp_Object op = allocate_managed_opaque (Vtimeout_free_list, 0); + struct timeout *timeout = (struct timeout *) XOPAQUE_DATA (op); EMACS_TIME current_time; EMACS_TIME interval; @@ -1138,7 +1191,7 @@ Lisp_Object *function, Lisp_Object *object) { Lisp_Object op = Qnil, rest; - Lisp_Timeout *timeout; + struct timeout *timeout; Lisp_Object *timeout_list; struct gcpro gcpro1; int id; @@ -1151,16 +1204,16 @@ /* Find the timeout on the list of pending ones. */ LIST_LOOP (rest, *timeout_list) { - timeout = XTIMEOUT (XCAR (rest)); + timeout = (struct timeout *) XOPAQUE_DATA (XCAR (rest)); if (timeout->interval_id == interval_id) break; } assert (!NILP (rest)); op = XCAR (rest); - timeout = XTIMEOUT (op); + timeout = (struct timeout *) XOPAQUE_DATA (op); /* We make sure to snarf the data out of the timeout object before - we free it with free_managed_lcrecord(). */ + we free it with free_managed_opaque(). */ id = timeout->id; *function = timeout->function; *object = timeout->object; @@ -1202,7 +1255,7 @@ *timeout_list = noseeum_cons (op, *timeout_list); } else - free_managed_lcrecord (Vtimeout_free_list, op); + free_managed_opaque (Vtimeout_free_list, op); UNGCPRO; return id; @@ -1211,7 +1264,7 @@ void event_stream_disable_wakeup (int id, int async_p) { - Lisp_Timeout *timeout = 0; + struct timeout *timeout = 0; Lisp_Object rest; Lisp_Object *timeout_list; @@ -1223,7 +1276,7 @@ /* Find the timeout on the list of pending ones, if it's still there. */ LIST_LOOP (rest, *timeout_list) { - timeout = XTIMEOUT (XCAR (rest)); + timeout = (struct timeout *) XOPAQUE_DATA (XCAR (rest)); if (timeout->id == id) break; } @@ -1239,14 +1292,14 @@ event_stream_remove_async_timeout (timeout->interval_id); else event_stream_remove_timeout (timeout->interval_id); - free_managed_lcrecord (Vtimeout_free_list, op); + free_managed_opaque (Vtimeout_free_list, op); } } static int event_stream_wakeup_pending_p (int id, int async_p) { - Lisp_Timeout *timeout; + struct timeout *timeout; Lisp_Object rest; Lisp_Object timeout_list; int found = 0; @@ -1260,7 +1313,7 @@ /* Find the element on the list of pending ones, if it's still there. */ LIST_LOOP (rest, timeout_list) { - timeout = XTIMEOUT (XCAR (rest)); + timeout = (struct timeout *) XOPAQUE_DATA (XCAR (rest)); if (timeout->id == id) { found = 1; @@ -1963,7 +2016,7 @@ } else { - Lisp_Event *e = XEVENT (target_event); + struct Lisp_Event *e = XEVENT (target_event); /* The command_event_queue was empty. Wait for an event. */ event_stream_next_event (e); @@ -2070,6 +2123,9 @@ 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. @@ -2345,56 +2401,6 @@ 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) { @@ -3032,7 +3038,7 @@ case timeout_event: { - Lisp_Event *e = XEVENT (event); + struct Lisp_Event *e = XEVENT (event); if (!NILP (e->event.timeout.function)) call1 (e->event.timeout.function, e->event.timeout.object); @@ -3090,6 +3096,514 @@ return event_binding (event0, 1); } +#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) +static void +menu_move_up (void) +{ + widget_value *current, *prev; + widget_value *entries; + + current = lw_get_entries (False); + entries = lw_get_entries (True); + prev = NULL; + if (current != entries) + { + 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; + widget_value *new; + + current = lw_get_entries (False); + 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) + { + --level; + 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) + { + --level; + 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. */ @@ -3211,11 +3725,9 @@ return Qnil; } - /* if we're currently in a menu accelerator, check there for further - events */ - /* #### fuck me! who wrote this crap? think "abstraction", baby. */ + /* if we're currently in a menu accelerator, check there for further events */ #if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) - if (x_kludge_lw_menu_active ()) + if (lw_menu_active) { return command_builder_operate_menu_accelerator (builder); } @@ -3266,14 +3778,14 @@ Lisp_Object terminal = builder->most_current_event; struct key_data* key = & XEVENT (terminal)->event.key; Emchar c = 0; - if ((key->modifiers & XEMACS_MOD_SHIFT) + if ((key->modifiers & 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 & XEMACS_MOD_SHIFT) - key->modifiers &= (~ XEMACS_MOD_SHIFT); + struct Lisp_Event terminal_copy = *XEVENT (terminal); + + if (key->modifiers & MOD_SHIFT) + key->modifiers &= (~ MOD_SHIFT); else key->keysym = make_char (c + 'a' - 'A'); @@ -3663,7 +4175,7 @@ if (EVENTP (recent) && event_matches_key_specifier_p (XEVENT (recent), Vmeta_prefix_char)) { - Lisp_Event *e; + struct Lisp_Event *e; /* When we see a sequence like "ESC x", pretend we really saw "M-x". DoubleThink the recent-keys and this-command-keys as well. */ @@ -3674,10 +4186,10 @@ Fcopy_event (event, recent); e = XEVENT (recent); if (e->event_type == key_press_event) - e->event.key.modifiers |= XEMACS_MOD_META; + e->event.key.modifiers |= MOD_META; else if (e->event_type == button_press_event || e->event_type == button_release_event) - e->event.button.modifiers |= XEMACS_MOD_META; + e->event.button.modifiers |= MOD_META; else abort (); @@ -3708,11 +4220,7 @@ if (KEYMAPP (leaf)) { -#if defined (HAVE_X_WINDOWS) && defined (LWLIB_MENUBARS_LUCID) - if (!x_kludge_lw_menu_active ()) -#else - if (1) -#endif + if (!lw_menu_active) { Lisp_Object prompt = Fkeymap_prompt (leaf, Qt); if (STRINGP (prompt)) @@ -3732,20 +4240,19 @@ 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); + struct 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)) { @@ -3864,9 +4371,6 @@ { /* 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); @@ -3887,9 +4391,6 @@ 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. */ @@ -3909,18 +4410,14 @@ 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, + /* ### This doesn't really fix the problem, if delete-frame is called by some hook */ if (NILP (win)) return; - - /* This is a kludge, but necessary; see simple.el */ - call0 (Qhandle_post_motion_command); +#endif if (! zmacs_region_stays && (!MINI_WINDOW_P (XWINDOW (win)) @@ -3933,10 +4430,12 @@ ("Error in `post-command-hook' (setting hook to nil)", Qpost_command_hook, 1); -#if 0 /* FSF Emacs crap */ +#ifdef DEFERRED_ACTION_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) @@ -3945,9 +4444,9 @@ safe_run_hook_trapping_errors ("Error in `post-command-idle-hook' (setting hook to nil)", Qpost_command_idle_hook, 1); -#endif /* FSF Emacs crap */ - -#if 0 /* FSF Emacs */ +#endif + +#if 0 /* FSFmacs */ if (!NILP (current_buffer->mark_active)) { if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) @@ -3959,7 +4458,7 @@ BUF_MODIFF (current_buffer) != prev_modiff) run_hook (intern ("activate-mark-hook")); } -#endif /* FSF Emacs */ +#endif /* FSFmacs */ /* #### Kludge!!! This is necessary to make sure that things are properly positioned even if post-command-hook moves point. @@ -3993,7 +4492,7 @@ { /* This function can GC */ struct command_builder *command_builder; - Lisp_Event *ev; + struct Lisp_Event *ev; Lisp_Object console; Lisp_Object channel; @@ -4107,35 +4606,15 @@ } else /* key sequence is bound to a command */ { - int magic_undo = 0; - int magic_undo_count = 20; - Vthis_command = leaf; - /* Don't push an undo boundary if the command set the prefix arg, or if we are executing a keyboard macro, or if in the minibuffer. If the command we are about to execute is self-insert, it's tricky: up to 20 consecutive self-inserts may 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-defer-undo' - property to install that behavior on functions other - than `self-insert-command', or to change the magic - number 20 to something else. #### DOCUMENT THIS! */ - - if (SYMBOLP (leaf)) - { - Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil); - if (NATNUMP (prop)) - magic_undo = 1, magic_undo_count = XINT (prop); - else if (!NILP (prop)) - magic_undo = 1; - else if (EQ (leaf, Qself_insert_command)) - magic_undo = 1; - } - - if (!magic_undo) + */ + if (! EQ (leaf, Qself_insert_command)) command_builder->self_insert_countdown = 0; if (NILP (XCONSOLE (console)->prefix_arg) && NILP (Vexecuting_macro) @@ -4149,10 +4628,10 @@ && command_builder->self_insert_countdown == 0) Fundo_boundary (); - if (magic_undo) + if (EQ (leaf, Qself_insert_command)) { if (--command_builder->self_insert_countdown < 0) - command_builder->self_insert_countdown = magic_undo_count; + command_builder->self_insert_countdown = 20; } execute_command_event (command_builder, @@ -4338,7 +4817,7 @@ Calling this function directs the translated event to replace the original event, so that only one version of the event actually -appears in the echo area and in the value of `this-command-keys'. +appears in the echo area and in the value of `this-command-keys.'. */ ()) { @@ -4362,7 +4841,9 @@ { Emchar ch = XCHAR (keysym); Bufbyte str[MAX_EMCHAR_LEN]; - Bytecount len = set_charptr_emchar (str, ch); + Bytecount len; + + len = set_charptr_emchar (str, ch); Lstream_write (XLSTREAM (Vdribble_file), str, len); } else if (string_char_length (XSYMBOL (keysym)->name) == 1) @@ -4423,14 +4904,12 @@ 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); + defsymbol (&Qcommand_execute, "command-execute"); DEFSUBR (Frecent_keys); DEFSUBR (Frecent_keys_ring_size); @@ -4448,21 +4927,23 @@ 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 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"); - defsymbol (&Qhandle_pre_motion_command, "handle-pre-motion-command"); - defsymbol (&Qhandle_post_motion_command, "handle-post-motion-command"); -#if 0 /* FSF Emacs crap */ +#ifdef ILL_CONCEIVED_HOOK 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, @@ -4470,41 +4951,37 @@ defsymbol (&Qauto_show_make_point_visible, "auto-show-make-point-visible"); - defsymbol (&Qself_insert_defer_undo, "self-insert-defer-undo"); + 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 (&Qcancel_mode_internal, "cancel-mode-internal"); } void -reinit_vars_of_event_stream (void) -{ - recent_keys_ring_index = 0; - recent_keys_ring_size = 100; - num_input_chars = 0; - Vtimeout_free_list = make_lcrecord_list (sizeof (Lisp_Timeout), - &lrecord_timeout); - staticpro_nodump (&Vtimeout_free_list); - the_low_level_timeout_blocktype = - Blocktype_new (struct low_level_timeout_blocktype); - something_happened = 0; - recursive_sit_for = Qnil; -} - -void vars_of_event_stream (void) { - reinit_vars_of_event_stream (); + recent_keys_ring_index = 0; + recent_keys_ring_size = 100; Vrecent_keys_ring = Qnil; staticpro (&Vrecent_keys_ring); Vthis_command_keys = Qnil; staticpro (&Vthis_command_keys); Vthis_command_keys_tail = Qnil; - pdump_wire (&Vthis_command_keys_tail); + + num_input_chars = 0; command_event_queue = Qnil; staticpro (&command_event_queue); command_event_queue_tail = Qnil; - pdump_wire (&command_event_queue_tail); Vlast_selected_frame = Qnil; staticpro (&Vlast_selected_frame); @@ -4515,9 +4992,20 @@ pending_async_timeout_list = Qnil; staticpro (&pending_async_timeout_list); + Vtimeout_free_list = make_opaque_list (sizeof (struct timeout), + mark_timeout); + staticpro (&Vtimeout_free_list); + + the_low_level_timeout_blocktype = + Blocktype_new (struct low_level_timeout_blocktype); + + something_happened = 0; + last_point_position_buffer = Qnil; staticpro (&last_point_position_buffer); + recursive_sit_for = Qnil; + DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /* *Nonzero means echo unfinished commands after this many seconds of pause. */ ); @@ -4563,7 +5051,7 @@ */ ); focus_follows_mouse = 0; -#if 0 /* FSF Emacs crap */ +#ifdef ILL_CONCEIVED_HOOK /* 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. */ @@ -4580,7 +5068,9 @@ 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'. */ @@ -4596,7 +5086,7 @@ whenever `deferred-action-list' is non-nil. */ ); Vdeferred_action_function = Qnil; -#endif /* FSF Emacs crap */ +#endif /* DEFERRED_ACTION_CRAP */ DEFVAR_LISP ("last-command-event", &Vlast_command_event /* Last keyboard or mouse button event that was part of a command. This @@ -4686,23 +5176,6 @@ */ ); 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. @@ -4756,15 +5229,6 @@ */ ); 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 /* @@ -4825,6 +5289,41 @@ 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 @@ -4832,6 +5331,41 @@ { 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 12e008d41344 -r 697ef44129c6 src/event-tty.c --- a/src/event-tty.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/event-tty.c Mon Aug 13 11:20:41 2007 +0200 @@ -64,7 +64,7 @@ } static void -tty_timeout_to_emacs_event (Lisp_Event *emacs_event) +tty_timeout_to_emacs_event (struct Lisp_Event *emacs_event) { emacs_event->event_type = timeout_event; /* timeout events have nil as channel */ @@ -112,7 +112,7 @@ } static void -emacs_tty_next_event (Lisp_Event *emacs_event) +emacs_tty_next_event (struct Lisp_Event *emacs_event) { while (1) { @@ -156,7 +156,8 @@ if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &process_only_mask)) { Lisp_Object process; - Lisp_Process *p = get_process_from_usid (FD_TO_USID(i)); + struct Lisp_Process *p = + get_process_from_usid (FD_TO_USID(i)); assert (p); XSETPROCESS (process, p); @@ -187,20 +188,20 @@ } static void -emacs_tty_handle_magic_event (Lisp_Event *emacs_event) +emacs_tty_handle_magic_event (struct Lisp_Event *emacs_event) { /* Nothing to do currently */ } static void -emacs_tty_select_process (Lisp_Process *process) +emacs_tty_select_process (struct Lisp_Process *process) { event_stream_unixoid_select_process (process); } static void -emacs_tty_unselect_process (Lisp_Process *process) +emacs_tty_unselect_process (struct Lisp_Process *process) { event_stream_unixoid_unselect_process (process); } @@ -244,12 +245,11 @@ /************************************************************************/ void -reinit_vars_of_event_tty (void) +vars_of_event_tty (void) { 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; @@ -264,12 +264,6 @@ } void -vars_of_event_tty (void) -{ - reinit_vars_of_event_tty (); -} - -void init_event_tty_late (void) { event_stream = tty_event_stream; diff -r 12e008d41344 -r 697ef44129c6 src/event-unixoid.c --- a/src/event-unixoid.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/event-unixoid.c Mon Aug 13 11:20:41 2007 +0200 @@ -41,6 +41,10 @@ #include "sysproc.h" /* select stuff */ #include "systime.h" +#ifdef HAVE_GPM +#include "gpmevent.h" +#endif + /* Mask of bits indicating the descriptors that we wait for input on. These work as follows: @@ -71,7 +75,7 @@ int fake_event_occurred; int -read_event_from_tty_or_stream_desc (Lisp_Event *event, +read_event_from_tty_or_stream_desc (struct Lisp_Event *event, struct console *con, int fd) { unsigned char ch; @@ -80,6 +84,12 @@ XSETCONSOLE (console, con); +#ifdef HAVE_GPM + if (fd == CONSOLE_TTY_MOUSE_FD (con)) { + return handle_gpm_read (event,con,fd); + } +#endif + nread = read (fd, &ch, 1); if (nread <= 0) { @@ -174,7 +184,7 @@ } static int -get_process_infd (Lisp_Process *p) +get_process_infd (struct Lisp_Process *p) { Lisp_Object instr, outstr; get_process_streams (p, &instr, &outstr); @@ -183,7 +193,7 @@ } int -event_stream_unixoid_select_process (Lisp_Process *proc) +event_stream_unixoid_select_process (struct Lisp_Process *proc) { int infd = get_process_infd (proc); @@ -194,7 +204,7 @@ } int -event_stream_unixoid_unselect_process (Lisp_Process *proc) +event_stream_unixoid_unselect_process (struct Lisp_Process *proc) { int infd = get_process_infd (proc); @@ -225,7 +235,7 @@ { /* Something went seriously wrong; don't abort since maybe the TTY just died at the wrong time. */ - stderr_out ("xemacs: select failed: errno = %d\n", errno); + fprintf (stderr, "xemacs: select failed: errno = %d\n", errno); return 0; } /* else, we got interrupted by a signal, so try again. */ diff -r 12e008d41344 -r 697ef44129c6 src/events-mod.h --- a/src/events-mod.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/events-mod.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,8 @@ /* The modifiers XEmacs knows about; these appear in key and button events. */ -#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 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 */ diff -r 12e008d41344 -r 697ef44129c6 src/events.c --- a/src/events.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/events.c Mon Aug 13 11:20:41 2007 +0200 @@ -37,6 +37,17 @@ #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. @@ -70,51 +81,51 @@ deinitialize_event (Lisp_Object ev) { int i; - Lisp_Event *event = XEVENT (ev); + struct Lisp_Event *event = XEVENT (ev); - for (i = 0; i < (int) (sizeof (Lisp_Event) / sizeof (int)); i++) + for (i = 0; i < (int) (sizeof (struct Lisp_Event) / sizeof (int)); i++) ((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); } /* Set everything to zero or nil so that it's predictable. */ void -zero_event (Lisp_Event *e) +zero_event (struct 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; } static Lisp_Object -mark_event (Lisp_Object obj) +mark_event (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Event *event = XEVENT (obj); + struct Lisp_Event *event = XEVENT (obj); switch (event->event_type) { case key_press_event: - mark_object (event->event.key.keysym); + markobj (event->event.key.keysym); break; case process_event: - mark_object (event->event.process.process); + markobj (event->event.process.process); break; case timeout_event: - mark_object (event->event.timeout.function); - mark_object (event->event.timeout.object); + markobj (event->event.timeout.function); + markobj (event->event.timeout.object); break; case eval_event: case misc_user_event: - mark_object (event->event.eval.function); - mark_object (event->event.eval.object); + markobj (event->event.eval.function); + markobj (event->event.eval.object); break; case magic_eval_event: - mark_object (event->event.magic_eval.object); + markobj (event->event.magic_eval.object); break; case button_press_event: case button_release_event: @@ -126,12 +137,12 @@ default: abort (); } - mark_object (event->channel); + markobj (event->channel); return event->next; } 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); @@ -210,8 +221,8 @@ static int event_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Event *e1 = XEVENT (obj1); - Lisp_Event *e2 = XEVENT (obj2); + struct Lisp_Event *e1 = XEVENT (obj1); + struct Lisp_Event *e2 = XEVENT (obj2); if (e1->event_type != e2->event_type) return 0; if (!EQ (e1->channel, e2->channel)) return 0; @@ -282,9 +293,8 @@ if (CONSOLE_MSWINDOWS_P (con)) return (!memcmp(&e1->event.magic.underlying_mswindows_event, &e2->event.magic.underlying_mswindows_event, - sizeof (union magic_data))); + sizeof(union magic_data))); #endif - abort (); return 1; /* not reached */ } @@ -297,7 +307,7 @@ static unsigned long event_hash (Lisp_Object obj, int depth) { - Lisp_Event *e = XEVENT (obj); + struct Lisp_Event *e = XEVENT (obj); unsigned long hash; hash = HASH2 (e->event_type, LISP_HASH (e->channel)); @@ -350,8 +360,6 @@ if (CONSOLE_MSWINDOWS_P (con)) return HASH2 (hash, e->event.magic.underlying_mswindows_event); #endif - abort (); - return 0; } case empty_event: @@ -367,7 +375,7 @@ DEFINE_BASIC_LRECORD_IMPLEMENTATION ("event", event, mark_event, print_event, 0, event_equal, - event_hash, 0, Lisp_Event); + event_hash, struct Lisp_Event); DEFUN ("make-event", Fmake_event, 0, 2, 0, /* @@ -420,7 +428,7 @@ { Lisp_Object tail, keyword, value; Lisp_Object event = Qnil; - Lisp_Event *e; + struct Lisp_Event *e; EMACS_INT coord_x = 0, coord_y = 0; struct gcpro gcpro1; @@ -540,13 +548,13 @@ 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; + 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); } @@ -755,7 +763,7 @@ Make a copy of the given event object. If a second argument is given, the first event is copied into the second and the second is returned. If the second argument is not supplied (or -is nil) then a new event will be made as with `make-event'. See also +is nil) then a new event will be made as with `allocate-event.' See also the function `deallocate-event'. */ (event1, event2)) @@ -763,26 +771,19 @@ CHECK_LIVE_EVENT (event1); if (NILP (event2)) event2 = Fmake_event (Qnil, Qnil); - else - { - CHECK_LIVE_EVENT (event2); - if (EQ (event1, event2)) - return signal_simple_continuable_error_2 - ("copy-event called with `eq' events", event1, event2); - } + else CHECK_LIVE_EVENT (event2); + if (EQ (event1, event2)) + return signal_simple_continuable_error_2 + ("copy-event called with `eq' events", event1, event2); assert (XEVENT_TYPE (event1) <= last_event_type); assert (XEVENT_TYPE (event2) <= last_event_type); { - Lisp_Event *ev2 = XEVENT (event2); - Lisp_Event *ev1 = XEVENT (event1); + Lisp_Object save_next = XEVENT_NEXT (event2); - ev2->event_type = ev1->event_type; - ev2->channel = ev1->channel; - ev2->timestamp = ev1->timestamp; - ev2->event = ev1->event; - + *XEVENT (event2) = *XEVENT (event1); + XSET_EVENT_NEXT (event2, save_next); return event2; } } @@ -962,11 +963,11 @@ void -character_to_event (Emchar c, Lisp_Event *event, struct console *con, +character_to_event (Emchar c, struct Lisp_Event *event, struct console *con, int use_console_meta_flag, int do_backspace_mapping) { Lisp_Object k = Qnil; - int m = 0; + unsigned int m = 0; if (event->event_type == dead_event) error ("character-to-event called with a deallocated event!"); @@ -985,21 +986,21 @@ break; case 1: /* top bit is meta */ c -= 128; - m = XEMACS_MOD_META; + m = MOD_META; break; default: /* this is a real character */ break; } } - if (c < ' ') c += '@', m |= XEMACS_MOD_CONTROL; - if (m & XEMACS_MOD_CONTROL) + if (c < ' ') c += '@', m |= MOD_CONTROL; + if (m & MOD_CONTROL) { switch (c) { - 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; + 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; default: #if defined(HAVE_TTY) if (do_backspace_mapping && @@ -1007,9 +1008,9 @@ c - '@' == XCHAR (con->tty_erase_char)) { k = QKbackspace; - m &= ~XEMACS_MOD_CONTROL; + m &= ~MOD_CONTROL; } -#endif /* defined(HAVE_TTY) && !defined(CYGWIN) */ +#endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ break; } if (c >= 'A' && c <= 'Z') c -= 'A'-'a'; @@ -1018,7 +1019,7 @@ else if (do_backspace_mapping && CHARP (con->tty_erase_char) && c == XCHAR (con->tty_erase_char)) k = QKbackspace; -#endif /* defined(HAVE_TTY) && !defined(CYGWIN) */ +#endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ else if (c == 127) k = QKdelete; else if (c == ' ') @@ -1031,18 +1032,17 @@ event->event.key.modifiers = m; } + /* This variable controls what character name -> character code mapping we are using. Window-system-specific code sets this to some symbol, and we use that symbol as the plist key to convert keysyms into 8-bit codes. In this way one can have several character sets predefined and switch them by changing this. - - #### This is utterly bogus and should be removed. */ Lisp_Object Vcharacter_set_property; Emchar -event_to_character (Lisp_Event *event, +event_to_character (struct Lisp_Event *event, int allow_extra_modifiers, int allow_meta, int allow_non_ascii) @@ -1052,11 +1052,11 @@ if (event->event_type != key_press_event) { - assert (event->event_type != dead_event); + if (event->event_type == dead_event) abort (); return -1; } if (!allow_extra_modifiers && - event->event.key.modifiers & (XEMACS_MOD_SUPER|XEMACS_MOD_HYPER|XEMACS_MOD_ALT)) + event->event.key.modifiers & (MOD_SUPER|MOD_HYPER|MOD_ALT)) return -1; if (CHAR_OR_CHAR_INTP (event->event.key.keysym)) c = XCHAR_OR_CHAR_INT (event->event.key.keysym); @@ -1075,7 +1075,7 @@ else return -1; - if (event->event.key.modifiers & XEMACS_MOD_CONTROL) + if (event->event.key.modifiers & MOD_CONTROL) { if (c >= 'a' && c <= 'z') c -= ('a' - 'A'); @@ -1093,7 +1093,7 @@ if (! allow_extra_modifiers) return -1; } - if (event->event.key.modifiers & XEMACS_MOD_META) + if (event->event.key.modifiers & MOD_META) { if (! allow_meta) return -1; if (c & 0200) return -1; /* don't allow M-oslash (overlap) */ @@ -1219,7 +1219,7 @@ } void -format_event_object (char *buf, Lisp_Event *event, int brief) +format_event_object (char *buf, struct Lisp_Event *event, int brief) { int mouse_p = 0; int mod = 0; @@ -1233,13 +1233,13 @@ key = event->event.key.keysym; /* Hack. */ if (! brief && CHARP (key) && - mod & (XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER)) + mod & (MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER)) { int k = XCHAR (key); if (k >= 'a' && k <= 'z') key = make_char (k - ('a' - 'A')); else if (k >= 'A' && k <= 'Z') - mod |= XEMACS_MOD_SHIFT; + mod |= MOD_SHIFT; } break; } @@ -1255,7 +1255,7 @@ } case magic_event: { - const char *name = NULL; + CONST char *name = NULL; #ifdef HAVE_X_WINDOWS { @@ -1281,12 +1281,12 @@ } #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 & 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 (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 (mouse_p) { modprint1 ("button"); @@ -1303,7 +1303,7 @@ } else if (SYMBOLP (key)) { - const char *str = 0; + CONST char *str = 0; if (brief) { if (EQ (key, QKlinefeed)) str = "LFD"; @@ -1322,7 +1322,7 @@ } else { - Lisp_String *name = XSYMBOL (key)->name; + struct Lisp_String *name = XSYMBOL (key)->name; memcpy (buf, string_data (name), string_length (name) + 1); str += string_length (name); } @@ -1358,7 +1358,7 @@ */ (event)) { - Lisp_Event *e; + struct Lisp_Event *e; CHECK_LIVE_EVENT (event); return XEVENT_NEXT (event); @@ -1543,12 +1543,12 @@ { int mod = XINT (Fevent_modifier_bits (event)); Lisp_Object result = Qnil; - 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 & 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; } @@ -2098,7 +2098,7 @@ (event)) { Lisp_Object props = Qnil; - Lisp_Event *e; + struct Lisp_Event *e; struct gcpro gcpro1; CHECK_LIVE_EVENT (event); @@ -2177,8 +2177,6 @@ void syms_of_events (void) { - INIT_LRECORD_IMPLEMENTATION (event); - DEFSUBR (Fcharacter_to_event); DEFSUBR (Fevent_to_character); @@ -2231,28 +2229,11 @@ defsymbol (&Qbutton_release, "button-release"); defsymbol (&Qmisc_user, "misc-user"); defsymbol (&Qascii_character, "ascii-character"); - - defsymbol (&QKbackspace, "backspace"); - defsymbol (&QKtab, "tab"); - defsymbol (&QKlinefeed, "linefeed"); - defsymbol (&QKreturn, "return"); - defsymbol (&QKescape, "escape"); - defsymbol (&QKspace, "space"); - defsymbol (&QKdelete, "delete"); -} - - -void -reinit_vars_of_events (void) -{ - Vevent_resource = Qnil; } void vars_of_events (void) { - reinit_vars_of_events (); - DEFVAR_LISP ("character-set-property", &Vcharacter_set_property /* A symbol used to look up the 8-bit character of a keysym. To convert a keysym symbol to an 8-bit code, as when that key is @@ -2262,4 +2243,22 @@ variable. */ ); Vcharacter_set_property = Qnil; + + Vevent_resource = Qnil; + + QKbackspace = KEYSYM ("backspace"); + QKtab = KEYSYM ("tab"); + QKlinefeed = KEYSYM ("linefeed"); + QKreturn = KEYSYM ("return"); + QKescape = KEYSYM ("escape"); + QKspace = KEYSYM ("space"); + QKdelete = KEYSYM ("delete"); + + staticpro (&QKbackspace); + staticpro (&QKtab); + staticpro (&QKlinefeed); + staticpro (&QKreturn); + staticpro (&QKescape); + staticpro (&QKspace); + staticpro (&QKdelete); } diff -r 12e008d41344 -r 697ef44129c6 src/events.h --- a/src/events.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/events.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_events_h_ -#define INCLUDED_events_h_ +#ifndef _XEMACS_EVENTS_H_ +#define _XEMACS_EVENTS_H_ #include "systime.h" @@ -40,8 +40,7 @@ multiple heterogeneous machines, X11 and SunView, or X11 and NeXT, for example, then it will be necessary to construct an event_stream structure that can cope with the given types. Currently, the only implemented - event_streams are for dumb-ttys, and for X11 plus dumb-ttys, - and for mswindows. + event_streams are for dumb-ttys, and for X11 plus dumb-ttys. To implement this for one window system is relatively simple. To implement this for multiple window systems is trickier and may @@ -276,9 +275,9 @@ The Create stream pair function is passed two void* values, which identify process-dependent 'handles'. The process implementation uses these handles to communicate with child processes. The function must be prepared to receive - handle types of any process implementation. Since only one process + handle types of any process implementation. Since there only one process implementation exists in a particular XEmacs configuration, preprocessing - is a means of compiling in the support for the code which deals with particular + is a mean of compiling in the support for the code which deals with particular handle types. For example, a unixoid type loop, which relies on file descriptors, may be @@ -317,19 +316,21 @@ #define USID_DONTHASH ((USID)0) +struct Lisp_Event; +struct Lisp_Process; + struct event_stream { int (*event_pending_p) (int); - void (*next_event_cb) (Lisp_Event *); - void (*handle_magic_event_cb) (Lisp_Event *); + void (*next_event_cb) (struct Lisp_Event *); + void (*handle_magic_event_cb) (struct Lisp_Event *); int (*add_timeout_cb) (EMACS_TIME); void (*remove_timeout_cb) (int); void (*select_console_cb) (struct console *); void (*unselect_console_cb) (struct console *); - void (*select_process_cb) (Lisp_Process *); - void (*unselect_process_cb) (Lisp_Process *); + void (*select_process_cb) (struct Lisp_Process *); + void (*unselect_process_cb) (struct 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 */, @@ -367,20 +368,20 @@ struct key_data { Lisp_Object keysym; - int modifiers; + unsigned char modifiers; }; struct button_data { int button; - int modifiers; + unsigned char modifiers; int x, y; }; struct motion_data { int x, y; - int modifiers; + unsigned char modifiers; }; struct process_data @@ -407,7 +408,7 @@ Lisp_Object function; Lisp_Object object; int button; - int modifiers; + unsigned char modifiers; int x, y; }; @@ -434,30 +435,6 @@ #endif }; -struct Lisp_Timeout -{ - struct lcrecord_header header; - int id; /* Id we use to identify the timeout over its lifetime */ - int interval_id; /* Id for this particular interval; this may - be different each time the timeout is - signalled.*/ - Lisp_Object function, object; /* Function and object associated - with timeout. */ - EMACS_TIME next_signal_time; /* Absolute time when the timeout - is next going to be signalled. */ - unsigned int resignal_msecs; /* How far after the next timeout - should the one after that - occur? */ -}; -typedef struct Lisp_Timeout Lisp_Timeout; - -DECLARE_LRECORD (timeout, Lisp_Timeout); -#define XTIMEOUT(x) XRECORD (x, timeout, Lisp_Timeout) -#define XSETTIMEOUT(x, p) XSETRECORD (x, p, timeout) -#define TIMEOUTP(x) RECORDP (x, timeout) -#define CHECK_TIMEOUT(x) CHECK_RECORD (x, timeout) -#define CONCHECK_TIMEOUT(x) CONCHECK_RECORD (x, timeout) - struct Lisp_Event { /* header->next (aka XEVENT_NEXT ()) is used as follows: @@ -485,10 +462,11 @@ } event; }; -DECLARE_LRECORD (event, Lisp_Event); -#define XEVENT(x) XRECORD (x, event, Lisp_Event) +DECLARE_LRECORD (event, struct Lisp_Event); +#define XEVENT(x) XRECORD (x, event, struct Lisp_Event) #define XSETEVENT(x, p) XSETRECORD (x, p, event) #define EVENTP(x) RECORDP (x, event) +#define GC_EVENTP(x) GC_RECORDP (x, event) #define CHECK_EVENT(x) CHECK_RECORD (x, event) #define CONCHECK_EVENT(x) CONCHECK_RECORD (x, event) @@ -533,9 +511,9 @@ extern Lisp_Object QKspace, QKtab, Qmouse_event_p, Vcharacter_set_property; extern Lisp_Object Qcancel_mode_internal; -/* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key if there are +/* Note: under X Windows, 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 - XEMACS_MOD_META instead. + MOD_META instead. */ #ifdef emacs @@ -543,12 +521,12 @@ #define KEYSYM(x) (intern (x)) /* from events.c */ -void format_event_object (char *buf, Lisp_Event *e, int brief); -void character_to_event (Emchar c, Lisp_Event *event, +void format_event_object (char *buf, struct Lisp_Event *e, int brief); +void character_to_event (Emchar c, struct Lisp_Event *event, struct console *con, int use_console_meta_flag, int do_backspace_mapping); -void zero_event (Lisp_Event *e); +void zero_event (struct Lisp_Event *e); void deallocate_event_chain (Lisp_Object event); Lisp_Object event_chain_tail (Lisp_Object event); void enqueue_event (Lisp_Object event, Lisp_Object *head, Lisp_Object *tail); @@ -565,19 +543,17 @@ /* True if this is a non-internal event (keyboard press, menu, scrollbar, mouse button) */ int command_event_p (Lisp_Object event); -void define_self_inserting_symbol (Lisp_Object, Lisp_Object); -Emchar event_to_character (Lisp_Event *, int, int, int); struct console *event_console_or_selected (Lisp_Object event); /* from event-stream.c */ Lisp_Object allocate_command_builder (Lisp_Object console); void enqueue_magic_eval_event (void (*fun) (Lisp_Object), Lisp_Object object); -void event_stream_next_event (Lisp_Event *event); -void event_stream_handle_magic_event (Lisp_Event *event); +void event_stream_next_event (struct Lisp_Event *event); +void event_stream_handle_magic_event (struct Lisp_Event *event); void event_stream_select_console (struct console *con); void event_stream_unselect_console (struct console *con); -void event_stream_select_process (Lisp_Process *proc); -void event_stream_unselect_process (Lisp_Process *proc); +void event_stream_select_process (struct Lisp_Process *proc); +void event_stream_unselect_process (struct Lisp_Process *proc); USID event_stream_create_stream_pair (void* inhandle, void* outhandle, Lisp_Object* instream, Lisp_Object* outstream, int flags); USID event_stream_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream); @@ -640,9 +616,9 @@ int event_stream_unixoid_select_console (struct console *con); int event_stream_unixoid_unselect_console (struct console *con); -int event_stream_unixoid_select_process (Lisp_Process *proc); -int event_stream_unixoid_unselect_process (Lisp_Process *proc); -int read_event_from_tty_or_stream_desc (Lisp_Event *event, +int event_stream_unixoid_select_process (struct Lisp_Process *proc); +int event_stream_unixoid_unselect_process (struct Lisp_Process *proc); +int read_event_from_tty_or_stream_desc (struct Lisp_Event *event, struct console *con, int fd); USID event_stream_unixoid_create_stream_pair (void* inhandle, void* outhandle, Lisp_Object* instream, @@ -662,60 +638,4 @@ #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_ */ +#endif /* _XEMACS_EVENTS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/extents.c --- a/src/extents.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/extents.c Mon Aug 13 11:20:41 2007 +0200 @@ -227,7 +227,6 @@ #include "opaque.h" #include "process.h" #include "redisplay.h" -#include "gutter.h" /* ------------------------------- */ /* gap array */ @@ -261,7 +260,7 @@ Gap_Array_Marker *markers; } Gap_Array; -static Gap_Array_Marker *gap_array_marker_freelist; +Gap_Array_Marker *gap_array_marker_freelist; /* Convert a "memory position" (i.e. taking the gap into account) into the address of the element at (i.e. after) that position. "Memory @@ -302,7 +301,7 @@ Extent_List_Marker *markers; } Extent_List; -static Extent_List_Marker *extent_list_marker_freelist; +Extent_List_Marker *extent_list_marker_freelist; #define EXTENT_LESS_VALS(e,st,nd) ((extent_start (e) < (st)) || \ ((extent_start (e) == (st)) && \ @@ -445,6 +444,9 @@ Lisp_Object Qwhitespace; /* Qtext defined in general.c */ +/* partially used in redisplay */ +Lisp_Object Qglyph_invisible; + Lisp_Object Qcopy_function; Lisp_Object Qpaste_function; @@ -462,13 +464,10 @@ /* 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 */ @@ -891,8 +890,8 @@ allocate_extent_list (void) { Extent_List *el = xnew (Extent_List); - el->start = make_gap_array (sizeof (EXTENT)); - el->end = make_gap_array (sizeof (EXTENT)); + el->start = make_gap_array (sizeof(EXTENT)); + el->end = make_gap_array (sizeof(EXTENT)); el->markers = 0; return el; } @@ -911,24 +910,24 @@ /************************************************************************/ static Lisp_Object -mark_extent_auxiliary (Lisp_Object obj) +mark_extent_auxiliary (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); - mark_object (data->begin_glyph); - mark_object (data->end_glyph); - mark_object (data->invisible); - mark_object (data->children); - mark_object (data->read_only); - mark_object (data->mouse_face); - mark_object (data->initial_redisplay_function); - mark_object (data->before_change_functions); - mark_object (data->after_change_functions); + markobj (data->begin_glyph); + markobj (data->end_glyph); + markobj (data->invisible); + markobj (data->children); + markobj (data->read_only); + markobj (data->mouse_face); + markobj (data->initial_redisplay_function); + markobj (data->before_change_functions); + markobj (data->after_change_functions); return data->parent; } DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, mark_extent_auxiliary, internal_object_printer, - 0, 0, 0, 0, struct extent_auxiliary); + 0, 0, 0, struct extent_auxiliary); void allocate_extent_auxiliary (EXTENT ext) @@ -974,7 +973,7 @@ static void soe_invalidate (Lisp_Object obj); static Lisp_Object -mark_extent_info (Lisp_Object obj) +mark_extent_info (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct extent_info *data = (struct extent_info *) XEXTENT_INFO (obj); int i; @@ -997,7 +996,7 @@ Lisp_Object exobj; XSETEXTENT (exobj, extent); - mark_object (exobj); + markobj (exobj); } } @@ -1026,7 +1025,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, mark_extent_info, internal_object_printer, - finalize_extent_info, 0, 0, 0, + finalize_extent_info, 0, 0, struct extent_info); static Lisp_Object @@ -1541,7 +1540,8 @@ 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); } @@ -1553,7 +1553,8 @@ 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); } @@ -1593,47 +1594,33 @@ object = extent_object (extent); - if (extent_detached_p (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. */ return; - 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)); - } + { + 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. @@ -2615,11 +2602,12 @@ 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); @@ -2925,13 +2913,37 @@ 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, void (*) (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); + +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_getprop, extent_putprop, + extent_remprop, extent_plist, + struct extent); + static Lisp_Object -mark_extent (Lisp_Object obj) +mark_extent (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct extent *extent = XEXTENT (obj); - mark_object (extent_object (extent)); - mark_object (extent_no_chase_normal_field (extent, face)); + markobj (extent_object (extent)); + markobj (extent_no_chase_normal_field (extent, face)); return extent->plist; } @@ -2950,9 +2962,11 @@ if (extent_detached_p (ext)) strcpy (bp, "detached"); else - sprintf (bp, "%ld, %ld", - (long) XINT (Fextent_start_position (obj)), - (long) XINT (Fextent_end_position (obj))); + { + Bufpos from = XINT (Fextent_start_position (obj)); + Bufpos to = XINT (Fextent_end_position (obj)); + sprintf (bp, "%d, %d", from, to); + } bp += strlen (bp); *bp++ = (extent_end_open_p (anc) ? ')': ']'); if (!NILP (extent_end_glyph (anc))) *bp++ = '*'; @@ -2990,9 +3004,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 @@ -3114,13 +3128,6 @@ 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) { @@ -3170,7 +3177,7 @@ return -1; } - return external_remprop (extent_plist_addr (ext), prop, 0, ERROR_ME); + return external_remprop (&ext->plist, prop, 0, ERROR_ME); } static Lisp_Object @@ -3179,20 +3186,6 @@ 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 */ @@ -4623,9 +4616,14 @@ int speccount; }; +/* This juggling with the pointer to another file's global variable is + kind of yucky. Perhaps I should just export the variable. */ +static int *inside_change_hook_pointer; + static Lisp_Object report_extent_modification_restore (Lisp_Object buffer) { + *inside_change_hook_pointer = 0; if (current_buffer != XBUFFER (buffer)) Fset_buffer (buffer); return Qnil; @@ -4650,13 +4648,7 @@ /* Now that we are sure to call elisp, set up an unwind-protect so inside_change_hook gets restored in case we throw. Also record the current buffer, in case we change it. Do the recording only - once. - - One confusing thing here is that our caller never actually calls - unbind_to (closure.speccount, Qnil). This is because - map_extents_bytind() unbinds before, and with a smaller - speccount. The additional unbind_to() in - report_extent_modification() would cause XEmacs to abort. */ + once. */ if (closure->speccount == -1) { closure->speccount = specpdl_depth (); @@ -4672,10 +4664,7 @@ /* #### It's a shame that we can't use any of the existing run_hook* functions here. This is so because all of them work with symbols, to be able to retrieve default values of local hooks. - <sigh> - - #### Idea: we could set up a dummy symbol, and call the hook - functions on *that*. */ + <sigh> */ if (!CONSP (hook) || EQ (XCAR (hook), Qlambda)) call3 (hook, exobj, startobj, endobj); @@ -4683,8 +4672,6 @@ { Lisp_Object tail; EXTERNAL_LIST_LOOP (tail, hook) - /* #### Shouldn't this perform the same Fset_buffer() check as - above? */ call3 (XCAR (tail), exobj, startobj, endobj); } return 0; @@ -4692,7 +4679,7 @@ void report_extent_modification (Lisp_Object buffer, Bufpos start, Bufpos end, - int afterp) + int *inside, int afterp) { struct report_extent_modification_closure closure; @@ -4702,8 +4689,20 @@ closure.afterp = afterp; closure.speccount = -1; + inside_change_hook_pointer = inside; + *inside = 1; + map_extents (start, end, report_extent_modification_mapper, (void *)&closure, buffer, NULL, ME_MIGHT_CALL_ELISP); + + if (closure.speccount == -1) + *inside = 0; + else + { + /* We mustn't unbind when closure.speccount != -1 because + map_extents_bytind has already done that. */ + assert (*inside == 0); + } } @@ -5007,7 +5006,7 @@ set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, Lisp_Object layout_obj) { - EXTENT extent = decode_extent (extent_obj, 0); + EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); glyph_layout layout = symbol_to_glyph_layout (layout_obj); /* Make sure we've actually been given a valid glyph or it's nil @@ -6677,10 +6676,6 @@ 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"); @@ -6720,6 +6715,8 @@ defsymbol (&Qwhitespace, "whitespace"); /* Qtext defined in general.c */ + defsymbol (&Qglyph_invisible, "glyph-invisible"); + defsymbol (&Qpaste_function, "paste-function"); defsymbol (&Qcopy_function, "copy-function"); @@ -6796,26 +6793,8 @@ } void -reinit_vars_of_extents (void) -{ - extent_auxiliary_defaults.begin_glyph = Qnil; - extent_auxiliary_defaults.end_glyph = Qnil; - extent_auxiliary_defaults.parent = Qnil; - extent_auxiliary_defaults.children = Qnil; - extent_auxiliary_defaults.priority = 0; - extent_auxiliary_defaults.invisible = Qnil; - extent_auxiliary_defaults.read_only = Qnil; - extent_auxiliary_defaults.mouse_face = Qnil; - extent_auxiliary_defaults.initial_redisplay_function = Qnil; - extent_auxiliary_defaults.before_change_functions = Qnil; - extent_auxiliary_defaults.after_change_functions = Qnil; -} - -void vars_of_extents (void) { - reinit_vars_of_extents (); - DEFVAR_INT ("mouse-highlight-priority", &mouse_highlight_priority /* The priority to use for the mouse-highlighting pseudo-extent that is used to highlight extents with the `mouse-face' attribute set. @@ -6842,6 +6821,18 @@ Vextent_face_reusable_list = Fcons (Qnil, Qnil); staticpro (&Vextent_face_reusable_list); + + extent_auxiliary_defaults.begin_glyph = Qnil; + extent_auxiliary_defaults.end_glyph = Qnil; + extent_auxiliary_defaults.parent = Qnil; + extent_auxiliary_defaults.children = Qnil; + extent_auxiliary_defaults.priority = 0; + extent_auxiliary_defaults.invisible = Qnil; + extent_auxiliary_defaults.read_only = Qnil; + extent_auxiliary_defaults.mouse_face = Qnil; + extent_auxiliary_defaults.initial_redisplay_function = Qnil; + extent_auxiliary_defaults.before_change_functions = Qnil; + extent_auxiliary_defaults.after_change_functions = Qnil; } void diff -r 12e008d41344 -r 697ef44129c6 src/extents.h --- a/src/extents.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/extents.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,13 +20,14 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_extents_h_ -#define INCLUDED_extents_h_ +#ifndef _XEMACS_EXTENTS_H_ +#define _XEMACS_EXTENTS_H_ DECLARE_LRECORD (extent, struct extent); #define XEXTENT(x) XRECORD (x, extent, struct extent) #define XSETEXTENT(x, p) XSETRECORD (x, p, extent) #define EXTENTP(x) RECORDP (x, extent) +#define GC_EXTENTP(x) GC_RECORDP (x, extent) #define CHECK_EXTENT(x) CHECK_RECORD (x, extent) #define CONCHECK_EXTENT(x) CONCHECK_RECORD (x, extent) @@ -146,6 +147,7 @@ XRECORD (x, extent_auxiliary, struct extent_auxiliary) #define XSETEXTENT_AUXILIARY(x, p) XSETRECORD (x, p, extent_auxiliary) #define EXTENT_AUXILIARYP(x) RECORDP (x, extent_auxiliary) +#define GC_EXTENT_AUXILIARYP(x) GC_RECORDP (x, extent_auxiliary) #define CHECK_EXTENT_AUXILIARY(x) CHECK_RECORD (x, extent_auxiliary) #define CONCHECK_EXTENT_AUXILIARY(x) CONCHECK_RECORD (x, extent_auxiliary) @@ -161,6 +163,7 @@ #define XEXTENT_INFO(x) XRECORD (x, extent_info, struct extent_info) #define XSETEXTENT_INFO(x, p) XSETRECORD (x, p, extent_info) #define EXTENT_INFOP(x) RECORDP (x, extent_info) +#define GC_EXTENT_INFOP(x) GC_RECORDP (x, extent_info) #define CHECK_EXTENT_INFO(x) CHECK_RECORD (x, extent_info) #define CONCHECK_EXTENT_INFO(x) CONCHECK_RECORD (x, extent_info) @@ -177,8 +180,8 @@ #define extent_no_chase_normal_field(e, field) ((e)->flags.field) -INLINE_HEADER struct extent_auxiliary *extent_aux_or_default (EXTENT e); -INLINE_HEADER struct extent_auxiliary * +INLINE struct extent_auxiliary *extent_aux_or_default (EXTENT e); +INLINE struct extent_auxiliary * extent_aux_or_default (EXTENT e) { return e->flags.has_aux ? @@ -259,8 +262,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_HEADER Lisp_Object * extent_no_chase_plist_addr (EXTENT e); -INLINE_HEADER Lisp_Object * +INLINE Lisp_Object * extent_no_chase_plist_addr (EXTENT e); +INLINE Lisp_Object * extent_no_chase_plist_addr (EXTENT e) { return e->flags.has_aux ? &XCDR (e->plist) : &e->plist; @@ -318,7 +321,6 @@ 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); @@ -340,8 +342,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_HEADER EXTENT extent_ancestor (EXTENT e); -INLINE_HEADER EXTENT +INLINE EXTENT extent_ancestor (EXTENT e); +INLINE EXTENT extent_ancestor (EXTENT e) { return e->flags.has_parent ? extent_ancestor_1 (e) : e; @@ -368,7 +370,7 @@ Bytind opoint, Bytecount length); void process_extents_for_deletion (Lisp_Object object, Bytind from, Bytind to, int destroy_them); -void report_extent_modification (Lisp_Object, Bufpos, Bufpos, int); +void report_extent_modification (Lisp_Object, Bufpos, Bufpos, int *, int); void set_extent_glyph (EXTENT extent, Lisp_Object glyph, int endp, glyph_layout layout); @@ -398,4 +400,4 @@ #endif /* emacs */ -#endif /* INCLUDED_extents_h_ */ +#endif /* _XEMACS_EXTENTS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/extw-Xlib.h --- a/src/extw-Xlib.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/extw-Xlib.h Mon Aug 13 11:20:41 2007 +0200 @@ -17,8 +17,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_extw_Xlib_h_ -#define INCLUDED_extw_Xlib_h_ +#ifndef _EXTW_XLIB_H_ +#define _EXTW_XLIB_H_ #define extw_shell_send 0 #define extw_client_send 1 @@ -48,4 +48,4 @@ void extw_send_notify_3(Display *display, Window win, en_extw_notify type, long data0, long data1, long data2); -#endif /* INCLUDED_extw_Xlib_h_ */ +#endif /* _EXTW_XLIB_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/extw-Xt.c --- a/src/extw-Xt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/extw-Xt.c Mon Aug 13 11:20:41 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 12e008d41344 -r 697ef44129c6 src/extw-Xt.h --- a/src/extw-Xt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/extw-Xt.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,8 +19,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_extw_Xt_h_ -#define INCLUDED_extw_Xt_h_ +#ifndef _EXTW_XT_H_ +#define _EXTW_XT_H_ #include "extw-Xlib.h" @@ -41,4 +41,4 @@ en_extw_notify type, unsigned long timeout); -#endif /* INCLUDED_extw_Xt_h_ */ +#endif /* _EXTW_XT_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/faces.c --- a/src/faces.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/faces.c Mon Aug 13 11:20:41 2007 +0200 @@ -57,8 +57,9 @@ Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face; Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face; -/* Qdefault, Qhighlight, Qleft_margin, Qright_margin defined in general.c */ -Lisp_Object Qmodeline, Qgui_element, Qtext_cursor, Qvertical_divider; +/* Qdefault, Qhighlight defined in general.c */ +Lisp_Object Qmodeline, Qgui_element, Qleft_margin, Qright_margin, Qtext_cursor; +Lisp_Object Qvertical_divider; /* In the old implementation Vface_list was a list of the face names, not the faces themselves. We now distinguish between permanent and @@ -72,26 +73,26 @@ static Lisp_Object -mark_face (Lisp_Object obj) +mark_face (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Face *face = XFACE (obj); + struct Lisp_Face *face = XFACE (obj); - mark_object (face->name); - mark_object (face->doc_string); + markobj (face->name); + markobj (face->doc_string); - mark_object (face->foreground); - mark_object (face->background); - mark_object (face->font); - mark_object (face->display_table); - mark_object (face->background_pixmap); - mark_object (face->underline); - mark_object (face->strikethru); - mark_object (face->highlight); - mark_object (face->dim); - mark_object (face->blinking); - mark_object (face->reverse); + markobj (face->foreground); + markobj (face->background); + markobj (face->font); + markobj (face->display_table); + markobj (face->background_pixmap); + markobj (face->underline); + markobj (face->strikethru); + markobj (face->highlight); + markobj (face->dim); + markobj (face->blinking); + markobj (face->reverse); - mark_object (face->charsets_warned_about); + markobj (face->charsets_warned_about); return face->plist; } @@ -99,7 +100,7 @@ static void print_face (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Face *face = XFACE (obj); + struct Lisp_Face *face = XFACE (obj); if (print_readably) { @@ -129,8 +130,8 @@ static int face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Face *f1 = XFACE (obj1); - Lisp_Face *f2 = XFACE (obj2); + struct Lisp_Face *f1 = XFACE (obj1); + struct Lisp_Face *f2 = XFACE (obj2); depth++; @@ -153,7 +154,7 @@ static unsigned long face_hash (Lisp_Object obj, int depth) { - Lisp_Face *f = XFACE (obj); + struct Lisp_Face *f = XFACE (obj); depth++; @@ -167,28 +168,28 @@ static Lisp_Object face_getprop (Lisp_Object obj, Lisp_Object prop) { - Lisp_Face *f = XFACE (obj); + struct Lisp_Face *f = XFACE (obj); return - (EQ (prop, Qforeground) ? f->foreground : - EQ (prop, Qbackground) ? f->background : - EQ (prop, Qfont) ? f->font : - EQ (prop, Qdisplay_table) ? f->display_table : - EQ (prop, Qbackground_pixmap) ? f->background_pixmap : - EQ (prop, Qunderline) ? f->underline : - EQ (prop, Qstrikethru) ? f->strikethru : - EQ (prop, Qhighlight) ? f->highlight : - EQ (prop, Qdim) ? f->dim : - EQ (prop, Qblinking) ? f->blinking : - EQ (prop, Qreverse) ? f->reverse : - EQ (prop, Qdoc_string) ? f->doc_string : + ((EQ (prop, Qforeground)) ? f->foreground : + (EQ (prop, Qbackground)) ? f->background : + (EQ (prop, Qfont)) ? f->font : + (EQ (prop, Qdisplay_table)) ? f->display_table : + (EQ (prop, Qbackground_pixmap)) ? f->background_pixmap : + (EQ (prop, Qunderline)) ? f->underline : + (EQ (prop, Qstrikethru)) ? f->strikethru : + (EQ (prop, Qhighlight)) ? f->highlight : + (EQ (prop, Qdim)) ? f->dim : + (EQ (prop, Qblinking)) ? f->blinking : + (EQ (prop, Qreverse)) ? f->reverse : + (EQ (prop, Qdoc_string)) ? f->doc_string : external_plist_get (&f->plist, prop, 0, ERROR_ME)); } static int face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) { - Lisp_Face *f = XFACE (obj); + struct Lisp_Face *f = XFACE (obj); if (EQ (prop, Qforeground) || EQ (prop, Qbackground) || @@ -218,7 +219,7 @@ static int face_remprop (Lisp_Object obj, Lisp_Object prop) { - Lisp_Face *f = XFACE (obj); + struct Lisp_Face *f = XFACE (obj); if (EQ (prop, Qforeground) || EQ (prop, Qbackground) || @@ -245,7 +246,7 @@ static Lisp_Object face_plist (Lisp_Object obj) { - Lisp_Face *face = XFACE (obj); + struct Lisp_Face *face = XFACE (obj); Lisp_Object result = face->plist; result = cons3 (Qreverse, face->reverse, result); @@ -263,30 +264,11 @@ return result; } -static const struct lrecord_description face_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Face, name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, doc_string) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, foreground) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, background) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, font) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, display_table) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, background_pixmap) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, underline) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, reverse) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) }, - { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, mark_face, print_face, 0, face_equal, - face_hash, face_description, face_getprop, + face_hash, face_getprop, face_putprop, face_remprop, - face_plist, Lisp_Face); + face_plist, struct Lisp_Face); /************************************************************************/ /* face read syntax */ @@ -352,7 +334,7 @@ ****************************************************************************/ static void -reset_face (Lisp_Face *f) +reset_face (struct Lisp_Face *f) { f->name = Qnil; f->doc_string = Qnil; @@ -372,10 +354,11 @@ f->charsets_warned_about = Qnil; } -static Lisp_Face * +static struct Lisp_Face * allocate_face (void) { - Lisp_Face *result = alloc_lcrecord_type (Lisp_Face, &lrecord_face); + struct Lisp_Face *result = + alloc_lcrecord_type (struct Lisp_Face, &lrecord_face); reset_face (result); return result; @@ -496,7 +479,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; @@ -770,7 +753,7 @@ (name, doc_string, temporary)) { /* This function can GC if initialized is non-zero */ - Lisp_Face *f; + struct Lisp_Face *f; Lisp_Object face; CHECK_SYMBOL (name); @@ -998,7 +981,8 @@ /* mark for GC a dynarr of face cachels. */ void -mark_face_cachels (face_cachel_dynarr *elements) +mark_face_cachels (face_cachel_dynarr *elements, + void (*markobj) (Lisp_Object)) { int elt; @@ -1014,13 +998,13 @@ for (i = 0; i < NUM_LEADING_BYTES; i++) if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i])) - mark_object (cachel->font[i]); + markobj (cachel->font[i]); } - mark_object (cachel->face); - mark_object (cachel->foreground); - mark_object (cachel->background); - mark_object (cachel->display_table); - mark_object (cachel->background_pixmap); + markobj (cachel->face); + markobj (cachel->foreground); + markobj (cachel->background); + markobj (cachel->display_table); + markobj (cachel->background_pixmap); } } @@ -1138,7 +1122,7 @@ { Lisp_Object charset = CHARSET_BY_LEADING_BYTE (i + MIN_LEADING_BYTE); Lisp_Object font_instance = FACE_CACHEL_FONT (cachel, charset); - Lisp_Font_Instance *fi = XFONT_INSTANCE (font_instance); + struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_instance); assert (CHARSETP (charset)); assert (FONT_INSTANCEP (font_instance)); @@ -1690,7 +1674,7 @@ */ (old_face, new_name, locale, tag_set, exact_p, how_to_add)) { - Lisp_Face *fold, *fnew; + struct Lisp_Face *fold, *fnew; Lisp_Object new_face = Qnil; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -1752,11 +1736,11 @@ void syms_of_faces (void) { - INIT_LRECORD_IMPLEMENTATION (face); - - /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */ + /* Qdefault & Qwidget defined in general.c */ defsymbol (&Qmodeline, "modeline"); defsymbol (&Qgui_element, "gui-element"); + defsymbol (&Qleft_margin, "left-margin"); + defsymbol (&Qright_margin, "right-margin"); defsymbol (&Qtext_cursor, "text-cursor"); defsymbol (&Qvertical_divider, "vertical-divider"); @@ -1878,8 +1862,6 @@ bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); #endif #ifdef HAVE_MS_WINDOWS - fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb); fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); bg_fb = acons (list1 (Qmswindows), build_string ("white"), bg_fb); #endif @@ -1896,7 +1878,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-*", @@ -1914,7 +1896,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)), @@ -1926,12 +1908,6 @@ inst_list); #endif /* HAVE_TTY */ #ifdef HAVE_MS_WINDOWS - /* Fixedsys does not exist for printers */ - inst_list = Fcons (Fcons (list1 (Qmsprinter), - build_string ("Courier:Regular:10::Western")), inst_list); - inst_list = Fcons (Fcons (list1 (Qmsprinter), - build_string ("Courier New:Regular:10::Western")), inst_list); - inst_list = Fcons (Fcons (list1 (Qmswindows), build_string ("Fixedsys:Regular:9::Western")), inst_list); inst_list = Fcons (Fcons (list1 (Qmswindows), @@ -1975,8 +1951,6 @@ bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); #endif #ifdef HAVE_MS_WINDOWS - fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb); fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); bg_fb = acons (list1 (Qmswindows), build_string ("Gray75"), bg_fb); #endif @@ -2030,13 +2004,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)); - /* We don't want widgets to have a default background pixmap. */ + set_specifier_fallback (Fget (Vwidget_face, Qbackground_pixmap, Qnil), + Fget (Vgui_element_face, Qbackground_pixmap, + Qunbound)); Vleft_margin_face = Fmake_face (Qleft_margin, build_string ("left margin face"), diff -r 12e008d41344 -r 697ef44129c6 src/faces.h --- a/src/faces.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/faces.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,14 +21,14 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_faces_h_ -#define INCLUDED_faces_h_ +#ifndef _XEMACS_FACES_H_ +#define _XEMACS_FACES_H_ #include "buffer.h" /* for NUM_LEADING_BYTES */ -/* a Lisp_Face is the C object corresponding to a face. There is one - of these per face. It basically contains all of the specifiers for - the built-in face properties, plus the plist of user-specified +/* a struct Lisp_Face is the C object corresponding to a face. There + is one of these per face. It basically contains all of the specifiers + for the built-in face properties, plus the plist of user-specified properties. */ struct Lisp_Face @@ -125,7 +125,7 @@ corresponding single-face cachels. Formerly we didn't bother to keep track of the faces used for - merging. We do now because we need to do so because there is no + merging. We do know 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 @@ -222,10 +222,11 @@ unsigned char font_updated[NUM_LEADING_BYTES]; }; -DECLARE_LRECORD (face, Lisp_Face); -#define XFACE(x) XRECORD (x, face, Lisp_Face) +DECLARE_LRECORD (face, struct Lisp_Face); +#define XFACE(x) XRECORD (x, face, struct Lisp_Face) #define XSETFACE(x, p) XSETRECORD (x, p, face) #define FACEP(x) RECORDP (x, face) +#define GC_FACEP(x) GC_RECORDP (x, face) #define CHECK_FACE(x) CHECK_RECORD (x, face) Lisp_Object ensure_face_cachel_contains_charset (struct face_cachel *cachel, @@ -240,7 +241,8 @@ void face_cachel_charset_font_metric_info (struct face_cachel *cachel, unsigned char *charsets, struct font_metric_info *fm); -void mark_face_cachels (face_cachel_dynarr *elements); +void mark_face_cachels (face_cachel_dynarr *elements, + void (*markobj) (Lisp_Object)); void mark_face_cachels_as_clean (struct window *w); void mark_face_cachels_as_not_updated (struct window *w); void reset_face_cachel (struct face_cachel *inst); @@ -258,7 +260,7 @@ extern Lisp_Object Qstrikethru, Vbuilt_in_face_specifiers, Vdefault_face; extern Lisp_Object Vleft_margin_face, Vpointer_face, Vright_margin_face; -extern Lisp_Object Vtext_cursor_face, Vvertical_divider_face; +extern Lisp_Object Vtext_cursor_face, Vvertical_divider_face; extern Lisp_Object Vtoolbar_face, Vgui_element_face, Vwidget_face; void mark_all_faces_as_clean (void); @@ -358,8 +360,6 @@ FACE_PROPERTY_INSTANCE (face, Qbackground_pixmap, domain, 0, Qzero) #define FACE_UNDERLINE_P(face, domain) \ (!NILP (FACE_PROPERTY_INSTANCE (face, Qunderline, domain, 0, Qzero))) -#define FACE_STRIKETHRU_P(face, domain) \ - (!NILP (FACE_PROPERTY_INSTANCE (face, Qstrikethru, domain, 0, Qzero))) #define FACE_HIGHLIGHT_P(face, domain) \ (!NILP (FACE_PROPERTY_INSTANCE (face, Qhighlight, domain, 0, Qzero))) #define FACE_DIM_P(face, domain) \ @@ -369,4 +369,4 @@ #define FACE_REVERSE_P(face, domain) \ (!NILP (FACE_PROPERTY_INSTANCE (face, Qreverse, domain, 0, Qzero))) -#endif /* INCLUDED_faces_h_ */ +#endif /* _XEMACS_FACES_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/file-coding.c --- a/src/file-coding.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/file-coding.c Mon Aug 13 11:20:41 2007 +0200 @@ -25,19 +25,17 @@ #include <config.h> #include "lisp.h" - #include "buffer.h" #include "elhash.h" #include "insdel.h" #include "lstream.h" -#include "opaque.h" #ifdef MULE #include "mule-ccl.h" #include "chartab.h" #endif #include "file-coding.h" -Lisp_Object Qcoding_system_error; +Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; Lisp_Object Vkeyboard_coding_system; Lisp_Object Vterminal_coding_system; @@ -48,39 +46,16 @@ /* Table of symbols identifying each coding category. */ Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; - - -struct file_coding_dump { - /* Coding system currently associated with each coding category. */ - Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1]; - - /* Table of all coding categories in decreasing order of priority. - This describes a permutation of the possible coding categories. */ - int coding_category_by_priority[CODING_CATEGORY_LAST + 1]; - -#ifdef MULE - Lisp_Object ucs_to_mule_table[65536]; -#endif -} *fcd; - -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 }, -#endif - { XD_END } -}; - -static const struct struct_description fcd_description = { - sizeof (struct file_coding_dump), - fcd_description_1 -}; - -Lisp_Object mule_to_ucs_table; - -Lisp_Object Qcoding_systemp; - -Lisp_Object Qraw_text, Qno_conversion, Qccl, Qiso2022; +/* Coding system currently associated with each coding category. */ +Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1]; + +/* Table of all coding categories in decreasing order of priority. + This describes a permutation of the possible coding categories. */ +int coding_category_by_priority[CODING_CATEGORY_LAST + 1]; + +Lisp_Object Qcoding_system_p; + +Lisp_Object Qno_conversion, Qccl, Qiso2022; /* Qinternal in general.c */ Lisp_Object Qmnemonic, Qeol_type; @@ -97,7 +72,7 @@ Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; Lisp_Object Qno_iso6429; Lisp_Object Qinput_charset_conversion, Qoutput_charset_conversion; -Lisp_Object Qescape_quoted; +Lisp_Object Qctext, Qescape_quoted; Lisp_Object Qshort, Qno_ascii_eol, Qno_ascii_cntl, Qseven, Qlock_shift; #endif Lisp_Object Qencode, Qdecode; @@ -176,67 +151,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; @@ -251,26 +226,6 @@ Dynarr_declare (codesys_prop); } codesys_prop_dynarr; -static const struct lrecord_description codesys_prop_description_1[] = { - { XD_LISP_OBJECT, offsetof (codesys_prop, sym) }, - { XD_END } -}; - -static const struct struct_description codesys_prop_description = { - sizeof (codesys_prop), - codesys_prop_description_1 -}; - -static const struct lrecord_description codesys_prop_dynarr_description_1[] = { - XD_DYNARR_DESC (codesys_prop_dynarr, &codesys_prop_description), - { XD_END } -}; - -static const struct struct_description codesys_prop_dynarr_description = { - sizeof (codesys_prop_dynarr), - codesys_prop_dynarr_description_1 -}; - codesys_prop_dynarr *the_codesys_prop_dynarr; enum codesys_prop_enum @@ -285,69 +240,26 @@ /* Coding system functions */ /************************************************************************/ -static Lisp_Object mark_coding_system (Lisp_Object); +static Lisp_Object mark_coding_system (Lisp_Object, void (*) (Lisp_Object)); static void print_coding_system (Lisp_Object, Lisp_Object, int); static void finalize_coding_system (void *header, int for_disksave); -#ifdef MULE -static const struct lrecord_description ccs_description_1[] = { - { XD_LISP_OBJECT, offsetof (charset_conversion_spec, from_charset) }, - { XD_LISP_OBJECT, offsetof (charset_conversion_spec, to_charset) }, - { XD_END } -}; - -static const struct struct_description ccs_description = { - sizeof (charset_conversion_spec), - ccs_description_1 -}; - -static const struct lrecord_description ccsd_description_1[] = { - XD_DYNARR_DESC (charset_conversion_spec_dynarr, &ccs_description), - { XD_END } -}; - -static const struct struct_description ccsd_description = { - sizeof (charset_conversion_spec_dynarr), - ccsd_description_1 -}; -#endif - -static const struct lrecord_description coding_system_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, doc_string) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, mnemonic) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, post_read_conversion) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, pre_write_conversion) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, eol_lf) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, eol_crlf) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, eol_cr) }, -#ifdef MULE - { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Coding_System, iso2022.initial_charset), 4 }, - { XD_STRUCT_PTR, offsetof (Lisp_Coding_System, iso2022.input_conv), 1, &ccsd_description }, - { XD_STRUCT_PTR, offsetof (Lisp_Coding_System, iso2022.output_conv), 1, &ccsd_description }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, ccl.decode) }, - { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, ccl.encode) }, -#endif - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system, mark_coding_system, print_coding_system, finalize_coding_system, - 0, 0, coding_system_description, - Lisp_Coding_System); + 0, 0, struct Lisp_Coding_System); static Lisp_Object -mark_coding_system (Lisp_Object obj) +mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lisp_Coding_System *codesys = XCODING_SYSTEM (obj); - mark_object (CODING_SYSTEM_NAME (codesys)); - mark_object (CODING_SYSTEM_DOC_STRING (codesys)); - mark_object (CODING_SYSTEM_MNEMONIC (codesys)); - mark_object (CODING_SYSTEM_EOL_LF (codesys)); - mark_object (CODING_SYSTEM_EOL_CRLF (codesys)); - mark_object (CODING_SYSTEM_EOL_CR (codesys)); + markobj (CODING_SYSTEM_NAME (codesys)); + markobj (CODING_SYSTEM_DOC_STRING (codesys)); + markobj (CODING_SYSTEM_MNEMONIC (codesys)); + markobj (CODING_SYSTEM_EOL_LF (codesys)); + markobj (CODING_SYSTEM_EOL_CRLF (codesys)); + markobj (CODING_SYSTEM_EOL_CR (codesys)); switch (CODING_SYSTEM_TYPE (codesys)) { @@ -355,15 +267,15 @@ int i; case CODESYS_ISO2022: for (i = 0; i < 4; i++) - mark_object (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)); + markobj (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)); if (codesys->iso2022.input_conv) { for (i = 0; i < Dynarr_length (codesys->iso2022.input_conv); i++) { struct charset_conversion_spec *ccs = Dynarr_atp (codesys->iso2022.input_conv, i); - mark_object (ccs->from_charset); - mark_object (ccs->to_charset); + markobj (ccs->from_charset); + markobj (ccs->to_charset); } } if (codesys->iso2022.output_conv) @@ -372,22 +284,22 @@ { struct charset_conversion_spec *ccs = Dynarr_atp (codesys->iso2022.output_conv, i); - mark_object (ccs->from_charset); - mark_object (ccs->to_charset); + markobj (ccs->from_charset); + markobj (ccs->to_charset); } } break; case CODESYS_CCL: - mark_object (CODING_SYSTEM_CCL_DECODE (codesys)); - mark_object (CODING_SYSTEM_CCL_ENCODE (codesys)); + markobj (CODING_SYSTEM_CCL_DECODE (codesys)); + markobj (CODING_SYSTEM_CCL_ENCODE (codesys)); break; #endif /* MULE */ default: break; } - mark_object (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys)); + markobj (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys)); return CODING_SYSTEM_POST_READ_CONVERSION (codesys); } @@ -436,7 +348,7 @@ } } -static eol_type_t +static enum eol_type symbol_to_eol_type (Lisp_Object symbol) { CHECK_SYMBOL (symbol); @@ -450,7 +362,7 @@ } static Lisp_Object -eol_type_to_symbol (eol_type_t type) +eol_type_to_symbol (enum eol_type type) { switch (type) { @@ -541,21 +453,15 @@ */ (coding_system_or_name)) { + if (CODING_SYSTEMP (coding_system_or_name)) + return coding_system_or_name; + if (NILP (coding_system_or_name)) coding_system_or_name = Qbinary; - else if (CODING_SYSTEMP (coding_system_or_name)) - return coding_system_or_name; else CHECK_SYMBOL (coding_system_or_name); - while (1) - { - coding_system_or_name = - Fgethash (coding_system_or_name, Vcoding_system_hash_table, Qnil); - - if (CODING_SYSTEMP (coding_system_or_name) || NILP (coding_system_or_name)) - return coding_system_or_name; - } + return Fgethash (coding_system_or_name, Vcoding_system_hash_table, Qnil); } DEFUN ("get-coding-system", Fget_coding_system, 1, 1, 0, /* @@ -589,7 +495,8 @@ (struct coding_system_list_closure *) coding_system_list_closure; Lisp_Object *coding_system_list = cscl->coding_system_list; - *coding_system_list = Fcons (key, *coding_system_list); + *coding_system_list = Fcons (XCODING_SYSTEM (value)->name, + *coding_system_list); return 0; } @@ -1042,169 +949,42 @@ return new_coding_system; } -DEFUN ("coding-system-canonical-name-p", Fcoding_system_canonical_name_p, 1, 1, 0, /* -Return t if OBJECT names a coding system, and is not a coding system alias. -*/ - (object)) -{ - return CODING_SYSTEMP (Fgethash (object, Vcoding_system_hash_table, Qnil)) - ? Qt : Qnil; -} - -DEFUN ("coding-system-alias-p", Fcoding_system_alias_p, 1, 1, 0, /* -Return t if OBJECT is a coding system alias. -All coding system aliases are created by `define-coding-system-alias'. +DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias, 2, 2, 0, /* +Define symbol ALIAS as an alias for coding system CODING-SYSTEM. */ - (object)) -{ - return SYMBOLP (Fgethash (object, Vcoding_system_hash_table, Qzero)) - ? Qt : Qnil; -} - -DEFUN ("coding-system-aliasee", Fcoding_system_aliasee, 1, 1, 0, /* -Return the coding-system symbol for which symbol ALIAS is an alias. -*/ - (alias)) -{ - Lisp_Object aliasee = Fgethash (alias, Vcoding_system_hash_table, Qnil); - if (SYMBOLP (aliasee)) - return aliasee; - else - signal_simple_error ("Symbol is not a coding system alias", alias); - return Qnil; /* To keep the compiler happy */ -} - -static Lisp_Object -append_suffix_to_symbol (Lisp_Object symbol, const char *ascii_string) + (alias, coding_system)) { - return Fintern (concat2 (Fsymbol_name (symbol), build_string (ascii_string)), - Qnil); -} - -/* A maphash function, for removing dangling coding system aliases. */ -static int -dangling_coding_system_alias_p (Lisp_Object alias, - Lisp_Object aliasee, - void *dangling_aliases) -{ - if (SYMBOLP (aliasee) - && NILP (Fgethash (aliasee, Vcoding_system_hash_table, Qnil))) - { - (*(int *) dangling_aliases)++; - return 1; - } - else - return 0; -} - -DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias, 2, 2, 0, /* -Define symbol ALIAS as an alias for coding system ALIASEE. - -You can use this function to redefine an alias that has already been defined, -but you cannot redefine a name which is the canonical name for a coding system. -\(a canonical name of a coding system is what is returned when you call -`coding-system-name' on a coding system). - -ALIASEE itself can be an alias, which allows you to define nested aliases. - -You are forbidden, however, from creating alias loops or `dangling' aliases. -These will be detected, and an error will be signaled if you attempt to do so. - -If ALIASEE is nil, then ALIAS will simply be undefined. - -See also `coding-system-alias-p', `coding-system-aliasee', -and `coding-system-canonical-name-p'. -*/ - (alias, aliasee)) -{ - Lisp_Object real_coding_system, probe; - CHECK_SYMBOL (alias); - - if (!NILP (Fcoding_system_canonical_name_p (alias))) - signal_simple_error - ("Symbol is the canonical name of a coding system and cannot be redefined", - alias); - - if (NILP (aliasee)) + if (!NILP (Ffind_coding_system (alias))) + signal_simple_error ("Symbol already names a coding system", alias); + coding_system = Fget_coding_system (coding_system); + Fputhash (alias, coding_system, Vcoding_system_hash_table); + + /* Set up aliases for subsidiaries. */ + if (XCODING_SYSTEM_EOL_TYPE (coding_system) == EOL_AUTODETECT) { - Lisp_Object subsidiary_unix = append_suffix_to_symbol (alias, "-unix"); - Lisp_Object subsidiary_dos = append_suffix_to_symbol (alias, "-dos"); - Lisp_Object subsidiary_mac = append_suffix_to_symbol (alias, "-mac"); - - Fremhash (alias, Vcoding_system_hash_table); - - /* Undefine subsidiary aliases, - presumably created by a previous call to this function */ - if (! NILP (Fcoding_system_alias_p (subsidiary_unix)) && - ! NILP (Fcoding_system_alias_p (subsidiary_dos)) && - ! NILP (Fcoding_system_alias_p (subsidiary_mac))) - { - Fdefine_coding_system_alias (subsidiary_unix, Qnil); - Fdefine_coding_system_alias (subsidiary_dos, Qnil); - Fdefine_coding_system_alias (subsidiary_mac, Qnil); - } - - /* Undefine dangling coding system aliases. */ - { - int dangling_aliases; - - do { - dangling_aliases = 0; - elisp_map_remhash (dangling_coding_system_alias_p, - Vcoding_system_hash_table, - &dangling_aliases); - } while (dangling_aliases > 0); - } - - return Qnil; + Lisp_Object str; + XSETSTRING (str, symbol_name (XSYMBOL (alias))); +#define FROB(type, name) \ + do { \ + Lisp_Object subsidiary = XCODING_SYSTEM_EOL_##type (coding_system); \ + if (!NILP (subsidiary)) \ + Fdefine_coding_system_alias \ + (Fintern (concat2 (str, build_string (name)), Qnil), subsidiary); \ + } while (0) + FROB (LF, "-unix"); + FROB (CRLF, "-dos"); + FROB (CR, "-mac"); +#undef FROB } - - if (CODING_SYSTEMP (aliasee)) - aliasee = XCODING_SYSTEM_NAME (aliasee); - - /* Checks that aliasee names a coding-system */ - real_coding_system = Fget_coding_system (aliasee); - - /* Check for coding system alias loops */ - if (EQ (alias, aliasee)) - alias_loop: signal_simple_error_2 - ("Attempt to create a coding system alias loop", alias, aliasee); - - for (probe = aliasee; - SYMBOLP (probe); - probe = Fgethash (probe, Vcoding_system_hash_table, Qzero)) - { - if (EQ (probe, alias)) - goto alias_loop; - } - - Fputhash (alias, aliasee, Vcoding_system_hash_table); - - /* Set up aliases for subsidiaries. - #### There must be a better way to handle subsidiary coding systems. */ - { - static const char *suffixes[] = { "-unix", "-dos", "-mac" }; - int i; - for (i = 0; i < countof (suffixes); i++) - { - Lisp_Object alias_subsidiary = - append_suffix_to_symbol (alias, suffixes[i]); - Lisp_Object aliasee_subsidiary = - append_suffix_to_symbol (aliasee, suffixes[i]); - - if (! NILP (Ffind_coding_system (aliasee_subsidiary))) - Fdefine_coding_system_alias (alias_subsidiary, aliasee_subsidiary); - } - } - /* FSF return value is a vector of [ALIAS-unix ALIAS-dos ALIAS-mac], + /* FSF return value is a vector of [ALIAS-unix ALIAS-doc ALIAS-mac], but it doesn't look intentional, so I'd rather return something meaningful or nothing at all. */ return Qnil; } static Lisp_Object -subsidiary_coding_system (Lisp_Object coding_system, eol_type_t type) +subsidiary_coding_system (Lisp_Object coding_system, enum eol_type type) { Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system); Lisp_Object new_coding_system; @@ -1484,7 +1264,7 @@ order. */ for (j = 0; j <= CODING_CATEGORY_LAST; j++) { - int cat = fcd->coding_category_by_priority[j]; + int cat = coding_category_by_priority[j]; if (category_to_priority[cat] < 0) category_to_priority[cat] = i++; } @@ -1493,7 +1273,7 @@ constructed. */ for (i = 0; i <= CODING_CATEGORY_LAST; i++) - fcd->coding_category_by_priority[category_to_priority[i]] = i; + coding_category_by_priority[category_to_priority[i]] = i; /* Phew! That was confusing. */ return Qnil; @@ -1508,7 +1288,7 @@ Lisp_Object list = Qnil; for (i = CODING_CATEGORY_LAST; i >= 0; i--) - list = Fcons (coding_category_symbol[fcd->coding_category_by_priority[i]], + list = Fcons (coding_category_symbol[coding_category_by_priority[i]], list); return list; } @@ -1521,7 +1301,7 @@ int cat = decode_coding_category (coding_category); coding_system = Fget_coding_system (coding_system); - fcd->coding_category_system[cat] = coding_system; + coding_category_system[cat] = coding_system; return Qnil; } @@ -1531,7 +1311,7 @@ (coding_category)) { int cat = decode_coding_category (coding_category); - Lisp_Object sys = fcd->coding_category_system[cat]; + Lisp_Object sys = coding_category_system[cat]; if (!NILP (sys)) return XCODING_SYSTEM_NAME (sys); @@ -1545,7 +1325,7 @@ struct detection_state { - eol_type_t eol_type; + enum eol_type eol_type; int seen_non_ascii; int mask; #ifdef MULE @@ -1626,8 +1406,8 @@ return (mask & (mask - 1)) == 0; } -static eol_type_t -detect_eol_type (struct detection_state *st, const unsigned char *src, +static enum eol_type +detect_eol_type (struct detection_state *st, CONST unsigned char *src, unsigned int n) { int c; @@ -1635,19 +1415,21 @@ while (n--) { c = *src++; - if (c == '\n') - { - if (st->eol.just_saw_cr) - return EOL_CRLF; - else if (st->eol.seen_anything) - return EOL_LF; - } - else if (st->eol.just_saw_cr) - return EOL_CR; - else if (c == '\r') + if (c == '\r') st->eol.just_saw_cr = 1; else - st->eol.just_saw_cr = 0; + { + if (c == '\n') + { + if (st->eol.just_saw_cr) + return EOL_CRLF; + else if (st->eol.seen_anything) + return EOL_LF; + } + else if (st->eol.just_saw_cr) + return EOL_CR; + st->eol.just_saw_cr = 0; + } st->eol.seen_anything = 1; } @@ -1672,7 +1454,7 @@ */ static int -detect_coding_type (struct detection_state *st, const Extbyte *src, +detect_coding_type (struct detection_state *st, CONST unsigned char *src, unsigned int n, int just_do_eol) { int c; @@ -1749,7 +1531,7 @@ } } if (NILP (retval)) - retval = Fget_coding_system (Qraw_text); + retval = Fget_coding_system (Qno_conversion); return retval; } else @@ -1763,32 +1545,30 @@ the first one that is allowed. */ for (i = 0; i <= CODING_CATEGORY_LAST; i++) { - cat = fcd->coding_category_by_priority[i]; + cat = coding_category_by_priority[i]; if ((mask & (1 << cat)) && - !NILP (fcd->coding_category_system[cat])) + !NILP (coding_category_system[cat])) break; } if (cat >= 0) - return fcd->coding_category_system[cat]; + return coding_category_system[cat]; else - return Fget_coding_system (Qraw_text); + return Fget_coding_system (Qno_conversion); } } /* Given a seekable read stream and potential coding system and EOL type as specified, do any autodetection that is called for. If the - coding system and/or EOL type are not `autodetect', they will be left + coding system and/or EOL type are not autodetect, they will be left alone; but this function will never return an autodetect coding system or EOL type. This function does not automatically fetch subsidiary coding systems; that should be unnecessary with the explicit eol-type argument. */ -#define LENGTH(string_constant) (sizeof (string_constant) - 1) - void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, - eol_type_t *eol_type_in_out) + enum eol_type *eol_type_in_out) { struct detection_state decst; @@ -1800,108 +1580,27 @@ decst.mask = ~0; /* If autodetection is called for, do it now. */ - if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT - || *eol_type_in_out == EOL_AUTODETECT) + if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT || + *eol_type_in_out == EOL_AUTODETECT) { - Extbyte buf[4096]; - Lisp_Object coding_system = Qnil; - Extbyte *p; - ssize_t nread = Lstream_read (stream, buf, sizeof (buf)); - Extbyte *scan_end; - - /* Look for initial "-*-"; mode line prefix */ - for (p = buf, - scan_end = buf + nread - LENGTH ("-*-coding:?-*-"); - p <= scan_end - && *p != '\n' - && *p != '\r'; - p++) - if (*p == '-' && *(p+1) == '*' && *(p+2) == '-') - { - Extbyte *local_vars_beg = p + 3; - /* Look for final "-*-"; mode line suffix */ - for (p = local_vars_beg, - scan_end = buf + nread - LENGTH ("-*-"); - p <= scan_end - && *p != '\n' - && *p != '\r'; - p++) - if (*p == '-' && *(p+1) == '*' && *(p+2) == '-') - { - Extbyte *suffix = p; - /* Look for "coding:" */ - for (p = local_vars_beg, - scan_end = suffix - LENGTH ("coding:?"); - p <= scan_end; - p++) - if (memcmp ("coding:", p, LENGTH ("coding:")) == 0 - && (p == local_vars_beg - || (*(p-1) == ' ' || - *(p-1) == '\t' || - *(p-1) == ';'))) - { - Extbyte save; - int n; - p += LENGTH ("coding:"); - while (*p == ' ' || *p == '\t') p++; - - /* Get coding system name */ - save = *suffix; *suffix = '\0'; - /* Characters valid in a MIME charset name (rfc 1521), - and in a Lisp symbol name. */ - n = strspn ( (char *) p, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789" - "!$%&*+-.^_{|}~"); - *suffix = save; - if (n > 0) - { - save = p[n]; p[n] = '\0'; - coding_system = - Ffind_coding_system (intern ((char *) p)); - p[n] = save; - } - break; - } - break; - } + + while (1) + { + unsigned char random_buffer[4096]; + int nread; + + nread = Lstream_read (stream, random_buffer, sizeof (random_buffer)); + if (!nread) break; - } - - if (NILP (coding_system)) - do - { - if (detect_coding_type (&decst, buf, nread, - XCODING_SYSTEM_TYPE (*codesys_in_out) - != CODESYS_AUTODETECT)) - break; - nread = Lstream_read (stream, buf, sizeof (buf)); - if (nread == 0) - break; - } - while (1); - - else if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT - && XCODING_SYSTEM_EOL_TYPE (coding_system) == EOL_AUTODETECT) - do - { - if (detect_coding_type (&decst, buf, nread, 1)) - break; - nread = Lstream_read (stream, buf, sizeof (buf)); - if (!nread) - break; - } - while (1); + if (detect_coding_type (&decst, random_buffer, nread, + XCODING_SYSTEM_TYPE (*codesys_in_out) != + CODESYS_AUTODETECT)) + break; + } *eol_type_in_out = decst.eol_type; if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT) - { - if (NILP (coding_system)) - *codesys_in_out = coding_system_from_mask (decst.mask); - else - *codesys_in_out = coding_system; - } + *codesys_in_out = coding_system_from_mask (decst.mask); } /* If we absolutely can't determine the EOL type, just assume LF. */ @@ -1940,7 +1639,7 @@ while (1) { unsigned char random_buffer[4096]; - ssize_t nread = Lstream_read (istr, random_buffer, sizeof (random_buffer)); + int nread = Lstream_read (istr, random_buffer, sizeof (random_buffer)); if (!nread) break; @@ -1961,10 +1660,10 @@ #endif for (i = CODING_CATEGORY_LAST; i >= 0; i--) { - int sys = fcd->coding_category_by_priority[i]; + int sys = coding_category_by_priority[i]; if (decst.mask & (1 << sys)) { - Lisp_Object codesys = fcd->coding_category_system[sys]; + Lisp_Object codesys = coding_category_system[sys]; if (!NILP (codesys)) codesys = subsidiary_coding_system (codesys, decst.eol_type); val = Fcons (codesys, val); @@ -2091,7 +1790,7 @@ EOL type stored in CODESYS because the latter might indicate automatic EOL-type detection while the former will always indicate a particular EOL type. */ - eol_type_t eol_type; + enum eol_type eol_type; #ifdef MULE /* Additional ISO2022 information. We define the structure above because it's also needed by the detection routines. */ @@ -2100,29 +1799,25 @@ /* Additional information (the state of the running CCL program) used by the CCL decoder. */ struct ccl_program ccl; - - /* counter for UTF-8 or UCS-4 */ - unsigned char counter; #endif struct detection_state decst; }; -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); +static int decoding_reader (Lstream *stream, unsigned char *data, size_t size); +static int decoding_writer (Lstream *stream, 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); static int decoding_closer (Lstream *stream); -static Lisp_Object decoding_marker (Lisp_Object stream); +static Lisp_Object decoding_marker (Lisp_Object stream, + void (*markobj) (Lisp_Object)); DEFINE_LSTREAM_IMPLEMENTATION ("decoding", lstream_decoding, sizeof (struct decoding_stream)); static Lisp_Object -decoding_marker (Lisp_Object stream) +decoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) { Lstream *str = DECODING_STREAM_DATA (XLSTREAM (stream))->other_end; Lisp_Object str_obj; @@ -2132,9 +1827,9 @@ and automatically marked. */ XSETLSTREAM (str_obj, str); - mark_object (str_obj); + markobj (str_obj); if (str->imp->marker) - return (str->imp->marker) (str_obj); + return (str->imp->marker) (str_obj, markobj); else return Qnil; } @@ -2142,12 +1837,12 @@ /* Read SIZE bytes of data and store it into DATA. We are a decoding stream so we read data from the other end, decode it, and store it into DATA. */ -static ssize_t +static int decoding_reader (Lstream *stream, unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); unsigned char *orig_data = data; - ssize_t read_size; + int read_size; int error_occurred = 0; /* We need to interface to mule_decode(), which expects to take some @@ -2204,11 +1899,11 @@ return data - orig_data; } -static ssize_t -decoding_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); - ssize_t retval; + int retval; /* Decode all our data into the runoff, and then attempt to write it all out to the other end. Remove whatever chunk we succeeded @@ -2238,15 +1933,7 @@ { setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys)); } - 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; } @@ -2322,7 +2009,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); @@ -2365,7 +2052,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); @@ -2429,8 +2116,7 @@ decode_coding_utf8 (decoding, src, dst, n); break; case CODESYS_CCL: - str->ccl.last_block = str->flags & CODING_STATE_END; - ccl_driver (&str->ccl, src, dst, n, 0, CCL_MODE_DECODING); + ccl_driver (&str->ccl, src, dst, n, 0); break; case CODESYS_ISO2022: decode_coding_iso2022 (decoding, src, dst, n); @@ -2485,7 +2171,7 @@ char tempbuf[1024]; /* some random amount */ Bufpos newpos, even_newer_pos; Bufpos oldpos = lisp_buffer_stream_startpos (istr); - ssize_t size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; @@ -2570,21 +2256,22 @@ #endif /* MULE */ }; -static ssize_t encoding_reader (Lstream *stream, unsigned char *data, size_t size); -static ssize_t encoding_writer (Lstream *stream, const unsigned char *data, - size_t size); +static int encoding_reader (Lstream *stream, unsigned char *data, size_t size); +static int encoding_writer (Lstream *stream, CONST unsigned char *data, + size_t size); static int encoding_rewinder (Lstream *stream); static int encoding_seekable_p (Lstream *stream); static int encoding_flusher (Lstream *stream); static int encoding_closer (Lstream *stream); -static Lisp_Object encoding_marker (Lisp_Object stream); +static Lisp_Object encoding_marker (Lisp_Object stream, + void (*markobj) (Lisp_Object)); DEFINE_LSTREAM_IMPLEMENTATION ("encoding", lstream_encoding, sizeof (struct encoding_stream)); static Lisp_Object -encoding_marker (Lisp_Object stream) +encoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) { Lstream *str = ENCODING_STREAM_DATA (XLSTREAM (stream))->other_end; Lisp_Object str_obj; @@ -2594,9 +2281,9 @@ and automatically marked. */ XSETLSTREAM (str_obj, str); - mark_object (str_obj); + markobj (str_obj); if (str->imp->marker) - return (str->imp->marker) (str_obj); + return (str->imp->marker) (str_obj, markobj); else return Qnil; } @@ -2604,12 +2291,12 @@ /* Read SIZE bytes of data and store it into DATA. We are a encoding stream so we read data from the other end, encode it, and store it into DATA. */ -static ssize_t +static int encoding_reader (Lstream *stream, unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); unsigned char *orig_data = data; - ssize_t read_size; + int read_size; int error_occurred = 0; /* We need to interface to mule_encode(), which expects to take some @@ -2666,11 +2353,11 @@ return data - orig_data; } -static ssize_t -encoding_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - ssize_t retval; + int retval; /* Encode all our data into the runoff, and then attempt to write it all out to the other end. Remove whatever chunk we succeeded @@ -2778,7 +2465,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); @@ -2809,7 +2496,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); @@ -2841,8 +2528,7 @@ encode_coding_utf8 (encoding, src, dst, n); break; case CODESYS_CCL: - str->ccl.last_block = str->flags & CODING_STATE_END; - ccl_driver (&str->ccl, src, dst, n, 0, CCL_MODE_ENCODING); + ccl_driver (&str->ccl, src, dst, n, 0); break; case CODESYS_ISO2022: encode_coding_iso2022 (encoding, src, dst, n); @@ -2893,7 +2579,7 @@ char tempbuf[1024]; /* some random amount */ Bufpos newpos, even_newer_pos; Bufpos oldpos = lisp_buffer_stream_startpos (istr); - ssize_t size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; @@ -2956,7 +2642,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; @@ -2981,7 +2667,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; @@ -3038,7 +2724,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; @@ -3242,7 +2928,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; @@ -3268,7 +2954,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; @@ -3318,7 +3004,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,6 +3121,8 @@ /* */ /************************************************************************/ +Lisp_Object ucs_to_mule_table[65536]; +Lisp_Object mule_to_ucs_table; DEFUN ("set-ucs-char", Fset_ucs_char, 2, 2, 0, /* Map UCS-4 code CODE to Mule character CHARACTER. @@ -3449,9 +3137,9 @@ CHECK_INT (code); c = XINT (code); - if (c < sizeof (fcd->ucs_to_mule_table)) + if (c < sizeof (ucs_to_mule_table)) { - fcd->ucs_to_mule_table[c] = character; + ucs_to_mule_table[c] = character; return Qt; } else @@ -3461,9 +3149,9 @@ static Lisp_Object ucs_to_char (unsigned long code) { - if (code < sizeof (fcd->ucs_to_mule_table)) + if (code < sizeof (ucs_to_mule_table)) { - return fcd->ucs_to_mule_table[code]; + return ucs_to_mule_table[code]; } else if ((0xe00000 <= code) && (code <= 0xe00000 + 94 * 94 * 14)) { @@ -3585,7 +3273,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--) @@ -3610,43 +3298,41 @@ } 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); unsigned int flags = str->flags; unsigned int ch = str->ch; - unsigned char counter = str->counter; while (n--) { unsigned char c = *src++; - switch (counter) + switch (flags) { case 0: ch = c; - counter = 3; + flags = 3; break; case 1: decode_ucs4 ( ( ch << 8 ) | c, dst); ch = 0; - counter = 0; + flags = 0; break; default: ch = ( ch << 8 ) | c; - counter--; + flags--; } } - if (counter & CODING_STATE_END) + if (flags & CODING_STATE_END) DECODE_OUTPUT_PARTIAL_CHAR (ch); str->flags = flags; str->ch = ch; - str->counter = counter; } 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); @@ -3659,7 +3345,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: @@ -3785,7 +3471,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--) @@ -3820,45 +3506,44 @@ } 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); unsigned int flags = str->flags; unsigned int ch = str->ch; eol_type_t eol_type = str->eol_type; - unsigned char counter = str->counter; while (n--) { unsigned char c = *src++; - switch (counter) + switch (flags) { case 0: if ( c >= 0xfc ) { ch = c & 0x01; - counter = 5; + flags = 5; } else if ( c >= 0xf8 ) { ch = c & 0x03; - counter = 4; + flags = 4; } else if ( c >= 0xf0 ) { ch = c & 0x07; - counter = 3; + flags = 3; } else if ( c >= 0xe0 ) { ch = c & 0x0f; - counter = 2; + flags = 2; } else if ( c >= 0xc0 ) { ch = c & 0x1f; - counter = 1; + flags = 1; } else { @@ -3870,11 +3555,11 @@ ch = ( ch << 6 ) | ( c & 0x3f ); decode_ucs4 (ch, dst); ch = 0; - counter = 0; + flags = 0; break; default: ch = ( ch << 6 ) | ( c & 0x3f ); - counter--; + flags--; } label_continue_loop:; } @@ -3884,7 +3569,6 @@ str->flags = flags; str->ch = ch; - str->counter = counter; } static void @@ -3934,7 +3618,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); @@ -3948,12 +3632,12 @@ /* 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: #endif /* ENABLE_COMPOSITE_CHARS */ - + while (n--) { unsigned char c = *src++; @@ -4652,7 +4336,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; @@ -4843,7 +4527,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); @@ -5084,8 +4768,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]; @@ -5169,7 +4853,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; @@ -5187,7 +4871,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 */ @@ -5478,7 +5162,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; @@ -5503,7 +5187,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,16 +5241,171 @@ } - +/************************************************************************/ +/* Simple internal/external functions */ +/************************************************************************/ + +static Extbyte_dynarr *conversion_out_dynarr; +static Bufbyte_dynarr *conversion_in_dynarr; + +/* Determine coding system from coding format */ + +/* #### not correct for all values of `fmt'! */ +static Lisp_Object +external_data_format_to_coding_system (enum external_data_format fmt) +{ + switch (fmt) + { + case FORMAT_FILENAME: + case FORMAT_TERMINAL: + if (EQ (Vfile_name_coding_system, Qnil) || + EQ (Vfile_name_coding_system, Qbinary)) + return Qnil; + else + return Fget_coding_system (Vfile_name_coding_system); +#ifdef MULE + case FORMAT_CTEXT: + return Fget_coding_system (Qctext); +#endif + default: + return Qnil; + } +} + +Extbyte * +convert_to_external_format (CONST Bufbyte *ptr, + Bytecount len, + Extcount *len_out, + enum external_data_format fmt) +{ + Lisp_Object coding_system = external_data_format_to_coding_system (fmt); + + if (!conversion_out_dynarr) + conversion_out_dynarr = Dynarr_new (Extbyte); + else + Dynarr_reset (conversion_out_dynarr); + + if (NILP (coding_system)) + { + CONST Bufbyte *end = ptr + len; + + for (; ptr < end;) + { + Bufbyte c = + (BYTE_ASCII_P (*ptr)) ? *ptr : + (*ptr == LEADING_BYTE_CONTROL_1) ? (*(ptr+1) - 0x20) : + (*ptr == LEADING_BYTE_LATIN_ISO8859_1) ? (*(ptr+1)) : + '~'; + + Dynarr_add (conversion_out_dynarr, (Extbyte) c); + INC_CHARPTR (ptr); + } + +#ifdef ERROR_CHECK_BUFPOS + assert (ptr == end); +#endif + } + else + { + Lisp_Object instream, outstream, da_outstream; + Lstream *istr, *ostr; + struct gcpro gcpro1, gcpro2, gcpro3; + char tempbuf[1024]; /* some random amount */ + + instream = make_fixed_buffer_input_stream ((unsigned char *) ptr, len); + da_outstream = make_dynarr_output_stream + ((unsigned_char_dynarr *) conversion_out_dynarr); + outstream = + make_encoding_output_stream (XLSTREAM (da_outstream), coding_system); + istr = XLSTREAM (instream); + ostr = XLSTREAM (outstream); + GCPRO3 (instream, outstream, da_outstream); + while (1) + { + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + if (!size_in_bytes) + break; + Lstream_write (ostr, tempbuf, size_in_bytes); + } + Lstream_close (istr); + Lstream_close (ostr); + UNGCPRO; + Lstream_delete (istr); + Lstream_delete (ostr); + Lstream_delete (XLSTREAM (da_outstream)); + } + + *len_out = Dynarr_length (conversion_out_dynarr); + Dynarr_add (conversion_out_dynarr, 0); /* remember to zero-terminate! */ + return Dynarr_atp (conversion_out_dynarr, 0); +} + +Bufbyte * +convert_from_external_format (CONST Extbyte *ptr, + Extcount len, + Bytecount *len_out, + enum external_data_format fmt) +{ + Lisp_Object coding_system = external_data_format_to_coding_system (fmt); + + if (!conversion_in_dynarr) + conversion_in_dynarr = Dynarr_new (Bufbyte); + else + Dynarr_reset (conversion_in_dynarr); + + if (NILP (coding_system)) + { + CONST Extbyte *end = ptr + len; + for (; ptr < end; ptr++) + { + Extbyte c = *ptr; + DECODE_ADD_BINARY_CHAR (c, conversion_in_dynarr); + } + } + else + { + Lisp_Object instream, outstream, da_outstream; + Lstream *istr, *ostr; + struct gcpro gcpro1, gcpro2, gcpro3; + char tempbuf[1024]; /* some random amount */ + + instream = make_fixed_buffer_input_stream ((unsigned char *) ptr, len); + da_outstream = make_dynarr_output_stream + ((unsigned_char_dynarr *) conversion_in_dynarr); + outstream = + make_decoding_output_stream (XLSTREAM (da_outstream), coding_system); + istr = XLSTREAM (instream); + ostr = XLSTREAM (outstream); + GCPRO3 (instream, outstream, da_outstream); + while (1) + { + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + if (!size_in_bytes) + break; + Lstream_write (ostr, tempbuf, size_in_bytes); + } + Lstream_close (istr); + Lstream_close (ostr); + UNGCPRO; + Lstream_delete (istr); + Lstream_delete (ostr); + Lstream_delete (XLSTREAM (da_outstream)); + } + + *len_out = Dynarr_length (conversion_in_dynarr); + Dynarr_add (conversion_in_dynarr, 0); /* remember to zero-terminate! */ + return Dynarr_atp (conversion_in_dynarr, 0); +} + + /************************************************************************/ /* Initialization */ /************************************************************************/ void -syms_of_file_coding (void) +syms_of_mule_coding (void) { - INIT_LRECORD_IMPLEMENTATION (coding_system); - + defsymbol (&Qbuffer_file_coding_system, "buffer-file-coding-system"); deferror (&Qcoding_system_error, "coding-system-error", "Coding-system error", Qio_error); @@ -5577,9 +5416,6 @@ DEFSUBR (Fcoding_system_name); DEFSUBR (Fmake_coding_system); DEFSUBR (Fcopy_coding_system); - DEFSUBR (Fcoding_system_canonical_name_p); - DEFSUBR (Fcoding_system_alias_p); - DEFSUBR (Fcoding_system_aliasee); DEFSUBR (Fdefine_coding_system_alias); DEFSUBR (Fsubsidiary_coding_system); @@ -5609,9 +5445,8 @@ DEFSUBR (Fset_char_ucs); DEFSUBR (Fchar_ucs); #endif /* MULE */ - defsymbol (&Qcoding_systemp, "coding-system-p"); + defsymbol (&Qcoding_system_p, "coding-system-p"); defsymbol (&Qno_conversion, "no-conversion"); - defsymbol (&Qraw_text, "raw-text"); #ifdef MULE defsymbol (&Qbig5, "big5"); defsymbol (&Qshift_jis, "shift-jis"); @@ -5655,6 +5490,7 @@ defsymbol (&Qdecode, "decode"); #ifdef MULE + defsymbol (&Qctext, "ctext"); defsymbol (&coding_category_symbol[CODING_CATEGORY_SHIFT_JIS], "shift-jis"); defsymbol (&coding_category_symbol[CODING_CATEGORY_BIG5], @@ -5679,7 +5515,7 @@ } void -lstream_type_create_file_coding (void) +lstream_type_create_mule_coding (void) { LSTREAM_HAS_METHOD (decoding, reader); LSTREAM_HAS_METHOD (decoding, writer); @@ -5699,18 +5535,15 @@ } void -vars_of_file_coding (void) +vars_of_mule_coding (void) { int i; - fcd = xnew (struct file_coding_dump); - dumpstruct (&fcd, &fcd_description); - /* Initialize to something reasonable ... */ for (i = 0; i <= CODING_CATEGORY_LAST; i++) { - fcd->coding_category_system[i] = Qnil; - fcd->coding_category_by_priority[i] = i; + coding_category_system[i] = Qnil; + coding_category_by_priority[i] = i; } Fprovide (intern ("file-coding")); @@ -5728,24 +5561,24 @@ Vterminal_coding_system = Qnil; DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read /* -Overriding coding system used when reading from a file or process. -You should bind this variable with `let', but do not set it globally. -If this is non-nil, it specifies the coding system that will be used -to decode input on read operations, such as from a file or process. -It overrides `buffer-file-coding-system-for-read', +Overriding coding system used when writing a file or process. +You should *bind* this, not set it. If this is non-nil, it specifies +the coding system that will be used when a file or process is read +in, and overrides `buffer-file-coding-system-for-read', `insert-file-contents-pre-hook', etc. Use those variables instead of -this one for permanent changes to the environment. */ ); +this one for permanent changes to the environment. +*/ ); Vcoding_system_for_read = Qnil; DEFVAR_LISP ("coding-system-for-write", &Vcoding_system_for_write /* -Overriding coding system used when writing to a file or process. -You should bind this variable with `let', but do not set it globally. -If this is non-nil, it specifies the coding system that will be used -to encode output for write operations, such as to a file or process. -It overrides `buffer-file-coding-system', `write-region-pre-hook', etc. -Use those variables instead of this one for permanent changes to the -environment. */ ); +Overriding coding system used when writing a file or process. +You should *bind* this, not set it. If this is non-nil, it specifies +the coding system that will be used when a file or process is wrote +in, and overrides `buffer-file-coding-system', +`write-region-pre-hook', etc. Use those variables instead of this one +for permanent changes to the environment. +*/ ); Vcoding_system_for_write = Qnil; DEFVAR_LISP ("file-name-coding-system", &Vfile_name_coding_system /* @@ -5764,14 +5597,13 @@ } void -complex_vars_of_file_coding (void) +complex_vars_of_mule_coding (void) { staticpro (&Vcoding_system_hash_table); Vcoding_system_hash_table = make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); the_codesys_prop_dynarr = Dynarr_new (codesys_prop); - dumpstruct (&the_codesys_prop_dynarr, &codesys_prop_dynarr_description); #define DEFINE_CODESYS_PROP(Prop_Type, Sym) do \ { \ @@ -5811,34 +5643,22 @@ DEFINE_CODESYS_PROP (CODESYS_PROP_CCL, Qdecode); #endif /* MULE */ /* Need to create this here or we're really screwed. */ - Fmake_coding_system - (Qraw_text, Qno_conversion, - build_string ("Raw text, which means it converts only line-break-codes."), - list2 (Qmnemonic, build_string ("Raw"))); - - Fmake_coding_system - (Qbinary, Qno_conversion, - build_string ("Binary, which means it does not convert anything."), - list4 (Qeol_type, Qlf, - Qmnemonic, build_string ("Binary"))); - - Fdefine_coding_system_alias (Qno_conversion, Qraw_text); - - Fdefine_coding_system_alias (Qfile_name, Qbinary); - - Fdefine_coding_system_alias (Qterminal, Qbinary); - Fdefine_coding_system_alias (Qkeyboard, Qbinary); + Fmake_coding_system (Qno_conversion, Qno_conversion, build_string ("No conversion"), + list2 (Qmnemonic, build_string ("Noconv"))); + + Fcopy_coding_system (Fcoding_system_property (Qno_conversion, Qeol_lf), + Qbinary); /* Need this for bootstrapping */ - fcd->coding_category_system[CODING_CATEGORY_NO_CONVERSION] = - Fget_coding_system (Qraw_text); + coding_category_system[CODING_CATEGORY_NO_CONVERSION] = + Fget_coding_system (Qno_conversion); #ifdef MULE { unsigned int i; for (i = 0; i < 65536; i++) - fcd->ucs_to_mule_table[i] = Qnil; + ucs_to_mule_table[i] = Qnil; } staticpro (&mule_to_ucs_table); mule_to_ucs_table = Fmake_char_table(Qgeneric); diff -r 12e008d41344 -r 697ef44129c6 src/file-coding.h --- a/src/file-coding.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/file-coding.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,14 +24,14 @@ /* 91.10.09 written by K.Handa <handa@etl.go.jp> */ /* Rewritten by Ben Wing <ben@xemacs.org>. */ -#ifndef INCLUDED_file_coding_h_ -#define INCLUDED_file_coding_h_ +#ifndef _XEMACS_MULE_CODING_H_ +#define _XEMACS_MULE_CODING_H_ struct decoding_stream; struct encoding_stream; /* Coding system types. These go into the TYPE field of a - Lisp_Coding_System. */ + struct Lisp_Coding_System. */ enum coding_system_type { @@ -84,8 +84,7 @@ struct lcrecord_header header; /* Name and doc string of this coding system. */ - Lisp_Object name; - Lisp_Object doc_string; + Lisp_Object name, doc_string; /* This is the major type of the coding system -- one of Big5, ISO2022, Shift-JIS, etc. See the constants above. */ @@ -95,17 +94,14 @@ system is active for a particular buffer. */ Lisp_Object mnemonic; - Lisp_Object post_read_conversion; - Lisp_Object pre_write_conversion; + Lisp_Object post_read_conversion, pre_write_conversion; - eol_type_t eol_type; + enum eol_type eol_type; /* Subsidiary coding systems that specify a particular type of EOL marking, rather than autodetecting it. These will only be non-nil if (eol_type == EOL_AUTODETECT). */ - Lisp_Object eol_lf; - Lisp_Object eol_crlf; - Lisp_Object eol_cr; + Lisp_Object eol_lf, eol_crlf, eol_cr; #ifdef MULE struct { @@ -134,17 +130,17 @@ { /* For a CCL coding system, these specify the CCL programs used for decoding (input) and encoding (output). */ - Lisp_Object decode; - Lisp_Object encode; + Lisp_Object decode, encode; } ccl; #endif }; typedef struct Lisp_Coding_System Lisp_Coding_System; -DECLARE_LRECORD (coding_system, Lisp_Coding_System); -#define XCODING_SYSTEM(x) XRECORD (x, coding_system, Lisp_Coding_System) +DECLARE_LRECORD (coding_system, struct Lisp_Coding_System); +#define XCODING_SYSTEM(x) XRECORD (x, coding_system, struct Lisp_Coding_System) #define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system) #define CODING_SYSTEMP(x) RECORDP (x, coding_system) +#define GC_CODING_SYSTEMP(x) GC_RECORDP (x, coding_system) #define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system) #define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system) @@ -254,15 +250,14 @@ EXFUN (Fsubsidiary_coding_system, 2); extern Lisp_Object Qucs4, Qutf8; -extern Lisp_Object Qbig5, Qccl, Qcharset_g0; +extern Lisp_Object Qbig5, Qbuffer_file_coding_system, Qccl, Qcharset_g0; extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error; -extern Lisp_Object Qcoding_systemp, Qcr, Qcrlf, Qdecode, Qencode; +extern Lisp_Object Qcoding_system_p, Qcr, Qcrlf, Qctext, Qdecode, Qencode; extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted; extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift; extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion; -extern Lisp_Object Qraw_text; extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion; extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven; extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read; @@ -505,7 +500,7 @@ void set_encoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, - eol_type_t *eol_type_in_out); + enum eol_type *eol_type_in_out); #ifndef MULE @@ -520,6 +515,5 @@ #define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0) #define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c) #endif /* not MULE */ +#endif /* _XEMACS_MULE_CODING_H_ */ -#endif /* INCLUDED_file_coding_h_ */ - diff -r 12e008d41344 -r 697ef44129c6 src/fileio.c --- a/src/fileio.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/fileio.c Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "events.h" @@ -53,13 +54,25 @@ #endif /* HPUX_PRE_8_0 */ #endif /* HPUX */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT +#define NOMINMAX 1 +#include <windows.h> +#include <direct.h> +#include <fcntl.h> +#include <stdlib.h> +#endif /* not WINDOWSNT */ + +#ifdef WINDOWSNT +#define CORRECT_DIR_SEPS(s) \ + do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ + else unixtodos_filename (s); \ + } while (0) #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 /* WIN32_NATIVE */ +#define DRIVE_LETTER(x) (tolower (x)) +#endif /* WINDOWSNT */ int lisp_to_time (Lisp_Object, time_t *); Lisp_Object time_to_lisp (time_t); @@ -96,6 +109,8 @@ int disable_auto_save_when_buffer_shrinks; +Lisp_Object Qfile_name_handler_alist; + Lisp_Object Vdirectory_sep_char; /* These variables describe handlers that have "already" had a chance @@ -123,7 +138,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 @@ -136,7 +151,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: */ @@ -152,14 +167,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: */ @@ -171,7 +186,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, @@ -181,7 +196,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) { @@ -196,7 +211,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, @@ -206,7 +221,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) { @@ -227,7 +242,7 @@ Lisp_Object lisp_strerror (int errnum) { - return build_ext_string (strerror (errnum), Qnative); + return build_ext_string (strerror (errnum), FORMAT_NATIVE); } static Lisp_Object @@ -267,17 +282,19 @@ signal handler) because that's way too losing. (#### Actually, longjmp()ing out of the signal handler may not be - as losing as I thought. See sys_do_signal() in sysdep.c.) */ - -ssize_t + as losing as I thought. See sys_do_signal() in sysdep.c.) + + Solaris include files declare the return value as ssize_t. + Is that standard? */ +int read_allowing_quit (int fildes, void *buf, size_t size) { QUIT; return sys_read_1 (fildes, buf, size, 1); } -ssize_t -write_allowing_quit (int fildes, const void *buf, size_t size) +int +write_allowing_quit (int fildes, CONST void *buf, size_t size) { QUIT; return sys_write_1 (fildes, buf, size, 1); @@ -420,7 +437,7 @@ p = beg + XSTRING_LENGTH (file); while (p != beg && !IS_ANY_SEP (p[-1]) -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* only recognize drive specifier at beginning */ && !(p[-1] == ':' && p == beg + 2) #endif @@ -428,14 +445,14 @@ if (p == beg) return Qnil; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* 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 = (Bufbyte*) alloca (MAXPATHLEN + 1); - if (_getdcwd (toupper (*beg) - 'A' + 1, (char *)res, MAXPATHLEN)) + Bufbyte *res = alloca (MAXPATHLEN + 1); + if (getdefdir (toupper (*beg) - 'A' + 1, res)) { char *c=((char *) res) + strlen ((char *) res); if (!IS_DIRECTORY_SEP (*c)) @@ -447,7 +464,7 @@ p = beg + strlen ((char *) beg); } } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ return make_string (beg, p - beg); } @@ -475,7 +492,7 @@ end = p = beg + XSTRING_LENGTH (file); while (p != beg && !IS_ANY_SEP (p[-1]) -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* only recognize drive specifier at beginning */ && !(p[-1] == ':' && p == beg + 2) #endif @@ -569,19 +586,28 @@ */ static int -directory_file_name (const char *src, char *dst) +directory_file_name (CONST char *src, char *dst) { - long slen = strlen (src); + long slen; + + slen = strlen (src); /* Process as Unix format: just remove any final slash. But leave "/" unchanged; do not change it to "". */ strcpy (dst, src); +#ifdef APOLLO + /* Handle // as root for apollo's. */ + if ((slen > 2 && dst[slen - 1] == '/') + || (slen > 1 && dst[0] != '/' && dst[slen - 1] == '/')) + dst[slen - 1] = 0; +#else if (slen > 1 && IS_DIRECTORY_SEP (dst[slen - 1]) -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT && !IS_ANY_SEP (dst[slen - 2]) -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ ) dst[slen - 1] = 0; +#endif /* APOLLO */ return 1; } @@ -623,10 +649,8 @@ 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 a temporary file name starting with PREFIX. +Generate 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. @@ -636,8 +660,7 @@ */ (prefix)) { - static const char tbl[64] = - { + static 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', @@ -645,12 +668,13 @@ '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','-','_' - }; + '4','5','6','7','8','9','-','_' }; + static unsigned count, count_initialized_p; Lisp_Object val; Bytecount len; Bufbyte *p, *data; + unsigned pid; CHECK_STRING (prefix); @@ -676,37 +700,44 @@ /* 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 - 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]; - } + 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; /* Here we try to minimize useless stat'ing when this function is invoked many times successively with the same PREFIX. We achieve - this by using a very pseudo-random number generator to generate - file names unique to this process, with a very long cycle. */ + 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; + } while (1) { struct stat ignored; - - p[0] = tbl[(temp_name_rand >> 0) & 63]; - p[1] = tbl[(temp_name_rand >> 6) & 63]; - p[2] = tbl[(temp_name_rand >> 12) & 63]; + unsigned num = count; + + p[0] = tbl[num & 63], num >>= 6; + p[1] = tbl[num & 63], num >>= 6; + p[2] = tbl[num & 63], num >>= 6; /* Poor man's congruential RN generator. Replace with ++count for debugging. */ - temp_name_rand += 25229; - temp_name_rand %= 225307; + count += 25229; + count %= 225307; QUIT; - if (stat ((const char *) data, &ignored) < 0) + if (stat ((CONST char *) data, &ignored) < 0) { /* We want to return only if errno is ENOENT. */ if (errno == ENOENT) @@ -746,15 +777,15 @@ Bufbyte *newdir, *p, *o; int tlen; Bufbyte *target; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT int drive = 0; int collapse_newdir = 1; #else struct passwd *pw; -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ int length; Lisp_Object handler; -#ifdef CYGWIN +#ifdef __CYGWIN32__ char *user; #endif @@ -796,18 +827,18 @@ /* 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 WIN32_NATIVE - /* Detect Windows file names with drive specifiers. */ +#ifdef WINDOWSNT + /* Detect MSDOS 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 WIN32_NATIVE */ +#else /* not WINDOWSNT */ /* Detect Unix absolute file names (/... alone is not absolute on - Windows). */ + DOS or Windows). */ && ! (IS_DIRECTORY_SEP (o[0])) -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ ) { struct gcpro gcpro1; @@ -825,15 +856,15 @@ into name should be safe during all of this, though. */ nm = XSTRING_DATA (name); -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* 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 ((char *)alloca (strlen ((char *)nm) + 1), (char *)nm); + nm = strcpy (alloca (strlen (nm) + 1), 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 = (Bufbyte *) strrchr ((char *)nm, ':'); + Bufbyte *colon = strrchr (nm, ':'); if (colon) /* Only recognize colon as part of drive specifier if there is a @@ -863,14 +894,14 @@ "//somedir". */ if (drive && IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1])) nm++; -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* 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 WIN32_NATIVE +#ifdef WINDOWSNT && (drive || IS_DIRECTORY_SEP (nm[1])) #endif ) @@ -901,7 +932,7 @@ } if (!lose) { -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* Make sure directories are all separated with / or \ as desired, but avoid allocation of a new string when not required. */ @@ -919,11 +950,11 @@ XSTRING_DATA (name)[1] = ':'; } return name; -#else /* not WIN32_NATIVE */ +#else /* not WINDOWSNT */ if (nm == XSTRING_DATA (name)) return name; return build_string ((char *) nm); -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ } } @@ -950,17 +981,15 @@ if (IS_DIRECTORY_SEP (nm[1]) || nm[1] == 0) /* ~ by itself */ { - Extbyte *newdir_external = get_home_directory (); + char * newdir_external = get_home_directory (); if (newdir_external == NULL) newdir = (Bufbyte *) ""; else - TO_INTERNAL_FORMAT (C_STRING, newdir_external, - C_STRING_ALLOCA, (* ((char **) &newdir)), - Qfile_name); + GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA (newdir_external, newdir); nm++; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT collapse_newdir = 0; #endif } @@ -979,7 +1008,7 @@ multiple user profiles users defined, each with its HOME. Therefore, the following should be reworked to handle this case. */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* 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 @@ -988,20 +1017,20 @@ newdir = (Bufbyte *) get_home_directory(); dostounix_filename (newdir); nm += strlen(o) + 1; -#else /* not WIN32_NATIVE */ -#ifdef CYGWIN +#else /* not WINDOWSNT */ +#ifdef __CYGWIN32__ if ((user = user_login_name (NULL)) != NULL) { /* Does the user login name match the ~name? */ - if (strcmp (user, (char *) o + 1) == 0) + if (strcmp(user,((char *) o + 1)) == 0) { - newdir = (Bufbyte *) get_home_directory(); + newdir = (Bufbyte *) get_home_directory(); nm = p; } } if (! newdir) { -#endif /* CYGWIN */ +#endif /* __CYGWIN32__ */ /* Jamie reports that getpwnam() can get wedged by SIGIO/SIGALARM occurring in it. (It can call select()). */ slow_down_interrupts (); @@ -1012,17 +1041,17 @@ newdir = (Bufbyte *) pw -> pw_dir; nm = p; } -#ifdef CYGWIN +#ifdef __CYGWIN32__ } #endif -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ /* If we don't find a user of that name, leave the name unchanged; don't move nm forward to p. */ } } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* 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) @@ -1031,7 +1060,7 @@ if (!IS_DIRECTORY_SEP (nm[0])) { newdir = alloca (MAXPATHLEN + 1); - if (!_getdcwd (toupper (drive) - 'A' + 1, newdir, MAXPATHLEN)) + if (!getdefdir (toupper (drive) - 'A' + 1, newdir)) newdir = NULL; } if (!newdir) @@ -1044,13 +1073,13 @@ newdir[3] = 0; } } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* Finally, if no prefix has been specified and nm is not absolute, then it must be expanded relative to default_directory. */ if (1 -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT /* /... alone is not absolute on DOS and Windows. */ && !IS_DIRECTORY_SEP (nm[0]) #else @@ -1061,12 +1090,12 @@ newdir = XSTRING_DATA (default_directory); } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT if (newdir) { /* First ensure newdir is an absolute name. */ if ( - /* Detect Windows file names with drive specifiers. */ + /* Detect MSDOS 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. */ @@ -1096,7 +1125,7 @@ newdir = alloca (MAXPATHLEN + 1); if (drive) { - if (!_getdcwd (toupper (drive) - 'A' + 1, newdir, MAXPATHLEN)) + if (!getdefdir (toupper (drive) - 'A' + 1, newdir)) newdir = "/"; } else @@ -1127,7 +1156,7 @@ newdir = ""; } } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ if (newdir) { @@ -1135,7 +1164,7 @@ just // (an incomplete UNC name). */ length = strlen ((char *) newdir); if (length > 1 && IS_DIRECTORY_SEP (newdir[length - 1]) -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT && !(length == 2 && IS_DIRECTORY_SEP (newdir[0])) #endif ) @@ -1152,14 +1181,14 @@ /* Now concatenate the directory and name to new space in the stack frame */ tlen += strlen ((char *) nm) + 1; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* 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 WIN32_NATIVE */ +#else /* not WINDOWSNT */ target = (Bufbyte *) alloca (tlen); -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ *target = 0; if (newdir) @@ -1208,7 +1237,7 @@ ++o; p += 3; } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* if drive is set, we're not dealing with an UNC, so multiple dir-seps are redundant (and reportedly cause trouble under win95) */ @@ -1221,7 +1250,7 @@ } } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* At last, set drive name, except for network file name. */ if (drive) { @@ -1234,11 +1263,15 @@ assert (IS_DIRECTORY_SEP (target[0]) && IS_DIRECTORY_SEP (target[1])); } CORRECT_DIR_SEPS (target); -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ return 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 @@ -1249,71 +1282,55 @@ */ (filename, default_)) { - /* This function can GC. */ + /* This function can GC. GC checked 1997.04.06. */ Lisp_Object expanded_name; + Lisp_Object handler; struct gcpro gcpro1; CHECK_STRING (filename); expanded_name = Fexpand_file_name (filename, default_); - GCPRO1 (expanded_name); - if (!STRINGP (expanded_name)) return Qnil; - { - Lisp_Object handler = - Ffind_file_name_handler (expanded_name, Qfile_truename); - - if (!NILP (handler)) - RETURN_UNGCPRO - (call2_check_string (handler, Qfile_truename, expanded_name)); - } + 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); { char resolved_path[MAXPATHLEN]; - Extbyte *path; - Extbyte *p; - Extcount elen; - - TO_EXTERNAL_FORMAT (LISP_STRING, expanded_name, - ALLOCA, (path, elen), - Qfile_name); - p = path; - if (elen > MAXPATHLEN) + char path[MAXPATHLEN]; + char *p = path; + int elen = XSTRING_LENGTH (expanded_name); + + if (elen >= countof (path)) goto toolong; + memcpy (path, XSTRING_DATA (expanded_name), elen + 1); + /* memset (resolved_path, 0, sizeof (resolved_path)); */ + /* Try doing it all at once. */ - /* !! Does realpath() Mule-encapsulate? - Answer: Nope! So we do it above */ - if (!xrealpath ((char *) path, resolved_path)) + /* !!#### Does realpath() Mule-encapsulate? */ + if (!xrealpath (path, resolved_path)) { /* Didn't resolve it -- have to do it one component at a time. */ /* "realpath" is a typically useless, stupid un*x piece of crap. 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. - - 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. */ + partial result returned. What a piece of junk. */ for (;;) { - p = (Extbyte *) memchr (p + 1, '/', elen - (p + 1 - path)); + p = (char *) memchr (p + 1, '/', elen - (p + 1 - path)); if (p) *p = 0; - if (xrealpath ((char *) path, resolved_path)) + /* memset (resolved_path, 0, sizeof (resolved_path)); */ + if (xrealpath (path, resolved_path)) { if (p) *p = '/'; @@ -1330,8 +1347,7 @@ /* "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); @@ -1352,20 +1368,17 @@ } { - 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] = '\0'; + resolved_path[rlen] = '/'; + resolved_path[rlen + 1] = 0; + rlen = rlen + 1; } - TO_INTERNAL_FORMAT (DATA, (resolved_path, rlen), - LISP_STRING, resolved_name, - Qfile_name); - RETURN_UNGCPRO (resolved_name); + return make_ext_string ((Bufbyte *) resolved_path, rlen, FORMAT_BINARY); } toolong: @@ -1374,7 +1387,7 @@ lose: report_file_error ("Finding truename", list1 (expanded_name)); } - RETURN_UNGCPRO (Qnil); + return Qnil; /* suppress compiler warning */ } @@ -1416,12 +1429,13 @@ for (p = nm; p != endp; p++) { if ((p[0] == '~' -#if defined (WIN32_NATIVE) || defined (CYGWIN) - /* // at start of file name is meaningful in WindowsNT systems */ +#if defined (APOLLO) || defined (WINDOWSNT) || defined (__CYGWIN32__) + /* // at start of file name is meaningful in Apollo and + WindowsNT systems */ || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm) -#else /* not (WIN32_NATIVE || CYGWIN) */ +#else /* not (APOLLO || WINDOWSNT || __CYGWIN32__) */ || IS_DIRECTORY_SEP (p[0]) -#endif /* not (WIN32_NATIVE || CYGWIN) */ +#endif /* not (APOLLO || WINDOWSNT || __CYGWIN32__) */ ) && p != nm && (IS_DIRECTORY_SEP (p[-1]))) @@ -1429,7 +1443,7 @@ nm = p; substituted = 1; } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* see comment in expand-file-name about drive specifiers */ else if (IS_DRIVE (p[0]) && p[1] == ':' && p > nm && IS_DIRECTORY_SEP (p[-1])) @@ -1437,7 +1451,7 @@ nm = p; substituted = 1; } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ } /* See if any variables are substituted into the string @@ -1477,9 +1491,9 @@ target = (Bufbyte *) alloca (s - o + 1); strncpy ((char *) target, (char *) o, s - o); target[s - o] = 0; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT strupr (target); /* $home == $HOME etc. */ -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* Get variable value */ o = (Bufbyte *) egetenv ((char *) target); @@ -1528,9 +1542,9 @@ target = (Bufbyte *) alloca (s - o + 1); strncpy ((char *) target, (char *) o, s - o); target[s - o] = 0; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT strupr (target); /* $home == $HOME etc. */ -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* Get variable value */ o = (Bufbyte *) egetenv ((char *) target); @@ -1547,16 +1561,16 @@ for (p = xnm; p != x; p++) if ((p[0] == '~' -#if defined (WIN32_NATIVE) +#if defined (APOLLO) || defined (WINDOWSNT) || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm) -#else /* not WIN32_NATIVE */ +#else /* not (APOLLO || WINDOWSNT) */ || IS_DIRECTORY_SEP (p[0]) -#endif /* not WIN32_NATIVE */ +#endif /* APOLLO || WINDOWSNT */ ) /* 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 WIN32_NATIVE +#ifdef WINDOWSNT else if (IS_DRIVE (p[0]) && p[1] == ':' && p > nm && IS_DIRECTORY_SEP (p[-1])) xnm = p; @@ -1608,7 +1622,7 @@ If the file does not exist, STATPTR->st_mode is set to 0. */ static void -barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, +barf_or_query_if_file_exists (Lisp_Object absname, CONST char *querystring, int interactive, struct stat *statptr) { /* This function can GC. GC checked 1997.04.06. */ @@ -1626,7 +1640,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)); @@ -1718,7 +1732,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 (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); @@ -1731,7 +1745,7 @@ copyable by us. */ input_file_statable_p = (fstat (ifd, &st) >= 0); -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT if (out_st.st_mode != 0 && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) { @@ -1791,7 +1805,7 @@ mtime)) report_file_error ("I/O error", list1 (newname)); } - chmod ((const char *) XSTRING_DATA (newname), + chmod ((CONST char *) XSTRING_DATA (newname), st.st_mode & 07777); } @@ -1829,7 +1843,7 @@ { return Fsignal (Qfile_error, list3 (build_translated_string ("Creating directory"), - build_translated_string ("pathname too long"), + build_translated_string ("pathame too long"), dirname_)); } strncpy (dir, (char *) XSTRING_DATA (dirname_), @@ -1871,8 +1885,8 @@ } DEFUN ("delete-file", Fdelete_file, 1, 1, "fDelete file: ", /* -Delete the file named FILENAME (a string). -If FILENAME has multiple names, it continues to exist with the other names. +Delete specified file. One argument, a file name string. +If file has multiple names, it continues to exist with the other names. */ (filename)) { @@ -1969,10 +1983,13 @@ INTP (ok_if_already_exists), 0); /* Syncing with FSF 19.34.6 note: FSF does not have conditional code for - WIN32_NATIVE here; I've removed it. --marcpa */ - - /* We have configure check for rename() and emulate using - link()/unlink() if necessary. */ + 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. */ if (0 > rename ((char *) XSTRING_DATA (filename), (char *) XSTRING_DATA (newname))) { @@ -1981,7 +1998,7 @@ Fcopy_file (filename, newname, /* We have already prompted if it was an integer, so don't have copy-file prompt again. */ - (NILP (ok_if_already_exists) ? Qnil : Qt), + ((NILP (ok_if_already_exists)) ? Qnil : Qt), Qt); Fdelete_file (filename); } @@ -2037,10 +2054,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(WIN32_NATIVE) +#if defined(WINDOWSNT) /* Windows does not support this operation. */ report_file_error ("Adding new name", Flist (2, &filename)); -#else /* not defined(WIN32_NATIVE) */ +#else /* not defined(WINDOWSNT) */ unlink ((char *) XSTRING_DATA (newname)); if (0 > link ((char *) XSTRING_DATA (filename), @@ -2049,12 +2066,13 @@ report_file_error ("Adding new name", list2 (filename, newname)); } -#endif /* defined(WIN32_NATIVE) */ +#endif /* defined(WINDOWSNT) */ 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. @@ -2066,7 +2084,6 @@ (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; @@ -2094,7 +2111,6 @@ 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", @@ -2107,11 +2123,10 @@ report_file_error ("Making symbolic link", list2 (filename, linkname)); } -#endif /* S_IFLNK */ - UNGCPRO; return Qnil; } +#endif /* S_IFLNK */ #ifdef HPUX_NET @@ -2121,21 +2136,26 @@ (path, login)) { int netresult; - const char *path_ext; - const char *login_ext; CHECK_STRING (path); CHECK_STRING (login); /* 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); - - netresult = netunam (path_ext, login_ext); - - return netresult == -1 ? Qnil : Qt; + { + char *path_ext; + char *login_ext; + + GET_C_STRING_FILENAME_DATA_ALLOCA (path, path_ext); + GET_C_STRING_EXT_DATA_ALLOCA (login, FORMAT_OS, login_ext); + + netresult = netunam (path_ext, login_ext); + } + + if (netresult == -1) + return Qnil; + else + return Qt; } #endif /* HPUX_NET */ @@ -2151,7 +2171,7 @@ CHECK_STRING (filename); ptr = XSTRING_DATA (filename); return (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT || (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2])) #endif ) ? Qt : Qnil; @@ -2162,12 +2182,12 @@ static int check_executable (char *filename) { -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT struct stat st; if (stat (filename, &st) < 0) return 0; return ((st.st_mode & S_IEXEC) != 0); -#else /* not WIN32_NATIVE */ +#else /* not WINDOWSNT */ #ifdef HAVE_EACCESS return eaccess (filename, 1) >= 0; #else @@ -2176,13 +2196,13 @@ But Unix doesn't give us a right way to do it. */ return access (filename, 1) >= 0; #endif /* HAVE_EACCESS */ -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ } /* 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); @@ -2269,14 +2289,14 @@ if (!NILP (handler)) RETURN_UNGCPRO (call2 (handler, Qfile_readable_p, abspath)); -#if defined(WIN32_NATIVE) || defined(CYGWIN) +#if defined(WINDOWSNT) || defined(__CYGWIN32__) /* 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 WIN32_NATIVE */ +#else /* not WINDOWSNT */ { int desc = interruptible_open ((char *) XSTRING_DATA (abspath), O_RDONLY | OPEN_BINARY, 0); UNGCPRO; @@ -2285,7 +2305,7 @@ close (desc); return Qt; } -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ } /* Having this before file-symlink-p mysteriously caused it to be forgotten @@ -2333,13 +2353,11 @@ (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; @@ -2354,7 +2372,6 @@ if (!NILP (handler)) return call2 (handler, Qfile_symlink_p, filename); -#ifdef S_IFLNK bufsize = 100; while (1) { @@ -2430,7 +2447,7 @@ return call2 (handler, Qfile_accessible_directory_p, filename); -#if !defined(WIN32_NATIVE) +#if !defined(WINDOWSNT) if (NILP (Ffile_directory_p (filename))) return (Qnil); else @@ -2451,7 +2468,7 @@ UNGCPRO; return tem ? Qnil : Qt; } -#endif /* !defined(WIN32_NATIVE) */ +#endif /* !defined(WINDOWSNT) */ } DEFUN ("file-regular-p", Ffile_regular_p, 1, 1, 0, /* @@ -2511,10 +2528,10 @@ return Qnil; /* Syncing with FSF 19.34.6 note: not in FSF, #if 0'ed out here. */ #if 0 -#ifdef WIN32_NATIVE +#ifdef DOS_NT if (check_executable (XSTRING_DATA (abspath))) st.st_mode |= S_IEXEC; -#endif /* WIN32_NATIVE */ +#endif /* DOS_NT */ #endif /* 0 */ return make_int (st.st_mode & 07777); @@ -2588,7 +2605,7 @@ */ ()) { -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT sync (); #endif return Qnil; @@ -2724,7 +2741,15 @@ fd = -1; - if (stat ((char *) XSTRING_DATA (filename), &st) < 0) + if ( +#ifndef APOLLO + (stat ((char *) XSTRING_DATA (filename), &st) < 0) +#else /* APOLLO */ + /* Don't even bother with interruptible_open. APOLLO sucks. */ + ((fd = open ((char *) XSTRING_DATA (filename), O_RDONLY | OPEN_BINARY, 0)) < 0 + || fstat (fd, &st) < 0) +#endif /* APOLLO */ + ) { if (fd >= 0) close (fd); badopen: @@ -2959,7 +2984,7 @@ occurs inside of the filedesc stream. */ while (1) { - ssize_t this_len; + Bytecount this_len; Charcount cc_inserted; QUIT; @@ -3008,6 +3033,9 @@ { if (!EQ (buf->undo_list, Qt)) buf->undo_list = Qnil; +#ifdef APOLLO + stat ((char *) XSTRING_DATA (filename), &st); +#endif if (NILP (handler)) { buf->modtime = st.st_mtime; @@ -3220,8 +3248,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) @@ -3313,11 +3341,21 @@ } #endif /* HAVE_FSYNC */ - /* Spurious "file has changed on disk" warnings used to be seen on - 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(). */ + /* Spurious "file has changed on disk" warnings have been + observed on Suns as well. + It seems that `close' can change the modtime, under nfs. + + (This has supposedly been fixed in Sunos 4, + but who knows about all the other machines with NFS?) */ + /* On VMS and APOLLO, must do the stat after the close + since closing changes the modtime. */ + /* As it does on Windows too - kkm */ + /* The spurious warnings appear on Linux too. Rather than handling + this on a per-system basis, unconditionally do the stat after the close - cgw */ + +#if 0 /* !defined (WINDOWSNT) */ /* !defined (VMS) && !defined (APOLLO) */ + fstat (desc, &st); +#endif /* NFS can report a write failure now. */ if (close (desc) < 0) @@ -3333,7 +3371,9 @@ unbind_to (speccount, Qnil); } + /* # if defined (WINDOWSNT) */ /* defined (VMS) || defined (APOLLO) */ stat ((char *) XSTRING_DATA (fn), &st); + /* #endif */ #ifdef CLASH_DETECTION if (!auto_saving) @@ -3869,7 +3909,7 @@ run_hook (Qauto_save_hook); - if (STRINGP (Vauto_save_list_file_name)) + if (GC_STRINGP (Vauto_save_list_file_name)) listfile = condition_case_1 (Qt, auto_save_expand_name, Vauto_save_list_file_name, @@ -3888,13 +3928,13 @@ for (do_handled_files = 0; do_handled_files < 2; do_handled_files++) { for (tail = Vbuffer_alist; - CONSP (tail); + GC_CONSP (tail); tail = XCDR (tail)) { buf = XCDR (XCAR (tail)); b = XBUFFER (buf); - if (!NILP (current_only) + if (!GC_NILP (current_only) && b != current_buffer) continue; @@ -3906,7 +3946,7 @@ /* Check for auto save enabled and file changed since last auto save and file changed since last real save. */ - if (STRINGP (b->auto_save_file_name) + if (GC_STRINGP (b->auto_save_file_name) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) && b->auto_save_modified < BUF_MODIFF (b) /* -1 means we've turned off autosaving for a while--see below. */ @@ -3951,19 +3991,19 @@ continue; } set_buffer_internal (b); - if (!auto_saved && NILP (no_message)) + if (!auto_saved && GC_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); } /* Open the auto-save list file, if necessary. We only do this now so that the file only exists if we actually auto-saved any files. */ - if (!auto_saved && STRINGP (listfile) && listdesc < 0) + if (!auto_saved && GC_STRINGP (listfile) && listdesc < 0) { listdesc = open ((char *) XSTRING_DATA (listfile), O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, @@ -3982,22 +4022,21 @@ 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, - ALLOCA, (auto_save_file_name_ext, - auto_save_file_name_ext_len), - Qfile_name); + GET_STRING_FILENAME_DATA_ALLOCA + (b->auto_save_file_name, + auto_save_file_name_ext, + auto_save_file_name_ext_len); if (!NILP (b->filename)) { - const Extbyte *filename_ext; + CONST Extbyte *filename_ext; Extcount filename_ext_len; - TO_EXTERNAL_FORMAT (LISP_STRING, b->filename, - ALLOCA, (filename_ext, - filename_ext_len), - Qfile_name); + GET_STRING_FILENAME_DATA_ALLOCA (b->filename, + filename_ext, + filename_ext_len); write (listdesc, filename_ext, filename_ext_len); } write (listdesc, "\n", 1); @@ -4053,17 +4092,17 @@ one because nothing needed to be auto-saved. Do this afterwards rather than before in case we get a crash attempting to autosave (in that case we'd still want the old one around). */ - if (listdesc < 0 && !auto_saved && STRINGP (listfile)) + if (listdesc < 0 && !auto_saved && GC_STRINGP (listfile)) unlink ((char *) XSTRING_DATA (listfile)); /* Show "...done" only if the echo area would otherwise be empty. */ 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; @@ -4141,6 +4180,7 @@ defsymbol (&Qset_visited_file_modtime, "set-visited-file-modtime"); defsymbol (&Qcar_less_than_car, "car-less-than-car"); /* Vomitous! */ + defsymbol (&Qfile_name_handler_alist, "file-name-handler-alist"); defsymbol (&Qauto_save_hook, "auto-save-hook"); defsymbol (&Qauto_save_error, "auto-save-error"); defsymbol (&Qauto_saving, "auto-saving"); @@ -4170,7 +4210,9 @@ 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 */ @@ -4296,31 +4338,5 @@ on other platforms, it is initialized so that Lisp code can find out what the normal separator is. */ ); -#ifdef WIN32_NATIVE - Vdirectory_sep_char = make_char ('\\'); -#else 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 12e008d41344 -r 697ef44129c6 src/filelock.c --- a/src/filelock.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/filelock.c Mon Aug 13 11:20:41 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,16 +63,13 @@ 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. */ @@ -93,27 +90,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 ((Bufbyte *) (lock), (file))) + (lock = (char *) alloca (XSTRING_LENGTH(file) + 2 + 1), \ + fill_in_lock_file_name (lock, (file))) static void -fill_in_lock_file_name (Bufbyte *lockfile, Lisp_Object fn) +fill_in_lock_file_name (lockfile, fn) + register char *lockfile; + register Lisp_Object fn; { - Bufbyte *file_name = XSTRING_DATA (fn); - Bufbyte *p; - size_t dirlen; + register char *p; + + strcpy (lockfile, XSTRING_DATA(fn)); - for (p = file_name + XSTRING_LENGTH (fn) - 1; - p > file_name && !IS_ANY_SEP (p[-1]); - p--) - ; - dirlen = p - file_name; + /* 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; - memcpy (lockfile, file_name, dirlen); - p = lockfile + dirlen; - *(p++) = '.'; - *(p++) = '#'; - memcpy (p, file_name + dirlen, XSTRING_LENGTH (fn) - dirlen + 1); + /* Insert the `.#'. */ + p[1] = '.'; + p[2] = '#'; } /* Lock the lock file named LFNAME. @@ -121,21 +118,21 @@ Return 1 if successful, 0 if not. */ static int -lock_file_1 (char *lfname, int force) +lock_file_1 (char *lfname,int force) { - int err; - char *lock_info_str; + register int err; + char *user_name; char *host_name; - char *user_name = user_login_name (NULL); + char *lock_info_str; - if (user_name == NULL) + if (STRINGP (Fuser_login_name (Qnil))) + user_name = (char *)XSTRING_DATA((Fuser_login_name (Qnil))); + else user_name = ""; - - if (STRINGP (Vsystem_name)) - host_name = (char *) XSTRING_DATA (Vsystem_name); + if (STRINGP (Fsystem_name ())) + host_name = (char *)XSTRING_DATA((Fsystem_name ())); else host_name = ""; - lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) + LOCK_PID_MAX + 5); @@ -143,7 +140,7 @@ (unsigned long) getpid ()); err = symlink (lock_info_str, lfname); - if (err != 0 && errno == EEXIST && force) + if (errno == EEXIST && force) { unlink (lfname); err = symlink (lock_info_str, lfname); @@ -160,7 +157,7 @@ static int current_lock_owner (lock_info_type *owner, char *lfname) { - int len, ret; + int o, p, len, ret; int local_owner = 0; char *at, *dot; char *lfinfo = 0; @@ -174,7 +171,7 @@ len = readlink (lfname, lfinfo, bufsize); } while (len >= bufsize); - + /* If nonexistent lock file, all is well; otherwise, got strange error. */ if (len == -1) { @@ -184,7 +181,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) @@ -192,7 +189,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, '@'); @@ -205,7 +202,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); @@ -217,10 +214,10 @@ /* We're done looking at the link info. */ xfree (lfinfo); - + /* On current host? */ - if (STRINGP (Fsystem_name ()) - && strcmp (owner->host, (char *) XSTRING_DATA (Fsystem_name ())) == 0) + if (STRINGP (Fsystem_name ()) + && strcmp (owner->host, XSTRING_DATA(Fsystem_name ())) == 0) { if (owner->pid == getpid ()) ret = 2; /* We own it. */ @@ -239,7 +236,7 @@ here's where we'd do it. */ ret = 1; } - + /* Avoid garbage. */ if (local_owner || ret <= 0) { @@ -263,7 +260,7 @@ if (errno != EEXIST) return -1; - + locker = current_lock_owner (clasher, lfname); if (locker == 2) { @@ -302,7 +299,7 @@ /* 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; @@ -326,7 +323,7 @@ && NILP (Fverify_visited_file_modtime (subject_buf)) && !NILP (Ffile_exists_p (fn))) call1_in_buffer (XBUFFER(subject_buf), - Qask_user_about_supersession_threat, fn); + Qask_user_about_supersession_threat, fn); } /* Try to lock the lock. */ @@ -340,7 +337,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)); @@ -359,9 +356,6 @@ unlock_file (Lisp_Object fn) { register char *lfname; - struct gcpro gcpro1; - - GCPRO1 (fn); fn = Fexpand_file_name (fn, Qnil); @@ -369,29 +363,28 @@ if (current_lock_owner (0, lfname) == 2) unlink (lfname); - - UNGCPRO; } void -unlock_all_files (void) +unlock_all_files () { register Lisp_Object tail; + register struct buffer *b; - for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) + for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail)) { - struct buffer *b = XBUFFER (XCDR (XCAR (tail))); + 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. -FILE defaults to current buffer's visited file, + Lock FILE, if current buffer is modified.\n\ +FILE defaults to current buffer's visited file,\n\ or else nothing is done if current buffer isn't visiting a file. */ - (file)) + (file)) { if (NILP (file)) file = current_buffer->file_truename; @@ -435,18 +428,15 @@ } DEFUN ("file-locked-p", Ffile_locked_p, 0, 1, 0, /* -Return nil if the FILENAME is not locked, + Return nil if the FILENAME is not locked,\n\ 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); @@ -463,8 +453,6 @@ if (owner > 0) FREE_LOCK_INFO (locker); - UNGCPRO; - return ret; } diff -r 12e008d41344 -r 697ef44129c6 src/filemode.c --- a/src/filemode.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/filemode.c Mon Aug 13 11:20:41 2007 +0200 @@ -79,9 +79,9 @@ mode_string (unsigned short mode, char *str) { str[0] = ftypelet (mode); - rwx ((unsigned short) ((mode & 0700) << 0), &str[1]); - rwx ((unsigned short) ((mode & 0070) << 3), &str[4]); - rwx ((unsigned short) ((mode & 0007) << 6), &str[7]); + rwx ((mode & 0700) << 0, &str[1]); + rwx ((mode & 0070) << 3, &str[4]); + rwx ((mode & 0007) << 6, &str[7]); setst (mode, str); } diff -r 12e008d41344 -r 697ef44129c6 src/floatfns.c --- a/src/floatfns.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/floatfns.c Mon Aug 13 11:20:41 2007 +0200 @@ -55,13 +55,9 @@ #define THIS_FILENAME floatfns #include "sysfloat.h" -/* The code uses emacs_rint, so that it works to undefine HAVE_RINT - if `rint' exists but does not work right. */ -#ifdef HAVE_RINT -#define emacs_rint rint -#else +#ifndef HAVE_RINT static double -emacs_rint (double x) +rint (double x) { double r = floor (x + 0.5); double diff = fabs (r - x); @@ -79,7 +75,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. @@ -112,21 +108,21 @@ #define arith_error(op,arg) \ - Fsignal (Qarith_error, list2 (build_string (op), arg)) + Fsignal (Qarith_error, list2 (build_string ((op)), (arg))) #define range_error(op,arg) \ - Fsignal (Qrange_error, list2 (build_string (op), arg)) + Fsignal (Qrange_error, list2 (build_string ((op)), (arg))) #define range_error2(op,a1,a2) \ - Fsignal (Qrange_error, list3 (build_string (op), a1, a2)) + Fsignal (Qrange_error, list3 (build_string ((op)), (a1), (a2))) #define domain_error(op,arg) \ - Fsignal (Qdomain_error, list2 (build_string (op), arg)) + Fsignal (Qdomain_error, list2 (build_string ((op)), (arg))) #define domain_error2(op,a1,a2) \ - Fsignal (Qdomain_error, list3 (build_string (op), a1, a2)) + Fsignal (Qdomain_error, list3 (build_string ((op)), (a1), (a2))) /* 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) @@ -164,7 +160,7 @@ static Lisp_Object -mark_float (Lisp_Object obj) +mark_float (Lisp_Object obj, void (*markobj) (Lisp_Object)) { return Qnil; } @@ -183,14 +179,9 @@ return (unsigned long) fmod (extract_float (obj), 4e9); } -static const struct lrecord_description float_description[] = { - { XD_END } -}; - DEFINE_BASIC_LRECORD_IMPLEMENTATION ("float", float, mark_float, print_float, 0, float_equal, - float_hash, float_description, - Lisp_Float); + float_hash, struct Lisp_Float); /* Extract a Lisp number as a `double', or signal an error. */ @@ -705,19 +696,19 @@ double f = extract_float (arg); if (f == 0.0) - return make_int (- (EMACS_INT)(((EMACS_UINT) 1) << (VALBITS - 1))); /* most-negative-fixnum */ + return make_int (- (int)((((EMACS_UINT) 1) << (VALBITS - 1)))); /* most-negative-fixnum */ #ifdef HAVE_LOGB { Lisp_Object val; - IN_FLOAT (val = make_int ((EMACS_INT) logb (f)), "logb", arg); - return val; + IN_FLOAT (val = make_int ((int) logb (f)), "logb", arg); + return (val); } #else #ifdef HAVE_FREXP { int exqp; IN_FLOAT (frexp (f, &exqp), "logb", arg); - return make_int (exqp - 1); + return (make_int (exqp - 1)); } #else { @@ -741,7 +732,7 @@ f /= d; val += i; } - return make_int (val); + return (make_int (val)); } #endif /* ! HAVE_FREXP */ #endif /* ! HAVE_LOGB */ @@ -835,7 +826,7 @@ { double d; /* Screw the prevailing rounding mode. */ - IN_FLOAT ((d = emacs_rint (XFLOAT_DATA (arg))), "round", arg); + IN_FLOAT ((d = rint (XFLOAT_DATA (arg))), "round", arg); return (float_to_int (d, "round", arg, Qunbound)); } #endif /* LISP_FLOAT_TYPE */ @@ -895,7 +886,7 @@ (arg)) { double d = extract_float (arg); - IN_FLOAT (d = emacs_rint (d), "fround", arg); + IN_FLOAT (d = rint (d), "fround", arg); return make_float (d); } @@ -988,7 +979,6 @@ void syms_of_floatfns (void) { - INIT_LRECORD_IMPLEMENTATION (float); /* Trig functions. */ diff -r 12e008d41344 -r 697ef44129c6 src/fns.c --- a/src/fns.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/fns.c Mon Aug 13 11:20:41 2007 +0200 @@ -36,7 +36,10 @@ #include "lisp.h" -#include "sysfile.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <errno.h> #include "buffer.h" #include "bytecode.h" @@ -58,7 +61,7 @@ static int internal_old_equal (Lisp_Object, Lisp_Object, int); static Lisp_Object -mark_bit_vector (Lisp_Object obj) +mark_bit_vector (Lisp_Object obj, void (*markobj) (Lisp_Object)) { return Qnil; } @@ -66,10 +69,10 @@ static void print_bit_vector (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - size_t i; - Lisp_Bit_Vector *v = XBIT_VECTOR (obj); - size_t len = bit_vector_length (v); - size_t last = len; + int i; + struct Lisp_Bit_Vector *v = XBIT_VECTOR (obj); + int len = bit_vector_length (v); + int last = len; if (INTP (Vprint_length)) last = min (len, XINT (Vprint_length)); @@ -89,8 +92,8 @@ static int bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1); - Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2); + struct Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1); + struct Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2); return ((bit_vector_length (v1) == bit_vector_length (v2)) && !memcmp (v1->bits, v2->bits, @@ -101,32 +104,17 @@ static unsigned long bit_vector_hash (Lisp_Object obj, int depth) { - Lisp_Bit_Vector *v = XBIT_VECTOR (obj); + struct Lisp_Bit_Vector *v = XBIT_VECTOR (obj); return HASH2 (bit_vector_length (v), memory_hash (v->bits, BIT_VECTOR_LONG_STORAGE (bit_vector_length (v)) * 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_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); +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("bit-vector", bit_vector, + mark_bit_vector, print_bit_vector, 0, + bit_vector_equal, bit_vector_hash, + struct Lisp_Bit_Vector); DEFUN ("identity", Fidentity, 1, 1, 0, /* Return the argument unchanged. @@ -189,7 +177,7 @@ return XINT (Flength (seq)); else { - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq); + struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq); return (f->flags.interactivep ? COMPILED_INTERACTIVE : f->flags.domainp ? COMPILED_DOMAIN : @@ -201,7 +189,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 @@ -220,7 +208,7 @@ return make_int (XSTRING_CHAR_LENGTH (sequence)); else if (CONSP (sequence)) { - size_t len; + int len; GET_EXTERNAL_LIST_LENGTH (sequence, len); return make_int (len); } @@ -247,7 +235,7 @@ (list)) { Lisp_Object hare, tortoise; - size_t len; + int len; for (hare = tortoise = list, len = 0; CONSP (hare) && (! EQ (hare, tortoise) || len == 0); @@ -273,7 +261,7 @@ (s1, s2)) { Bytecount len; - Lisp_String *p1, *p2; + struct Lisp_String *p1, *p2; if (SYMBOLP (s1)) p1 = XSYMBOL (s1)->name; @@ -320,7 +308,7 @@ */ (s1, s2)) { - Lisp_String *p1, *p2; + struct Lisp_String *p1, *p2; Charcount end, len2; int i; @@ -351,41 +339,32 @@ properly, it would still not work because strcoll() does not handle multiple locales. This is the fundamental flaw in the locale model. */ - { - Bytecount bcend = charcount_to_bytecount (string_data (p1), end); - /* Compare strings using collation order of locale. */ - /* Need to be tricky to handle embedded nulls. */ - - for (i = 0; i < bcend; i += strlen((char *) string_data (p1) + i) + 1) - { - int val = strcoll ((char *) string_data (p1) + i, - (char *) string_data (p2) + i); - if (val < 0) - return Qt; - if (val > 0) - return Qnil; - } - } + Bytecount bcend = charcount_to_bytecount (string_data (p1), end); + /* Compare strings using collation order of locale. */ + /* Need to be tricky to handle embedded nulls. */ + + for (i = 0; i < bcend; i += strlen((char *) string_data (p1) + i) + 1) + { + int val = strcoll ((char *) string_data (p1) + i, + (char *) string_data (p2) + i); + if (val < 0) + return Qt; + if (val > 0) + return Qnil; + } #else /* not I18N2, or MULE */ - { - Bufbyte *ptr1 = string_data (p1); - Bufbyte *ptr2 = string_data (p2); - - /* #### It is not really necessary to do this: We could compare - byte-by-byte and still get a reasonable comparison, since this - would compare characters with a charset in the same way. With - a little rearrangement of the leading bytes, we could make most - inter-charset comparisons work out the same, too; even if some - don't, this is not a big deal because inter-charset comparisons - aren't really well-defined anyway. */ - for (i = 0; i < end; i++) - { - if (charptr_emchar (ptr1) != charptr_emchar (ptr2)) - return charptr_emchar (ptr1) < charptr_emchar (ptr2) ? Qt : Qnil; - INC_CHARPTR (ptr1); - INC_CHARPTR (ptr2); - } - } + /* #### It is not really necessary to do this: We could compare + byte-by-byte and still get a reasonable comparison, since this + would compare characters with a charset in the same way. + With a little rearrangement of the leading bytes, we could + make most inter-charset comparisons work out the same, too; + even if some don't, this is not a big deal because inter-charset + comparisons aren't really well-defined anyway. */ + for (i = 0; i < end; i++) + { + if (string_char (p1, i) != string_char (p2, i)) + return string_char (p1, i) < string_char (p2, i) ? Qt : Qnil; + } #endif /* not I18N2, or MULE */ /* Can't do i < len2 because then comparison between "foo" and "foo^@" won't work right in I18N2 case */ @@ -399,7 +378,7 @@ */ (string)) { - Lisp_String *s; + struct Lisp_String *s; CHECK_STRING (string); s = XSTRING (string); @@ -412,7 +391,7 @@ void bump_string_modiff (Lisp_Object str) { - Lisp_String *s = XSTRING (str); + struct Lisp_String *s = XSTRING (str); Lisp_Object *ptr = &s->plist; #ifdef I18N3 @@ -527,7 +506,7 @@ Lisp_Object list_copy = Fcons (XCAR (list), XCDR (list)); Lisp_Object last = list_copy; Lisp_Object hare, tortoise; - size_t len; + int len; for (tortoise = hare = XCDR (list), len = 1; CONSP (hare); @@ -902,7 +881,7 @@ (string, from, to)) { Charcount ccfr, ccto; - Bytecount bfr, blen; + Bytecount bfr, bto; Lisp_Object val; CHECK_STRING (string); @@ -910,90 +889,93 @@ get_string_range_char (string, from, to, &ccfr, &ccto, GB_HISTORICAL_STRING_BEHAVIOR); bfr = charcount_to_bytecount (XSTRING_DATA (string), ccfr); - blen = charcount_to_bytecount (XSTRING_DATA (string) + bfr, ccto - ccfr); - val = make_string (XSTRING_DATA (string) + bfr, blen); + bto = charcount_to_bytecount (XSTRING_DATA (string), ccto); + val = make_string (XSTRING_DATA (string) + bfr, bto - bfr); /* Copy any applicable extent information into the new string: */ - copy_string_extents (val, string, 0, bfr, blen); + copy_string_extents (val, string, 0, bfr, bto - bfr); return val; } DEFUN ("subseq", Fsubseq, 2, 3, 0, /* -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. +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. */ - (sequence, start, end)) + (seq, from, to)) { - 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; + 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; else { - CHECK_INT (end); - e = XINT (end); - if (e < 0) - e = len + e; + CHECK_INT (to); + t = XINT (to); + if (t < 0) + t = len + t; } - if (!(0 <= s && s <= e && e <= len)) - args_out_of_range_3 (sequence, make_int (s), make_int (e)); - - if (VECTORP (sequence)) + if (!(0 <= f && f <= t && t <= len)) + args_out_of_range_3 (seq, make_int (f), make_int (t)); + + if (VECTORP (seq)) { - Lisp_Object result = make_vector (e - s, Qnil); - EMACS_INT i; - Lisp_Object *in_elts = XVECTOR_DATA (sequence); + Lisp_Object result = make_vector (t - f, Qnil); + int i; + Lisp_Object *in_elts = XVECTOR_DATA (seq); Lisp_Object *out_elts = XVECTOR_DATA (result); - for (i = s; i < e; i++) - out_elts[i - s] = in_elts[i]; + for (i = f; i < t; i++) + out_elts[i - f] = in_elts[i]; return result; } - else if (LISTP (sequence)) + + if (LISTP (seq)) { Lisp_Object result = Qnil; - EMACS_INT i; - - sequence = Fnthcdr (make_int (s), sequence); - - for (i = s; i < e; i++) + int i; + + seq = Fnthcdr (make_int (f), seq); + + for (i = f; i < t; i++) { - result = Fcons (Fcar (sequence), result); - sequence = Fcdr (sequence); + result = Fcons (Fcar (seq), result); + seq = Fcdr (seq); } return Fnreverse (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; - } + + /* bit vector */ + { + Lisp_Object result = make_bit_vector (t - f, Qzero); + 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; + } } @@ -1002,7 +984,7 @@ */ (n, list)) { - REGISTER size_t i; + REGISTER int i; REGISTER Lisp_Object tail = list; CHECK_NATNUM (n); for (i = XINT (n); i; i--) @@ -1061,7 +1043,7 @@ #ifdef LOSING_BYTECODE else if (COMPILED_FUNCTIONP (sequence)) { - EMACS_INT idx = XINT (n); + int idx = XINT (n); if (idx < 0) { lose: @@ -1113,7 +1095,7 @@ */ (list, n)) { - EMACS_INT int_n, count; + int int_n, count; Lisp_Object retval, tortoise, hare; CHECK_LIST (list); @@ -1149,7 +1131,7 @@ */ (list, n)) { - EMACS_INT int_n; + int int_n; CHECK_LIST (list); @@ -1852,7 +1834,7 @@ plists_differ (Lisp_Object a, Lisp_Object b, int nil_means_not_present, int laxp, int depth) { - int eqp = (depth == -1); /* -1 as depth means use eq, not equal. */ + int eqp = (depth == -1); /* -1 as depth means us eq, not equal. */ int la, lb, m, i, fill; Lisp_Object *keys, *vals; char *flags; @@ -1896,10 +1878,10 @@ { if (!laxp ? EQ (k, keys [i]) : internal_equal (k, keys [i], depth)) { - if (eqp - /* We narrowly escaped being Ebolified here. */ - ? !EQ_WITH_EBOLA_NOTICE (v, vals [i]) - : !internal_equal (v, vals [i], depth)) + if ((eqp + /* We narrowly escaped being Ebolified here. */ + ? !EQ_WITH_EBOLA_NOTICE (v, vals [i]) + : !internal_equal (v, vals [i], depth))) /* a property in B has a different value than in A */ goto MISMATCH; flags [i] = 1; @@ -2370,7 +2352,8 @@ 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. +the plist; that means it's a malformed or circular plist or has non-symbols +as keywords. */ (plist)) { @@ -2447,7 +2430,9 @@ (lax_plist, prop, default_)) { Lisp_Object val = external_plist_get (&lax_plist, prop, 1, ERROR_ME); - return UNBOUNDP (val) ? default_ : val; + if (UNBOUNDP (val)) + return default_; + return val; } DEFUN ("lax-plist-put", Flax_plist_put, 3, 3, 0, /* @@ -2567,87 +2552,228 @@ 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 (struct 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 (struct 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 (struct 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 (struct Lisp_String *s, Lisp_Object property) +{ + return external_remprop (string_plist_ptr (s), property, 0, ERROR_ME); +} + +static Lisp_Object +string_plist (struct Lisp_String *s) +{ + return *string_plist_ptr (s); +} + DEFUN ("get", Fget, 2, 3, 0, /* -Return the value of OBJECT's PROPERTY property. -This is the last VALUE stored with `(put OBJECT PROPERTY VALUE)'. +Return the value of OBJECT's PROPNAME property. +This is the last VALUE stored with `(put OBJECT PROPNAME VALUE)'. If there is no such property, return optional third arg DEFAULT -\(which defaults to `nil'). OBJECT can be a symbol, string, extent, -face, or glyph. See also `put', `remprop', and `object-plist'. +\(which defaults to `nil'). OBJECT can be a symbol, face, extent, +or string. See also `put', `remprop', and `object-plist'. */ - (object, property, default_)) + (object, propname, default_)) { /* Various places in emacs call Fget() and expect it not to quit, so don't quit. */ - Lisp_Object val; - - if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->getprop) - val = XRECORD_LHEADER_IMPLEMENTATION (object)->getprop (object, property); + + /* 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; + } + } else - signal_simple_error ("Object type has no properties", object); - - return UNBOUNDP (val) ? default_ : val; + { + noprops: + signal_simple_error ("Object type has no properties", object); + return Qnil; /* Not reached */ + } } DEFUN ("put", Fput, 3, 3, 0, /* -Set OBJECT's PROPERTY to VALUE. -It can be subsequently retrieved with `(get OBJECT PROPERTY)'. -OBJECT can be a symbol, face, extent, or string. +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. + 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, property, value)) + (object, propname, value)) { + CHECK_SYMBOL (propname); CHECK_LISP_WRITEABLE (object); - if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->putprop) + if (SYMBOLP (object)) + symbol_putprop (object, propname, value); + else if (STRINGP (object)) + string_putprop (XSTRING (object), propname, value); + else if (LRECORDP (object)) { - if (! XRECORD_LHEADER_IMPLEMENTATION (object)->putprop - (object, property, value)) - signal_simple_error ("Can't set property on object", property); + 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; } else - signal_simple_error ("Object type has no settable properties", object); + { + noprops: + signal_simple_error ("Object type has no settable properties", object); + } return value; } +void +pure_put (Lisp_Object sym, Lisp_Object prop, Lisp_Object val) +{ + Fput (sym, prop, Fpurecopy (val)); +} + DEFUN ("remprop", Fremprop, 2, 2, 0, /* -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'. +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'. */ - (object, property)) + (object, propname)) { - int ret = 0; - + int retval = 0; + + CHECK_SYMBOL (propname); CHECK_LISP_WRITEABLE (object); - if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->remprop) + if (SYMBOLP (object)) + retval = symbol_remprop (object, propname); + else if (STRINGP (object)) + retval = string_remprop (XSTRING (object), propname); + else if (LRECORDP (object)) { - ret = XRECORD_LHEADER_IMPLEMENTATION (object)->remprop (object, property); - if (ret == -1) - signal_simple_error ("Can't remove property from object", property); + 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; } else - signal_simple_error ("Object type has no removable properties", object); - - return ret ? Qt : Qnil; + { + noprops: + signal_simple_error ("Object type has no removable properties", object); + } + + return retval ? Qt : Qnil; } DEFUN ("object-plist", Fobject_plist, 1, 1, 0, /* -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. +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.) */ (object)) { - if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->plist) - return XRECORD_LHEADER_IMPLEMENTATION (object)->plist (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); + } else signal_simple_error ("Object type has no properties", object); @@ -2668,7 +2794,7 @@ return 0; if (LRECORDP (obj1)) { - const struct lrecord_implementation + CONST struct lrecord_implementation *imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1), *imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2); @@ -2728,7 +2854,7 @@ DEFUN ("fillarray", Ffillarray, 2, 2, 0, /* -Destructively modify ARRAY by replacing each element with ITEM. +Store each element of ARRAY with ITEM. ARRAY is a vector, bit vector, or string. */ (array, item)) @@ -2736,28 +2862,15 @@ retry: if (STRINGP (array)) { - Lisp_String *s = XSTRING (array); - Bytecount old_bytecount = string_length (s); - Bytecount new_bytecount; - Bytecount item_bytecount; - Bufbyte item_buf[MAX_EMCHAR_LEN]; - Bufbyte *p; - Bufbyte *end; - + Emchar charval; + struct Lisp_String *s = XSTRING (array); + Charcount len = string_char_length (s); + Charcount i; CHECK_CHAR_COERCE_INT (item); CHECK_LISP_WRITEABLE (array); - - item_bytecount = set_charptr_emchar (item_buf, XCHAR (item)); - new_bytecount = item_bytecount * string_char_length (s); - - resize_string (s, -1, new_bytecount - old_bytecount); - - for (p = string_data (s), end = p + new_bytecount; - p < end; - p += item_bytecount) - memcpy (p, item_buf, item_bytecount); - *p = '\0'; - + charval = XCHAR (item); + for (i = 0; i < len; i++) + set_string_char (s, i, charval); bump_string_modiff (array); } else if (VECTORP (array)) @@ -2770,7 +2883,7 @@ } else if (BIT_VECTORP (array)) { - Lisp_Bit_Vector *v = XBIT_VECTOR (array); + struct Lisp_Bit_Vector *v = XBIT_VECTOR (array); int len = bit_vector_length (v); int bit; CHECK_BIT (item); @@ -2920,16 +3033,15 @@ } -/* This is the guts of several mapping functions. - Apply FUNCTION to each element of SEQUENCE, one by one, - storing the results into elements of VALS, a C vector of Lisp_Objects. - LENI is the length of VALS, which should also be the length of SEQUENCE. +/* This is the guts of all mapping functions. + Apply fn to each element of seq, one by one, + storing the results into elements of vals, a C vector of Lisp_Objects. + leni is the length of vals, which should also be the length of seq. If VALS is a null pointer, do not accumulate the results. */ static void -mapcar1 (size_t leni, Lisp_Object *vals, - Lisp_Object function, Lisp_Object sequence) +mapcar1 (size_t leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) { Lisp_Object result; Lisp_Object args[2]; @@ -2942,61 +3054,21 @@ gcpro1.nvars = 0; } - args[0] = function; - - if (LISTP (sequence)) + args[0] = fn; + + if (LISTP (seq)) { - /* A devious `function' could either: - - insert garbage into the list in front of us, causing XCDR to crash - - amputate the list behind us using (setcdr), causing the remaining - elts to lose their GCPRO status. - - if (vals != 0) we avoid this by copying the elts into the - `vals' array. By a stroke of luck, `vals' is exactly large - enough to hold the elts left to be traversed as well as the - results computed so far. - - 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. */ - - if (vals) + for (i = 0; i < leni; i++) { - Lisp_Object *val = vals; - Lisp_Object elt; - - LIST_LOOP_2 (elt, sequence) - *val++ = elt; - - gcpro1.nvars = leni; - - for (i = 0; i < leni; i++) - { - args[1] = vals[i]; - vals[i] = Ffuncall (2, args); - } - } - else - { - Lisp_Object elt, tail; - struct gcpro ngcpro1; - - NGCPRO1 (tail); - - { - EXTERNAL_LIST_LOOP_3 (elt, sequence, tail) - { - args[1] = elt; - Ffuncall (2, args); - } - } - - NUNGCPRO; + args[1] = XCAR (seq); + seq = XCDR (seq); + result = Ffuncall (2, args); + if (vals) vals[gcpro1.nvars++] = result; } } - else if (VECTORP (sequence)) + else if (VECTORP (seq)) { - Lisp_Object *objs = XVECTOR_DATA (sequence); + Lisp_Object *objs = XVECTOR_DATA (seq); for (i = 0; i < leni; i++) { args[1] = *objs++; @@ -3004,16 +3076,10 @@ if (vals) vals[gcpro1.nvars++] = result; } } - else if (STRINGP (sequence)) + else if (STRINGP (seq)) { - /* The string data of `sequence' might be relocated during GC. */ - Bytecount slen = XSTRING_LENGTH (sequence); - Bufbyte *p = alloca_array (Bufbyte, slen); - Bufbyte *end = p + slen; - - memcpy (p, XSTRING_DATA (sequence), slen); - - while (p < end) + Bufbyte *p = XSTRING_DATA (seq); + for (i = 0; i < leni; i++) { args[1] = make_char (charptr_emchar (p)); INC_CHARPTR (p); @@ -3021,9 +3087,9 @@ if (vals) vals[gcpro1.nvars++] = result; } } - else if (BIT_VECTORP (sequence)) + else if (BIT_VECTORP (seq)) { - Lisp_Bit_Vector *v = XBIT_VECTOR (sequence); + struct Lisp_Bit_Vector *v = XBIT_VECTOR (seq); for (i = 0; i < leni; i++) { args[1] = make_int (bit_vector_bit (v, i)); @@ -3032,130 +3098,86 @@ } } else - abort (); /* unreachable, since Flength (sequence) did not get an error */ + abort(); /* cannot get here since Flength(seq) did not get an error */ if (vals) UNGCPRO; } DEFUN ("mapconcat", Fmapconcat, 3, 3, 0, /* -Apply FUNCTION to each element of SEQUENCE, and concat the results as strings. -In between each pair of results, insert SEPARATOR. Thus, using " " as -SEPARATOR results in spaces between the values returned by FUNCTION. -SEQUENCE may be a list, a vector, a bit vector, or a string. +Apply FN to each element of SEQ, and concat the results as strings. +In between each pair of results, stick in SEP. +Thus, " " as SEP results in spaces between the values returned by FN. */ - (function, sequence, separator)) + (fn, seq, sep)) { - size_t len = XINT (Flength (sequence)); + size_t len = XINT (Flength (seq)); Lisp_Object *args; int i; + struct gcpro gcpro1; int nargs = len + len - 1; - if (len == 0) return build_string (""); + if (nargs < 0) return build_string (""); args = alloca_array (Lisp_Object, nargs); - mapcar1 (len, args, function, sequence); + GCPRO1 (sep); + mapcar1 (len, args, fn, seq); + UNGCPRO; for (i = len - 1; i >= 0; i--) args[i + i] = args[i]; for (i = 1; i < nargs; i += 2) - args[i] = separator; + args[i] = sep; return Fconcat (nargs, args); } DEFUN ("mapcar", Fmapcar, 2, 2, 0, /* -Apply FUNCTION to each element of SEQUENCE; return a list of the results. -The result is a list of the same length as SEQUENCE. +Apply FUNCTION to each element of SEQUENCE, and make a list of the results. +The result is a list just as long as SEQUENCE. SEQUENCE may be a list, a vector, a bit vector, or a string. */ - (function, sequence)) + (fn, seq)) { - size_t len = XINT (Flength (sequence)); + size_t len = XINT (Flength (seq)); Lisp_Object *args = alloca_array (Lisp_Object, len); - mapcar1 (len, args, function, sequence); + mapcar1 (len, args, fn, seq); return Flist (len, args); } DEFUN ("mapvector", Fmapvector, 2, 2, 0, /* -Apply FUNCTION to each element of SEQUENCE; return a vector of the results. +Apply FUNCTION to each element of SEQUENCE, making a vector of the results. The result is a vector of the same length as SEQUENCE. -SEQUENCE may be a list, a vector, a bit vector, or a string. +SEQUENCE may be a list, a vector or a string. */ - (function, sequence)) + (fn, seq)) { - size_t len = XINT (Flength (sequence)); + size_t len = XINT (Flength (seq)); Lisp_Object result = make_vector (len, Qnil); struct gcpro gcpro1; GCPRO1 (result); - mapcar1 (len, XVECTOR_DATA (result), function, sequence); + mapcar1 (len, XVECTOR_DATA (result), fn, seq); UNGCPRO; return result; } -DEFUN ("mapc-internal", Fmapc_internal, 2, 2, 0, /* +DEFUN ("mapc", Fmapc, 2, 2, 0, /* Apply FUNCTION to each element of SEQUENCE. SEQUENCE may be a list, a vector, a bit vector, or a string. This function is like `mapcar' but does not accumulate the results, which is more efficient if you do not use the results. - -The difference between this and `mapc' is that `mapc' supports all -the spiffy Common Lisp arguments. You should normally use `mapc'. */ - (function, sequence)) -{ - mapcar1 (XINT (Flength (sequence)), 0, function, sequence); - - return sequence; -} - - - - -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)) + (fn, seq)) { - 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; + mapcar1 (XINT (Flength (seq)), 0, fn, seq); + + return seq; } @@ -3230,13 +3252,10 @@ (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 -<bug-gnu-emacs@gnu.org>. +<bug-gnu-emacs@prep.ai.mit.edu>. */ (fexp)) { @@ -3363,12 +3382,9 @@ } /* base64 encode/decode functions. - - Originally based on code from GNU recode. Ported to FSF Emacs by - Lars Magne Ingebrigtsen and Karl Heuer. Ported to XEmacs and - subsequently heavily hacked by Hrvoje Niksic. */ - -#define MIME_LINE_LENGTH 72 + Based on code from GNU recode. */ + +#define MIME_LINE_LENGTH 76 #define IS_ASCII(Character) \ ((Character) < 128) @@ -3424,11 +3440,11 @@ base64 characters. */ #define ADVANCE_INPUT(c, stream) \ - ((ec = Lstream_get_emchar (stream)) == -1 ? 0 : \ + (ec = Lstream_get_emchar (stream), \ + ec == -1 ? 0 : \ ((ec > 255) ? \ - (signal_simple_error ("Non-ascii character in base64 input", \ - make_char (ec)), 0) \ - : (c = (Bufbyte)ec), 1)) + (error ("Non-ascii character detected in base64 input"), 0) \ + : (c = (Bufbyte)ec, 1))) static Bytind base64_encode_1 (Lstream *istream, Bufbyte *to, int line_break) @@ -3488,90 +3504,98 @@ } #undef ADVANCE_INPUT -/* Get next character from the stream, except that non-base64 - characters are ignored. This is in accordance with rfc2045. EC - should be an Emchar, so that it can hold -1 as the value for EOF. */ -#define ADVANCE_INPUT_IGNORE_NONBASE64(ec, stream, streampos) do { \ - ec = Lstream_get_emchar (stream); \ - ++streampos; \ - /* IS_BASE64 may not be called with negative arguments so check for \ - EOF first. */ \ - if (ec < 0 || IS_BASE64 (ec) || ec == '=') \ - break; \ -} while (1) - -#define STORE_BYTE(pos, val, ccnt) do { \ +#define ADVANCE_INPUT(c, stream) \ + (ec = Lstream_get_emchar (stream), \ + ec == -1 ? 0 : (c = (Bufbyte)ec, 1)) + +#define STORE_BYTE(pos, val) do { \ pos += set_charptr_emchar (pos, (Emchar)((unsigned char)(val))); \ - ++ccnt; \ + ++*ccptr; \ } while (0) static Bytind base64_decode_1 (Lstream *istream, Bufbyte *to, Charcount *ccptr) { - Charcount ccnt = 0; + Emchar ec; Bufbyte *e = to; - EMACS_INT streampos = 0; - + unsigned long value; + + *ccptr = 0; while (1) { - Emchar ec; - unsigned long value; + Bufbyte c; + + if (!ADVANCE_INPUT (c, istream)) + break; + + /* Accept wrapping lines. */ + if (c == '\r') + { + if (!ADVANCE_INPUT (c, istream) + || c != '\n') + return -1; + } + if (c == '\n') + { + if (!ADVANCE_INPUT (c, istream)) + break; + /* FSF checks for end of text here, but that's wrong. */ + /* FSF checks for correct line length here; that's also + wrong; some MIME encoders use different line lengths. */ + } /* Process first byte of a quadruplet. */ - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - break; - if (ec == '=') - signal_simple_error ("Illegal `=' character while decoding base64", - make_int (streampos)); - value = base64_char_to_value[ec] << 18; + if (!IS_BASE64 (c)) + return -1; + value = base64_char_to_value[c] << 18; /* Process second byte of a quadruplet. */ - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - error ("Premature EOF while decoding base64"); - if (ec == '=') - signal_simple_error ("Illegal `=' character while decoding base64", - make_int (streampos)); - value |= base64_char_to_value[ec] << 12; - STORE_BYTE (e, value >> 16, ccnt); + if (!ADVANCE_INPUT (c, istream)) + return -1; + + if (!IS_BASE64 (c)) + return -1; + value |= base64_char_to_value[c] << 12; + + STORE_BYTE (e, value >> 16); /* Process third byte of a quadruplet. */ - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - error ("Premature EOF while decoding base64"); - - if (ec == '=') + if (!ADVANCE_INPUT (c, istream)) + return -1; + + if (c == '=') { - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - error ("Premature EOF while decoding base64"); - if (ec != '=') - signal_simple_error ("Padding `=' expected but not found while decoding base64", - make_int (streampos)); + if (!ADVANCE_INPUT (c, istream)) + return -1; + if (c != '=') + return -1; continue; } - value |= base64_char_to_value[ec] << 6; - STORE_BYTE (e, 0xff & value >> 8, ccnt); + if (!IS_BASE64 (c)) + return -1; + value |= base64_char_to_value[c] << 6; + + STORE_BYTE (e, 0xff & value >> 8); /* Process fourth byte of a quadruplet. */ - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - error ("Premature EOF while decoding base64"); - if (ec == '=') + if (!ADVANCE_INPUT (c, istream)) + return -1; + + if (c == '=') continue; - value |= base64_char_to_value[ec]; - STORE_BYTE (e, 0xff & value, ccnt); + if (!IS_BASE64 (c)) + return -1; + value |= base64_char_to_value[c]; + + STORE_BYTE (e, 0xff & value); } - *ccptr = ccnt; return e - to; } #undef ADVANCE_INPUT -#undef ADVANCE_INPUT_IGNORE_NONBASE64 -#undef STORE_BYTE +#undef INPUT_EOF_P static Lisp_Object free_malloced_ptr (Lisp_Object unwind_obj) @@ -3648,8 +3672,8 @@ XMALLOC_UNBIND (encoded, allength, speccount); buffer_delete_range (buf, begv + encoded_length, zv + encoded_length, 0); - /* Simulate FSF Emacs implementation of this function: if point was - in the region, place it at the beginning. */ + /* Simulate FSF Emacs: if point was in the region, place it at the + beginning. */ if (old_pt >= begv && old_pt < zv) BUF_SET_PT (buf, begv); @@ -3690,7 +3714,6 @@ Base64-decode the region between BEG and END. Return the length of the decoded text. If the region can't be decoded, return nil and don't modify the buffer. -Characters out of the base64 alphabet are ignored. */ (beg, end)) { @@ -3715,6 +3738,13 @@ abort (); Lstream_delete (XLSTREAM (input)); + if (decoded_length < 0) + { + /* The decoding wasn't possible. */ + XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount); + return Qnil; + } + /* Now we have decoded the region, so we insert the new contents and delete the old. (Insert first in order to preserve markers.) */ BUF_SET_PT (buf, begv); @@ -3723,8 +3753,8 @@ buffer_delete_range (buf, begv + cc_decoded_length, zv + cc_decoded_length, 0); - /* Simulate FSF Emacs implementation of this function: if point was - in the region, place it at the beginning. */ + /* Simulate FSF Emacs: if point was in the region, place it at the + beginning. */ if (old_pt >= begv && old_pt < zv) BUF_SET_PT (buf, begv); @@ -3733,7 +3763,6 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, 1, 1, 0, /* Base64-decode STRING and return the result. -Characters out of the base64 alphabet are ignored. */ (string)) { @@ -3756,6 +3785,13 @@ abort (); Lstream_delete (XLSTREAM (input)); + if (decoded_length < 0) + { + /* The decoding wasn't possible. */ + XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount); + return Qnil; + } + result = make_string (decoded, decoded_length); XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount); return result; @@ -3766,8 +3802,6 @@ 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"); @@ -3845,9 +3879,8 @@ DEFSUBR (Fnconc); DEFSUBR (Fmapcar); DEFSUBR (Fmapvector); - DEFSUBR (Fmapc_internal); + DEFSUBR (Fmapc); DEFSUBR (Fmapconcat); - DEFSUBR (Freplace_list); DEFSUBR (Fload_average); DEFSUBR (Ffeaturep); DEFSUBR (Frequire); diff -r 12e008d41344 -r 697ef44129c6 src/font-lock.c --- a/src/font-lock.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/font-lock.c Mon Aug 13 11:20:41 2007 +0200 @@ -414,7 +414,8 @@ find_context (struct buffer *buf, Bufpos pt) { /* This function can GC */ - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = + XCHAR_TABLE (buf->mirror_syntax_table); Lisp_Object syntaxtab = buf->syntax_table; Emchar prev_c, c; Bufpos target = pt; @@ -768,14 +769,8 @@ } void -reinit_vars_of_font_lock (void) +vars_of_font_lock (void) { xzero (context_cache); xzero (bol_context_cache); } - -void -vars_of_font_lock (void) -{ - reinit_vars_of_font_lock (); -} diff -r 12e008d41344 -r 697ef44129c6 src/frame-msw.c --- a/src/frame-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/frame-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -58,7 +58,7 @@ #define POPUP_WIDTH 30 #define POPUP_HEIGHT 10 -/* Default regular frame size, in characters */ +/* Default popup size, in characters */ #define DEFAULT_FRAME_WIDTH 80 #define DEFAULT_FRAME_HEIGHT 35 @@ -70,32 +70,12 @@ /* Default properties to use when creating frames. */ Lisp_Object Vdefault_mswindows_frame_plist; -Lisp_Object Vdefault_msprinter_frame_plist; Lisp_Object Vmswindows_use_system_frame_size_defaults; /* This does not need to be GC protected, as it holds a frame Lisp_Object already protected by Fmake_frame */ Lisp_Object Vmswindows_frame_being_created; -/*---------------------------------------------------------------------*/ -/*----- 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) { @@ -142,17 +122,19 @@ 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) = make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); #endif /* hashtable of instantiated glyphs on the frame. */ - 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) = + FRAME_MSWINDOWS_WIDGET_HASH_TABLE (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 */ @@ -200,8 +182,8 @@ XEMACS_CLASS, STRINGP(f->name) ? XSTRING_DATA(f->name) : (STRINGP(name) ? - (const Extbyte*)XSTRING_DATA(name) : - (const Extbyte*)XEMACS_CLASS), + (CONST Extbyte*)XSTRING_DATA(name) : + (CONST Extbyte*)XEMACS_CLASS), style, rect_default.left, rect_default.top, rect_default.width, rect_default.height, @@ -216,6 +198,7 @@ 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); } @@ -265,15 +248,13 @@ } static void -mswindows_mark_frame (struct frame *f) +mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object)) { - mark_object (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); + markobj (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); #ifdef HAVE_TOOLBARS - mark_object (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f)); + markobj (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f)); #endif - mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f)); - mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f)); - mark_object (FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f)); + markobj (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f)); } static void @@ -287,6 +268,7 @@ { if (f->frame_data) { + DeleteDC(FRAME_MSWINDOWS_CDC(f)); ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f)); DestroyWindow(FRAME_MSWINDOWS_HANDLE(f)); xfree (f->frame_data); @@ -612,8 +594,7 @@ bugs (and is more consistent with X) so I am going to reenable it. --andyp */ if ( FRAME_PIXWIDTH (f) && FRAME_PIXHEIGHT (f) - && (width_specified_p || height_specified_p - || x_specified_p || y_specified_p)) + && (width_specified_p || height_specified_p || x_specified_p || y_specified_p)) { XEMACS_RECT_WH dest = { x, y, width, height }; @@ -623,10 +604,11 @@ void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest) { - RECT rect, ws_rect; + RECT 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) @@ -649,44 +631,32 @@ GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL, GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE)); - /* resize and move the window so that it fits in the workspace. This is + /* resize and move the window so that it fits on the screen. 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 > ws_rect.right - ws_rect.left) + if (pixel_width > DEVICE_MSWINDOWS_HORZRES(d)) { - pixel_width = ws_rect.right - ws_rect.left; + pixel_width = DEVICE_MSWINDOWS_HORZRES(d); size_p=1; } - if (pixel_height > ws_rect.bottom - ws_rect.top) + if (pixel_height > DEVICE_MSWINDOWS_VERTRES(d)) { - pixel_height = ws_rect.bottom - ws_rect.top; + pixel_height = DEVICE_MSWINDOWS_VERTRES(d); size_p=1; } - /* adjust position so window is in workspace */ - if (dest->left + pixel_width > ws_rect.right) + /* adjust position so window is on screen */ + if (dest->left + pixel_width > DEVICE_MSWINDOWS_HORZRES(d)) { - dest->left = ws_rect.right - pixel_width; + dest->left = DEVICE_MSWINDOWS_HORZRES(d) - pixel_width; move_p=1; } - if (dest->left < ws_rect.left) + if (dest->top + pixel_height > DEVICE_MSWINDOWS_VERTRES(d)) { - dest->left = ws_rect.left; - move_p=1; - } - - 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; + dest->top = DEVICE_MSWINDOWS_VERTRES(d) - pixel_height; move_p=1; } @@ -729,307 +699,10 @@ return IsZoomed (FRAME_MSWINDOWS_HANDLE (f)); } -/*---------------------------------------------------------------------*/ -/*----- PRINTER FRAME -----*/ -/*---------------------------------------------------------------------*/ - -/* - * With some drvier/os combination (I discovered this with HP drviers - * 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); -} - -static void -maybe_error_if_job_active (struct frame *f) -{ - if (FRAME_MSPRINTER_JOB_STARTED (f)) - error_frame_unsizable (f); -} - -static void -msprinter_init_frame_1 (struct frame *f, Lisp_Object props) -{ - /* 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."); - - f->frame_data = xnew_and_zero (struct msprinter_frame); - - /* Default margin size is 1" = 1440 twips */ - FRAME_MSPRINTER_TOP_MARGIN(f) = 1440; - FRAME_MSPRINTER_BOTTOM_MARGIN(f) = 1440; - FRAME_MSPRINTER_LEFT_MARGIN(f) = 1440; - FRAME_MSPRINTER_RIGHT_MARGIN(f) = 1440; - - /* Negative for "uinspecified" */ - FRAME_MSPRINTER_CHARWIDTH(f) = -1; - FRAME_MSPRINTER_CHARHEIGHT(f) = -1; -} - -static void -msprinter_init_frame_3 (struct frame *f) -{ - DOCINFO di; - struct device *device = XDEVICE (FRAME_DEVICE (f)); - HDC hdc; - int frame_left, frame_top, frame_width, frame_height; - - /* 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) = - MulDiv (GetDeviceCaps (hdc, PHYSICALWIDTH) - - (frame_left + frame_width), 1440, - GetDeviceCaps (hdc, LOGPIXELSX)); - } - else - frame_width = (GetDeviceCaps (hdc, PHYSICALWIDTH) - - frame_left - - MulDiv (GetDeviceCaps (hdc, LOGPIXELSX), - FRAME_MSPRINTER_RIGHT_MARGIN(f), 1440)); - - frame_top = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSY), - FRAME_MSPRINTER_TOP_MARGIN(f), 1440) - - GetDeviceCaps (hdc, PHYSICALOFFSETY)); - - if (FRAME_MSPRINTER_CHARHEIGHT(f) > 0) - { - char_to_real_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT(f), - NULL, &frame_height); - - 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 - - MulDiv (GetDeviceCaps (hdc, LOGPIXELSY), - FRAME_MSPRINTER_BOTTOM_MARGIN(f), 1440)); - - /* Geometry sanity checks */ - if (!frame_pixsize_valid_p (f, frame_width, frame_height)) - error ("Area inside print margins has shrunk to naught."); - - 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."); - - /* Apply XEmacs frame geometry and layout windows */ - { - int rows, columns; - FRAME_PIXWIDTH(f) = frame_width; - FRAME_PIXHEIGHT(f) = frame_height; - pixel_to_char_size (f, frame_width, frame_height, &columns, &rows); - change_frame_size (f, rows, columns, 0); - } - - FRAME_MSPRINTER_PIXLEFT(f) = frame_left; - FRAME_MSPRINTER_PIXTOP(f) = frame_top; - - /* Start print job */ - di.cbSize = sizeof (di); - di.lpszDocName = (STRINGP(f->name) - ? (char*) XSTRING_DATA(f->name) - : "XEmacs print document"); - di.lpszOutput = NULL; - di.lpszDatatype = NULL; - di.fwType = 0; - - if (StartDoc (hdc, &di) <= 0) - error ("Cannot start print job"); - - apply_dc_geometry (f); - - /* Finish frame setup */ - FRAME_MSPRINTER_JOB_STARTED (f) = 1; - FRAME_VISIBLE_P(f) = 0; -} - -static void -msprinter_mark_frame (struct frame *f) -{ -} - -static void -msprinter_delete_frame (struct frame *f) -{ - 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 (hdc); - xfree (f->frame_data); - } - - f->frame_data = 0; -} - -static Lisp_Object -msprinter_frame_property (struct frame *f, Lisp_Object property) -{ - if (EQ (Qleft_margin, property)) - return make_int (FRAME_MSPRINTER_LEFT_MARGIN(f)); - else if (EQ (Qtop_margin, property)) - return make_int (FRAME_MSPRINTER_TOP_MARGIN(f)); - if (EQ (Qright_margin, property)) - return make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f)); - else if (EQ (Qbottom_margin, property)) - return make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f)); - else - return Qunbound; -} - -static int -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)); -} - -static Lisp_Object -msprinter_frame_properties (struct frame *f) -{ - Lisp_Object props = Qnil; - props = cons3 (Qbottom_margin, - make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f)), props); - props = cons3 (Qright_margin, - make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f)), props); - props = cons3 (Qtop_margin, - make_int (FRAME_MSPRINTER_TOP_MARGIN(f)), props); - props = cons3 (Qleft_margin, - make_int (FRAME_MSPRINTER_LEFT_MARGIN(f)), props); - return props; -} - -static void -msprinter_set_frame_properties (struct frame *f, Lisp_Object plist) -{ - Lisp_Object tail; - - /* Extract the properties from plist */ - for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail))) - { - Lisp_Object prop = Fcar (tail); - Lisp_Object val = Fcar (Fcdr (tail)); - - if (SYMBOLP (prop)) - { - if (EQ (prop, Qwidth)) - { - maybe_error_if_job_active (f); - if (!NILP (val)) - { - CHECK_NATNUM (val); - FRAME_MSPRINTER_CHARWIDTH(f) = XINT (val); - } - } - if (EQ (prop, Qheight)) - { - maybe_error_if_job_active (f); - if (!NILP (val)) - { - CHECK_NATNUM (val); - FRAME_MSPRINTER_CHARHEIGHT(f) = XINT (val); - } - } - else if (EQ (prop, Qleft_margin)) - { - maybe_error_if_job_active (f); - CHECK_NATNUM (val); - FRAME_MSPRINTER_LEFT_MARGIN(f) = XINT (val); - } - else if (EQ (prop, Qtop_margin)) - { - maybe_error_if_job_active (f); - CHECK_NATNUM (val); - FRAME_MSPRINTER_TOP_MARGIN(f) = XINT (val); - } - else if (EQ (prop, Qright_margin)) - { - maybe_error_if_job_active (f); - CHECK_NATNUM (val); - FRAME_MSPRINTER_RIGHT_MARGIN(f) = XINT (val); - } - else if (EQ (prop, Qbottom_margin)) - { - maybe_error_if_job_active (f); - CHECK_NATNUM (val); - FRAME_MSPRINTER_BOTTOM_MARGIN(f) = XINT (val); - } - } - } -} - -static void -msprinter_set_frame_size (struct frame *f, int width, int height) -{ - /* We're absolutely unsizeable */ - 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 */ + /* frame methods */ CONSOLE_HAS_METHOD (mswindows, init_frame_1); CONSOLE_HAS_METHOD (mswindows, init_frame_2); CONSOLE_HAS_METHOD (mswindows, init_frame_3); @@ -1060,18 +733,6 @@ CONSOLE_HAS_METHOD (mswindows, get_frame_parent); CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits); CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p); - - /* Printer frames, aka print jobs */ - CONSOLE_HAS_METHOD (msprinter, init_frame_1); - CONSOLE_HAS_METHOD (msprinter, init_frame_3); - CONSOLE_HAS_METHOD (msprinter, mark_frame); - CONSOLE_HAS_METHOD (msprinter, delete_frame); - CONSOLE_HAS_METHOD (msprinter, frame_property); - CONSOLE_HAS_METHOD (msprinter, internal_frame_property_p); - 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 @@ -1080,16 +741,10 @@ } void -reinit_vars_of_frame_mswindows (void) +vars_of_frame_mswindows (void) { /* Needn't staticpro -- see comment above. */ Vmswindows_frame_being_created = Qnil; -} - -void -vars_of_frame_mswindows (void) -{ - reinit_vars_of_frame_mswindows (); 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. @@ -1138,43 +793,4 @@ mswindows_console_methods->device_specific_frame_props = &Vdefault_mswindows_frame_plist; - - DEFVAR_LISP ("default-msprinter-frame-plist", &Vdefault_msprinter_frame_plist /* -Plist of default frame-creation properties for msprinter print job frames. -These override what is specified in `default-frame-plist', but are -overridden by the arguments to the particular call to `make-frame'. - -Note: In many cases, properties of a frame are available as specifiers -instead of through the frame-properties mechanism. - -Here is a list of recognized frame properties, other than those -documented in `set-frame-properties' (they can be queried and -set at any time, except as otherwise noted): - - left-margin Margin of the page, in twips. Twip is a - 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 - defaults to one inch (25.4 mm). - - MARGINS NOTE. right-margin and bottom-margin are overridden by - the height and width properties. If you want to specify size - of the printable area in character, as with the rest of XEmacs, - use these properties. If height and/or width are nil, then - corresponding margin setting is taken into account. If you - specify height and/or width in `default-frame-plist', but still - want to specify right/bottom margins, set height/width in this - plist to nil, as in this example: - - (setq default-frame-plist '(height 55 'width 80) - default-msprinter-frame-plist '(height nil 'width nil)) - -See also `default-frame-plist', which specifies properties which apply -to all frames, not just mswindows frames. -*/ ); - Vdefault_msprinter_frame_plist = Qnil; - - msprinter_console_methods->device_specific_frame_props = - &Vdefault_msprinter_frame_plist; } diff -r 12e008d41344 -r 697ef44129c6 src/frame-tty.c --- a/src/frame-tty.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/frame-tty.c Mon Aug 13 11:20:41 2007 +0200 @@ -33,6 +33,10 @@ #include "events.h" +#ifdef HAVE_GPM +#include <gpm.h> +#endif + /* Default properties to use when creating frames. */ Lisp_Object Vdefault_tty_frame_plist; @@ -82,6 +86,33 @@ call1 (Qinit_post_tty_win, FRAME_CONSOLE (f)); } +#ifdef HAVE_GPM +static int +tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y) +{ + Gpm_Event ev; + int num_buttons; + + num_buttons = Gpm_GetSnapshot(&ev); + *x = ev.x; + *y = ev.y; + *frame = DEVICE_SELECTED_FRAME (d); + return (1); +} + +static void +tty_set_mouse_position (struct window *w, int x, int y) +{ + /* XXX + I couldn't find any GPM functions that set the mouse position. + Mr. Perry had left this function empty; that must be why. + karlheg + */ +} + +#endif + + /* Change from withdrawn state to mapped state. */ static void tty_make_frame_visible (struct frame *f) @@ -192,6 +223,10 @@ CONSOLE_HAS_METHOD (tty, init_frame_1); CONSOLE_HAS_METHOD (tty, init_frame_3); CONSOLE_HAS_METHOD (tty, after_init_frame); +#ifdef HAVE_GPM + CONSOLE_HAS_METHOD (tty, get_mouse_position); + CONSOLE_HAS_METHOD (tty, set_mouse_position); +#endif CONSOLE_HAS_METHOD (tty, make_frame_visible); CONSOLE_HAS_METHOD (tty, make_frame_invisible); CONSOLE_HAS_METHOD (tty, frame_visible_p); diff -r 12e008d41344 -r 697ef44129c6 src/frame-x.c --- a/src/frame-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/frame-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -50,7 +50,6 @@ #include "faces.h" #include "frame.h" #include "window.h" -#include "gutter.h" #ifdef HAVE_DRAGNDROP #include "dragdrop.h" @@ -104,34 +103,19 @@ struct frame * x_any_window_to_frame (struct device *d, Window wdesc) { - Widget w; - assert (DEVICE_X_P (d)); - - w = XtWindowToWidget (DEVICE_X_DISPLAY (d), wdesc); - - if (!w) - return 0; - - /* 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 - 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) */ - return x_any_widget_or_parent_to_frame (d, w); -} - -static struct frame * -x_find_frame_for_window (struct device *d, Window wdesc) -{ Lisp_Object tail, frame; struct frame *f; + + assert (DEVICE_X_P (d)); + /* This function was previously written to accept only a window argument (and to loop over all devices looking for a matching window), but that is incorrect because window ID's are not unique across displays. */ for (tail = DEVICE_FRAME_LIST (d); CONSP (tail); tail = XCDR (tail)) { + int i; + frame = XCAR (tail); f = XFRAME (frame); /* This frame matches if the window is any of its widgets. */ @@ -154,18 +138,18 @@ would incorrectly get sucked away by Emacs if this function matched on psheet widgets. */ - /* Note: that this called only from - x_any_widget_or_parent_to_frame it is unnecessary to iterate - over the top level widgets. */ - - /* Note: we use to special case scrollbars but this turns out to be a bad idea - because - 1. We sometimes get events for _unmapped_ scrollbars and our - callers don't want us to fail. - 2. Starting with the 21.2 widget stuff there are now loads of - widgets to check and it is easy to forget adding them in a loop here. - See x_any_window_to_frame - 3. We pick up all widgets now anyway. */ + for (i = 0; i < FRAME_X_NUM_TOP_WIDGETS (f); i++) + { + Widget wid = FRAME_X_TOP_WIDGETS (f)[i]; + if (wid && XtIsManaged (wid) && wdesc == XtWindow (wid)) + return f; + } + +#ifdef HAVE_SCROLLBARS + /* Match if the window is one of this frame's scrollbars. */ + if (x_window_is_scrollbar (f, wdesc)) + return f; +#endif } return 0; @@ -176,7 +160,7 @@ { while (widget) { - struct frame *f = x_find_frame_for_window (d, XtWindow (widget)); + struct frame *f = x_any_window_to_frame (d, XtWindow (widget)); if (f) return f; widget = XtParent (widget); @@ -344,7 +328,7 @@ XSetClassHint (dpy, XtWindow (shell), &classhint); } -#ifndef HAVE_WMCOMMAND +#ifndef HAVE_SESSION static void x_wm_maybe_store_wm_command (struct frame *f) { @@ -395,7 +379,7 @@ } } -#endif /* !HAVE_WMCOMMAND */ +#endif /* !HAVE_SESSION */ static int x_frame_iconified_p (struct frame *f) @@ -437,9 +421,9 @@ init_x_prop_symbols (void) { #define def(sym, rsrc) \ - Fput (sym, Qx_resource_name, build_string (rsrc)) + pure_put (sym, Qx_resource_name, build_string (rsrc)) #define defi(sym,rsrc) \ - def (sym, rsrc); Fput (sym, Qintegerp, Qt) + def (sym, rsrc); pure_put (sym, Qintegerp, Qt) #if 0 /* this interferes with things. #### fix this right */ def (Qminibuffer, XtNminibuffer); @@ -660,17 +644,15 @@ 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); + GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA ((CONST char *) value, tmp); new_XtValue = (String) tmp; break; } #endif /* MULE */ - /* #### Caching is device-independent - belongs in update_frame_title. */ + /* ### Caching is device-independent - belongs in update_frame_title. */ Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) { @@ -761,22 +743,18 @@ 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); + GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop); if (STRINGP (val)) { - const Extbyte *extval; + CONST Extbyte *extval; Extcount extvallen; - TO_EXTERNAL_FORMAT (LISP_STRING, val, - ALLOCA, (extval, extvallen), - Qctext); + GET_STRING_CTEXT_DATA_ALLOCA (val, extval, extvallen); XtVaSetValues (w, XtVaTypedArg, extprop, XtRString, extval, extvallen + 1, (XtArgVal) NULL); @@ -1110,7 +1088,7 @@ unsigned int modifier = 0, state = 0; char *Ctext; int numItems = 0, textlen = 0, pos = 0; - Lisp_Event *lisp_event = XEVENT (event); + struct Lisp_Event *lisp_event = XEVENT(event); Lisp_Object item = Qnil; struct gcpro gcpro1; @@ -1147,12 +1125,12 @@ x_event.xbutton.y_root = lisp_event->event.button.y; } modifier = lisp_event->event.button.modifiers; - 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; + 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; state |= Button1Mask << (lisp_event->event.button.button-1); x_event.xbutton.state = state; @@ -1192,7 +1170,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); } @@ -1262,7 +1240,7 @@ { filePath = transferInfo->dropData->data.files[ii]; hurl = dnd_url_hexify_string ((char *)filePath, "file:"); - /* #### Mule-izing required */ + /* ### Mule-izing required */ l_data = Fcons (make_string ((Bufbyte* )hurl, strlen (hurl)), l_data); @@ -1337,7 +1315,7 @@ char *dnd_data = NULL; unsigned long dnd_len = 0; int dnd_typ = DndText, dnd_dealloc = 0; - Lisp_Event *lisp_event = XEVENT (event); + struct Lisp_Event *lisp_event = XEVENT(event); /* only drag if this is really a press */ if (EVENT_TYPE(lisp_event) != button_press_event) @@ -1368,7 +1346,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); } @@ -1413,12 +1391,12 @@ } modifier = lisp_event->event.button.modifiers; - 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; + 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; state |= Button1Mask << (lisp_event->event.button.button-1); x_event.xbutton.state = state; @@ -1551,16 +1529,13 @@ { struct window *win = XWINDOW (f->root_window); - 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); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); + WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) - + FRAME_LEFT_GUTTER_BOUNDS (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); } } @@ -1865,7 +1840,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; @@ -1876,9 +1851,7 @@ #endif if (STRINGP (f->name)) - TO_EXTERNAL_FORMAT (LISP_STRING, f->name, - C_STRING_ALLOCA, name, - Qctext); + GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, name); else name = "emacs"; @@ -1907,7 +1880,7 @@ char *string; CHECK_STRING (lisp_window_id); - string = (char *) XSTRING_DATA (lisp_window_id); + string = (char *) (XSTRING_DATA (lisp_window_id)); if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X')) sscanf (string+2, "%lxu", &window_id); #if 0 @@ -2086,9 +2059,9 @@ /* tell the window manager about us. */ x_wm_store_class_hints (shell_widget, XtName (frame_widget)); -#ifndef HAVE_WMCOMMAND +#ifndef HAVE_SESSION x_wm_maybe_store_wm_command (f); -#endif /* HAVE_WMCOMMAND */ +#endif /* HAVE_SESSION */ x_wm_hack_wm_protocols (shell_widget); } @@ -2217,10 +2190,10 @@ } static void -x_mark_frame (struct frame *f) +x_mark_frame (struct frame *f, void (*markobj) (Lisp_Object)) { - mark_object (FRAME_X_ICON_PIXMAP (f)); - mark_object (FRAME_X_ICON_PIXMAP_MASK (f)); + markobj (FRAME_X_ICON_PIXMAP (f)); + markobj (FRAME_X_ICON_PIXMAP_MASK (f)); } static void @@ -2652,10 +2625,10 @@ { Display *dpy; -#ifndef HAVE_WMCOMMAND +#ifndef HAVE_SESSION if (FRAME_X_TOP_LEVEL_FRAME_P (f)) x_wm_maybe_move_wm_command (f); -#endif /* HAVE_WMCOMMAND */ +#endif /* HAVE_SESSION */ #ifdef HAVE_CDE DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f)); @@ -2676,7 +2649,7 @@ #else XtDestroyWidget (FRAME_X_SHELL_WIDGET (f)); /* make sure the windows are really gone! */ - /* #### Is this REALLY necessary? */ + /* ### Is this REALLY necessary? */ XFlush (dpy); #endif /* EXTERNAL_WIDGET */ diff -r 12e008d41344 -r 697ef44129c6 src/frame.c --- a/src/frame.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/frame.c Mon Aug 13 11:20:41 2007 +0200 @@ -34,7 +34,6 @@ #include "faces.h" #include "frame.h" #include "glyphs.h" -#include "gutter.h" #include "menubar.h" #include "redisplay.h" #include "scrollbar.h" @@ -86,6 +85,7 @@ Lisp_Object Qborder_width; Lisp_Object Qframep, Qframe_live_p; +Lisp_Object Qframe_x_p, Qframe_tty_p; Lisp_Object Qdelete_frame; Lisp_Object Qframe_title_format, Vframe_title_format; @@ -116,22 +116,22 @@ Lisp_Object Qframe_being_created; static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val); -static struct display_line title_string_display_line; -/* Used by generate_title_string. Global because they get used so much that - 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) +mark_frame (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct frame *f = XFRAME (obj); -#define MARKED_SLOT(x) mark_object (f->x) +#define MARKED_SLOT(x) ((void) (markobj (f->x))); #include "frameslots.h" + mark_subwindow_cachels (f->subwindow_cachels, markobj); + if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */ - MAYBE_FRAMEMETH (f, mark_frame, (f)); + MAYBE_FRAMEMETH (f, mark_frame, (f, markobj)); return Qnil; } @@ -155,13 +155,13 @@ } DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, - mark_frame, print_frame, 0, 0, 0, 0, + mark_frame, print_frame, 0, 0, 0, struct frame); static void nuke_all_frame_slots (struct frame *f) { -#define MARKED_SLOT(x) f->x = Qnil +#define MARKED_SLOT(x) f->x = Qnil; #include "frameslots.h" } @@ -206,13 +206,7 @@ f->last_nonminibuf_window = root_window; /* cache of subwindows visible on frame */ - 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); + f->subwindow_cachels = Dynarr_new (subwindow_cachel); /* Choose a buffer for the frame's root window. */ XWINDOW (root_window)->buffer = Qt; @@ -224,7 +218,7 @@ a space), try to find another one. */ if (string_char (XSTRING (Fbuffer_name (buf)), 0) == ' ') buf = Fother_buffer (buf, Qnil, Qnil); - Fset_window_buffer (root_window, buf, Qnil); + Fset_window_buffer (root_window, buf); } return f; @@ -247,7 +241,7 @@ f->has_minibuffer = 1; XWINDOW (mini_window)->buffer = Qt; - Fset_window_buffer (mini_window, Vminibuffer_zero, Qt); + Fset_window_buffer (mini_window, Vminibuffer_zero); } /* Make a frame using a separate minibuffer window on another frame. @@ -268,9 +262,7 @@ FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame)))) error ("frame and minibuffer must be on the same console"); - /* Do not create a default minibuffer frame on printer devices. */ - if (NILP (mini_window) - && DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (f)))) + if (NILP (mini_window)) { struct console *con = XCONSOLE (FRAME_CONSOLE (f)); /* Use default-minibuffer-frame if possible. */ @@ -285,13 +277,8 @@ } /* Install the chosen minibuffer window, with proper buffer. */ - if (!NILP (mini_window)) - { - store_minibuf_frame_prop (f, mini_window); - Fset_window_buffer (mini_window, Vminibuffer_zero, Qt); - } - else - f->minibuffer_window = Qnil; + store_minibuf_frame_prop (f, mini_window); + Fset_window_buffer (mini_window, Vminibuffer_zero); } /* Make a frame containing only a minibuffer window. */ @@ -321,7 +308,7 @@ /* Put the proper buffer in that window. */ - Fset_window_buffer (mini_window, Vminibuffer_zero, Qt); + Fset_window_buffer (mini_window, Vminibuffer_zero); } static Lisp_Object @@ -385,7 +372,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); @@ -422,7 +409,7 @@ update_frame_window_mirror (f); - if (initialized && !DEVICE_STREAM_P (d)) + if (initialized) { if (!NILP (f->minibuffer_window)) reset_face_cachels (XWINDOW (f->minibuffer_window)); @@ -471,7 +458,7 @@ #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); } @@ -504,18 +491,6 @@ 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) @@ -916,13 +891,10 @@ 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; + MARK_TOOLBAR_CHANGED; #endif - MARK_GUTTER_CHANGED; - } f->last_nonminibuf_window = window; } } @@ -1333,9 +1305,7 @@ console = DEVICE_CONSOLE (d); con = XCONSOLE (console); - if (!called_from_delete_device && - !(MAYBE_INT_DEVMETH (d, device_implementation_flags, ()) - & XDEVIMPF_FRAMELESS_OK)) + if (!called_from_delete_device) { /* If we're deleting the only non-minibuffer frame on the device, delete the device. */ @@ -1521,7 +1491,7 @@ next_frame_internal (frame, Qt, device, called_from_delete_device); if (NILP (next_f) || EQ (next_f, frame)) - set_device_selected_frame (d, Qnil); + ; else set_device_selected_frame (d, next_f); } @@ -1536,7 +1506,7 @@ { struct frame *sel_frame = selected_frame (); Fset_window_buffer (sel_frame->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qt); + XWINDOW (minibuf_window)->buffer); minibuf_window = sel_frame->minibuffer_window; /* If the dying minibuffer window was selected, @@ -1556,13 +1526,6 @@ #ifdef HAVE_TOOLBARS 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 the instance cache calling the - finalize method for each instance. */ - free_frame_subwindow_instance_cache (f); /* This must be done before the window and window_mirror structures are freed. The scrollbar information is attached to them. */ @@ -1574,7 +1537,11 @@ f->root_window = Qnil; /* clear out the cached glyph information */ - f->subwindow_instance_cache = Qnil; + if (f->subwindow_cachels) + { + Dynarr_free (f->subwindow_cachels); + f->subwindow_cachels = 0; + } /* Remove the frame now from the list. This way, any events generated on this frame by the maneuvers below will disperse themselves. */ @@ -1871,7 +1838,7 @@ struct window *w; int pix_x, pix_y; - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); CHECK_INT (x); CHECK_INT (y); @@ -1895,7 +1862,7 @@ { struct window *w; - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); CHECK_INT (x); CHECK_INT (y); @@ -1944,7 +1911,7 @@ if (EQ (f->minibuffer_window, minibuf_window)) { Fset_window_buffer (sel_frame->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qt); + XWINDOW (minibuf_window)->buffer); minibuf_window = sel_frame->minibuffer_window; } @@ -1970,7 +1937,7 @@ if (EQ (f->minibuffer_window, minibuf_window)) { Fset_window_buffer (sel_frame->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qt); + XWINDOW (minibuf_window)->buffer); minibuf_window = sel_frame->minibuffer_window; } @@ -2102,31 +2069,6 @@ /* 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; -} /***************************************************************************/ @@ -2182,7 +2124,7 @@ Lisp_Object *face_prop_out) { Lisp_Object list = Vbuilt_in_face_specifiers; - Lisp_String *s; + struct Lisp_String *s; if (!SYMBOLP (sym)) return 0; @@ -2192,7 +2134,7 @@ while (!NILP (list)) { Lisp_Object prop = Fcar (list); - Lisp_String *prop_name; + struct Lisp_String *prop_name; if (!SYMBOLP (prop)) continue; @@ -2270,9 +2212,8 @@ minibuffer Gives the minibuffer behavior for this frame. Either t (frame has its own minibuffer), `only' (frame is - a minibuffer-only frame), `none' (frame has no minibuffer) - or a window (frame uses that window, which is on another - frame, as the minibuffer). + a minibuffer-only frame), 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'. @@ -2286,13 +2227,7 @@ 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, - 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, + modeline-shadow-thickness, has-modeline-p [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' @@ -2725,8 +2660,8 @@ window = FRAME_SELECTED_WINDOW (f); - egw = max (glyph_width (Vcontinuation_glyph, window), - glyph_width (Vtruncation_glyph, window)); + egw = max (glyph_width (Vcontinuation_glyph, Vdefault_face, 0, window), + glyph_width (Vtruncation_glyph, Vdefault_face, 0, window)); egw = max (egw, cpw); bdr = 2 * f->internal_border_width; obw = FRAME_SCROLLBAR_WIDTH (f) + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) + @@ -2901,9 +2836,9 @@ { int adjustment, trunc_width, cont_width; - trunc_width = glyph_width (Vtruncation_glyph, + trunc_width = glyph_width (Vtruncation_glyph, Vdefault_face, 0, FRAME_SELECTED_WINDOW (f)); - cont_width = glyph_width (Vcontinuation_glyph, + cont_width = glyph_width (Vcontinuation_glyph, Vdefault_face, 0, FRAME_SELECTED_WINDOW (f)); adjustment = max (trunc_width, cont_width); adjustment = max (adjustment, font_width); @@ -2917,14 +2852,7 @@ if (new_pixheight) { - /* 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); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_TOP_BORDER_END (f); if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) @@ -2950,10 +2878,7 @@ new_pixheight - minibuf_height, 0); XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = - FRAME_TOP_BORDER_END (f) + - FRAME_TOP_GUTTER_BOUNDS (f) + - FRAME_BOTTOM_GUTTER_BOUNDS (f) + - new_pixheight - minibuf_height; + new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); } @@ -2968,20 +2893,13 @@ if (new_pixwidth) { - /* 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); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_LEFT_BORDER_END (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_GUTTER_BOUNDS (f); + FRAME_LEFT_BORDER_END (f); set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); } @@ -3000,7 +2918,6 @@ } MARK_FRAME_TOOLBARS_CHANGED (f); - MARK_FRAME_GUTTERS_CHANGED (f); MARK_FRAME_CHANGED (f); f->echo_area_garbaged = 1; } @@ -3036,37 +2953,6 @@ } -/* The caller is responsible for freeing the returned string. */ -static Bufbyte * -generate_title_string (struct window *w, Lisp_Object format_str, - face_index findex, int type) -{ - struct display_line *dl; - struct display_block *db; - int elt = 0; - - dl = &title_string_display_line; - db = get_display_block_from_line (dl, TEXT); - Dynarr_reset (db->runes); - - generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0, - -1, type); - - Dynarr_reset (title_string_emchar_dynarr); - while (elt < Dynarr_length (db->runes)) - { - if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) - Dynarr_add (title_string_emchar_dynarr, - Dynarr_atp (db->runes, elt)->object.chr.ch); - elt++; - } - - return - convert_emchar_string_into_malloced_string - (Dynarr_atp (title_string_emchar_dynarr, 0), - Dynarr_length (title_string_emchar_dynarr), 0); -} - void update_frame_title (struct frame *f) { @@ -3090,8 +2976,8 @@ if (HAS_FRAMEMETH_P (f, set_title_from_bufbyte)) { - title = generate_title_string (w, title_format, - DEFAULT_INDEX, CURRENT_DISP); + title = generate_formatted_string (w, title_format, Qnil, + DEFAULT_INDEX, CURRENT_DISP); FRAMEMETH (f, set_title_from_bufbyte, (f, title)); } @@ -3102,8 +2988,8 @@ if (title) xfree (title); - title = generate_title_string (w, icon_format, - DEFAULT_INDEX, CURRENT_DISP); + title = generate_formatted_string (w, icon_format, Qnil, + DEFAULT_INDEX, CURRENT_DISP); } FRAMEMETH (f, set_icon_name_from_bufbyte, (f, title)); } @@ -3162,29 +3048,9 @@ } -/***************************************************************************/ -/* */ -/* initialization */ -/* */ -/***************************************************************************/ - -void -init_frame (void) -{ -#ifndef PDUMP - if (!initialized) -#endif - { - title_string_emchar_dynarr = Dynarr_new (Emchar); - xzero (title_string_display_line); - } -} - 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"); @@ -3197,6 +3063,8 @@ defsymbol (&Qframep, "framep"); defsymbol (&Qframe_live_p, "frame-live-p"); + defsymbol (&Qframe_x_p, "frame-x-p"); + defsymbol (&Qframe_tty_p, "frame-tty-p"); defsymbol (&Qdelete_frame, "delete-frame"); defsymbol (&Qsynchronize_minibuffers, "synchronize-minibuffers"); defsymbol (&Qbuffer_predicate, "buffer-predicate"); @@ -3295,8 +3163,6 @@ DEFSUBR (Fset_frame_size); DEFSUBR (Fset_frame_position); DEFSUBR (Fset_frame_pointer); - DEFSUBR (Fprint_job_page_number); - DEFSUBR (Fprint_job_eject_page); } void @@ -3410,34 +3276,27 @@ Vsynchronize_minibuffers = Qnil; DEFVAR_LISP ("frame-title-format", &Vframe_title_format /* -Controls the title of the window-system window of the selected frame. +Controls the title of the X window corresponding to 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 + Vframe_title_format = Fpurecopy (build_string ("%S: %b")); DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /* Controls the title of the icon corresponding to the selected frame. See also the variable `frame-title-format'. */ ); - Vframe_icon_title_format = build_string ("%b"); + Vframe_icon_title_format = Fpurecopy (build_string ("%b")); 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 is used primarily for picking up X resources, and is *not* the title -of the frame. (See `frame-title-format'.) +This can be overridden by arguments to `make-frame'. +This must be a string. */ ); #ifndef INFODOCK - Vdefault_frame_name = build_string ("emacs"); + Vdefault_frame_name = Fpurecopy (build_string ("emacs")); #else - Vdefault_frame_name = build_string ("InfoDock"); + Vdefault_frame_name = Fpurecopy (build_string ("InfoDock")); #endif DEFVAR_LISP ("default-frame-plist", &Vdefault_frame_plist /* diff -r 12e008d41344 -r 697ef44129c6 src/frame.h --- a/src/frame.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/frame.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_frame_h_ -#define INCLUDED_frame_h_ +#ifndef _XEMACS_FRAME_H_ +#define _XEMACS_FRAME_H_ #ifdef HAVE_SCROLLBARS #include "scrollbar.h" @@ -33,7 +33,6 @@ #include "device.h" #include "glyphs.h" -#include "redisplay.h" #define FRAME_TYPE_NAME(f) ((f)->framemeths->name) #define FRAME_TYPE(f) ((f)->framemeths->symbol) @@ -78,9 +77,6 @@ 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 @@ -94,8 +90,8 @@ int modiff; - struct expose_ignore* subwindow_exposures; - struct expose_ignore* subwindow_exposures_tail; + /* subwindow cache elements for this frame */ + subwindow_cachel_dynarr *subwindow_cachels; #ifdef HAVE_SCROLLBARS /* frame-local scrollbar information. See scrollbar.c. */ @@ -113,15 +109,6 @@ unsigned int current_toolbar_size[4]; #endif - /* 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 */ void *frame_data; @@ -173,11 +160,6 @@ unsigned int bottom_toolbar_was_visible :1; unsigned int left_toolbar_was_visible :1; unsigned int right_toolbar_was_visible :1; - /* gutter visibility */ - unsigned int top_gutter_was_visible :1; - unsigned int bottom_gutter_was_visible :1; - unsigned int left_gutter_was_visible :1; - unsigned int right_gutter_was_visible :1; /* redisplay flags */ unsigned int buffers_changed :1; @@ -186,7 +168,6 @@ unsigned int faces_changed :1; unsigned int frame_changed :1; unsigned int subwindows_changed :1; - unsigned int subwindows_state_changed :1; unsigned int glyphs_changed :1; unsigned int icon_changed :1; unsigned int menubar_changed :1; @@ -194,7 +175,6 @@ unsigned int point_changed :1; unsigned int size_changed :1; unsigned int toolbar_changed :1; - unsigned int gutter_changed :1; unsigned int windows_changed :1; unsigned int windows_structure_changed :1; unsigned int window_face_cache_reset :1; /* used by expose handler */ @@ -218,7 +198,6 @@ 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; @@ -243,6 +222,7 @@ #define XFRAME(x) XRECORD (x, frame, struct frame) #define XSETFRAME(x, p) XSETRECORD (x, p, frame) #define FRAMEP(x) RECORDP (x, frame) +#define GC_FRAMEP(x) GC_RECORDP (x, frame) #define CHECK_FRAME(x) CHECK_RECORD (x, frame) #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame) @@ -260,16 +240,16 @@ #define FRAME_TYPE_P(f, type) EQ (FRAME_TYPE (f), Q##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER struct frame * +INLINE struct frame * error_check_frame_type (struct frame * f, Lisp_Object sym); -INLINE_HEADER struct frame * +INLINE struct frame * error_check_frame_type (struct frame * f, Lisp_Object sym) { assert (EQ (FRAME_TYPE (f), sym)); return f; } # define FRAME_TYPE_DATA(f, type) \ - ((struct type##_frame *) error_check_frame_type (f, Q##type)->frame_data) + ((struct type##_frame *) (error_check_frame_type (f, Q##type))->frame_data) #else # define FRAME_TYPE_DATA(f, type) \ ((struct type##_frame *) (f)->frame_data) @@ -290,40 +270,6 @@ (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. */ @@ -372,7 +318,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)) \ { \ @@ -380,20 +326,7 @@ MARK_DEVICE_SUBWINDOWS_CHANGED (mfgc_d); \ } \ else \ - 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->modiff++; \ - if (!NILP (mfgc_f->device)) \ - { \ - struct device *mfgc_d = XDEVICE (mfgc_f->device); \ - MARK_DEVICE_SUBWINDOWS_STATE_CHANGED (mfgc_d); \ - } \ - else \ - subwindows_state_changed = 1; \ + subwindows_changed = 1; \ } while (0) #define MARK_FRAME_TOOLBARS_CHANGED(f) do { \ @@ -409,19 +342,6 @@ toolbar_changed = 1; \ } while (0) -#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); \ - } \ - else \ - gutter_changed = 1; \ -} while (0) - #define MARK_FRAME_SIZE_CHANGED(f) do { \ struct frame *mfsc_f = (f); \ mfsc_f->size_changed = 1; \ @@ -501,15 +421,13 @@ #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_PAGENUMBER(f) ((f)->page_number + 0) -#define FRAME_SET_PAGENUMBER(f,x) (f)->page_number = (x); +#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer) +#define FRAME_HEIGHT(f) ((f)->height) +#define FRAME_WIDTH(f) ((f)->width) +#define FRAME_CHARHEIGHT(f) ((f)->char_height) +#define FRAME_CHARWIDTH(f) ((f)->char_width) +#define FRAME_PIXHEIGHT(f) ((f)->pixheight) +#define FRAME_PIXWIDTH(f) ((f)->pixwidth) #ifdef HAVE_SCROLLBARS #define FRAME_SCROLLBAR_WIDTH(f) \ (NILP ((f)->vertical_scrollbar_visible_p) ? \ @@ -524,8 +442,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) @@ -544,7 +462,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_instance_cache) +#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_cachels) #if 0 /* FSFmacs */ @@ -621,7 +539,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) @@ -680,18 +598,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) @@ -723,32 +641,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: @@ -772,6 +690,9 @@ 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); 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, @@ -816,6 +737,4 @@ void update_frame_icon (struct frame *f); void invalidate_vertical_divider_cache_in_frame (struct frame *f); -void init_frame (void); - -#endif /* INCLUDED_frame_h_ */ +#endif /* _XEMACS_FRAME_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/frameslots.h --- a/src/frameslots.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/frameslots.h Mon Aug 13 11:20:41 2007 +0200 @@ -84,9 +84,6 @@ /* 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. */ @@ -145,9 +142,6 @@ 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 12e008d41344 -r 697ef44129c6 src/free-hook.c --- a/src/free-hook.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/free-hook.c Mon Aug 13 11:20:41 2007 +0200 @@ -85,14 +85,14 @@ /* System function prototypes don't belong in C source files */ /* extern void free (void *); */ -static struct hash_table *pointer_table; +struct hash_table *pointer_table; extern void (*__free_hook) (void *); extern void *(*__malloc_hook) (size_t); static void *check_malloc (size_t); -typedef void (*fun_ptr) (void); +typedef void (*fun_ptr) (); /* free_queue is not too useful without backtrace logging */ #define FREE_QUEUE_LIMIT 1 @@ -110,11 +110,11 @@ unsigned long length; } free_queue_entry; -static free_queue_entry free_queue[FREE_QUEUE_LIMIT]; +free_queue_entry free_queue[FREE_QUEUE_LIMIT]; -static int current_free; +int current_free; -static int strict_free_check; +int strict_free_check; static void check_free (void *ptr) @@ -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 12e008d41344 -r 697ef44129c6 src/gdbinit --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gdbinit Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,477 @@ +# -*- ksh -*- +# Copyright (C) 1998 Free Software Foundation, Inc. + +# This file is part of XEmacs. + +# XEmacs is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. + +# XEmacs is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +# You should have received a copy of the GNU General Public License +# along with XEmacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Author: Martin Buchholz + +# Some useful commands for debugging emacs with gdb 4.16 or better. +# Install this as your .gdbinit file in your home directory, +# or source this file from your .gdbinit +# Configure xemacs with --debug, and compile with -g. +# +# See also the question of the XEmacs FAQ, titled +# "How to Debug an XEmacs problem with a debugger". +# +# This can be used to debug XEmacs no matter how the following are +# specified: + +# USE_UNION_TYPE + +# (the above all have configure equivalents) + +# Some functions defined here require a running process, but most +# don't. Considerable effort has been expended to this end. + +# See the dbg_ C support code in src/alloc.c that allows the functions +# defined in this file to work correctly. + +set print union off +set print pretty off + +define decode_object + set $obj = (unsigned long) $arg0 + if $obj & 1 + # It's an int + set $val = $obj >> 1 + set $type = Lisp_Type_Int + else + set $type = $obj & dbg_typemask + if $type == Lisp_Type_Char + set $val = ($obj & dbg_valmask) >> dbg_gctypebits + else + # It's a record pointer + set $val = $obj + end + end + + if $type == Lisp_Type_Record + set $lheader = (struct lrecord_header *) $val + set $imp = lrecord_implementations_table[$lheader->type] + else + set $imp = -1 + end +end + +document decode_object +Usage: decode_object lisp_object +Extract implementation information from a Lisp Object. +Defines variables $val, $type and $imp. +end + +define xint +decode_object $arg0 +print ((long) $val) +end + +define xtype + decode_object $arg0 + 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 + +define lisp-shadows + run -batch -vanilla -f list-load-path-shadows +end + +document lisp-shadows +Usage: lisp-shadows +Run xemacs to check for lisp shadows +end + +define environment-to-run-temacs + unset env EMACSLOADPATH + set env EMACSBOOTSTRAPLOADPATH=../lisp/:.. + set env EMACSBOOTSTRAPMODULEPATH=../modules/:.. +end + +define run-temacs + environment-to-run-temacs + run -batch -l ../lisp/loadup.el run-temacs -q +end + +document run-temacs +Usage: run-temacs +Run temacs interactively, like xemacs. +Use this with debugging tools (like purify) that cannot deal with dumping, +or when temacs builds successfully, but xemacs does not. +end + +define update-elc + environment-to-run-temacs + run -batch -l ../lisp/update-elc.el +end + +document update-elc +Usage: update-elc +Run the core lisp byte compilation part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end + +define dump-temacs + environment-to-run-temacs + run -batch -l ../lisp/loadup.el dump +end + +document dump-temacs +Usage: dump-temacs +Run the dumping part of the build procedure. +Use when debugging temacs, not xemacs! +Use this when temacs builds successfully, but xemacs does not. +end + +# if you use Purify, do this: +# export PURIFYOPTIONS='-pointer-mask=0x0fffffff' + +define ldp + printf "%s", "Lisp => " + call debug_print($arg0) +end + +document ldp +Usage: ldp lisp_object +Print a Lisp Object value using the Lisp printer. +Requires a running xemacs process. +end + +define lbt +call debug_backtrace() +end + +document lbt +Usage: lbt +Print the current Lisp stack trace. +Requires a running xemacs process. +end + + +define leval +ldp Feval(Fcar(Fread_from_string(build_string($arg0),Qnil,Qnil))) +end + +document leval +Usage: leval "SEXP" +Eval a lisp expression. +Requires a running xemacs process. + +Example: +(gdb) leval "(+ 1 2)" +Lisp ==> 3 +end + + +define wtype +print $arg0->core.widget_class->core_class.class_name +end + +define xtname +print XrmQuarkToString(((Object)($arg0))->object.xrm_name) +end + +# GDB's command language makes you want to ... + +define pstruct + set $xstruct = (struct $arg0 *) $val + print $xstruct + print *$xstruct +end + +define pobj + decode_object $arg0 + if $type == Lisp_Type_Int + printf "Integer: %d\n", $val + else + if $type == Lisp_Type_Char + if $val > 32 && $val < 128 + printf "Char: %c\n", $val + else + printf "Char: %d\n", $val + end + else + if $type == Lisp_Type_String || $imp == lrecord_string + pstruct Lisp_String + else + if $type == Lisp_Type_Cons || $imp == lrecord_cons + pstruct Lisp_Cons + else + if $type == Lisp_Type_Symbol || $imp == lrecord_symbol + pstruct Lisp_Symbol + printf "Symbol name: %s\n", $xstruct->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 + else + if $imp == lrecord_bit_vector + pstruct Lisp_Bit_Vector + else + if $imp == lrecord_buffer + pstruct buffer + else + if $imp == lrecord_char_table + pstruct Lisp_Char_Table + else + if $imp == lrecord_char_table_entry + pstruct Lisp_Char_Table_Entry + else + if $imp == lrecord_charset + pstruct Lisp_Charset + else + if $imp == lrecord_coding_system + pstruct Lisp_Coding_System + else + if $imp == lrecord_color_instance + pstruct Lisp_Color_Instance + else + if $imp == lrecord_command_builder + pstruct command_builder + else + if $imp == lrecord_compiled_function + pstruct Lisp_Compiled_Function + else + if $imp == lrecord_console + pstruct console + else + if $imp == lrecord_database + pstruct Lisp_Database + else + if $imp == lrecord_device + pstruct device + else + if $imp == lrecord_event + pstruct Lisp_Event + else + if $imp == lrecord_extent + pstruct extent + else + if $imp == lrecord_extent_auxiliary + pstruct extent_auxiliary + else + if $imp == lrecord_extent_info + pstruct extent_info + else + if $imp == lrecord_face + pstruct Lisp_Face + else + if $imp == lrecord_float + pstruct Lisp_Float + else + if $imp == lrecord_font_instance + pstruct Lisp_Font_Instance + else + if $imp == lrecord_frame + pstruct frame + else + if $imp == lrecord_glyph + pstruct Lisp_Glyph + else + if $imp == lrecord_hash_table + pstruct Lisp_Hash_Table + else + if $imp == lrecord_image_instance + pstruct Lisp_Image_Instance + else + if $imp == lrecord_keymap + pstruct Lisp_Keymap + else + if $imp == lrecord_lcrecord_list + pstruct lcrecord_list + else + if $imp == lrecord_lstream + pstruct lstream + else + if $imp == lrecord_marker + pstruct Lisp_Marker + else + if $imp == lrecord_opaque + pstruct Lisp_Opaque + else + if $imp == lrecord_opaque_list + pstruct Lisp_Opaque_List + else + if $imp == lrecord_popup_data + pstruct popup_data + else + if $imp == lrecord_process + pstruct Lisp_Process + else + if $imp == lrecord_range_table + pstruct Lisp_Range_Table + else + if $imp == lrecord_specifier + pstruct Lisp_Specifier + else + if $imp == lrecord_subr + pstruct Lisp_Subr + else + if $imp == lrecord_symbol_value_buffer_local + pstruct symbol_value_buffer_local + else + if $imp == lrecord_symbol_value_forward + pstruct symbol_value_forward + else + if $imp == lrecord_symbol_value_lisp_magic + pstruct symbol_value_lisp_magic + else + if $imp == lrecord_symbol_value_varalias + pstruct symbol_value_varalias + else + if $imp == lrecord_toolbar_button + pstruct toolbar_button + else + if $imp == lrecord_tooltalk_message + pstruct Lisp_Tooltalk_Message + else + if $imp == lrecord_tooltalk_pattern + pstruct Lisp_Tooltalk_Pattern + else + if $imp == lrecord_weak_list + pstruct weak_list + else + if $imp == lrecord_window + pstruct window + else + if $imp == lrecord_window_configuration + pstruct window_config + else + echo Unknown Lisp Object type\n + print $arg0 + # Barf, gag, retch + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + # Repeat after me... gdb sux, gdb sux, gdb sux... + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + # Are we having fun yet?? + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end +end + +document pobj +Usage: pobj lisp_object +Print the internal C structure of a underlying Lisp Object. +end + +# ------------------------------------------------------------- +# functions to test the debugging support itself. +# If you change this file, make sure the following still work... +# ------------------------------------------------------------- +define test_xtype + printf "Vemacs_major_version: " + xtype Vemacs_major_version + printf "Vhelp_char: " + xtype Vhelp_char + printf "Qnil: " + xtype Qnil + printf "Qunbound: " + xtype Qunbound + printf "Vobarray: " + xtype Vobarray + printf "Vall_weak_lists: " + xtype Vall_weak_lists + printf "Vxemacs_codename: " + xtype Vxemacs_codename +end + +define test_pobj + printf "Vemacs_major_version: " + pobj Vemacs_major_version + printf "Vhelp_char: " + pobj Vhelp_char + printf "Qnil: " + pobj Qnil + printf "Qunbound: " + pobj Qunbound + printf "Vobarray: " + pobj Vobarray + printf "Vall_weak_lists: " + pobj Vall_weak_lists + printf "Vxemacs_codename: " + pobj Vxemacs_codename +end + diff -r 12e008d41344 -r 697ef44129c6 src/general.c --- a/src/general.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/general.c Mon Aug 13 11:20:41 2007 +0200 @@ -31,27 +31,28 @@ #include <config.h> #include "lisp.h" -Lisp_Object Qabort; Lisp_Object Qactually_requested; Lisp_Object Qafter; Lisp_Object Qall; +Lisp_Object Qalways; Lisp_Object Qand; -Lisp_Object Qappend; Lisp_Object Qassoc; Lisp_Object Qat; +Lisp_Object Qauth; Lisp_Object Qautodetect; Lisp_Object Qbad_variable; +Lisp_Object Qbase; Lisp_Object Qbefore; Lisp_Object Qbinary; +Lisp_Object Qbinddn; Lisp_Object Qbitmap; +Lisp_Object Qblack; Lisp_Object Qboolean; Lisp_Object Qbottom; -Lisp_Object Qbottom_margin; Lisp_Object Qbuffer; Lisp_Object Qbutton; -Lisp_Object Qcancel; +Lisp_Object Qcase; Lisp_Object Qcategory; -Lisp_Object Qcenter; Lisp_Object Qchannel; Lisp_Object Qchar; Lisp_Object Qcharacter; @@ -60,21 +61,18 @@ Lisp_Object Qcolumns; Lisp_Object Qcommand; Lisp_Object Qconsole; -Lisp_Object Qcopies; 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 Qderef; Lisp_Object Qdevice; -Lisp_Object Qdialog; Lisp_Object Qdimension; Lisp_Object Qdisplay; Lisp_Object Qdoc_string; -Lisp_Object Qduplex; Lisp_Object Qdynarr_overhead; Lisp_Object Qempty; Lisp_Object Qeq; @@ -83,25 +81,18 @@ Lisp_Object Qeval; Lisp_Object Qextents; Lisp_Object Qface; -Lisp_Object Qfile_name; +Lisp_Object Qfind; Lisp_Object Qfont; Lisp_Object Qframe; -Lisp_Object Qfrom_page; -Lisp_Object Qfull_assoc; -Lisp_Object Qfuncall; Lisp_Object Qfunction; Lisp_Object Qgap_overhead; Lisp_Object Qgeneric; Lisp_Object Qgeometry; Lisp_Object Qglobal; -Lisp_Object Qgutter; Lisp_Object Qheight; -Lisp_Object Qhelp; Lisp_Object Qhighlight; -Lisp_Object Qhorizontal; Lisp_Object Qicon; Lisp_Object Qid; -Lisp_Object Qignore; Lisp_Object Qimage; Lisp_Object Qinfo; Lisp_Object Qinherit; @@ -111,11 +102,9 @@ Lisp_Object Qkey_assoc; Lisp_Object Qkeyboard; Lisp_Object Qkeymap; -Lisp_Object Qlandscape; -Lisp_Object Qlast_command; +Lisp_Object Qkrbv41; +Lisp_Object Qkrbv42; Lisp_Object Qleft; -Lisp_Object Qleft_margin; -Lisp_Object Qlet; Lisp_Object Qlist; Lisp_Object Qmagic; Lisp_Object Qmalloc_overhead; @@ -127,102 +116,99 @@ Lisp_Object Qminus; Lisp_Object Qmodifiers; Lisp_Object Qmotion; -Lisp_Object Qmsprinter; Lisp_Object Qmswindows; Lisp_Object Qname; -Lisp_Object Qno; +Lisp_Object Qnever; Lisp_Object Qnone; Lisp_Object Qnot; Lisp_Object Qnothing; Lisp_Object Qnotice; Lisp_Object Qobject; -Lisp_Object Qok; Lisp_Object Qold_assoc; Lisp_Object Qold_delete; Lisp_Object Qold_delq; Lisp_Object Qold_rassoc; Lisp_Object Qold_rassq; +Lisp_Object Qonelevel; Lisp_Object Qonly; Lisp_Object Qor; -Lisp_Object Qorientation; Lisp_Object Qother; +Lisp_Object Qpasswd; +Lisp_Object Qpath; Lisp_Object Qpointer; Lisp_Object Qpopup; -Lisp_Object Qportrait; +Lisp_Object Qport; Lisp_Object Qprint; -Lisp_Object Qprinter; Lisp_Object Qprocess; Lisp_Object Qprovide; Lisp_Object Qrassoc; Lisp_Object Qrassq; Lisp_Object Qrequire; Lisp_Object Qresource; -Lisp_Object Qretry; 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 Qsizelimit; Lisp_Object Qspace; Lisp_Object Qspecifier; Lisp_Object Qstream; Lisp_Object Qstring; +Lisp_Object Qsubtree; Lisp_Object Qsymbol; Lisp_Object Qsyntax; -Lisp_Object Qterminal; Lisp_Object Qtest; Lisp_Object Qtext; -Lisp_Object Qthis_command; +Lisp_Object Qtimelimit; Lisp_Object Qtimeout; Lisp_Object Qtimestamp; Lisp_Object Qtoolbar; Lisp_Object Qtop; -Lisp_Object Qtop_margin; -Lisp_Object Qto_page; Lisp_Object Qtty; Lisp_Object Qtype; Lisp_Object Qundecided; Lisp_Object Qundefined; Lisp_Object Qunimplemented; Lisp_Object Qvalue_assoc; -Lisp_Object Qvertical; +Lisp_Object Qvector; Lisp_Object Qwarning; +Lisp_Object Qwhite; +Lisp_Object Qwidth; Lisp_Object Qwidget; -Lisp_Object Qwidth; Lisp_Object Qwindow; Lisp_Object Qwindow_system; Lisp_Object Qx; Lisp_Object Qy; -Lisp_Object Qyes; void syms_of_general (void) { - defsymbol (&Qabort, "abort"); defsymbol (&Qactually_requested, "actually-requested"); defsymbol (&Qafter, "after"); defsymbol (&Qall, "all"); + defsymbol (&Qalways, "always"); defsymbol (&Qand, "and"); - defsymbol (&Qappend, "append"); defsymbol (&Qassoc, "assoc"); defsymbol (&Qat, "at"); + defsymbol (&Qauth, "auth"); defsymbol (&Qautodetect, "autodetect"); defsymbol (&Qbad_variable, "bad-variable"); + defsymbol (&Qbase, "base"); defsymbol (&Qbefore, "before"); defsymbol (&Qbinary, "binary"); + defsymbol (&Qbinddn, "binddn"); defsymbol (&Qbitmap, "bitmap"); + defsymbol (&Qblack, "black"); defsymbol (&Qboolean, "boolean"); defsymbol (&Qbottom, "bottom"); - defsymbol (&Qbottom_margin, "bottom-margin"); defsymbol (&Qbuffer, "buffer"); defsymbol (&Qbutton, "button"); - defsymbol (&Qcancel, "cancel"); + defsymbol (&Qcase, "case"); defsymbol (&Qcategory, "category"); - defsymbol (&Qcenter, "center"); defsymbol (&Qchannel, "channel"); defsymbol (&Qchar, "char"); defsymbol (&Qcharacter, "character"); @@ -231,21 +217,18 @@ defsymbol (&Qcolumns, "columns"); defsymbol (&Qcommand, "command"); defsymbol (&Qconsole, "console"); - defsymbol (&Qcopies, "copies"); 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 (&Qderef, "deref"); defsymbol (&Qdevice, "device"); - defsymbol (&Qdialog, "dialog"); 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"); @@ -254,26 +237,18 @@ defsymbol (&Qeval, "eval"); defsymbol (&Qextents, "extents"); defsymbol (&Qface, "face"); - defsymbol (&Qfile_name, "file-name"); + defsymbol (&Qfind, "find"); defsymbol (&Qfont, "font"); defsymbol (&Qframe, "frame"); - defsymbol (&Qfrom_page, "from-page"); - defsymbol (&Qfunction, "function"); - defsymbol (&Qfull_assoc, "full-assoc"); - defsymbol (&Qfuncall, "funcall"); defsymbol (&Qfunction, "function"); defsymbol (&Qgap_overhead, "gap-overhead"); defsymbol (&Qgeneric, "generic"); defsymbol (&Qgeometry, "geometry"); defsymbol (&Qglobal, "global"); - defsymbol (&Qgutter, "gutter"); defsymbol (&Qheight, "height"); - defsymbol (&Qhelp, "help"); defsymbol (&Qhighlight, "highlight"); - defsymbol (&Qhorizontal, "horizontal"); defsymbol (&Qicon, "icon"); defsymbol (&Qid, "id"); - defsymbol (&Qignore, "ignore"); defsymbol (&Qimage, "image"); defsymbol (&Qinfo, "info"); defsymbol (&Qinherit, "inherit"); @@ -283,11 +258,9 @@ defsymbol (&Qkey_assoc, "key-assoc"); defsymbol (&Qkeyboard, "keyboard"); defsymbol (&Qkeymap, "keymap"); - defsymbol (&Qlandscape, "landscape"); - defsymbol (&Qlast_command, "last-command"); + defsymbol (&Qkrbv41, "krbv41"); + defsymbol (&Qkrbv42, "krbv42"); defsymbol (&Qleft, "left"); - defsymbol (&Qleft_margin, "left-margin"); - defsymbol (&Qlet, "let"); defsymbol (&Qlist, "list"); defsymbol (&Qmagic, "magic"); defsymbol (&Qmalloc_overhead, "malloc-overhead"); @@ -299,75 +272,71 @@ defsymbol (&Qminus, "-"); defsymbol (&Qmodifiers, "modifiers"); defsymbol (&Qmotion, "motion"); - defsymbol (&Qmsprinter, "msprinter"); defsymbol (&Qmswindows, "mswindows"); defsymbol (&Qname, "name"); - defsymbol (&Qno, "no"); + defsymbol (&Qnever, "never"); defsymbol (&Qnone, "none"); defsymbol (&Qnot, "not"); defsymbol (&Qnothing, "nothing"); defsymbol (&Qnotice, "notice"); defsymbol (&Qobject, "object"); - defsymbol (&Qok, "ok"); 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 (&Qonelevel, "onelevel"); defsymbol (&Qonly, "only"); defsymbol (&Qor, "or"); - defsymbol (&Qorientation, "orientation"); defsymbol (&Qother, "other"); + defsymbol (&Qpasswd, "passwd"); + defsymbol (&Qpath, "path"); defsymbol (&Qpointer, "pointer"); defsymbol (&Qpopup, "popup"); - defsymbol (&Qportrait, "portrait"); + defsymbol (&Qport, "port"); defsymbol (&Qprint, "print"); - defsymbol (&Qprinter, "printer"); defsymbol (&Qprocess, "process"); defsymbol (&Qprovide, "provide"); defsymbol (&Qrassoc, "rassoc"); defsymbol (&Qrassq, "rassq"); defsymbol (&Qrequire, "require"); defsymbol (&Qresource, "resource"); - defsymbol (&Qretry, "retry"); 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 (&Qsizelimit, "sizelimit"); defsymbol (&Qspace, "space"); defsymbol (&Qspecifier, "specifier"); defsymbol (&Qstream, "stream"); defsymbol (&Qstring, "string"); + defsymbol (&Qsubtree, "subtree"); defsymbol (&Qsymbol, "symbol"); defsymbol (&Qsyntax, "syntax"); - defsymbol (&Qterminal, "terminal"); defsymbol (&Qtest, "test"); defsymbol (&Qtext, "text"); - defsymbol (&Qthis_command, "this-command"); + defsymbol (&Qtimelimit, "timelimit"); defsymbol (&Qtimeout, "timeout"); defsymbol (&Qtimestamp, "timestamp"); defsymbol (&Qtoolbar, "toolbar"); defsymbol (&Qtop, "top"); - defsymbol (&Qtop_margin, "top-margin"); - defsymbol (&Qto_page, "to-page"); defsymbol (&Qtty, "tty"); defsymbol (&Qtype, "type"); defsymbol (&Qundecided, "undecided"); defsymbol (&Qundefined, "undefined"); defsymbol (&Qunimplemented, "unimplemented"); defsymbol (&Qvalue_assoc, "value-assoc"); - defsymbol (&Qvertical, "vertical"); + defsymbol (&Qvector, "vector"); defsymbol (&Qwarning, "warning"); + defsymbol (&Qwhite, "white"); + defsymbol (&Qwidth, "width"); defsymbol (&Qwidget, "widget"); - defsymbol (&Qwidth, "width"); defsymbol (&Qwindow, "window"); defsymbol (&Qwindow_system, "window-system"); defsymbol (&Qx, "x"); defsymbol (&Qy, "y"); - defsymbol (&Qyes, "yes"); } diff -r 12e008d41344 -r 697ef44129c6 src/getloadavg.c --- a/src/getloadavg.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 11:20:41 2007 +0200 @@ -44,6 +44,7 @@ convex DGUX hpux + MSDOS No-op for MSDOS. NeXT sgi sequent Sequent Dynix 3.x.x (BSD) @@ -51,7 +52,7 @@ sony_news NEWS-OS (works at least for 4.1C) UMAX UMAX4_3 - WIN32_NATIVE No-op for Windows95/NT. + WIN32 No-op for Windows95/NT. __linux__ Linux: assumes /proc filesystem mounted. Support from Michael K. Johnson. __NetBSD__ NetBSD: assumes /kern filesystem mounted. @@ -68,11 +69,8 @@ #include <config.h> #endif -#include "lisp.h" -#include "sysfile.h" /* for encapsulated open, close, read, write */ - -#ifndef WIN32_NATIVE -#ifndef CYGWIN +#ifndef WINDOWSNT +#ifndef __CYGWIN32__ #include <sys/types.h> @@ -83,6 +81,10 @@ #include <sys/param.h> #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. @@ -92,6 +94,10 @@ #include <errno.h> +#ifndef errno +extern int errno; +#endif + #ifndef HAVE_GETLOADAVG /* The existing Emacs configuration files define a macro called @@ -108,9 +114,11 @@ #define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) #endif +#ifdef XEMACS #if defined (HAVE_KSTAT_H) #include <kstat.h> #endif /* HAVE_KSTAT_H */ +#endif /* XEMACS */ #if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ @@ -453,9 +461,11 @@ #include <sys/dg_sys_info.h> #endif +#ifdef XEMACS #if defined (HAVE_SYS_PSTAT_H) #include <sys/pstat.h> #endif /* HAVE_SYS_PSTAT_H (on HPUX) */ +#endif /* XEMACS */ #if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION) #include <fcntl.h> @@ -526,7 +536,7 @@ privileges to use it. Initial implementation courtesy Zlatko Calusic <zcalusic@carnet.hr>. - Integrated to XEmacs by Hrvoje Niksic <hniksic@xemacs.org>. + Integrated to XEmacs by Hrvoje Niksic <hniksic@srce.hr>. Additional cleanup by Hrvoje Niksic, based on code published by Casper Dik <Casper.Dik@Holland.Sun.Com>. */ kstat_ctl_t *kc; @@ -762,6 +772,31 @@ loadavg[elem++] = load_info.fifteen_minute; #endif /* DGUX */ +#if !defined (LDAV_DONE) && defined (apollo) +#define LDAV_DONE +/* Apollo code from lisch@mentorg.com (Ray Lischner). + + This system call is not documented. The load average is obtained as + three long integers, for the load average over the past minute, + five minutes, and fifteen minutes. Each value is a scaled integer, + with 16 bits of integer part and 16 bits of fraction part. + + I'm not sure which operating system first supported this system call, + but I know that SR10.2 supports it. */ + + extern void proc1_$get_loadav (); + unsigned long load_ave[3]; + + proc1_$get_loadav (load_ave); + + if (nelem > 0) + loadavg[elem++] = load_ave[0] / 65536.0; + if (nelem > 1) + loadavg[elem++] = load_ave[1] / 65536.0; + if (nelem > 2) + loadavg[elem++] = load_ave[2] / 65536.0; +#endif /* apollo */ + #if !defined (LDAV_DONE) && defined (OSF_MIPS) #define LDAV_DONE @@ -773,7 +808,7 @@ : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); #endif /* OSF_MIPS */ -#if !defined (LDAV_DONE) && defined (WIN32_NATIVE) +#if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32)) #define LDAV_DONE /* A faithful emulation is going to have to be saved for a rainy day. */ @@ -781,7 +816,7 @@ { loadavg[elem] = 0.0; } -#endif /* WIN32_NATIVE */ +#endif /* MSDOS */ #if !defined (LDAV_DONE) && defined (OSF_ALPHA) #define LDAV_DONE @@ -972,4 +1007,4 @@ } #endif /*__GNUWIN32__*/ -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ diff -r 12e008d41344 -r 697ef44129c6 src/getpagesize.h --- a/src/getpagesize.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/getpagesize.h Mon Aug 13 11:20:41 2007 +0200 @@ -17,9 +17,6 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_getpagesize_h_ -#define INCLUDED_getpagesize_h_ - /* Emulate getpagesize on systems that lack it. */ #if 0 @@ -67,4 +64,3 @@ #endif /* _SC_PAGESIZE */ #endif /* not HAVE_GETPAGESIZE */ -#endif /* INCLUDED_getpagesize_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/gif_io.c --- a/src/gif_io.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gif_io.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,13 +1,8 @@ -#include <config.h> - #include <stdio.h> #include <stdlib.h> #include <string.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include "gifrlib.h" -#include "sysfile.h" /****************************************************************************** * Set up the GifFileType structure for use. This must be called first in any * diff -r 12e008d41344 -r 697ef44129c6 src/gifrlib.h --- a/src/gifrlib.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gifrlib.h Mon Aug 13 11:20:41 2007 +0200 @@ -14,8 +14,8 @@ * 19 Jan 98 - Version 3.1 by Jareth Hein (Support for user-defined I/O). * ******************************************************************************/ -#ifndef INCLUDED_gifrlib_h_ -#define INCLUDED_gifrlib_h_ +#ifndef GIF_LIB_H +#define GIF_LIB_H #define GIF_ERROR 0 #define GIF_OK 1 @@ -264,4 +264,5 @@ ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap); void FreeMapObject(ColorMapObject *Object); -#endif /* INCLUDED_gifrlib_h_ */ + +#endif /* GIF_LIB_H */ diff -r 12e008d41344 -r 697ef44129c6 src/glyphs-eimage.c --- a/src/glyphs-eimage.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs-eimage.c Mon Aug 13 11:20:41 2007 +0200 @@ -56,7 +56,6 @@ #include "buffer.h" #include "frame.h" #include "opaque.h" -#include "window.h" #include "sysfile.h" @@ -315,7 +314,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); /* It is OK for the unwind data to be local to this function, because the unwind-protect is always executed when this stack frame is still valid. */ @@ -373,13 +372,13 @@ { 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 stack data it might allocate. Need to be able to convert and write out to a file. */ - TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); jpeg_memory_src (&cinfo, (JOCTET *) bytes, len); } @@ -481,9 +480,9 @@ /* Step 6.5: Create the pixmap and set up the image instance */ /* now instantiate */ - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), + MAYBE_DEVMETH (XDEVICE (ii->device), init_image_instance_from_eimage, - (ii, cinfo.output_width, cinfo.output_height, 1, + (ii, cinfo.output_width, cinfo.output_height, unwind.eimage, dest_mask, instantiator, domain)); @@ -581,12 +580,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; @@ -600,7 +599,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); /* It is OK for the unwind data to be local to this function, because the unwind-protect is always executed when this stack frame is still valid. */ @@ -624,7 +623,7 @@ assert (!NILP (data)); if (!(unwind.giffile = GifSetup())) - signal_image_error ("Insufficient memory to instantiate GIF image", instantiator); + signal_image_error ("Insufficent memory to instantiate GIF image", instantiator); /* set up error facilities */ if (setjmp(gif_err.setjmp_buffer)) @@ -637,7 +636,7 @@ } GifSetErrorFunc(unwind.giffile, (Gif_error_func)gif_error_func, (VoidPtr)&gif_err); - TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); mem_struct.bytes = bytes; mem_struct.len = len; mem_struct.index = 0; @@ -652,10 +651,10 @@ DGifSlurp (unwind.giffile); } - /* 3. Now create the EImage(s) */ + /* 3. Now create the EImage */ { ColorMapObject *cmo = unwind.giffile->SColorMap; - int i, j, row, pass, interlace, slice; + int i, j, row, pass, interlace; unsigned char *eip; /* interlaced gifs have rows in this order: 0, 8, 16, ..., 4, 12, 20, ..., 2, 6, 10, ..., 1, 3, 5, ... */ @@ -664,80 +663,51 @@ height = unwind.giffile->SHeight; width = unwind.giffile->SWidth; - unwind.eimage = (unsigned char*) - xmalloc (width * height * 3 * unwind.giffile->ImageCount); + unwind.eimage = (unsigned char*) xmalloc (width * height * 3); if (!unwind.eimage) signal_image_error("Unable to allocate enough memory for image", instantiator); /* write the data in EImage format (8bit RGB triples) */ - for (slice = 0; slice < unwind.giffile->ImageCount; slice++) + /* Note: We just use the first image in the file and ignore the rest. + We check here that that image covers the full "screen" size. + I don't know whether that's always the case. + -dkindred@cs.cmu.edu */ + if (unwind.giffile->SavedImages[0].ImageDesc.Height != height + || unwind.giffile->SavedImages[0].ImageDesc.Width != width + || unwind.giffile->SavedImages[0].ImageDesc.Left != 0 + || unwind.giffile->SavedImages[0].ImageDesc.Top != 0) + signal_image_error ("First image in GIF file is not full size", + instantiator); + + interlace = unwind.giffile->SavedImages[0].ImageDesc.Interlace; + pass = 0; + row = interlace ? InterlacedOffset[pass] : 0; + eip = unwind.eimage; + for (i = 0; i < height; i++) { - /* We check here that that the current image covers the full "screen" size. */ - if (unwind.giffile->SavedImages[slice].ImageDesc.Height != height - || unwind.giffile->SavedImages[slice].ImageDesc.Width != width - || unwind.giffile->SavedImages[slice].ImageDesc.Left != 0 - || unwind.giffile->SavedImages[slice].ImageDesc.Top != 0) - signal_image_error ("Image in GIF file is not full size", - instantiator); - - interlace = unwind.giffile->SavedImages[slice].ImageDesc.Interlace; - pass = 0; - row = interlace ? InterlacedOffset[pass] : 0; - eip = unwind.eimage + (width * height * 3 * slice); - for (i = 0; i < height; i++) + if (interlace) + if (row >= height) { + row = InterlacedOffset[++pass]; + while (row >= height) + row = InterlacedOffset[++pass]; + } + eip = unwind.eimage + (row * width * 3); + for (j = 0; j < width; j++) { - if (interlace) - if (row >= height) { - row = InterlacedOffset[++pass]; - while (row >= height) - row = InterlacedOffset[++pass]; - } - eip = unwind.eimage + (width * height * 3 * slice) + (row * width * 3); - for (j = 0; j < width; j++) - { - unsigned char pixel = - unwind.giffile->SavedImages[slice].RasterBits[(i * width) + j]; - *eip++ = cmo->Colors[pixel].Red; - *eip++ = cmo->Colors[pixel].Green; - *eip++ = cmo->Colors[pixel].Blue; - } - row += interlace ? InterlacedJumps[pass] : 1; + unsigned char pixel = unwind.giffile->SavedImages[0].RasterBits[(i * width) + j]; + *eip++ = cmo->Colors[pixel].Red; + *eip++ = cmo->Colors[pixel].Green; + *eip++ = cmo->Colors[pixel].Blue; } + row += interlace ? InterlacedJumps[pass] : 1; } - - /* now instantiate */ - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), - init_image_instance_from_eimage, - (ii, width, height, unwind.giffile->ImageCount, unwind.eimage, dest_mask, - instantiator, domain)); } - - /* We read the gif successfully. If we have more than one slice then - animate the gif. */ - if (unwind.giffile->ImageCount > 1) - { - /* See if there is a timeout value. In theory there could be one - for every image - but that makes the implementation way to - complicated for now so we just take the first. */ - unsigned short timeout = 0; - Lisp_Object tid; - - if (unwind.giffile->SavedImages[0].Function == GRAPHICS_EXT_FUNC_CODE - && - unwind.giffile->SavedImages[0].ExtensionBlockCount) - { - timeout = (unsigned short) - ((unwind.giffile->SavedImages[0].ExtensionBlocks[0].Bytes[2] << 8) + - unwind.giffile-> SavedImages[0].ExtensionBlocks[0].Bytes[1]) * 10; - } - - /* Too short a timeout will crucify us performance-wise. */ - tid = add_glyph_animated_timeout (timeout > 10 ? timeout : 10, image_instance); - - if (!NILP (tid)) - IMAGE_INSTANCE_PIXMAP_TIMEOUT (ii) = XINT (tid); - } + /* now instantiate */ + MAYBE_DEVMETH (XDEVICE (ii->device), + init_image_instance_from_eimage, + (ii, width, height, unwind.eimage, dest_mask, + instantiator, domain)); unbind_to (speccount, Qnil); } @@ -770,7 +740,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? */ }; @@ -790,7 +760,7 @@ struct png_error_struct { - const char *err_str; + CONST char *err_str; jmp_buf setjmp_buffer; /* for return to caller */ }; @@ -845,7 +815,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); struct png_unwind_data unwind; int speccount = specpdl_depth (); int height, width; @@ -894,14 +864,14 @@ /* 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)); /* #### This is a definite problem under Mule due to the amount of stack data it might allocate. Need to think about using Lstreams */ - TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); tbr.bytes = bytes; tbr.len = len; tbr.index = 0; @@ -943,16 +913,16 @@ } else { - Lisp_Color_Instance *c; + struct Lisp_Color_Instance *c; Lisp_Object rgblist; c = XCOLOR_INSTANCE (bkgd); rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device), color_instance_rgb_components, (c)); - 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)))); + my_background.red = XINT (XCAR (rgblist)); + my_background.green = XINT (XCAR (XCDR (rgblist))); + my_background.blue = XINT (XCAR (XCDR (XCDR (rgblist)))); } if (png_get_bKGD (png_ptr, info_ptr, &image_background)) @@ -1018,9 +988,9 @@ } /* now instantiate */ - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), + MAYBE_DEVMETH (XDEVICE (ii->device), init_image_instance_from_eimage, - (ii, width, height, 1, unwind.eimage, dest_mask, + (ii, width, height, unwind.eimage, dest_mask, instantiator, domain)); /* This will clean up everything else. */ @@ -1156,7 +1126,7 @@ struct tiff_error_struct { -#ifdef HAVE_VSNPRINTF +#if HAVE_VSNPRINTF char err_str[256]; #else char err_str[1024]; /* return the error string */ @@ -1171,12 +1141,12 @@ 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; va_start (vargs, fmt); -#ifdef HAVE_VSNPRINTF +#if HAVE_VSNPRINTF vsnprintf (tiff_err_data.err_str, 255, fmt, vargs); #else /* pray this doesn't overflow... */ @@ -1188,17 +1158,17 @@ } 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 +#if HAVE_VSNPRINTF char warn_str[256]; #else char warn_str[1024]; #endif va_start (vargs, fmt); -#ifdef HAVE_VSNPRINTF +#if HAVE_VSNPRINTF vsnprintf (warn_str, 255, fmt, vargs); #else vsprintf (warn_str, fmt, vargs); @@ -1213,7 +1183,7 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); tiff_memory_storage mem_struct; /* It is OK for the unwind data to be local to this function, because the unwind-protect is always executed when this @@ -1248,9 +1218,7 @@ /* #### This is a definite problem under Mule due to the amount of stack data it might allocate. Think about Lstreams... */ - TO_EXTERNAL_FORMAT (LISP_STRING, data, - ALLOCA, (bytes, len), - Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); mem_struct.bytes = bytes; mem_struct.len = len; mem_struct.index = 0; @@ -1261,13 +1229,13 @@ tiff_memory_seek, tiff_memory_close, tiff_memory_size, tiff_map_noop, tiff_unmap_noop); if (!unwind.tiff) - signal_image_error ("Insufficient memory to instantiate TIFF image", instantiator); + signal_image_error ("Insufficent memory to instantiate TIFF image", instantiator); TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height); unwind.eimage = (unsigned char *) xmalloc (width * height * 3); - /* #### This is little more than proof-of-concept/function testing. + /* ### This is little more than proof-of-concept/function testing. It needs to be reimplemented via scanline reads for both memory compactness. */ raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32)); @@ -1300,9 +1268,9 @@ } /* now instantiate */ - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), + MAYBE_DEVMETH (XDEVICE (ii->device), init_image_instance_from_eimage, - (ii, width, height, 1, unwind.eimage, dest_mask, + (ii, width, height, unwind.eimage, dest_mask, instantiator, domain)); unbind_to (speccount, Qnil); diff -r 12e008d41344 -r 697ef44129c6 src/glyphs-msw.c --- a/src/glyphs-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ /* mswindows-specific glyph objects. - Copyright (C) 1998, 1999, 2000 Andy Piper. - + Copyright (C) 1998 Andy Piper. + This file is part of XEmacs. XEmacs is free software; you can redistribute it and/or modify it @@ -20,7 +20,7 @@ /* Synched up with: Not in FSF. */ -/* written by Andy Piper <andy@xemacs.org> plagiarising bits from +/* written by Andy Piper <andy@xemacs.org> plagerising bits from glyphs-x.c */ #include <config.h> @@ -53,44 +53,24 @@ #define WIDGET_GLYPH_SLOT 0 -DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); -#ifdef HAVE_JPEG -DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); -#endif -#ifdef HAVE_TIFF -DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff); -#endif -#ifdef HAVE_PNG -DECLARE_IMAGE_INSTANTIATOR_FORMAT (png); -#endif -#ifdef HAVE_GIF -DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif); -#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, edit); +#if 0 +DEFINE_DEVICE_IIFORMAT (mswindows, group); +#endif DEFINE_DEVICE_IIFORMAT (mswindows, subwindow); DEFINE_DEVICE_IIFORMAT (mswindows, widget); DEFINE_DEVICE_IIFORMAT (mswindows, label); DEFINE_DEVICE_IIFORMAT (mswindows, scrollbar); -DEFINE_DEVICE_IIFORMAT (mswindows, combo_box); -DEFINE_DEVICE_IIFORMAT (mswindows, progress_gauge); -DEFINE_DEVICE_IIFORMAT (mswindows, tree_view); -DEFINE_DEVICE_IIFORMAT (mswindows, tab_control); +DEFINE_DEVICE_IIFORMAT (mswindows, combo); +DEFINE_DEVICE_IIFORMAT (mswindows, progress); DEFINE_IMAGE_INSTANTIATOR_FORMAT (bmp); Lisp_Object Qbmp; @@ -102,60 +82,13 @@ Lisp_Object Qmswindows_resource; static void -mswindows_initialize_dibitmap_image_instance (Lisp_Image_Instance *ii, - int slices, - enum image_instance_type type); +mswindows_initialize_dibitmap_image_instance (struct Lisp_Image_Instance *ii, + enum image_instance_type type); static void -mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, - 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); -} +mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image, + struct frame* f); -/* - * 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); - } -} +COLORREF mswindows_string_to_color (CONST char *name); #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) @@ -176,7 +109,7 @@ BITMAPINFO* bmp_info; unsigned char *ip, *dp; - if (GetDeviceCaps (get_device_compdc (d), BITSPIXEL) > 0) + if (DEVICE_MSWINDOWS_BITSPIXEL (d) > 0) { int bpline = BPLINE(width * 3); /* FIXME: we can do this because 24bpp implies no color table, once @@ -187,7 +120,7 @@ * structure - unless it has memory / color allocation implications * .... */ bmp_info=xnew_and_zero (BITMAPINFO); - + if (!bmp_info) { return NULL; @@ -195,7 +128,7 @@ bmp_info->bmiHeader.biBitCount=24; /* just RGB triples for now */ bmp_info->bmiHeader.biCompression=BI_RGB; /* just RGB triples for now */ - bmp_info->bmiHeader.biSizeImage=width*height*3; + bmp_info->bmiHeader.biSizeImage=width*height*3; /* bitmap data needs to be in blue, green, red triples - in that order, eimage is in RGB format so we need to convert */ @@ -231,7 +164,7 @@ /* use our quantize table to allocate the colors */ ncolors = qtable->num_active_colors; - bmp_info=(BITMAPINFO*)xmalloc_and_zero (sizeof(BITMAPINFOHEADER) + + bmp_info=(BITMAPINFO*)xmalloc_and_zero (sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * ncolors); if (!bmp_info) { @@ -241,12 +174,12 @@ colortbl=(RGBQUAD*)(((unsigned char*)bmp_info)+sizeof(BITMAPINFOHEADER)); - bmp_info->bmiHeader.biBitCount=8; - bmp_info->bmiHeader.biCompression=BI_RGB; + bmp_info->bmiHeader.biBitCount=8; + bmp_info->bmiHeader.biCompression=BI_RGB; bmp_info->bmiHeader.biSizeImage=bpline*height; - bmp_info->bmiHeader.biClrUsed=ncolors; - bmp_info->bmiHeader.biClrImportant=ncolors; - + bmp_info->bmiHeader.biClrUsed=ncolors; + bmp_info->bmiHeader.biClrImportant=ncolors; + *bmp_data = (unsigned char *) xmalloc_and_zero (bpline * height); *bit_count = bpline * height; @@ -256,39 +189,36 @@ xfree (bmp_info); return NULL; } - + /* 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 */ bmp_info->bmiHeader.biWidth=width; bmp_info->bmiHeader.biHeight=height; bmp_info->bmiHeader.biPlanes=1; bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); bmp_info->bmiHeader.biXPelsPerMeter=0; /* unless you know better */ - bmp_info->bmiHeader.biYPelsPerMeter=0; + bmp_info->bmiHeader.biYPelsPerMeter=0; return bmp_info; } @@ -312,7 +242,7 @@ (IS_DIRECTORY_SEP(XSTRING_BYTE (name, 2))))))) { if (!NILP (Ffile_readable_p (name))) - return Fexpand_file_name (name, Qnil); + return name; else return Qnil; } @@ -326,7 +256,7 @@ locate_file (temp, name, Qnil, &found, R_OK); UNGCPRO; } - + return found; } @@ -339,36 +269,45 @@ in the error message. */ static void -init_image_instance_from_dibitmap (Lisp_Image_Instance *ii, +init_image_instance_from_dibitmap (struct Lisp_Image_Instance *ii, BITMAPINFO *bmp_info, int dest_mask, void *bmp_data, int bmp_bits, - int slices, - Lisp_Object instantiator, + Lisp_Object instantiator, int x_hot, int y_hot, int create_mask) { - struct device *d = XDEVICE (IMAGE_INSTANCE_DEVICE (ii)); + Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); + struct device *d = XDEVICE (device); + struct frame *f; void* bmp_buf=0; - enum image_instance_type type; + int 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) type = IMAGE_POINTER; - else + else incompatible_image_types (instantiator, dest_mask, IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); + hdc = FRAME_MSWINDOWS_CDC (f); - hdc = get_device_compdc (d); - bitmap = CreateDIBSection (hdc, - bmp_info, - DIB_RGB_COLORS, - &bmp_buf, - 0, 0); + bitmap=CreateDIBSection (hdc, + bmp_info, + DIB_RGB_COLORS, + &bmp_buf, + 0,0); if (!bitmap || !bmp_buf) signal_simple_error ("Unable to create bitmap", instantiator); @@ -376,29 +315,24 @@ /* copy in the actual bitmap */ memcpy (bmp_buf, bmp_data, bmp_bits); - mswindows_initialize_dibitmap_image_instance (ii, slices, type); + mswindows_initialize_dibitmap_image_instance (ii, type); IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = find_keyword_in_vector (instantiator, Q_file); - /* Fixup a set of bitmaps. */ IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap; - IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; - 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; + IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth; + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight; + IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot); XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot); - init_image_instance_geometry (ii); if (create_mask) { - mswindows_initialize_image_instance_mask (ii, hdc); + mswindows_initialize_image_instance_mask (ii, f); } - + if (type == IMAGE_POINTER) { mswindows_initialize_image_instance_icon(ii, TRUE); @@ -406,35 +340,9 @@ } static void -image_instance_add_dibitmap (Lisp_Image_Instance *ii, - BITMAPINFO *bmp_info, - void *bmp_data, - int bmp_bits, - int slice, - Lisp_Object instantiator) -{ - struct device *d = XDEVICE (IMAGE_INSTANCE_DEVICE (ii)); - void* bmp_buf=0; - - HBITMAP bitmap = CreateDIBSection (get_device_compdc (d), - bmp_info, - DIB_RGB_COLORS, - &bmp_buf, - 0,0); - - if (!bitmap || !bmp_buf) - signal_simple_error ("Unable to create bitmap", instantiator); - - /* copy in the actual bitmap */ - memcpy (bmp_buf, bmp_data, bmp_bits); - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (ii, slice) = bitmap; -} - -static void -mswindows_init_image_instance_from_eimage (Lisp_Image_Instance *ii, +mswindows_init_image_instance_from_eimage (struct Lisp_Image_Instance *ii, int width, int height, - int slices, - unsigned char *eimage, + unsigned char *eimage, int dest_mask, Lisp_Object instantiator, Lisp_Object domain) @@ -444,86 +352,79 @@ unsigned char* bmp_data; int bmp_bits; COLORREF bkcolor; - int slice; - - CHECK_MSGDI_DEVICE (device); + + if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) + signal_simple_error ("Not an mswindows device", device); /* this is a hack but MaskBlt and TransparentBlt are not supported on most windows variants */ - bkcolor = COLOR_INSTANCE_MSWINDOWS_COLOR + bkcolor = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (FACE_BACKGROUND (Vdefault_face, domain))); - for (slice = 0; slice < slices; slice++) + /* build a bitmap from the eimage */ + if (!(bmp_info=convert_EImage_to_DIBitmap (device, width, height, eimage, + &bmp_bits, &bmp_data))) { - /* build a bitmap from the eimage */ - if (!(bmp_info=convert_EImage_to_DIBitmap (device, width, height, - eimage + (width * height * 3 * slice), - &bmp_bits, &bmp_data))) - { - signal_simple_error ("EImage to DIBitmap conversion failed", - instantiator); - } + signal_simple_error ("EImage to DIBitmap conversion failed", + instantiator); + } - /* Now create the pixmap and set up the image instance */ - if (slice == 0) - init_image_instance_from_dibitmap (ii, bmp_info, dest_mask, - bmp_data, bmp_bits, slices, instantiator, - 0, 0, 0); - else - image_instance_add_dibitmap (ii, bmp_info, bmp_data, bmp_bits, slice, - instantiator); + /* Now create the pixmap and set up the image instance */ + init_image_instance_from_dibitmap (ii, bmp_info, dest_mask, + bmp_data, bmp_bits, instantiator, + 0, 0, 0); - xfree (bmp_info); - xfree (bmp_data); - } + xfree (bmp_info); + xfree (bmp_data); } -inline static void -set_mono_pixel (unsigned char* bits, - int bpline, int height, - int x, int y, int white) -{ - int i; - unsigned char bitnum; +static void set_mono_pixel ( unsigned char* bits, + int bpline, int height, + int x, int y, int white ) +{ + int index; + unsigned char bitnum; /* Find the byte on which this scanline begins */ - i = (height - y - 1) * bpline; + index = (height - y - 1) * bpline; /* Find the byte containing this pixel */ - i += (x >> 3); + index += (x >> 3); /* Which bit is it? */ - bitnum = (unsigned char) (7 - (x & 7)); - if (white) /* Turn it on */ - bits[i] |= (1 << bitnum); - else /* Turn it off */ - bits[i] &= ~(1 << bitnum); -} + bitnum = (unsigned char)( 7 - (x % 8) ); + if( white ) /* Turn it on */ + bits[index] |= (1<<bitnum); + else /* Turn it off */ + bits[index] &= ~(1<<bitnum); +} static void -mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, - HDC hcdc) +mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image, + struct frame* f) { HBITMAP mask; HGDIOBJ old = NULL; - unsigned char *dibits, *and_bits; - BITMAPINFO *bmp_info = - (BITMAPINFO*) xmalloc_and_zero (sizeof (BITMAPINFO) + sizeof (RGBQUAD)); + HDC hcdc = FRAME_MSWINDOWS_CDC (f); + unsigned char* dibits; + BITMAPINFO* bmp_info = + xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); int i, j; - int height = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (image); - - int maskbpline = BPLINE ((IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image) + 7) / 8); - int bpline = BPLINE (IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image) * 3); + int height = IMAGE_INSTANCE_PIXMAP_HEIGHT (image); + + void* and_bits; + int maskbpline = BPLINE (((IMAGE_INSTANCE_PIXMAP_WIDTH (image)+7)/8)); + int bpline = BPLINE (IMAGE_INSTANCE_PIXMAP_WIDTH (image) * 3); if (!bmp_info) return; - bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image); + bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_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.biClrUsed = 2; - bmp_info->bmiHeader.biClrImportant = 2; - bmp_info->bmiHeader.biSizeImage = height * maskbpline; + 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; bmp_info->bmiColors[0].rgbRed = 0; bmp_info->bmiColors[0].rgbGreen = 0; bmp_info->bmiColors[0].rgbBlue = 0; @@ -532,11 +433,11 @@ bmp_info->bmiColors[1].rgbGreen = 255; bmp_info->bmiColors[1].rgbBlue = 255; bmp_info->bmiColors[0].rgbReserved = 0; - - if (!(mask = CreateDIBSection (hcdc, + + if (!(mask = CreateDIBSection (hcdc, bmp_info, DIB_RGB_COLORS, - (void**)&and_bits, + &and_bits, 0,0))) { xfree (bmp_info); @@ -547,17 +448,17 @@ /* build up an in-memory set of bits to mess with */ xzero (*bmp_info); - bmp_info->bmiHeader.biWidth = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image); + bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image); bmp_info->bmiHeader.biHeight = -height; - bmp_info->bmiHeader.biPlanes = 1; - bmp_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmp_info->bmiHeader.biBitCount = 24; - bmp_info->bmiHeader.biCompression = BI_RGB; - bmp_info->bmiHeader.biClrUsed = 0; - bmp_info->bmiHeader.biClrImportant = 0; + 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 = (unsigned char*) xmalloc_and_zero (bpline * height); + dibits = xmalloc_and_zero (bpline * height); if (GetDIBits (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image), 0, @@ -572,20 +473,20 @@ /* now set the colored bits in the mask and transparent ones to black in the original */ - for (i = 0; i < IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (image); i++) - { - for (j=0; j<height; j++) - { + for(i=0; i<IMAGE_INSTANCE_PIXMAP_WIDTH (image); i++) + { + for(j=0; j<height; j++) + { unsigned char* idx = &dibits[j * bpline + i * 3]; - if (RGB (idx[2], idx[1], idx[0]) == transparent_color) - { + if( RGB (idx[2], idx[1], idx[0]) == transparent_color ) + { idx[0] = idx[1] = idx[2] = 0; - set_mono_pixel (and_bits, maskbpline, height, i, j, TRUE); + set_mono_pixel( and_bits, maskbpline, height, i, j, TRUE ); } - else - { - set_mono_pixel (and_bits, maskbpline, height, i, j, FALSE); + else + { + set_mono_pixel( and_bits, maskbpline, height, i, j, FALSE ); } } } @@ -600,14 +501,14 @@ xfree (bmp_info); xfree (dibits); - + SelectObject(hcdc, old); IMAGE_INSTANCE_MSWINDOWS_MASK (image) = mask; } void -mswindows_initialize_image_instance_icon (Lisp_Image_Instance* image, +mswindows_initialize_image_instance_icon (struct Lisp_Image_Instance* image, int cursor) { ICONINFO x_icon; @@ -618,32 +519,31 @@ x_icon.yHotspot=XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (image)); x_icon.hbmMask=IMAGE_INSTANCE_MSWINDOWS_MASK (image); x_icon.hbmColor=IMAGE_INSTANCE_MSWINDOWS_BITMAP (image); - + IMAGE_INSTANCE_MSWINDOWS_ICON (image)= CreateIconIndirect (&x_icon); } -static HBITMAP -create_resized_bitmap (HBITMAP curbmp, struct frame *f, - int curx, int cury, - int newx, int newy) +HBITMAP +mswindows_create_resized_bitmap (struct Lisp_Image_Instance* ii, + struct frame* f, + int newx, int newy) { HBITMAP newbmp; HGDIOBJ old1, old2; - - HDC hcdc = get_device_compdc (XDEVICE (FRAME_DEVICE (f))); - HDC hdcDst = CreateCompatibleDC (hcdc); - - old1 = SelectObject (hcdc, curbmp); - + HDC hcdc = FRAME_MSWINDOWS_CDC (f); + HDC hdcDst = CreateCompatibleDC (hcdc); + + old1 = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii)); + newbmp = CreateCompatibleBitmap (hcdc, newx, newy); old2 = SelectObject (hdcDst, newbmp); - + if (!StretchBlt (hdcDst, 0, 0, newx, newy, - hcdc, 0, 0, - curx, - cury, + hcdc, 0, 0, + IMAGE_INSTANCE_PIXMAP_WIDTH (ii), + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), SRCCOPY)) { DeleteObject (newbmp); @@ -659,37 +559,45 @@ } HBITMAP -mswindows_create_resized_bitmap (Lisp_Image_Instance* ii, - struct frame* f, - int newx, int newy) -{ - return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii), - f, - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii), - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii), - newx, newy); -} - -HBITMAP -mswindows_create_resized_mask (Lisp_Image_Instance* ii, +mswindows_create_resized_mask (struct Lisp_Image_Instance* ii, struct frame* f, int newx, int newy) { - if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii) == NULL) - return NULL; + if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii)) + { + HBITMAP newmask; + HGDIOBJ old1, old2; + HDC hcdc = FRAME_MSWINDOWS_CDC (f); + HDC hdcDst = CreateCompatibleDC (hcdc); + + old1 = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_MASK (ii)); + newmask = CreateCompatibleBitmap(hcdc, newx, newy); + old2 = SelectObject (hdcDst, newmask); - return create_resized_bitmap (IMAGE_INSTANCE_MSWINDOWS_MASK (ii), - f, - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii), - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii), - newx, newy); + if (!StretchBlt(hdcDst, 0, 0, newx, newy, + hcdc, 0, 0, + IMAGE_INSTANCE_PIXMAP_WIDTH (ii), + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), + SRCCOPY)) + { + DeleteObject (newmask); + DeleteDC (hdcDst); + return NULL; + } + + SelectObject (hdcDst, old2); + SelectObject (hcdc, old1); + + DeleteDC (hdcDst); + + return newmask; + } + + return NULL; } -#if 0 /* Currently unused */ -/* #### Warining: This function is not correct anymore with - resizable printer bitmaps. If you uncomment it, clean it. --kkm */ int -mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii, +mswindows_resize_dibitmap_instance (struct Lisp_Image_Instance* ii, struct frame* f, int newx, int newy) { @@ -698,7 +606,7 @@ if (!newbmp) return FALSE; - + if (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii)) DeleteObject (IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii)); if (IMAGE_INSTANCE_MSWINDOWS_MASK (ii)) @@ -711,7 +619,6 @@ return TRUE; } -#endif /********************************************************************** * XPM * @@ -775,12 +682,10 @@ for (j=0; j<i; j++) { Lisp_Object cons = XCAR (results); - colortbl[j].color = + colortbl[j].color = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (XCDR (cons))); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (cons), - C_STRING_ALLOCA, colortbl[j].name, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (XCAR (cons), colortbl[j].name); colortbl[j].name = xstrdup (colortbl[j].name); /* mustn't lose this when we return */ free_cons (XCONS (cons)); cons = results; @@ -790,7 +695,7 @@ return colortbl; } -static int xpm_to_eimage (Lisp_Object image, const Extbyte *buffer, +static int xpm_to_eimage (Lisp_Object image, CONST Extbyte *buffer, unsigned char** data, int* width, int* height, int* x_hot, int* y_hot, @@ -804,7 +709,7 @@ unsigned char* dptr; unsigned int* sptr; COLORREF color; /* the american spelling virus hits again .. */ - COLORREF* colortbl; + COLORREF* colortbl; xzero (xpmimage); xzero (xpminfo); @@ -830,15 +735,15 @@ default: { signal_double_file_error_2 ("Parsing pixmap data", - "unknown error", + "unknown error code", make_int (result), image); } } - + *width = xpmimage.width; *height = xpmimage.height; - maskbpline = BPLINE ((~7UL & (unsigned long)(*width + 7)) / 8); - + maskbpline = BPLINE (((~7UL & (unsigned long)(*width + 7)) / 8)); + *data = xnew_array_and_zero (unsigned char, *width * *height * 3); if (!*data) @@ -869,7 +774,7 @@ !strcasecmp (xpmimage.colorTable[i].symbolic,"None")) { *transp=TRUE; - colortbl[i]=transparent_color; + colortbl[i]=transparent_color; transp_idx=i; goto label_found_color; } @@ -894,7 +799,7 @@ if (!strcasecmp (xpmimage.colorTable[i].c_color,"None")) { *transp=TRUE; - colortbl[i]=transparent_color; + colortbl[i]=transparent_color; transp_idx=i; goto label_found_color; } @@ -905,14 +810,14 @@ mswindows_string_to_color (xpmimage.colorTable[i].c_color); goto label_found_color; } - + label_no_color: xfree (*data); xfree (colortbl); XpmFreeXpmImage (&xpmimage); XpmFreeXpmInfo (&xpminfo); return 0; - + label_found_color:; } @@ -944,9 +849,9 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - const Extbyte *bytes; + CONST Extbyte *bytes; Extcount len; unsigned char *eimage; int width, height, x_hot, y_hot; @@ -955,18 +860,17 @@ int bmp_bits; int nsymbols=0, transp; struct color_symbol* color_symbols=NULL; - + Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); Lisp_Object color_symbol_alist = find_keyword_in_vector (instantiator, Q_color_symbols); - CHECK_MSGDI_DEVICE (device); + if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) + signal_simple_error ("Not an mswindows device", device); assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - ALLOCA, (bytes, len), - Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); /* in case we have color symbols */ color_symbols = extract_xpm_color_names (device, domain, @@ -976,10 +880,10 @@ if (!xpm_to_eimage (image_instance, bytes, &eimage, &width, &height, &x_hot, &y_hot, &transp, color_symbols, nsymbols)) { - signal_simple_error ("XPM to EImage conversion failed", + signal_simple_error ("XPM to EImage conversion failed", image_instance); } - + if (color_symbols) { while (nsymbols--) @@ -988,7 +892,7 @@ } xfree(color_symbols); } - + /* build a bitmap from the eimage */ if (!(bmp_info=convert_EImage_to_DIBitmap (device, width, height, eimage, &bmp_bits, &bmp_data))) @@ -1000,7 +904,7 @@ /* Now create the pixmap and set up the image instance */ init_image_instance_from_dibitmap (ii, bmp_info, dest_mask, - bmp_data, bmp_bits, 1, instantiator, + bmp_data, bmp_bits, instantiator, x_hot, y_hot, transp); xfree (bmp_info); @@ -1035,9 +939,9 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - const Extbyte *bytes; + CONST Extbyte *bytes; Extcount len; BITMAPFILEHEADER* bmp_file_header; BITMAPINFO* bmp_info; @@ -1045,18 +949,17 @@ int bmp_bits; Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - CHECK_MSGDI_DEVICE (device); + if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) + signal_simple_error ("Not an mswindows device", device); assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - ALLOCA, (bytes, len), - Qbinary); - + GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len); + /* Then slurp the image into memory, decoding along the way. The result is the image in a simple one-byte-per-pixel format. */ - + bmp_file_header=(BITMAPFILEHEADER*)bytes; bmp_info = (BITMAPINFO*)(bytes + sizeof(BITMAPFILEHEADER)); bmp_data = (Extbyte*)bytes + bmp_file_header->bfOffBits; @@ -1064,7 +967,7 @@ /* Now create the pixmap and set up the image instance */ init_image_instance_from_dibitmap (ii, bmp_info, dest_mask, - bmp_data, bmp_bits, 1, instantiator, + bmp_data, bmp_bits, instantiator, 0, 0, 0); } @@ -1076,9 +979,9 @@ static void mswindows_resource_validate (Lisp_Object instantiator) { - if ((NILP (find_keyword_in_vector (instantiator, Q_file)) + if ((NILP (find_keyword_in_vector (instantiator, Q_file)) && - NILP (find_keyword_in_vector (instantiator, Q_resource_id))) + NILP (find_keyword_in_vector (instantiator, Q_resource_id))) || NILP (find_keyword_in_vector (instantiator, Q_resource_type))) signal_simple_error ("Must supply :file, :resource-id and :resource-type", @@ -1095,7 +998,7 @@ GCPRO2 (file, alist); - file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, + file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, console_type); if (CONSP (file)) /* failure locating filename */ @@ -1126,7 +1029,7 @@ return IMAGE_POINTER_MASK | IMAGE_COLOR_PIXMAP_MASK; } -typedef struct +typedef struct { char *name; int resource_id; @@ -1140,12 +1043,10 @@ #define OIC_BANG 32515 #define OIC_NOTE 32516 #define OIC_WINLOGO 32517 -#if defined (CYGWIN) && CYGWIN_VERSION_DLL_MAJOR < 21 #define LR_SHARED 0x8000 #endif -#endif -static const resource_t bitmap_table[] = +static CONST resource_t bitmap_table[] = { /* bitmaps */ { "close", OBM_CLOSE }, @@ -1177,7 +1078,7 @@ {0} }; -static const resource_t cursor_table[] = +static CONST resource_t cursor_table[] = { /* cursors */ { "normal", OCR_NORMAL }, @@ -1196,7 +1097,7 @@ { 0 } }; -static const resource_t icon_table[] = +static CONST resource_t icon_table[] = { /* icons */ { "sample", OIC_SAMPLE }, @@ -1210,8 +1111,8 @@ static int resource_name_to_resource (Lisp_Object name, int type) { - const resource_t* res = (type == IMAGE_CURSOR ? cursor_table - : type == IMAGE_ICON ? icon_table + CONST resource_t* res = (type == IMAGE_CURSOR ? cursor_table + : type == IMAGE_ICON ? icon_table : bitmap_table); if (INTP (name)) @@ -1222,12 +1123,10 @@ { signal_simple_error ("invalid resource identifier", name); } - + do { Extbyte* nm=0; - TO_EXTERNAL_FORMAT (LISP_STRING, name, - C_STRING_ALLOCA, nm, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (name, nm); if (!strcasecmp ((char*)res->name, nm)) return res->resource_id; } while ((++res)->name); @@ -1252,25 +1151,26 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); unsigned int type = 0; HANDLE himage = NULL; LPCTSTR resid=0; HINSTANCE hinst = NULL; ICONINFO iconinfo; - enum image_instance_type iitype; + int iitype=0; char* fname=0; Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Lisp_Object file = find_keyword_in_vector (instantiator, Q_file); - Lisp_Object resource_type = find_keyword_in_vector (instantiator, + Lisp_Object resource_type = find_keyword_in_vector (instantiator, Q_resource_type); - Lisp_Object resource_id = find_keyword_in_vector (instantiator, + Lisp_Object resource_id = find_keyword_in_vector (instantiator, Q_resource_id); xzero (iconinfo); - CHECK_MSGDI_DEVICE (device); + if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) + signal_simple_error ("Not an mswindows device", device); type = resource_symbol_to_type (resource_type); @@ -1278,7 +1178,7 @@ iitype = IMAGE_POINTER; else if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) iitype = IMAGE_COLOR_PIXMAP; - else + else incompatible_image_types (instantiator, dest_mask, IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); @@ -1286,15 +1186,13 @@ if (!NILP (file)) { Extbyte* f=0; - TO_EXTERNAL_FORMAT (LISP_STRING, file, - C_STRING_ALLOCA, f, - Qfile_name); -#ifdef CYGWIN + GET_C_STRING_FILENAME_DATA_ALLOCA (file, f); +#ifdef __CYGWIN32__ CYGWIN_WIN32_PATH (f, fname); #else fname = f; #endif - + if (NILP (resource_id)) resid = (LPCTSTR)fname; else @@ -1303,21 +1201,19 @@ LOAD_LIBRARY_AS_DATAFILE); resid = MAKEINTRESOURCE (resource_name_to_resource (resource_id, type)); - + if (!resid) - TO_EXTERNAL_FORMAT (LISP_STRING, resource_id, - C_STRING_ALLOCA, resid, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (resource_id, resid); } } else if (!(resid = MAKEINTRESOURCE (resource_name_to_resource (resource_id, type)))) signal_simple_error ("Invalid resource identifier", resource_id); - + /* load the image */ if (!(himage = LoadImage (hinst, resid, type, 0, 0, - LR_CREATEDIBSECTION | LR_DEFAULTSIZE | - LR_SHARED | + LR_CREATEDIBSECTION | LR_DEFAULTSIZE | + LR_SHARED | (!NILP (file) ? LR_LOADFROMFILE : 0)))) { signal_simple_error ("Cannot load image", instantiator); @@ -1326,31 +1222,30 @@ if (hinst) FreeLibrary (hinst); - mswindows_initialize_dibitmap_image_instance (ii, 1, iitype); + mswindows_initialize_dibitmap_image_instance (ii, iitype); IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = file; - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = + IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = GetSystemMetrics (type == IMAGE_CURSOR ? SM_CXCURSOR : SM_CXICON); - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = GetSystemMetrics (type == IMAGE_CURSOR ? SM_CYCURSOR : SM_CYICON); IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1; - init_image_instance_geometry (ii); /* hey, we've got an icon type thing so we can reverse engineer the bitmap and mask */ if (type != IMAGE_BITMAP) { - GetIconInfo ((HICON)himage, &iconinfo); + GetIconInfo (himage, &iconinfo); IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = iconinfo.hbmColor; IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = iconinfo.hbmMask; XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), iconinfo.xHotspot); XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), iconinfo.yHotspot); - IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = (HICON) himage; + IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = himage; } else { IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = NULL; - IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = (HBITMAP) himage; + IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = himage; IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0); XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0); @@ -1376,6 +1271,15 @@ signal_simple_error ("invalid resource identifier", data); } +void +check_valid_string_or_int (Lisp_Object data) +{ + if (!INTP (data)) + CHECK_STRING (data); + else + CHECK_INT (data); +} + /********************************************************************** * XBM * **********************************************************************/ @@ -1420,7 +1324,7 @@ * and return data * * Note that this file and ../X/XRdBitF.c look very similar.... Keep them - * that way (but don't use common source code so that people can have one + * that way (but don't use common source code so that people can have one * without the other). */ @@ -1444,8 +1348,7 @@ * Table index for the hex values. Initialized once, first time. * Used for translation value or delimiter significance lookup. */ -static void -initHexTable (void) +static void initHexTable() { /* * We build the table at run time for several reasons: @@ -1471,21 +1374,20 @@ hexTable[' '] = -1; hexTable[','] = -1; hexTable['}'] = -1; hexTable['\n'] = -1; hexTable['\t'] = -1; - + initialized = TRUE; } /* * read next hex value in the input stream, return -1 if EOF */ -static int -NextInt (FILE *fstream) +static int NextInt ( FILE *fstream ) { int ch; int value = 0; int gotone = 0; int done = 0; - + /* loop, accumulate hex value until find delimiter */ /* skip any initial delimiters found in read stream */ @@ -1514,9 +1416,11 @@ * its arguments won't have been touched. This routine should look as much * like the Xlib routine XReadBitmapfile as possible. */ -int read_bitmap_data (FILE* fstream, unsigned int *width, - unsigned int *height, unsigned char **datap, - int *x_hot, int *y_hot) +int read_bitmap_data (fstream, width, height, datap, x_hot, y_hot) + FILE *fstream; /* handle on file */ + unsigned int *width, *height; /* RETURNED */ + unsigned char **datap; /* RETURNED */ + int *x_hot, *y_hot; /* RETURNED */ { unsigned char *data = NULL; /* working variable */ char line[MAX_SIZE]; /* input line from file */ @@ -1564,7 +1468,7 @@ } continue; } - + if (sscanf(line, "static short %s = {", name_and_type) == 1) version10p = 1; else if (sscanf(line,"static unsigned char %s = {",name_and_type) == 1) @@ -1581,7 +1485,7 @@ if (strcmp("bits[]", type)) continue; - + if (!ww || !hh) RETURN (BitmapFileInvalid); @@ -1594,7 +1498,7 @@ size = bytes_per_line * hh; data = (unsigned char *) Xmalloc ((unsigned int) size); - if (!data) + if (!data) RETURN (BitmapNoMemory); if (version10p) { @@ -1613,7 +1517,7 @@ int bytes; for (bytes=0, ptr=data; bytes<size; bytes++, ptr++) { - if ((value = NextInt(fstream)) < 0) + if ((value = NextInt(fstream)) < 0) RETURN (BitmapFileInvalid); *ptr=value; } @@ -1636,7 +1540,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) { @@ -1665,7 +1569,7 @@ padded to a multiple of 16. Scan lines are stored in increasing byte order from left to right, big-endian within a byte. 0 = black, 1 = white. */ -static HBITMAP +HBITMAP xbm_create_bitmap_from_data (HDC hdc, char *data, unsigned int width, unsigned int height, int mask, COLORREF fg, COLORREF bg) @@ -1676,21 +1580,21 @@ void *bmp_buf = 0; unsigned char *new_data, *new_offset; int i, j; - BITMAPINFO *bmp_info = - (BITMAPINFO*) xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); + BITMAPINFO* bmp_info = + xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); HBITMAP bitmap; if (!bmp_info) return NULL; - + new_data = (unsigned char *) xmalloc_and_zero (height * new_width); - + if (!new_data) { xfree (bmp_info); return NULL; } - + for (i=0; i<height; i++) { offset = data + i*old_width; @@ -1718,11 +1622,11 @@ bmp_info->bmiHeader.biHeight=-(LONG)height; bmp_info->bmiHeader.biPlanes=1; bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmp_info->bmiHeader.biBitCount=1; + 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 * new_width; + bmp_info->bmiHeader.biClrUsed = 2; + bmp_info->bmiHeader.biClrImportant = 2; + bmp_info->bmiHeader.biSizeImage = height * new_width; bmp_info->bmiColors[0].rgbRed = GetRValue (fg); bmp_info->bmiColors[0].rgbGreen = GetGValue (fg); bmp_info->bmiColors[0].rgbBlue = GetBValue (fg); @@ -1731,21 +1635,21 @@ bmp_info->bmiColors[1].rgbGreen = GetGValue (bg); bmp_info->bmiColors[1].rgbBlue = GetBValue (bg); bmp_info->bmiColors[1].rgbReserved = 0; - - bitmap = CreateDIBSection (hdc, + + bitmap = CreateDIBSection (hdc, bmp_info, DIB_RGB_COLORS, - &bmp_buf, + &bmp_buf, 0,0); xfree (bmp_info); - + if (!bitmap || !bmp_buf) { xfree (new_data); return NULL; } - + /* copy in the actual bitmap */ memcpy (bmp_buf, new_data, height * new_width); xfree (new_data); @@ -1757,10 +1661,10 @@ image instance accordingly. */ static void -init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii, +init_image_instance_from_xbm_inline (struct 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, @@ -1769,16 +1673,17 @@ Lisp_Object mask_filename) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); + struct frame* f = XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device))); Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground); Lisp_Object background = find_keyword_in_vector (instantiator, Q_background); enum image_instance_type type; COLORREF black = PALETTERGB (0,0,0); COLORREF white = PALETTERGB (255,255,255); - HDC hdc; + + HDC hdc = FRAME_MSWINDOWS_CDC (f); - CHECK_MSGDI_DEVICE (device); - - hdc = get_device_compdc (XDEVICE (device)); + if (!DEVICE_MSWINDOWS_P (XDEVICE (device))) + signal_simple_error ("Not an MS-Windows device", device); if ((dest_mask & IMAGE_MONO_PIXMAP_MASK) && (dest_mask & IMAGE_COLOR_PIXMAP_MASK)) @@ -1799,26 +1704,24 @@ IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); - mswindows_initialize_dibitmap_image_instance (ii, 1, type); - + mswindows_initialize_dibitmap_image_instance (ii, type); + IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = find_keyword_in_vector (instantiator, Q_file); - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = width; - IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = height; + IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = width; + IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = height; IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1; XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0); XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0); - init_image_instance_geometry (ii); - IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask ? mask : - xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, + xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, TRUE, black, white); switch (type) { case IMAGE_MONO_PIXMAP: - IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = - xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, + IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = + xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, FALSE, black, black); break; @@ -1846,8 +1749,8 @@ IMAGE_INSTANCE_PIXMAP_FG (ii) = foreground; IMAGE_INSTANCE_PIXMAP_BG (ii) = background; - IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = - xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, + IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = + xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, FALSE, fg, black); } break; @@ -1862,9 +1765,9 @@ if (NILP (background)) background = pointer_bg; - IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = + IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = find_keyword_in_vector (instantiator, Q_hotspot_x); - IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = + IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = find_keyword_in_vector (instantiator, Q_hotspot_y); IMAGE_INSTANCE_PIXMAP_FG (ii) = foreground; IMAGE_INSTANCE_PIXMAP_BG (ii) = background; @@ -1873,8 +1776,8 @@ if (COLOR_INSTANCEP (background)) bg = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (background)); - IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = - xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, + IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = + xbm_create_bitmap_from_data (hdc, (Extbyte *) bits, width, height, TRUE, fg, black); mswindows_initialize_image_instance_icon (ii, TRUE); } @@ -1890,28 +1793,29 @@ 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); - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HDC hdc = get_device_compdc (XDEVICE (IMAGE_INSTANCE_DEVICE (ii))); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct frame* f = XFRAME (DEVICE_SELECTED_FRAME + (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)))); + HDC hdc = FRAME_MSWINDOWS_CDC (f); HBITMAP mask = 0; + CONST char *gcc_may_you_rot_in_hell; if (!NILP (mask_data)) { - const char *ext_data; - - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))), - C_STRING_ALLOCA, ext_data, - Qbinary); - mask = xbm_create_bitmap_from_data (hdc, - (unsigned char *) ext_data, - XINT (XCAR (mask_data)), - XINT (XCAR (XCDR (mask_data))), - FALSE, - PALETTERGB (0,0,0), - PALETTERGB (255,255,255)); + GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (mask_data))), + gcc_may_you_rot_in_hell); + mask = + xbm_create_bitmap_from_data ( hdc, + (unsigned char *) + gcc_may_you_rot_in_hell, + XINT (XCAR (mask_data)), + XINT (XCAR (XCDR (mask_data))), FALSE, + PALETTERGB (0,0,0), + PALETTERGB (255,255,255)); } init_image_instance_from_xbm_inline (ii, width, height, bits, @@ -1922,23 +1826,22 @@ /* Instantiate method for XBM's. */ static void -mswindows_xbm_instantiate (Lisp_Object image_instance, +mswindows_xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - const char *ext_data; + CONST char *gcc_go_home; assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))), - C_STRING_ALLOCA, ext_data, - Qbinary); + GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (data))), + gcc_go_home); xbm_instantiate_1 (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, XINT (XCAR (data)), - XINT (XCAR (XCDR (data))), ext_data); + XINT (XCAR (XCDR (data))), gcc_go_home); } #ifdef HAVE_XFACE @@ -1973,14 +1876,12 @@ 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; + CONST char * volatile emsg = 0; + CONST char * volatile dstring; assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - C_STRING_ALLOCA, dstring, - Qbinary); + GET_C_STRING_BINARY_DATA_ALLOCA (data, dstring); if ((p = strchr (dstring, ':'))) { @@ -2036,7 +1937,7 @@ /************************************************************************/ static void -mswindows_print_image_instance (Lisp_Image_Instance *p, +mswindows_print_image_instance (struct Lisp_Image_Instance *p, Lisp_Object printcharfun, int escapeflag) { @@ -2047,12 +1948,12 @@ case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: - sprintf (buf, " (0x%lx", + sprintf (buf, " (0x%lx", (unsigned long) IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)); write_c_string (buf, printcharfun); if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) { - sprintf (buf, "/0x%lx", + sprintf (buf, "/0x%lx", (unsigned long) IMAGE_INSTANCE_MSWINDOWS_MASK (p)); write_c_string (buf, printcharfun); } @@ -2064,49 +1965,24 @@ } } -#ifdef DEBUG_WIDGETS -extern int debug_widget_instances; -#endif - static void -mswindows_finalize_image_instance (Lisp_Image_Instance *p) +mswindows_finalize_image_instance (struct Lisp_Image_Instance *p) { - if (!p->data) - return; - - if (DEVICE_LIVE_P (XDEVICE (IMAGE_INSTANCE_DEVICE (p)))) + if (DEVICE_LIVE_P (XDEVICE (p->device))) { - if (image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (p)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) + if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET + || + IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) { -#ifdef DEBUG_WIDGETS - debug_widget_instances--; - stderr_out ("widget destroyed, %d left\n", debug_widget_instances); -#endif if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) - { - DestroyWindow (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p)); - DestroyWindow (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p)); - IMAGE_INSTANCE_SUBWINDOW_ID (p) = 0; - } + DestroyWindow (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p)); + IMAGE_INSTANCE_SUBWINDOW_ID (p) = 0; } else if (p->data) { - int i; - if (IMAGE_INSTANCE_PIXMAP_TIMEOUT (p)) - disable_glyph_animated_timeout (IMAGE_INSTANCE_PIXMAP_TIMEOUT (p)); - - if (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (p)) - { - for (i = 0; i < IMAGE_INSTANCE_PIXMAP_MAXSLICE (p); i++) - { - if (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (p, i)) - DeleteObject (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (p, i)); - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (p, i) = 0; - } - xfree (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (p)); - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (p) = 0; - } + if (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)) + DeleteObject (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)); + IMAGE_INSTANCE_MSWINDOWS_BITMAP (p) = 0; if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) DeleteObject (IMAGE_INSTANCE_MSWINDOWS_MASK (p)); IMAGE_INSTANCE_MSWINDOWS_MASK (p) = 0; @@ -2127,158 +2003,51 @@ /* subwindow and widget support */ /************************************************************************/ -static HFONT -mswindows_widget_hfont (Lisp_Image_Instance *p, - Lisp_Object domain) -{ - Lisp_Object face = IMAGE_INSTANCE_WIDGET_FACE (p); - int under = FACE_UNDERLINE_P (face, domain); - int strike = FACE_STRIKETHRU_P (face, domain); - Lisp_Object font = query_string_font (IMAGE_INSTANCE_WIDGET_TEXT (p), - face, domain); - - return mswindows_get_hfont (XFONT_INSTANCE (font), under, strike); -} - -static HDWP -begin_defer_window_pos (struct frame *f) -{ - if (FRAME_MSWINDOWS_DATA (f)->hdwp == 0) - FRAME_MSWINDOWS_DATA (f)->hdwp = BeginDeferWindowPos (10); - 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 -mswindows_unmap_subwindow (Lisp_Image_Instance *p) +mswindows_unmap_subwindow (struct Lisp_Image_Instance *p) { if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) { - 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; - if (GetFocus() == WIDGET_INSTANCE_MSWINDOWS_HANDLE (p)) - SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p))); + SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), + NULL, + 0, 0, 0, 0, + SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE + | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); } } /* map the subwindow. This is used by redisplay via redisplay_output_subwindow */ static void -mswindows_map_subwindow (Lisp_Image_Instance *p, int x, int y, - struct display_glyph_area* dga) +mswindows_map_subwindow (struct Lisp_Image_Instance *p, int x, int y) { - struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p)); - HDWP hdwp = begin_defer_window_pos (f); - HDWP new_hdwp; - /* move the window before mapping it ... */ - SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p), - NULL, - x, y, dga->width, dga->height, - SWP_NOZORDER - | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); - /* ... adjust the child ... */ - SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), - NULL, - -dga->xoffset, -dga->yoffset, 0, 0, - SWP_NOZORDER | SWP_NOSIZE + /* ShowWindow (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), SW_SHOW);*/ + SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), + NULL, + x, y, 0, 0, + SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); - /* ... now map it - we are not allowed to move it at the same time. */ - 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; -} - -/* resize the subwindow instance */ -static void -mswindows_resize_subwindow (Lisp_Image_Instance* ii, int w, int h) -{ - /* Set the size of the control .... */ - 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_update_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_widget (Lisp_Image_Instance *p) +mswindows_update_subwindow (struct Lisp_Image_Instance *p) { - /* 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))) + if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET) { - /* set the widget font from the widget face */ - SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p), - WM_SETFONT, - (WPARAM) mswindows_widget_hfont - (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); + /* 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); + } } } @@ -2286,29 +2055,17 @@ callbacks. The hashtable is weak so deregistration is handled automatically */ static int -mswindows_register_gui_item (Lisp_Object image_instance, - Lisp_Object gui, Lisp_Object domain) -{ - Lisp_Object frame = DOMAIN_FRAME (domain); - struct frame* f = XFRAME (frame); - int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), - gui, - WIDGET_GLYPH_SLOT); - 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 (instance, - XIMAGE_INSTANCE_WIDGET_ITEM (instance), - domain); + Lisp_Object frame = FW_FRAME (domain); + struct frame* f = XFRAME (frame); + int id = gui_item_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), + &XIMAGE_INSTANCE_WIDGET_ITEM (instance), + WIDGET_GLYPH_SLOT); + Fputhash (make_int (id), + XIMAGE_INSTANCE_WIDGET_CALLBACK (instance), + FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f)); + return id; } static void @@ -2316,49 +2073,31 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - Lisp_Object frame = DOMAIN_FRAME (domain); + struct device* d = XDEVICE (device); + Lisp_Object frame = FW_FRAME (domain); HWND wnd; - CHECK_MSWINDOWS_DEVICE (device); + if (!DEVICE_MSWINDOWS_P (d)) + signal_simple_error ("Not an mswindows device", device); /* have to set the type this late in case there is no device instantiation for a widget */ IMAGE_INSTANCE_TYPE (ii) = IMAGE_SUBWINDOW; - /* Allocate space for the clip window */ - ii->data = xnew_and_zero (struct mswindows_subwindow_data); - if ((IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (ii) - = CreateWindowEx( - 0, /* EX flags */ - XEMACS_CONTROL_CLASS, - 0, /* text */ - WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CHILD, - 0, /* starting x position */ - 0, /* starting y position */ - IMAGE_INSTANCE_WIDGET_WIDTH (ii), - IMAGE_INSTANCE_WIDGET_HEIGHT (ii), - /* parent window */ - FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), - NULL, /* No menu */ - NULL, /* must be null for this class */ - NULL)) == NULL) - signal_simple_error ("window creation failed with code", - make_int (GetLastError())); - - wnd = CreateWindow( "STATIC", + wnd = CreateWindow( "STATIC", "", - WS_CHILD, + WS_CHILD, 0, /* starting x position */ 0, /* starting y position */ IMAGE_INSTANCE_WIDGET_WIDTH (ii), IMAGE_INSTANCE_WIDGET_HEIGHT (ii), - IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (ii), + FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), /* parent window */ 0, - (HINSTANCE) + (HINSTANCE) GetWindowLong (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), - GWL_HINSTANCE), + GWL_HINSTANCE), NULL); SetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance)); @@ -2366,19 +2105,19 @@ } static int -mswindows_image_instance_equal (Lisp_Image_Instance *p1, - Lisp_Image_Instance *p2, int depth) +mswindows_image_instance_equal (struct Lisp_Image_Instance *p1, + struct Lisp_Image_Instance *p2, int depth) { switch (IMAGE_INSTANCE_TYPE (p1)) { case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: - if (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p1) + if (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p1) != IMAGE_INSTANCE_MSWINDOWS_BITMAP (p2)) return 0; break; - + default: break; } @@ -2387,7 +2126,7 @@ } static unsigned long -mswindows_image_instance_hash (Lisp_Image_Instance *p, int depth) +mswindows_image_instance_hash (struct Lisp_Image_Instance *p, int depth) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -2395,7 +2134,7 @@ case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: return (unsigned long) IMAGE_INSTANCE_MSWINDOWS_BITMAP (p); - + default: return 0; } @@ -2408,8 +2147,7 @@ methods are called. */ static void -mswindows_initialize_dibitmap_image_instance (Lisp_Image_Instance *ii, - int slices, +mswindows_initialize_dibitmap_image_instance (struct Lisp_Image_Instance *ii, enum image_instance_type type) { ii->data = xnew_and_zero (struct mswindows_image_instance_data); @@ -2420,126 +2158,93 @@ IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = Qnil; IMAGE_INSTANCE_PIXMAP_FG (ii) = Qnil; IMAGE_INSTANCE_PIXMAP_BG (ii) = Qnil; - IMAGE_INSTANCE_PIXMAP_MAXSLICE (ii) = slices; - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (ii) = - xnew_array_and_zero (HBITMAP, slices); } -#ifdef HAVE_WIDGETS - /************************************************************************/ /* widgets */ /************************************************************************/ + static void 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); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); +#if 0 + struct Lisp_Image_Instance *groupii = 0; + Lisp_Object group = find_keyword_in_vector (instantiator, Q_group); +#endif Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style; - Lisp_Object frame = DOMAIN_FRAME (domain); + struct device* d = XDEVICE (device); + Lisp_Object frame = FW_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); + struct gui_item* pgui = &IMAGE_INSTANCE_WIDGET_ITEM (ii); - CHECK_MSWINDOWS_DEVICE (device); - - if (!gui_item_active_p (gui)) + if (!DEVICE_MSWINDOWS_P (d)) + signal_simple_error ("Not an mswindows device", device); +#if 0 + /* if the user specified another glyph as a group pick up the + instance in our domain. */ + if (!NILP (group)) + { + if (SYMBOLP (group)) + group = XSYMBOL (group)->value; + group = glyph_image_instance (group, domain, ERROR_ME, 1); + groupii = XIMAGE_INSTANCE (group); + } +#endif + if (!gui_item_active_p (pgui)) flags |= WS_DISABLED; style = pgui->style; - if (!NILP (pgui->callback) || !NILP (pgui->callback_ex)) + if (!NILP (pgui->callback)) { id = mswindows_register_widget_instance (image_instance, domain); } - + /* have to set the type this late in case there is no device + instantiation for a widget */ + 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); - - /* allocate space for the clip window and then allocate the clip window */ - ii->data = xnew_and_zero (struct mswindows_subwindow_data); + GET_C_STRING_OS_DATA_ALLOCA (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm); - if ((IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (ii) - = CreateWindowEx( - WS_EX_CONTROLPARENT, /* EX flags */ - XEMACS_CONTROL_CLASS, - 0, /* text */ - WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CHILD, - 0, /* starting x position */ - 0, /* starting y position */ - IMAGE_INSTANCE_WIDGET_WIDTH (ii), - IMAGE_INSTANCE_WIDGET_HEIGHT (ii), - /* parent window */ - DOMAIN_MSWINDOWS_HANDLE (domain), - (HMENU)id, /* No menu */ - NULL, /* must be null for this class */ - NULL)) == NULL) - signal_simple_error ("window creation failed with code", - make_int (GetLastError())); - - if ((wnd = CreateWindowEx( - exflags /* | WS_EX_NOPARENTNOTIFY*/, - class, - nm, - flags | WS_CHILD | WS_VISIBLE, - 0, /* starting x position */ - 0, /* starting y position */ - IMAGE_INSTANCE_WIDGET_WIDTH (ii), - IMAGE_INSTANCE_WIDGET_HEIGHT (ii), - /* parent window */ - IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (ii), - (HMENU)id, /* No menu */ - (HINSTANCE) - GetWindowLong - (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), - GWL_HINSTANCE), - NULL)) == NULL) - signal_simple_error ("window creation failed with code", - make_int (GetLastError())); + wnd = CreateWindowEx( + exflags /* | WS_EX_NOPARENTNOTIFY*/, + class, + nm, + flags | WS_CHILD, + 0, /* starting x position */ + 0, /* starting y position */ + IMAGE_INSTANCE_WIDGET_WIDTH (ii), + IMAGE_INSTANCE_WIDGET_HEIGHT (ii), + /* parent window */ + FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), + (HMENU)id, /* No menu */ + (HINSTANCE) + GetWindowLong (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), + GWL_HINSTANCE), + NULL); IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd; SetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance)); /* set the widget font from the widget face */ - if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) - SendMessage (wnd, WM_SETFONT, - (WPARAM) mswindows_widget_hfont (ii, domain), - MAKELPARAM (TRUE, 0)); -} - -/* 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, - 0); + SendMessage (wnd, WM_SETFONT, + (WPARAM)FONT_INSTANCE_MSWINDOWS_HFONT + (XFONT_INSTANCE (widget_face_font_info + (domain, + IMAGE_INSTANCE_WIDGET_FACE (ii), + 0, 0))), + MAKELPARAM (TRUE, 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 - want to display it in and BitBlt it. So image instances can have a + want to display it in and BitBlt it. So images instances can have a many-to-one relationship with things you see, whereas widgets can only be one-to-one (i.e. per frame) */ static void @@ -2547,31 +2252,28 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - /* This function can call lisp */ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HWND wnd; - int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback - only. Since we seem to want nothing beyond BN_CLICK, - the style is perhaps not necessary -- kkm */ + int flags = BS_NOTIFY; Lisp_Object style; - Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - Lisp_Gui_Item* pgui = XGUI_ITEM (gui); + struct gui_item* pgui = &IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image); + if (!gui_item_active_p (pgui)) + flags |= WS_DISABLED; + if (!NILP (glyph)) { if (!IMAGE_INSTANCEP (glyph)) glyph = glyph_image_instance (glyph, domain, ERROR_ME, 1); if (IMAGE_INSTANCEP (glyph)) - flags |= XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ? + flags |= XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ? BS_BITMAP : BS_ICON; } style = pgui->style; - /* #### consider using the default face for radio and toggle - buttons. */ if (EQ (style, Qradio)) { flags |= BS_RADIOBUTTON; @@ -2581,282 +2283,75 @@ flags |= BS_AUTOCHECKBOX; } else - { - flags |= BS_DEFPUSHBUTTON; - } + flags |= BS_DEFPUSHBUTTON; mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "BUTTON", - flags, 0); + pointer_bg, dest_mask, domain, "BUTTON", flags, + WS_EX_CONTROLPARENT); wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* set the checked state */ - if (gui_item_selected_p (gui)) - SendMessage (wnd, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + if (gui_item_selected_p (pgui)) + SendMessage (wnd, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); else SendMessage (wnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); /* add the image if one was given */ - if (!NILP (glyph) && IMAGE_INSTANCEP (glyph) - && - IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (glyph))) + if (!NILP (glyph) && IMAGE_INSTANCEP (glyph)) { - SendMessage (wnd, BM_SETIMAGE, - (WPARAM) (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ? + SendMessage (wnd, BM_SETIMAGE, + (WPARAM) (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ? IMAGE_BITMAP : IMAGE_ICON), - (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ? - (LPARAM) XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) : - (LPARAM) XIMAGE_INSTANCE_MSWINDOWS_ICON (glyph))); + (LPARAM) (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ? + XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) : + XIMAGE_INSTANCE_MSWINDOWS_ICON (glyph))); } } -/* Update the state of a button. */ -static void -mswindows_button_update (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, +mswindows_edit_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "EDIT", + pointer_bg, dest_mask, domain, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_TABSTOP - | WS_BORDER, WS_EX_CLIENTEDGE); + | WS_BORDER, + WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); } -/* instantiate a progress gauge */ +/* instantiate an edit control */ static void -mswindows_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, +mswindows_progress_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { HWND wnd; - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, PROGRESS_CLASS, - WS_BORDER | PBS_SMOOTH, WS_EX_CLIENTEDGE); + pointer_bg, dest_mask, domain, PROGRESS_CLASS, + WS_TABSTOP | WS_BORDER | PBS_SMOOTH, + WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* set the colors */ #ifdef PBS_SETBKCOLOR - SendMessage (wnd, PBS_SETBKCOLOR, 0, - (LPARAM) (COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_BACKGROUND + SendMessage (wnd, PBS_SETBKCOLOR, 0, + (LPARAM) (COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_BACKGROUND (XIMAGE_INSTANCE_WIDGET_FACE (ii), - XIMAGE_INSTANCE_FRAME (ii)))))); + XIMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))))); #endif #ifdef PBS_SETBARCOLOR - SendMessage (wnd, PBS_SETBARCOLOR, 0, - (L:PARAM) (COLOR_INSTANCE_MSWINDOWS_COLOR - (XCOLOR_INSTANCE - (FACE_FOREGROUND + SendMessage (wnd, PBS_SETBARCOLOR, 0, + (L:PARAM) (COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_FOREGROUND (XIMAGE_INSTANCE_WIDGET_FACE (ii), - XIMAGE_INSTANCE_FRAME (ii)))))); + XIMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))))); #endif } -/* instantiate a tree view widget */ -static HTREEITEM add_tree_item (Lisp_Object image_instance, - HWND wnd, HTREEITEM parent, Lisp_Object item, - int children, Lisp_Object domain) -{ - TV_INSERTSTRUCT tvitem; - HTREEITEM ret; - - tvitem.hParent = parent; - tvitem.hInsertAfter = TVI_LAST; - tvitem.item.mask = TVIF_TEXT | TVIF_CHILDREN; - tvitem.item.cChildren = children; - - if (GUI_ITEMP (item)) - { - 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, - Qnative); - } - else - TO_EXTERNAL_FORMAT (LISP_STRING, item, - C_STRING_ALLOCA, tvitem.item.pszText, - Qnative); - - tvitem.item.cchTextMax = strlen (tvitem.item.pszText); - - if ((ret = (HTREEITEM)SendMessage (wnd, TVM_INSERTITEM, - 0, (LPARAM)&tvitem)) == 0) - signal_simple_error ("error adding tree view entry", item); - - return ret; -} - -static void add_tree_item_list (Lisp_Object image_instance, - HWND wnd, HTREEITEM parent, Lisp_Object list, - Lisp_Object domain) -{ - Lisp_Object rest; - - /* get the first item */ - parent = add_tree_item (image_instance, wnd, parent, XCAR (list), TRUE, domain); - /* recursively add items to the tree view */ - LIST_LOOP (rest, XCDR (list)) - { - if (LISTP (XCAR (rest))) - add_tree_item_list (image_instance, wnd, parent, XCAR (rest), domain); - else - add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE, domain); - } -} - -static void -mswindows_tree_view_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) -{ - Lisp_Object rest; - HWND wnd; - HTREEITEM parent; - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, WC_TREEVIEW, - WS_TABSTOP | WS_BORDER | PBS_SMOOTH - | TVS_HASLINES | TVS_HASBUTTONS, - WS_EX_CLIENTEDGE); - - wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); - - /* define a root */ - parent = add_tree_item (image_instance, wnd, NULL, - XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), - TRUE, domain); - - /* recursively add items to the tree view */ - /* add items to the tab */ - LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))) - { - if (LISTP (XCAR (rest))) - add_tree_item_list (image_instance, wnd, parent, XCAR (rest), domain); - else - add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE, domain); - } -} - -/* instantiate a tab control */ -static TC_ITEM* add_tab_item (Lisp_Object image_instance, - HWND wnd, Lisp_Object item, - Lisp_Object domain, int i) -{ - TC_ITEM tvitem, *ret; - - tvitem.mask = TCIF_TEXT; - - if (GUI_ITEMP (item)) - { - 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, - Qnative); - } - else - { - CHECK_STRING (item); - TO_EXTERNAL_FORMAT (LISP_STRING, item, - C_STRING_ALLOCA, tvitem.pszText, - Qnative); - } - - tvitem.cchTextMax = strlen (tvitem.pszText); - - if ((ret = (TC_ITEM*)SendMessage (wnd, TCM_INSERTITEM, - i, (LPARAM)&tvitem)) < 0) - signal_simple_error ("error adding tab entry", item); - - return ret; -} - -static void -mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - 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, 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; - - if (EQ (orient, Qleft) || EQ (orient, Qright)) - { - flags |= TCS_VERTICAL | TCS_MULTILINE; - } - if (EQ (orient, Qright) || EQ (orient, Qbottom)) - { - flags |= TCS_BOTTOM; - } - - mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - 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); - if (gui_item_selected_p (XCAR (rest))) - selected = i; - i++; - } - SendMessage (wnd, TCM_SETCURSEL, selected, 0); -} - -/* set the properties of a tab control */ -static void -mswindows_tab_control_update (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); - int i = 0, selected = 0; - Lisp_Object rest; - - /* 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); - } -} - /* instantiate a static control possible for putting other things in */ static void mswindows_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, @@ -2864,10 +2359,24 @@ int dest_mask, Lisp_Object domain) { mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "STATIC", + pointer_bg, dest_mask, domain, "STATIC", 0, WS_EX_STATICEDGE); } +#if 0 +/* instantiate a static control possible for putting other things in */ +static void +mswindows_group_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) +{ + mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, "BUTTON", + WS_GROUP | BS_GROUPBOX | WS_BORDER, + WS_EX_CLIENTEDGE ); +} +#endif + /* instantiate a scrollbar control */ static void mswindows_scrollbar_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, @@ -2875,22 +2384,20 @@ int dest_mask, Lisp_Object domain) { mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "SCROLLBAR", - WS_TABSTOP, WS_EX_CLIENTEDGE); + pointer_bg, dest_mask, domain, "SCROLLBAR", + 0, + WS_EX_CLIENTEDGE ); } /* instantiate a combo control */ static void -mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, +mswindows_combo_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); - HWND wnd; + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + HANDLE wnd; Lisp_Object rest; - Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties), - Q_items, Qnil); - int len, height; /* Maybe ought to generalise this more but it may be very windows specific. In windows the window height of a combo box is the @@ -2898,38 +2405,23 @@ before creating the window and then reset it to a single line after the window is created so that redisplay does the right thing. */ - widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain); - - /* We now have everything right apart from the height. */ - default_face_font_info (domain, 0, 0, &height, 0, 0); - GET_LIST_LENGTH (data, len); - - height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len; - IMAGE_INSTANCE_HEIGHT (ii) = height; - - /* Now create the widget. */ mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "COMBOBOX", + pointer_bg, dest_mask, domain, "COMBOBOX", WS_BORDER | WS_TABSTOP | CBS_DROPDOWN - | CBS_AUTOHSCROLL + | CBS_AUTOHSCROLL | CBS_HASSTRINGS | WS_VSCROLL, - WS_EX_CLIENTEDGE); - /* Reset the height. layout will probably do this safely, but better make sure. */ - image_instance_layout (image_instance, - IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, - domain); - + WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); + /* reset the height */ + widget_text_to_pixel_conversion (domain, + IMAGE_INSTANCE_WIDGET_FACE (ii), 1, 0, + &IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii), 0); 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)) { Extbyte* lparam; - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (rest), - C_STRING_ALLOCA, lparam, - Qnative); + GET_C_STRING_OS_DATA_ALLOCA (XCAR (rest), lparam); if (SendMessage (wnd, CB_ADDSTRING, 0, (LPARAM)lparam) == CB_ERR) signal_simple_error ("error adding combo entries", instantiator); } @@ -2939,16 +2431,16 @@ static Lisp_Object mswindows_widget_property (Lisp_Object image_instance, Lisp_Object prop) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + HANDLE 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 = (Extbyte*) alloca (len+1); - + Extbyte* buf =alloca (len+1); + SendMessage (wnd, WM_GETTEXT, (WPARAM)len+1, (LPARAM) buf); - return build_ext_string (buf, Qnative); + return build_ext_string (buf, FORMAT_OS); } return Qunbound; } @@ -2957,8 +2449,8 @@ static Lisp_Object mswindows_button_property (Lisp_Object image_instance, Lisp_Object prop) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* check the state of a button */ if (EQ (prop, Q_selected)) { @@ -2972,68 +2464,58 @@ /* get properties of a combo box */ static Lisp_Object -mswindows_combo_box_property (Lisp_Object image_instance, Lisp_Object prop) +mswindows_combo_property (Lisp_Object image_instance, Lisp_Object prop) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + HANDLE 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 = (Extbyte*) alloca (len+1); + Extbyte* buf = alloca (len+1); SendMessage (wnd, CB_GETLBTEXT, (WPARAM)item, (LPARAM)buf); - return build_ext_string (buf, Qnative); + return build_ext_string (buf, FORMAT_OS); + } + 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) +{ + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + if (EQ (prop, Q_text)) + { + Extbyte* lparam=0; + CHECK_STRING (val); + GET_C_STRING_OS_DATA_ALLOCA (val, lparam); + SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + WM_SETTEXT, 0, (LPARAM)lparam); + return Qt; } return Qunbound; } /* set the properties of a progres guage */ -static void -mswindows_progress_gauge_update (Lisp_Object image_instance) +static Lisp_Object +mswindows_progress_set_property (Lisp_Object image_instance, Lisp_Object prop, + Lisp_Object val) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) + struct 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 - printf ("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 -mswindows_control_wnd_proc (HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - case WM_NOTIFY: - case WM_COMMAND: - case WM_CTLCOLORBTN: - case WM_CTLCOLORLISTBOX: - case WM_CTLCOLOREDIT: - case WM_CTLCOLORSTATIC: - case WM_CTLCOLORSCROLLBAR: - - return mswindows_wnd_proc (GetParent (hwnd), msg, wParam, lParam); - default: - return DefWindowProc (hwnd, msg, wParam, lParam); - } -} - -#endif /* HAVE_WIDGETS */ - /************************************************************************/ /* initialization */ @@ -3049,107 +2531,66 @@ void console_type_create_glyphs_mswindows (void) { - /* image methods - display */ + /* image methods */ + 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, resize_subwindow); - CONSOLE_HAS_METHOD (mswindows, update_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); - - /* 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_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_CONSOLE2 (mswindows, msprinter, jpeg); -#endif -#ifdef HAVE_TIFF - IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, tiff); #endif -#ifdef HAVE_PNG - IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, png); -#endif -#ifdef HAVE_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, update); - /* edit-field widget */ - INITIALIZE_DEVICE_IIFORMAT (mswindows, edit_field); - IIFORMAT_HAS_DEVMETHOD (mswindows, edit_field, instantiate); - /* subwindow */ + + INITIALIZE_DEVICE_IIFORMAT (mswindows, edit); + IIFORMAT_HAS_DEVMETHOD (mswindows, edit, instantiate); + INITIALIZE_DEVICE_IIFORMAT (mswindows, subwindow); IIFORMAT_HAS_DEVMETHOD (mswindows, subwindow, instantiate); - /* label */ + + INITIALIZE_DEVICE_IIFORMAT (mswindows, widget); + IIFORMAT_HAS_DEVMETHOD (mswindows, widget, property); + IIFORMAT_HAS_DEVMETHOD (mswindows, widget, set_property); +#if 0 + INITIALIZE_DEVICE_IIFORMAT (mswindows, group); + IIFORMAT_HAS_DEVMETHOD (mswindows, group, instantiate); +#endif 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, combo); + IIFORMAT_HAS_DEVMETHOD (mswindows, combo, property); + IIFORMAT_HAS_DEVMETHOD (mswindows, combo, instantiate); + 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, update); - 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); - /* tab control widget */ - INITIALIZE_DEVICE_IIFORMAT (mswindows, tab_control); - IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, instantiate); - IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, update); -#endif - /* windows bitmap format */ + + INITIALIZE_DEVICE_IIFORMAT (mswindows, progress); + IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property); + IIFORMAT_HAS_DEVMETHOD (mswindows, progress, instantiate); + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); + IIFORMAT_HAS_METHOD (bmp, validate); IIFORMAT_HAS_METHOD (bmp, normalize); IIFORMAT_HAS_METHOD (bmp, possible_dest_types); @@ -3157,9 +2598,7 @@ IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); - IIFORMAT_VALID_CONSOLE2 (mswindows, msprinter, bmp); - /* mswindows resources */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, "mswindows-resource"); @@ -3168,21 +2607,29 @@ IIFORMAT_HAS_METHOD (mswindows_resource, possible_dest_types); IIFORMAT_HAS_METHOD (mswindows_resource, instantiate); - IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_type, + IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_type, 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_CONSOLE2 (mswindows, msprinter, mswindows_resource); } void vars_of_glyphs_mswindows (void) { + Fprovide (Qbmp); + Fprovide (Qmswindows_resource); DEFVAR_LISP ("mswindows-bitmap-file-path", &Vmswindows_bitmap_file_path /* A list of the directories in which mswindows bitmap files may be found. This is used by the `make-image-instance' function. */ ); Vmswindows_bitmap_file_path = Qnil; + + Fprovide (Qbutton); + Fprovide (Qedit); + Fprovide (Qcombo); + Fprovide (Qscrollbar); + Fprovide (Qlabel); + Fprovide (Qprogress); } void diff -r 12e008d41344 -r 697ef44129c6 src/glyphs-msw.h --- a/src/glyphs-msw.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs-msw.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_glyphs_msw_h_ -#define INCLUDED_glyphs_msw_h_ +#ifndef _XEMACS_GLYPHS_MSW_H_ +#define _XEMACS_GLYPHS_MSW_H_ #ifdef HAVE_MS_WINDOWS @@ -34,54 +34,42 @@ struct mswindows_image_instance_data { - HBITMAP* bitmaps; + HBITMAP bitmap; + HBITMAP mask; HICON icon; - int real_width, real_height; }; #define MSWINDOWS_IMAGE_INSTANCE_DATA(i) \ ((struct mswindows_image_instance_data *) (i)->data) #define IMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \ - (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmaps[0]) -#define IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE(i,slice) \ - (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmaps[slice]) -#define IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES(i) \ - (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmaps) + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmap) #define IMAGE_INSTANCE_MSWINDOWS_MASK(i) \ - (*(HBITMAP*)&(IMAGE_INSTANCE_PIXMAP_MASK (i))) /* Make it lvalue */ + (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->mask) #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)) -#define XIMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE(i,slice) \ - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (XIMAGE_INSTANCE (i,slice)) -#define XIMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES(i) \ - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_MSWINDOWS_MASK(i) \ IMAGE_INSTANCE_MSWINDOWS_MASK (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_MSWINDOWS_ICON(i) \ IMAGE_INSTANCE_MSWINDOWS_ICON (XIMAGE_INSTANCE (i)) int -mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii, +mswindows_resize_dibitmap_instance (struct Lisp_Image_Instance* ii, struct frame* f, int newx, int newy); HBITMAP -mswindows_create_resized_bitmap (Lisp_Image_Instance* ii, +mswindows_create_resized_bitmap (struct Lisp_Image_Instance* ii, struct frame* f, int newx, int newy); HBITMAP -mswindows_create_resized_mask (Lisp_Image_Instance* ii, +mswindows_create_resized_mask (struct Lisp_Image_Instance* ii, struct frame* f, int newx, int newy); void -mswindows_initialize_image_instance_icon (Lisp_Image_Instance* image, +mswindows_initialize_image_instance_icon (struct Lisp_Image_Instance* image, int cursor); #define WIDGET_INSTANCE_MSWINDOWS_HANDLE(i) \ @@ -90,27 +78,5 @@ #define XWIDGET_INSTANCE_MSWINDOWS_HANDLE(i) \ WIDGET_INSTANCE_MSWINDOWS_HANDLE (XIMAGE_INSTANCE (i)) -struct mswindows_subwindow_data -{ - HWND clip_window; -}; - -#define MSWINDOWS_SUBWINDOW_DATA(i) \ - ((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_ */ +#endif /* _XEMACS_GLYPHS_MSW_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/glyphs-widget.c --- a/src/glyphs-widget.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs-widget.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ /* Widget-specific glyph objects. - Copyright (C) 1998, 1999, 2000 Andy Piper. + Copyright (C) 1998 Andy Piper This file is part of XEmacs. @@ -38,46 +38,65 @@ #include "opaque.h" DEFINE_IMAGE_INSTANTIATOR_FORMAT (button); -DEFINE_IMAGE_INSTANTIATOR_FORMAT (combo_box); -Lisp_Object Qcombo_box; -DEFINE_IMAGE_INSTANTIATOR_FORMAT (edit_field); -Lisp_Object Qedit_field; +DEFINE_IMAGE_INSTANTIATOR_FORMAT (combo); +Lisp_Object Qcombo; +DEFINE_IMAGE_INSTANTIATOR_FORMAT (edit); +Lisp_Object Qedit; DEFINE_IMAGE_INSTANTIATOR_FORMAT (scrollbar); Lisp_Object Qscrollbar; DEFINE_IMAGE_INSTANTIATOR_FORMAT (widget); +#if 0 +DEFINE_IMAGE_INSTANTIATOR_FORMAT (group); +Lisp_Object Qgroup; +#endif DEFINE_IMAGE_INSTANTIATOR_FORMAT (label); Lisp_Object Qlabel; -DEFINE_IMAGE_INSTANTIATOR_FORMAT (progress_gauge); -Lisp_Object Qprogress_gauge; -DEFINE_IMAGE_INSTANTIATOR_FORMAT (tree_view); -Lisp_Object Qtree_view; -DEFINE_IMAGE_INSTANTIATOR_FORMAT (tab_control); -Lisp_Object Qtab_control; -DEFINE_IMAGE_INSTANTIATOR_FORMAT (layout); -Lisp_Object Qlayout; -DEFINE_IMAGE_INSTANTIATOR_FORMAT (native_layout); -Lisp_Object Qnative_layout; +DEFINE_IMAGE_INSTANTIATOR_FORMAT (progress); +Lisp_Object Qprogress; Lisp_Object Q_descriptor, Q_height, Q_width, Q_properties, Q_items; -Lisp_Object Q_image, Q_text, Q_orientation, Q_justify, Q_border; -Lisp_Object Q_margin_width; -Lisp_Object Qetched_in, Qetched_out, Qbevel_in, Qbevel_out; +Lisp_Object Q_image, Q_text, Q_percent; -#ifdef DEBUG_WIDGETS -int debug_widget_instances; -#endif +#define WIDGET_BORDER_HEIGHT 2 +#define WIDGET_BORDER_WIDTH 4 /* TODO: - - tooltips for controls, especially buttons. - - keyboard traversal. - - lisp configurable layout. + - more complex controls. + - tooltips for controls. */ -/* In MS-Windows normal windows work in pixels, dialog boxes work in +/* In windows normal windows work in pixels, dialog boxes work in dialog box units. Why? sigh. We could reuse the metrics for dialogs if this were not the case. As it is we have to position things pixel wise. I'm not even sure that X has this problem at least for buttons in groups. */ +Lisp_Object +widget_face_font_info (Lisp_Object domain, Lisp_Object face, + int *height, int *width) +{ + Lisp_Object font_instance = FACE_FONT (face, domain, Vcharset_ascii); + + if (height) + *height = XFONT_INSTANCE (font_instance)->height; + if (width) + *width = XFONT_INSTANCE (font_instance)->width; + + return font_instance; +} + +void +widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face, + int th, int tw, + int* height, int* width) +{ + int ch=0, cw=0; + widget_face_font_info (domain, face, &ch, &cw); + if (height) + *height = th * (ch + 2 * WIDGET_BORDER_HEIGHT); + if (width) + *width = tw * cw + 2 * WIDGET_BORDER_WIDTH; +} + static int widget_possible_dest_types (void) { @@ -85,7 +104,7 @@ } static void -check_valid_glyph_or_instantiator (Lisp_Object data) +check_valid_glyph_or_image (Lisp_Object data) { Lisp_Object glyph = data; if (SYMBOLP (data)) @@ -93,49 +112,11 @@ if (IMAGE_INSTANCEP (glyph)) CHECK_IMAGE_INSTANCE (glyph); - else if (!CONSP (glyph) && !VECTORP (glyph)) + else if (!CONSP (glyph)) CHECK_BUFFER_GLYPH (glyph); } static void -check_valid_orientation (Lisp_Object data) -{ - if (!EQ (data, Qhorizontal) - && - !EQ (data, Qvertical)) - signal_simple_error ("unknown orientation for layout", data); -} - -static void -check_valid_tab_orientation (Lisp_Object data) -{ - if (!EQ (data, Qtop) - && - !EQ (data, Qbottom) - && - !EQ (data, Qleft) - && - !EQ (data, Qright)) - signal_simple_error ("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); -} - -static void -check_valid_border (Lisp_Object data) -{ - 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); -} - -static void check_valid_anything (Lisp_Object data) { } @@ -152,13 +133,6 @@ } static void -check_valid_int_or_function (Lisp_Object data) -{ - if (!INTP (data) && !CONSP (data)) - signal_simple_error ("must be an integer or expresssion", data); -} - -static void check_valid_symbol (Lisp_Object data) { CHECK_SYMBOL (data); @@ -171,103 +145,37 @@ signal_simple_error (":descriptor must be a string or a vector", data); } -void -check_valid_item_list_1 (Lisp_Object items) +static void +check_valid_item_list (Lisp_Object data) { Lisp_Object rest; + Lisp_Object items; + Fcheck_valid_plist (data); + + items = Fplist_get (data, Q_items, Qnil); CHECK_LIST (items); EXTERNAL_LIST_LOOP (rest, items) { - if (STRINGP (XCAR (rest))) - CHECK_STRING (XCAR (rest)); - else if (VECTORP (XCAR (rest))) - gui_parse_item_keywords (XCAR (rest)); - else if (LISTP (XCAR (rest))) - check_valid_item_list_1 (XCAR (rest)); - else - signal_simple_error ("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) -{ - Lisp_Object rest; - - CHECK_LIST (data); - EXTERNAL_LIST_LOOP (rest, data) - { - check_valid_glyph_or_instantiator (XCAR (rest)); + CHECK_STRING (XCAR (rest)); } } -static Lisp_Object -glyph_instantiator_to_glyph (Lisp_Object sym) -{ - /* 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); - } - - /* substitute the new glyph */ - RETURN_UNGCPRO (glyph); -} - -static void -substitute_keyword_value (Lisp_Object inst, Lisp_Object key, Lisp_Object val) -{ - int i; - /* substitute the new glyph */ - for (i = 0; i < XVECTOR_LENGTH (inst); i++) - { - if (EQ (key, XVECTOR_DATA (inst)[i])) - { - XVECTOR_DATA (inst)[i+1] = val; - break; - } - } -} - -/* Wire widget property invocations to specific widgets. The problem - we are solving here is that when instantiators get converted to - instances they lose some type information (they just become - subwindows or widgets for example). For widgets we need to preserve - this type information so that we can do widget specific operations - on the instances. This is encoded in the widget type - field. widget_property gets invoked by decoding the primary type - (Qwidget), <widget>_property then invokes based on the secondary - 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. */ +/* wire widget property invocations to specific widgets ... The + problem we are solving here is that when instantiators get converted + to instances they lose some type information (they just become + subwindows or widgets for example). For widgets we need to preserve + this type information so that we can do widget specific operations on + the instances. This is encoded in the widget type + field. widget_property gets invoked by decoding the primary type + (Qwidget), widget property then invokes based on the secondary type + (Qedit for example). It is debatable that we should wire things in this + generalised way rather than treating widgets specially in + image_instance_property. */ static Lisp_Object widget_property (Lisp_Object image_instance, Lisp_Object prop) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; /* first see if its a general property ... */ @@ -275,7 +183,7 @@ return Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, Qnil); /* .. then try device specific methods ... */ - meths = decode_device_ii_format (image_instance_device (image_instance), + meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, property)) @@ -292,20 +200,12 @@ static Lisp_Object widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object val) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); + struct 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 - of. */ - if (EQ (prop, Q_text)) - { - IMAGE_INSTANCE_WIDGET_TEXT (ii) = val; - IMAGE_INSTANCE_TEXT_CHANGED (ii) = 1; - } - - /* Now try device specific methods first ... */ - meths = decode_device_ii_format (image_instance_device (image_instance), + /* try device specific methods first ... */ + meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), IMAGE_INSTANCE_WIDGET_TYPE (ii), ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, set_property) @@ -331,154 +231,19 @@ return val; } -/* 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 - *_set_property. Thus *_set_property 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. */ -void -update_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 generic methods. 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. */ - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), update_widget, (ii)); - - /* Device-format specific methods */ - meths = decode_device_ii_format (image_instance_device (widget), - IMAGE_INSTANCE_WIDGET_TYPE (ii), - ERROR_ME_NOT); - MAYBE_IIFORMAT_METH (meths, update, (widget)); - - /* Pick up the items we recorded earlier. */ - if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) - { - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii); - IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil; - } -} - -/* 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, - 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 (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, - width, height, disp, - domain)); - else - { - /* ... 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, query_geometry)) - IIFORMAT_METH (meths, query_geometry, (image_instance, - width, height, disp, - domain)); - else - { - 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), - 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 (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)) - *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 int -widget_layout (Lisp_Object image_instance, - int width, int height, 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 (image_instance), - IMAGE_INSTANCE_WIDGET_TYPE (ii), - ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, layout)) - return IIFORMAT_METH (meths, layout, (image_instance, - width, height, domain)); - else - { - /* ... 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, layout)) - return IIFORMAT_METH (meths, layout, (image_instance, - width, height, domain)); - } - return 1; -} - static void widget_validate (Lisp_Object instantiator) { Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor); - + struct gui_item gui; if (NILP (desc)) signal_simple_error ("Must supply :descriptor", instantiator); if (VECTORP (desc)) - gui_parse_item_keywords (desc); + gui_parse_item_keywords (desc, &gui); if (!NILP (find_keyword_in_vector (instantiator, Q_width)) - && !NILP (find_keyword_in_vector (instantiator, Q_pixel_width))) + && !NILP (find_keyword_in_vector (instantiator, Q_pixel_width))) signal_simple_error ("Must supply only one of :width and :pixel-width", instantiator); if (!NILP (find_keyword_in_vector (instantiator, Q_height)) @@ -487,7 +252,7 @@ } static void -combo_box_validate (Lisp_Object instantiator) +combo_validate (Lisp_Object instantiator) { widget_validate (instantiator); if (NILP (find_keyword_in_vector (instantiator, Q_properties))) @@ -506,42 +271,52 @@ same reasons we normalize file to data. */ if (!NILP (glyph)) { - substitute_keyword_value (inst, Q_image, glyph_instantiator_to_glyph (glyph)); + int i; + struct gcpro gcpro1; + if (SYMBOLP (glyph)) + glyph = XSYMBOL (glyph)->value; + GCPRO1 (glyph); + + if (CONSP (glyph)) + glyph = Feval (glyph); + /* substitute the new glyph */ + for (i = 0; i < XVECTOR_LENGTH (inst); i++) + { + if (EQ (Q_image, XVECTOR_DATA (inst)[i])) + { + XVECTOR_DATA (inst)[i+1] = glyph; + break; + } + } + UNGCPRO; } - return inst; } static void -initialize_widget_image_instance (Lisp_Image_Instance *ii, Lisp_Object type) +initialize_widget_image_instance (struct Lisp_Image_Instance *ii, Lisp_Object type) { /* initialize_subwindow_image_instance (ii);*/ IMAGE_INSTANCE_WIDGET_TYPE (ii) = type; 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) = LAYOUT_HORIZONTAL; - IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) = 0; + IMAGE_INSTANCE_WIDGET_FACE (ii) = Vwidget_face; + gui_item_init (&IMAGE_INSTANCE_WIDGET_ITEM (ii)); } /* 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 - want to display it in and BitBlt it. So image instances can have a + want to display it in and BitBlt it. So images instances can have a many-to-one relationship with things you see, whereas widgets can only be one-to-one (i.e. per frame) */ -void -widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) +static void +widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain, int default_textheight, + int default_pixheight) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct gui_item* pgui = &IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Object face = find_keyword_in_vector (instantiator, Q_face); Lisp_Object height = find_keyword_in_vector (instantiator, Q_height); Lisp_Object width = find_keyword_in_vector (instantiator, Q_width); @@ -549,701 +324,110 @@ 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); 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)) 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)); + IMAGE_INSTANCE_WIDGET_FACE (ii) = Fget_face (face); + /* data items for some widgets */ + IMAGE_INSTANCE_WIDGET_PROPS (ii) = + find_keyword_in_vector (instantiator, Q_properties); + /* 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 */ 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) = - gui_parse_item_keywords_no_errors (instantiator); + gui_parse_item_keywords_no_errors (instantiator, pgui); IMAGE_INSTANCE_WIDGET_TEXT (ii) = desc; } else - IMAGE_INSTANCE_WIDGET_ITEMS (ii) = - gui_parse_item_keywords_no_errors (desc); - - /* 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) = LAYOUT_VERTICAL; - - /* parse more gui items out of the properties */ - if (!NILP (props) - && - !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)); - } - } + gui_parse_item_keywords_no_errors (desc, pgui); - /* Normalize size information. We now only assign sizes if the user - gives us some explicitly, or there are some constraints that we - can't change later on. Otherwise we postpone sizing until query - geometry gets called. */ - if (!NILP (pixwidth)) /* pixwidth takes precendent */ - { - 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)) - { - tw = XINT (width); - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; - } - + /* normalize size information */ + if (!NILP (width)) + tw = XINT (width); + if (!NILP (height)) + th = XINT (height); + if (!NILP (pixwidth)) + pw = XINT (pixwidth); if (!NILP (pixheight)) - { - 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) - { - th = XINT (height); - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; - } - - /* Taking the default face information when the user has specified - size in characters is probably as good as any since the widget - face is more likely to be proportional and thus give inadequate - results. Using character sizes can only ever be approximate - anyway. */ - if (tw || th) - { - int charwidth, charheight; - default_face_font_info (domain, 0, 0, &charheight, &charwidth, 0); - if (tw) - pw = charwidth * tw; - if (th) - ph = charheight * th; - } + ph = XINT (pixheight); /* for a widget with an image pick up the dimensions from that */ if (!NILP (glyph)) { - if (!pw) - pw = glyph_width (glyph, domain) + 2 * WIDGET_BORDER_WIDTH; - if (!ph) - ph = glyph_height (glyph, domain) + 2 * WIDGET_BORDER_HEIGHT; - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; - } - - /* Pick up the margin width. */ - if (!NILP (mwidth)) - IMAGE_INSTANCE_MARGIN_WIDTH (ii) = XINT (mwidth); - - /* 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 "); - debug_print (instantiator); - stderr_out ("%d widgets instantiated\n", debug_widget_instances); -#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, - 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. */ - query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii), - IMAGE_INSTANCE_WIDGET_FACE (ii), - width, 0, 0, domain); - } - if (*height) - { - int len, h; - default_face_font_info (domain, 0, 0, &h, 0, 0); - GET_LIST_LENGTH (items, len); - *height = len * h; - } -} - -/* 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, - int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); - Lisp_Object rest; - unsigned int tw = 0, th = 0; - - LIST_LOOP (rest, items) - { - int h, w; - - query_string_geometry (XGUI_ITEM (XCAR (rest))->name, - IMAGE_INSTANCE_WIDGET_FACE (ii), - &w, &h, 0, domain); - tw += 5 * WIDGET_BORDER_WIDTH; /* some bias */ - tw += w; - th = max (th, h + 2 * WIDGET_BORDER_HEIGHT); + if (!pw && !tw) + pw = glyph_width (glyph, Qnil, DEFAULT_INDEX, domain) + + 2 * WIDGET_BORDER_WIDTH; + if (!ph && !th) + ph = glyph_height (glyph, Qnil, DEFAULT_INDEX, domain) + + 2 * WIDGET_BORDER_HEIGHT; } - /* Fixup returned values depending on orientation. */ - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)) - { - if (height) *height = tw; - if (width) *width = th; - } - else - { - if (height) *height = th; - if (width) *width = tw; - } -} - -/* Get the geometry of a tab control. This is based on the number of - items and text therin in the tab control. */ -static Lisp_Object -tab_control_set_property (Lisp_Object image_instance, - Lisp_Object prop, - Lisp_Object val) -{ - /* Record new items for update. *_tab_control_update will do the - rest. */ - if (EQ (prop, Q_items)) + /* if we still don' t have sizes, guess from text size */ + if (!tw && !pw && !NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) + tw = XSTRING_LENGTH (IMAGE_INSTANCE_WIDGET_TEXT (ii)); + if (!th && !ph) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); - - check_valid_item_list_1 (val); - - /* 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 (val)); - IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1; - - return Qt; + if (default_textheight) + th = default_textheight; + else if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) + th = 1; + else + ph = default_pixheight; } - return Qunbound; -} - -/* set the properties of a progres guage */ -static Lisp_Object -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_value)) - { - CHECK_INT (val); -#ifdef DEBUG_WIDGET_OUTPUT - printf ("progress gauge value set to %ld\n", XINT (val)); -#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 = val; + + if (tw !=0 || th !=0) + widget_text_to_pixel_conversion (domain, + IMAGE_INSTANCE_WIDGET_FACE (ii), + th, tw, th ? &ph : 0, tw ? &pw : 0); - IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1; - - return Qt; - } - return Qunbound; -} - - -/***************************************************************************** - * widget layout * - *****************************************************************************/ -/* we need to convert things like glyphs to images, eval expressions - etc.*/ -static Lisp_Object -layout_normalize (Lisp_Object inst, Lisp_Object console_type) -{ - /* 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. */ - if (!NILP (items)) - { - Lisp_Object rest; - LIST_LOOP (rest, items) - { - /* substitute the new glyph */ - Fsetcar (rest, glyph_instantiator_to_glyph (XCAR (rest))); - } - } - /* normalize the border spec. */ - if (VECTORP (border) || CONSP (border)) - { - substitute_keyword_value (inst, Q_border, glyph_instantiator_to_glyph (border)); - } - return inst; -} - -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); - Lisp_Object border = find_keyword_in_vector (instantiator, Q_border); - - /* 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; - } - - if (EQ (border, Qt)) - { - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = Qetched_in; - } - else - { - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border; - } - /* We don't do the children yet as we might not have a containing - window. */ + IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = pw; + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = ph; } static void -layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object domain) +widget_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 items = find_keyword_in_vector (instantiator, Q_items); - Lisp_Object rest, children = Qnil; - - if (GLYPHP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) - { - /* 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. */ - Lisp_Object gii = glyph_image_instance - (IMAGE_INSTANCE_LAYOUT_BORDER (ii), - image_instance, ERROR_ME, 1); - - if (!IMAGE_INSTANCEP (gii)) - return; - /* make sure we are designated as the parent. */ - XIMAGE_INSTANCE_PARENT (gii) = image_instance; - children = Fcons (gii, children); - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0); - } - - /* Pick up the sub-widgets. */ - LIST_LOOP (rest, items) - { - /* make sure the image is instantiated */ - Lisp_Object gii = glyph_image_instance (XCAR (rest), - image_instance, ERROR_ME, 1); - if (!IMAGE_INSTANCEP (gii)) - return; - /* make sure we are designated as the parent. */ - XIMAGE_INSTANCE_PARENT (gii) = image_instance; - 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; + widget_instantiate_1 (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, 1, 0); } -/* Layout widget. Sizing commentary: we have a number of problems that - we would like to address. Some consider some of these more - important than others. It used to be that size information was - determined at instantiation time and was then fixed forever - after. Generally this is not what we want. Users want size to be - "big enough" to accommodate whatever they are trying to show and - this is dependent on text length, lines, font metrics etc. Of - 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 - 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. - - 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. - - 4. A button grows to accommodate additional text. The whitespace - around it should be modified to cope with the new layout - requirements. - - 5. A button grows. The area surrounding it should grow also if - 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. - - Text glyphs are particularly troublesome since their metrics depend - on the context in which they are being viewed. For instance they - can appear differently depending on the window face, frame face or - glyph face. In order to simplify this text glyphs can now only have - a glyph-face or image-instance face. All other glyphs are - essentially fixed in appearance. Perhaps the problem is that text - glyphs are cached on a device basis like most other glyphs. Instead - they should be cached per-window and then the instance would be - fixed and we wouldn't have to mess around with font metrics and the - rest. */ - -/* 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, int* width, - int* height, enum image_instance_geometry disp, - Lisp_Object domain) +combo_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 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))) - { - image_instance_query_geometry (XCAR (items), &gwidth, &gheight, disp, domain); - 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); - image_instance_query_geometry (glyph, &gwidth, &gheight, disp, domain); - - nitems ++; - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - { - maxph = max (maxph, gheight); - maxpw += gwidth; - } - else - { - maxpw = max (maxpw, gwidth); - maxph += gheight; - } - } - - /* 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 (!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; + Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties), + Q_items, Qnil); + int len; + GET_LIST_LENGTH (data, len); + widget_instantiate_1 (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, len + 1, 0); } -int -layout_layout (Lisp_Object image_instance, - int width, int height, Lisp_Object domain) +/* Instantiate a static control */ +static void +static_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 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; - int gheight, gwidth; - - /* If we are not initialized then we won't have any children. */ - if (!IMAGE_INSTANCE_INITIALIZED (ii)) - return 0; - - /* Pick up the border text if we have one. */ - if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) - { - Lisp_Object border = XCAR (items); - items = XCDR (items); - image_instance_query_geometry (border, &gwidth, &gheight, - IMAGE_DESIRED_GEOMETRY, domain); - /* #### Really, what should this be? */ - XIMAGE_INSTANCE_XOFFSET (border) = 10; - XIMAGE_INSTANCE_YOFFSET (border) = 0; - ph_adjust = gheight / 2; - IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust); - - image_instance_layout (border, gwidth, gheight, domain); - } - - /* 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); - nitems ++; - if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) - == LAYOUT_HORIZONTAL) - { - maxph = max (maxph, gheight); - maxpw += gwidth; - } - else - { - maxpw = max (maxpw, gwidth); - maxph += gheight; - } - } - - /* work out spacing between items and bounds of the layout */ - if (width < maxpw) - /* The user wants a smaller space than the largest item, so we - just provide default spacing and will let the output routines - clip.. */ - horiz_spacing = WIDGET_BORDER_WIDTH * 2; - 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 + - IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2)) - / (nitems + 1); - else - 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) - == LAYOUT_VERTICAL) - vert_spacing = (height - (maxph + ph_adjust + - IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2)) - / (nitems + 1); - else - vert_spacing = (height - (maxph + ph_adjust)) / 2 - - IMAGE_INSTANCE_MARGIN_WIDTH (ii); - - 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 - border glyph. */ - LIST_LOOP (rest, items) - { - Lisp_Object glyph = XCAR (rest); - - image_instance_query_geometry (glyph, &gwidth, &gheight, - IMAGE_DESIRED_GEOMETRY, domain); - - 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); - } - return 1; -} - -/* Layout subwindows if they are real subwindows. */ -static int -native_layout_layout (Lisp_Object image_instance, - int width, int height, - 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, 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; + widget_instantiate_1 (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, 0, 4); } @@ -1260,232 +444,114 @@ defkeyword (&Q_properties, ":properties"); defkeyword (&Q_items, ":items"); defkeyword (&Q_image, ":image"); - defkeyword (&Q_text, ":text"); - defkeyword (&Q_orientation, ":orientation"); - defkeyword (&Q_justify, ":justify"); - defkeyword (&Q_border, ":border"); - defkeyword (&Q_margin_width, ":margin-width"); - - defsymbol (&Qetched_in, "etched-in"); - defsymbol (&Qetched_out, "etched-out"); - defsymbol (&Qbevel_in, "bevel-in"); - defsymbol (&Qbevel_out, "bevel-out"); -} - -#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_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_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) - - -static void image_instantiator_widget (void) -{ /* 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, query_geometry); - IIFORMAT_HAS_METHOD (widget, layout); -} - -static void image_instantiator_buttons (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (button, "button"); - 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); - VALID_WIDGET_KEYWORDS (button); - VALID_GUI_KEYWORDS (button); -} - -static void image_instantiator_edit_fields (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (edit_field, "edit-field"); - 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); -} - -static void image_instantiator_combo_box (void) -{ - 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_or_function); - IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face); - IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list); -} - -static void image_instantiator_scrollbar (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (scrollbar, "scrollbar"); - 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_or_function); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int_or_function); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face); -} - -static void image_instantiator_progress_guage (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (progress_gauge, "progress-gauge"); - 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, set_property); - VALID_WIDGET_KEYWORDS (progress_gauge); - VALID_GUI_KEYWORDS (progress_gauge); -} - -static void image_instantiator_tree_view (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (tree_view, "tree-view"); - 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_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); -} - -static void image_instantiator_tab_control (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (tab_control, "tab-control"); - 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, set_property); - 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); -} - -static void image_instantiator_labels (void) -{ - 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_glyph_or_instantiator_list) - -static void image_instantiator_layout (void) -{ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (layout, "layout"); - 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); - - 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); - - VALID_GUI_KEYWORDS (native_layout); - VALID_LAYOUT_KEYWORDS (native_layout); + defkeyword (&Q_percent, ":percent"); + defkeyword (&Q_text, "text"); } void image_instantiator_format_create_glyphs_widget (void) { - image_instantiator_widget(); - 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(); - image_instantiator_native_layout(); -} +#define VALID_GUI_KEYWORDS(type) \ + IIFORMAT_VALID_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_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_KEYWORD (type, Q_callback, check_valid_callback); \ + IIFORMAT_VALID_KEYWORD (type, Q_descriptor, check_valid_string_or_vector) + +#define VALID_WIDGET_KEYWORDS(type) \ + 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) + + /* 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); + + /* widget image-instantiator types - buttons */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (button, "button"); + 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, normalize, widget); + IIFORMAT_VALID_KEYWORD (button, Q_image, check_valid_glyph_or_image); + VALID_WIDGET_KEYWORDS (button); + VALID_GUI_KEYWORDS (button); + + /* edit fields */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (edit, "edit"); + IIFORMAT_HAS_SHARED_METHOD (edit, validate, widget); + IIFORMAT_HAS_SHARED_METHOD (edit, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (edit, instantiate, widget); + VALID_WIDGET_KEYWORDS (edit); + VALID_GUI_KEYWORDS (edit); -void -reinit_vars_of_glyphs_widget (void) -{ -#ifdef DEBUG_WIDGETS - debug_widget_instances = 0; + /* combo box */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (combo, "combo"); + IIFORMAT_HAS_METHOD (combo, validate); + IIFORMAT_HAS_SHARED_METHOD (combo, possible_dest_types, widget); + IIFORMAT_HAS_METHOD (combo, instantiate); + VALID_GUI_KEYWORDS (combo); + + IIFORMAT_VALID_KEYWORD (combo, Q_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (combo, Q_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (combo, Q_pixel_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (combo, Q_face, check_valid_face); + IIFORMAT_VALID_KEYWORD (combo, Q_properties, check_valid_item_list); + + /* scrollbar */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (scrollbar, "scrollbar"); + IIFORMAT_HAS_SHARED_METHOD (scrollbar, validate, widget); + IIFORMAT_HAS_SHARED_METHOD (scrollbar, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (scrollbar, instantiate, widget); + 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_face, check_valid_face); + + /* progress guage */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (progress, "progress"); + IIFORMAT_HAS_SHARED_METHOD (progress, validate, widget); + IIFORMAT_HAS_SHARED_METHOD (progress, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (progress, instantiate, widget); + VALID_WIDGET_KEYWORDS (progress); + VALID_GUI_KEYWORDS (progress); + + /* labels */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (label, "label"); + IIFORMAT_HAS_SHARED_METHOD (label, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (label, instantiate, static); + VALID_WIDGET_KEYWORDS (label); + IIFORMAT_VALID_KEYWORD (label, Q_descriptor, check_valid_string); + +#if 0 + /* group */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (group, "group"); + IIFORMAT_HAS_SHARED_METHOD (group, possible_dest_types, widget); + IIFORMAT_HAS_METHOD (group, instantiate); + + IIFORMAT_VALID_KEYWORD (group, Q_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (group, Q_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (group, Q_pixel_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (group, Q_pixel_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (group, Q_face, check_valid_face); + IIFORMAT_VALID_KEYWORD (group, Q_background, check_valid_string); + IIFORMAT_VALID_KEYWORD (group, Q_descriptor, check_valid_string); #endif } void vars_of_glyphs_widget (void) { - reinit_vars_of_glyphs_widget (); } diff -r 12e008d41344 -r 697ef44129c6 src/glyphs-x.c --- a/src/glyphs-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -4,7 +4,6 @@ Copyright (C) 1995 Tinker Systems Copyright (C) 1995, 1996 Ben Wing Copyright (C) 1995 Sun Microsystems - Copyright (C) 1999, 2000 Andy Piper This file is part of XEmacs. @@ -40,11 +39,9 @@ Many changes for color work and optimizations by Jareth Hein for 21.0 Switch of GIF/JPEG/PNG to new EImage intermediate code by Jareth Hein for 21.0 TIFF code by Jareth Hein for 21.0 - GIF/JPEG/PNG/TIFF code moved to new glyph-eimage.c by Andy Piper for 21.0 - Subwindow and Widget support by Andy Piper for 21.2 + GIF/JPEG/PNG/TIFF code moved to new glyph-eimage.c for 21.0 TODO: - Support the GrayScale, StaticColor and StaticGray visual classes. Convert images.el to C and stick it in here? */ @@ -54,9 +51,6 @@ #include "console-x.h" #include "glyphs-x.h" #include "objects-x.h" -#ifdef HAVE_WIDGETS -#include "gui-x.h" -#endif #include "xmu.h" #include "buffer.h" @@ -64,8 +58,6 @@ #include "frame.h" #include "insdel.h" #include "opaque.h" -#include "gui.h" -#include "faces.h" #include "imgproc.h" @@ -77,11 +69,6 @@ #include "file-coding.h" #endif -#ifdef LWLIB_WIDGETS_MOTIF -#include <Xm/Xm.h> -#endif -#include <X11/IntrinsicP.h> - #if INTBITS == 32 # define FOUR_BYTE_TYPE unsigned int #elif LONGBITS == 32 @@ -94,22 +81,6 @@ #define LISP_DEVICE_TO_X_SCREEN(dev) XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev))) -DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); -DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); -#ifdef HAVE_JPEG -DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); -#endif -#ifdef HAVE_TIFF -DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff); -#endif -#ifdef HAVE_PNG -DECLARE_IMAGE_INSTANTIATOR_FORMAT (png); -#endif -#ifdef HAVE_GIF -DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif); -#endif #ifdef HAVE_XPM DEFINE_DEVICE_IIFORMAT (x, xpm); #endif @@ -126,20 +97,6 @@ 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); -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 -DEFINE_DEVICE_IIFORMAT (x, combo_box); -#endif -DEFINE_DEVICE_IIFORMAT (x, tab_control); -DEFINE_DEVICE_IIFORMAT (x, label); -#endif - static void cursor_font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, @@ -147,15 +104,6 @@ int dest_mask, Lisp_Object domain); -#ifdef HAVE_WIDGETS -static void -update_widget_face (widget_value* wv, - Lisp_Image_Instance* ii, Lisp_Object domain); -static void -update_tab_widget_face (widget_value* wv, - Lisp_Image_Instance* ii, Lisp_Object domain); -#endif - #include "bitmaps.h" @@ -190,13 +138,6 @@ vis = DEVICE_X_VISUAL (XDEVICE(device)); depth = DEVICE_X_DEPTH(XDEVICE(device)); - if (vis->class == GrayScale || vis->class == StaticColor || - vis->class == StaticGray) - { - /* #### Implement me!!! */ - return NULL; - } - if (vis->class == PseudoColor) { /* Quantize the image and get a histogram while we're at it. @@ -234,7 +175,7 @@ *pixtbl = xnew_array (unsigned long, pixcount); *npixels = 0; - /* #### should implement a sort by popularity to assure proper allocation */ + /* ### should implement a sort by popularity to assure proper allocation */ n = *npixels; for (i = 0; i < qtable->num_active_colors; i++) { @@ -265,7 +206,7 @@ gr = *ip++; bl = *ip++; conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)]; -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN if (outimg->byte_order == MSBFirst) for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; else @@ -340,7 +281,7 @@ bl = *ip++ >> (8 - bbits); conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift); -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN if (outimg->byte_order == MSBFirst) for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q]; else @@ -360,7 +301,7 @@ static void -x_print_image_instance (Lisp_Image_Instance *p, +x_print_image_instance (struct Lisp_Image_Instance *p, Lisp_Object printcharfun, int escapeflag) { @@ -385,43 +326,19 @@ } } -#ifdef DEBUG_WIDGETS -extern int debug_widget_instances; -#endif - static void -x_finalize_image_instance (Lisp_Image_Instance *p) +x_finalize_image_instance (struct Lisp_Image_Instance *p) { if (!p->data) return; - if (DEVICE_LIVE_P (XDEVICE (IMAGE_INSTANCE_DEVICE (p)))) + if (DEVICE_LIVE_P (XDEVICE (p->device))) { - 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)) - { -#ifdef DEBUG_WIDGETS - debug_widget_instances--; - stderr_out ("widget destroyed, %d left\n", debug_widget_instances); -#endif - lw_destroy_widget (IMAGE_INSTANCE_X_WIDGET_ID (p)); - lw_destroy_widget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); + Display *dpy = DEVICE_X_DISPLAY (XDEVICE (p->device)); - /* 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_TYPE (p) == IMAGE_WIDGET + || + IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) { if (IMAGE_INSTANCE_SUBWINDOW_ID (p)) XDestroyWindow (dpy, IMAGE_INSTANCE_X_SUBWINDOW_ID (p)); @@ -429,33 +346,20 @@ } else { - int i; - if (IMAGE_INSTANCE_PIXMAP_TIMEOUT (p)) - disable_glyph_animated_timeout (IMAGE_INSTANCE_PIXMAP_TIMEOUT (p)); - + if (IMAGE_INSTANCE_X_PIXMAP (p)) + XFreePixmap (dpy, IMAGE_INSTANCE_X_PIXMAP (p)); if (IMAGE_INSTANCE_X_MASK (p) && IMAGE_INSTANCE_X_MASK (p) != IMAGE_INSTANCE_X_PIXMAP (p)) XFreePixmap (dpy, IMAGE_INSTANCE_X_MASK (p)); - IMAGE_INSTANCE_PIXMAP_MASK (p) = 0; - - if (IMAGE_INSTANCE_X_PIXMAP_SLICES (p)) - { - for (i = 0; i < IMAGE_INSTANCE_PIXMAP_MAXSLICE (p); i++) - if (IMAGE_INSTANCE_X_PIXMAP_SLICE (p,i)) - { - XFreePixmap (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE (p,i)); - IMAGE_INSTANCE_X_PIXMAP_SLICE (p, i) = 0; - } - xfree (IMAGE_INSTANCE_X_PIXMAP_SLICES (p)); - IMAGE_INSTANCE_X_PIXMAP_SLICES (p) = 0; - } - + IMAGE_INSTANCE_X_PIXMAP (p) = 0; + IMAGE_INSTANCE_X_MASK (p) = 0; + if (IMAGE_INSTANCE_X_CURSOR (p)) { XFreeCursor (dpy, IMAGE_INSTANCE_X_CURSOR (p)); IMAGE_INSTANCE_X_CURSOR (p) = 0; } - + if (IMAGE_INSTANCE_X_NPIXELS (p) != 0) { XFreeColors (dpy, @@ -466,13 +370,7 @@ } } } - /* You can sometimes have pixels without a live device. I forget - why, but that's why we free them here if we have a pixmap type - image instance. It probably means that we might also get a memory - leak with widgets. */ - if (IMAGE_INSTANCE_TYPE (p) != IMAGE_WIDGET - && IMAGE_INSTANCE_TYPE (p) != IMAGE_SUBWINDOW - && IMAGE_INSTANCE_X_PIXELS (p)) + if (IMAGE_INSTANCE_X_PIXELS (p)) { xfree (IMAGE_INSTANCE_X_PIXELS (p)); IMAGE_INSTANCE_X_PIXELS (p) = 0; @@ -483,8 +381,8 @@ } static int -x_image_instance_equal (Lisp_Image_Instance *p1, - Lisp_Image_Instance *p2, int depth) +x_image_instance_equal (struct Lisp_Image_Instance *p1, + struct Lisp_Image_Instance *p2, int depth) { switch (IMAGE_INSTANCE_TYPE (p1)) { @@ -503,7 +401,7 @@ } static unsigned long -x_image_instance_hash (Lisp_Image_Instance *p, int depth) +x_image_instance_hash (struct Lisp_Image_Instance *p, int depth) { switch (IMAGE_INSTANCE_TYPE (p)) { @@ -523,14 +421,10 @@ methods are called. */ static void -x_initialize_pixmap_image_instance (Lisp_Image_Instance *ii, - int slices, +x_initialize_pixmap_image_instance (struct Lisp_Image_Instance *ii, enum image_instance_type type) { ii->data = xnew_and_zero (struct x_image_instance_data); - IMAGE_INSTANCE_PIXMAP_MAXSLICE (ii) = slices; - IMAGE_INSTANCE_X_PIXMAP_SLICES (ii) = - xnew_array_and_zero (Pixmap, slices); IMAGE_INSTANCE_TYPE (ii) = type; IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = Qnil; IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (ii) = Qnil; @@ -574,7 +468,7 @@ (XSTRING_BYTE (name, 2) == '/'))))) { if (!NILP (Ffile_readable_p (name))) - return Fexpand_file_name (name, Qnil); + return name; else return Qnil; } @@ -700,7 +594,7 @@ /* Get the data while doing the conversion */ while (1) { - ssize_t size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; /* It does seem the flushes are necessary... */ @@ -843,13 +737,12 @@ Use the same code as for `xpm'. */ static void -init_image_instance_from_x_image (Lisp_Image_Instance *ii, +init_image_instance_from_x_image (struct Lisp_Image_Instance *ii, XImage *ximage, int dest_mask, Colormap cmap, unsigned long *pixels, int npixels, - int slices, Lisp_Object instantiator) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); @@ -885,15 +778,13 @@ XFreeGC (dpy, gc); - x_initialize_pixmap_image_instance (ii, slices, IMAGE_COLOR_PIXMAP); + x_initialize_pixmap_image_instance (ii, IMAGE_COLOR_PIXMAP); IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = find_keyword_in_vector (instantiator, Q_file); - /* Fixup a set of pixmaps. */ IMAGE_INSTANCE_X_PIXMAP (ii) = pixmap; - - IMAGE_INSTANCE_PIXMAP_MASK (ii) = 0; + IMAGE_INSTANCE_X_MASK (ii) = 0; IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = ximage->width; IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = ximage->height; IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = ximage->depth; @@ -903,44 +794,8 @@ } static void -image_instance_add_x_image (Lisp_Image_Instance *ii, - XImage *ximage, - int slice, - Lisp_Object instantiator) -{ - Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - Display *dpy; - GC gc; - Drawable d; - Pixmap pixmap; - - dpy = DEVICE_X_DISPLAY (XDEVICE (device)); - d = XtWindow(DEVICE_XT_APP_SHELL (XDEVICE (device))); - - pixmap = XCreatePixmap (dpy, d, ximage->width, - ximage->height, ximage->depth); - if (!pixmap) - signal_simple_error ("Unable to create pixmap", instantiator); - - gc = XCreateGC (dpy, pixmap, 0, NULL); - if (!gc) - { - XFreePixmap (dpy, pixmap); - signal_simple_error ("Unable to create GC", instantiator); - } - - XPutImage (dpy, pixmap, gc, ximage, 0, 0, 0, 0, - ximage->width, ximage->height); - - XFreeGC (dpy, gc); - - IMAGE_INSTANCE_X_PIXMAP_SLICE (ii, slice) = pixmap; -} - -static void -x_init_image_instance_from_eimage (Lisp_Image_Instance *ii, +x_init_image_instance_from_eimage (struct Lisp_Image_Instance *ii, int width, int height, - int slices, unsigned char *eimage, int dest_mask, Lisp_Object instantiator, @@ -950,42 +805,33 @@ Colormap cmap = DEVICE_X_COLORMAP (XDEVICE(device)); unsigned long *pixtbl = NULL; int npixels = 0; - int slice; XImage* ximage; - for (slice = 0; slice < slices; slice++) + ximage = convert_EImage_to_XImage (device, width, height, eimage, + &pixtbl, &npixels); + if (!ximage) { - ximage = convert_EImage_to_XImage (device, width, height, - eimage + (width * height * 3 * slice), - &pixtbl, &npixels); - if (!ximage) - { - if (pixtbl) xfree (pixtbl); - signal_image_error("EImage to XImage conversion failed", instantiator); - } + if (pixtbl) xfree (pixtbl); + signal_image_error("EImage to XImage conversion failed", instantiator); + } - /* Now create the pixmap and set up the image instance */ - if (slice == 0) - init_image_instance_from_x_image (ii, ximage, dest_mask, - cmap, pixtbl, npixels, slices, - instantiator); - else - image_instance_add_x_image (ii, ximage, slice, instantiator); + /* Now create the pixmap and set up the image instance */ + init_image_instance_from_x_image (ii, ximage, dest_mask, + cmap, pixtbl, npixels, + instantiator); - if (ximage) - { - if (ximage->data) - { - xfree (ximage->data); - ximage->data = 0; - } - XDestroyImage (ximage); - ximage = 0; - } + if (ximage) + { + if (ximage->data) + { + xfree (ximage->data); + ximage->data = 0; + } + XDestroyImage (ximage); } } -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) { @@ -999,7 +845,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))), @@ -1011,10 +857,10 @@ image instance accordingly. */ static void -init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii, +init_image_instance_from_xbm_inline (struct 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, @@ -1056,7 +902,7 @@ IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); - x_initialize_pixmap_image_instance (ii, 1, type); + x_initialize_pixmap_image_instance (ii, type); IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = width; IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = height; IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = @@ -1152,24 +998,24 @@ 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); - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Pixmap mask = 0; + CONST char *gcc_may_you_rot_in_hell; if (!NILP (mask_data)) { - const char *ext_data; - - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))), - C_STRING_ALLOCA, 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); + GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (mask_data))), + gcc_may_you_rot_in_hell); + mask = + pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii), + XINT (XCAR (mask_data)), + XINT (XCAR (XCDR (mask_data))), + (CONST unsigned char *) + gcc_may_you_rot_in_hell); } init_image_instance_from_xbm_inline (ii, width, height, bits, @@ -1185,17 +1031,16 @@ int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - const char *ext_data; + CONST char *gcc_go_home; assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))), - C_STRING_ALLOCA, ext_data, - Qbinary); + GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (data))), + gcc_go_home); xbm_instantiate_1 (image_instance, instantiator, pointer_fg, pointer_bg, dest_mask, XINT (XCAR (data)), - XINT (XCAR (XCDR (data))), ext_data); + XINT (XCAR (XCDR (data))), gcc_go_home); } @@ -1299,11 +1144,11 @@ static void x_xpm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) { /* This function can GC */ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); Display *dpy; @@ -1361,7 +1206,7 @@ visual = DEVICE_X_VISUAL (XDEVICE(device)); #endif - x_initialize_pixmap_image_instance (ii, 1, type); + x_initialize_pixmap_image_instance (ii, type); assert (!NILP (data)); @@ -1471,7 +1316,7 @@ pixels = NULL; IMAGE_INSTANCE_X_PIXMAP (ii) = pixmap; - IMAGE_INSTANCE_PIXMAP_MASK (ii) = (void*)mask; + IMAGE_INSTANCE_X_MASK (ii) = mask; IMAGE_INSTANCE_X_COLORMAP (ii) = cmap; IMAGE_INSTANCE_X_PIXELS (ii) = pixels; IMAGE_INSTANCE_X_NPIXELS (ii) = npixels; @@ -1670,16 +1515,13 @@ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; - char *bits, *bp; - const char *p; - const char * volatile emsg = 0; - const char * volatile dstring; + char *p, *bits, *bp; + CONST char * volatile emsg = 0; + CONST char * volatile dstring; assert (!NILP (data)); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - C_STRING_ALLOCA, dstring, - Qbinary); + GET_C_STRING_BINARY_DATA_ALLOCA (data, dstring); if ((p = strchr (dstring, ':'))) { @@ -1743,7 +1585,7 @@ static Lisp_Object autodetect_normalize (Lisp_Object instantiator, - Lisp_Object console_type) + Lisp_Object console_type) { Lisp_Object file = find_keyword_in_vector (instantiator, Q_data); Lisp_Object filename = Qnil; @@ -1834,10 +1676,10 @@ static void autodetect_instantiate (Lisp_Object image_instance, - Lisp_Object instantiator, - Lisp_Object pointer_fg, - Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) + Lisp_Object instantiator, + Lisp_Object pointer_fg, + Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); struct gcpro gcpro1, gcpro2, gcpro3; @@ -1850,10 +1692,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; + GET_C_STRING_FILENAME_DATA_ALLOCA (data, name_ext); if (XmuCursorNameToIndex (name_ext) != -1) { result = alist_to_tagged_vector (Qcursor_font, alist); @@ -1940,7 +1780,7 @@ { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); Display *dpy; XColor fg, bg; @@ -2004,7 +1844,7 @@ /* #### call XQueryTextExtents() and check_pointer_sizes() here. */ - x_initialize_pixmap_image_instance (ii, 1, IMAGE_POINTER); + x_initialize_pixmap_image_instance (ii, IMAGE_POINTER); IMAGE_INSTANCE_X_CURSOR (ii) = XCreateGlyphCursor (dpy, source, mask, source_char, mask_char, &fg, &bg); @@ -2038,11 +1878,11 @@ { /* This function can GC */ Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); 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))) @@ -2053,13 +1893,11 @@ 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); + GET_C_STRING_FILENAME_DATA_ALLOCA (data, name_ext); if ((i = XmuCursorNameToIndex (name_ext)) == -1) signal_simple_error ("Unrecognized cursor-font name", data); - x_initialize_pixmap_image_instance (ii, 1, IMAGE_POINTER); + x_initialize_pixmap_image_instance (ii, IMAGE_POINTER); IMAGE_INSTANCE_X_CURSOR (ii) = XCreateFontCursor (dpy, i); foreground = find_keyword_in_vector (instantiator, Q_foreground); if (NILP (foreground)) @@ -2074,7 +1912,7 @@ x_colorize_image_instance (Lisp_Object image_instance, Lisp_Object foreground, Lisp_Object background) { - Lisp_Image_Instance *p; + struct Lisp_Image_Instance *p; p = XIMAGE_INSTANCE (image_instance); @@ -2084,7 +1922,7 @@ IMAGE_INSTANCE_TYPE (p) = IMAGE_COLOR_PIXMAP; /* Make sure there aren't two pointers to the same mask, causing it to get freed twice. */ - IMAGE_INSTANCE_PIXMAP_MASK (p) = 0; + IMAGE_INSTANCE_X_MASK (p) = 0; break; default: @@ -2127,145 +1965,21 @@ /* unmap the image if it is a widget. This is used by redisplay via redisplay_unmap_subwindows */ static void -x_unmap_subwindow (Lisp_Image_Instance *p) +x_unmap_subwindow (struct Lisp_Image_Instance *p) { - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) - { - XUnmapWindow - (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), - IMAGE_INSTANCE_X_CLIPWINDOW (p)); - } - else /* must be a widget */ - { - XtUnmapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); - } + XUnmapWindow (DisplayOfScreen (IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (p)), + IMAGE_INSTANCE_X_SUBWINDOW_ID (p)); } /* map the subwindow. This is used by redisplay via redisplay_output_subwindow */ static void -x_map_subwindow (Lisp_Image_Instance *p, int x, int y, - struct display_glyph_area* dga) -{ - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) - { - Window subwindow = IMAGE_INSTANCE_X_SUBWINDOW_ID (p); - XMoveResizeWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), - IMAGE_INSTANCE_X_CLIPWINDOW (p), - 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)); - } - else /* must be a widget */ - { - XtConfigureWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p), - x + IMAGE_INSTANCE_X_WIDGET_XOFFSET (p), - y + IMAGE_INSTANCE_X_WIDGET_YOFFSET (p), - dga->width, dga->height, 0); - XtMoveWidget (IMAGE_INSTANCE_X_WIDGET_ID (p), - -dga->xoffset, -dga->yoffset); - 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) -{ - /* 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_update_widget (Lisp_Image_Instance *p) +x_map_subwindow (struct Lisp_Image_Instance *p, int x, int y) { - /* This function can GC if IN_REDISPLAY is false. */ -#ifdef HAVE_WIDGETS - 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)); - wv->change = STRUCTURAL_CHANGE; - /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, True); - free_widget_value_tree (wv); - } - - /* Now do non structural updates. */ - wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p)); - - if (!wv) - return; - - /* 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); - TO_EXTERNAL_FORMAT (LISP_STRING, val, - C_STRING_ALLOCA, 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))) - { - Lisp_Object sw; - XSETIMAGE_INSTANCE (sw, p); - signal_simple_error ("XEmacs bug: subwindow is deleted", sw); - } - - 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, False); -#endif + XMapWindow (DisplayOfScreen (IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (p)), + IMAGE_INSTANCE_X_SUBWINDOW_ID (p)); + XMoveWindow (DisplayOfScreen (IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (p)), + IMAGE_INSTANCE_X_SUBWINDOW_ID (p), x, y); } /* instantiate and x type subwindow */ @@ -2275,17 +1989,17 @@ int dest_mask, Lisp_Object domain) { /* This function can GC */ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - Lisp_Object frame = DOMAIN_FRAME (domain); + Lisp_Object frame = FW_FRAME (domain); struct frame* f = XFRAME (frame); Display *dpy; Screen *xs; Window pw, win; XSetWindowAttributes xswa; Mask valueMask = 0; - unsigned int w = IMAGE_INSTANCE_WIDTH (ii), - h = IMAGE_INSTANCE_HEIGHT (ii); + unsigned int w = IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii), + h = IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii); if (!DEVICE_X_P (XDEVICE (device))) signal_simple_error ("Not an X device", device); @@ -2293,32 +2007,28 @@ dpy = DEVICE_X_DISPLAY (XDEVICE (device)); xs = DefaultScreenOfDisplay (dpy); - IMAGE_INSTANCE_TYPE (ii) = IMAGE_SUBWINDOW; + if (dest_mask & IMAGE_SUBWINDOW_MASK) + IMAGE_INSTANCE_TYPE (ii) = IMAGE_SUBWINDOW; + else + incompatible_image_types (instantiator, dest_mask, + IMAGE_SUBWINDOW_MASK); pw = XtWindow (FRAME_X_TEXT_WIDGET (f)); ii->data = xnew_and_zero (struct x_subwindow_data); IMAGE_INSTANCE_X_SUBWINDOW_PARENT (ii) = pw; - IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (ii) = DisplayOfScreen (xs); + IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (ii) = xs; xswa.backing_store = Always; valueMask |= CWBackingStore; xswa.colormap = DefaultColormapOfScreen (xs); valueMask |= CWColormap; - - /* Create a window for clipping */ - IMAGE_INSTANCE_X_CLIPWINDOW (ii) = - XCreateWindow (dpy, pw, 0, 0, w, h, 0, CopyFromParent, - InputOutput, CopyFromParent, valueMask, - &xswa); - - /* Now put the subwindow inside the clip window. */ - win = XCreateWindow (dpy, IMAGE_INSTANCE_X_CLIPWINDOW (ii), - 0, 0, w, h, 0, CopyFromParent, + + win = XCreateWindow (dpy, pw, 0, 0, w, h, 0, CopyFromParent, InputOutput, CopyFromParent, valueMask, &xswa); - + IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)win; } @@ -2331,7 +2041,7 @@ (subwindow, property, data)) { Atom property_atom; - Lisp_Subwindow *sw; + struct Lisp_Subwindow *sw; Display *dpy; CHECK_SUBWINDOW (subwindow); @@ -2352,416 +2062,14 @@ } #endif - -#ifdef HAVE_WIDGETS - -/************************************************************************/ -/* widgets */ -/************************************************************************/ - -static void -update_widget_face (widget_value* wv, Lisp_Image_Instance *ii, - Lisp_Object domain) -{ -#ifdef LWLIB_WIDGETS_MOTIF - XmFontList fontList; -#endif - /* Update the foreground. */ - Lisp_Object pixel = FACE_FOREGROUND - (IMAGE_INSTANCE_WIDGET_FACE (ii), - domain); - XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)), bcolor; - lw_add_widget_value_arg (wv, XtNforeground, fcolor.pixel); - - /* Update the background. */ - pixel = FACE_BACKGROUND (IMAGE_INSTANCE_WIDGET_FACE (ii), - domain); - bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); - lw_add_widget_value_arg (wv, XtNbackground, bcolor.pixel); - -#ifdef LWLIB_WIDGETS_MOTIF - fontList = XmFontListCreate - (FONT_INSTANCE_X_FONT - (XFONT_INSTANCE (query_string_font - (IMAGE_INSTANCE_WIDGET_TEXT (ii), - IMAGE_INSTANCE_WIDGET_FACE (ii), - domain))), XmSTRING_DEFAULT_CHARSET); - lw_add_widget_value_arg (wv, XmNfontList, (XtArgVal)fontList); -#endif - lw_add_widget_value_arg - (wv, XtNfont, (XtArgVal)FONT_INSTANCE_X_FONT - (XFONT_INSTANCE (query_string_font - (IMAGE_INSTANCE_WIDGET_TEXT (ii), - IMAGE_INSTANCE_WIDGET_FACE (ii), - domain)))); -} - -static void -update_tab_widget_face (widget_value* wv, Lisp_Image_Instance *ii, - Lisp_Object domain) -{ - if (wv->contents) - { - widget_value* val = wv->contents, *cur; - - /* Give each child label the correct foreground color. */ - Lisp_Object pixel = FACE_FOREGROUND - (IMAGE_INSTANCE_WIDGET_FACE (ii), - domain); - XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); - lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel); - - for (cur = val->next; cur; cur = cur->next) - { - if (cur->value) - { - lw_copy_widget_value_args (val, cur); - } - } - } -} - -static void -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) +static void +x_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), pixel; - struct device* d = XDEVICE (device); - Lisp_Object frame = DOMAIN_FRAME (domain); - struct frame* f = XFRAME (frame); - char* nm=0; - Widget wid; - Arg al [32]; - int ac = 0; - int id = new_lwlib_id (); - widget_value* clip_wv; - XColor fcolor, bcolor; - - if (!DEVICE_X_P (d)) - signal_simple_error ("Not an X device", device); - - /* have to set the type this late in case there is no device - instantiation for a widget. But we can go ahead and do it without - checking because there is always a generic instantiator. */ - 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); - - ii->data = xnew_and_zero (struct x_subwindow_data); - - /* Create a clip window to contain the subwidget. Incredibly the - XEmacs manager seems to be the most appropriate widget for - this. Nothing else is simple enough and yet does what is - required. */ - clip_wv = xmalloc_widget_value (); - - lw_add_widget_value_arg (clip_wv, XtNresize, False); - lw_add_widget_value_arg (clip_wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_WIDTH (ii)); - lw_add_widget_value_arg (clip_wv, XtNheight, - (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); - clip_wv->enabled = True; - - clip_wv->name = xstrdup ("clip-window"); - clip_wv->value = xstrdup ("clip-window"); - - IMAGE_INSTANCE_X_CLIPWIDGET (ii) - = lw_create_widget ("clip-window", "clip-window", new_lwlib_id (), - clip_wv, FRAME_X_CONTAINER_WIDGET (f), - False, 0, 0, 0); - - free_widget_value_tree (clip_wv); - - /* copy any args we were given */ - ac = 0; - lw_add_value_args_to_args (wv, al, &ac); - - /* Fixup the colors. We have to do this *before* the widget gets - created so that Motif will fix up the shadow colors - correctly. Once the widget is created Motif won't do this - anymore...*/ - pixel = FACE_FOREGROUND - (IMAGE_INSTANCE_WIDGET_FACE (ii), - IMAGE_INSTANCE_FRAME (ii)); - fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); - - pixel = FACE_BACKGROUND - (IMAGE_INSTANCE_WIDGET_FACE (ii), - IMAGE_INSTANCE_FRAME (ii)); - bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); - - lw_add_widget_value_arg (wv, XtNbackground, bcolor.pixel); - lw_add_widget_value_arg (wv, XtNforeground, fcolor.pixel); - /* 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_WIDTH (ii)); - lw_add_widget_value_arg (wv, XtNheight, - (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); - /* update the font. */ - update_widget_face (wv, ii, domain); - - wid = lw_create_widget (type, wv->name, id, wv, IMAGE_INSTANCE_X_CLIPWIDGET (ii), - False, 0, popup_selection_callback, 0); - - IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)wid; - IMAGE_INSTANCE_X_WIDGET_LWID (ii) = id; - /* 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. */ - ac = 0; - XtSetArg (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++; - XtSetArg (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++; - XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac); - - XtSetMappedWhenManaged (wid, TRUE); - - free_widget_value_tree (wv); - /* 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 */ -static Lisp_Object -x_widget_property (Lisp_Object image_instance, Lisp_Object prop) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - /* get the text from a control */ - if (EQ (prop, Q_text)) - { - widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); - return build_ext_string (wv->value, Qnative); - } - 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); + XResizeWindow (DisplayOfScreen (IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (ii)), + IMAGE_INSTANCE_X_SUBWINDOW_ID (ii), + w, h); } -/* 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 - want to display it in and BitBlt it. So images instances can have a - many-to-one relationship with things you see, whereas widgets can - only be one-to-one (i.e. per frame) */ -static void -x_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image); - widget_value* wv = gui_items_to_widget_values (image_instance, gui); - - if (!NILP (glyph)) - { - if (!IMAGE_INSTANCEP (glyph)) - glyph = glyph_image_instance (glyph, domain, ERROR_ME, 1); - } - - x_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "button", wv); - - /* add the image if one was given */ - if (!NILP (glyph) && IMAGE_INSTANCEP (glyph) - && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (glyph))) - { - Arg al [2]; - int ac =0; -#ifdef LWLIB_WIDGETS_MOTIF - XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++; - XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));ac++; -#else - XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; -#endif - XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac); - } -} - -/* 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_update (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)); - - /* 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) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - /* check the state of a button */ - if (EQ (prop, Q_selected)) - { - widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); - - if (wv->selected) - return Qt; - else - return Qnil; - } - return Qunbound; -} - -/* instantiate a progress gauge */ -static void -x_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - widget_value* wv = gui_items_to_widget_values (image_instance, gui); - - x_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "progress", wv); -} - -/* set the properties of a progres guage */ -static void -x_progress_gauge_update (Lisp_Object image_instance) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) - { - Arg al [1]; - 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); - } -} - -/* instantiate an edit control */ -static void -x_edit_field_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - widget_value* wv = gui_items_to_widget_values (image_instance, gui); - - x_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "text-field", wv); -} - -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 -/* instantiate a combo control */ -static void -x_combo_box_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); - widget_value * wv = 0; - /* This is not done generically because of sizing problems under - mswindows. */ - widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain); - - wv = gui_items_to_widget_values (image_instance, - IMAGE_INSTANCE_WIDGET_ITEMS (ii)); - - x_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "combo-box", wv); -} -#endif - -static void -x_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - widget_value * wv = - gui_items_to_widget_values (image_instance, - IMAGE_INSTANCE_WIDGET_ITEMS (ii)); - - update_tab_widget_face (wv, 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 void -x_tab_control_update (Lisp_Object image_instance) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - /* Possibly update the face. */ - if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) - || - XFRAME (IMAGE_INSTANCE_FRAME (ii))->faces_changed - || - IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) - { - widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); - - /* #### I don't know why this can occur. */ - if (!wv) - return; - - update_tab_widget_face (wv, ii, - IMAGE_INSTANCE_FRAME (ii)); - - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True); - } -} - -/* instantiate a static control possible for putting other things in */ -static void -x_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, - Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object domain) -{ - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); - widget_value* wv = gui_items_to_widget_values (image_instance, gui); - - x_widget_instantiate (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, domain, "button", wv); -} -#endif /* HAVE_WIDGETS */ - /************************************************************************/ /* initialization */ @@ -2789,76 +2097,23 @@ CONSOLE_HAS_METHOD (x, locate_pixmap_file); CONSOLE_HAS_METHOD (x, unmap_subwindow); CONSOLE_HAS_METHOD (x, map_subwindow); - CONSOLE_HAS_METHOD (x, update_widget); - CONSOLE_HAS_METHOD (x, update_subwindow); + CONSOLE_HAS_METHOD (x, resize_subwindow); } void image_instantiator_format_create_glyphs_x (void) { - 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 INITIALIZE_DEVICE_IIFORMAT (x, xpm); IIFORMAT_HAS_DEVMETHOD (x, xpm, instantiate); #endif -#ifdef HAVE_JPEG - IIFORMAT_VALID_CONSOLE (x, jpeg); -#endif -#ifdef HAVE_TIFF - IIFORMAT_VALID_CONSOLE (x, tiff); -#endif -#ifdef HAVE_PNG - IIFORMAT_VALID_CONSOLE (x, png); -#endif -#ifdef HAVE_GIF - IIFORMAT_VALID_CONSOLE (x, gif); -#endif INITIALIZE_DEVICE_IIFORMAT (x, xbm); IIFORMAT_HAS_DEVMETHOD (x, xbm, instantiate); 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, update); - /* general widget methods. */ - INITIALIZE_DEVICE_IIFORMAT (x, widget); - IIFORMAT_HAS_DEVMETHOD (x, widget, property); - /* progress gauge */ - INITIALIZE_DEVICE_IIFORMAT (x, progress_gauge); - IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, update); - IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, instantiate); - /* text field */ - INITIALIZE_DEVICE_IIFORMAT (x, edit_field); - IIFORMAT_HAS_DEVMETHOD (x, edit_field, instantiate); -#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 - /* combo box */ - INITIALIZE_DEVICE_IIFORMAT (x, combo_box); - IIFORMAT_HAS_DEVMETHOD (x, combo_box, instantiate); - IIFORMAT_HAS_SHARED_DEVMETHOD (x, combo_box, update, 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, update); - /* label */ - INITIALIZE_DEVICE_IIFORMAT (x, label); - IIFORMAT_HAS_DEVMETHOD (x, label, instantiate); -#endif + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (cursor_font, "cursor-font"); - IIFORMAT_VALID_CONSOLE (x, cursor_font); IIFORMAT_HAS_METHOD (cursor_font, validate); IIFORMAT_HAS_METHOD (cursor_font, possible_dest_types); @@ -2873,7 +2128,6 @@ IIFORMAT_HAS_METHOD (font, validate); IIFORMAT_HAS_METHOD (font, possible_dest_types); IIFORMAT_HAS_METHOD (font, instantiate); - IIFORMAT_VALID_CONSOLE (x, font); IIFORMAT_VALID_KEYWORD (font, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (font, Q_foreground, check_valid_string); @@ -2891,7 +2145,6 @@ IIFORMAT_HAS_METHOD (autodetect, normalize); IIFORMAT_HAS_METHOD (autodetect, possible_dest_types); IIFORMAT_HAS_METHOD (autodetect, instantiate); - IIFORMAT_VALID_CONSOLE (x, autodetect); IIFORMAT_VALID_KEYWORD (autodetect, Q_data, check_valid_string); } @@ -2919,7 +2172,7 @@ make_int (name##_height), \ make_ext_string (name##_bits, \ sizeof (name##_bits), \ - Qbinary))), \ + FORMAT_BINARY))), \ Qglobal, Qx, Qnil) BUILD_GLYPH_INST (Vtruncation_glyph, truncator); diff -r 12e008d41344 -r 697ef44129c6 src/glyphs-x.h --- a/src/glyphs-x.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs-x.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_glyphs_x_h_ -#define INCLUDED_glyphs_x_h_ +#ifndef _XEMACS_GLYPHS_X_H_ +#define _XEMACS_GLYPHS_X_H_ #include "glyphs.h" @@ -39,7 +39,8 @@ struct x_image_instance_data { - Pixmap* pixmaps; + Pixmap pixmap; + Pixmap mask; Cursor cursor; /* If depth>0, then that means that other colors were allocated when @@ -55,13 +56,8 @@ #define X_IMAGE_INSTANCE_DATA(i) ((struct x_image_instance_data *) (i)->data) -#define IMAGE_INSTANCE_X_PIXMAP(i) (X_IMAGE_INSTANCE_DATA (i)->pixmaps[0]) -#define IMAGE_INSTANCE_X_PIXMAP_SLICE(i,slice) \ - (X_IMAGE_INSTANCE_DATA (i)->pixmaps[slice]) -#define IMAGE_INSTANCE_X_PIXMAP_SLICES(i) \ - (X_IMAGE_INSTANCE_DATA (i)->pixmaps) -#define IMAGE_INSTANCE_X_MASK(i) \ - (Pixmap)(IMAGE_INSTANCE_PIXMAP_MASK (i)) +#define IMAGE_INSTANCE_X_PIXMAP(i) (X_IMAGE_INSTANCE_DATA (i)->pixmap) +#define IMAGE_INSTANCE_X_MASK(i) (X_IMAGE_INSTANCE_DATA (i)->mask) #define IMAGE_INSTANCE_X_CURSOR(i) (X_IMAGE_INSTANCE_DATA (i)->cursor) #define IMAGE_INSTANCE_X_COLORMAP(i) (X_IMAGE_INSTANCE_DATA (i)->colormap) #define IMAGE_INSTANCE_X_PIXELS(i) (X_IMAGE_INSTANCE_DATA (i)->pixels) @@ -69,10 +65,6 @@ #define XIMAGE_INSTANCE_X_PIXMAP(i) \ IMAGE_INSTANCE_X_PIXMAP (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_PIXMAP_SLICES(i) \ - IMAGE_INSTANCE_X_PIXMAP_SLICES (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_PIXMAP_SLICE(i) \ - IMAGE_INSTANCE_X_PIXMAP_SLICE (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_X_MASK(i) \ IMAGE_INSTANCE_X_MASK (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_X_CURSOR(i) \ @@ -88,67 +80,22 @@ struct x_subwindow_data { - union - { - struct - { - Display *display; - Window parent_window; - Window clip_window; - } sub; - struct - { - Widget clip_window; - Position x_offset; - Position y_offset; - LWLIB_ID id; - } wid; - } data; + Screen *xscreen; + Window parent_window; }; #define X_SUBWINDOW_INSTANCE_DATA(i) ((struct x_subwindow_data *) (i)->data) -#define IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(i) \ - (X_SUBWINDOW_INSTANCE_DATA (i)->data.sub.display) +#define IMAGE_INSTANCE_X_SUBWINDOW_SCREEN(i) \ + (X_SUBWINDOW_INSTANCE_DATA (i)->xscreen) #define IMAGE_INSTANCE_X_SUBWINDOW_PARENT(i) \ - (X_SUBWINDOW_INSTANCE_DATA (i)->data.sub.parent_window) -#define IMAGE_INSTANCE_X_CLIPWINDOW(i) \ - (X_SUBWINDOW_INSTANCE_DATA (i)->data.sub.clip_window) -#define IMAGE_INSTANCE_X_WIDGET_XOFFSET(i) \ - (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.x_offset) -#define IMAGE_INSTANCE_X_WIDGET_YOFFSET(i) \ - (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.y_offset) -#define IMAGE_INSTANCE_X_WIDGET_LWID(i) \ - (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)) - + (X_SUBWINDOW_INSTANCE_DATA (i)->parent_window) #define XIMAGE_INSTANCE_X_SUBWINDOW_PARENT(i) \ IMAGE_INSTANCE_X_SUBWINDOW_PARENT (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(i) \ - IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_WIDGET_XOFFSET(i) \ - IMAGE_INSTANCE_X_WIDGET_XOFFSET (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_WIDGET_YOFFSET(i) \ - IMAGE_INSTANCE_X_WIDGET_YOFFSET (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_WIDGET_LWID(i) \ - IMAGE_INSTANCE_X_WIDGET_LWID (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_CLIPWIDGET(i) \ - IMAGE_INSTANCE_X_CLIPWIDGET (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_X_CLIPWINDOW(i) \ - IMAGE_INSTANCE_X_CLIPWINDOW (XIMAGE_INSTANCE (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))) +#define XIMAGE_INSTANCE_X_SUBWINDOW_SCREEN(i) \ + IMAGE_INSTANCE_X_SUBWINDOW_SCREEN (XIMAGE_INSTANCE (i)) +#define IMAGE_INSTANCE_X_SUBWINDOW_ID(i) \ + ((Window) IMAGE_INSTANCE_SUBWINDOW_ID (i)) #endif /* HAVE_X_WINDOWS */ -#endif /* INCLUDED_glyphs_x_h_ */ +#endif /* _XEMACS_GLYPHS_X_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/glyphs.c --- a/src/glyphs.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,9 @@ /* 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, 2000 Ben Wing + Copyright (C) 1995, 1996 Ben Wing Copyright (C) 1995 Sun Microsystems - Copyright (C) 1998, 1999, 2000 Andy Piper + Copyright (C) 1998 Andy Piper This file is part of XEmacs. @@ -24,27 +24,24 @@ /* Synched up with: Not in FSF. */ -/* Written by Ben Wing and Chuck Thompson. Heavily modified / - rewritten by Andy Piper. */ +/* Written by Ben Wing and Chuck Thompson */ #include <config.h> #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 "rangetab.h" +#include "objects.h" #include "redisplay.h" -#include "specifier.h" #include "window.h" +#include "frame.h" +#include "chartab.h" +#include "rangetab.h" #ifdef HAVE_XPM #include <X11/xpm.h> @@ -73,15 +70,11 @@ Lisp_Object Vimage_instance_type_list; Lisp_Object Vglyph_type_list; -int disable_animated_pixmaps; - DEFINE_IMAGE_INSTANTIATOR_FORMAT (nothing); DEFINE_IMAGE_INSTANTIATOR_FORMAT (inherit); DEFINE_IMAGE_INSTANTIATOR_FORMAT (string); 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); @@ -121,28 +114,16 @@ 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 governing_domain, - Lisp_Object glyph); +static Lisp_Object allocate_image_instance (Lisp_Object device); 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); -/* 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 - always occur. */ -int hold_ignored_expose_registration; - EXFUN (Fimage_instance_type, 1); EXFUN (Fglyph_type, 1); -EXFUN (Fnext_window, 4); /**************************************************************************** @@ -174,7 +155,7 @@ if ((NILP (d) && NILP (device)) || (!NILP (device) && - EQ (CONSOLE_TYPE (XCONSOLE + EQ (CONSOLE_TYPE (XCONSOLE (DEVICE_CONSOLE (XDEVICE (device)))), d))) return Dynarr_at (the_image_instantiator_format_entry_dynarr, i).meths; } @@ -193,50 +174,21 @@ } static int -valid_image_instantiator_format_p (Lisp_Object format, Lisp_Object locale) +valid_image_instantiator_format_p (Lisp_Object format) { - int i; - struct image_instantiator_methods* meths = - decode_image_instantiator_format (format, ERROR_ME_NOT); - Lisp_Object contype = Qnil; - /* mess with the locale */ - if (!NILP (locale) && SYMBOLP (locale)) - contype = locale; - else - { - struct console* console = decode_console (locale); - contype = console ? CONSOLE_TYPE (console) : locale; - } - /* nothing is valid in all locales */ - if (EQ (format, Qnothing)) - return 1; - /* reject unknown formats */ - else if (NILP (contype) || !meths) - return 0; - - for (i = 0; i < Dynarr_length (meths->consoles); i++) - if (EQ (contype, Dynarr_at (meths->consoles, i).symbol)) - return 1; - return 0; + return (decode_image_instantiator_format (format, ERROR_ME_NOT) != 0); } DEFUN ("valid-image-instantiator-format-p", Fvalid_image_instantiator_format_p, - 1, 2, 0, /* + 1, 1, 0, /* 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, '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. +'autodetect, 'widget and 'subwindow, depending on how XEmacs was compiled. */ - (image_instantiator_format, locale)) + (image_instantiator_format)) { - return valid_image_instantiator_format_p (image_instantiator_format, - locale) ? + return valid_image_instantiator_format_p (image_instantiator_format) ? Qt : Qnil; } @@ -259,9 +211,8 @@ entry.device = device; entry.meths = meths; Dynarr_add (the_image_instantiator_format_entry_dynarr, entry); - if (NILP (memq_no_quit (symbol, Vimage_instantiator_format_list))) - Vimage_instantiator_format_list = - Fcons (symbol, Vimage_instantiator_format_list); + Vimage_instantiator_format_list = + Fcons (symbol, Vimage_instantiator_format_list); } void @@ -551,86 +502,6 @@ 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)); - 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; -} - static Lisp_Object normalize_image_instantiator (Lisp_Object instantiator, Lisp_Object contype, @@ -655,7 +526,7 @@ struct image_instantiator_methods *meths; GCPRO1 (instantiator); - + meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], ERROR_ME); RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize, @@ -665,71 +536,36 @@ } static Lisp_Object -instantiate_image_instantiator (Lisp_Object governing_domain, - Lisp_Object domain, +instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, - int dest_mask, Lisp_Object glyph) + int dest_mask) { - Lisp_Object ii = allocate_image_instance (governing_domain, glyph); - Lisp_Image_Instance* p = XIMAGE_INSTANCE (ii); - struct image_instantiator_methods *meths, *device_meths; + Lisp_Object ii = allocate_image_instance (device); + struct image_instantiator_methods *meths; struct gcpro gcpro1; + int methp = 0; GCPRO1 (ii); - 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. */ - 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))) + + /* 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))) signal_simple_error ("Don't know how to instantiate this image instantiator?", instantiator); - - /* 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), 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), 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); + MAYBE_IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, + pointer_bg, dest_mask, domain)); + UNGCPRO; + + return ii; } @@ -740,66 +576,40 @@ Lisp_Object Qimage_instancep; static Lisp_Object -mark_image_instance (Lisp_Object obj) +mark_image_instance (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - 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); - /* 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. */ + struct Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); + + markobj (i->name); switch (IMAGE_INSTANCE_TYPE (i)) { case IMAGE_TEXT: - mark_object (IMAGE_INSTANCE_TEXT_STRING (i)); + markobj (IMAGE_INSTANCE_TEXT_STRING (i)); break; case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: - mark_object (IMAGE_INSTANCE_PIXMAP_FILENAME (i)); - mark_object (IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (i)); - mark_object (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (i)); - mark_object (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (i)); - mark_object (IMAGE_INSTANCE_PIXMAP_FG (i)); - mark_object (IMAGE_INSTANCE_PIXMAP_BG (i)); + markobj (IMAGE_INSTANCE_PIXMAP_FILENAME (i)); + markobj (IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (i)); + markobj (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (i)); + markobj (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (i)); + markobj (IMAGE_INSTANCE_PIXMAP_FG (i)); + markobj (IMAGE_INSTANCE_PIXMAP_BG (i)); break; case IMAGE_WIDGET: - 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_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)); + markobj (IMAGE_INSTANCE_WIDGET_TYPE (i)); + markobj (IMAGE_INSTANCE_WIDGET_PROPS (i)); + markobj (IMAGE_INSTANCE_WIDGET_FACE (i)); + mark_gui_item (&IMAGE_INSTANCE_WIDGET_ITEM (i), markobj); case IMAGE_SUBWINDOW: + markobj (IMAGE_INSTANCE_SUBWINDOW_FRAME (i)); break; default: break; } - /* The image may have been previously finalized (yes that's wierd, - 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)); + MAYBE_DEVMETH (XDEVICE (i->device), mark_image_instance, (i, markobj)); return i->device; } @@ -809,7 +619,7 @@ int escapeflag) { char buf[100]; - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (obj); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (obj); if (print_readably) error ("printing unreadable object #<image-instance 0x%x>", @@ -823,7 +633,7 @@ write_c_string (" ", printcharfun); } write_c_string ("on ", printcharfun); - print_internal (ii->domain, printcharfun, 0); + print_internal (ii->device, printcharfun, 0); write_c_string (" ", printcharfun); switch (IMAGE_INSTANCE_TYPE (ii)) { @@ -897,25 +707,25 @@ break; case IMAGE_WIDGET: - print_internal (IMAGE_INSTANCE_WIDGET_TYPE (ii), printcharfun, 0); - - if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_ITEM (ii))) + if (!NILP (IMAGE_INSTANCE_WIDGET_CALLBACK (ii))) { - write_c_string (" ", printcharfun); - print_internal (IMAGE_INSTANCE_WIDGET_TEXT (ii), printcharfun, 1); + print_internal (IMAGE_INSTANCE_WIDGET_CALLBACK (ii), printcharfun, 0); + write_c_string (", ", printcharfun); } - if (!NILP (IMAGE_INSTANCE_WIDGET_FACE (ii))) { - write_c_string (" face=", printcharfun); + write_c_string (" (", 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: - sprintf (buf, " %dx%d", IMAGE_INSTANCE_WIDTH (ii), - IMAGE_INSTANCE_HEIGHT (ii)); + sprintf (buf, " %dx%d", IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii), + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); write_c_string (buf, printcharfun); /* This is stolen from frame.c. Subwindows are strange in that they @@ -924,25 +734,27 @@ write_c_string (" on #<", printcharfun); { - struct frame* f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); - + struct frame* f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + if (!FRAME_LIVE_P (f)) write_c_string ("dead", printcharfun); - else + else write_c_string (DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))), printcharfun); + + write_c_string ("-frame ", printcharfun); } - write_c_string ("-frame>", printcharfun); + write_c_string (">", printcharfun); sprintf (buf, " 0x%p", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); write_c_string (buf, printcharfun); - + break; default: abort (); } - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), print_image_instance, + MAYBE_DEVMETH (XDEVICE (ii->device), print_image_instance, (ii, printcharfun, escapeflag)); sprintf (buf, " 0x%x>", ii->header.uid); write_c_string (buf, printcharfun); @@ -951,42 +763,36 @@ static void finalize_image_instance (void *header, int for_disksave) { - Lisp_Image_Instance *i = (Lisp_Image_Instance *) header; - - /* objects like this exist at dump time, so don't bomb out. */ - if (IMAGE_INSTANCE_TYPE (i) == IMAGE_NOTHING - || - NILP (IMAGE_INSTANCE_DEVICE (i))) + struct Lisp_Image_Instance *i = (struct Lisp_Image_Instance *) header; + + if (IMAGE_INSTANCE_TYPE (i) == IMAGE_NOTHING) + /* objects like this exist at dump time, so don't bomb out. */ return; if (for_disksave) finalose (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; + /* do this so that the cachels get reset */ + if (IMAGE_INSTANCE_TYPE (i) == IMAGE_WIDGET + || + IMAGE_INSTANCE_TYPE (i) == IMAGE_SUBWINDOW) + { + MARK_FRAME_GLYPHS_CHANGED + (XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (i))); + } + + MAYBE_DEVMETH (XDEVICE (i->device), finalize_image_instance, (i)); } static int image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (obj1); - Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (obj2); - - 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)) + struct Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (obj1); + struct 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)) return 0; if (!internal_equal (IMAGE_INSTANCE_NAME (i1), IMAGE_INSTANCE_NAME (i2), depth + 1)) @@ -1007,10 +813,12 @@ case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: - if (!(IMAGE_INSTANCE_PIXMAP_DEPTH (i1) == + if (!(IMAGE_INSTANCE_PIXMAP_WIDTH (i1) == + IMAGE_INSTANCE_PIXMAP_WIDTH (i2) && + IMAGE_INSTANCE_PIXMAP_HEIGHT (i1) == + IMAGE_INSTANCE_PIXMAP_HEIGHT (i2) && + IMAGE_INSTANCE_PIXMAP_DEPTH (i1) == IMAGE_INSTANCE_PIXMAP_DEPTH (i2) && - IMAGE_INSTANCE_PIXMAP_SLICE (i1) == - IMAGE_INSTANCE_PIXMAP_SLICE (i2) && EQ (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (i1), IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (i2)) && EQ (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (i1), @@ -1026,33 +834,22 @@ case IMAGE_WIDGET: 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) + IMAGE_INSTANCE_WIDGET_TYPE (i2)) && + EQ (IMAGE_INSTANCE_WIDGET_CALLBACK (i1), + IMAGE_INSTANCE_WIDGET_CALLBACK (i2)) && 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) - )) + && internal_equal (IMAGE_INSTANCE_WIDGET_TEXT (i1), + IMAGE_INSTANCE_WIDGET_TEXT (i2), + depth + 1))) return 0; - break; - case IMAGE_SUBWINDOW: - if (!(IMAGE_INSTANCE_SUBWINDOW_ID (i1) == + if (!(IMAGE_INSTANCE_SUBWINDOW_WIDTH (i1) == + IMAGE_INSTANCE_SUBWINDOW_WIDTH (i2) && + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (i1) == + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (i2) && + IMAGE_INSTANCE_SUBWINDOW_ID (i1) == IMAGE_INSTANCE_SUBWINDOW_ID (i2))) return 0; break; @@ -1061,46 +858,15 @@ abort (); } - 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)); + return DEVMETH_OR_GIVEN (d1, image_instance_equal, (i1, i2, depth), 1); } static unsigned long image_instance_hash (Lisp_Object obj, int depth) { - Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); - unsigned long hash = HASH4 (LISP_HASH (IMAGE_INSTANCE_DOMAIN (i)), - IMAGE_INSTANCE_WIDTH (i), - IMAGE_INSTANCE_MARGIN_WIDTH (i), - IMAGE_INSTANCE_HEIGHT (i)); - - ERROR_CHECK_IMAGE_INSTANCE (obj); + struct Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); + struct device *d = XDEVICE (i->device); + unsigned long hash = (unsigned long) d; switch (IMAGE_INSTANCE_TYPE (i)) { @@ -1115,76 +881,50 @@ case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: - hash = HASH4 (hash, IMAGE_INSTANCE_PIXMAP_DEPTH (i), - IMAGE_INSTANCE_PIXMAP_SLICE (i), + hash = HASH5 (hash, IMAGE_INSTANCE_PIXMAP_WIDTH (i), + IMAGE_INSTANCE_PIXMAP_HEIGHT (i), + IMAGE_INSTANCE_PIXMAP_DEPTH (i), internal_hash (IMAGE_INSTANCE_PIXMAP_FILENAME (i), depth + 1)); break; case IMAGE_WIDGET: - /* We need the hash to be equivalent to what should be - displayed. */ - hash = HASH5 (hash, - LISP_HASH (IMAGE_INSTANCE_WIDGET_TYPE (i)), + hash = HASH4 (hash, + internal_hash (IMAGE_INSTANCE_WIDGET_TYPE (i), depth + 1), internal_hash (IMAGE_INSTANCE_WIDGET_PROPS (i), depth + 1), - internal_hash (IMAGE_INSTANCE_WIDGET_ITEMS (i), depth + 1), - internal_hash (IMAGE_INSTANCE_LAYOUT_CHILDREN (i), - depth + 1)); + internal_hash (IMAGE_INSTANCE_WIDGET_CALLBACK (i), depth + 1)); case IMAGE_SUBWINDOW: - hash = HASH2 (hash, (int) IMAGE_INSTANCE_SUBWINDOW_ID (i)); + hash = HASH4 (hash, IMAGE_INSTANCE_SUBWINDOW_WIDTH (i), + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (i), + (int) IMAGE_INSTANCE_SUBWINDOW_ID (i)); break; default: abort (); } - return HASH2 (hash, DEVMETH_OR_GIVEN - (XDEVICE (image_instance_device (obj)), - image_instance_hash, (i, depth), - 0)); + return HASH2 (hash, DEVMETH_OR_GIVEN (d, image_instance_hash, (i, depth), + 0)); } DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, mark_image_instance, print_image_instance, finalize_image_instance, image_instance_equal, - image_instance_hash, 0, - Lisp_Image_Instance); + image_instance_hash, + struct Lisp_Image_Instance); static Lisp_Object -allocate_image_instance (Lisp_Object governing_domain, Lisp_Object glyph) +allocate_image_instance (Lisp_Object device) { - Lisp_Image_Instance *lp = - alloc_lcrecord_type (Lisp_Image_Instance, &lrecord_image_instance); + struct Lisp_Image_Instance *lp = + alloc_lcrecord_type (struct Lisp_Image_Instance, &lrecord_image_instance); Lisp_Object val; zero_lcrecord (lp); - /* It's not possible to simply keep a record of the domain in which - the instance was instantiated. This is because caching may mean - that the domain becomes invalid but the instance remains - 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->device = device; lp->type = IMAGE_NOTHING; lp->name = Qnil; - lp->x_offset = 0; - lp->y_offset = 0; - lp->width = IMAGE_UNSPECIFIED_GEOMETRY; - lp->margin_width = 0; - lp->height = IMAGE_UNSPECIFIED_GEOMETRY; - lp->parent = glyph; - /* So that layouts get done. */ - lp->layout_changed = 1; - lp->initialized = 0; - XSETIMAGE_INSTANCE (val, lp); - MARK_GLYPHS_CHANGED; - return val; } @@ -1228,6 +968,16 @@ } 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 in 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; @@ -1279,7 +1029,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), @@ -1296,7 +1046,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, 'subwindow, and 'widget, depending on how XEmacs was compiled. +'pointer, and 'subwindow, depending on how XEmacs was compiled. */ (image_instance_type)) { @@ -1333,47 +1083,28 @@ } } -/* 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 domain, +make_image_instance_1 (Lisp_Object data, Lisp_Object device, Lisp_Object dest_types) { Lisp_Object ii; struct gcpro gcpro1; int dest_mask; - Lisp_Object governing_domain; - + + XSETDEVICE (device, decode_device (device)); + /* instantiate_image_instantiator() will abort if given an + image instance ... */ 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 (DOMAIN_XDEVICE (domain)), + data = normalize_image_instantiator (data, DEVICE_TYPE (XDEVICE (device)), make_int (dest_mask)); GCPRO1 (data); - /* 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)) + if (VECTORP (data) && EQ (XVECTOR_DATA (data)[0], Qinherit)) signal_simple_error ("Inheritance not allowed here", data); - governing_domain = - get_image_instantiator_governing_domain (data, domain); - ii = instantiate_image_instantiator (governing_domain, domain, data, - Qnil, Qnil, dest_mask, Qnil); + ii = instantiate_image_instantiator (device, device, data, + Qnil, Qnil, dest_mask); RETURN_UNGCPRO (ii); } @@ -1387,7 +1118,7 @@ instances, if you want more control over the instantiation process. DATA is an image instantiator, which describes the image; see -`make-image-specifier' for a description of the allowed values. +`image-specifier-p' 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 @@ -1412,72 +1143,37 @@ 'subwindow A child window that is treated as an image. This allows (e.g.) 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, 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. + Not currently implemented. + +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. 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, domain, dest_types, no_error)) + (data, device, 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, domain, dest_types); + 3, data, device, dest_types); } DEFUN ("image-instance-p", Fimage_instance_p, 1, 1, 0, /* @@ -1496,7 +1192,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); return encode_image_instance_type (XIMAGE_INSTANCE_TYPE (image_instance)); } @@ -1509,20 +1204,6 @@ 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. @@ -1539,27 +1220,26 @@ } DEFUN ("image-instance-property", Fimage_instance_property, 2, 2, 0, /* -Return the given property of the given image instance. +Return the given property of the given image instance. Returns nil if the property or the property method do not exist for -the image instance in the domain. +the image instance in the domain. */ (image_instance, prop)) { - Lisp_Image_Instance* ii; + struct Lisp_Image_Instance* ii; Lisp_Object type, ret; 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 (image_instance), + meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), type, ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, property) - && + && !UNBOUNDP (ret = IIFORMAT_METH (meths, property, (image_instance, prop)))) { return ret; @@ -1577,63 +1257,40 @@ } DEFUN ("set-image-instance-property", Fset_image_instance_property, 3, 3, 0, /* -Set the given property of the given image instance. +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. - -WARNING: If you are thinking about using this function, think again. -You probably want to be using `set-glyph-image' to change the glyph's -specifier. Be especially wary if you are thinking of calling this -function after having called `glyph-image-instance'. Unless you are -absolutely sure what you're doing, pretty much the only legitimate -uses for this function are setting user-specified info in a widget, -such as text in a text field. */ +*/ (image_instance, prop, val)) { - Lisp_Image_Instance* ii; + struct Lisp_Image_Instance* ii; Lisp_Object type, ret; struct image_instantiator_methods* meths; CHECK_IMAGE_INSTANCE (image_instance); - ERROR_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 (image_instance), + meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), type, ERROR_ME_NOT); if (meths && HAS_IIFORMAT_METH_P (meths, set_property) && - !UNBOUNDP (ret = + !UNBOUNDP (ret = IIFORMAT_METH (meths, set_property, (image_instance, prop, val)))) { - val = ret; + return 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)))) { - /* ... 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; - } + return ret; } - /* Make sure the image instance gets redisplayed. */ - set_image_instance_dirty_p (image_instance, 1); - /* Force the glyph to be laid out again. */ - IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; - - MARK_SUBWINDOWS_STATE_CHANGED; - MARK_GLYPHS_CHANGED; - return val; } @@ -1643,7 +1300,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1663,7 +1319,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1684,7 +1339,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1704,16 +1358,17 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: + return make_int (XIMAGE_INSTANCE_PIXMAP_HEIGHT (image_instance)); + case IMAGE_SUBWINDOW: case IMAGE_WIDGET: - return make_int (XIMAGE_INSTANCE_HEIGHT (image_instance)); + return make_int (XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (image_instance)); default: return Qnil; @@ -1726,16 +1381,17 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_POINTER: + return make_int (XIMAGE_INSTANCE_PIXMAP_WIDTH (image_instance)); + case IMAGE_SUBWINDOW: case IMAGE_WIDGET: - return make_int (XIMAGE_INSTANCE_WIDTH (image_instance)); + return make_int (XIMAGE_INSTANCE_SUBWINDOW_WIDTH (image_instance)); default: return Qnil; @@ -1753,7 +1409,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1778,7 +1433,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1800,7 +1454,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1812,7 +1465,7 @@ case IMAGE_WIDGET: return FACE_FOREGROUND ( XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_FRAME + XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance)); default: @@ -1828,7 +1481,6 @@ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1840,7 +1492,7 @@ case IMAGE_WIDGET: return FACE_BACKGROUND ( XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_FRAME + XIMAGE_INSTANCE_SUBWINDOW_FRAME (image_instance)); default: @@ -1862,18 +1514,14 @@ Lisp_Object device; CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); CHECK_COLOR_INSTANCE (foreground); CHECK_COLOR_INSTANCE (background); - device = image_instance_device (image_instance); + device = XIMAGE_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 (XIMAGE_INSTANCE_DOMAIN (image_instance), - Qnil); + new = allocate_image_instance (device); 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 @@ -1884,166 +1532,19 @@ return new; } - -/************************************************************************/ -/* Geometry calculations */ -/************************************************************************/ - -/* Find out desired geometry of the image instance. If there is no - special function then just return the width and / or height. */ -void -image_instance_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 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); - - if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry)) - { - IIFORMAT_METH (meths, query_geometry, (image_instance, width, height, - disp, domain)); - } - else - { - if (width) - *width = IMAGE_INSTANCE_WIDTH (ii); - if (height) - *height = IMAGE_INSTANCE_HEIGHT (ii); - } -} - -/* Layout the image instance using the provided dimensions. Layout - widgets are going to do different kinds of calculations to - determine what size to give things so we could make the layout - 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). */ -void -image_instance_layout (Lisp_Object image_instance, - int width, int height, 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; - - type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); - meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); - - /* If geometry is unspecified then get some reasonable values for it. */ - if (width == IMAGE_UNSPECIFIED_GEOMETRY - || - height == IMAGE_UNSPECIFIED_GEOMETRY) - { - int dwidth = IMAGE_UNSPECIFIED_GEOMETRY; - int dheight = IMAGE_UNSPECIFIED_GEOMETRY; - - /* Get the desired geometry. */ - if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry)) - { - IIFORMAT_METH (meths, query_geometry, (image_instance, &dwidth, &dheight, - IMAGE_DESIRED_GEOMETRY, - domain)); - } - else - { - dwidth = IMAGE_INSTANCE_WIDTH (ii); - dheight = IMAGE_INSTANCE_HEIGHT (ii); - } - - /* Compare with allowed geometry. */ - if (width == IMAGE_UNSPECIFIED_GEOMETRY) - width = dwidth; - if (height == IMAGE_UNSPECIFIED_GEOMETRY) - 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 (IIFORMAT_METH_OR_GIVEN (meths, layout, - (image_instance, width, height, domain), 1)) - /* Do not clear the dirty flag here - redisplay will do this for - us at the end. */ - IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0; -} - -/* - * Mark image instance in W as dirty if (a) W's faces have changed and - * (b) GLYPH_OR_II instance in W is a string. - * - * Return non-zero if instance has been marked dirty. - */ -int -invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w) -{ - if (XFRAME(WINDOW_FRAME(w))->faces_changed) - { - Lisp_Object image = glyph_or_ii; - - if (GLYPHP (glyph_or_ii)) - { - Lisp_Object window; - XSETWINDOW (window, w); - image = glyph_image_instance (glyph_or_ii, window, ERROR_ME_NOT, 1); - } - - if (TEXT_IMAGE_INSTANCEP (image)) - { - 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; - } - } - - return 0; -} - /************************************************************************/ /* 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)); @@ -2064,14 +1565,10 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); if (dest_mask & IMAGE_NOTHING_MASK) - { - IMAGE_INSTANCE_TYPE (ii) = IMAGE_NOTHING; - IMAGE_INSTANCE_HEIGHT (ii) = 0; - IMAGE_INSTANCE_WIDTH (ii) = 0; - } + IMAGE_INSTANCE_TYPE (ii) = IMAGE_NOTHING; else incompatible_image_types (instantiator, dest_mask, IMAGE_NOTHING_MASK); } @@ -2131,153 +1628,25 @@ return IMAGE_TEXT_MASK; } -/* Called from autodetect_instantiate() */ +/* called from autodetect_instantiate() */ void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Object string = find_keyword_in_vector (instantiator, Q_data); - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - - /* Should never get here with a domain other than a window. */ - assert (!NILP (string) && WINDOWP (DOMAIN_WINDOW (domain))); + Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + assert (!NILP (data)); if (dest_mask & IMAGE_TEXT_MASK) { IMAGE_INSTANCE_TYPE (ii) = IMAGE_TEXT; - IMAGE_INSTANCE_TEXT_STRING (ii) = string; + IMAGE_INSTANCE_TEXT_STRING (ii) = data; } else incompatible_image_types (instantiator, dest_mask, IMAGE_TEXT_MASK); } -/* Sort out the size of the text that is being displayed. Calculating - it dynamically allows us to change the text and still see - everything. Note that the following methods are for text not string - since that is what the instantiated type is. The first method is a - helper that is used elsewhere for calculating text geometry. */ -void -query_string_geometry (Lisp_Object string, Lisp_Object face, - 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 = DOMAIN_FRAME (domain); - - /* Compute height */ - if (height) - { - /* Compute string metric info */ - find_charsets_in_bufbyte_string (charsets, - XSTRING_DATA (string), - XSTRING_LENGTH (string)); - - /* Fallback to the default face if none was provided. */ - if (!NILP (face)) - { - reset_face_cachel (&frame_cachel); - update_face_cachel_data (&frame_cachel, frame, face); - cachel = &frame_cachel; - } - else - { - cachel = WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), - DEFAULT_INDEX); - } - - ensure_face_cachel_complete (cachel, domain, charsets); - face_cachel_charset_font_metric_info (cachel, charsets, &fm); - - *height = fm.ascent + fm.descent; - /* #### descent only gets set if we query the height as well. */ - if (descent) - *descent = fm.descent; - } - - /* Compute width */ - if (width) - { - if (!NILP (face)) - *width = redisplay_frame_text_width_string (XFRAME (frame), - face, - 0, string, 0, -1); - else - *width = redisplay_frame_text_width_string (XFRAME (frame), - Vdefault_face, - 0, string, 0, -1); - } -} - -Lisp_Object -query_string_font (Lisp_Object string, Lisp_Object face, Lisp_Object domain) -{ - unsigned char charsets[NUM_LEADING_BYTES]; - struct face_cachel frame_cachel; - struct face_cachel *cachel; - int i; - Lisp_Object frame = DOMAIN_FRAME (domain); - - /* Compute string font info */ - find_charsets_in_bufbyte_string (charsets, - XSTRING_DATA (string), - XSTRING_LENGTH (string)); - - reset_face_cachel (&frame_cachel); - update_face_cachel_data (&frame_cachel, frame, face); - cachel = &frame_cachel; - - ensure_face_cachel_complete (cachel, domain, charsets); - - for (i = 0; i < NUM_LEADING_BYTES; i++) - { - if (charsets[i]) - { - return FACE_CACHEL_FONT (cachel, - CHARSET_BY_LEADING_BYTE (i + - MIN_LEADING_BYTE)); - - } - } - - return Qnil; /* NOT REACHED */ -} - -static void -text_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 descent = 0; - - query_string_geometry (IMAGE_INSTANCE_TEXT_STRING (ii), - IMAGE_INSTANCE_FACE (ii), - width, height, &descent, domain); - - /* The descent gets set as a side effect of querying the - geometry. */ - IMAGE_INSTANCE_TEXT_DESCENT (ii) = descent; -} - -/* 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)) - { - CHECK_STRING (val); - IMAGE_INSTANCE_TEXT_STRING (ii) = val; - - return Qt; - } - return Qunbound; -} - /**************************************************************************** * formatted-string * @@ -2301,12 +1670,20 @@ Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { + Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + assert (!NILP (data)); /* #### implement this */ warn_when_safe (Qunimplemented, Qnotice, "`formatted-string' not yet implemented; assuming `string'"); - - string_instantiate (image_instance, instantiator, - pointer_fg, pointer_bg, dest_mask, domain); + if (dest_mask & IMAGE_TEXT_MASK) + { + IMAGE_INSTANCE_TYPE (ii) = IMAGE_TEXT; + IMAGE_INSTANCE_TEXT_STRING (ii) = data; + } + else + incompatible_image_types (instantiator, dest_mask, IMAGE_TEXT_MASK); } @@ -2470,11 +1847,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; + + GET_C_STRING_FILENAME_DATA_ALLOCA (name, filename_ext); result = read_bitmap_data_from_file (filename_ext, &w, &h, &data, xhot, yhot); @@ -2484,7 +1859,7 @@ int len = (w + 7) / 8 * h; retval = list3 (make_int (w), make_int (h), - make_ext_string (data, len, Qbinary)); + make_ext_string (data, len, FORMAT_BINARY)); XFree ((char *) data); return retval; } @@ -2717,10 +2092,8 @@ char **data; int result; char *fname = 0; - - TO_EXTERNAL_FORMAT (LISP_STRING, name, - C_STRING_ALLOCA, fname, - Qfile_name); + + GET_C_STRING_FILENAME_DATA_ALLOCA (name, fname); result = XpmReadFileToData (fname, &data); if (result == XpmSuccess) @@ -2930,7 +2303,7 @@ static void image_create (Lisp_Object obj) { - Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); + struct Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); IMAGE_SPECIFIER_ALLOWED (image) = ~0; /* all are allowed */ IMAGE_SPECIFIER_ATTACHEE (image) = Qnil; @@ -2938,25 +2311,18 @@ } static void -image_mark (Lisp_Object obj) +image_mark (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); - - mark_object (IMAGE_SPECIFIER_ATTACHEE (image)); - mark_object (IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image)); + struct Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); + + markobj (IMAGE_SPECIFIER_ATTACHEE (image)); + markobj (IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image)); } static Lisp_Object image_instantiate_cache_result (Lisp_Object locative) { - /* 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.*/ + /* locative = (instance instantiator . subtable) */ Fputhash (XCAR (XCDR (locative)), XCAR (locative), XCDR (XCDR (locative))); free_cons (XCONS (XCDR (locative))); free_cons (XCONS (locative)); @@ -2972,22 +2338,17 @@ Lisp_Object domain, Lisp_Object instantiator, Lisp_Object depth) { - Lisp_Object glyph = IMAGE_SPECIFIER_ATTACHEE (XIMAGE_SPECIFIER (specifier)); + Lisp_Object device = DFW_DEVICE (domain); + struct device *d = XDEVICE (device); 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 governing domain and type are + /* make sure that the image instance's device and type are matching. */ - 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)))) + + if (EQ (device, XIMAGE_INSTANCE_DEVICE (instantiator))) { int mask = image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instantiator)); @@ -2998,8 +2359,8 @@ instantiator); } else - signal_simple_error_2 ("Wrong domain for image instance", - instantiator, domain); + signal_simple_error_2 ("Wrong device for image instance", + instantiator, device); } else if (VECTORP (instantiator) && EQ (XVECTOR_DATA (instantiator)[0], Qinherit)) @@ -3011,21 +2372,11 @@ } else { - Lisp_Object instance = Qnil; - Lisp_Object subtable = Qnil; + Lisp_Object instance; + Lisp_Object subtable; 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) { @@ -3034,103 +2385,98 @@ ls3 = list3 (instantiator, pointer_fg, pointer_bg); } - /* First look in the device cache. */ - if (DEVICEP (governing_domain)) + /* First look in the hash table. */ + subtable = Fgethash (make_int (dest_mask), d->image_instance_cache, + Qunbound); + if (UNBOUNDP (subtable)) { - 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, + d->image_instance_cache); + instance = 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)) { - /* 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 : instantiator, - subtable, Qunbound); + if (!WINDOWP (domain)) + signal_simple_error ("Can't instantiate subwindow outside a window", + instantiator); + instance = Fgethash (instantiator, + XWINDOW (domain)->subwindow_instance_cache, + Qunbound); } } - else if (WINDOWP (governing_domain)) - { - /* Subwindows have a per-window cache and have to be treated - differently. */ - instance = - Fgethash (instantiator, - XWINDOW (governing_domain)->subwindow_instance_cache, - Qunbound); - } - else - 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, - DEVICEP (governing_domain) ? subtable - : XWINDOW (governing_domain) - ->subwindow_instance_cache)); + subtable)); 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 (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); - + instance = instantiate_image_instantiator (device, + domain, + instantiator, + pointer_fg, pointer_bg, + dest_mask); + Fsetcar (locative, instance); -#ifdef ERROR_CHECK_GLYPHS + /* only after the image has been instantiated do we know + whether we need to put it in the per-window image instance + cache. */ 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 + & + (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); -#ifdef ERROR_CHECK_GLYPHS - if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) - & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) - assert (EQ (Fgethash ((pointerp ? ls3 : instantiator), - XWINDOW (governing_domain) - ->subwindow_instance_cache, - Qunbound), instance)); -#endif } else free_list (ls3); @@ -3138,14 +2484,7 @@ if (NILP (instance)) signal_simple_error ("Can't instantiate image (probably cached)", instantiator); -#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); + return instance; } abort (); @@ -3232,7 +2571,7 @@ set_image_attached_to (Lisp_Object obj, Lisp_Object face_or_glyph, Lisp_Object property) { - Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); + struct Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); IMAGE_SPECIFIER_ATTACHEE (image) = face_or_glyph; IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image) = property; @@ -3287,79 +2626,170 @@ return retlist; } -/* Copy an image instantiator. We can't use Fcopy_tree since widgets - may contain circular references which would send Fcopy_tree into - infloop death. */ -static Lisp_Object -image_copy_vector_instantiator (Lisp_Object instantiator) -{ - int i; - struct image_instantiator_methods *meths; - Lisp_Object *elt; - int instantiator_len; - - CHECK_VECTOR (instantiator); - - instantiator = Fcopy_sequence (instantiator); - elt = XVECTOR_DATA (instantiator); - instantiator_len = XVECTOR_LENGTH (instantiator); - - meths = decode_image_instantiator_format (elt[0], ERROR_ME); - - for (i = 1; i < instantiator_len; i += 2) - { - int j; - Lisp_Object keyword = elt[i]; - Lisp_Object value = elt[i+1]; - - /* Find the keyword entry. */ - for (j = 0; j < Dynarr_length (meths->keywords); j++) - { - if (EQ (keyword, Dynarr_at (meths->keywords, j).keyword)) - break; - } - - /* Only copy keyword values that should be copied. */ - if (Dynarr_at (meths->keywords, j).copy_p - && - (CONSP (value) || VECTORP (value))) - { - elt [i+1] = Fcopy_tree (value, Qt); - } - } - - return instantiator; -} - -static Lisp_Object -image_copy_instantiator (Lisp_Object arg) -{ - if (CONSP (arg)) - { - Lisp_Object rest; - rest = arg = Fcopy_sequence (arg); - while (CONSP (rest)) - { - Lisp_Object elt = XCAR (rest); - if (CONSP (elt)) - XCAR (rest) = Fcopy_tree (elt, Qt); - else if (VECTORP (elt)) - XCAR (rest) = image_copy_vector_instantiator (elt); - if (VECTORP (XCDR (rest))) /* hack for (a b . [c d]) */ - XCDR (rest) = Fcopy_tree (XCDR (rest), Qt); - rest = XCDR (rest); - } - } - else if (VECTORP (arg)) - { - arg = image_copy_vector_instantiator (arg); - } - return arg; -} - DEFUN ("image-specifier-p", Fimage_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is an image specifier. -See `make-image-specifier' for a description of image instantiators. + +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 <X11/cursorfont.h>] 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 X window; not currently implemented.) +'widget + (A widget control, for instance text field or radio button.) +'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.) + +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). */ (object)) { @@ -3372,14 +2802,14 @@ ****************************************************************************/ static Lisp_Object -mark_glyph (Lisp_Object obj) +mark_glyph (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Glyph *glyph = XGLYPH (obj); - - mark_object (glyph->image); - mark_object (glyph->contrib_p); - mark_object (glyph->baseline); - mark_object (glyph->face); + struct Lisp_Glyph *glyph = XGLYPH (obj); + + markobj (glyph->image); + markobj (glyph->contrib_p); + markobj (glyph->baseline); + markobj (glyph->face); return glyph->plist; } @@ -3387,7 +2817,7 @@ static void print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Glyph *glyph = XGLYPH (obj); + struct Lisp_Glyph *glyph = XGLYPH (obj); char buf[20]; if (print_readably) @@ -3410,8 +2840,8 @@ static int glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Glyph *g1 = XGLYPH (obj1); - Lisp_Glyph *g2 = XGLYPH (obj2); + struct Lisp_Glyph *g1 = XGLYPH (obj1); + struct Lisp_Glyph *g2 = XGLYPH (obj2); depth++; @@ -3436,7 +2866,7 @@ static Lisp_Object glyph_getprop (Lisp_Object obj, Lisp_Object prop) { - Lisp_Glyph *g = XGLYPH (obj); + struct Lisp_Glyph *g = XGLYPH (obj); if (EQ (prop, Qimage)) return g->image; if (EQ (prop, Qcontrib_p)) return g->contrib_p; @@ -3449,9 +2879,9 @@ static int glyph_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) { - if (EQ (prop, Qimage) || - EQ (prop, Qcontrib_p) || - EQ (prop, Qbaseline)) + if ((EQ (prop, Qimage)) || + (EQ (prop, Qcontrib_p)) || + (EQ (prop, Qbaseline))) return 0; if (EQ (prop, Qface)) @@ -3467,9 +2897,9 @@ static int glyph_remprop (Lisp_Object obj, Lisp_Object prop) { - if (EQ (prop, Qimage) || - EQ (prop, Qcontrib_p) || - EQ (prop, Qbaseline)) + if ((EQ (prop, Qimage)) || + (EQ (prop, Qcontrib_p)) || + (EQ (prop, Qbaseline))) return -1; if (EQ (prop, Qface)) @@ -3484,7 +2914,7 @@ static Lisp_Object glyph_plist (Lisp_Object obj) { - Lisp_Glyph *glyph = XGLYPH (obj); + struct Lisp_Glyph *glyph = XGLYPH (obj); Lisp_Object result = glyph->plist; result = cons3 (Qface, glyph->face, result); @@ -3495,21 +2925,12 @@ return result; } -static const struct lrecord_description glyph_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Glyph, image) }, - { XD_LISP_OBJECT, offsetof (Lisp_Glyph, contrib_p) }, - { XD_LISP_OBJECT, offsetof (Lisp_Glyph, baseline) }, - { XD_LISP_OBJECT, offsetof (Lisp_Glyph, face) }, - { XD_LISP_OBJECT, offsetof (Lisp_Glyph, plist) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("glyph", glyph, mark_glyph, print_glyph, 0, - glyph_equal, glyph_hash, glyph_description, + glyph_equal, glyph_hash, glyph_getprop, glyph_putprop, glyph_remprop, glyph_plist, - Lisp_Glyph); + struct Lisp_Glyph); Lisp_Object allocate_glyph (enum glyph_type type, @@ -3518,17 +2939,17 @@ { /* This function can GC */ Lisp_Object obj = Qnil; - Lisp_Glyph *g = alloc_lcrecord_type (Lisp_Glyph, &lrecord_glyph); + struct Lisp_Glyph *g = + alloc_lcrecord_type (struct Lisp_Glyph, &lrecord_glyph); g->type = type; g->image = Fmake_specifier (Qimage); /* This function can GC */ - g->dirty = 0; switch (g->type) { case GLYPH_BUFFER: XIMAGE_SPECIFIER_ALLOWED (g->image) = - IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK - | IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK + IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK + | IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK; break; case GLYPH_POINTER: @@ -3537,8 +2958,7 @@ break; case GLYPH_ICON: XIMAGE_SPECIFIER_ALLOWED (g->image) = - IMAGE_NOTHING_MASK | IMAGE_MONO_PIXMAP_MASK - | IMAGE_COLOR_PIXMAP_MASK; + IMAGE_NOTHING_MASK | IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK; break; default: abort (); @@ -3644,13 +3064,11 @@ DEFUN ("glyphp", Fglyphp, 1, 1, 0, /* Return non-nil if OBJECT is a glyph. -A glyph is an object used for pixmaps, widgets and the like. It is used +A glyph is an object used for pixmaps 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. 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. +buttons, and the like. Its image is described using an image specifier -- +see `image-specifier-p'. */ (object)) { @@ -3673,54 +3091,68 @@ } } -Lisp_Object -glyph_image_instance (Lisp_Object glyph, Lisp_Object domain, - Error_behavior errb, int no_quit) -{ - Lisp_Object specifier = GLYPH_IMAGE (XGLYPH (glyph)); - - /* This can never return Qunbound. All glyphs have 'nothing as - a fallback. */ - Lisp_Object image_instance = specifier_instance (specifier, Qunbound, - domain, errb, no_quit, 0, - Qzero); - assert (!UNBOUNDP (image_instance)); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); - - return image_instance; -} - -static Lisp_Object -glyph_image_instance_maybe (Lisp_Object glyph_or_image, Lisp_Object window) -{ - Lisp_Object instance = glyph_or_image; - - if (GLYPHP (glyph_or_image)) - instance = glyph_image_instance (glyph_or_image, window, ERROR_ME_NOT, 1); - - return instance; -} - /***************************************************************************** glyph_width - Return the width of the given GLYPH on the given WINDOW. - Calculations are done based on recursively querying the geometry of - the associated image instances. + Return the width of the given GLYPH on the given WINDOW. If the + instance is a string then the width is calculated using the font of + the given FACE, unless a face is defined by the glyph itself. ****************************************************************************/ unsigned short -glyph_width (Lisp_Object glyph_or_image, Lisp_Object domain) +glyph_width (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window) { - Lisp_Object instance = glyph_image_instance_maybe (glyph_or_image, - domain); + Lisp_Object instance; + Lisp_Object frame = XWINDOW (window)->frame; + + /* #### We somehow need to distinguish between the user causing this + error condition and a bug causing it. */ + if (!GLYPHP (glyph)) + return 0; + else + instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1); + if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); - - return XIMAGE_INSTANCE_WIDTH (instance); + switch (XIMAGE_INSTANCE_TYPE (instance)) + { + case IMAGE_TEXT: + { + Lisp_Object str = XIMAGE_INSTANCE_TEXT_STRING (instance); + Lisp_Object private_face = XGLYPH_FACE(glyph); + + if (!NILP (private_face)) + return redisplay_frame_text_width_string (XFRAME (frame), + private_face, + 0, str, 0, -1); + else + if (!NILP (frame_face)) + return redisplay_frame_text_width_string (XFRAME (frame), + frame_face, + 0, str, 0, -1); + else + return redisplay_text_width_string (XWINDOW (window), + window_findex, + 0, str, 0, -1); + } + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + case IMAGE_POINTER: + return XIMAGE_INSTANCE_PIXMAP_WIDTH (instance); + + case IMAGE_NOTHING: + return 0; + + case IMAGE_SUBWINDOW: + case IMAGE_WIDGET: + return XIMAGE_INSTANCE_SUBWINDOW_WIDTH (instance); + + default: + abort (); + return 0; + } } DEFUN ("glyph-width", Fglyph_width, 1, 2, 0, /* @@ -3733,60 +3165,127 @@ XSETWINDOW (window, decode_window (window)); CHECK_GLYPH (glyph); - return make_int (glyph_width (glyph, window)); + return make_int (glyph_width (glyph, Qnil, DEFAULT_INDEX, window)); +} + +#define RETURN_ASCENT 0 +#define RETURN_DESCENT 1 +#define RETURN_HEIGHT 2 + +Lisp_Object +glyph_image_instance (Lisp_Object glyph, Lisp_Object domain, + Error_behavior errb, int no_quit) +{ + Lisp_Object specifier = GLYPH_IMAGE (XGLYPH (glyph)); + + /* This can never return Qunbound. All glyphs have 'nothing as + a fallback. */ + return specifier_instance (specifier, Qunbound, domain, errb, no_quit, 0, + Qzero); +} + +static unsigned short +glyph_height_internal (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window, + int function) +{ + Lisp_Object instance; + Lisp_Object frame = XWINDOW (window)->frame; + + if (!GLYPHP (glyph)) + return 0; + else + instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1); + + if (!IMAGE_INSTANCEP (instance)) + return 0; + + switch (XIMAGE_INSTANCE_TYPE (instance)) + { + case IMAGE_TEXT: + { + struct font_metric_info fm; + Lisp_Object string = XIMAGE_INSTANCE_TEXT_STRING (instance); + unsigned char charsets[NUM_LEADING_BYTES]; + struct face_cachel frame_cachel; + struct face_cachel *cachel; + + find_charsets_in_bufbyte_string (charsets, + XSTRING_DATA (string), + XSTRING_LENGTH (string)); + + if (!NILP (frame_face)) + { + reset_face_cachel (&frame_cachel); + update_face_cachel_data (&frame_cachel, frame, frame_face); + cachel = &frame_cachel; + } + else + cachel = WINDOW_FACE_CACHEL (XWINDOW (window), window_findex); + ensure_face_cachel_complete (cachel, window, charsets); + + face_cachel_charset_font_metric_info (cachel, charsets, &fm); + + switch (function) + { + case RETURN_ASCENT: return fm.ascent; + case RETURN_DESCENT: return fm.descent; + case RETURN_HEIGHT: return fm.ascent + fm.descent; + default: + abort (); + return 0; /* not reached */ + } + } + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + case IMAGE_POINTER: + /* #### Ugh ugh ugh -- temporary crap */ + if (function == RETURN_ASCENT || function == RETURN_HEIGHT) + return XIMAGE_INSTANCE_PIXMAP_HEIGHT (instance); + else + return 0; + + case IMAGE_NOTHING: + return 0; + + case IMAGE_SUBWINDOW: + case IMAGE_WIDGET: + /* #### Ugh ugh ugh -- temporary crap */ + if (function == RETURN_ASCENT || function == RETURN_HEIGHT) + return XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (instance); + else + return 0; + + default: + abort (); + return 0; + } } unsigned short -glyph_ascent (Lisp_Object glyph_or_image, Lisp_Object domain) +glyph_ascent (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window) { - Lisp_Object instance = glyph_image_instance_maybe (glyph_or_image, - domain); - if (!IMAGE_INSTANCEP (instance)) - return 0; - - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); - - if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT) - return XIMAGE_INSTANCE_TEXT_ASCENT (instance); - else - return XIMAGE_INSTANCE_HEIGHT (instance); + return glyph_height_internal (glyph, frame_face, window_findex, window, + RETURN_ASCENT); } unsigned short -glyph_descent (Lisp_Object glyph_or_image, Lisp_Object domain) +glyph_descent (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window) { - Lisp_Object instance = glyph_image_instance_maybe (glyph_or_image, - domain); - if (!IMAGE_INSTANCEP (instance)) - return 0; - - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); - - if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT) - return XIMAGE_INSTANCE_TEXT_DESCENT (instance); - else - return 0; + return glyph_height_internal (glyph, frame_face, window_findex, window, + RETURN_DESCENT); } /* strictly a convenience function. */ unsigned short -glyph_height (Lisp_Object glyph_or_image, Lisp_Object domain) +glyph_height (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window) { - Lisp_Object instance = glyph_image_instance_maybe (glyph_or_image, - domain); - - if (!IMAGE_INSTANCEP (instance)) - return 0; - - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, domain); - - return XIMAGE_INSTANCE_HEIGHT (instance); + return glyph_height_internal (glyph, frame_face, window_findex, window, + RETURN_HEIGHT); } DEFUN ("glyph-ascent", Fglyph_ascent, 1, 2, 0, /* @@ -3799,7 +3298,7 @@ XSETWINDOW (window, decode_window (window)); CHECK_GLYPH (glyph); - return make_int (glyph_ascent (glyph, window)); + return make_int (glyph_ascent (glyph, Qnil, DEFAULT_INDEX, window)); } DEFUN ("glyph-descent", Fglyph_descent, 1, 2, 0, /* @@ -3812,7 +3311,7 @@ XSETWINDOW (window, decode_window (window)); CHECK_GLYPH (glyph); - return make_int (glyph_descent (glyph, window)); + return make_int (glyph_descent (glyph, Qnil, DEFAULT_INDEX, window)); } /* This is redundant but I bet a lot of people expect it to exist. */ @@ -3826,45 +3325,12 @@ XSETWINDOW (window, decode_window (window)); CHECK_GLYPH (glyph); - return make_int (glyph_height (glyph, window)); + return make_int (glyph_height (glyph, Qnil, DEFAULT_INDEX, window)); } -static void -set_glyph_dirty_p (Lisp_Object glyph_or_image, Lisp_Object window, int dirty) -{ - Lisp_Object instance = glyph_or_image; - - if (!NILP (glyph_or_image)) - { - if (GLYPHP (glyph_or_image)) - { - instance = glyph_image_instance (glyph_or_image, window, - ERROR_ME_NOT, 1); - 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; - } -} +#undef RETURN_ASCENT +#undef RETURN_DESCENT +#undef RETURN_HEIGHT /* #### do we need to cache this info to speed things up? */ @@ -3920,51 +3386,20 @@ (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, - 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); - - 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) -{ - 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 - /***************************************************************************** * glyph cachel functions * *****************************************************************************/ -/* #### 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. */ +/* + #### All of this is 95% copied from face cachels. + Consider consolidating. + #### We need to add a dirty flag to the glyphs. + */ + void -mark_glyph_cachels (glyph_cachel_dynarr *elements) +mark_glyph_cachels (glyph_cachel_dynarr *elements, + void (*markobj) (Lisp_Object)) { int elt; @@ -3974,7 +3409,7 @@ for (elt = 0; elt < Dynarr_length (elements); elt++) { struct glyph_cachel *cachel = Dynarr_atp (elements, elt); - mark_object (cachel->glyph); + markobj (cachel->glyph); } } @@ -3982,32 +3417,19 @@ update_glyph_cachel_data (struct window *w, Lisp_Object glyph, struct glyph_cachel *cachel) { - if (!cachel->updated || NILP (cachel->glyph) || !EQ (cachel->glyph, glyph) - || XGLYPH_DIRTYP (cachel->glyph) - || XFRAME(WINDOW_FRAME(w))->faces_changed) + /* #### This should be || !cachel->updated */ + if (NILP (cachel->glyph) || !EQ (cachel->glyph, glyph)) { - Lisp_Object window, instance; + Lisp_Object window; XSETWINDOW (window, w); + /* #### This could be sped up if we redid things to grab the glyph + instantiation and passed it to the size functions. */ cachel->glyph = glyph; - /* Speed things up slightly by grabbing the glyph instantiation - 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); - - /* #### Do the following 2 lines buy us anything? --kkm */ - XGLYPH_DIRTYP (glyph) = XIMAGE_INSTANCE_DIRTYP (instance); - cachel->dirty = XGLYPH_DIRTYP (glyph); - cachel->width = glyph_width (instance, window); - cachel->ascent = glyph_ascent (instance, window); - cachel->descent = glyph_descent (instance, window); + cachel->width = glyph_width (glyph, Qnil, DEFAULT_INDEX, window); + cachel->ascent = glyph_ascent (glyph, Qnil, DEFAULT_INDEX, window); + cachel->descent = glyph_descent (glyph, Qnil, DEFAULT_INDEX, window); } cachel->updated = 1; @@ -4025,7 +3447,7 @@ Dynarr_add (w->glyph_cachels, new_cachel); } -glyph_index +static glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph) { int elt; @@ -4040,7 +3462,8 @@ if (EQ (cachel->glyph, glyph) && !NILP (glyph)) { - update_glyph_cachel_data (w, glyph, cachel); + if (!cachel->updated) + update_glyph_cachel_data (w, glyph, cachel); return elt; } } @@ -4083,24 +3506,7 @@ #undef FROB for (elt = 0; elt < Dynarr_length (w->glyph_cachels); elt++) - { - Dynarr_atp (w->glyph_cachels, elt)->updated = 0; - } -} - -/* Unset the dirty bit on all the glyph cachels that have it. */ -void -mark_glyph_cachels_as_clean (struct window* w) -{ - int elt; - Lisp_Object window; - XSETWINDOW (window, w); - for (elt = 0; elt < Dynarr_length (w->glyph_cachels); elt++) - { - struct glyph_cachel *cachel = Dynarr_atp (w->glyph_cachels, elt); - cachel->dirty = 0; - set_glyph_dirty_p (cachel->glyph, window, 0); - } + Dynarr_atp (w->glyph_cachels, elt)->updated = 0; } #ifdef MEMORY_USAGE_STATS @@ -4124,7 +3530,7 @@ /***************************************************************************** * subwindow cachel functions * *****************************************************************************/ -/* Subwindows are curious in that you have to physically unmap them to +/* subwindows are curious in that you have to physically unmap them to not display them. It is problematic deciding what to do in redisplay. We have two caches - a per-window instance cache that keeps track of subwindows on a window, these are linked to their @@ -4133,179 +3539,115 @@ 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. This is a weak list so unreference instances - will get deleted properly. */ + subwindow_cachels. The question is should we just not mark + instances in the subwindow_cachelsnor 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, + void (*markobj) (Lisp_Object)) +{ + int elt; + + if (!elements) + return; + + for (elt = 0; elt < Dynarr_length (elements); elt++) + { + struct subwindow_cachel *cachel = Dynarr_atp (elements, elt); + markobj (cachel->subwindow); + } +} + +static void +update_subwindow_cachel_data (struct frame *f, Lisp_Object subwindow, + struct subwindow_cachel *cachel) +{ + if (NILP (cachel->subwindow) || !EQ (cachel->subwindow, subwindow)) + { + 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; +} /* 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 */ - -/* 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 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. */ void -free_frame_subwindow_instance_cache (struct frame* f) +reset_subwindow_cachels (struct frame *f) { - Lisp_Object rest; - - LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) - { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest)); - /* Make sure that the subwindow is unmapped so that window - deletion will not try and do it again. */ - unmap_subwindow (XCAR (rest)); - finalize_image_instance (ii, 0); - } -} - -/* Unmap and remove all instances from 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); - /* Make sure that the subwindow is unmapped so that window - deletion will not try and do it again. */ - unmap_subwindow (value); - XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)) - = delq_no_quit (value, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))); - } -} - -/***************************************************************************** - * subwindow exposure ignorance * - *****************************************************************************/ -/* when we unmap subwindows the associated window system will generate - expose events. This we do not want as redisplay already copes with - the repainting necessary. Worse, we can get in an endless cycle of - redisplay if we are not careful. Thus we keep a per-frame list of - expose events that are going to come and ignore them as - required. */ - -struct expose_ignore_blocktype -{ - Blocktype_declare (struct expose_ignore); -} *the_expose_ignore_blocktype; - -int -check_for_ignored_expose (struct frame* f, int x, int y, int width, int height) -{ - struct expose_ignore *ei, *prev; - /* the ignore list is FIFO so we should generally get a match with - the first element in the list */ - for (ei = f->subwindow_exposures, prev = 0; ei; ei = ei->next) + int elt; + for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) { - /* 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 give us what we want.*/ - if (ei->x <= x && ei->y <= y - && ei->x + ei->width >= x + width - && ei->y + ei->height >= y + height) + struct subwindow_cachel *cachel = + Dynarr_atp (f->subwindow_cachels, elt); + + if (!NILP (cachel->subwindow) && cachel->being_displayed) { -#ifdef DEBUG_WIDGETS - stderr_out ("ignored %d+%d, %dx%d for exposure %d+%d, %dx%d\n", - x, y, width, height, ei->x, ei->y, ei->width, ei->height); -#endif - if (!prev) - f->subwindow_exposures = ei->next; - else - prev->next = ei->next; - - if (ei == f->subwindow_exposures_tail) - f->subwindow_exposures_tail = prev; - - Blocktype_free (the_expose_ignore_blocktype, ei); - return 1; - } - prev = ei; - } - return 0; -} - -static void -register_ignored_expose (struct frame* f, int x, int y, int width, int height) -{ - if (!hold_ignored_expose_registration) - { - struct expose_ignore *ei; - - ei = Blocktype_alloc (the_expose_ignore_blocktype); - - ei->next = NULL; - ei->x = x; - ei->y = y; - ei->width = width; - ei->height = height; - - /* we have to add the exposure to the end of the list, since we - want to check the oldest events first. for speed we keep a record - of the end so that we can add right to it. */ - if (f->subwindow_exposures_tail) - { - f->subwindow_exposures_tail->next = ei; - } - if (!f->subwindow_exposures) - { - f->subwindow_exposures = ei; - } - f->subwindow_exposures_tail = ei; - } -} - -/**************************************************************************** - find_matching_subwindow - - See if there is a subwindow that completely encloses the requested - area. - ****************************************************************************/ -int find_matching_subwindow (struct frame* f, int x, int y, int width, int height) -{ - Lisp_Object rest; - - LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) - { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest)); - - if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) - && - IMAGE_INSTANCE_DISPLAY_X (ii) <= x - && - IMAGE_INSTANCE_DISPLAY_Y (ii) <= y - && - IMAGE_INSTANCE_DISPLAY_X (ii) - + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) >= x + width - && - IMAGE_INSTANCE_DISPLAY_Y (ii) - + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) >= y + height) - { - return 1; + struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (cachel->subwindow); + MAYBE_DEVMETH (XDEVICE (f->device), unmap_subwindow, (ii)); } } - return 0; + Dynarr_reset (f->subwindow_cachels); +} + +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; } @@ -4313,164 +3655,89 @@ * subwindow functions * *****************************************************************************/ -/* Update the displayed characteristics of a subwindow. This function - should generally only get called if the subwindow is actually - dirty. */ -void +/* update the displayed characteristics of a subwindow */ +static void update_subwindow (Lisp_Object subwindow) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - 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)) - update_widget (subwindow); - /* Reset the changed flags. */ - IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0; - IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (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), - update_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); + struct 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)); } -int -image_instance_changed (Lisp_Object subwindow) +void +update_frame_subwindows (struct frame *f) { - 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)))) - return 1; - else - return 0; -} - -/* Update all the subwindows on a frame. */ -void -update_widget_instances (Lisp_Object frame) -{ - struct frame* f; - Lisp_Object rest; - - /* Its possible for the preceeding 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); - } - } + int elt; + + if (f->subwindows_changed || f->glyphs_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); + } + } } /* remove a subwindow from its frame */ void unmap_subwindow (Lisp_Object subwindow) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); + struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); + int elt; + struct subwindow_cachel* cachel; struct frame* f; - ERROR_CHECK_IMAGE_INSTANCE (subwindow); - - if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK) + if (!(IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET + || + IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW) || - !IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)) + NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))) return; -#ifdef DEBUG_WIDGETS - stderr_out ("unmapping subwindow %d\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); -#endif - f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); - - /* make sure we don't get expose events */ - register_ignored_expose (f, IMAGE_INSTANCE_DISPLAY_X (ii), - IMAGE_INSTANCE_DISPLAY_Y (ii), - IMAGE_INSTANCE_DISPLAY_WIDTH (ii), - IMAGE_INSTANCE_DISPLAY_HEIGHT (ii)); + f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); + elt = get_subwindow_cachel_index (f, subwindow); + cachel = Dynarr_atp (f->subwindow_cachels, elt); + + cachel->x = -1; + cachel->y = -1; + cachel->being_displayed = 0; IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0; - MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)), - unmap_subwindow, (ii)); + MAYBE_DEVMETH (XDEVICE (ii->device), unmap_subwindow, (ii)); } /* show a subwindow in its frame */ -void map_subwindow (Lisp_Object subwindow, int x, int y, - struct display_glyph_area *dga) +void map_subwindow (Lisp_Object subwindow, int x, int y) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); + struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); + int elt; + struct subwindow_cachel* cachel; struct frame* f; - ERROR_CHECK_IMAGE_INSTANCE (subwindow); - - if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) + if (!(IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET + || + IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW) + || + NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))) return; -#ifdef DEBUG_WIDGETS - stderr_out ("mapping subwindow %d, %dx%d@%d+%d\n", - IMAGE_INSTANCE_SUBWINDOW_ID (ii), - dga->width, dga->height, x, y); -#endif - f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); + f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1; - 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)); + elt = get_subwindow_cachel_index (f, subwindow); + cachel = Dynarr_atp (f->subwindow_cachels, elt); + cachel->x = x; + cachel->y = y; + cachel->being_displayed = 1; + + MAYBE_DEVMETH (XDEVICE (ii->device), map_subwindow, (ii, x, y)); } static int @@ -4479,64 +3746,53 @@ 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, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, Lisp_Object domain) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object device = image_instance_device (image_instance); - Lisp_Object frame = DOMAIN_FRAME (domain); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); + Lisp_Object frame = FW_FRAME (domain); Lisp_Object width = find_keyword_in_vector (instantiator, Q_pixel_width); Lisp_Object height = find_keyword_in_vector (instantiator, Q_pixel_height); if (NILP (frame)) signal_simple_error ("No selected frame", device); - + if (!(dest_mask & IMAGE_SUBWINDOW_MASK)) incompatible_image_types (instantiator, dest_mask, IMAGE_SUBWINDOW_MASK); ii->data = 0; IMAGE_INSTANCE_SUBWINDOW_ID (ii) = 0; + IMAGE_INSTANCE_SUBWINDOW_FRAME (ii) = Qnil; IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0; - - if (INTP (width)) + IMAGE_INSTANCE_SUBWINDOW_FRAME (ii) = frame; + + /* this stuff may get overidden by the widget code */ + if (NILP (width)) + IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20; + else { int w = 1; + CHECK_INT (width); if (XINT (width) > 1) w = XINT (width); - IMAGE_INSTANCE_WIDTH (ii) = w; - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = w; } - - if (INTP (height)) + if (NILP (height)) + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20; + else { int h = 1; + CHECK_INT (height); if (XINT (height) > 1) h = XINT (height); - IMAGE_INSTANCE_HEIGHT (ii) = h; - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = h; } } -/* 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. */ @@ -4552,7 +3808,7 @@ (subwindow)) { CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); - return make_int ((int) XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow)); + return make_int ((int) (XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow))); } DEFUN ("resize-subwindow", Fresize_subwindow, 1, 3, 0, /* @@ -4562,26 +3818,25 @@ (subwindow, width, height)) { int neww, newh; - Lisp_Image_Instance* ii; CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); - ii = XIMAGE_INSTANCE (subwindow); if (NILP (width)) - neww = IMAGE_INSTANCE_WIDTH (ii); + neww = XIMAGE_INSTANCE_SUBWINDOW_WIDTH (subwindow); else neww = XINT (width); if (NILP (height)) - newh = IMAGE_INSTANCE_HEIGHT (ii); + newh = XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (subwindow); else newh = XINT (height); - /* The actual resizing gets done asychronously by - update_subwindow. */ - IMAGE_INSTANCE_HEIGHT (ii) = newh; - IMAGE_INSTANCE_WIDTH (ii) = neww; - IMAGE_INSTANCE_SIZE_CHANGED (ii) = 1; + + MAYBE_DEVMETH (XDEVICE (XIMAGE_INSTANCE_DEVICE (subwindow)), + resize_subwindow, (XIMAGE_INSTANCE (subwindow), neww, newh)); + + XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (subwindow) = newh; + XIMAGE_INSTANCE_SUBWINDOW_WIDTH (subwindow) = neww; return subwindow; } @@ -4592,9 +3847,9 @@ (subwindow)) { CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); -#if 0 + map_subwindow (subwindow, 0, 0); -#endif + return subwindow; } @@ -4680,82 +3935,6 @@ abort (); } } - -/***************************************************************************** - * timeouts for animated glyphs * - *****************************************************************************/ -static Lisp_Object Qglyph_animated_timeout_handler; - -DEFUN ("glyph-animated-timeout-handler", Fglyph_animated_timeout_handler, 1, 1, 0, /* -Callback function for updating animated images. -Don't use this. -*/ - (arg)) -{ - CHECK_WEAK_LIST (arg); - - if (!NILP (XWEAK_LIST_LIST (arg)) && !NILP (XCAR (XWEAK_LIST_LIST (arg)))) - { - Lisp_Object value = XCAR (XWEAK_LIST_LIST (arg)); - - if (IMAGE_INSTANCEP (value)) - { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (value); - - if (COLOR_PIXMAP_IMAGE_INSTANCEP (value) - && - IMAGE_INSTANCE_PIXMAP_MAXSLICE (ii) > 1 - && - !disable_animated_pixmaps) - { - /* Increment the index of the image slice we are currently - viewing. */ - IMAGE_INSTANCE_PIXMAP_SLICE (ii) = - (IMAGE_INSTANCE_PIXMAP_SLICE (ii) + 1) - % IMAGE_INSTANCE_PIXMAP_MAXSLICE (ii); - /* We might need to kick redisplay at this point - but we - also might not. */ - MARK_DEVICE_FRAMES_GLYPHS_CHANGED - (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); - } - } - } - return Qnil; -} - -Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object image) -{ - Lisp_Object ret = Qnil; - - if (tickms > 0 && IMAGE_INSTANCEP (image)) - { - double ms = ((double)tickms) / 1000.0; - struct gcpro gcpro1; - Lisp_Object holder = make_weak_list (WEAK_LIST_SIMPLE); - - GCPRO1 (holder); - XWEAK_LIST_LIST (holder) = Fcons (image, Qnil); - - ret = Fadd_timeout (make_float (ms), - Qglyph_animated_timeout_handler, - holder, make_float (ms)); - - UNGCPRO; - } - return ret; -} - -void disable_glyph_animated_timeout (int i) -{ - Lisp_Object id; - XSETINT (id, i); - - Fdisable_timeout (id); -} - /***************************************************************************** * initialization * @@ -4764,9 +3943,6 @@ void syms_of_glyphs (void) { - INIT_LRECORD_IMPLEMENTATION (glyph); - INIT_LRECORD_IMPLEMENTATION (image_instance); - /* image instantiators */ DEFSUBR (Fimage_instantiator_format_list); @@ -4814,7 +3990,6 @@ 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); @@ -4866,12 +4041,6 @@ /* 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"); - DEFSUBR (Fglyph_animated_timeout_handler); - /* Errors */ deferror (&Qimage_conversion_error, "image-conversion-error", @@ -4879,12 +4048,6 @@ } -static const struct lrecord_description image_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct image_specifier, attachee) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct image_specifier, attachee_property) }, - { XD_END } -}; - void specifier_type_create_image (void) { @@ -4898,72 +4061,9 @@ SPECIFIER_HAS_METHOD (image, validate); SPECIFIER_HAS_METHOD (image, after_change); SPECIFIER_HAS_METHOD (image, going_to_add); - SPECIFIER_HAS_METHOD (image, copy_instantiator); } void -reinit_specifier_type_create_image (void) -{ - REINITIALIZE_SPECIFIER_TYPE (image); -} - - -static const struct lrecord_description iike_description_1[] = { - { XD_LISP_OBJECT, offsetof (ii_keyword_entry, keyword) }, - { XD_END } -}; - -static const struct struct_description iike_description = { - sizeof (ii_keyword_entry), - iike_description_1 -}; - -static const struct lrecord_description iiked_description_1[] = { - XD_DYNARR_DESC (ii_keyword_entry_dynarr, &iike_description), - { XD_END } -}; - -static const struct struct_description iiked_description = { - sizeof (ii_keyword_entry_dynarr), - iiked_description_1 -}; - -static const struct lrecord_description iife_description_1[] = { - { XD_LISP_OBJECT, offsetof (image_instantiator_format_entry, symbol) }, - { XD_LISP_OBJECT, offsetof (image_instantiator_format_entry, device) }, - { XD_STRUCT_PTR, offsetof (image_instantiator_format_entry, meths), 1, &iim_description }, - { XD_END } -}; - -static const struct struct_description iife_description = { - sizeof (image_instantiator_format_entry), - iife_description_1 -}; - -static const struct lrecord_description iifed_description_1[] = { - XD_DYNARR_DESC (image_instantiator_format_entry_dynarr, &iife_description), - { XD_END } -}; - -static const struct struct_description iifed_description = { - sizeof (image_instantiator_format_entry_dynarr), - iifed_description_1 -}; - -static const struct lrecord_description iim_description_1[] = { - { XD_LISP_OBJECT, offsetof (struct image_instantiator_methods, symbol) }, - { XD_LISP_OBJECT, offsetof (struct image_instantiator_methods, device) }, - { XD_STRUCT_PTR, offsetof (struct image_instantiator_methods, keywords), 1, &iiked_description }, - { XD_STRUCT_PTR, offsetof (struct image_instantiator_methods, consoles), 1, &cted_description }, - { XD_END } -}; - -const struct struct_description iim_description = { - sizeof(struct image_instantiator_methods), - iim_description_1 -}; - -void image_instantiator_format_create (void) { /* image instantiators */ @@ -4974,8 +4074,6 @@ Vimage_instantiator_format_list = Qnil; staticpro (&Vimage_instantiator_format_list); - dumpstruct (&the_image_instantiator_format_entry_dynarr, &iifed_description); - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (nothing, "nothing"); IIFORMAT_HAS_METHOD (nothing, possible_dest_types); @@ -4993,37 +4091,23 @@ 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, query_geometry); INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (formatted_string, "formatted-string"); IIFORMAT_HAS_METHOD (formatted_string, validate); IIFORMAT_HAS_METHOD (formatted_string, possible_dest_types); 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); @@ -5073,27 +4157,15 @@ } void -reinit_vars_of_glyphs (void) -{ - the_expose_ignore_blocktype = - Blocktype_new (struct expose_ignore_blocktype); - - hold_ignored_expose_registration = 0; -} - - -void vars_of_glyphs (void) { - reinit_vars_of_glyphs (); - Vthe_nothing_vector = vector1 (Qnothing); staticpro (&Vthe_nothing_vector); /* image instances */ - Vimage_instance_type_list = Fcons (Qnothing, - list6 (Qtext, Qmono_pixmap, Qcolor_pixmap, + Vimage_instance_type_list = Fcons (Qnothing, + list6 (Qtext, Qmono_pixmap, Qcolor_pixmap, Qpointer, Qsubwindow, Qwidget)); staticpro (&Vimage_instance_type_list); @@ -5152,12 +4224,6 @@ #ifdef HAVE_XFACE Fprovide (Qxface); #endif - - DEFVAR_BOOL ("disable-animated-pixmaps", &disable_animated_pixmaps /* -Whether animated pixmaps should be animated. -Default is t. -*/); - disable_animated_pixmaps = 0; } void @@ -5170,59 +4236,19 @@ DEFVAR_SPECIFIER ("current-display-table", &Vcurrent_display_table /* *The display table currently in use. This is a specifier; use `set-specifier' to change it. - -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. +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. */ ); Vcurrent_display_table = Fmake_specifier (Qdisplay_table); set_specifier_fallback (Vcurrent_display_table, list1 (Fcons (Qnil, Qnil))); set_specifier_caching (Vcurrent_display_table, - offsetof (struct window, display_table), + slot_offset (struct window, + display_table), some_window_value_changed, 0, 0); } diff -r 12e008d41344 -r 697ef44129c6 src/glyphs.h --- a/src/glyphs.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/glyphs.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_glyphs_h_ -#define INCLUDED_glyphs_h_ +#ifndef _XEMACS_GLYPHS_H_ +#define _XEMACS_GLYPHS_H_ #include "specifier.h" #include "gui.h" @@ -50,21 +50,16 @@ tiff color-pixmap bmp color-pixmap cursor-font pointer - mswindows-resource pointer, color-pixmap + mswindows-resource pointer font pointer subwindow subwindow inherit mono-pixmap autodetect mono-pixmap, color-pixmap, pointer, text - button widget - edit-field widget - combo-box widget - progress-gauge widget - tab-control widget - tree-view widget + button widget + edit widget + combo widget scrollbar widget - label widget - layout widget - native-layout widget + static widget */ /* These are methods specific to a particular format of image instantiator @@ -76,7 +71,6 @@ Lisp_Object keyword; void (*validate) (Lisp_Object data); int multiple_p; - int copy_p; }; typedef struct @@ -84,28 +78,6 @@ Dynarr_declare (ii_keyword_entry); } ii_keyword_entry_dynarr; -extern const struct struct_description iim_description; - -enum image_instance_geometry -{ - IMAGE_GEOMETRY, - IMAGE_DESIRED_GEOMETRY, - IMAGE_MIN_GEOMETRY, - IMAGE_MAX_GEOMETRY -}; - -#define IMAGE_UNSPECIFIED_GEOMETRY -1 - -#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; @@ -113,8 +85,6 @@ Lisp_Object device; /* sometimes used */ ii_keyword_entry_dynarr *keywords; - /* consoles this ii is supported on */ - console_type_entry_dynarr *consoles; /* Implementation specific methods: */ /* Validate method: Given an instantiator vector, signal an error if @@ -130,10 +100,6 @@ Lisp_Object (*normalize_method) (Lisp_Object instantiator, Lisp_Object console_type); - /* 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. */ int (*possible_dest_types_method) (void); @@ -148,11 +114,6 @@ 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, @@ -162,21 +123,6 @@ 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); - - /* 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, - int* width, int* height, - enum image_instance_geometry disp, - Lisp_Object domain); - - /* Layout the instance and its children bounded by the provided - dimensions. Returns success or failure. */ - int (*layout_method) (Lisp_Object image_instance, - int width, int height, Lisp_Object domain); }; /***** Calling an image-instantiator method *****/ @@ -205,7 +151,7 @@ the specified value */ #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ - ((mstruc && HAS_IIFORMAT_METH_P (mstruc, m)) ? \ + (HAS_IIFORMAT_METH_P (mstruc, m) ? \ IIFORMAT_METH (mstruc, m, args) : (given)) /***** Defining new image-instantiator types *****/ @@ -224,18 +170,14 @@ format##_image_instantiator_methods->device = Qnil; \ format##_image_instantiator_methods->keywords = \ Dynarr_new (ii_keyword_entry); \ - format##_image_instantiator_methods->consoles = \ - Dynarr_new (console_type_entry); \ add_entry_to_image_instantiator_format_list \ (Q##format, format##_image_instantiator_methods); \ - dumpstruct (&format##_image_instantiator_methods, \ - &iim_description); \ } while (0) #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ do { \ defsymbol (&Q##format, obj_name); \ - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name);\ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name); \ } while (0) /* Declare that image-instantiator format FORMAT has method M; used in @@ -249,78 +191,49 @@ /* Declare that KEYW is a valid keyword for image-instantiator format FORMAT. VALIDATE_FUN if a function that returns whether the data is valid. The keyword may not appear more than once. */ -#define IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, copy, multi) \ +#define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ do { \ struct ii_keyword_entry entry; \ \ entry.keyword = keyw; \ entry.validate = validate_fun; \ - entry.multiple_p = multi; \ - entry.copy_p = copy; \ + entry.multiple_p = 0; \ Dynarr_add (format##_image_instantiator_methods->keywords, \ entry); \ } while (0) -#define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ -IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 0) - /* Same as IIFORMAT_VALID_KEYWORD except that the keyword may appear multiple times. */ -#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 - copied by the specifier functions. This is necessary for things - like callbacks etc. */ -#define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \ -IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 0, 0) - -/* Declare that image-instantiator format FORMAT is supported on - CONSOLE type. */ -#define IIFORMAT_VALID_CONSOLE(console, format) \ - do { \ - struct console_type_entry entry; \ - \ - entry.symbol = Q##console; \ - entry.meths = console##_console_methods; \ - Dynarr_add (format##_image_instantiator_methods->consoles, \ - entry); \ +#define IIFORMAT_VALID_MULTI_KEYWORD(format, keyword, validate_fun) \ + do { \ + struct ii_keyword_entry entry; \ + \ + entry.keyword = keyword; \ + entry.validate = validate_fun; \ + entry.multiple_p = 1; \ + Dynarr_add (format##_image_instantiator_methods->keywords, \ + 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); \ +#define DEFINE_DEVICE_IIFORMAT(type, format)\ struct image_instantiator_methods *type##_##format##_image_instantiator_methods -#define INITIALIZE_DEVICE_IIFORMAT(type, format) \ -do { \ - type##_##format##_image_instantiator_methods = \ - xnew_and_zero (struct image_instantiator_methods); \ +#define INITIALIZE_DEVICE_IIFORMAT(type, format) \ +do { \ + type##_##format##_image_instantiator_methods = \ + xnew_and_zero (struct image_instantiator_methods); \ type##_##format##_image_instantiator_methods->symbol = Q##format; \ type##_##format##_image_instantiator_methods->device = Q##type; \ type##_##format##_image_instantiator_methods->keywords = \ - Dynarr_new (ii_keyword_entry); \ - add_entry_to_device_ii_format_list \ + Dynarr_new (ii_keyword_entry); \ + add_entry_to_device_ii_format_list \ (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ - IIFORMAT_VALID_CONSOLE(type,format); \ - dumpstruct (&type##_##format##_image_instantiator_methods, \ - &iim_description); \ } while (0) /* Declare that image-instantiator format FORMAT has method M; used in initialization routines */ #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \ (type##_##format##_image_instantiator_methods->m##_method = type##_##format##_##m) -#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, @@ -348,33 +261,17 @@ 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 initialize_subwindow_image_instance (Lisp_Image_Instance*); +void initialize_subwindow_image_instance (struct 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, - int* width, int* height, - enum image_instance_geometry disp, - Lisp_Object domain); -void image_instance_layout (Lisp_Object image_instance, - int width, int height, - Lisp_Object domain); -int layout_layout (Lisp_Object image_instance, - int width, int height, - 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 */ @@ -410,25 +307,15 @@ /* Image Instance Object */ /************************************************************************/ -DECLARE_LRECORD (image_instance, Lisp_Image_Instance); -#define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance) +DECLARE_LRECORD (image_instance, struct Lisp_Image_Instance); +#define XIMAGE_INSTANCE(x) \ + XRECORD (x, image_instance, struct Lisp_Image_Instance) #define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance) #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance) +#define GC_IMAGE_INSTANCEP(x) GC_RECORDP (x, image_instance) #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, @@ -449,13 +336,6 @@ #define IMAGE_SUBWINDOW_MASK (1 << 5) #define IMAGE_WIDGET_MASK (1 << 6) -/* 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) @@ -520,38 +400,18 @@ struct Lisp_Image_Instance { struct lcrecord_header header; - 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 device; Lisp_Object name; - /* The glyph from which we were instantiated. This is a weak - reference. */ - Lisp_Object parent; enum image_instance_type type; - unsigned int x_offset, y_offset; /* for layout purposes */ - 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. */ - union { struct { - unsigned int descent; Lisp_Object string; } text; struct { - unsigned int depth; - unsigned int slice, maxslice, timeout; + int width, height, depth; Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */ Lisp_Object filename; /* string or Qnil */ Lisp_Object mask_filename; /* string or Qnil */ @@ -560,38 +420,20 @@ or a pointer */ Lisp_Object auxdata; /* list or Qnil: any additional data to be seen from lisp */ - void* mask; /* mask that can be seen from all windowing systems */ } pixmap; /* used for pointers as well */ struct { + Lisp_Object frame; + unsigned int width, height; void* subwindow; /* specific devices can use this as necessary */ - 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 because we - want people to be able to put :face in the instantiator - spec. Using gyph-face is more inconvenient, although more - general. */ - Lisp_Object face; - Lisp_Object type; - Lisp_Object props; /* properties or border*/ - Lisp_Object items; /* a list of displayed gui_items */ - Lisp_Object pending_items; /* gui_items that should be displayed */ - Lisp_Object children; /* a list of children */ - Lisp_Object width; /* dynamic width spec. */ - Lisp_Object height; /* dynamic height spec. */ - /* Change flags to augment dirty. */ - unsigned int face_changed : 1; - unsigned int items_changed : 1; + int being_displayed; /* used to detect when needs to be unmapped */ + struct + { + Lisp_Object face; /* foreground and background colors */ + Lisp_Object type; + Lisp_Object props; /* properties */ + struct gui_item gui_item; + } widget; /* widgets are subwindows */ } subwindow; } u; @@ -599,69 +441,17 @@ void *data; }; -/* Layout bit-fields. */ -#define LAYOUT_HORIZONTAL 0 -#define LAYOUT_VERTICAL 1 - -#define LAYOUT_JUSTIFY_LEFT 0 -#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_PARENT(i) ((i)->parent) -#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) \ +#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) \ - (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \ - XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil) + +#define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) -/* 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_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) -#define IMAGE_INSTANCE_TEXT_HEIGHT(i) \ - IMAGE_INSTANCE_HEIGHT(i) -#define IMAGE_INSTANCE_TEXT_DESCENT(i) ((i)->u.text.descent) -#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) \ - IMAGE_INSTANCE_HEIGHT(i) +#define IMAGE_INSTANCE_PIXMAP_WIDTH(i) ((i)->u.pixmap.width) +#define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) ((i)->u.pixmap.height) #define IMAGE_INSTANCE_PIXMAP_DEPTH(i) ((i)->u.pixmap.depth) #define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename) #define IMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) ((i)->u.pixmap.mask_filename) @@ -670,106 +460,35 @@ #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg) #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg) #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata) -#define IMAGE_INSTANCE_PIXMAP_MASK(i) ((i)->u.pixmap.mask) -#define IMAGE_INSTANCE_PIXMAP_SLICE(i) ((i)->u.pixmap.slice) -#define IMAGE_INSTANCE_PIXMAP_MAXSLICE(i) ((i)->u.pixmap.maxslice) -#define IMAGE_INSTANCE_PIXMAP_TIMEOUT(i) ((i)->u.pixmap.timeout) -/* Subwindow properties */ +#define IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) ((i)->u.subwindow.width) +#define IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) ((i)->u.subwindow.height) #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow) -/* 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_FRAME(i) ((i)->u.subwindow.frame) #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ ((i)->u.subwindow.being_displayed) -#define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \ -((i)->u.subwindow.v_resize) -#define IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP(i) \ -((i)->u.subwindow.h_resize) -#define IMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \ -((i)->u.subwindow.orientation) -#define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \ -((i)->u.subwindow.justification) -/* Widget properties */ #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \ - IMAGE_INSTANCE_WIDTH(i) + IMAGE_INSTANCE_SUBWINDOW_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) \ - ((i)->u.subwindow.face = f) -#define IMAGE_INSTANCE_WIDGET_FACE(i) \ - (!NILP ((i)->u.subwindow.face) ? (i)->u.subwindow.face : \ - !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 + IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) +#define IMAGE_INSTANCE_WIDGET_CALLBACK(i) \ + ((i)->u.subwindow.widget.gui_item.callback) +#define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.widget.type) +#define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.widget.props) +#define IMAGE_INSTANCE_WIDGET_FACE(i) ((i)->u.subwindow.widget.face) +#define IMAGE_INSTANCE_WIDGET_TEXT(i) ((i)->u.subwindow.widget.gui_item.name) +#define IMAGE_INSTANCE_WIDGET_ITEM(i) ((i)->u.subwindow.widget.gui_item) -/* 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_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)) #define XIMAGE_INSTANCE_TEXT_STRING(i) \ IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_TEXT_WIDTH(i) \ - IMAGE_INSTANCE_TEXT_WIDTH (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_TEXT_HEIGHT(i) \ - IMAGE_INSTANCE_TEXT_HEIGHT (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_TEXT_ASCENT(i) \ - IMAGE_INSTANCE_TEXT_ASCENT (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_TEXT_DESCENT(i) \ - IMAGE_INSTANCE_TEXT_DESCENT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \ IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i)) @@ -789,69 +508,34 @@ IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_PIXMAP_MASK(i) \ - IMAGE_INSTANCE_PIXMAP_MASK (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_PIXMAP_SLICE(i) \ - IMAGE_INSTANCE_PIXMAP_SLICE (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_PIXMAP_MAXSLICE(i) \ - IMAGE_INSTANCE_PIXMAP_MAXSLICE (XIMAGE_INSTANCE (i)) -#define XIMAGE_INSTANCE_PIXMAP_TIMEOUT(i) \ - IMAGE_INSTANCE_PIXMAP_TIMEOUT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \ 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_CALLBACK(i) \ + IMAGE_INSTANCE_WIDGET_CALLBACK (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_FACE(i) \ IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) -#define XSET_IMAGE_INSTANCE_WIDGET_FACE(i) \ - SET_IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ + IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \ 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_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_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_FRAME(i) \ + IMAGE_INSTANCE_SUBWINDOW_FRAME (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 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); @@ -860,7 +544,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, @@ -896,16 +580,13 @@ Lisp_Object plist; void (*after_change) (Lisp_Object glyph, Lisp_Object property, Lisp_Object locale); +}; - unsigned int dirty : 1; /* So that we can selectively - redisplay changed glyphs. */ -}; -typedef struct Lisp_Glyph Lisp_Glyph; - -DECLARE_LRECORD (glyph, Lisp_Glyph); -#define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph) +DECLARE_LRECORD (glyph, struct Lisp_Glyph); +#define XGLYPH(x) XRECORD (x, glyph, struct Lisp_Glyph) #define XSETGLYPH(x, p) XSETRECORD (x, p, glyph) #define GLYPHP(x) RECORDP (x, glyph) +#define GC_GLYPHP(x) GC_RECORDP (x, glyph) #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph) #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph) @@ -932,35 +613,37 @@ #define GLYPH_CONTRIB_P(g) ((g)->contrib_p) #define GLYPH_BASELINE(g) ((g)->baseline) #define GLYPH_FACE(g) ((g)->face) -#define GLYPH_DIRTYP(g) ((g)->dirty) #define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g)) #define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g)) #define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g)) #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) -#define XGLYPH_DIRTYP(g) GLYPH_DIRTYP (XGLYPH (g)) -#define MARK_GLYPH_CHANGED(g) (GLYPH_DIRTYP (g) = 1); - -extern Lisp_Object Qxpm, Qxface, Qetched_in, Qetched_out, Qbevel_in, Qbevel_out; +extern Lisp_Object Qxpm, Qxface; extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable; -extern Lisp_Object Qxbm, Qedit_field, Qgroup, Qlabel, Qcombo_box, Qscrollbar; -extern Lisp_Object Qtree_view, Qtab_control, Qprogress_gauge, Q_border; +extern Lisp_Object Qxbm, Qedit, Qgroup, Qlabel, Qcombo, Qscrollbar, Qprogress; 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, Qimage_conversion_error; -extern Lisp_Object Q_orientation, Q_margin_width; +extern Lisp_Object Q_items, Q_properties, Q_image, Q_percent, Qimage_conversion_error; 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); -unsigned short glyph_height (Lisp_Object glyph, Lisp_Object domain); +unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, + Lisp_Object window); +unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, + Lisp_Object window); +unsigned short glyph_descent (Lisp_Object glyph, + Lisp_Object frame_face, + face_index window_findex, + Lisp_Object window); +unsigned short glyph_height (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, + Lisp_Object window); Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain); Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain); int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain); @@ -979,13 +662,11 @@ void (*after_change) (Lisp_Object glyph, Lisp_Object property, Lisp_Object locale)); -void query_string_geometry ( Lisp_Object string, Lisp_Object face, - 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); -void disable_glyph_animated_timeout (int i); +Lisp_Object widget_face_font_info (Lisp_Object domain, Lisp_Object face, + int *height, int *width); +void widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face, + int th, int tw, + int* height, int* width); /************************************************************************/ /* Glyph Cachels */ @@ -996,14 +677,7 @@ { Lisp_Object glyph; - unsigned int dirty :1; /* I'm copying faces here. I'm not - sure why we need two dirty - flags. Maybe because an image - instance can be dirty and so we - need to frob this in the same way - as other image instance properties. */ unsigned int updated :1; - unsigned short width; unsigned short ascent; unsigned short descent; @@ -1016,61 +690,21 @@ #define OCT_ESC_GLYPH_INDEX (glyph_index) 4 #define INVIS_GLYPH_INDEX (glyph_index) 5 -#ifdef ERROR_CHECK_GLYPHS - -#include "window.h" +#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 -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 (glyph_cachel_dynarr *elements, + void (*markobj) (Lisp_Object)); void mark_glyph_cachels_as_not_updated (struct window *w); -void mark_glyph_cachels_as_clean (struct window *w); void reset_glyph_cachels (struct window *w); -glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph); #ifdef MEMORY_USAGE_STATS int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, @@ -1089,26 +723,29 @@ * Subwindow Object * ****************************************************************************/ -void unmap_subwindow (Lisp_Object subwindow); -void map_subwindow (Lisp_Object subwindow, int x, int y, - struct display_glyph_area *dga); -int find_matching_subwindow (struct frame* f, int x, int y, int width, int height); -void update_widget (Lisp_Object widget); -void update_widget_instances (Lisp_Object frame); -void update_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_instance_cache (struct frame* f); -void reset_frame_subwindow_instance_cache (struct frame* f); - -struct expose_ignore +/* 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 { - unsigned int x, y; - unsigned int width, height; - struct expose_ignore *next; + Lisp_Object subwindow; + int x, y; + int width, height; + int being_displayed; + int updated; }; -int check_for_ignored_expose (struct frame* f, int x, int y, int width, int height); -extern int hold_ignored_expose_registration; +typedef struct +{ + Dynarr_declare (subwindow_cachel); +} subwindow_cachel_dynarr; -#endif /* INCLUDED_glyphs_h_ */ +void mark_subwindow_cachels (subwindow_cachel_dynarr *elements, + void (*markobj) (Lisp_Object)); +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); +void update_frame_subwindows (struct frame *f); + +#endif /* _XEMACS_GLYPHS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/gmalloc.c --- a/src/gmalloc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gmalloc.c Mon Aug 13 11:20:41 2007 +0200 @@ -25,6 +25,8 @@ # 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! */ @@ -271,7 +273,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 */ @@ -367,7 +369,7 @@ #endif /* How to really get more memory. */ -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#ifdef HEAP_IN_DATA /* once dumped, free() & realloc() on static heap space will fail */ #define PURE_DATA(x) \ ((static_heap_dumped && (char*)x >= static_heap_base \ @@ -446,7 +448,7 @@ static int initialize () { -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#ifdef HEAP_IN_DATA if (static_heap_dumped && __morecore == more_static_core) { __morecore = __default_morecore; @@ -1016,6 +1018,79 @@ #include <malloc.h> #endif +#if 0 /* FSFmacs */ +/* XEmacs requires an ANSI compiler, and memmove() is part of the ANSI- + mandated functions. For losing systems like SunOS 4, we provide + our own memmove(). */ + +#if (defined (MEMMOVE_MISSING) || \ + !defined(_LIBC) && !defined(STDC_HEADERS) && !defined(USG)) + +/* Snarfed directly from Emacs src/dispnew.c: + XXX Should use system bcopy if it handles overlap. */ +#ifndef emacs + +/* Like bcopy except never gets confused by overlap. */ + +static void +safe_bcopy (char *from, char *to, int size) +{ + if (size <= 0 || from == to) + return; + + /* If the source and destination don't overlap, then bcopy can + handle it. If they do overlap, but the destination is lower in + memory than the source, we'll assume bcopy can handle that. */ + if (to < from || from + size <= to) + bcopy (from, to, size); + + /* Otherwise, we'll copy from the end. */ + else + { + char *endf = from + size; + char *endt = to + size; + + /* If TO - FROM is large, then we should break the copy into + nonoverlapping chunks of TO - FROM bytes each. However, if + TO - FROM is small, then the bcopy function call overhead + makes this not worth it. The crossover point could be about + anywhere. Since I don't think the obvious copy loop is too + bad, I'm trying to err in its favor. */ + if (to - from < 64) + { + do + *--endt = *--endf; + while (endf != from); + } + else + { + for (;;) + { + endt -= (to - from); + endf -= (to - from); + + if (endt < to) + break; + + bcopy (endf, endt, to - from); + } + + /* If SIZE wasn't a multiple of TO - FROM, there will be a + little left over. The amount left over is + (endt + (to - from)) - to, which is endt - from. */ + bcopy (from, to, endt - from); + } + } +} +#endif /* Not emacs. */ + +#define memmove(to, from, size) safe_bcopy ((from), (to), (size)) + +#endif + +#endif /* FSFmacs */ + + #ifndef min #define min(A, B) ((A) < (B) ? (A) : (B)) #endif @@ -1036,7 +1111,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 12e008d41344 -r 697ef44129c6 src/gpmevent.c --- a/src/gpmevent.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gpmevent.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,27 +1,4 @@ -/* GPM (General purpose mouse) functions - Copyright (C) 1997 William M. Perry <wmperry@gnu.org> - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* Authors: William Perry */ +/* William Perry 1997 */ #include <config.h> #include "lisp.h" @@ -31,10 +8,6 @@ #include "events.h" #include "events-mod.h" #include "sysdep.h" -#include "commands.h" -#include "lstream.h" -#include "sysproc.h" /* for MAXDESC */ -#include "process.h" #ifdef HAVE_GPM #include "gpmevent.h" @@ -48,602 +21,94 @@ #include <linux/keyboard.h> #endif -extern int gpm_tried; -extern void *gpm_stack; - -static int (*orig_event_pending_p) (int); -static void (*orig_next_event_cb) (Lisp_Event *); - -static Lisp_Object gpm_event_queue; -static Lisp_Object gpm_event_queue_tail; - -struct __gpm_state { - int gpm_tried; - int gpm_flag; - void *gpm_stack; -}; - -static struct __gpm_state gpm_state_information[MAXDESC]; - -static void -store_gpm_state (int fd) +int +handle_gpm_read (struct Lisp_Event *event, struct console *con, int fd) { - gpm_state_information[fd].gpm_tried = gpm_tried; - gpm_state_information[fd].gpm_flag = gpm_flag; - gpm_state_information[fd].gpm_stack = gpm_stack; -} + Gpm_Event ev; + int modifiers = 0; + int type = -1; + int button = 1; -static void -restore_gpm_state (int fd) -{ - gpm_tried = gpm_state_information[fd].gpm_tried; - gpm_flag = gpm_state_information[fd].gpm_flag; - gpm_stack = gpm_state_information[fd].gpm_stack; - gpm_consolefd = gpm_fd = fd; -} - -static void -clear_gpm_state (int fd) -{ - if (fd >= 0) - { - memset(&gpm_state_information[fd], '\0', sizeof(struct __gpm_state)); - } - gpm_tried = gpm_flag = 1; - gpm_fd = gpm_consolefd = -1; - gpm_stack = NULL; -} - -static int -get_process_infd (Lisp_Process *p) -{ - Lisp_Object instr, outstr; - get_process_streams (p, &instr, &outstr); - assert (!NILP (instr)); - return filedesc_stream_fd (XLSTREAM (instr)); -} + if (!Gpm_GetEvent(&ev)) + return 0; -DEFUN ("receive-gpm-event", Freceive_gpm_event, 0, 2, 0, /* -Run GPM_GetEvent(). -This function is the process handler for the GPM connection. -*/ - (process, string)) -{ - Gpm_Event ev; - int modifiers = 0; - int button = 1; - Lisp_Object fake_event; - Lisp_Event *event = NULL; - struct gcpro gcpro1; - static int num_events; - - CHECK_PROCESS (process); - - restore_gpm_state (get_process_infd (XPROCESS (process))); - - if (!Gpm_GetEvent(&ev)) - { - warn_when_safe (Qnil, Qcritical, "Gpm_GetEvent failed - %d", gpm_fd); - return(Qzero); - } - - GCPRO1(fake_event); + event->timestamp = 0; + event->channel = CONSOLE_SELECTED_FRAME (con); - num_events++; - - fake_event = Fmake_event (Qnil, Qnil); - event = XEVENT(fake_event); - - event->timestamp = 0; - event->channel = Fselected_frame (Qnil); /* CONSOLE_SELECTED_FRAME (con); */ - - /* Whow, wouldn't named defines be NICE!?!?! */ - modifiers = 0; + /* Whow, wouldn't named defines be NICE!?!?! */ + modifiers = 0; - 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) - { - button = 1; - } - else if (ev.buttons & GPM_B_MIDDLE) - { - button = 2; - } - else if (ev.buttons & GPM_B_RIGHT) - { - button = 3; - } + 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; - switch (GPM_BARE_EVENTS(ev.type)) { - case GPM_DOWN: - case GPM_UP: - event->event_type = - (ev.type & GPM_DOWN) ? button_press_event : button_release_event; - event->event.button.x = ev.x; - event->event.button.y = ev.y; - event->event.button.button = button; - event->event.button.modifiers = modifiers; - break; - case GPM_MOVE: - case GPM_DRAG: - event->event_type = pointer_motion_event; - event->event.motion.x = ev.x; - event->event.motion.y = ev.y; - event->event.motion.modifiers = modifiers; - default: - /* This will never happen */ - break; - } - - /* Handle the event */ - enqueue_event (fake_event, &gpm_event_queue, &gpm_event_queue_tail); - - UNGCPRO; - - return (Qzero); -} - -static void turn_off_gpm (char *process_name) -{ - Lisp_Object process = Fget_process (build_string (process_name)); - int fd = -1; + if (ev.type & GPM_DOWN) + type = GPM_DOWN; + else if (ev.type & GPM_UP) + type = GPM_UP; + else if (ev.type & GPM_MOVE) { + type = GPM_MOVE; + GPM_DRAWPOINTER(&ev); + } - if (NILP (process)) - { - /* Something happened to our GPM process - fail silently */ - return; - } - - fd = get_process_infd (XPROCESS (process)); - - restore_gpm_state (fd); - - Gpm_Close(); - - clear_gpm_state (fd); - - Fdelete_process (build_string (process_name)); -} - -#ifdef TIOCLINUX -static Lisp_Object -tty_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type) -{ - /* This function can GC */ - struct device *d = decode_device (Qnil); - int fd = DEVICE_INFD (d); - char c = 3; - Lisp_Object output_stream; - Lisp_Object terminal_stream; - Lisp_Object output_string; - struct gcpro gcpro1,gcpro2,gcpro3; - - GCPRO3(output_stream,terminal_stream,output_string); - - /* The ioctl() to paste actually puts things in the input queue of - ** the virtual console, so we need to trap that data, since we are - ** supposed to return the actual string selection from this - ** function. - */ + if (ev.buttons & GPM_B_LEFT) + button = 1; + else if (ev.buttons & GPM_B_MIDDLE) + button = 2; + else if (ev.buttons & GPM_B_RIGHT) + button = 3; - /* I really hate doing this, but it doesn't seem to cause any - ** problems, and it makes the Lstream_read stuff further down - ** error out correctly instead of trying to indefinitely read from - ** the console. - ** - ** There is no set_descriptor_blocking() function call, but in my - ** testing under linux, it has not proved fatal to leave the - ** descriptor in non-blocking mode. - ** - ** William Perry Nov 5, 1999 - */ - set_descriptor_non_blocking (fd); - - /* We need two streams, one for reading from the selected device, - ** and one to write the data into. There is no writable version - ** of the lisp-string lstream, so we make do with a resizing - ** buffer stream, and make a string out of it after we are - ** done. - */ - output_stream = make_resizing_buffer_output_stream (); - terminal_stream = make_filedesc_input_stream (fd, 0, -1, LSTR_BLOCKED_OK); - output_string = Qnil; - - /* #### We should arguably use a specbind() and an unwind routine here, - ** #### but I don't care that much right now. - */ - if (NILP (output_stream) || NILP (terminal_stream)) - { - /* Should we signal an error here? */ - goto out; - } - - if (ioctl (fd, TIOCLINUX, &c) < 0) - { - /* Could not get the selection - eek */ - UNGCPRO; - return (Qnil); - } - - while (1) - { - Bufbyte tempbuf[1024]; /* some random amount */ - ssize_t i; - ssize_t size_in_bytes = - Lstream_read (XLSTREAM (terminal_stream), - tempbuf, sizeof (tempbuf)); - - if (size_in_bytes <= 0) - { - /* end of the stream */ - break; - } - - /* convert CR->LF */ - for (i = 0; i < size_in_bytes; i++) - { - if (tempbuf[i] == '\r') - { - tempbuf[i] = '\n'; - } - } - - Lstream_write (XLSTREAM (output_stream), tempbuf, size_in_bytes); - } - - Lstream_flush (XLSTREAM (output_stream)); - - output_string = make_string (resizing_buffer_stream_ptr (XLSTREAM (output_stream)), - Lstream_byte_count (XLSTREAM (output_stream))); - - Lstream_delete (XLSTREAM (output_stream)); - Lstream_delete (XLSTREAM (terminal_stream)); - - out: - UNGCPRO; - return (output_string); + switch (type) { + case GPM_DOWN: + case GPM_UP: + event->event_type = + type == GPM_DOWN ? button_press_event : button_release_event; + event->event.button.x = ev.x; + event->event.button.y = ev.y; + event->event.button.button = button; + event->event.button.modifiers = modifiers; + break; + case GPM_MOVE: + event->event_type = pointer_motion_event; + event->event.motion.x = ev.x; + event->event.motion.y = ev.y; + event->event.motion.modifiers = modifiers; + default: + return 0; + } + return 1; } -static Lisp_Object -tty_selection_exists_p (Lisp_Object selection, Lisp_Object selection_type) -{ - return (Qt); -} -#endif /* TIOCLINUX */ - -#if 0 -static Lisp_Object -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 - ** end position on the _screen_, not a string to stick in there. - ** Lame. - ** - ** William Perry Nov 4, 1999 - */ -} -#endif - -/* This function appears to work once in a blue moon. I'm not sure -** exactly why either. *sigh* -** -** William Perry Nov 4, 1999 -** -** Apparently, this is the way (mouse-position) is supposed to work, -** and I was just expecting something else. (mouse-pixel-position) -** works just fine. -** -** William Perry Nov 7, 1999 -*/ -static int -tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y) +void +connect_to_gpm (struct console *con) { - Gpm_Event ev; - int num_buttons; - - memset(&ev,'\0',sizeof(ev)); - - num_buttons = Gpm_GetSnapshot(&ev); - - if (!num_buttons) - { - /* This means there are events pending... */ - - /* #### In theory, we should drain the events pending, stick - ** #### them in the queue, and return the mouse position - ** #### anyway. - */ - return(-1); - } - *x = ev.x; - *y = ev.y; - *frame = DEVICE_SELECTED_FRAME (d); - return (1); -} - -static void -tty_set_mouse_position (struct window *w, int x, int y) -{ - /* - #### I couldn't find any GPM functions that set the mouse position. - #### Mr. Perry had left this function empty; that must be why. - #### karlheg - */ -} - -static int gpm_event_pending_p (int user_p) -{ - Lisp_Object event; + /* Only do this if we are running after dumping and really interactive */ + if (!noninteractive && initialized) { + /* We really only want to do this on a TTY */ + CONSOLE_TTY_MOUSE_FD (con) = -1; + if (EQ (CONSOLE_TYPE (con), Qtty)) { + Gpm_Connect conn; + int rval; - EVENT_CHAIN_LOOP (event, gpm_event_queue) - { - if (!user_p || command_event_p (event)) - { - return (1); - } - } - return (orig_event_pending_p (user_p)); -} - -static void gpm_next_event_cb (Lisp_Event *event) -{ - /* #### It would be nice to preserve some sort of ordering of the - ** #### different types of events, but that would be quite a bit - ** #### of work, and would more than likely break the abstraction - ** #### between the other event loops and this one. - */ - - if (!NILP (gpm_event_queue)) - { - Lisp_Object queued_event = dequeue_event (&gpm_event_queue, &gpm_event_queue_tail); - *event = *(XEVENT (queued_event)); - - if (event->event_type == pointer_motion_event) - { - struct device *d = decode_device (event->channel); - int fd = DEVICE_INFD (d); + conn.eventMask = GPM_DOWN|GPM_UP|GPM_MOVE; + conn.defaultMask = GPM_MOVE; + conn.minMod = 0; + conn.maxMod = ((1<<KG_SHIFT)|(1<<KG_ALT)|(1<<KG_CTRL)); - /* Ok, now this is just freaky. Bear with me though. - ** - ** If you run gnuclient and attach to a XEmacs running in - ** X or on another TTY, the mouse cursor does not get - ** drawn correctly. This is because the ioctl() fails - ** with EPERM because the TTY specified is not our - ** controlling terminal. If you are the superuser, it - ** will work just spiffy. The appropriate source file (at - ** least in linux 2.2.x) is - ** .../linux/drivers/char/console.c in the function - ** tioclinux(). The following bit of code is brutal to - ** us: - ** - ** if (current->tty != tty && !suser()) - ** return -EPERM; - ** - ** I even tried setting us as a process leader, removing - ** our controlling terminal, and then using the TIOCSCTTY - ** to set up a new controlling terminal, all with no luck. - ** - ** What is even weirder is if you run XEmacs in a VC, and - ** attach to it from another VC with gnuclient, go back to - ** the original VC and hit a key, the mouse pointer - ** displays (in BOTH VCs), until you hit a key in the - ** second VC, after which it does not display in EITHER - ** VC. Bizarre, no? - ** - ** All I can say is thank god Linux comes with source code - ** or I would have been completely confused. Well, ok, - ** I'm still completely confused. I don't see why they - ** don't just check the permissions on the device - ** (actually, if you have enough access to it to get the - ** console's file descriptor, you should be able to do - ** with it as you wish, but maybe that is just me). - ** - ** William M. Perry - Nov 9, 1999 - */ - - Gpm_DrawPointer (event->event.motion.x,event->event.motion.y, fd); - } - - return; - } - - orig_next_event_cb (event); -} - -static void hook_event_callbacks_once (void) -{ - static int hooker; - - if (!hooker) - { - orig_event_pending_p = event_stream->event_pending_p; - orig_next_event_cb = event_stream->next_event_cb; - event_stream->event_pending_p = gpm_event_pending_p; - event_stream->next_event_cb = gpm_next_event_cb; - hooker = 1; - } + rval = Gpm_Open (&conn, 0); + switch (rval) { + case -1: /* General failure */ + break; + case -2: /* We are running under an XTerm */ + Gpm_Close(); + break; + default: + set_descriptor_non_blocking (gpm_fd); + CONSOLE_TTY_MOUSE_FD (con) = gpm_fd; + } + } + } } -static void hook_console_methods_once (void) -{ - static int hooker; - - if (!hooker) - { - /* Install the mouse position methods for the TTY console type */ - CONSOLE_HAS_METHOD (tty, get_mouse_position); - CONSOLE_HAS_METHOD (tty, set_mouse_position); - CONSOLE_HAS_METHOD (tty, get_foreign_selection); - CONSOLE_HAS_METHOD (tty, selection_exists_p); -#if 0 - CONSOLE_HAS_METHOD (tty, own_selection); #endif - } -} - -DEFUN ("gpm-enabled-p", Fgpm_enabled_p, 0, 1, 0, /* -Return non-nil if GPM mouse support is currently enabled on DEVICE. -*/ - (device)) -{ - char *console_name = ttyname (DEVICE_INFD (decode_device (device))); - char process_name[1024]; - Lisp_Object proc; - - if (!console_name) - { - return (Qnil); - } - - memset (process_name, '\0', sizeof(process_name)); - snprintf (process_name, sizeof(process_name) - 1, "gpm for %s", console_name); - - proc = Fget_process (build_string (process_name)); - - if (NILP (proc)) - { - return (Qnil); - } - - if (1) /* (PROCESS_LIVE_P (proc)) */ - { - return (Qt); - } - return (Qnil); -} - -DEFUN ("gpm-enable", Fgpm_enable, 0, 2, 0, /* -Toggle accepting of GPM mouse events. -*/ - (device, arg)) -{ - Gpm_Connect conn; - int rval; - Lisp_Object gpm_process; - Lisp_Object gpm_filter; - struct device *d = decode_device (device); - int fd = DEVICE_INFD (d); - char *console_name = ttyname (fd); - char process_name[1024]; - - hook_event_callbacks_once (); - hook_console_methods_once (); - - if (noninteractive) - { - error ("Can't connect to GPM in batch mode."); - } - - if (!console_name) - { - /* Something seriously wrong here... */ - return (Qnil); - } - - memset (process_name, '\0', sizeof(process_name)); - snprintf (process_name, sizeof(process_name) - 1, "gpm for %s", console_name); - - if (NILP (arg)) - { - turn_off_gpm (process_name); - return (Qnil); - } - - /* DANGER DANGER. - ** Though shalt not call (gpm-enable t) after we have already - ** started, or stuff blows up. - */ - if (!NILP (Fgpm_enabled_p (device))) - { - error ("GPM already enabled for this console."); - } - - conn.eventMask = GPM_DOWN|GPM_UP|GPM_MOVE|GPM_DRAG; - conn.defaultMask = GPM_MOVE; - conn.minMod = 0; - conn.maxMod = ((1<<KG_SHIFT)|(1<<KG_ALT)|(1<<KG_CTRL)); - - /* Reset some silly static variables so that multiple Gpm_Open() - ** calls have even a sligh chance of working - */ - gpm_tried = 0; - gpm_flag = 0; - gpm_stack = NULL; - - /* Make sure Gpm_Open() does ioctl() on the correct - ** descriptor, or it can get the wrong terminal sizes, etc. - */ - gpm_consolefd = fd; - - /* We have to pass the virtual console manually, otherwise if you - ** use 'gnuclient -nw' to connect to an XEmacs that is running in - ** X, Gpm_Open() tries to use ttyname(0 | 1 | 2) to find out which - ** console you are using, which is of course not correct for the - ** new tty device. - */ - if (strncmp (console_name, "/dev/tty",8) || !isdigit (console_name[8])) - { - /* Urk, something really wrong */ - return (Qnil); - } - - rval = Gpm_Open (&conn, atoi(console_name + 8)); - - switch (rval) { - case -1: /* General failure */ - break; - case -2: /* We are running under an XTerm */ - Gpm_Close(); - break; - default: - /* Is this really necessary? */ - set_descriptor_non_blocking (gpm_fd); - store_gpm_state (gpm_fd); - gpm_process = connect_to_file_descriptor (build_string (process_name), Qnil, - make_int (gpm_fd), - make_int (gpm_fd)); - - if (!NILP (gpm_process)) - { - rval = 0; - Fprocess_kill_without_query (gpm_process, Qnil); - XSETSUBR (gpm_filter, &SFreceive_gpm_event); - set_process_filter (gpm_process, gpm_filter, 1); - - /* Keep track of the device for later */ - /* Fput (gpm_process, intern ("gpm-device"), device); */ - } - else - { - Gpm_Close(); - rval = -1; - } - } - - return(rval ? Qnil : Qt); -} - -void vars_of_gpmevent (void) -{ - gpm_event_queue = Qnil; - gpm_event_queue_tail = Qnil; - staticpro (&gpm_event_queue); - staticpro (&gpm_event_queue_tail); - pdump_wire (&gpm_event_queue); - pdump_wire (&gpm_event_queue_tail); -} - -void syms_of_gpmevent (void) -{ - DEFSUBR (Freceive_gpm_event); - DEFSUBR (Fgpm_enable); - DEFSUBR (Fgpm_enabled_p); -} - -#endif /* HAVE_GPM */ diff -r 12e008d41344 -r 697ef44129c6 src/gpmevent.h --- a/src/gpmevent.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gpmevent.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,28 +1,7 @@ -/* GPM (General purpose mouse) support - Copyright (C) 1997 William M. Perry <wmperry@gnu.org> - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. +#ifndef _HAVE_GPM +#define _HAVE_GPM -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. */ - -#ifndef INCLUDED_gpmevent_h_ -#define INCLUDED_gpmevent_h_ - -int handle_gpm_read (Lisp_Event *event, struct console *con, int fd); +int handle_gpm_read (struct Lisp_Event *event, struct console *con, int fd); void connect_to_gpm (struct console *con); -#endif /* INCLUDED_gpmevent_h_ */ +#endif diff -r 12e008d41344 -r 697ef44129c6 src/gui-msw.c --- a/src/gui-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gui-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -22,14 +22,11 @@ #include <config.h> #include "lisp.h" -#include "console-msw.h" +#include "gui.h" #include "redisplay.h" -#include "gui.h" -#include "glyphs.h" #include "frame.h" #include "elhash.h" -#include "events.h" -#include "buffer.h" +#include "console-msw.h" /* * Return value is Qt if we have dispatched the command, @@ -38,149 +35,23 @@ * command if we return nil */ Lisp_Object -mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, LPARAM id) +mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, WORD id) { /* Try to map the command id through the proper hash table */ - Lisp_Object callback, callback_ex, image_instance, frame, event; - - XSETFRAME (frame, f); - - /* #### make_int should assert that --kkm */ - assert (XINT (make_int (id)) == id); - - image_instance = Fgethash (make_int (id), - FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f), Qnil); - 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); - - if (!NILP (callback_ex) && !UNBOUNDP (callback_ex)) - { - event = Fmake_event (Qnil, Qnil); + Lisp_Object data, fn, arg, frame; - 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)) + data = Fgethash (make_int (id), + FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), Qnil); + + if (NILP (data) || UNBOUNDP (data)) return Qnil; - else - { - Lisp_Object fn, arg; - event = Fmake_event (Qnil, Qnil); + MARK_SUBWINDOWS_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); - 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; } -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. - -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)) -{ - /* Encode filename and current directory. */ - Lisp_Object current_dir = Ffile_name_directory (document); - char* path = NULL; - char* doc = NULL; - Extbyte* f=0; - int ret; - struct gcpro gcpro1, gcpro2; - - CHECK_STRING (document); - - if (NILP (current_dir)) - current_dir = current_buffer->directory; - - GCPRO2 (current_dir, document); - - /* Use mule and cygwin-safe APIs top get at file data. */ - if (STRINGP (current_dir)) - { - TO_EXTERNAL_FORMAT (LISP_STRING, current_dir, - C_STRING_ALLOCA, f, - Qfile_name); -#ifdef CYGWIN - CYGWIN_WIN32_PATH (f, path); -#else - path = f; -#endif - } - - if (STRINGP (document)) - { - TO_EXTERNAL_FORMAT (LISP_STRING, document, - C_STRING_ALLOCA, f, - Qfile_name); -#ifdef CYGWIN - CYGWIN_WIN32_PATH (f, doc); -#else - doc = f; -#endif - } - - UNGCPRO; - - ret = (int) ShellExecute (NULL, - (STRINGP (operation) ? - XSTRING_DATA (operation) : NULL), - doc, - (STRINGP (parameters) ? - XSTRING_DATA (parameters) : NULL), - path, - (INTP (show_flag) ? - XINT (show_flag) : SW_SHOWDEFAULT)); - - if (ret > 32) - return Qt; - - if (ret == ERROR_FILE_NOT_FOUND) - signal_simple_error ("file not found", document); - else if (ret == ERROR_PATH_NOT_FOUND) - signal_simple_error ("path not found", current_dir); - else if (ret == ERROR_BAD_FORMAT) - signal_simple_error ("bad executable format", document); - else - error ("internal error"); - - return Qnil; -} - -void -syms_of_gui_mswindows (void) -{ - DEFSUBR (Fmswindows_shell_execute); -} diff -r 12e008d41344 -r 697ef44129c6 src/gui-x.c --- a/src/gui-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gui-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -33,14 +33,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" +#ifdef HAVE_POPUPS Lisp_Object Qmenu_no_selection_hook; +#endif /* we need a unique id for each popup menu, dialog box, and scrollbar */ static unsigned int lwlib_id_tick; @@ -60,26 +59,36 @@ } +#ifdef HAVE_POPUPS + +struct mark_widget_value_closure +{ + void (*markobj) (Lisp_Object); +}; + static int mark_widget_value_mapper (widget_value *val, void *closure) { Lisp_Object markee; + + struct mark_widget_value_closure *cl = + (struct mark_widget_value_closure *) closure; if (val->call_data) { VOID_TO_LISP (markee, val->call_data); - mark_object (markee); + (cl->markobj) (markee); } if (val->accel) { VOID_TO_LISP (markee, val->accel); - mark_object (markee); + (cl->markobj) (markee); } return 0; } static Lisp_Object -mark_popup_data (Lisp_Object obj) +mark_popup_data (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct popup_data *data = (struct popup_data *) XPOPUP_DATA (obj); @@ -87,14 +96,19 @@ call-data */ if (data->id) - lw_map_widget_values (data->id, mark_widget_value_mapper, 0); + { + struct mark_widget_value_closure closure; + + closure.markobj = markobj; + lw_map_widget_values (data->id, mark_widget_value_mapper, &closure); + } return data->last_menubar_buffer; } DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data, mark_popup_data, internal_object_printer, - 0, 0, 0, 0, struct popup_data); + 0, 0, 0, struct popup_data); /* This is like FRAME_MENUBAR_DATA (f), but contains an alist of (id . popup-data) for GCPRO'ing the callbacks of the popup menus @@ -145,7 +159,7 @@ widget_value *wv = (widget_value *) get_opaque_ptr (closure); free_opaque_ptr (closure); if (wv) - free_widget_value_tree (wv); + free_widget_value (wv); return Qnil; } @@ -188,7 +202,6 @@ if (! wv) return; if (wv->key) xfree (wv->key); if (wv->value) xfree (wv->value); - if (wv->name) xfree (wv->name); wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; @@ -212,9 +225,9 @@ popup_selection_callback (Widget widget, LWLIB_ID ignored_id, XtPointer client_data) { - Lisp_Object data, image_instance, callback, callback_ex; - Lisp_Object frame, event; - int update_subwindows_p = 0; + Lisp_Object fn, arg; + Lisp_Object data; + Lisp_Object frame; struct device *d = get_device_from_display (XtDisplay (widget)); struct frame *f = x_any_widget_or_parent_to_frame (d, widget); @@ -242,45 +255,11 @@ if (((EMACS_INT) client_data) == -1) { - 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; + fn = Qrun_hooks; + arg = Qmenu_no_selection_hook; } else - { - image_instance = XCAR (data); - callback = XCAR (XCDR (data)); - callback_ex = XCDR (XCDR (data)); - update_subwindows_p = 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; - } - } + get_gui_callback (data, &fn, &arg); /* This is the timestamp used for asserting focus so we need to get an up-to-date value event if no events has been dispatched to emacs @@ -290,12 +269,7 @@ #else DEVICE_X_MOUSE_TIMESTAMP (d) = DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (d); #endif - 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); + signal_special_Xt_user_event (frame, fn, arg); } #if 1 @@ -313,9 +287,9 @@ #endif char * -menu_separator_style (const char *s) +menu_separator_style (CONST char *s) { - const char *p; + CONST char *p; char first; if (!s || s[0] == '\0') @@ -341,133 +315,180 @@ return NULL; } -char * -strdup_and_add_accel (char *name) -{ - int i; - int found_accel = 0; +/* set menu accelerator key to first underlined character in menu name */ - for (i=0; name[i]; ++i) - if (name[i] == '%' && name[i+1] == '_') - { - found_accel = 1; - break; - } - - if (found_accel) - return xstrdup (name); - else - { - char *chars = (char *) alloca (strlen (name) + 3); - chars[0] = '%'; - chars[1] = '_'; - memcpy (chars+2, name, strlen (name) + 1); - return xstrdup (chars); +Lisp_Object +menu_name_to_accelerator (char *name) +{ + while (*name) { + if (*name=='%') { + ++name; + if (!(*name)) + return Qnil; + if (*name=='_' && *(name+1)) + { + int accelerator = (int) (unsigned char) (*(name+1)); + return make_char (tolower (accelerator)); + } } + ++name; + } + return Qnil; } /* This does the dirty work. gc_currently_forbidden is 1 when this is called. */ + 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) +button_item_to_widget_value (Lisp_Object desc, widget_value *wv, + int allow_text_field_p, int no_keys_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; + Lisp_Object name = Qnil; + Lisp_Object callback = Qnil; + Lisp_Object suffix = Qnil; + Lisp_Object active_p = Qt; + Lisp_Object include_p = Qt; + Lisp_Object selected_p = Qnil; + Lisp_Object keys = Qnil; + Lisp_Object style = Qnil; + Lisp_Object config_tag = Qnil; + Lisp_Object accel = Qnil; + int length = XVECTOR_LENGTH (desc); + Lisp_Object *contents = XVECTOR_DATA (desc); + int plist_p; + int selected_spec = 0, included_spec = 0; + + if (length < 2) + signal_simple_error ("Button descriptors must be at least 2 long", desc); - /* degenerate case */ - if (STRINGP (gui_item)) + /* length 2: [ "name" callback ] + length 3: [ "name" callback active-p ] + length 4: [ "name" callback active-p suffix ] + or [ "name" callback keyword value ] + length 5+: [ "name" callback [ keyword value ]+ ] + */ + plist_p = (length >= 5 || (length > 2 && KEYWORDP (contents [2]))); + + if (!plist_p && length > 2) + /* the old way */ + { + name = contents [0]; + callback = contents [1]; + active_p = contents [2]; + if (length == 4) + suffix = contents [3]; + } + else { - wv->type = TEXT_TYPE; - wv->name = (char *) XSTRING_DATA (gui_item); - wv->name = strdup_and_add_accel (wv->name); - return 1; + /* the new way */ + int i; + if (length & 1) + signal_simple_error ( + "Button descriptor has an odd number of keywords and values", + desc); + + name = contents [0]; + callback = contents [1]; + for (i = 2; i < length;) + { + Lisp_Object key = contents [i++]; + Lisp_Object val = contents [i++]; + if (!KEYWORDP (key)) + signal_simple_error_2 ("Not a keyword", key, desc); + + if (EQ (key, Q_active)) active_p = val; + else if (EQ (key, Q_suffix)) suffix = val; + else if (EQ (key, Q_keys)) keys = val; + else if (EQ (key, Q_style)) style = val; + else if (EQ (key, Q_selected)) selected_p = val, selected_spec = 1; + else if (EQ (key, Q_included)) include_p = val, included_spec = 1; + else if (EQ (key, Q_config)) config_tag = val; + else if (EQ (key, Q_accelerator)) + { + if ( SYMBOLP (val) + || CHARP (val)) + accel = val; + else + signal_simple_error ("Bad keyboard accelerator", val); + } + else if (EQ (key, Q_filter)) + signal_simple_error(":filter keyword not permitted on leaf nodes", desc); + else + signal_simple_error_2 ("Unknown menu item keyword", key, desc); + } } - else if (!GUI_ITEMP (gui_item)) - signal_simple_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); #ifdef HAVE_MENUBARS - if (menu_entry_p && !gui_item_included_p (gui_item, Vmenubar_configuration)) + if ((!NILP (config_tag) && NILP (Fmemq (config_tag, Vmenubar_configuration))) + || (included_spec && NILP (Feval (include_p)))) { /* the include specification says to ignore this item. */ return 0; } #endif /* HAVE_MENUBARS */ - if (!STRINGP (pgui->name)) - pgui->name = Feval (pgui->name); + CHECK_STRING (name); + wv->name = (char *) XSTRING_DATA (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 (NILP (accel)) + accel = menu_name_to_accelerator (wv->name); + wv->accel = LISP_TO_VOID (accel); - if (!NILP (pgui->suffix)) + if (!NILP (suffix)) { - const char *const_bogosity; + CONST char *const_bogosity; Lisp_Object suffix2; /* Shortcut to avoid evaluating suffix each time */ - if (STRINGP (pgui->suffix)) - suffix2 = pgui->suffix; + if (STRINGP (suffix)) + suffix2 = suffix; else { - suffix2 = Feval (pgui->suffix); + suffix2 = Feval (suffix); CHECK_STRING (suffix2); } - TO_EXTERNAL_FORMAT (LISP_STRING, suffix2, - C_STRING_ALLOCA, const_bogosity, - Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (suffix2, const_bogosity); wv->value = (char *) const_bogosity; wv->value = xstrdup (wv->value); } - wv_set_evalable_slot (wv->enabled, pgui->active); - wv_set_evalable_slot (wv->selected, pgui->selected); + wv_set_evalable_slot (wv->enabled, active_p); + wv_set_evalable_slot (wv->selected, selected_p); - if (!NILP (pgui->callback) || !NILP (pgui->callback_ex)) - wv->call_data = LISP_TO_VOID (cons3 (gui_object_instance, - pgui->callback, - pgui->callback_ex)); + wv->call_data = LISP_TO_VOID (callback); if (no_keys_p #ifdef HAVE_MENUBARS - || (menu_entry_p && !menubar_show_keybindings) + || !menubar_show_keybindings #endif ) wv->key = 0; - else if (!NILP (pgui->keys)) /* Use this string to generate key bindings */ + else if (!NILP (keys)) /* Use this string to generate key bindings */ { - 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)); + CHECK_STRING (keys); + keys = Fsubstitute_command_keys (keys); + if (XSTRING_LENGTH (keys) > 0) + wv->key = xstrdup ((char *) XSTRING_DATA (keys)); else wv->key = 0; } - else if (SYMBOLP (pgui->callback)) /* Show the binding of this command. */ + else if (SYMBOLP (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); + where_is_to_char (callback, buf); if (buf [0]) wv->key = xstrdup (buf); else wv->key = 0; } - CHECK_SYMBOL (pgui->style); - if (NILP (pgui->style)) + CHECK_SYMBOL (style); + if (NILP (style)) { /* If the callback is nil, treat this item like unselectable text. This way, dashes will show up as a separator. */ @@ -494,13 +515,13 @@ wv->type = BUTTON_TYPE; } } - else if (EQ (pgui->style, Qbutton)) + else if (EQ (style, Qbutton)) wv->type = BUTTON_TYPE; - else if (EQ (pgui->style, Qtoggle)) + else if (EQ (style, Qtoggle)) wv->type = TOGGLE_TYPE; - else if (EQ (pgui->style, Qradio)) + else if (EQ (style, Qradio)) wv->type = RADIO_TYPE; - else if (EQ (pgui->style, Qtext)) + else if (EQ (style, Qtext)) { wv->type = TEXT_TYPE; #if 0 @@ -509,132 +530,19 @@ #endif } else - signal_simple_error_2 ("Unknown style", pgui->style, gui_item); + signal_simple_error_2 ("Unknown style", style, desc); if (!allow_text_field_p && (wv->type == TEXT_TYPE)) - signal_simple_error ("Text field not allowed in this context", gui_item); + signal_simple_error ("Text field not allowed in this context", desc); - if (!NILP (pgui->selected) && EQ (pgui->style, Qtext)) + if (selected_spec && EQ (style, Qtext)) signal_simple_error ( - ":selected only makes sense with :style toggle, radio or button", - gui_item); + ":selected only makes sense with :style toggle, radio or button", + desc); return 1; } -/* parse tree's of gui items into widget_value hierarchies */ -static void gui_item_children_to_widget_values (Lisp_Object gui_object_instance, - Lisp_Object items, - widget_value* parent); - -static widget_value * -gui_items_to_widget_values_1 (Lisp_Object gui_object_instance, - Lisp_Object items, widget_value* parent, - widget_value* prev) -{ - widget_value* wv = 0; - - assert ((parent || prev) && !(parent && prev)); - /* now walk the tree creating widget_values as appropriate */ - if (!CONSP (items)) - { - wv = xmalloc_widget_value(); - if (parent) - parent->contents = wv; - else - prev->next = wv; - if (!button_item_to_widget_value (gui_object_instance, - items, wv, 0, 1, 0)) - { - free_widget_value_tree (wv); - if (parent) - parent->contents = 0; - else - prev->next = 0; - } - else - { - 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)); - - if (parent) - wv = gui_items_to_widget_values_1 (gui_object_instance, - XCAR (items), parent, 0); - else - wv = gui_items_to_widget_values_1 (gui_object_instance, - XCAR (items), 0, prev); - /* the rest are the children */ - gui_item_children_to_widget_values (gui_object_instance, - XCDR (items), wv); - } - return wv; -} - -static void -gui_item_children_to_widget_values (Lisp_Object gui_object_instance, - Lisp_Object items, widget_value* parent) -{ - widget_value* wv = 0, *prev = 0; - Lisp_Object rest; - CHECK_CONS (items); - - /* first one is master */ - prev = gui_items_to_widget_values_1 (gui_object_instance, XCAR (items), - parent, 0); - /* the rest are the children */ - LIST_LOOP (rest, XCDR (items)) - { - Lisp_Object tab = XCAR (rest); - wv = gui_items_to_widget_values_1 (gui_object_instance, tab, 0, prev); - prev = wv; - } -} - -widget_value * -gui_items_to_widget_values (Lisp_Object gui_object_instance, Lisp_Object items) -{ - /* !!#### 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); - - /* Inhibit GC during this conversion. The reasons for this are - the same as in menu_item_descriptor_to_widget_value(); see - the large comment above that function. */ - record_unwind_protect (restore_gc_inhibit, - make_int (gc_currently_forbidden)); - gc_currently_forbidden = 1; - - /* Also make sure that we free the partially-created widget_value - tree on Lisp error. */ - control = xmalloc_widget_value(); - wv_closure = make_opaque_ptr (control); - record_unwind_protect (widget_value_unwind, wv_closure); - - gui_items_to_widget_values_1 (gui_object_instance, items, control, 0); - - /* mess about getting the data we really want */ - tmp = control; - control = control->contents; - tmp->next = 0; - tmp->contents = 0; - free_widget_value_tree (tmp); - - /* No more need to free the half-filled-in structures. */ - set_opaque_ptr (wv_closure, 0); - unbind_to (count, Qnil); - - return control; -} +#endif /* HAVE_POPUPS */ /* This is a kludge to make sure emacs can only link against a version of lwlib that was compiled in the right way. Emacs references symbols which @@ -685,11 +593,6 @@ #elif defined (HAVE_DIALOGS) MACROLET (lwlib_dialogs_athena); #endif -#ifdef LWLIB_WIDGETS_MOTIF - MACROLET (lwlib_widgets_motif); -#elif defined (HAVE_WIDGETS) - MACROLET (lwlib_widgets_athena); -#endif #undef MACROLET } @@ -697,27 +600,18 @@ void syms_of_gui_x (void) { - INIT_LRECORD_IMPLEMENTATION (popup_data); - +#ifdef HAVE_POPUPS defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook"); -} - -void -reinit_vars_of_gui_x (void) -{ - lwlib_id_tick = (1<<16); /* start big, to not conflict with Energize */ -#ifdef HAVE_POPUPS - popup_up_p = 0; #endif - - /* this makes only safe calls as in emacs.c */ - sanity_check_lwlib (); } void vars_of_gui_x (void) { - reinit_vars_of_gui_x (); + lwlib_id_tick = (1<<16); /* start big, to not conflict with Energize */ + +#ifdef HAVE_POPUPS + popup_up_p = 0; Vpopup_callbacks = Qnil; staticpro (&Vpopup_callbacks); @@ -731,4 +625,8 @@ */ ); #endif Fset (Qmenu_no_selection_hook, Qnil); +#endif /* HAVE_POPUPS */ + + /* this makes only safe calls as in emacs.c */ + sanity_check_lwlib (); } diff -r 12e008d41344 -r 697ef44129c6 src/gui-x.h --- a/src/gui-x.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gui-x.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_gui_x_h_ -#define INCLUDED_gui_x_h_ +#ifndef _XEMACS_XLWLIB_H_ +#define _XEMACS_XLWLIB_H_ #include "../lwlib/lwlib.h" @@ -30,6 +30,8 @@ LWLIB_ID new_lwlib_id (void); +#ifdef HAVE_POPUPS + /* Each frame has one of these, and they are also contained in Vpopup_callbacks. It doesn't really need to be an lrecord (it's not lisp-accessible) @@ -60,6 +62,7 @@ #define XPOPUP_DATA(x) XRECORD (x, popup_data, struct popup_data) #define XSETPOPUP_DATA(x, p) XSETRECORD (x, p, popup_data) #define POPUP_DATAP(x) RECORDP (x, popup_data) +#define GC_POPUP_DATAP(x) GC_RECORDP (x, popup_data) #define CHECK_POPUP_DATA(x) CHECK_RECORD (x, popup_data) void gcpro_popup_callbacks (LWLIB_ID id); @@ -68,15 +71,12 @@ void free_popup_widget_value_tree (widget_value *wv); void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, XtPointer client_data); -char *strdup_and_add_accel (char *name); -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); -widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance, - Lisp_Object items); +int button_item_to_widget_value (Lisp_Object desc, widget_value *wv, + int allow_text_field_p, int no_keys_p); Lisp_Object menu_name_to_accelerator (char *name); -char *menu_separator_style (const char *s); +char *menu_separator_style (CONST char *s); Lisp_Object widget_value_unwind (Lisp_Object closure); -#endif /* INCLUDED_gui_x_h_ */ +#endif /* HAVE_POPUPS */ + +#endif /* _XEMACS_XLWLIB_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/gui.c --- a/src/gui.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gui.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,16 +27,13 @@ #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, Q_callback_ex, Q_value; +Lisp_Object Q_accelerator, Q_label, Q_callback; Lisp_Object Qtoggle, Qradio; -static Lisp_Object parse_gui_item_tree_list (Lisp_Object list); - #ifdef HAVE_POPUPS /* count of menus/dboxes currently up */ @@ -53,9 +50,9 @@ #endif /* HAVE_POPUPS */ int -separator_string_p (const char *s) +separator_string_p (CONST char *s) { - const char *p; + CONST char *p; char first; if (!s || s[0] == '\0') @@ -74,17 +71,11 @@ void get_gui_callback (Lisp_Object data, Lisp_Object *fn, Lisp_Object *arg) { - 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)))))) + if (SYMBOLP (data) + || (COMPILED_FUNCTIONP (data) + && XCOMPILED_FUNCTION (data)->flags.interactivep) + || (EQ (XCAR (data), Qlambda) + && !NILP (Fassq (Qinteractive, Fcdr (Fcdr (data)))))) { *fn = Qcall_interactively; *arg = data; @@ -106,17 +97,35 @@ } /* + * Initialize the gui_item structure by setting all (GC-protected) + * fields to their default values. The defaults are t for :active and + * :included values, and nil for others. + */ +void +gui_item_init (struct gui_item *pgui_item) +{ + pgui_item->name = Qnil; + pgui_item->callback = Qnil; + pgui_item->suffix = Qnil; + pgui_item->active = Qt; + pgui_item->included = Qt; + pgui_item->config = Qnil; + pgui_item->filter = Qnil; + pgui_item->style = Qnil; + pgui_item->selected = Qnil; + pgui_item->keys = Qnil; +} + +/* * Add a value VAL associated with keyword KEY into PGUI_ITEM * structure. If KEY is not a keyword, or is an unknown keyword, then * error is signaled. */ void -gui_item_add_keyval_pair (Lisp_Object gui_item, - Lisp_Object key, Lisp_Object val, +gui_item_add_keyval_pair (struct gui_item *pgui_item, + Lisp_Object key, Lisp_Object val, Error_behavior errb) { - 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); @@ -128,55 +137,11 @@ 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_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_callback)) pgui_item->callback = val; + else if (EQ (key, Q_key_sequence)) ; /* ignored for FSF compatability */ else if (EQ (key, Q_label)) ; /* ignored for 21.0 implement in 21.2 */ - else if (EQ (key, Q_accelerator)) - { - if (SYMBOLP (val) || CHARP (val)) - pgui_item->accelerator = val; - else if (ERRB_EQ (errb, ERROR_ME)) - signal_simple_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); -} - -void -gui_item_init (Lisp_Object gui_item) -{ - Lisp_Gui_Item *lp = XGUI_ITEM (gui_item); - - lp->name = Qnil; - lp->callback = Qnil; - lp->callback_ex = Qnil; - lp->suffix = Qnil; - lp->active = Qt; - lp->included = Qt; - lp->config = Qnil; - lp->filter = Qnil; - lp->style = Qnil; - lp->selected = Qnil; - lp->keys = Qnil; - lp->accelerator = Qnil; - lp->value = Qnil; -} - -Lisp_Object -allocate_gui_item (void) -{ - Lisp_Gui_Item *lp = alloc_lcrecord_type (Lisp_Gui_Item, &lrecord_gui_item); - Lisp_Object val; - - zero_lcrecord (lp); - XSETGUI_ITEM (val, lp); - - gui_item_init (val); - - return val; + signal_simple_error_2 ("Unknown keyword in gui item", key, pgui_item->name); } /* @@ -184,14 +149,12 @@ * function extracts the description of the item into the PGUI_ITEM * structure. */ -static Lisp_Object -make_gui_item_from_keywords_internal (Lisp_Object item, - Error_behavior errb) +static void +gui_parse_item_keywords_internal (Lisp_Object item, struct gui_item *pgui_item, + Error_behavior errb) { int length, plist_p, start; Lisp_Object *contents; - Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); CHECK_VECTOR (item); length = XVECTOR_LENGTH (item); @@ -218,7 +181,7 @@ pgui_item->callback = contents [1]; start = 2; } - else + else start =1; if (!plist_p && length > 2) @@ -241,54 +204,21 @@ { Lisp_Object key = contents [i++]; Lisp_Object val = contents [i++]; - gui_item_add_keyval_pair (gui_item, key, val, errb); + gui_item_add_keyval_pair (pgui_item, key, val, errb); } } - return gui_item; -} - -Lisp_Object -gui_parse_item_keywords (Lisp_Object item) -{ - return make_gui_item_from_keywords_internal (item, ERROR_ME); -} - -Lisp_Object -gui_parse_item_keywords_no_errors (Lisp_Object item) -{ - return make_gui_item_from_keywords_internal (item, ERROR_ME_NOT); } -/* convert a gui item into plist properties */ void -gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item) +gui_parse_item_keywords (Lisp_Object item, struct gui_item *pgui_item) { - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); + gui_parse_item_keywords_internal (item, pgui_item, ERROR_ME); +} - 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)) - Fplist_put (plist, Q_active, pgui_item->active); - if (!NILP (pgui_item->included)) - Fplist_put (plist, Q_included, pgui_item->included); - if (!NILP (pgui_item->config)) - Fplist_put (plist, Q_config, pgui_item->config); - if (!NILP (pgui_item->filter)) - Fplist_put (plist, Q_filter, pgui_item->filter); - if (!NILP (pgui_item->style)) - Fplist_put (plist, Q_style, pgui_item->style); - if (!NILP (pgui_item->selected)) - Fplist_put (plist, Q_selected, pgui_item->selected); - if (!NILP (pgui_item->keys)) - 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); +void +gui_parse_item_keywords_no_errors (Lisp_Object item, struct gui_item *pgui_item) +{ + gui_parse_item_keywords_internal (item, pgui_item, ERROR_ME_NOT); } /* @@ -296,51 +226,13 @@ * if any */ int -gui_item_active_p (Lisp_Object gui_item) +gui_item_active_p (CONST struct gui_item *pgui_item) { /* This function can call lisp */ /* Shortcut to avoid evaluating Qt each time */ - return (EQ (XGUI_ITEM (gui_item)->active, Qt) - || !NILP (Feval (XGUI_ITEM (gui_item)->active))); -} - -/* set menu accelerator key to first underlined character in menu name */ -Lisp_Object -gui_item_accelerator (Lisp_Object gui_item) -{ - Lisp_Gui_Item *pgui = XGUI_ITEM (gui_item); - - if (!NILP (pgui->accelerator)) - return pgui->accelerator; - - else - return gui_name_accelerator (pgui->name); -} - -Lisp_Object -gui_name_accelerator (Lisp_Object nm) -{ - Bufbyte *name = XSTRING_DATA (nm); - - while (*name) - { - if (*name == '%') - { - ++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); - } - return make_char (DOWNCASE (current_buffer, - charptr_emchar (XSTRING_DATA (nm)))); + return (EQ (pgui_item->active, Qt) + || !NILP (Feval (pgui_item->active))); } /* @@ -348,13 +240,13 @@ * if any */ int -gui_item_selected_p (Lisp_Object gui_item) +gui_item_selected_p (CONST struct gui_item *pgui_item) { /* This function can call lisp */ /* Shortcut to avoid evaluating Qt each time */ - return (EQ (XGUI_ITEM (gui_item)->selected, Qt) - || !NILP (Feval (XGUI_ITEM (gui_item)->selected))); + return (EQ (pgui_item->selected, Qt) + || !NILP (Feval (pgui_item->selected))); } /* @@ -363,10 +255,9 @@ * configuration variable */ int -gui_item_included_p (Lisp_Object gui_item, Lisp_Object conflist) +gui_item_included_p (CONST struct gui_item *pgui_item, Lisp_Object conflist) { /* This function can call lisp */ - 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) @@ -398,13 +289,11 @@ * buffer. */ unsigned int -gui_item_display_flush_left (Lisp_Object gui_item, - char *buf, Bytecount buf_len) +gui_item_display_flush_left (CONST struct gui_item *pgui_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); /* Copy item name first */ CHECK_STRING (pgui_item->name); @@ -447,33 +336,29 @@ * buffer. */ unsigned int -gui_item_display_flush_right (Lisp_Object gui_item, - char *buf, Bytecount buf_len) +gui_item_display_flush_right (CONST struct gui_item *pgui_item, + char* buf, Bytecount buf_len) { - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); *buf = 0; -#ifdef HAVE_MENUBARS /* Have keys? */ if (!menubar_show_keybindings) return 0; -#endif /* Try :keys first */ if (!NILP (pgui_item->keys)) { CHECK_STRING (pgui_item->keys); - if (XSTRING_LENGTH (pgui_item->keys) + 1 > buf_len) + if (XSTRING_LENGTH (pgui_item->keys) > buf_len) signal_too_long_error (pgui_item->name); - memcpy (buf, XSTRING_DATA (pgui_item->keys), - XSTRING_LENGTH (pgui_item->keys) + 1); + strcpy (buf, (CONST char *) XSTRING_DATA (pgui_item->keys)); 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); @@ -489,52 +374,27 @@ } #endif /* HAVE_WINDOW_SYSTEM */ -static Lisp_Object -mark_gui_item (Lisp_Object obj) +Lisp_Object +mark_gui_item (struct gui_item* p, void (*markobj) (Lisp_Object)) { - Lisp_Gui_Item *p = XGUI_ITEM (obj); - - 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); - mark_object (p->included); - mark_object (p->config); - mark_object (p->filter); - mark_object (p->style); - mark_object (p->selected); - mark_object (p->keys); - mark_object (p->accelerator); - mark_object (p->value); + markobj (p->name); + markobj (p->callback); + markobj (p->suffix); + markobj (p->active); + markobj (p->included); + markobj (p->config); + markobj (p->filter); + markobj (p->style); + markobj (p->selected); + markobj (p->keys); return Qnil; } -static unsigned long -gui_item_hash (Lisp_Object obj, int depth) +int +gui_item_hash (Lisp_Object hashtable, struct gui_item* g, int slot) { - Lisp_Gui_Item *p = XGUI_ITEM (obj); - - 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)), - 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->value, depth + 1))); -} - -int -gui_item_id_hash (Lisp_Object hashtable, Lisp_Object gitem, int slot) -{ - int hashid = gui_item_hash (gitem, 0); + int hashid = HASH2 (internal_hash (g->callback, 0), internal_hash (g->name, 0)); int id = GUI_ITEM_ID_BITS (hashid, slot); while (!NILP (Fgethash (make_int (id), hashtable, Qnil))) @@ -544,177 +404,9 @@ return id; } -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 (!(internal_equal (p1->name, p2->name, depth + 1) - && - 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) - && - EQ (p1->included, p2->included) - && - EQ (p1->config, p2->config) - && - EQ (p1->filter, p2->filter) - && - EQ (p1->style, p2->style) - && - EQ (p1->selected, p2->selected) - && - EQ (p1->accelerator, p2->accelerator) - && - EQ (p1->keys, p2->keys) - && - EQ (p1->value, p2->value))) - return 0; - return 1; -} - -static void -print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - Lisp_Gui_Item *g = XGUI_ITEM (obj); - char buf[20]; - - if (print_readably) - error ("printing unreadable object #<gui-item 0x%x>", g->header.uid); - - write_c_string ("#<gui-item ", printcharfun); - sprintf (buf, "0x%x>", g->header.uid); - 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) -{ - Lisp_Object ret = entry; - struct gcpro gcpro1; - - GCPRO1 (ret); - - if (VECTORP (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); - - RETURN_UNGCPRO (ret); -} - -Lisp_Object -parse_gui_item_tree_children (Lisp_Object list) -{ - 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) - { - if (CONSP (XCAR (rest))) - sub = parse_gui_item_tree_list (XCAR (rest)); - else - sub = parse_gui_item_tree_item (XCAR (rest)); - - ret = Fcons (sub, ret); - } - /* make the order the same as the items we have parsed */ - RETURN_UNGCPRO (Fnreverse (ret)); -} - -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)); - 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, - finalize_gui_item, gui_item_equal, - gui_item_hash, - 0, - Lisp_Gui_Item); - void syms_of_gui (void) { - INIT_LRECORD_IMPLEMENTATION (gui_item); - defkeyword (&Q_active, ":active"); defkeyword (&Q_suffix, ":suffix"); defkeyword (&Q_keys, ":keys"); @@ -727,8 +419,6 @@ defkeyword (&Q_accelerator, ":accelerator"); defkeyword (&Q_label, ":label"); defkeyword (&Q_callback, ":callback"); - defkeyword (&Q_callback_ex, ":callback-ex"); - defkeyword (&Q_value, ":value"); defsymbol (&Qtoggle, "toggle"); defsymbol (&Qradio, "radio"); diff -r 12e008d41344 -r 697ef44129c6 src/gui.h --- a/src/gui.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/gui.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,26 +24,20 @@ /* Written by kkm on 12/24/97 */ -#ifndef INCLUDED_gui_h_ -#define INCLUDED_gui_h_ +#ifndef _XEMACS_GUI_H_ +#define _XEMACS_GUI_H_ -int separator_string_p (const char *s); +int separator_string_p (CONST char *s); void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *); extern int popup_up_p; -/************************************************************************/ -/* Image Instance Object */ -/************************************************************************/ - /* This structure describes gui button, menu item or submenu properties */ -struct Lisp_Gui_Item +struct gui_item { - 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,49 +46,50 @@ Lisp_Object style; /* Symbol */ Lisp_Object selected; /* Form */ Lisp_Object keys; /* String */ - Lisp_Object accelerator; /* Char or Symbol */ - Lisp_Object value; /* Anything you like */ }; +#define GUI_ITEM_LAST_GCPROED keys +#define GUI_ITEM_GCPRO_COUNT \ + (slot_offset(struct gui_item, GUI_ITEM_LAST_GCPROED) / sizeof(Lisp_Object) + 1) -DECLARE_LRECORD (gui_item, Lisp_Gui_Item); -#define XGUI_ITEM(x) XRECORD (x, gui_item, Lisp_Gui_Item) -#define XSETGUI_ITEM(x, p) XSETRECORD (x, p, gui_item) -#define GUI_ITEMP(x) RECORDP (x, gui_item) -#define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item) -#define CONCHECK_GUI_ITEM(x) CONCHECK_RECORD (x, gui_item) +/* + * gui_item is a struct containing a bunch of Lisp_Object + * members. We need to GC-protect all the member slots. + * Rather than build a long chain of individual gcpro structs + * that protect the slots individually, we protect all the + * member slots by pretending the struct is an array. ANSI C + * requires this hack to work, ugly though it is. + */ +#define GCPRO_GUI_ITEM(pgui_item) \ + do { \ + Lisp_Object *gui_item_array = (Lisp_Object *) pgui_item; \ + GCPRO1 (gui_item_array[0]); \ + gcpro1.nvars = GUI_ITEM_GCPRO_COUNT; \ + } while (0); 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, Q_callback_ex, Q_value; +extern Lisp_Object Q_key_sequence, Q_label, Q_callback; -void gui_item_add_keyval_pair (Lisp_Object, +void gui_item_init (struct gui_item *pgui_item); +void gui_item_add_keyval_pair (struct gui_item *pgui_item, Lisp_Object key, Lisp_Object val, Error_behavior errb); -Lisp_Object gui_parse_item_keywords (Lisp_Object item); -Lisp_Object gui_parse_item_keywords_no_errors (Lisp_Object item); -void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item); -int gui_item_active_p (Lisp_Object); -int gui_item_selected_p (Lisp_Object); -int gui_item_included_p (Lisp_Object, Lisp_Object into); -Lisp_Object gui_item_accelerator (Lisp_Object gui_item); -Lisp_Object gui_name_accelerator (Lisp_Object name); -int gui_item_id_hash (Lisp_Object, Lisp_Object gui_item, int); -unsigned int gui_item_display_flush_left (Lisp_Object pgui_item, +void gui_parse_item_keywords (Lisp_Object item, struct gui_item *pgui_item); +void gui_parse_item_keywords_no_errors (Lisp_Object item, struct gui_item *pgui_item); +int gui_item_active_p (CONST struct gui_item *pgui_item); +int gui_item_selected_p (CONST struct gui_item *pgui_item); +int gui_item_included_p (CONST struct gui_item *pgui_item, Lisp_Object into); +int gui_item_hash (Lisp_Object, struct gui_item*, int); +Lisp_Object mark_gui_item (struct gui_item* p, void (*markobj) (Lisp_Object)); +unsigned int gui_item_display_flush_left (CONST struct gui_item *pgui_item, char* buf, Bytecount buf_len); -unsigned int gui_item_display_flush_right (Lisp_Object gui_item, +unsigned int gui_item_display_flush_right (CONST struct gui_item *pgui_item, char* buf, Bytecount buf_len); -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); - /* this is mswindows biased but reasonably safe I think */ #define GUI_ITEM_ID_SLOTS 8 #define GUI_ITEM_ID_MIN(s) (s * 0x2000) #define GUI_ITEM_ID_MAX(s) (0x1FFF + GUI_ITEM_ID_MIN (s)) #define GUI_ITEM_ID_BITS(x,s) (((x) & 0x1FFF) + GUI_ITEM_ID_MIN (s)) -#define MAX_MENUITEM_LENGTH 128 - -#endif /* INCLUDED_gui_h_ */ +#endif /* _XEMACS_GUI_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/gutter.c --- a/src/gutter.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1536 +0,0 @@ -/* Gutter implementation. - Copyright (C) 1999, 2000 Andy Piper. - -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. */ - -/* written by Andy Piper <andy@xemacs.org> with specifiers partially - ripped-off from toolbar.c */ - -#include <config.h> -#include "lisp.h" - -#include "buffer.h" -#include "frame.h" -#include "device.h" -#include "faces.h" -#include "glyphs.h" -#include "redisplay.h" -#include "window.h" -#include "gutter.h" - -Lisp_Object Vgutter[4]; -Lisp_Object Vgutter_size[4]; -Lisp_Object Vgutter_visible_p[4]; -Lisp_Object Vgutter_border_width[4]; - -Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p; -Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height; -Lisp_Object Vdefault_gutter_border_width; - -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 { \ - switch (pos) \ - { \ - case TOP_GUTTER: \ - (frame)->top_gutter_was_visible = flag; \ - break; \ - case BOTTOM_GUTTER: \ - (frame)->bottom_gutter_was_visible = flag; \ - break; \ - case LEFT_GUTTER: \ - (frame)->left_gutter_was_visible = flag; \ - break; \ - case RIGHT_GUTTER: \ - (frame)->right_gutter_was_visible = flag; \ - break; \ - default: \ - abort (); \ - } \ - } while (0) - -static int gutter_was_visible (struct frame* frame, enum gutter_pos pos) -{ - switch (pos) - { - case TOP_GUTTER: - return frame->top_gutter_was_visible; - case BOTTOM_GUTTER: - return frame->bottom_gutter_was_visible; - case LEFT_GUTTER: - return frame->left_gutter_was_visible; - case RIGHT_GUTTER: - 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) -{ - Lisp_Object w = FRAME_ROOT_WINDOW (f); - - do { - while (!NILP (XWINDOW (w)->vchild)) - { - w = XWINDOW (w)->vchild; - } - } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild)); - - return w; -} -#endif - -static Lisp_Object -frame_bottommost_window (struct frame *f) -{ - Lisp_Object w = FRAME_ROOT_WINDOW (f); - - do { - while (!NILP (XWINDOW (w)->vchild)) - { - w = XWINDOW (w)->vchild; - while (!NILP (XWINDOW (w)->next)) - { - w = XWINDOW (w)->next; - } - } - } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild)); - - return w; -} - -#if 0 -static Lisp_Object -frame_leftmost_window (struct frame *f) -{ - Lisp_Object w = FRAME_ROOT_WINDOW (f); - - do { - while (!NILP (XWINDOW (w)->hchild)) - { - w = XWINDOW (w)->hchild; - } - } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild)); - - return w; -} - -static Lisp_Object -frame_rightmost_window (struct frame *f) -{ - Lisp_Object w = FRAME_ROOT_WINDOW (f); - - do { - while (!NILP (XWINDOW (w)->hchild)) - { - w = XWINDOW (w)->hchild; - while (!NILP (XWINDOW (w)->next)) - { - w = XWINDOW (w)->next; - } - } - } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild)); - return w; -} -#endif - -/* calculate the coordinates of a gutter for the current frame and - selected window. we have to be careful in calculating this as we - need to use *two* windows, the currently selected window will give - us the actual height, width and contents of the gutter, but if we - use this for calculating the gutter positions we run into trouble - if it is not the window nearest the gutter. Instead we predetermine - the nearest window and then use that.*/ -static void -get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, - int *width, int *height) -{ - struct window - * bot = XWINDOW (frame_bottommost_window (f)); - /* The top and bottom gutters take precedence over the left and - right. */ - switch (pos) - { - case TOP_GUTTER: - *x = FRAME_LEFT_BORDER_END (f); - *y = FRAME_TOP_BORDER_END (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); - *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 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); - *width = FRAME_LEFT_GUTTER_BOUNDS (f); - *height = WINDOW_BOTTOM (bot) - - (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 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); - *width = FRAME_RIGHT_GUTTER_BOUNDS (f); - *height = WINDOW_BOTTOM (bot) - - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); - break; - - default: - abort (); - } -} - -/* 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, int force) -{ - Lisp_Object frame; - Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); - struct device *d = XDEVICE (f->device); - struct window* w = XWINDOW (window); - int x, y, width, height, ypos; - int line, border_width; - face_index findex; - display_line_dynarr* ddla, *cdla; - 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, Vwidget_face); - - 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[pos]; - cdla = f->current_display_lines[pos]; - cdla_len = Dynarr_length (cdla); - - XSETFRAME (frame, f); - - get_gutter_coords (f, pos, &x, &y, &width, &height); - /* generate some display lines */ - generate_displayable_area (w, WINDOW_GUTTER (w, pos), - x + border_width, y + border_width, - width - 2 * border_width, - height - 2 * border_width, ddla, 0, findex); - - /* 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])) - { -#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]" : "<null>"); -#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; - - 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 - { - /* 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); - } - } - - w->gutter_extent_modiff [pos] = 0; -} - -/* Sizing gutters is a pain so we try and help the user by detemining - 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, count; - display_line_dynarr* ddla; - struct display_line *dl; - - /* we cannot autodetect gutter sizes for the left and right as there - is no reasonable metric to use */ - assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER); - /* degenerate case */ - 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), - FRAME_LEFT_BORDER_END (f), - 0, - FRAME_RIGHT_BORDER_START (f) - - 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)) - { - dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); - ypos = dl->ypos + dl->descent - dl->clip; - free_display_lines (ddla); - return make_int (ypos); - } - else - { - free_display_lines (ddla); - return Qnil; - } -} - -static void -clear_gutter (struct frame *f, enum gutter_pos pos) -{ - int x, y, width, height; - Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); - face_index findex = get_builtin_face_cache_index (XWINDOW (window), - Vwidget_face); - get_gutter_coords (f, pos, &x, &y, &width, &height); - - SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0); - - 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->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; - int local_buffers_changed = f->buffers_changed; - f->clip_changed = 0; - f->buffers_changed = 0; - - /* and output */ - GUTTER_POS_LOOP (pos) - { - if (FRAME_GUTTER_VISIBLE (f, pos)) - output_gutter (f, pos, 0); - - else if (gutter_was_visible (f, pos)) - clear_gutter (f, pos); - } - - f->clip_changed = local_clip_changed; - f->buffers_changed = local_buffers_changed; - f->gutter_changed = 0; - } -} - -void -reset_gutter_display_lines (struct frame* f) -{ - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) - { - if (f->current_display_lines[pos]) - Dynarr_reset (f->current_display_lines[pos]); - } -} - -static void -redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y, - int width, int height) -{ - int g_x, g_y, g_width, g_height; - - get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height); - - if (((y + height) < g_y) || (y > (g_y + g_height)) || !height || !width || !g_height || !g_width) - return; - 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. */ - reset_gutter_display_lines (f); - - /* 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, 1); -} - -void -redraw_exposed_gutters (struct frame *f, int x, int y, int width, - 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) -{ - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) - { - 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; - } - } -} - -static enum gutter_pos -decode_gutter_position (Lisp_Object position) -{ - if (EQ (position, Qtop)) return TOP_GUTTER; - if (EQ (position, Qbottom)) return BOTTOM_GUTTER; - if (EQ (position, Qleft)) return LEFT_GUTTER; - if (EQ (position, Qright)) return RIGHT_GUTTER; - signal_simple_error ("Invalid gutter position", position); - - return TOP_GUTTER; /* not reached */ -} - -DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /* -Set the position that the `default-gutter' will be displayed at. -Valid positions are 'top, 'bottom, 'left and 'right. -See `default-gutter-position'. -*/ - (position)) -{ - enum gutter_pos cur = decode_gutter_position (Vdefault_gutter_position); - enum gutter_pos new = decode_gutter_position (position); - - if (cur != new) - { - /* The following calls will automatically cause the dirty - flags to be set; we delay frame size changes to avoid - lots of frame flickering. */ - /* #### I think this should be GC protected. -sb */ - hold_frame_size_changes (); - set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil))); - set_specifier_fallback (Vgutter[new], Vdefault_gutter); - set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero))); - set_specifier_fallback (Vgutter_size[new], - new == TOP_GUTTER || new == BOTTOM_GUTTER - ? Vdefault_gutter_height - : Vdefault_gutter_width); - set_specifier_fallback (Vgutter_border_width[cur], - list1 (Fcons (Qnil, Qzero))); - set_specifier_fallback (Vgutter_border_width[new], - Vdefault_gutter_border_width); - /* We don't realy want the left and right gutters to default to - visible. */ - set_specifier_fallback (Vgutter_visible_p[cur], - 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; -} - -DEFUN ("default-gutter-position", Fdefault_gutter_position, 0, 0, 0, /* -Return the position that the `default-gutter' will be displayed at. -The `default-gutter' will only be displayed here if the corresponding -position-specific gutter specifier does not provide a value. -*/ - ()) -{ - return Vdefault_gutter_position; -} - -DEFUN ("gutter-pixel-width", Fgutter_pixel_width, 0, 2, 0, /* -Return the pixel width of the gutter at POS in LOCALE. -POS defaults to the default gutter position. LOCALE defaults to -the current window. -*/ - (pos, locale)) -{ - int x, y, width, height; - enum gutter_pos p = TOP_GUTTER; - struct frame *f = decode_frame (FW_FRAME (locale)); - - if (NILP (pos)) - pos = Vdefault_gutter_position; - p = decode_gutter_position (pos); - - get_gutter_coords (f, p, &x, &y, &width, &height); - width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); - - return make_int (width); -} - -DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /* -Return the pixel height of the gutter at POS in LOCALE. -POS defaults to the default gutter position. LOCALE defaults to -the current window. -*/ - (pos, locale)) -{ - int x, y, width, height; - enum gutter_pos p = TOP_GUTTER; - struct frame *f = decode_frame (FW_FRAME (locale)); - - if (NILP (pos)) - pos = Vdefault_gutter_position; - p = decode_gutter_position (pos); - - get_gutter_coords (f, p, &x, &y, &width, &height); - height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); - - return make_int (height); -} - -DEFINE_SPECIFIER_TYPE (gutter); - -static void -gutter_after_change (Lisp_Object specifier, Lisp_Object locale) -{ - MARK_GUTTER_CHANGED; -} - -static void -gutter_validate (Lisp_Object instantiator) -{ - 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)) - { - 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. - -See `make-gutter-specifier' for a description of possible gutter -instantiators. -*/ - (object)) -{ - return GUTTER_SPECIFIERP (object) ? Qt : Qnil; -} - - -/* - Helper for invalidating the real specifier when default - specifier caching changes -*/ -static void -recompute_overlaying_specifier (Lisp_Object real_one[4]) -{ - enum gutter_pos pos = decode_gutter_position (Vdefault_gutter_position); - Fset_specifier_dirty_flag (real_one[pos]); -} - -static void -gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval, enum gutter_pos pos) -{ - w->real_gutter[pos] = construct_window_gutter_spec (w, pos); - w->real_gutter_size[pos] = w->gutter_size[pos]; - - if (EQ (w->real_gutter_size[pos], Qautodetect) - && !NILP (w->gutter_visible_p[pos])) - { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); - } - MARK_GUTTER_CHANGED; - MARK_MODELINE_CHANGED; - MARK_WINDOWS_CHANGED (w); -} - -/* 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) -{ - recompute_overlaying_specifier (Vgutter); -} - -static void -gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) -{ - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) - { - w->real_gutter_size[pos] = w->gutter_size[pos]; - if (EQ (w->real_gutter_size[pos], Qautodetect) - && !NILP (w->gutter_visible_p[pos])) - { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); - } - } - - MARK_GUTTER_CHANGED; - MARK_MODELINE_CHANGED; - MARK_WINDOWS_CHANGED (w); -} - -static void -default_gutter_size_changed_in_window (Lisp_Object specifier, struct window *w, - Lisp_Object oldval) -{ - recompute_overlaying_specifier (Vgutter_size); -} - -static void -default_gutter_border_width_changed_in_window (Lisp_Object specifier, - struct window *w, - Lisp_Object oldval) -{ - recompute_overlaying_specifier (Vgutter_border_width); -} - -static void -default_gutter_visible_p_changed_in_window (Lisp_Object specifier, - struct window *w, - 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); -} - - -DECLARE_SPECIFIER_TYPE (gutter_size); -#define GUTTER_SIZE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_size) -DEFINE_SPECIFIER_TYPE (gutter_size); - -static void -gutter_size_validate (Lisp_Object instantiator) -{ - if (NILP (instantiator)) - return; - - if (!INTP (instantiator) && !EQ (instantiator, Qautodetect)) - signal_simple_error ("Gutter size must be an integer or 'autodetect", instantiator); -} - -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. -*/ - ()) -{ - Lisp_Object devcons, concons; - - DEVICE_LOOP_NO_BREAK (devcons, concons) - { - struct device *d = XDEVICE (XCAR (devcons)); - Lisp_Object frmcons; - - DEVICE_FRAME_LOOP (frmcons, d) - { - struct frame *f = XFRAME (XCAR (frmcons)); - - 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); - - 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; -} - -void -init_frame_gutters (struct frame *f) -{ - enum gutter_pos pos; - struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); - /* We are here as far in frame creation so cached specifiers are - already recomputed, and possibly modified by resource - 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])) - { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); - MARK_GUTTER_CHANGED; - 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 -syms_of_gutter (void) -{ - 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); - DEFSUBR (Fgutter_pixel_width); - 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 -vars_of_gutter (void) -{ - staticpro (&Vdefault_gutter_position); - Vdefault_gutter_position = Qtop; - - Fprovide (Qgutter); -} - -void -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); - - INITIALIZE_SPECIFIER_TYPE (gutter_visible, "gutter-visible", "gutter-visible-specifier-p"); - SPECIFIER_HAS_METHOD (gutter_visible, validate); -} - -void -reinit_specifier_type_create_gutter (void) -{ - REINITIALIZE_SPECIFIER_TYPE (gutter); - REINITIALIZE_SPECIFIER_TYPE (gutter_size); - REINITIALIZE_SPECIFIER_TYPE (gutter_visible); -} - -void -specifier_vars_of_gutter (void) -{ - Lisp_Object fb; - - DEFVAR_SPECIFIER ("default-gutter", &Vdefault_gutter /* -Specifier for a fallback gutter. -Use `set-specifier' to change this. - -The position of this gutter is specified in the function -`default-gutter-position'. If the corresponding position-specific -gutter (e.g. `top-gutter' if `default-gutter-position' is 'top) -does not specify a gutter in a particular domain (usually a window), -then the value of `default-gutter' in that domain, if any, will be -used instead. - -Note that the gutter at any particular position will not be -displayed unless its visibility flag is true and its thickness -\(width or height, depending on orientation) is non-zero. The -visibility is controlled by the specifiers `top-gutter-visible-p', -`bottom-gutter-visible-p', `left-gutter-visible-p', and -`right-gutter-visible-p', and the thickness is controlled by the -specifiers `top-gutter-height', `bottom-gutter-height', -`left-gutter-width', and `right-gutter-width'. - -Note that one of the four visibility specifiers inherits from -`default-gutter-visibility' and one of the four thickness -specifiers inherits from either `default-gutter-width' or -`default-gutter-height' (depending on orientation), just -like for the gutter description specifiers (e.g. `top-gutter') -mentioned above. - -Therefore, if you are setting `default-gutter', you should control -the visibility and thickness using `default-gutter-visible-p', -`default-gutter-width', and `default-gutter-height', rather than -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, 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 - automatically knew about specifier fallbacks, so we didn't - have to do it ourselves. */ - set_specifier_caching (Vdefault_gutter, - offsetof (struct window, default_gutter), - default_gutter_specs_changed, - 0, 0); - - DEFVAR_SPECIFIER ("top-gutter", - &Vgutter[TOP_GUTTER] /* -Specifier for the gutter at the top of the frame. -Use `set-specifier' to change this. -See `default-gutter' for a description of a valid gutter instantiator. -*/ ); - Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[TOP_GUTTER], - offsetof (struct window, gutter[TOP_GUTTER]), - top_gutter_specs_changed, - 0, 0); - - DEFVAR_SPECIFIER ("bottom-gutter", - &Vgutter[BOTTOM_GUTTER] /* -Specifier for the gutter at the bottom of the frame. -Use `set-specifier' to change this. -See `default-gutter' for a description of a valid gutter instantiator. - -Note that, unless the `default-gutter-position' is `bottom', by -default the height of the bottom gutter (controlled by -`bottom-gutter-height') is 0; thus, a bottom gutter will not be -displayed even if you provide a value for `bottom-gutter'. -*/ ); - Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[BOTTOM_GUTTER], - offsetof (struct window, gutter[BOTTOM_GUTTER]), - bottom_gutter_specs_changed, - 0, 0); - - DEFVAR_SPECIFIER ("left-gutter", - &Vgutter[LEFT_GUTTER] /* -Specifier for the gutter at the left edge of the frame. -Use `set-specifier' to change this. -See `default-gutter' for a description of a valid gutter instantiator. - -Note that, unless the `default-gutter-position' is `left', by -default the height of the left gutter (controlled by -`left-gutter-width') is 0; thus, a left gutter will not be -displayed even if you provide a value for `left-gutter'. -*/ ); - Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[LEFT_GUTTER], - offsetof (struct window, gutter[LEFT_GUTTER]), - left_gutter_specs_changed, - 0, 0); - - DEFVAR_SPECIFIER ("right-gutter", - &Vgutter[RIGHT_GUTTER] /* -Specifier for the gutter at the right edge of the frame. -Use `set-specifier' to change this. -See `default-gutter' for a description of a valid gutter instantiator. - -Note that, unless the `default-gutter-position' is `right', by -default the height of the right gutter (controlled by -`right-gutter-width') is 0; thus, a right gutter will not be -displayed even if you provide a value for `right-gutter'. -*/ ); - Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); - set_specifier_caching (Vgutter[RIGHT_GUTTER], - offsetof (struct window, gutter[RIGHT_GUTTER]), - right_gutter_specs_changed, - 0, 0); - - /* initially, top inherits from default; this can be - changed with `set-default-gutter-position'. */ - fb = list1 (Fcons (Qnil, Qnil)); - set_specifier_fallback (Vdefault_gutter, fb); - set_specifier_fallback (Vgutter[TOP_GUTTER], Vdefault_gutter); - set_specifier_fallback (Vgutter[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter[RIGHT_GUTTER], fb); - - DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /* -*Height of the default gutter, if it's oriented horizontally. -This is a specifier; use `set-specifier' to change it. - -The position of the default gutter is specified by the function -`set-default-gutter-position'. If the corresponding position-specific -gutter thickness specifier (e.g. `top-gutter-height' if -`default-gutter-position' is 'top) does not specify a thickness in a -particular domain (a window or a frame), then the value of -`default-gutter-height' or `default-gutter-width' (depending on the -gutter orientation) in that domain, if any, will be used instead. - -Note that `default-gutter-height' is only used when -`default-gutter-position' is 'top or 'bottom, and `default-gutter-width' -is only used when `default-gutter-position' is 'left or 'right. - -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. - -If you set the height to 'autodetect the size of the gutter will be -calculated to be large enough to hold the contents of the gutter. This -is the default. -*/ ); - Vdefault_gutter_height = Fmake_specifier (Qgutter_size); - set_specifier_caching (Vdefault_gutter_height, - offsetof (struct window, default_gutter_height), - default_gutter_size_changed_in_window, - 0, 0); - - DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* -*Width of the default gutter, if it's oriented vertically. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - Vdefault_gutter_width = Fmake_specifier (Qnatnum); - set_specifier_caching (Vdefault_gutter_width, - offsetof (struct window, default_gutter_width), - default_gutter_size_changed_in_window, - 0, 0); - - DEFVAR_SPECIFIER ("top-gutter-height", - &Vgutter_size[TOP_GUTTER] /* -*Height of the top gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - 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); - - DEFVAR_SPECIFIER ("bottom-gutter-height", - &Vgutter_size[BOTTOM_GUTTER] /* -*Height of the bottom gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - 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); - - DEFVAR_SPECIFIER ("left-gutter-width", - &Vgutter_size[LEFT_GUTTER] /* -*Width of left gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - 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); - - DEFVAR_SPECIFIER ("right-gutter-width", - &Vgutter_size[RIGHT_GUTTER] /* -*Width of right gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - 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); - - fb = Qnil; -#ifdef HAVE_TTY - fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); -#endif -#ifdef HAVE_X_WINDOWS - fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); -#endif -#ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); - fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); -#endif - if (!NILP (fb)) - set_specifier_fallback (Vdefault_gutter_height, fb); - - fb = Qnil; -#ifdef HAVE_TTY - fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); -#endif -#ifdef HAVE_X_WINDOWS - fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_WIDTH)), fb); -#endif -#ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); - fb = Fcons (Fcons (list1 (Qmswindows), - make_int (DEFAULT_GUTTER_WIDTH)), fb); -#endif - if (!NILP (fb)) - set_specifier_fallback (Vdefault_gutter_width, fb); - - set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height); - fb = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vgutter_size[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter_size[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter_size[RIGHT_GUTTER], fb); - - DEFVAR_SPECIFIER ("default-gutter-border-width", - &Vdefault_gutter_border_width /* -*Width of the border around the default gutter. -This is a specifier; use `set-specifier' to change it. - -The position of the default gutter is specified by the function -`set-default-gutter-position'. If the corresponding position-specific -gutter border width specifier (e.g. `top-gutter-border-width' if -`default-gutter-position' is 'top) does not specify a border width in a -particular domain (a window or a frame), then the value of -`default-gutter-border-width' in that domain, if any, will be used -instead. - -*/ ); - Vdefault_gutter_border_width = Fmake_specifier (Qnatnum); - set_specifier_caching (Vdefault_gutter_border_width, - offsetof (struct window, default_gutter_border_width), - default_gutter_border_width_changed_in_window, - 0, 0); - - DEFVAR_SPECIFIER ("top-gutter-border-width", - &Vgutter_border_width[TOP_GUTTER] /* -*Border width of the top gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[TOP_GUTTER], - offsetof (struct window, - gutter_border_width[TOP_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); - - DEFVAR_SPECIFIER ("bottom-gutter-border-width", - &Vgutter_border_width[BOTTOM_GUTTER] /* -*Border width of the bottom gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], - offsetof (struct window, - gutter_border_width[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); - - DEFVAR_SPECIFIER ("left-gutter-border-width", - &Vgutter_border_width[LEFT_GUTTER] /* -*Border width of left gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], - offsetof (struct window, - gutter_border_width[LEFT_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); - - DEFVAR_SPECIFIER ("right-gutter-border-width", - &Vgutter_border_width[RIGHT_GUTTER] /* -*Border width of right gutter. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-height' for more information. -*/ ); - Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); - set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], - offsetof (struct window, - gutter_border_width[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); - - fb = Qnil; -#ifdef HAVE_TTY - fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); -#endif -#ifdef HAVE_X_WINDOWS - fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); -#endif -#ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); - fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); -#endif - if (!NILP (fb)) - set_specifier_fallback (Vdefault_gutter_border_width, fb); - - set_specifier_fallback (Vgutter_border_width[TOP_GUTTER], Vdefault_gutter_border_width); - fb = list1 (Fcons (Qnil, Qzero)); - set_specifier_fallback (Vgutter_border_width[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter_border_width[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter_border_width[RIGHT_GUTTER], fb); - - DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /* -*Whether the default gutter is visible. -This is a specifier; use `set-specifier' to change it. - -The position of the default gutter is specified by the function -`set-default-gutter-position'. If the corresponding position-specific -gutter visibility specifier (e.g. `top-gutter-visible-p' if -`default-gutter-position' is 'top) does not specify a visible-p value -in a particular domain (a window or a frame), then the value of -`default-gutter-visible-p' in that domain, if any, will be used -instead. - -`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 (Qgutter_visible); - set_specifier_caching (Vdefault_gutter_visible_p, - offsetof (struct window, - default_gutter_visible_p), - default_gutter_visible_p_changed_in_window, - 0, 0); - - DEFVAR_SPECIFIER ("top-gutter-visible-p", - &Vgutter_visible_p[TOP_GUTTER] /* -*Whether the top gutter is visible. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-visible-p' for more information. -*/ ); - 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]), - top_gutter_specs_changed, 0, 0); - - DEFVAR_SPECIFIER ("bottom-gutter-visible-p", - &Vgutter_visible_p[BOTTOM_GUTTER] /* -*Whether the bottom gutter is visible. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-visible-p' for more information. -*/ ); - 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]), - bottom_gutter_specs_changed, 0, 0); - - DEFVAR_SPECIFIER ("left-gutter-visible-p", - &Vgutter_visible_p[LEFT_GUTTER] /* -*Whether the left gutter is visible. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-visible-p' for more information. -*/ ); - 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]), - left_gutter_specs_changed, 0, 0); - - DEFVAR_SPECIFIER ("right-gutter-visible-p", - &Vgutter_visible_p[RIGHT_GUTTER] /* -*Whether the right gutter is visible. -This is a specifier; use `set-specifier' to change it. - -See `default-gutter-visible-p' for more information. -*/ ); - 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]), - right_gutter_specs_changed, 0, 0); - - /* initially, top inherits from default; this can be - changed with `set-default-gutter-position'. */ - fb = list1 (Fcons (Qnil, Qt)); - set_specifier_fallback (Vdefault_gutter_visible_p, fb); - set_specifier_fallback (Vgutter_visible_p[TOP_GUTTER], - Vdefault_gutter_visible_p); - set_specifier_fallback (Vgutter_visible_p[BOTTOM_GUTTER], fb); - set_specifier_fallback (Vgutter_visible_p[LEFT_GUTTER], fb); - set_specifier_fallback (Vgutter_visible_p[RIGHT_GUTTER], fb); -} diff -r 12e008d41344 -r 697ef44129c6 src/gutter.h --- a/src/gutter.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* Define general gutter support. - Copyright (C) 1999 Andy Piper. - -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_gutter_h_ -#define INCLUDED_gutter_h_ - -#include "specifier.h" - -#define DEVICE_SUPPORTS_GUTTERS_P(d) HAS_DEVMETH_P (d, output_frame_gutters) - -DECLARE_SPECIFIER_TYPE (gutter); -#define XGUTTER_SPECIFIER(x) XSPECIFIER_TYPE (x, gutter) -#define XSETGUTTER_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, gutter) -#define GUTTER_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter) -#define CHECK_GUTTER_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, gutter) -#define CONCHECK_GUTTER_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, gutter) - -#define DEFAULT_GUTTER_WIDTH 40 -#define DEFAULT_GUTTER_BORDER_WIDTH 2 - -enum gutter_pos -{ - TOP_GUTTER = 0, - BOTTOM_GUTTER = 1, - LEFT_GUTTER = 2, - RIGHT_GUTTER = 3 -}; - -/* Iterate over all possible gutter positions */ -#define GUTTER_POS_LOOP(var) \ -for (var = (enum gutter_pos) 0; var < 4; var = (enum gutter_pos) (var + 1)) - -extern Lisp_Object Qgutter; - -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); -void free_frame_gutters (struct frame *f); -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) \ - (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) -#define WINDOW_GUTTER_SIZE(w, pos) \ - (INTP ((w)->gutter_size[pos]) ? XINT ((w)->gutter_size[pos]) : 0) -#define WINDOW_GUTTER_SIZE_INTERNAL(w, 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]) -#define WINDOW_GUTTER(w, 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)) \ - ? WINDOW_GUTTER_SIZE_INTERNAL (w, pos) \ - : 0) -#define WINDOW_REAL_GUTTER_VISIBLE(f, pos) \ - (WINDOW_REAL_GUTTER_SIZE (f, pos) > 0) -#define WINDOW_REAL_GUTTER_BORDER_WIDTH(f, pos) \ - ((!NILP (WINDOW_GUTTER_VISIBLE (f, pos)) \ - && WINDOW_GUTTER_SIZE_INTERNAL (f,pos) > 0) \ - ? WINDOW_GUTTER_BORDER_WIDTH (f, pos) \ - : 0) -#define WINDOW_REAL_GUTTER_BOUNDS(f, pos) \ - (WINDOW_REAL_GUTTER_SIZE (f,pos) + \ - 2 * WINDOW_REAL_GUTTER_BORDER_WIDTH (f,pos)) - -/* these macros predicate size on position and type of window */ -#define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) -#define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) -#define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) -#define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) - -#define FRAME_GUTTER_VISIBLE(f, pos) \ - WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) -#define FRAME_GUTTER_SIZE(f, pos) \ - WINDOW_REAL_GUTTER_SIZE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) -#define FRAME_GUTTER_BOUNDS(f, pos) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) -#define FRAME_GUTTER_BORDER_WIDTH(f, pos) \ - WINDOW_REAL_GUTTER_BORDER_WIDTH (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) - -#define FRAME_GUTTER(f, pos) \ -WINDOW_GUTTER (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) - -/* these macros predicate size on position and type of window */ -#define FRAME_TOP_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), TOP_GUTTER) -#define FRAME_BOTTOM_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), BOTTOM_GUTTER) -#define FRAME_LEFT_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), LEFT_GUTTER) -#define FRAME_RIGHT_GUTTER_BOUNDS(f) \ - WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), RIGHT_GUTTER) - -#endif /* INCLUDED_gutter_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/hash.c --- a/src/hash.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/hash.c Mon Aug 13 11:20:41 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,25 +52,6 @@ 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) @@ -78,7 +59,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, @@ -104,8 +85,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) { @@ -123,7 +104,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) : @@ -207,7 +188,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) { @@ -226,8 +207,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)) { @@ -288,7 +269,7 @@ } void -remhash (const void *key, struct hash_table *hash_table) +remhash (CONST void *key, struct hash_table *hash_table) { if (!key) { @@ -306,7 +287,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 12e008d41344 -r 697ef44129c6 src/hash.h --- a/src/hash.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/hash.h Mon Aug 13 11:20:41 2007 +0200 @@ -17,17 +17,17 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_hash_h_ -#define INCLUDED_hash_h_ +#ifndef _HASH_H_ +#define _HASH_H_ 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 */ @@ -78,4 +78,4 @@ void map_remhash (remhash_predicate predicate, struct hash_table *hash_table, void *arg); -#endif /* INCLUDED_hash_h_ */ +#endif /* _HASH_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/hpplay.c --- a/src/hpplay.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/hpplay.c Mon Aug 13 11:20:41 2007 +0200 @@ -51,8 +51,6 @@ #include <config.h> #include "lisp.h" -#include "nativesound.h" - #include <stdlib.h> #include <stdio.h> #ifdef HPUX10 @@ -63,7 +61,6 @@ #include <audio/CUlib.h> #endif /* !HPUX 10 */ - Lisp_Object Vhp_play_server; Lisp_Object Vhp_play_speaker; int hp_play_gain; @@ -205,11 +202,11 @@ play_bucket_internal(audio, pSBucket, volume); - ASetErrorHandler(prevHandler); + ASetErrorHandler(prevHandler); } -int +void play_sound_data (data, length, volume) unsigned char * data; int length; @@ -221,17 +218,7 @@ SunHeader *header; long status; char *server; - int result; - /* #### Finish this to return an error code. - This function signal a lisp error. How consistent with the rest. - What if this function is needed in doing the beep for the error? - - Apparently the author of this didn't read the comment in - Fplay_sound. - */ - - if (STRINGP (Vhp_play_server)) server = (char *) XSTRING_DATA (Vhp_play_server); server = ""; @@ -263,8 +250,6 @@ ASetErrorHandler(prevHandler); if (status) player_error_internal( audio, "Audio data copy failed", status ); - - return 1; } void diff -r 12e008d41344 -r 697ef44129c6 src/imgproc.h --- a/src/imgproc.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/imgproc.h Mon Aug 13 11:20:41 2007 +0200 @@ -18,9 +18,6 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef INCLUDED_imgproc_h_ -#define INCLUDED_imgproc_h_ - /* Synched up with: Not in FSF. */ /* Original author: Jareth Hein */ @@ -63,5 +60,3 @@ #define QUANT_GET_COLOR(qt,r,g,b) (qt->histogram[r>>COLOR_SHIFT][g>>COLOR_SHIFT][b>>COLOR_SHIFT]) quant_table *build_EImage_quantable(unsigned char *eimage, int width, int height, int num_colors); - -#endif /* INCLUDED_imgproc_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/indent.c --- a/src/indent.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/indent.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,8 +40,6 @@ #endif #include "window.h" -Lisp_Object Qcoerce; - /* Indentation can insert tabs if this is non-zero; otherwise always uses spaces */ int indent_tabs_mode; @@ -195,53 +193,6 @@ } int -string_column_at_point (Lisp_String* s, Bufpos init_pos, int tab_width) -{ - int col; - int tab_seen; - int post_tab; - Bufpos pos = init_pos; - Emchar c; - - if (tab_width <= 0 || tab_width > 1000) tab_width = 8; - col = tab_seen = post_tab = 0; - - while (1) - { - if (pos <= 0) - break; - - pos--; - c = string_char (s, pos); - if (c == '\t') - { - if (tab_seen) - col = ((col + tab_width) / tab_width) * tab_width; - - post_tab += col; - col = 0; - tab_seen = 1; - } - else if (c == '\n') - break; - else -#ifdef MULE - col += XCHARSET_COLUMNS (CHAR_CHARSET (c)); -#else - col ++; -#endif /* MULE */ - } - - if (tab_seen) - { - col = ((col + tab_width) / tab_width) * tab_width; - col += post_tab; - } - - return col; -} - -int current_column (struct buffer *buf) { if (buf == last_known_column_buffer @@ -391,11 +342,9 @@ If specified column is within a character, point goes after that character. If it's past end of line, point goes to end of line. -A value of 'coerce for the second (optional) argument FORCE means if -COLUMN is in the middle of a tab character, change it to spaces. -Any other non-nil value means the same, plus if the line is too short to -reach column COLUMN, then add spaces/tabs to get there. - +A non-nil second (optional) argument FORCE means, if the line +is too short to reach column COLUMN then add spaces/tabs to get there, +and if COLUMN is in the middle of a tab character, change it to spaces. Returns the actual column that it moved to. */ (column, force, buffer)) @@ -479,7 +428,7 @@ } /* If line ends prematurely, add space to the end. */ - if (col < goal && !NILP (force) && !EQ (force, Qcoerce)) + if (col < goal && !NILP (force)) { col = goal; Findent_to (make_int (col), Qzero, buffer); @@ -592,7 +541,7 @@ assert (start <= end); assert (start >= 0); assert (end < Dynarr_length (cache)); - + vpix = 0; for (i = start; i <= end; i++) vpix += Dynarr_atp (cache, i)->height; @@ -716,7 +665,7 @@ if (NILP (window)) window = Fselected_window (Qnil); - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); CHECK_INT (lines); selected = (EQ (window, Fselected_window (Qnil))); @@ -732,7 +681,7 @@ bufpos = vmotion_1 (w, orig, XINT (lines), vpos, vpix); /* Note that the buffer's point is set, not the window's point. */ - if (selected) + if (selected) BUF_SET_PT (XBUFFER (w->buffer), bufpos); else set_marker_restricted (w->pointm[CURRENT_DISP], @@ -790,7 +739,7 @@ if (NILP (window)) window = Fselected_window (Qnil); - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); w = XWINDOW (window); eobuf = BUF_ZV (XBUFFER (w->buffer)); @@ -893,7 +842,7 @@ if (NILP (window)) window = Fselected_window (Qnil); - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); CHECK_INT (pixels); selected = (EQ (window, Fselected_window (Qnil))); @@ -907,7 +856,7 @@ bufpos = vmotion_pixels (window, orig, XINT (pixels), howto, &motion); - if (selected) + if (selected) BUF_SET_PT (XBUFFER (w->buffer), bufpos); else set_marker_restricted (w->pointm[CURRENT_DISP], @@ -930,8 +879,6 @@ #endif DEFSUBR (Fvertical_motion); DEFSUBR (Fvertical_motion_pixels); - - defsymbol (&Qcoerce, "coerce"); } void diff -r 12e008d41344 -r 697ef44129c6 src/inline.c --- a/src/inline.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/inline.c Mon Aug 13 11:20:41 2007 +0200 @@ -22,23 +22,23 @@ /* The purpose of this file is so that there is at least one actual definition of each inline function. This is needed under GCC. The - reason is that under GCC we declare our inline functions `inline - extern', which causes the inlined version to get used only for + reason is that under GCC we declare our inline functions `extern + inline', which causes the inlined version to get used only for inlining, and in other cases to generate an external reference to the function. This is more efficient than declaring our inline - functions `inline static', which (in many cases) would cause a separate + functions `static inline', which (in many cases) would cause a separate version of the function to get inserted into every source file that - included the corresponding header file. See internals.texi. + included the corresponding header file. Some compilers that recognize `inline' may not do the same - `inline extern' business, so on those we just do `inline static'. + `extern inline' business, so on those we just do `static inline'. */ /* Note to maintainers: This file contains a list of all header files that use the INLINE macro, either directly, or by using DECLARE_LRECORD. - i.e. the output of ``grep -l -w 'DECLARE_LRECORD|INLINE_HEADER' *.h'' */ + i.e. the output of ``grep -l -w 'DECLARE_LRECORD|INLINE' *.h'' */ -#define DONT_EXTERN_INLINE_HEADER_FUNCTIONS +#define DONT_EXTERN_INLINE_FUNCTIONS #include <config.h> #include "lisp.h" @@ -53,7 +53,6 @@ #include "faces.h" #include "frame.h" #include "glyphs.h" -#include "gui.h" #include "keymap.h" #include "lstream.h" #include "objects.h" @@ -68,10 +67,6 @@ #include "eldap.h" #endif -#ifdef HAVE_POSTGRESQL -#include "postgresql.h" -#endif - #ifdef HAVE_TOOLBARS #include "toolbar.h" #endif diff -r 12e008d41344 -r 697ef44129c6 src/input-method-motif.c --- a/src/input-method-motif.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/input-method-motif.c Mon Aug 13 11:20:41 2007 +0200 @@ -41,7 +41,7 @@ { char *locale; - /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc + /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc routine calls setlocale(LC_ALL, lang) which fucks up our lower-level locale management, and especially the value of LC_NUMERIC. Anyway, since at this point, we don't know yet whether we're gonna need an X11 frame, @@ -115,10 +115,9 @@ default face, rather than foreground and background resources, or that the user can use set-frame-parameters to set xic attributes */ -#define res(name, class, representation, field, default_value) \ - { name, class, representation, sizeof(xim_resources.field), \ - XtOffsetOf(xim_resources_t, field), \ - XtRString, (XtPointer) (default_value) } +#define res(name, class, representation, field, default_value) \ + { name, class, representation, sizeof(xim_resources.field), \ + XtOffsetOf(xim_resources_t, field), XtRString, default_value } static XtResource resources[] = { @@ -162,7 +161,7 @@ void XIM_SetSpotLocation (struct frame *f, int x, int y) { - /* #### FIX: Must make sure spot fits within Preedit Area */ + /* ### FIX: Must make sure spot fits within Preedit Area */ XPoint *spot = &(FRAME_X_XIC_SPOT (f)); if (spot->x == (short) x && spot->y == (short) y) diff -r 12e008d41344 -r 697ef44129c6 src/input-method-xfs.c --- a/src/input-method-xfs.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/input-method-xfs.c Mon Aug 13 11:20:41 2007 +0200 @@ -42,7 +42,7 @@ { char *locale; - /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc + /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc routine calls setlocale(LC_ALL, lang) which fucks up our lower-level locale management, and especially the value of LC_NUMERIC. Anyway, since at this point, we don't know yet whether we're gonna need an X11 frame, diff -r 12e008d41344 -r 697ef44129c6 src/input-method-xlib.c --- a/src/input-method-xlib.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/input-method-xlib.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,47 +27,6 @@ and X11 R6 release guide chapters on internationalized input, for further details */ -/* - Policy: - - The XIM is of the device, by the device, for the device. - The XIC is of each frame, by each frame, for each frame. - The exceptions are: - 1. Activate XICs on poor frames when the XIM is back. - 2. Deactivate all the XICs when the XIM go down. - - Methods: - - - Register a callback for an XIM when the X device is being initialized. - XIM_init_device (d) { XRegisterIMInstantiateCallback (); } - The "XRegisterIMInstantiateCallback" is called when an XIM become - available on the X display. - - - Catch the XIC when the frame is being initialized if XIM was available. - XIM_init_frame (f) { ... XCreateIC (); ... } - - - Release the XIC when the frame is being closed. - XIM_delete_frame (f) { ... FRAME_X_XIC (f) = NULL; ... } - "XIM_delete_frame" is a "DestroyCallback" function declared in - XIM_init_frame (); - - - Release all the XICs when the XIM was down accidentally. - In IMDestroyCallback: - DEVICE_FRAME_LOOP (...) { FRAME_X_XIC (f) = NULL; } - - - Re-enable XIC for all the frames which doesn't have XIC when the XIM - is back. - In IMInstantiateCallback: - DEVICE_FRAME_LOOP (...) { XIM_init_frame (f); } - - - Note: - - - Currently, we don't use XDestroyIC because of _XimProtoCloseIM - (internally registered as im->methods->close) does "Xfree (ic)". - - */ - #include <config.h> #include "lisp.h" #include <X11/Xlocale.h> /* More portable than <locale.h> ? */ @@ -79,19 +38,10 @@ #include "EmacsFrame.h" #include "events.h" -#ifdef THIS_IS_X11R6 -#include <X11/IntrinsicP.h> -#endif - #ifndef XIM_XLIB #error XIM_XLIB is not defined?? #endif -Lisp_Object Qxim_xlib; -#define xim_warn(str) warn_when_safe (Qxim_xlib, Qwarning, str); -#define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str); -#define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str); - /* Get/Set IC values for just one attribute */ #ifdef DEBUG_XEMACS #define XIC_Value(Get_Set, xic, name, attr, value) \ @@ -122,8 +72,6 @@ "XIMPreeditNone|XIMStatusNothing\n" "XIMPreeditNone|XIMStatusNone"; -static Boolean xim_initted = False; - static XIMStyle best_style (XIMStyles *user, XIMStyles *xim); void @@ -131,7 +79,7 @@ { char *locale; - /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc + /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc routine calls setlocale(LC_ALL, lang) which fucks up our lower-level locale management, and especially the value of LC_NUMERIC. Anyway, since at this point, we don't know yet whether we're gonna need an X11 frame, @@ -139,31 +87,31 @@ /*XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL);*/ if ((locale = setlocale (LC_ALL, "")) == NULL) { - xim_warn ("Can't set locale.\n" - "Using C locale instead.\n"); + stderr_out ("Can't set locale.\n"); + stderr_out ("Using C locale instead.\n"); putenv ("LANG=C"); putenv ("LC_ALL=C"); if ((locale = setlocale (LC_ALL, "C")) == NULL) { - xim_warn ("Can't even set locale to `C'!\n"); + stderr_out ("Can't even set locale to `C'!\n"); return; } } if (!XSupportsLocale ()) { - xim_warn1 ("X Windows does not support locale `%s'\n" - "Using C Locale instead\n", locale); + stderr_out ("X Windows does not support locale `%s'\n", locale); + stderr_out ("Using C Locale instead\n"); putenv ("LANG=C"); putenv ("LC_ALL=C"); if ((locale = setlocale (LC_ALL, "C")) == NULL) { - xim_warn ("Can't even set locale to `C'!\n"); + stderr_out ("Can't even set locale to `C'!\n"); return; } if (!XSupportsLocale ()) { - xim_warn ("X Windows does not even support locale `C'!\n"); + stderr_out ("X Windows does not even support locale `C'!\n"); return; } } @@ -172,148 +120,65 @@ if (XSetLocaleModifiers ("") == NULL) { - xim_warn ("XSetLocaleModifiers(\"\") failed\n" - "Check the value of the XMODIFIERS environment variable.\n"); + stderr_out ("XSetLocaleModifiers(\"\") failed\n"); + stderr_out ("Check the value of the XMODIFIERS environment variable.\n"); } } -#ifdef THIS_IS_X11R6 /* Callbacks for IM are supported from X11R6 or later. */ -/* Called from when XIM is destroying. - Clear all the XIC when the XIM was destroying... */ -static void -IMDestroyCallback (XIM im, XPointer client_data, XPointer call_data) -{ - struct device *d = (struct device *)client_data; - Lisp_Object tail; - - DEVICE_FRAME_LOOP (tail, d) - { - struct frame *target_frame = XFRAME (XCAR (tail)); - if (FRAME_X_P (target_frame) && FRAME_X_XIC (target_frame)) - { - /* XDestroyIC (FRAME_X_XIC (target_frame)); */ - FRAME_X_XIC (target_frame) = NULL; - } - } - - DEVICE_X_XIM (d) = NULL; - xim_initted = False; - return; -} - -/* This is registered in XIM_init_device (when DEVICE is initializing). - This activates XIM when XIM becomes available. */ -static void -IMInstantiateCallback (Display *dpy, XPointer client_data, XPointer call_data) -{ - struct device *d = (struct device *)client_data; - XIM xim; - char *name, *class; - XIMCallback ximcallback; - Lisp_Object tail; - - /* if no xim is presented, initialize xim ... */ - if ( xim_initted == False ) - { - xim_initted = True; - XtGetApplicationNameAndClass (dpy, &name, &class); - DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class); - - /* destroy callback for im */ - ximcallback.callback = IMDestroyCallback; - ximcallback.client_data = (XPointer) d; - XSetIMValues (xim, XNDestroyCallback, &ximcallback, NULL); - } - - /* activate XIC on all the X frames... */ - DEVICE_FRAME_LOOP (tail, d) - { - struct frame *target_frame = XFRAME (XCAR (tail)); - if (FRAME_X_P (target_frame) && !FRAME_X_XIC (target_frame)) - { - XIM_init_frame (target_frame); - } - } - return; -} -#endif /* if THIS_IS_X11R6 */ - -/* Initialize XIM for X device. - Register the use of XIM using XRegisterIMInstantiateCallback. */ +/* Create X input method for device */ void XIM_init_device (struct device *d) { -#ifdef THIS_IS_X11R6 - DEVICE_X_XIM (d) = NULL; - XRegisterIMInstantiateCallback (DEVICE_X_DISPLAY (d), NULL, NULL, NULL, - IMInstantiateCallback, (XPointer) d); - return; -#else Display *dpy = DEVICE_X_DISPLAY (d); char *name, *class; XIM xim; XtGetApplicationNameAndClass (dpy, &name, &class); + DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class); + if (xim == NULL) { - xim_warn ("XOpenIM() failed...no input server available\n"); + stderr_out ("Warning: XOpenIM() failed...no input server available\n"); return; } else { + /* Get supported styles */ XGetIMValues (xim, XNQueryInputStyle, &DEVICE_X_XIM_STYLES (d), NULL); - return; +#ifdef DEBUG_XIM + describe_XIM (xim); +#endif } -#endif } - -/* - * For the frames - */ - -/* Callback for the deleting frame. */ -static void -XIM_delete_frame (Widget w, XtPointer client_data, XtPointer call_data) -{ - struct frame *f = (struct frame *) client_data; - struct device *d = XDEVICE (FRAME_DEVICE (f)); - - if (DEVICE_X_XIM (d)) - { - if (FRAME_X_XIC (f)) - { - XDestroyIC (FRAME_X_XIC (f)); - FRAME_X_XIC (f) = NULL; - } - } - return; -} - -/* Initialize XIC for new frame. - Create an X input context (XIC) for this frame. */ +/* Create an X input context for this frame. */ void XIM_init_frame (struct frame *f) { struct device *d = XDEVICE (FRAME_DEVICE (f)); - XIM xim; + XIM xim = DEVICE_X_XIM (d); + XIC xic; Widget w = FRAME_X_TEXT_WIDGET (f); Window win = XtWindow (w); - XRectangle p_area = {0,0,1,1}, s_area = {0,0,1,1}; + XRectangle p_area = {0,0,1,1}, s_area={0,0,1,1}; XPoint spot = {0,0}; XIMStyle style; XVaNestedList p_list, s_list; + typedef struct { XIMStyles styles; XFontSet fontset; Pixel fg; Pixel bg; - char *inputmethod; } xic_vars_t; + xic_vars_t xic_vars; - XIC xic; + + /* mrb: #### Fix so that background and foreground is set from + default face, rather than foreground and background resources, or + that the user can use set-frame-parameters to set xic attributes */ #define res(name, class, representation, field, default_value) \ { name, class, representation, sizeof(xic_vars.field), \ @@ -328,70 +193,64 @@ res(XtNximBackground, XtCBackground, XtRPixel, bg, (XtPointer) XtDefaultBackground) }; - - xim = DEVICE_X_XIM (d); + assert (win != 0 && w != NULL && d != NULL); if (!xim) - { + { /* No input method? */ + FRAME_X_XIC (f) = NULL; return; } - w = FRAME_X_TEXT_WIDGET (f); - - /* - * initialize XIC - */ - if (FRAME_X_XIC (f)) return; XtGetApplicationResources (w, &xic_vars, resources, XtNumber (resources), NULL, 0); + if (!xic_vars.fontset) { - xim_warn ("Can't get fontset resource for Input Method\n"); + stderr_out ("Can't get fontset resource for Input Method\n"); FRAME_X_XIC (f) = NULL; return; } - /* construct xic */ - XGetIMValues (xim, XNQueryInputStyle, &DEVICE_X_XIM_STYLES(d), NULL); FRAME_X_XIC_STYLE (f) = style = - best_style (&xic_vars.styles, (XIMStyles *)DEVICE_X_XIM_STYLES(d)); + best_style (&xic_vars.styles, DEVICE_X_XIM_STYLES (d)); + /* Hopefully we don't have to conditionalize the following based on + style; the IM should ignore values it doesn't use */ p_list = XVaCreateNestedList (0, - XNArea, &p_area, - XNSpotLocation, &spot, - XNForeground, xic_vars.fg, - XNBackground, xic_vars.bg, - XNFontSet, xic_vars.fontset, - NULL); + XNArea, &p_area, + XNSpotLocation, &spot, + XNForeground, xic_vars.fg, + XNBackground, xic_vars.bg, + XNFontSet, xic_vars.fontset, + NULL); s_list = XVaCreateNestedList (0, - XNArea, &s_area, - XNForeground, xic_vars.fg, - XNBackground, xic_vars.bg, - XNFontSet, xic_vars.fontset, - NULL); - + XNArea, &s_area, + XNForeground, xic_vars.fg, + XNBackground, xic_vars.bg, + XNFontSet, xic_vars.fontset, + NULL); FRAME_X_XIC (f) = xic = XCreateIC (xim, - XNInputStyle, style, - XNClientWindow, win, - XNFocusWindow, win, - XNPreeditAttributes, p_list, - XNStatusAttributes, s_list, - NULL); + XNInputStyle, style, + XNClientWindow, win, + XNFocusWindow, win, + XNPreeditAttributes, p_list, + XNStatusAttributes, s_list, + NULL); XFree (p_list); XFree (s_list); if (!xic) { - xim_warn ("Warning: XCreateIC failed.\n"); + stderr_out ("Warning: XCreateIC failed\n"); return; } if (style & XIMPreeditPosition) - { - XPoint *frame_spot = &(FRAME_X_XIC_SPOT(f)); + { /* Init spot to invalid values */ + XPoint *frame_spot = &(FRAME_X_XIC_SPOT (f)); frame_spot->x = frame_spot->y = -1; } @@ -399,14 +258,11 @@ XSetICFocus (xic); -#ifdef THIS_IS_X11R6 - /* when frame is going to be destroyed (closed) */ - XtAddCallback (FRAME_X_TEXT_WIDGET(f), XNDestroyCallback, - XIM_delete_frame, (XtPointer)f); +#ifdef DEBUG_XIM + describe_XIC (xic); #endif } - void XIM_SetGeometry (struct frame *f) { @@ -480,7 +336,7 @@ spot->x = (short) x; spot->y = (short) y; - /* #### FIX: Must make sure spot fits within Preedit Area */ + /* ### FIX: Must make sure spot fits within Preedit Area */ XIC_Value (Set, xic, XNPreeditAttributes, XNSpotLocation, spot); #ifdef DEBUG_XIM stderr_out ("Spot: %d %d\n", spot->x, spot->y); @@ -490,7 +346,7 @@ void XIM_focus_event (struct frame *f, int in_p) { - if (FRAME_X_XIC (f) /* && FRAME_X_XIM_REGISTERED(f) */) + if (FRAME_X_XIC (f)) (in_p ? XSetICFocus : XUnsetICFocus) (FRAME_X_XIC (f)); } @@ -608,9 +464,9 @@ #define STYLE_INFO(style) { style, #style, sizeof(#style) } static struct XIMStyleInfo { - const XIMStyle style; - const char * const name; - const int namelen; + CONST XIMStyle style; + CONST char * CONST name; + CONST int namelen; } emacs_XIMStyleInfo[] = { STYLE_INFO (XIMPreeditPosition|XIMStatusArea), STYLE_INFO (XIMPreeditPosition|XIMStatusNothing), @@ -626,9 +482,9 @@ char *s = (char *) fromVal->addr; char *end = s + fromVal->size; - XIMStyles * const p = (XIMStyles *) toVal->addr; - const char * const delimiter = " \t\n\r:;," ; - const int max_styles = XtNumber(emacs_XIMStyleInfo); + XIMStyles * CONST p = (XIMStyles *) toVal->addr; + CONST char * CONST delimiter = " \t\n\r:;," ; + CONST int max_styles = XtNumber(emacs_XIMStyleInfo); int i; char *c; @@ -781,65 +637,6 @@ return DEFAULTStyle; /* Default Style */ } -/* These lisp-callable functions will be sealed until xim-leim is needed. - Oct 22 1999 - kazz */ -#if 0 -/* - * External callable function for XIM - */ -DEFUN ("x-open-xim", Fx_open_xim, 1, 1, 0, /* -Open the XIC on the frame if XIM is available. -Commonly, use this as \(x-open-xim \(selected-frame)). -If the frame is not on X device, return signal. -If XIC is created successfully return t. If not return nil. -*/ - (frame)) -{ - struct frame *f; - - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - if (!FRAME_X_P (f)) - return signal_simple_error ("This frame is not on X device", frame); - - XIM_init_frame (f); - return FRAME_X_XIC (f) ? Qt : Qnil; -} - -DEFUN ("x-close-xim", Fx_close_xim, 1, 1, 0, /* -Close the XIC on the frame if it exists. -Commonly, use this as \(x-close-xim \(selected-frame)). -If the frame is not on X device, return signal. -Otherwise, it destroys the XIC if it exists, then returns t anyway. -*/ - (frame)) -{ - struct frame *f; - struct device *d; - - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - if (!FRAME_X_P (f)) - return signal_simple_error ("This frame is not on X device", frame); - - d = XDEVICE (FRAME_DEVICE (f)); - if (DEVICE_X_XIM (d)) { - /* XDestroyIC (FRAME_X_XIC (XFRAME (f))); */ - FRAME_X_XIC (XFRAME (f)) = NULL; - } - return Qt; -} -#endif /* if 0 */ - -void -syms_of_input_method_xlib (void) -{ - defsymbol (&Qxim_xlib, "xim-xlib"); -#if 0 /* see above */ - DEFSUBR (Fx_open_xim); - DEFSUBR (Fx_close_xim); -#endif -} void vars_of_input_method_xlib (void) diff -r 12e008d41344 -r 697ef44129c6 src/insdel.c --- a/src/insdel.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/insdel.c Mon Aug 13 11:20:41 2007 +0200 @@ -200,6 +200,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "device.h" @@ -303,64 +304,65 @@ the equivalent length in characters. */ Charcount -bytecount_to_charcount (const Bufbyte *ptr, Bytecount len) +bytecount_to_charcount (CONST Bufbyte *ptr, Bytecount len) { Charcount count = 0; - const Bufbyte *end = ptr + len; - -#if SIZEOF_LONG == 8 -# define STRIDE_TYPE long -# define HIGH_BIT_MASK 0x8080808080808080UL -#elif SIZEOF_LONG_LONG == 8 && !(defined (i386) || defined (__i386__)) -# define STRIDE_TYPE long long -# define HIGH_BIT_MASK 0x8080808080808080ULL -#elif SIZEOF_LONG == 4 -# define STRIDE_TYPE long -# define HIGH_BIT_MASK 0x80808080UL -#else -# error Add support for 128-bit systems here -#endif - -#define ALIGN_BITS ((EMACS_UINT) (ALIGNOF (STRIDE_TYPE) - 1)) -#define ALIGN_MASK (~ ALIGN_BITS) -#define ALIGNED(ptr) ((((EMACS_UINT) ptr) & ALIGN_BITS) == 0) -#define STRIDE sizeof (STRIDE_TYPE) - + CONST Bufbyte *end = ptr + len; + +#if (LONGBITS == 32 || LONGBITS == 64) + +# if (LONGBITS == 32) +# define LONG_BYTES 4 +# define ALIGN_MASK 0xFFFFFFFCU +# define HIGH_BIT_MASK 0x80808080U +# else +# define LONG_BYTES 8 +# define ALIGN_MASK 0xFFFFFFFFFFFFFFF8UL + /* I had a dream, I was being overrun with early Intel processors ... */ +# define HIGH_BIT_MASK 0x8080808080808080UL +# endif + + /* When we have a large number of bytes to scan, we can be trickier + and significantly faster by scanning them in chunks of the CPU word + size (assuming that they're all ASCII -- we cut out as soon as + we find something non-ASCII). */ + if (len >= 12) + { + /* Determine the section in the middle of the string that's + amenable to this treatment. Everything has to be aligned + on CPU word boundaries. */ + CONST Bufbyte *aligned_ptr = + (CONST Bufbyte *) (((unsigned long) (ptr + LONG_BYTES - 1)) & + ALIGN_MASK); + CONST Bufbyte *aligned_end = + (CONST Bufbyte *) (((unsigned long) end) & ALIGN_MASK); + + /* Handle unaligned stuff at the beginning. */ + while (ptr < aligned_ptr) + { + if (!BYTE_ASCII_P (*ptr)) + goto bail; + count++, ptr++; + } + /* Now do it. */ + while (ptr < aligned_end) + { + + if ((* (unsigned long *) ptr) & HIGH_BIT_MASK) + goto bail; + ptr += LONG_BYTES; + count += LONG_BYTES; + } + } + +#endif /* LONGBITS == 32 || LONGBITS == 64 */ + + bail: while (ptr < end) { - if (BYTE_ASCII_P (*ptr)) - { - /* optimize for long stretches of ASCII */ - if (! ALIGNED (ptr)) - ptr++, count++; - else - { - const unsigned STRIDE_TYPE *ascii_end = - (const unsigned STRIDE_TYPE *) ptr; - /* This loop screams, because we can typically - detect ASCII characters 8 at a time. */ - while ((const Bufbyte *) ascii_end + STRIDE <= end - && !(*ascii_end & HIGH_BIT_MASK)) - ascii_end++; - if ((Bufbyte *) ascii_end == ptr) - ptr++, count++; - else - { - count += (Bufbyte *) ascii_end - ptr; - ptr = (Bufbyte *) ascii_end; - } - } - } - else - { - /* optimize for successive characters from the same charset */ - Bufbyte leading_byte = *ptr; - size_t bytes = REP_BYTES_BY_FIRST_BYTE (leading_byte); - while ((ptr < end) && (*ptr == leading_byte)) - ptr += bytes, count++; - } + count++; + INC_CHARPTR (ptr); } - #ifdef ERROR_CHECK_BUFPOS /* Bomb out if the specified substring ends in the middle of a character. Note that we might have already gotten @@ -376,9 +378,9 @@ the equivalent length in bytes. */ Bytecount -charcount_to_bytecount (const Bufbyte *ptr, Charcount len) +charcount_to_bytecount (CONST Bufbyte *ptr, Charcount len) { - const Bufbyte *newptr = ptr; + CONST Bufbyte *newptr = ptr; while (len > 0) { @@ -1603,7 +1605,7 @@ adjust_markers (struct buffer *buf, Memind from, Memind to, Bytecount amount) { - Lisp_Marker *m; + struct Lisp_Marker *m; for (m = BUF_MARKERS (buf); m; m = marker_next (m)) m->memind = do_marker_adjustment (m->memind, from, to, amount); @@ -1615,7 +1617,7 @@ static void adjust_markers_for_insert (struct buffer *buf, Memind ind, Bytecount amount) { - Lisp_Marker *m; + struct Lisp_Marker *m; for (m = BUF_MARKERS (buf); m; m = marker_next (m)) { @@ -1629,6 +1631,18 @@ /* Routines for dealing with the gap */ /************************************************************************/ +/* XEmacs requires an ANSI C compiler, and it damn well better have a + working memmove() */ +#define GAP_USE_BCOPY +#ifdef BCOPY_UPWARD_SAFE +# undef BCOPY_UPWARD_SAFE +#endif +#ifdef BCOPY_DOWNWARD_SAFE +# undef BCOPY_DOWNWARD_SAFE +#endif +#define BCOPY_UPWARD_SAFE 1 +#define BCOPY_DOWNWARD_SAFE 1 + /* maximum amount of memory moved in a single chunk. Increasing this value improves gap-motion efficiency but decreases QUIT responsiveness time. Was 32000 but today's processors are faster and files are @@ -1669,15 +1683,23 @@ /* Move at most GAP_MOVE_CHUNK chars before checking again for a quit. */ if (i > GAP_MOVE_CHUNK) i = GAP_MOVE_CHUNK; - - if (i >= 128) +#ifdef GAP_USE_BCOPY + if (i >= 128 + /* bcopy is safe if the two areas of memory do not overlap + or on systems where bcopy is always safe for moving upward. */ + && (BCOPY_UPWARD_SAFE + || to - from >= 128)) { + /* If overlap is not safe, avoid it by not moving too many + characters at once. */ + if (!BCOPY_UPWARD_SAFE && i > to - from) + i = to - from; new_s1 -= i; - from -= i; - to -= i; + from -= i, to -= i; memmove (to, from, i); } else +#endif { new_s1 -= i; while (--i >= 0) @@ -1740,15 +1762,23 @@ /* Move at most GAP_MOVE_CHUNK chars before checking again for a quit. */ if (i > GAP_MOVE_CHUNK) i = GAP_MOVE_CHUNK; - - if (i >= 128) +#ifdef GAP_USE_BCOPY + if (i >= 128 + /* bcopy is safe if the two areas of memory do not overlap + or on systems where bcopy is always safe for moving downward. */ + && (BCOPY_DOWNWARD_SAFE + || from - to >= 128)) { + /* If overlap is not safe, avoid it by not moving too many + characters at once. */ + if (!BCOPY_DOWNWARD_SAFE && i > from - to) + i = from - to; new_s1 += i; memmove (to, from, i); - from += i; - to += i; + from += i, to += i; } else +#endif { new_s1 += i; while (--i >= 0) @@ -2027,12 +2057,7 @@ of the specified region, that will also be handled correctly. begin_multiple_change() returns a number (actually a specpdl depth) - that you must pass to end_multiple_change() when you are done. - - FSF Emacs 20 implements a similar feature, accessible from Lisp - through a `combine-after-change-calls' special form, which is - essentially equivalent to this function. We should consider - whether we want to introduce a similar Lisp form. */ + that you must pass to end_multiple_change() when you are done. */ int begin_multiple_change (struct buffer *buf, Bufpos start, Bufpos end) @@ -2080,8 +2105,7 @@ /* We should first reset the variable and then change the buffer, because Fset_buffer() can throw. */ inside_change_hook = 0; - if (XBUFFER (buffer) != current_buffer) - Fset_buffer (buffer); + Fset_buffer (buffer); return Qnil; } @@ -2131,7 +2155,6 @@ if (!inside_change_hook) { Lisp_Object buffer; - int speccount; /* Are we in a multiple-change session? */ if (buf->text->changes->in_multiple_change && @@ -2169,9 +2192,6 @@ } /* Now in any case run the before-change-functions if any. */ - speccount = specpdl_depth (); - record_unwind_protect (change_function_restore, Fcurrent_buffer ()); - inside_change_hook = 1; MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { @@ -2180,28 +2200,25 @@ /* Obsolete, for compatibility */ || !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer))) { + int speccount = specpdl_depth (); + record_unwind_protect (change_function_restore, Fcurrent_buffer ()); set_buffer_internal (buf); + inside_change_hook = 1; va_run_hook_with_args (Qbefore_change_functions, 2, make_int (start), make_int (end)); /* Obsolete, for compatibility */ va_run_hook_with_args (Qbefore_change_function, 2, make_int (start), make_int (end)); + unbind_to (speccount, Qnil); } } - /* Make sure endpoints remain valid. before-change-functions - might have modified the buffer. */ - if (start < BUF_BEGV (buf)) start = BUF_BEGV (buf); - if (start > BUF_ZV (buf)) start = BUF_ZV (buf); - if (end < BUF_BEGV (buf)) end = BUF_BEGV (buf); - if (end > BUF_ZV (buf)) end = BUF_ZV (buf); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { XSETBUFFER (buffer, mbuf); - report_extent_modification (buffer, start, end, 0); + report_extent_modification (buffer, start, end, + &inside_change_hook, 0); } - unbind_to (speccount, Qnil); /* Only now do we indicate that the before-change-functions have been called, in case some function throws out. */ @@ -2238,7 +2255,6 @@ if (!inside_change_hook) { Lisp_Object buffer; - int speccount; if (buf->text->changes->in_multiple_change && buf->text->changes->mc_begin != 0) @@ -2251,9 +2267,6 @@ return; /* after-change-functions signalled when all changes done */ } - speccount = specpdl_depth (); - record_unwind_protect (change_function_restore, Fcurrent_buffer ()); - inside_change_hook = 1; MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { XSETBUFFER (buffer, mbuf); @@ -2262,7 +2275,10 @@ /* Obsolete, for compatibility */ || !NILP (symbol_value_in_buffer (Qafter_change_function, buffer))) { + int speccount = specpdl_depth (); + record_unwind_protect (change_function_restore, Fcurrent_buffer ()); set_buffer_internal (buf); + inside_change_hook = 1; /* The actual after-change functions take slightly different arguments than what we were passed. */ va_run_hook_with_args (Qafter_change_functions, 3, @@ -2272,24 +2288,16 @@ va_run_hook_with_args (Qafter_change_function, 3, make_int (start), make_int (new_end), make_int (orig_end - start)); + unbind_to (speccount, Qnil); } } - /* Make sure endpoints remain valid. after-change-functions - might have modified the buffer. */ - if (start < BUF_BEGV (buf)) start = BUF_BEGV (buf); - if (start > BUF_ZV (buf)) start = BUF_ZV (buf); - if (new_end < BUF_BEGV (buf)) new_end = BUF_BEGV (buf); - if (new_end > BUF_ZV (buf)) new_end = BUF_ZV (buf); - if (orig_end < BUF_BEGV (buf)) orig_end = BUF_BEGV (buf); - if (orig_end > BUF_ZV (buf)) orig_end = BUF_ZV (buf); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { XSETBUFFER (buffer, mbuf); - report_extent_modification (buffer, start, new_end, 1); + report_extent_modification (buffer, start, new_end, + &inside_change_hook, 1); } - unbind_to (speccount, Qnil); /* sets inside_change_hook back to 0 */ } } @@ -2369,7 +2377,7 @@ /************************************************************************/ void -fixup_internal_substring (const Bufbyte *nonreloc, Lisp_Object reloc, +fixup_internal_substring (CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount *len) { assert ((nonreloc && NILP (reloc)) || (!nonreloc && STRINGP (reloc))); @@ -2377,7 +2385,7 @@ if (*len < 0) { if (nonreloc) - *len = strlen ((const char *) nonreloc) - offset; + *len = strlen ((CONST char *) nonreloc) - offset; else *len = XSTRING_LENGTH (reloc) - offset; } @@ -2411,7 +2419,7 @@ Charcount buffer_insert_string_1 (struct buffer *buf, Bufpos pos, - const Bufbyte *nonreloc, Lisp_Object reloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int flags) { @@ -2576,7 +2584,7 @@ Charcount buffer_insert_raw_string_1 (struct buffer *buf, Bufpos pos, - const Bufbyte *nonreloc, Bytecount length, + CONST Bufbyte *nonreloc, Bytecount length, int flags) { /* This function can GC */ @@ -2600,12 +2608,12 @@ /* Insert the null-terminated string S (in external format). */ Charcount -buffer_insert_c_string_1 (struct buffer *buf, Bufpos pos, const char *s, +buffer_insert_c_string_1 (struct buffer *buf, Bufpos pos, CONST char *s, int flags) { /* This function can GC */ - const char *translated = GETTEXT (s); - return buffer_insert_string_1 (buf, pos, (const Bufbyte *) translated, Qnil, + CONST char *translated = GETTEXT (s); + return buffer_insert_string_1 (buf, pos, (CONST Bufbyte *) translated, Qnil, 0, strlen (translated), flags); } @@ -3071,23 +3079,16 @@ } void -find_charsets_in_bufbyte_string (unsigned char *charsets, const Bufbyte *str, +find_charsets_in_bufbyte_string (unsigned char *charsets, CONST Bufbyte *str, Bytecount len) { #ifndef MULE /* Telescope this. */ charsets[0] = 1; #else - const Bufbyte *strend = str + len; + CONST Bufbyte *strend = str + len; memset (charsets, 0, NUM_LEADING_BYTES); - /* #### SJT doesn't like this. */ - if (len == 0) - { - charsets[XCHARSET_LEADING_BYTE (Vcharset_ascii) - 128] = 1; - return; - } - while (str < strend) { charsets[CHAR_LEADING_BYTE (charptr_emchar (str)) - 128] = 1; @@ -3097,7 +3098,7 @@ } void -find_charsets_in_emchar_string (unsigned char *charsets, const Emchar *str, +find_charsets_in_emchar_string (unsigned char *charsets, CONST Emchar *str, Charcount len) { #ifndef MULE @@ -3107,14 +3108,6 @@ int i; memset (charsets, 0, NUM_LEADING_BYTES); - - /* #### SJT doesn't like this. */ - if (len == 0) - { - charsets[XCHARSET_LEADING_BYTE (Vcharset_ascii) - 128] = 1; - return; - } - for (i = 0; i < len; i++) { charsets[CHAR_LEADING_BYTE (str[i]) - 128] = 1; @@ -3123,10 +3116,10 @@ } int -bufbyte_string_displayed_columns (const Bufbyte *str, Bytecount len) +bufbyte_string_displayed_columns (CONST Bufbyte *str, Bytecount len) { int cols = 0; - const Bufbyte *end = str + len; + CONST Bufbyte *end = str + len; while (str < end) { @@ -3143,7 +3136,7 @@ } int -emchar_string_displayed_columns (const Emchar *str, Charcount len) +emchar_string_displayed_columns (CONST Emchar *str, Charcount len) { #ifdef MULE int cols = 0; @@ -3161,10 +3154,10 @@ /* NOTE: Does not reset the Dynarr. */ void -convert_bufbyte_string_into_emchar_dynarr (const Bufbyte *str, Bytecount len, +convert_bufbyte_string_into_emchar_dynarr (CONST Bufbyte *str, Bytecount len, Emchar_dynarr *dyn) { - const Bufbyte *strend = str + len; + CONST Bufbyte *strend = str + len; while (str < strend) { @@ -3175,10 +3168,10 @@ } Charcount -convert_bufbyte_string_into_emchar_string (const Bufbyte *str, Bytecount len, +convert_bufbyte_string_into_emchar_string (CONST Bufbyte *str, Bytecount len, Emchar *arr) { - const Bufbyte *strend = str + len; + CONST Bufbyte *strend = str + len; Charcount newlen = 0; while (str < strend) { @@ -3241,7 +3234,7 @@ /************************************************************************/ void -reinit_vars_of_insdel (void) +vars_of_insdel (void) { int i; @@ -3253,12 +3246,6 @@ } void -vars_of_insdel (void) -{ - reinit_vars_of_insdel (); -} - -void init_buffer_text (struct buffer *b) { if (!b->base_buffer) diff -r 12e008d41344 -r 697ef44129c6 src/insdel.h --- a/src/insdel.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/insdel.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Mostly rewritten by Ben Wing. */ -#ifndef INCLUDED_insdel_h_ -#define INCLUDED_insdel_h_ +#ifndef _XEMACS_INSDEL_H_ +#define _XEMACS_INSDEL_H_ /************************************************************************/ /* changing a buffer's text */ @@ -38,16 +38,16 @@ #define INSDEL_NO_LOCKING 2 Charcount buffer_insert_string_1 (struct buffer *buf, Bufpos pos, - const Bufbyte *nonreloc, Lisp_Object reloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int flags); Charcount buffer_insert_raw_string_1 (struct buffer *buf, Bufpos pos, - const Bufbyte *nonreloc, + CONST Bufbyte *nonreloc, Bytecount length, int flags); Charcount buffer_insert_lisp_string_1 (struct buffer *buf, Bufpos pos, Lisp_Object str, int flags); Charcount buffer_insert_c_string_1 (struct buffer *buf, Bufpos pos, - const char *s, int flags); + CONST char *s, int flags); Charcount buffer_insert_emacs_char_1 (struct buffer *buf, Bufpos pos, Emchar ch, int flags); Charcount buffer_insert_c_char_1 (struct buffer *buf, Bufpos pos, char c, @@ -140,11 +140,11 @@ /************************************************************************/ Memind do_marker_adjustment (Memind mpos, Memind from, - Memind to, Bytecount amount); + Memind to, int amount); -void fixup_internal_substring (const Bufbyte *nonreloc, +void fixup_internal_substring (CONST Bufbyte *nonreloc, Lisp_Object reloc, - Bytecount offset, Bytecount *len); + int offset, int *len); /* In font-lock.c */ void font_lock_maybe_update_syntactic_caches (struct buffer *buf, @@ -159,4 +159,4 @@ void init_buffer_text (struct buffer *b); void uninit_buffer_text (struct buffer *b); -#endif /* INCLUDED_insdel_h_ */ +#endif /* _XEMACS_INSDEL_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/intl.c --- a/src/intl.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/intl.c Mon Aug 13 11:20:41 2007 +0200 @@ -45,7 +45,7 @@ /* init_input -- Set things up for i18n level 4 input. */ void -init_input (const char *res_name, const char *res_class, Display *display) +init_input (CONST char *res_name, CONST char *res_class, Display *display) { XIMStyles *styles; unsigned short i; @@ -165,6 +165,7 @@ #endif /* I18N4 */ +Lisp_Object Qdomain; Lisp_Object Qdefer_gettext; DEFUN ("ignore-defer-gettext", Fignore_defer_gettext, 1, 1, 0, /* @@ -273,7 +274,14 @@ { CHECK_STRING (domain_name); if (load_in_progress) - return (domain_name); + { +#ifdef I18N3 + Vfile_domain = Fpurecopy (domain_name); + return Vfile_domain; +#else + return (domain_name); +#endif + } else return Qnil; } @@ -299,6 +307,8 @@ void syms_of_intl (void) { + defsymbol (&Qdomain, "domain"); + /* defer-gettext is defined as a symbol because when it is used in menu specification strings, it is not evaluated as a function by menu_item_descriptor_to_widget_value(). */ diff -r 12e008d41344 -r 697ef44129c6 src/iso-wide.h --- a/src/iso-wide.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/iso-wide.h Mon Aug 13 11:20:41 2007 +0200 @@ -17,8 +17,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_iso_wide_h_ -#define INCLUDED_iso_wide_h_ +#ifndef _XEMACS_ISO_WIDE_H +#define _XEMACS_ISO_WIDE_H /* The following macros are designed for SunOS 5.0 wide characters, in which the single byte ISO Latin-1 character 1xxxxxxx are represented @@ -46,4 +46,4 @@ #define WIDE_TO_BYTE(c) (IS_ISO_WIDE (c) ? ISO_WIDE_TO_BYTE (c) : (c)) #define BYTE_TO_WIDE(c) (IS_ISO_BYTE (c) ? ISO_BYTE_TO_WIDE (c) : (c)) -#endif /* INCLUDED_iso_wide_h_ */ +#endif /* _XEMACS_ISO_WIDE_H */ diff -r 12e008d41344 -r 697ef44129c6 src/keymap.c --- a/src/keymap.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/keymap.c Mon Aug 13 11:20:41 2007 +0200 @@ -37,6 +37,17 @@ #include "insdel.h" #include "keymap.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" @@ -88,25 +99,25 @@ If the key `C-a' was bound to some command, the hierarchy would look like - keymap-1: associates the integer XEMACS_MOD_CONTROL with keymap-2 + keymap-1: associates the integer MOD_CONTROL with keymap-2 keymap-2: associates "a" with the command Similarly, if the key `C-H-a' was bound to some command, the hierarchy would look like - keymap-1: associates the integer (XEMACS_MOD_CONTROL | XEMACS_MOD_HYPER) + keymap-1: associates the integer (MOD_CONTROL | MOD_HYPER) with keymap-2 keymap-2: associates "a" with the command Note that a special exception is made for the meta modifier, in order to deal with ESC/meta lossage. Any key combination containing the meta modifier is first indexed off of the main map into the meta - submap (with hash key XEMACS_MOD_META) and then indexed off of the + submap (with hash key MOD_META) and then indexed off of the meta submap with the meta modifier removed from the key combination. For example, when associating a command with C-M-H-a, we'd have - keymap-1: associates the integer XEMACS_MOD_META with keymap-2 - keymap-2: associates the integer (XEMACS_MOD_CONTROL | XEMACS_MOD_HYPER) + keymap-1: associates the integer MOD_META with keymap-2 + keymap-2: associates the integer (MOD_CONTROL | MOD_HYPER) with keymap-3 keymap-3: associates "a" with the command @@ -120,7 +131,7 @@ Note that this new model of keymaps takes much of the magic away from the Escape key: the value of the variable `esc-map' is no longer indexed in the `global-map' under the ESC key. It's indexed under the integer - XEMACS_MOD_META. This is not user-visible, however; none of the "bucky" + MOD_META. This is not user-visible, however; none of the "bucky" maps are. There is a hack in Flookup_key() that makes (lookup-key global-map "\^[") @@ -130,7 +141,7 @@ Since keymaps are opaque, the only way to extract information from them is with the functions lookup-key, key-binding, local-key-binding, and global-key-binding, which work just as before, and the new function - map-keymap, which is roughly analogous to maphash. + map-keymap, which is roughly analagous to maphash. Note that map-keymap perpetuates the illusion that the "bucky" submaps don't exist: if you map over a keymap with bucky submaps, it will also @@ -145,25 +156,33 @@ */ -struct Lisp_Keymap +typedef struct Lisp_Keymap { struct lcrecord_header header; - Lisp_Object parents; /* Keymaps to be searched after this one. - An ordered list */ + Lisp_Object parents; /* Keymaps to be searched after this one + * An ordered list */ Lisp_Object prompt; /* Qnil or a string to print in the minibuffer - when reading from this keymap */ + * when reading from this keymap */ + Lisp_Object table; /* The contents of this keymap */ Lisp_Object inverse_table; /* The inverse mapping of the above */ + Lisp_Object default_binding; /* Use this if no other binding is found - (this overrides parent maps and the - normal global-map lookup). */ + * (this overrides parent maps and the + * normal global-map lookup). */ + + Lisp_Object sub_maps_cache; /* Cache of directly inferior keymaps; This holds an alist, of the key and the maps, or the modifier bit and the map. If this is the symbol t, then the cache - needs to be recomputed. */ + needs to be recomputed. + */ + int fullness; /* How many entries there are in this table. + This should be the same as the fullness + of the `table', but hash.c is broken. */ Lisp_Object name; /* Just for debugging convenience */ -}; +} Lisp_Keymap; #define MAKE_MODIFIER_HASH_KEY(modifier) make_int (modifier) #define MODIFIER_HASH_KEY_BITS(x) (INTP (x) ? XINT (x) : 0) @@ -172,7 +191,7 @@ /* Actually allocate storage for these variables */ -Lisp_Object Vcurrent_global_map; /* Always a keymap */ +static Lisp_Object Vcurrent_global_map; /* Always a keymap */ static Lisp_Object Vmouse_grabbed_buffer; @@ -211,7 +230,6 @@ Lisp_Object shadow, int mice_only_p, Lisp_Object buffer); -static Lisp_Object keymap_submaps (Lisp_Object keymap); Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift; Lisp_Object Qbutton0, Qbutton1, Qbutton2, Qbutton3; @@ -234,15 +252,15 @@ /************************************************************************/ static Lisp_Object -mark_keymap (Lisp_Object obj) +mark_keymap (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lisp_Keymap *keymap = XKEYMAP (obj); - mark_object (keymap->parents); - mark_object (keymap->prompt); - mark_object (keymap->inverse_table); - mark_object (keymap->sub_maps_cache); - mark_object (keymap->default_binding); - mark_object (keymap->name); + markobj (keymap->parents); + markobj (keymap->prompt); + markobj (keymap->inverse_table); + markobj (keymap->sub_maps_cache); + markobj (keymap->default_binding); + markobj (keymap->name); return keymap->table; } @@ -252,34 +270,24 @@ /* This function can GC */ Lisp_Keymap *keymap = XKEYMAP (obj); char buf[200]; + int size = XINT (Fkeymap_fullness (obj)); if (print_readably) error ("printing unreadable object #<keymap 0x%x>", keymap->header.uid); write_c_string ("#<keymap ", printcharfun); if (!NILP (keymap->name)) - { - print_internal (keymap->name, printcharfun, 1); - write_c_string (" ", printcharfun); - } - sprintf (buf, "size %ld 0x%x>", - (long) XINT (Fkeymap_fullness (obj)), keymap->header.uid); + print_internal (keymap->name, printcharfun, 1); + /* #### Yuck! This is no way to form plural! --hniksic */ + sprintf (buf, "%s%d entr%s 0x%x>", + ((NILP (keymap->name)) ? "" : " "), + size, + ((size == 1) ? "y" : "ies"), + keymap->header.uid); write_c_string (buf, printcharfun); } -static const struct lrecord_description keymap_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, parents) }, - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, prompt) }, - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, table) }, - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, inverse_table) }, - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, default_binding) }, - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, sub_maps_cache) }, - { XD_LISP_OBJECT, offsetof (Lisp_Keymap, name) }, - { XD_END } -}; - /* No need for keymap_equal #### Why not? */ DEFINE_LRECORD_IMPLEMENTATION ("keymap", keymap, mark_keymap, print_keymap, 0, 0, 0, - keymap_description, Lisp_Keymap); /************************************************************************/ @@ -304,19 +312,19 @@ start_keymap = get_keymap (start_keymap, 1, 1); keymap = start_keymap; /* Hack special-case parents at top-level */ - tail = !NILP (tail) ? tail : XKEYMAP (keymap)->parents; + tail = ((!NILP (tail)) ? tail : XKEYMAP (keymap)->parents); for (;;) { Lisp_Object result; QUIT; - result = mapper (keymap, mapper_arg); + result = ((mapper) (keymap, mapper_arg)); if (!NILP (result)) { while (CONSP (malloc_bites)) { - Lisp_Cons *victim = XCONS (malloc_bites); + struct Lisp_Cons *victim = XCONS (malloc_bites); malloc_bites = victim->cdr; free_cons (victim); } @@ -333,7 +341,7 @@ stack_depth--; if (CONSP (malloc_bites)) { - Lisp_Cons *victim = XCONS (malloc_bites); + struct Lisp_Cons *victim = XCONS (malloc_bites); tail = victim->car; malloc_bites = victim->cdr; free_cons (victim); @@ -395,40 +403,40 @@ /* Some low-level functions */ /************************************************************************/ -static int +static unsigned int bucky_sym_to_bucky_bit (Lisp_Object sym) { - if (EQ (sym, Qcontrol)) return XEMACS_MOD_CONTROL; - if (EQ (sym, Qmeta)) return XEMACS_MOD_META; - if (EQ (sym, Qsuper)) return XEMACS_MOD_SUPER; - if (EQ (sym, Qhyper)) return XEMACS_MOD_HYPER; - if (EQ (sym, Qalt)) return XEMACS_MOD_ALT; - if (EQ (sym, Qsymbol)) return XEMACS_MOD_ALT; /* #### - reverse compat */ - if (EQ (sym, Qshift)) return XEMACS_MOD_SHIFT; + if (EQ (sym, Qcontrol)) return MOD_CONTROL; + if (EQ (sym, Qmeta)) return MOD_META; + if (EQ (sym, Qsuper)) return MOD_SUPER; + if (EQ (sym, Qhyper)) return MOD_HYPER; + if (EQ (sym, Qalt)) return MOD_ALT; + if (EQ (sym, Qsymbol)) return MOD_ALT; /* #### - reverse compat */ + if (EQ (sym, Qshift)) return MOD_SHIFT; return 0; } static Lisp_Object -control_meta_superify (Lisp_Object frob, int modifiers) +control_meta_superify (Lisp_Object frob, unsigned int modifiers) { if (modifiers == 0) return frob; frob = Fcons (frob, Qnil); - if (modifiers & XEMACS_MOD_SHIFT) frob = Fcons (Qshift, frob); - if (modifiers & XEMACS_MOD_ALT) frob = Fcons (Qalt, frob); - if (modifiers & XEMACS_MOD_HYPER) frob = Fcons (Qhyper, frob); - if (modifiers & XEMACS_MOD_SUPER) frob = Fcons (Qsuper, frob); - if (modifiers & XEMACS_MOD_CONTROL) frob = Fcons (Qcontrol, frob); - if (modifiers & XEMACS_MOD_META) frob = Fcons (Qmeta, frob); + if (modifiers & MOD_SHIFT) frob = Fcons (Qshift, frob); + if (modifiers & MOD_ALT) frob = Fcons (Qalt, frob); + if (modifiers & MOD_HYPER) frob = Fcons (Qhyper, frob); + if (modifiers & MOD_SUPER) frob = Fcons (Qsuper, frob); + if (modifiers & MOD_CONTROL) frob = Fcons (Qcontrol, frob); + if (modifiers & MOD_META) frob = Fcons (Qmeta, frob); return frob; } static Lisp_Object -make_key_description (const struct key_data *key, int prettify) +make_key_description (CONST struct key_data *key, int prettify) { Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; + unsigned int modifiers = key->modifiers; if (prettify && CHARP (keysym)) { @@ -453,18 +461,18 @@ static Lisp_Object raw_lookup_key (Lisp_Object keymap, - const struct key_data *raw_keys, int raw_keys_count, + CONST struct key_data *raw_keys, int raw_keys_count, int keys_so_far, int accept_default); /* Relies on caller to gc-protect args */ static Lisp_Object keymap_lookup_directly (Lisp_Object keymap, - Lisp_Object keysym, int modifiers) + Lisp_Object keysym, unsigned int modifiers) { Lisp_Keymap *k; - if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER - | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) != 0) + if ((modifiers & ~(MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER + | MOD_ALT | MOD_SHIFT)) != 0) abort (); k = XKEYMAP (keymap); @@ -477,14 +485,14 @@ keysym = i_fart_on_gcc; } - if (modifiers & XEMACS_MOD_META) /* Utterly hateful ESC lossage */ + if (modifiers & MOD_META) /* Utterly hateful ESC lossage */ { - Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), + Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), k->table, Qnil); if (NILP (submap)) return Qnil; k = XKEYMAP (submap); - modifiers &= ~XEMACS_MOD_META; + modifiers &= ~MOD_META; } if (modifiers != 0) @@ -568,57 +576,38 @@ */ } -/* Prevent luser from shooting herself in the foot using something like - (define-key ctl-x-4-map "p" global-map) */ -static void -check_keymap_definition_loop (Lisp_Object def, Lisp_Keymap *to_keymap) -{ - def = get_keymap (def, 0, 0); - - if (KEYMAPP (def)) - { - Lisp_Object maps; - - if (XKEYMAP (def) == to_keymap) - signal_simple_error ("Cyclic keymap definition", def); - - for (maps = keymap_submaps (def); - CONSP (maps); - maps = XCDR (maps)) - check_keymap_definition_loop (XCDR (XCAR (maps)), to_keymap); - } -} static void keymap_store_internal (Lisp_Object keysym, Lisp_Keymap *keymap, - Lisp_Object def) + Lisp_Object value) { - Lisp_Object prev_def = Fgethash (keysym, keymap->table, Qnil); - - if (EQ (prev_def, def)) + Lisp_Object prev_value = Fgethash (keysym, keymap->table, Qnil); + + if (EQ (prev_value, value)) return; - - check_keymap_definition_loop (def, keymap); - - if (!NILP (prev_def)) + if (!NILP (prev_value)) keymap_delete_inverse_internal (keymap->inverse_table, - keysym, prev_def); - if (NILP (def)) + keysym, prev_value); + if (NILP (value)) { + keymap->fullness--; + if (keymap->fullness < 0) abort (); Fremhash (keysym, keymap->table); } else { - Fputhash (keysym, def, keymap->table); + if (NILP (prev_value)) + keymap->fullness++; + Fputhash (keysym, value, keymap->table); keymap_store_inverse_internal (keymap->inverse_table, - keysym, def); + keysym, value); } keymap_tick++; } static Lisp_Object -create_bucky_submap (Lisp_Keymap *k, int modifiers, +create_bucky_submap (Lisp_Keymap *k, unsigned int modifiers, Lisp_Object parent_for_debugging_info) { Lisp_Object submap = Fmake_sparse_keymap (Qnil); @@ -634,29 +623,35 @@ /* Relies on caller to gc-protect keymap, keysym, value */ static void -keymap_store (Lisp_Object keymap, const struct key_data *key, +keymap_store (Lisp_Object keymap, CONST struct key_data *key, Lisp_Object value) { Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; - Lisp_Keymap *k = XKEYMAP (keymap); - - assert ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META - | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER - | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0); + unsigned int modifiers = key->modifiers; + Lisp_Keymap *k; + + if ((modifiers & ~(MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER + | MOD_ALT | MOD_SHIFT)) != 0) + abort (); + + k = XKEYMAP (keymap); /* If the keysym is a one-character symbol, use the char code instead. */ if (SYMBOLP (keysym) && string_char_length (XSYMBOL (keysym)->name) == 1) - keysym = make_char (string_char (XSYMBOL (keysym)->name, 0)); - - if (modifiers & XEMACS_MOD_META) /* Utterly hateful ESC lossage */ { - Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), + Lisp_Object run_the_gcc_developers_over_with_a_steamroller = + make_char (string_char (XSYMBOL (keysym)->name, 0)); + keysym = run_the_gcc_developers_over_with_a_steamroller; + } + + if (modifiers & MOD_META) /* Utterly hateful ESC lossage */ + { + Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), k->table, Qnil); if (NILP (submap)) - submap = create_bucky_submap (k, XEMACS_MOD_META, keymap); + submap = create_bucky_submap (k, MOD_META, keymap); k = XKEYMAP (submap); - modifiers &= ~XEMACS_MOD_META; + modifiers &= ~MOD_META; } if (modifiers != 0) @@ -757,6 +752,7 @@ keymap->inverse_table = Qnil; keymap->default_binding = Qnil; keymap->sub_maps_cache = Qnil; /* No possible submaps */ + keymap->fullness = 0; keymap->name = Qnil; if (size != 0) /* hack for copy-keymap */ @@ -1048,7 +1044,7 @@ struct key_data indirection; if (CHARP (idx)) { - Lisp_Event event; + struct Lisp_Event event; event.event_type = empty_event; character_to_event (XCHAR (idx), &event, XCONSOLE (Vselected_console), 0, 0); @@ -1059,7 +1055,7 @@ if (!INTP (XCDR (idx))) return Qnil; indirection.keysym = XCAR (idx); - indirection.modifiers = (unsigned char) XINT (XCDR (idx)); + indirection.modifiers = XINT (XCDR (idx)); } else if (SYMBOLP (idx)) { @@ -1090,7 +1086,7 @@ } static Lisp_Object -keymap_lookup_1 (Lisp_Object keymap, const struct key_data *key, +keymap_lookup_1 (Lisp_Object keymap, CONST struct key_data *key, int accept_default) { /* This function can GC */ @@ -1134,10 +1130,10 @@ copy_keymap_inverse_closure.inverse_table = keymap->inverse_table; new_keymap->parents = Fcopy_sequence (keymap->parents); + new_keymap->fullness = keymap->fullness; new_keymap->sub_maps_cache = Qnil; /* No submaps */ new_keymap->table = Fcopy_hash_table (keymap->table); new_keymap->inverse_table = Fcopy_hash_table (keymap->inverse_table); - new_keymap->default_binding = keymap->default_binding; /* After copying the inverse map, we need to copy the conses which are its values, lest they be shared by the copy, and mangled. */ @@ -1211,17 +1207,16 @@ struct gcpro gcpro1, gcpro2; keymap = get_keymap (keymap, 1, 1); - fullness = XINT (Fhash_table_count (XKEYMAP (keymap)->table)); + fullness = XKEYMAP (keymap)->fullness; + sub_maps = keymap_submaps (keymap); GCPRO2 (keymap, sub_maps); - for (sub_maps = keymap_submaps (keymap); - !NILP (sub_maps); - sub_maps = XCDR (sub_maps)) + for (; !NILP (sub_maps); sub_maps = XCDR (sub_maps)) { if (MODIFIER_HASH_KEY_BITS (XCAR (XCAR (sub_maps))) != 0) { - Lisp_Object bucky_map = XCDR (XCAR (sub_maps)); - fullness--; /* don't count bucky maps themselves. */ - fullness += keymap_fullness (bucky_map); + Lisp_Object sub_map = XCDR (XCAR (sub_maps)); + fullness--; /* don't count bucky maps */ + fullness += keymap_fullness (sub_map); } } UNGCPRO; @@ -1248,7 +1243,7 @@ static void define_key_check_and_coerce_keysym (Lisp_Object spec, Lisp_Object *keysym, - int modifiers) + unsigned int modifiers) { /* Now, check and massage the trailing keysym specifier. */ if (SYMBOLP (*keysym)) @@ -1271,19 +1266,21 @@ problems ... */ signal_simple_error ("keysym char must be printable", *keysym); /* #### This bites! I want to be able to write (control shift a) */ - if (modifiers & XEMACS_MOD_SHIFT) + if (modifiers & MOD_SHIFT) signal_simple_error ("The `shift' modifier may not be applied to ASCII keysyms", spec); } else { - signal_simple_error ("Unknown keysym specifier", *keysym); + signal_simple_error ("Unknown keysym specifier", + *keysym); } if (SYMBOLP (*keysym)) { - char *name = (char *) string_data (XSYMBOL (*keysym)->name); + char *name = (char *) + string_data (XSYMBOL (*keysym)->name); /* FSFmacs uses symbols with the printed representation of keysyms in their names, like 'M-x, and we use the syntax '(meta x). So, to avoid @@ -1346,8 +1343,6 @@ *keysym = QKescape; else if (EQ (*keysym, QDEL)) *keysym = QKdelete; - else if (EQ (*keysym, QSPC)) - *keysym = QKspace; else if (EQ (*keysym, QBS)) *keysym = QKbackspace; /* Emacs compatibility */ @@ -1387,7 +1382,7 @@ { if (CHAR_OR_CHAR_INTP (spec)) { - Lisp_Event event; + struct Lisp_Event event; event.event_type = empty_event; character_to_event (XCHAR_OR_CHAR_INT (spec), &event, XCONSOLE (Vselected_console), 0, 0); @@ -1448,14 +1443,14 @@ } else if (CONSP (spec)) { - int modifiers = 0; + unsigned int modifiers = 0; Lisp_Object keysym = Qnil; Lisp_Object rest = spec; /* First, parse out the leading modifier symbols. */ while (CONSP (rest)) { - int modifier; + unsigned int modifier; keysym = XCAR (rest); modifier = bucky_sym_to_bucky_bit (keysym); @@ -1535,7 +1530,8 @@ int -event_matches_key_specifier_p (Lisp_Event *event, Lisp_Object key_specifier) +event_matches_key_specifier_p (struct Lisp_Event *event, + Lisp_Object key_specifier) { Lisp_Object event2; int retval; @@ -1586,9 +1582,9 @@ } static int -meta_prefix_char_p (const struct key_data *key) +meta_prefix_char_p (CONST struct key_data *key) { - Lisp_Event event; + struct Lisp_Event event; event.event_type = key_press_event; event.channel = Vselected_console; @@ -1625,12 +1621,12 @@ struct key_data *returned_value) { Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; - int modifiers_sans_control = (modifiers & (~XEMACS_MOD_CONTROL)); - int modifiers_sans_meta = (modifiers & (~XEMACS_MOD_META)); + unsigned int modifiers = key->modifiers; + unsigned int modifiers_sans_control = (modifiers & (~MOD_CONTROL)); + unsigned int modifiers_sans_meta = (modifiers & (~MOD_META)); returned_value->keysym = Qnil; /* By default, no "alternate" key */ returned_value->modifiers = 0; - if (modifiers_sans_meta == XEMACS_MOD_CONTROL) + if (modifiers_sans_meta == MOD_CONTROL) { if EQ (keysym, QKspace) MACROLET (make_char ('@'), modifiers); @@ -1657,15 +1653,15 @@ else if (modifiers_sans_meta != 0) return; else if (EQ (keysym, QKbackspace)) /* backspace => c-h */ - MACROLET (make_char ('h'), (modifiers | XEMACS_MOD_CONTROL)); + MACROLET (make_char ('h'), (modifiers | MOD_CONTROL)); else if (EQ (keysym, QKtab)) /* tab => c-i */ - MACROLET (make_char ('i'), (modifiers | XEMACS_MOD_CONTROL)); + MACROLET (make_char ('i'), (modifiers | MOD_CONTROL)); else if (EQ (keysym, QKlinefeed)) /* linefeed => c-j */ - MACROLET (make_char ('j'), (modifiers | XEMACS_MOD_CONTROL)); + MACROLET (make_char ('j'), (modifiers | MOD_CONTROL)); else if (EQ (keysym, QKreturn)) /* return => c-m */ - MACROLET (make_char ('m'), (modifiers | XEMACS_MOD_CONTROL)); + MACROLET (make_char ('m'), (modifiers | MOD_CONTROL)); else if (EQ (keysym, QKescape)) /* escape => c-[ */ - MACROLET (make_char ('['), (modifiers | XEMACS_MOD_CONTROL)); + MACROLET (make_char ('['), (modifiers | MOD_CONTROL)); else return; #undef MACROLET @@ -1894,17 +1890,20 @@ (defvar my-escape-map (lookup-key my-map "\e")) if the luser really wants the map in a variable. */ - Lisp_Object meta_map; + Lisp_Object mmap; struct gcpro ngcpro1; NGCPRO1 (c); - meta_map = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), - XKEYMAP (keymap)->table, Qnil); - if (!NILP (meta_map) - && keymap_fullness (meta_map) != 0) - signal_simple_error_2 - ("Map contains meta-bindings, can't bind", - Fsingle_key_description (Vmeta_prefix_char), keymap); + mmap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), + XKEYMAP (keymap)->table, Qnil); + if (!NILP (mmap) + && keymap_fullness (mmap) != 0) + { + Lisp_Object desc + = Fsingle_key_description (Vmeta_prefix_char); + signal_simple_error_2 + ("Map contains meta-bindings, can't bind", desc, keymap); + } NUNGCPRO; } else @@ -1925,14 +1924,14 @@ if (metized) { - raw_key1.modifiers |= XEMACS_MOD_META; - raw_key2.modifiers |= XEMACS_MOD_META; + raw_key1.modifiers |= MOD_META; + raw_key2.modifiers |= MOD_META; metized = 0; } /* This crap is to make sure that someone doesn't bind something like "C-x M-a" while "C-x ESC" has a non-keymap binding. */ - if (raw_key1.modifiers & XEMACS_MOD_META) + if (raw_key1.modifiers & MOD_META) ensure_meta_prefix_char_keymapp (keys, idx, keymap); if (++idx == len) @@ -1982,7 +1981,7 @@ struct raw_lookup_key_mapper_closure { int remaining; - const struct key_data *raw_keys; + CONST struct key_data *raw_keys; int raw_keys_count; int keys_so_far; int accept_default; @@ -1993,7 +1992,7 @@ /* Caller should gc-protect args (keymaps may autoload) */ static Lisp_Object raw_lookup_key (Lisp_Object keymap, - const struct key_data *raw_keys, int raw_keys_count, + CONST struct key_data *raw_keys, int raw_keys_count, int keys_so_far, int accept_default) { /* This function can GC */ @@ -2016,7 +2015,7 @@ int accept_default = c->accept_default; int remaining = c->remaining; int keys_so_far = c->keys_so_far; - const struct key_data *raw_keys = c->raw_keys; + CONST struct key_data *raw_keys = c->raw_keys; Lisp_Object cmd; if (! meta_prefix_char_p (&(raw_keys[0]))) @@ -2055,7 +2054,7 @@ if (NILP (cmd)) { /* Do kludgy return of the meta-map */ - cmd = Fgethash (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), + cmd = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), XKEYMAP (k)->table, Qnil); } } @@ -2067,12 +2066,11 @@ if (!NILP (cmd)) cmd = raw_lookup_key (cmd, raw_keys + 1, remaining, keys_so_far + 1, accept_default); - else if ((raw_keys[1].modifiers & XEMACS_MOD_META) == 0) + else if ((raw_keys[1].modifiers & MOD_META) == 0) { struct key_data metified; metified.keysym = raw_keys[1].keysym; - metified.modifiers = raw_keys[1].modifiers | - (unsigned char) XEMACS_MOD_META; + metified.modifiers = raw_keys[1].modifiers | MOD_META; /* Search for meta-next-char sequence directly */ cmd = keymap_lookup_1 (k, &metified, accept_default); @@ -2108,7 +2106,7 @@ if (nkeys == 0) return Qnil; - if (nkeys < countof (kkk)) + if (nkeys < (countof (kkk))) raw_keys = kkk; else raw_keys = alloca_array (struct key_data, nkeys); @@ -2138,7 +2136,7 @@ nkeys = event_chain_count (event_head); - if (nkeys < countof (kkk)) + if (nkeys < (countof (kkk))) raw_keys = kkk; else raw_keys = alloca_array (struct key_data, nkeys); @@ -2364,7 +2362,8 @@ get_relevant_extent_keymaps (Fevent_modeline_position (terminal), XBUFFER (buffer)->generated_modeline_string, - Fevent_glyph_extent (terminal), &closure); + /* #### third arg should maybe be a glyph. */ + Qnil, &closure); if (!UNBOUNDP (map) && !NILP (map)) relevant_map_push (get_keymap (map, 1, 1), &closure); @@ -2732,9 +2731,9 @@ struct map_keymap_unsorted_closure { - void (*fn) (const struct key_data *, Lisp_Object binding, void *arg); + void (*fn) (CONST struct key_data *, Lisp_Object binding, void *arg); void *arg; - int modifiers; + unsigned int modifiers; }; /* used by map_keymap() */ @@ -2745,8 +2744,8 @@ /* This function can GC */ struct map_keymap_unsorted_closure *closure = (struct map_keymap_unsorted_closure *) map_keymap_unsorted_closure; - int modifiers = closure->modifiers; - int mod_bit; + unsigned int modifiers = closure->modifiers; + unsigned int mod_bit; mod_bit = MODIFIER_HASH_KEY_BITS (keysym); if (mod_bit != 0) { @@ -2796,7 +2795,7 @@ { /* obj1 and obj2 are conses with keysyms in their cars. Cdrs are ignored. */ - int bit1, bit2; + unsigned int bit1, bit2; int sym1_p = 0; int sym2_p = 0; obj1 = XCAR (obj1); @@ -2870,8 +2869,8 @@ /* used by map_keymap() */ static void map_keymap_sorted (Lisp_Object keymap_table, - int modifiers, - void (*function) (const struct key_data *key, + unsigned int modifiers, + void (*function) (CONST struct key_data *key, Lisp_Object binding, void *map_keymap_sorted_closure), void *map_keymap_sorted_closure) @@ -2895,7 +2894,7 @@ { Lisp_Object keysym = XCAR (XCAR (contents)); Lisp_Object binding = XCDR (XCAR (contents)); - int sub_bits = MODIFIER_HASH_KEY_BITS (keysym); + unsigned int sub_bits = MODIFIER_HASH_KEY_BITS (keysym); if (sub_bits != 0) map_keymap_sorted (XKEYMAP (get_keymap (binding, 1, 1))->table, @@ -2916,7 +2915,7 @@ /* used by Fmap_keymap() */ static void -map_keymap_mapper (const struct key_data *key, +map_keymap_mapper (CONST struct key_data *key, Lisp_Object binding, void *function) { @@ -2929,7 +2928,7 @@ static void map_keymap (Lisp_Object keymap_table, int sort_first, - void (*function) (const struct key_data *key, + void (*function) (CONST struct key_data *key, Lisp_Object binding, void *fn_arg), void *fn_arg) @@ -3001,11 +3000,11 @@ static void accessible_keymaps_mapper_1 (Lisp_Object keysym, Lisp_Object contents, - int modifiers, + unsigned int modifiers, struct accessible_keymaps_closure *closure) { /* This function can GC */ - int subbits = MODIFIER_HASH_KEY_BITS (keysym); + unsigned int subbits = MODIFIER_HASH_KEY_BITS (keysym); if (subbits != 0) { @@ -3085,28 +3084,23 @@ c.tail = Qnil; GCPRO4 (accessible_keymaps, c.tail, prefix, keymap); + retry: keymap = get_keymap (keymap, 1, 1); - - retry: if (NILP (prefix)) + prefix = make_vector (0, Qnil); + else if (!VECTORP (prefix) || STRINGP (prefix)) { - prefix = make_vector (0, Qnil); + prefix = wrong_type_argument (Qarrayp, prefix); + goto retry; } - else if (VECTORP (prefix) || STRINGP (prefix)) + else { int len = XINT (Flength (prefix)); - Lisp_Object def; + Lisp_Object def = Flookup_key (keymap, prefix, Qnil); Lisp_Object p; int iii; struct gcpro ngcpro1; - if (len == 0) - { - prefix = Qnil; - goto retry; - } - - def = Flookup_key (keymap, prefix, Qnil); def = get_keymap (def, 0, 1); if (!KEYMAPP (def)) goto RETURN; @@ -3123,16 +3117,12 @@ NUNGCPRO; prefix = p; } - else - { - prefix = wrong_type_argument (Qarrayp, prefix); - goto retry; - } accessible_keymaps = list1 (Fcons (prefix, keymap)); - /* For each map in the list maps, look at any other maps it points - to and stick them at the end if they are not already in the list */ + /* For each map in the list maps, + look at any other maps it points to + and stick them at the end if they are not already in the list */ for (c.tail = accessible_keymaps; !NILP (c.tail); @@ -3177,9 +3167,9 @@ for (i = 0; i < size; i++) { Lisp_Object s2 = Fsingle_key_description - (STRINGP (keys) - ? make_char (string_char (XSTRING (keys), i)) - : XVECTOR_DATA (keys)[i]); + (((STRINGP (keys)) + ? make_char (string_char (XSTRING (keys), i)) + : XVECTOR_DATA (keys)[i])); if (i == 0) string = s2; @@ -3210,7 +3200,7 @@ char buf [255]; if (!EVENTP (key)) { - Lisp_Event event; + struct Lisp_Event event; event.event_type = empty_event; CHECK_CHAR_COERCE_INT (key); character_to_event (XCHAR (key), &event, @@ -3459,7 +3449,7 @@ format_raw_keys (struct key_data *keys, int count, char *buf) { int i; - Lisp_Event event; + struct Lisp_Event event; event.event_type = key_press_event; event.channel = Vselected_console; for (i = 0; i < count; i++) @@ -3483,7 +3473,7 @@ keys_so_far and modifiers_so_far describe which map we're looking in; If we're in the "meta" submap of the map that "C-x 4" is bound to, then keys_so_far will be {(control x), \4}, and modifiers_so_far - will be XEMACS_MOD_META. That is, keys_so_far is the chain of keys that we + will be MOD_META. That is, keys_so_far is the chain of keys that we have followed, and modifiers_so_far_so_far is the bits (partial keys) beyond that. @@ -3501,7 +3491,7 @@ int shadow_count; int firstonly; int keys_count; - int modifiers_so_far; + unsigned int modifiers_so_far; char *target_buffer; struct key_data *keys_so_far; int keys_so_far_total_size; @@ -3516,9 +3506,9 @@ /* This function can GC */ struct where_is_closure *c = (struct where_is_closure *) arg; Lisp_Object definition = c->definition; - const int firstonly = c->firstonly; - const int keys_count = c->keys_count; - const int modifiers_so_far = c->modifiers_so_far; + CONST int firstonly = c->firstonly; + CONST unsigned int keys_count = c->keys_count; + CONST unsigned int modifiers_so_far = c->modifiers_so_far; char *target_buffer = c->target_buffer; Lisp_Object keys = Fgethash (definition, XKEYMAP (map)->inverse_table, @@ -3536,7 +3526,7 @@ for (;;) /* loop over all keys that match */ { - Lisp_Object k = CONSP (keys) ? XCAR (keys) : keys; + Lisp_Object k = ((CONSP (keys)) ? XCAR (keys) : keys); int i; so_far [keys_count].keysym = k; @@ -3591,9 +3581,9 @@ { Lisp_Object key = XCAR (XCAR (submaps)); Lisp_Object submap = XCDR (XCAR (submaps)); - int lower_modifiers; + unsigned int lower_modifiers; int lower_keys_count = keys_count; - int bucky; + unsigned int bucky; submap = get_keymap (submap, 0, 0); @@ -3634,7 +3624,7 @@ if (! c->keys_so_far_malloced) { struct key_data *new = xnew_array (struct key_data, size); - memcpy ((void *)new, (const void *)c->keys_so_far, + memcpy ((void *)new, (CONST void *)c->keys_so_far, c->keys_so_far_total_size * sizeof (struct key_data)); } else @@ -3887,7 +3877,7 @@ struct describe_map_shadow_closure { - const struct key_data *raw_key; + CONST struct key_data *raw_key; Lisp_Object self; }; @@ -3916,7 +3906,7 @@ static void -describe_map_mapper (const struct key_data *key, +describe_map_mapper (CONST struct key_data *key, Lisp_Object binding, void *describe_map_closure) { @@ -3924,7 +3914,7 @@ struct describe_map_closure *closure = (struct describe_map_closure *) describe_map_closure; Lisp_Object keysym = key->keysym; - int modifiers = key->modifiers; + unsigned int modifiers = key->modifiers; /* Don't mention suppressed commands. */ if (SYMBOLP (binding) @@ -3998,7 +3988,7 @@ ( ( <keysym> . <modifiers> ) . <binding> ) keysym and modifiers are used, binding is ignored. */ - int bit1, bit2; + unsigned int bit1, bit2; obj1 = XCAR (obj1); obj2 = XCAR (obj2); bit1 = XINT (XCDR (obj1)); @@ -4118,17 +4108,17 @@ { Lisp_Object elt = XCAR (XCAR (list)); Lisp_Object keysym = XCAR (elt); - int modifiers = XINT (XCDR (elt)); + unsigned int modifiers = XINT (XCDR (elt)); if (!NILP (elt_prefix)) buffer_insert_lisp_string (buf, elt_prefix); - if (modifiers & XEMACS_MOD_META) buffer_insert_c_string (buf, "M-"); - if (modifiers & XEMACS_MOD_CONTROL) buffer_insert_c_string (buf, "C-"); - if (modifiers & XEMACS_MOD_SUPER) buffer_insert_c_string (buf, "S-"); - if (modifiers & XEMACS_MOD_HYPER) buffer_insert_c_string (buf, "H-"); - if (modifiers & XEMACS_MOD_ALT) buffer_insert_c_string (buf, "Alt-"); - if (modifiers & XEMACS_MOD_SHIFT) buffer_insert_c_string (buf, "Sh-"); + if (modifiers & MOD_META) buffer_insert_c_string (buf, "M-"); + if (modifiers & MOD_CONTROL) buffer_insert_c_string (buf, "C-"); + if (modifiers & MOD_SUPER) buffer_insert_c_string (buf, "S-"); + if (modifiers & MOD_HYPER) buffer_insert_c_string (buf, "H-"); + if (modifiers & MOD_ALT) buffer_insert_c_string (buf, "Alt-"); + if (modifiers & MOD_SHIFT) buffer_insert_c_string (buf, "Sh-"); if (SYMBOLP (keysym)) { Lisp_Object code = Fget (keysym, Vcharacter_set_property, Qnil); @@ -4195,8 +4185,6 @@ void syms_of_keymap (void) { - INIT_LRECORD_IMPLEMENTATION (keymap); - defsymbol (&Qminor_mode_map_alist, "minor-mode-map-alist"); defsymbol (&Qkeymapp, "keymapp"); @@ -4278,7 +4266,6 @@ defsymbol (&QRET, "RET"); defsymbol (&QESC, "ESC"); defsymbol (&QDEL, "DEL"); - defsymbol (&QSPC, "SPC"); defsymbol (&QBS, "BS"); } @@ -4332,7 +4319,7 @@ staticpro (&Vcurrent_global_map); - Vsingle_space_string = make_string ((const Bufbyte *) " ", 1); + Vsingle_space_string = make_string_nocopy ((CONST Bufbyte *) " ", 1); staticpro (&Vsingle_space_string); } @@ -4348,7 +4335,7 @@ meta_disgustitute = Fmake_keymap (Qnil); Ffset (ESC_prefix, meta_disgustitute); /* no need to protect meta_disgustitute, though */ - keymap_store_internal (MAKE_MODIFIER_HASH_KEY (XEMACS_MOD_META), + keymap_store_internal (MAKE_MODIFIER_HASH_KEY (MOD_META), XKEYMAP (Vcurrent_global_map), meta_disgustitute); XKEYMAP (Vcurrent_global_map)->sub_maps_cache = Qt; diff -r 12e008d41344 -r 697ef44129c6 src/keymap.h --- a/src/keymap.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/keymap.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,15 +21,14 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_keymap_h_ -#define INCLUDED_keymap_h_ +#ifndef _XEMACS_KEYMAP_H_ +#define _XEMACS_KEYMAP_H_ -typedef struct Lisp_Keymap Lisp_Keymap; - -DECLARE_LRECORD (keymap, Lisp_Keymap); -#define XKEYMAP(x) XRECORD (x, keymap, Lisp_Keymap) +DECLARE_LRECORD (keymap, struct Lisp_Keymap); +#define XKEYMAP(x) XRECORD (x, keymap, struct Lisp_Keymap) #define XSETKEYMAP(x, p) XSETRECORD (x, p, keymap) #define KEYMAPP(x) RECORDP (x, keymap) +#define GC_KEYMAPP(x) GC_RECORDP (x, keymap) #define CHECK_KEYMAP(x) CHECK_RECORD (x, keymap) #define CONCHECK_KEYMAP(x) CONCHECK_RECORD (x, keymap) @@ -57,7 +56,7 @@ void key_desc_list_to_event (Lisp_Object list, Lisp_Object event, int allow_menu_events); -int event_matches_key_specifier_p (Lisp_Event *event, +int event_matches_key_specifier_p (struct Lisp_Event *event, Lisp_Object key_specifier); -#endif /* INCLUDED_keymap_h_ */ +#endif /* _XEMACS_KEYMAP_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/libsst.c --- a/src/libsst.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/libsst.c Mon Aug 13 11:20:41 2007 +0200 @@ -20,25 +20,29 @@ #include "lisp.h" #endif +#ifdef STDC_HEADERS #include <stdlib.h> -#include <stdio.h> -#include <fcntl.h> +#endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#include <stdio.h> +#include <fcntl.h> #include "libsst.h" #define AUDBUF 1024 +extern void usleep(); + int sst_open(play_level, record_level) int play_level, record_level; { int fd, i, gr, ger, gx; struct audio_ioctl ai; - char *ep; + char *getenv(), *ep; fd = open( "/dev/audio", O_RDWR ); if ( fd < 0 ) diff -r 12e008d41344 -r 697ef44129c6 src/libsst.h --- a/src/libsst.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/libsst.h Mon Aug 13 11:20:41 2007 +0200 @@ -12,9 +12,6 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_libsst_h_ -#define INCLUDED_libsst_h_ - #include <sys/ioctl.h> #ifndef SUNOS4_0_3 #define AUDIO_4_0_3_COMPAT @@ -49,5 +46,3 @@ #else /* !emacs */ # define warn(str) fprintf (stderr, "%s\n", (str)) #endif /* emacs */ - -#endif /* INCLUDED_libsst_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/libst.h --- a/src/libst.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/libst.h Mon Aug 13 11:20:41 2007 +0200 @@ -12,9 +12,6 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_libst_h_ -#define INCLUDED_libst_h_ - #define SAMPLES_PER_SECOND 8192 #define MINLIN -32768 @@ -68,5 +65,3 @@ 244, 228, 212, 196, 180, 164, 148, 132, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 }; - -#endif /* INCLUDED_libst_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/line-number.c --- a/src/line-number.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/line-number.c Mon Aug 13 11:20:41 2007 +0200 @@ -158,7 +158,7 @@ This will do nothing if the cache is uninitialized. */ void insert_invalidate_line_number_cache (struct buffer *b, Bufpos pos, - const Bufbyte *nonreloc, Bytecount length) + CONST Bufbyte *nonreloc, Bytecount length) { if (NILP (b->text->line_number_cache)) return; diff -r 12e008d41344 -r 697ef44129c6 src/line-number.h --- a/src/line-number.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/line-number.h Mon Aug 13 11:20:41 2007 +0200 @@ -17,16 +17,11 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef INCLUDED_line_number_h_ -#define INCLUDED_line_number_h_ - /* Synched up with: Not in FSF. */ void narrow_line_number_cache (struct buffer *); void insert_invalidate_line_number_cache (struct buffer *, Bufpos, - const Bufbyte *, Bytecount); + CONST Bufbyte *, Bytecount); void delete_invalidate_line_number_cache (struct buffer *, Bufpos, Bufpos); EMACS_INT buffer_line_number (struct buffer *, Bufpos, int); - -#endif /* INCLUDED_line_number_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/linuxplay.c --- a/src/linuxplay.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/linuxplay.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,7 @@ /* linuxplay.c - play a sound file on the speaker ** ** Copyright (C) 1995,96 by Markus Gutschke (gutschk@math.uni-muenster.de) - ** This is version 1.3 of linuxplay.c, with platform-independent functions - ** moved to a different file by Robert Bihlmeyer <robbe@orcus.priv.at>. + ** This is version 1.3 of linuxplay.c ** ** Parts of this code were inspired by sunplay.c, which is copyright 1989 by ** Jef Poskanzer and 1991,92 by Jamie Zawinski; c.f. sunplay.c for further @@ -46,6 +45,9 @@ /* Synched up with: Not in FSF. */ +#define HEADERSZ 256 /* has to be at least as big as the biggest header */ +#define SNDBUFSZ 2048 /* has to be at least as big as HEADERSZ */ + /* XEmacs beta testers say: undef this by default. */ #undef NOVOLUMECTRLFORMULAW /* Changing the volume for uLaw-encoded samples sounds very poor; possibly, @@ -57,12 +59,9 @@ #include <config.h> #endif -#include "miscplay.h" -#include "nativesound.h" - #include <errno.h> #include <fcntl.h> -#include SOUNDCARD_H_FILE /* Path computed by configure */ +#include SOUNDCARD_H_PATH /* Path computed by configure */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -83,19 +82,62 @@ #define warn(str) message("audio: %s ",GETTEXT(str)) #endif -static SIGTYPE (*sighup_handler) (int); -static SIGTYPE (*sigint_handler) (int); +#ifdef __GNUC__ +#define UNUSED(x) ((void)(x)) +#else +#define UNUSED(x) +#define __inline__ +#endif + +static void (*sighup_handler)(int); +static void (*sigint_handler)(int); + +/* Maintain global variable for keeping parser state information; this struct + is set to zero before the first invocation of the parser. The use of a + global variable prevents multiple concurrent executions of this code, but + this does not happen anyways... */ +enum wvState +{ wvMain, + wvSubchunk, + wvOutOfBlock, + wvSkipChunk, + wvSoundChunk, + wvFatal, + wvFatalNotify +}; + +static union { + struct { + int align; + enum wvState state; + size_t left; + unsigned char leftover[HEADERSZ]; + signed long chunklength; + } wave; + struct { + int align; + int isdata; + int skipping; + size_t left; + unsigned char leftover[HEADERSZ]; + } audio; +} parsestate; + +/* Use a global buffer as scratch-pad for possible conversions of the + sampling format */ +unsigned char linuxplay_sndbuf[SNDBUFSZ]; static int mix_fd; static int audio_vol; static int audio_fd; static char *audio_dev = "/dev/dsp"; +typedef enum {fmtIllegal,fmtRaw,fmtVoc,fmtWave,fmtSunAudio} fmtType; + /* Intercept SIGINT and SIGHUP in order to close the audio and mixer devices before terminating sound output; this requires reliable signals as provided by "syssignal.h" */ -static SIGTYPE -sighandler (int sig) +static void sighandler(int sig) { if (mix_fd > 0) { if (audio_vol >= 0) { @@ -114,6 +156,649 @@ else exit(1); } +/* There is no special treatment required for parsing raw data files; we + assume that these files contain data in 8bit unsigned format that + has been sampled at 8kHz; there is no extra header */ +static size_t parseraw(void **data,size_t *sz,void **outbuf) +{ + int rc = *sz; + + *outbuf = *data; + *sz = 0; + return(rc); +} + +/* Currently we cannot cope with files in VOC format; if you really need + to play these files, they should be converted by using SOX */ +static size_t parsevoc(void **data,size_t *sz,void **outbuf) +{ + UNUSED(data); + UNUSED(sz); + UNUSED(outbuf); + return(0); +} + +/* We need to perform some look-ahead in order to parse files in WAVE format; + this might require re-partioning of the data segments if headers cross the + boundaries between two read operations. This is done in a two-step way: + first we request a certain amount of bytes... */ +static __inline__ int waverequire(void **data,size_t *sz,size_t rq) +{ + int rc = 1; + + if (rq > HEADERSZ) { + warn("Header size exceeded while parsing WAVE file"); + parsestate.wave.state = wvFatal; + *sz = 0; + return(0); } + if ((rq -= parsestate.wave.left) <= 0) + return(rc); + if (rq > *sz) {rq = *sz; rc = 0;} + memcpy(parsestate.wave.leftover+parsestate.wave.left, + *data,rq); + parsestate.wave.left += rq; + (*(unsigned char **)data) += rq; + *sz -= rq; + return(rc); +} + +/* ...and next we remove this many bytes from the buffer */ +static __inline__ void waveremove(size_t rq) +{ + if (parsestate.wave.left <= rq) + parsestate.wave.left = 0; + else { + parsestate.wave.left -= rq; + memmove(parsestate.wave.leftover, + parsestate.wave.leftover+rq, + parsestate.wave.left); } + return; +} + +/* Sound files in WAVE format can contain an arbitrary amount of tagged + chunks; this requires quite some effort for parsing the data */ +static size_t parsewave(void **data,size_t *sz,void **outbuf) +{ + for (;;) + switch (parsestate.wave.state) { + case wvMain: + if (!waverequire(data,sz,20)) + return(0); + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + parsestate.wave.chunklength = parsestate.wave.leftover[16] + + 256*(parsestate.wave.leftover[17] + + 256*(parsestate.wave.leftover[18] + + 256*parsestate.wave.leftover[19])); + waveremove(20); + parsestate.wave.state = wvSubchunk; + break; + case wvSubchunk: + if (!waverequire(data,sz,parsestate.wave.chunklength)) + return(0); + parsestate.wave.align = parsestate.wave.chunklength < 14 ? 1 + : parsestate.wave.leftover[12]; + if (parsestate.wave.align != 1 && + parsestate.wave.align != 2 && + parsestate.wave.align != 4) { + warn("Illegal datawidth detected while parsing WAVE file"); + parsestate.wave.state = wvFatal; } + else + parsestate.wave.state = wvOutOfBlock; + waveremove(parsestate.wave.chunklength); + break; + case wvOutOfBlock: + if (!waverequire(data,sz,8)) + return(0); + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + parsestate.wave.chunklength = parsestate.wave.leftover[4] + + 256*(parsestate.wave.leftover[5] + + 256*(parsestate.wave.leftover[6] + + 256*(parsestate.wave.leftover[7] & 0x7F))); + if (memcmp(parsestate.wave.leftover,"data",4)) + parsestate.wave.state = wvSkipChunk; + else + parsestate.wave.state = wvSoundChunk; + waveremove(8); + break; + case wvSkipChunk: + if (parsestate.wave.chunklength > 0 && *sz > 0 && + (signed long)*sz < (signed long)parsestate.wave.chunklength) { + parsestate.wave.chunklength -= *sz; + *sz = 0; } + else { + if (parsestate.wave.chunklength > 0 && *sz > 0) { + *sz -= parsestate.wave.chunklength; + (*(unsigned char **)data) += parsestate.wave.chunklength; } + parsestate.wave.state = wvOutOfBlock; } + break; + case wvSoundChunk: { + size_t count,rq; + if (parsestate.wave.left) { /* handle leftover bytes from last + alignment operation */ + count = parsestate.wave.left; + rq = HEADERSZ-count; + if (rq > (size_t) parsestate.wave.chunklength) + rq = parsestate.wave.chunklength; + if (!waverequire(data,sz,rq)) { + parsestate.wave.chunklength -= parsestate.wave.left - count; + return(0); } + parsestate.wave.chunklength -= rq; + *outbuf = parsestate.wave.leftover; + parsestate.wave.left = 0; + return(rq); } + if (*sz >= (size_t) parsestate.wave.chunklength) { + count = parsestate.wave.chunklength; + rq = 0; } + else { + count = *sz; + count -= rq = count % parsestate.wave.align; } + *outbuf = *data; + (*(unsigned char **)data) += count; + *sz -= count; + if ((parsestate.wave.chunklength -= count) < parsestate.wave.align) { + parsestate.wave.state = wvOutOfBlock; + /* Some broken software (e.g. SOX) attaches junk to the end of a sound + chunk; so, let's ignore this... */ + if (parsestate.wave.chunklength) + parsestate.wave.state = wvSkipChunk; } + else if (rq) + /* align data length to a multiple of datasize; keep additional data + in "leftover" buffer --- this is necessary to ensure proper + functioning of the sndcnv... routines */ + waverequire(data,sz,rq); + return(count); } + case wvFatalNotify: + warn("Irrecoverable error while parsing WAVE file"); + parsestate.wave.state = wvFatal; + break; + case wvFatal: + default: + *sz = 0; + return(0); } +} + +/* Strip the header from files in Sun/DEC audio format; this requires some + extra processing as the header can be an arbitrary size and it might + result in alignment errors for subsequent conversions --- thus we do + some buffering, where needed */ +static size_t parsesundecaudio(void **data,size_t *sz,void **outbuf) +{ + /* There is data left over from the last invocation of this function; join + it with the new data and return a sound chunk that is as big as a + single entry */ + if (parsestate.audio.left) { + if (parsestate.audio.left + *sz > (size_t) parsestate.audio.align) { + int count; + memmove(parsestate.audio.leftover + parsestate.audio.left, + *data, + count = parsestate.audio.align - parsestate.audio.left); + *outbuf = parsestate.audio.leftover; + *sz -= count; + *data = (*(char **)data) + count; + parsestate.audio.left = 0; + return(parsestate.audio.align); } + else { + /* We need even more data in order to get one complete single entry! */ + memmove(parsestate.audio.leftover + parsestate.audio.left, + *data, + *sz); + *data = (*(char **)data) + *sz; + parsestate.audio.left += *sz; + *sz = 0; + return(0); } } + + /* This is the main sound chunk, strip of any extra data that does not fit + the alignment requirements and move these bytes into the leftover buffer*/ + if (parsestate.audio.isdata) { + int rc = *sz; + *outbuf = *data; + if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { + memmove(parsestate.audio.leftover, + (char *)*outbuf + rc - parsestate.audio.left, + parsestate.audio.left); + rc -= parsestate.audio.left; } + *sz = 0; + return(rc); } + + /* This is the first invocation of this function; we need to parse the + header information and determine how many bytes we need to skip until + the start of the sound chunk */ + if (!parsestate.audio.skipping) { + unsigned char *header = (unsigned char *) *data; + if (*sz < 8) { + warn("Irrecoverable error while parsing Sun/DEC audio file"); + return(0); } + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + if (header[3]) { /* Sun audio (big endian) */ + parsestate.audio.align = ((header[15] > 2)+1)*header[23]; + parsestate.audio.skipping = header[7]+256*(header[6]+256* + (header[5]+256*header[4])); } + else { /* DEC audio (little endian) */ + parsestate.audio.align = ((header[12] > 2)+1)*header[20]; + parsestate.audio.skipping = header[4]+256*(header[5]+256* + (header[6]+256*header[7])); }} + + /* We are skipping extra data that has been attached to header; most usually + this will be just a comment, such as the original filename and/or the + creation date. Make sure that we do not return less than one single sound + sample entry to the caller; if this happens, rather decide to move those + few bytes into the leftover buffer and deal with it later */ + if (*sz >= (size_t) parsestate.audio.skipping) { + /* Skip just the header information and return the sound chunk */ + int rc = *sz - parsestate.audio.skipping; + *outbuf = (char *)*data + parsestate.audio.skipping; + if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { + memmove(parsestate.audio.leftover, + (char *)*outbuf + rc - parsestate.audio.left, + parsestate.audio.left); + rc -= parsestate.audio.left; } + *sz = 0; + parsestate.audio.skipping = 0; + parsestate.audio.isdata++; + return(rc); } + else { + /* Skip everything */ + parsestate.audio.skipping -= *sz; + return(0); } +} + +/* If the soundcard could not be set to natively support the data format, we + try to do some limited on-the-fly conversion to a different format; if + no conversion is needed, though, we can output directly */ +static size_t sndcnvnop(void **data,size_t *sz,void **outbuf) +{ + int rc = *sz; + + *outbuf = *data; + *sz = 0; + return(rc); +} + +/* Convert 8 bit unsigned stereo data to 8 bit unsigned mono data */ +static size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) + *dest++ = (unsigned char)(((int)*(src)++ + + (int)*(src)++) / 2); + *data = src; + return(rc); +} + +/* Convert 8 bit signed stereo data to 8 bit signed mono data */ +static size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc, count; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) + *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + + (int)*((signed char *)(src++))) / 2); + *data = src; + return(rc); +} + +/* Convert 8 bit signed stereo data to 8 bit unsigned mono data */ +static size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) + *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + + (int)*((signed char *)(src++))) / 2) ^ 0x80; + *data = src; + return(rc); +} + +/* Convert 8 bit signed mono data to 8 bit unsigned mono data */ +static size_t sndcnv2unsigned(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz; + if (count > SNDBUFSZ) { *sz -= SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) + *dest++ = *(src)++ ^ 0x80; + *data = src; + return(rc); +} + +/* Convert a number in the range -32768..32767 to an 8 bit ulaw encoded + number --- I hope, I got this conversion right :-) */ +static __inline__ signed char int2ulaw(int i) +{ + /* Lookup table for fast calculation of number of bits that need shifting*/ + static short int t_bits[128] = { + 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7}; + REGISTER int bits,logi; + + /* unrolling this condition (hopefully) improves execution speed */ + if (i < 0) { + if ((i = (132-i)) > 0x7FFF) i = 0x7FFF; + logi = (i >> ((bits = t_bits[i/256])+4)); + return((bits << 4 | logi) ^ 0x7F); } + else { + if ((i = 132+i) > 0x7FFF) i = 0x7FFF; + logi = (i >> ((bits = t_bits[i/256])+4)); + return(~(bits << 4 | logi)); } +} + +/* Convert 8 bit ulaw stereo data to 8 bit ulaw mono data */ +static size_t sndcnvULaw_2mono(void **data,size_t *sz,void **outbuf) +{ + + static short int ulaw2int[256] = { + /* Precomputed lookup table for conversion from ulaw to 15 bit signed */ + -16062,-15550,-15038,-14526,-14014,-13502,-12990,-12478, + -11966,-11454,-10942,-10430, -9918, -9406, -8894, -8382, + -7998, -7742, -7486, -7230, -6974, -6718, -6462, -6206, + -5950, -5694, -5438, -5182, -4926, -4670, -4414, -4158, + -3966, -3838, -3710, -3582, -3454, -3326, -3198, -3070, + -2942, -2814, -2686, -2558, -2430, -2302, -2174, -2046, + -1950, -1886, -1822, -1758, -1694, -1630, -1566, -1502, + -1438, -1374, -1310, -1246, -1182, -1118, -1054, -990, + -942, -910, -878, -846, -814, -782, -750, -718, + -686, -654, -622, -590, -558, -526, -494, -462, + -438, -422, -406, -390, -374, -358, -342, -326, + -310, -294, -278, -262, -246, -230, -214, -198, + -186, -178, -170, -162, -154, -146, -138, -130, + -122, -114, -106, -98, -90, -82, -74, -66, + -60, -56, -52, -48, -44, -40, -36, -32, + -28, -24, -20, -16, -12, -8, -4, +0, + +16062,+15550,+15038,+14526,+14014,+13502,+12990,+12478, + +11966,+11454,+10942,+10430, +9918, +9406, +8894, +8382, + +7998, +7742, +7486, +7230, +6974, +6718, +6462, +6206, + +5950, +5694, +5438, +5182, +4926, +4670, +4414, +4158, + +3966, +3838, +3710, +3582, +3454, +3326, +3198, +3070, + +2942, +2814, +2686, +2558, +2430, +2302, +2174, +2046, + +1950, +1886, +1822, +1758, +1694, +1630, +1566, +1502, + +1438, +1374, +1310, +1246, +1182, +1118, +1054, +990, + +942, +910, +878, +846, +814, +782, +750, +718, + +686, +654, +622, +590, +558, +526, +494, +462, + +438, +422, +406, +390, +374, +358, +342, +326, + +310, +294, +278, +262, +246, +230, +214, +198, + +186, +178, +170, +162, +154, +146, +138, +130, + +122, +114, +106, +98, +90, +82, +74, +66, + +60, +56, +52, +48, +44, +40, +36, +32, + +28, +24, +20, +16, +12, +8, +4, +0}; + + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) + /* it is not possible to directly interpolate between two ulaw encoded + data bytes, thus we need to convert to linear format first and later + we convert back to ulaw format */ + *dest++ = int2ulaw(ulaw2int[*(src)++] + + ulaw2int[*(src)++]); + *data = src; + return(rc); +} + +/* Convert 16 bit little endian signed stereo data to 16 bit little endian + signed mono data */ +static size_t sndcnv16_2monoLE(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + signed short i; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + for (count /= 2; count--; ) { + i = ((int)(src[0]) + + 256*(int)(src[1]) + + (int)(src[2]) + + 256*(int)(src[3])) / 2; + src += 4; + *dest++ = (unsigned char)(i & 0xFF); + *dest++ = (unsigned char)((i / 256) & 0xFF); } + *data = src; + return(rc); +} + +/* Convert 16 bit big endian signed stereo data to 16 bit big endian + signed mono data */ +static size_t sndcnv16_2monoBE(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + signed short i; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + for (count /= 2; count--; ) { + i = ((int)(src[1]) + + 256*(int)(src[0]) + + (int)(src[3]) + + 256*(int)(src[2])) / 2; + src += 4; + *dest++ = (unsigned char)((i / 256) & 0xFF); + *dest++ = (unsigned char)(i & 0xFF); } + *data = src; + return(rc); +} + +/* Convert 16 bit little endian signed data to 8 bit unsigned data */ +static size_t sndcnv2byteLE(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) { + *dest++ = (unsigned char)(((signed char *)src)[1] ^ (signed char)0x80); + src += 2; + } + *data = src; + return(rc); +} + +/* Convert 16 bit big endian signed data to 8 bit unsigned data */ +static size_t sndcnv2byteBE(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 2; + if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) { + *dest++ = (unsigned char)(((signed char *)src)[0] ^ (signed char)0x80); + src += 2; + } + *data = src; + return(rc); +} + +/* Convert 16 bit little endian signed stereo data to 8 bit unsigned + mono data */ +static size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 4; + if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) { + *dest++ = (unsigned char)(((int)((signed char *)src)[1] + + (int)((signed char *)src)[3]) / 2 ^ 0x80); + src += 4; + } + *data = src; + return(rc); +} + +/* Convert 16 bit big endian signed stereo data to 8 bit unsigned + mono data */ +static size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf) +{ + REGISTER unsigned char *src; + REGISTER unsigned char *dest; + int rc,count; + + count = *sz / 4; + if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } + else *sz = 0; + rc = count; + src = (unsigned char *) *data; + *outbuf = + dest = linuxplay_sndbuf; + while (count--) { + *dest++ = (unsigned char)(((int)((signed char *)src)[0] + + (int)((signed char *)src)[2]) / 2 ^ 0x80); + src += 4; + } + *data = src; + return(rc); +} + +/* Look at the header of the sound file and try to determine the format; + we can recognize files in VOC, WAVE, and, Sun/DEC-audio format--- everything + else is assumed to be raw 8 bit unsigned data sampled at 8kHz */ +static fmtType analyze_format(unsigned char *format,int *fmt,int *speed, + int *tracks, + size_t (**parsesndfile)(void **,size_t *sz, + void **)) +{ + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + if (!memcmp(format,"Creative Voice File\x1A\x1A\x00",22) && + (format[22]+256*format[23]) == + ((0x1233-format[24]-256*format[25])&0xFFFF)) { /* VOC */ + *fmt = AFMT_U8; + *speed = 8000; + *tracks = 2; + *parsesndfile = parsevoc; + return(fmtVoc); } + else if (!memcmp(format,"RIFF",4) && + !memcmp(format+8,"WAVEfmt ",8)) { /* WAVE */ + if (memcmp(format+20,"\001\000\001"/* PCM mono */,4) && + memcmp(format+20,"\001\000\002"/* PCM stereo */,4)) + return(fmtIllegal); + *fmt = (format[32]/(*tracks = format[22])) == 1 ? + AFMT_U8 : AFMT_S16_LE; + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + *speed = format[24]+256*(format[25]+256* + (format[26]+256*format[27])); + *parsesndfile = parsewave; + return(fmtWave); } + else if (!memcmp(format,".snd",4)) { /* Sun Audio (big endian) */ + if (format[7]+256*(format[6]+256*(format[5]+256*format[4])) < 24) { + *fmt = AFMT_MU_LAW; + *speed = 8000; + *tracks = 1; + *parsesndfile = parsesundecaudio; + return(fmtSunAudio); } + if (!memcmp(format+12,"\000\000\000\001",4)) *fmt = AFMT_MU_LAW; + else if (!memcmp(format+12,"\000\000\000\002",4)) *fmt = AFMT_S8; + else if (!memcmp(format+12,"\000\000\000\003",4)) *fmt = AFMT_S16_BE; + else return(fmtIllegal); + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + *speed = format[19]+256*(format[18]+256* + (format[17]+256*format[16])); + *tracks = format[23]; + *parsesndfile = parsesundecaudio; + return(fmtSunAudio); } + else if (!memcmp(format,".sd",4)) { /* DEC Audio (little endian) */ + if (format[4]+256*(format[5]+256*(format[6]+256*format[7])) < 24) { + *fmt = AFMT_MU_LAW; + *speed = 8000; + *tracks = 1; + *parsesndfile = parsesundecaudio; + return(fmtSunAudio); } + if (!memcmp(format+12,"\001\000\000",4)) *fmt = AFMT_MU_LAW; + else if (!memcmp(format+12,"\002\000\000",4)) *fmt = AFMT_S8; + else if (!memcmp(format+12,"\003\000\000",4)) *fmt = AFMT_S16_LE; + else return(fmtIllegal); + /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ + *speed = format[16]+256*(format[17]+256* + (format[18]+256*format[19])); + *tracks = format[20]; + *parsesndfile = parsesundecaudio; + return(fmtSunAudio); } + else { + *fmt = AFMT_U8; + *speed = 8000; + *tracks = 1; + *parsesndfile = parseraw; + return(fmtRaw); } +} + /* Initialize the soundcard and mixer device with the parameters that we found in the header of the sound file. If the soundcard is not capable of natively supporting the required parameters, then try to set up conversion @@ -278,11 +963,8 @@ } /* XEmacs requires code both for playback of pre-loaded data and for playback - from a soundfile; we use one function for both cases. - - Returns 1 on succes. 0 otherwise. -*/ -static int linux_play_data_or_file(int fd,unsigned char *data, + from a soundfile; we use one function for both cases */ +static void linux_play_data_or_file(int fd,unsigned char *data, int length,int volume) { size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); @@ -291,17 +973,16 @@ int fmt,speed,tracks; unsigned char *pptr,*optr,*cptr,*sptr; int wrtn,rrtn,crtn,prtn; - unsigned char sndbuf[SNDBUFSZ]; /* We need to read at least the header information before we can start doing anything */ if (!data || length < HEADERSZ) { - if (fd < 0) return 0; + if (fd < 0) return; else { - length = read(fd,sndbuf,SNDBUFSZ); + length = read(fd,linuxplay_sndbuf,SNDBUFSZ); if (length < HEADERSZ) - return 0; - data = sndbuf; + return; + data = linuxplay_sndbuf; length = SNDBUFSZ; } } @@ -309,16 +990,14 @@ if (ffmt != fmtRaw && ffmt != fmtSunAudio && ffmt != fmtWave) { warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); - return 0; } + return; } /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and properly initializing it via ioctl() is preferred */ if ((audio_fd=open(audio_dev, O_WRONLY | O_NONBLOCK, 0)) < 0) { - /* JV. Much too verbose. In addition this can crash. See NOTE: in - Fplay_sound - perror(audio_dev); */ + perror(audio_dev); if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; } - return 0; } + return; } /* The VoxWare-SDK discourages direct manipulation of the mixer device as this could lead to problems, when multiple sound cards are installed */ @@ -331,7 +1010,8 @@ goto END_OF_PLAY; audio_vol = volume; - reset_parsestate(); + /* Initialize global parser state information to zero */ + memset(&parsestate,0,sizeof(parsestate)); /* Mainloop: read a block of data, parse its contents, perform all the necessary conversions and output it to the sound @@ -354,15 +1034,17 @@ warn(buf); goto END_OF_PLAY; } } if (fd >= 0) { - if ((rrtn = read(fd,sndbuf,SNDBUFSZ)) < 0) { + if ((rrtn = read(fd,linuxplay_sndbuf,SNDBUFSZ)) < 0) { perror("read"); goto END_OF_PLAY; } } else break; } while (rrtn > 0); - if (ffmt == fmtWave) - parse_wave_complete(); - + /* Verify that we could fully parse the entire soundfile; this is needed + only for files in WAVE format */ + if (ffmt == fmtWave && parsestate.wave.state != wvOutOfBlock && + parsestate.wave.state != wvFatal) + warn("Unexpected end of WAVE file"); END_OF_PLAY: /* Now cleanup all used resources */ @@ -384,11 +1066,12 @@ close(audio_fd); audio_fd = -1; - return 1; + return; } /* Call "linux_play_data_or_file" with the appropriate parameters for playing a soundfile */ +void play_sound_file (char *sound_file, int volume); void play_sound_file (char *sound_file, int volume) { int fd; @@ -403,7 +1086,9 @@ /* Call "linux_play_data_or_file" with the appropriate parameters for playing pre-loaded data */ -int play_sound_data (unsigned char *data, int length, int volume) +void play_sound_data (unsigned char *data, int length, int volume); +void play_sound_data (unsigned char *data, int length, int volume) { - return linux_play_data_or_file(-1,data,length,volume); + linux_play_data_or_file(-1,data,length,volume); + return; } diff -r 12e008d41344 -r 697ef44129c6 src/lisp-disunion.h --- a/src/lisp-disunion.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lisp-disunion.h Mon Aug 13 11:20:41 2007 +0200 @@ -70,8 +70,8 @@ XUINT The value bits of a Lisp_Object storing an integer, unsigned INTP Non-zero if this Lisp_Object an integer? Qzero Lisp Integer 0 - EQ Non-zero if two Lisp_Objects are identical */ - + EQ Non-zero if two Lisp_Objects are identical + GC_EQ Version of EQ used during garbage collection */ typedef EMACS_INT Lisp_Object; @@ -83,16 +83,14 @@ #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK)) #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */ #define XCHARVAL(x) ((x) >> GCBITS) +#define GC_EQ(x,y) EQ (x,y) #define XREALINT(x) ((x) >> INT_GCBITS) #define XUINT(x) ((EMACS_UINT)(x) >> INT_GCBITS) #define INTP(x) ((EMACS_UINT)(x) & Lisp_Type_Int_Bit) -#define INT_PLUS(x,y) ((x)+(y)-Lisp_Type_Int_Bit) -#define INT_MINUS(x,y) ((x)-(y)+Lisp_Type_Int_Bit) -#define INT_PLUS1(x) INT_PLUS (x, make_int (1)) -#define INT_MINUS1(x) INT_MINUS (x, make_int (1)) #define Qzero make_int (0) #define Qnull_pointer ((Lisp_Object) 0) +#define XGCTYPE(x) XTYPE(x) #define EQ(x,y) ((x) == (y)) #define XSETINT(var, value) ((void) ((var) = make_int (value))) #define XSETCHAR(var, value) ((void) ((var) = make_char (value))) @@ -103,7 +101,7 @@ #define VOID_TO_LISP(larg,varg) ((void) ((larg) = ((Lisp_Object) (varg)))) #define CVOID_TO_LISP VOID_TO_LISP #define LISP_TO_VOID(larg) ((void *) (larg)) -#define LISP_TO_CVOID(varg) ((const void *) (larg)) +#define LISP_TO_CVOID(varg) ((CONST void *) (larg)) /* Convert a Lisp_Object into something that can't be used as an lvalue. Useful for type-checking. */ diff -r 12e008d41344 -r 697ef44129c6 src/lisp-union.h --- a/src/lisp-union.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lisp-union.h Mon Aug 13 11:20:41 2007 +0200 @@ -30,7 +30,7 @@ union Lisp_Object { /* if non-valbits are at lower addresses */ -#ifdef WORDS_BIGENDIAN +#if defined(WORDS_BIGENDIAN) struct { EMACS_UINT val : VALBITS; @@ -76,7 +76,7 @@ GCC to accept any (yes, any) pointer as the argument of a function declared to accept a Lisp_Object. */ struct nosuchstruct *v; - const struct nosuchstruct *cv; + CONST struct nosuchstruct *cv; } Lisp_Object; @@ -100,8 +100,8 @@ } while (0) # define XPNTRVAL(x) ((x).ui) -INLINE_HEADER Lisp_Object make_int (EMACS_INT val); -INLINE_HEADER Lisp_Object +INLINE Lisp_Object make_int (EMACS_INT val); +INLINE Lisp_Object make_int (EMACS_INT val) { Lisp_Object obj; @@ -109,8 +109,8 @@ return obj; } -INLINE_HEADER Lisp_Object make_char (Emchar val); -INLINE_HEADER Lisp_Object +INLINE Lisp_Object make_char (Emchar val); +INLINE Lisp_Object make_char (Emchar val) { Lisp_Object obj; @@ -123,22 +123,20 @@ #define XREALINT(x) ((x).s.val) #define XUINT(x) ((x).u.val) #define XTYPE(x) ((x).gu.type) +#define XGCTYPE(x) XTYPE (x) #define EQ(x,y) ((x).v == (y).v) #define INTP(x) ((x).s.bits) -#define INT_PLUS(x,y) make_int (XINT (x) + XINT (y)) -#define INT_MINUS(x,y) make_int (XINT (x) - XINT (y)) -#define INT_PLUS1(x) make_int (XINT (x) + 1) -#define INT_MINUS1(x) make_int (XINT (x) - 1) +#define GC_EQ(x,y) EQ (x, y) /* Convert between a (void *) and a Lisp_Object, as when the Lisp_Object is passed to a toolkit callback function */ #define VOID_TO_LISP(larg,varg) \ ((void) ((larg).v = (struct nosuchstruct *) (varg))) #define CVOID_TO_LISP(larg,varg) \ - ((void) ((larg).cv = (const struct nosuchstruct *) (varg))) + ((void) ((larg).cv = (CONST struct nosuchstruct *) (varg))) #define LISP_TO_VOID(larg) ((void *) ((larg).v)) -#define LISP_TO_CVOID(larg) ((const void *) ((larg).cv)) +#define LISP_TO_CVOID(larg) ((CONST void *) ((larg).cv)) /* Convert a Lisp_Object into something that can't be used as an lvalue. Useful for type-checking. */ diff -r 12e008d41344 -r 697ef44129c6 src/lisp.h --- a/src/lisp.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lisp.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_lisp_h_ -#define INCLUDED_lisp_h_ +#ifndef _XEMACS_LISP_H_ +#define _XEMACS_LISP_H_ /************************************************************************/ /* general definitions */ @@ -39,9 +39,10 @@ #include <stdio.h> /* NULL, etc. */ #include <ctype.h> #include <stdarg.h> -#include <stddef.h> /* offsetof */ -#include <sys/types.h> -#include <limits.h> + +#ifdef __lucid +# include <sysent.h> +#endif /* ---- Dynamic arrays ---- */ @@ -59,13 +60,11 @@ void *Dynarr_newf (int elsize); void Dynarr_resize (void *dy, int size); -void Dynarr_insert_many (void *d, const void *el, int len, int start); +void Dynarr_insert_many (void *d, CONST void *el, int len, int start); void Dynarr_delete_many (void *d, int start, int len); void Dynarr_free (void *d); -#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type))) -#define Dynarr_new2(dynarr_type, type) \ - ((dynarr_type *) Dynarr_newf (sizeof (type))) +#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof(type))) #define Dynarr_at(d, pos) ((d)->base[pos]) #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) #define Dynarr_length(d) ((d)->cur) @@ -74,9 +73,9 @@ #define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur) #define Dynarr_insert_many_at_start(d, el, len) \ Dynarr_insert_many (d, el, len, 0) -#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1) +#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof(s) - 1) #define Dynarr_add_lisp_string(d, s) do { \ - Lisp_String *dyna_ls_s = XSTRING (s); \ + struct Lisp_String *dyna_ls_s = XSTRING (s); \ Dynarr_add_many (d, (char *) string_data (dyna_ls_s), \ string_length (dyna_ls_s)); \ } while (0) @@ -91,6 +90,9 @@ #define Dynarr_increment(d) ((d)->cur++) #define Dynarr_set_size(d, n) ((d)->cur = n) +/* Minimum size in elements for dynamic array when resized; default is 32 */ +extern int Dynarr_min_size; + #ifdef MEMORY_USAGE_STATS struct overhead_stats; size_t Dynarr_memory_usage (void *d, struct overhead_stats *stats); @@ -110,17 +112,19 @@ #endif /* Memory allocation */ -void malloc_warning (const char *); +void malloc_warning (CONST char *); void *xmalloc (size_t size); void *xmalloc_and_zero (size_t size); void *xrealloc (void *, size_t size); -char *xstrdup (const char *); +char *xstrdup (CONST char *); /* generally useful */ -#define countof(x) ((int) (sizeof(x)/sizeof((x)[0]))) +#define countof(x) ((int) (sizeof(x)/sizeof(x[0]))) +#define slot_offset(type, slot_name) \ + ((unsigned) (((char *) (&(((type *)0)->slot_name))) - ((char *)0))) #define xnew(type) ((type *) xmalloc (sizeof (type))) #define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type))) #define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type))) -#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue))) +#define xzero(lvalue) ((void) memset (&(lvalue), 0, sizeof (lvalue))) #define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type))) #define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type)))) #define alloca_array(type, len) ((type *) alloca ((len) * sizeof (type))) @@ -132,16 +136,21 @@ macro will realloc BASEVAR as necessary so that it can hold at least NEEDED_SIZE objects. The reallocing is done by doubling, which ensures constant amortized time per element. */ -#define DO_REALLOC(basevar, sizevar, needed_size, type) do { \ +#define DO_REALLOC(basevar, sizevar, needed_size, type) do \ +{ \ + /* Avoid side-effectualness. */ \ + /* Dammit! Macros suffer from dynamic scope! */ \ + /* We demand inline functions! */ \ size_t do_realloc_needed_size = (needed_size); \ - if ((sizevar) < do_realloc_needed_size) \ - { \ - if ((sizevar) < 32) \ - (sizevar) = 32; \ - while ((sizevar) < do_realloc_needed_size) \ - (sizevar) *= 2; \ - XREALLOC_ARRAY (basevar, type, (sizevar)); \ - } \ + size_t do_realloc_newsize = 0; \ + while ((sizevar) < (do_realloc_needed_size)) { \ + do_realloc_newsize = 2*(sizevar); \ + if (do_realloc_newsize < 32) \ + do_realloc_newsize = 32; \ + (sizevar) = do_realloc_newsize; \ + } \ + if (do_realloc_newsize) \ + XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \ } while (0) #ifdef ERROR_CHECK_MALLOC @@ -154,6 +163,7 @@ } while (0) #else void xfree (void *); +#define xfree_1 xfree #endif /* ERROR_CHECK_MALLOC */ #ifndef PRINTF_ARGS @@ -168,13 +178,13 @@ #ifndef DOESNT_RETURN # if defined __GNUC__ # if ((__GNUC__ > 2) || (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)) -# define DOESNT_RETURN void +# define DOESNT_RETURN void volatile # define DECLARE_DOESNT_RETURN(decl) \ - extern void decl __attribute__ ((noreturn)) + extern void volatile decl __attribute__ ((noreturn)) # define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ /* Should be able to state multiple independent __attribute__s, but \ the losing syntax doesn't work that way, and screws losing cpp */ \ - extern void decl \ + extern void volatile decl \ __attribute__ ((noreturn, format (printf, str, idx))) # else # define DOESNT_RETURN void volatile @@ -192,7 +202,7 @@ #ifndef ALIGNOF # if defined (__GNUC__) && (__GNUC__ >= 2) -# define ALIGNOF(x) __alignof__ (x) +# define ALIGNOF(x) __alignof (x) # else # define ALIGNOF(x) sizeof (x) # endif @@ -221,7 +231,7 @@ #ifdef USE_ASSERTIONS /* Highly dubious kludge */ /* (thanks, Jamie, I feel better now -- ben) */ -void assert_failed (const char *, int, const char *); +DECLARE_DOESNT_RETURN (assert_failed (CONST char *, int, CONST char *)); # define abort() (assert_failed (__FILE__, __LINE__, "abort()")) # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) #else @@ -239,33 +249,6 @@ /*#define REGISTER register*/ /*#endif*/ - -/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. - In particular, it must be large enough to contain a pointer. - config.h can override this, e.g. to use `long long' for bigger lisp ints. */ - -#ifndef SIZEOF_EMACS_INT -# define SIZEOF_EMACS_INT SIZEOF_VOID_P -#endif - -#ifndef EMACS_INT -# if SIZEOF_EMACS_INT == SIZEOF_LONG -# define EMACS_INT long -# elif SIZEOF_EMACS_INT == SIZEOF_INT -# define EMACS_INT int -# elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG -# define EMACS_INT long long -# else -# error Unable to determine suitable type for EMACS_INT -# endif -#endif - -#ifndef EMACS_UINT -# define EMACS_UINT unsigned EMACS_INT -#endif - -#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR) - /************************************************************************/ /* typedefs */ @@ -300,17 +283,17 @@ buffer.h (where they rightfully belong) to avoid syntax errors in function prototypes. */ -typedef EMACS_INT Bufpos; -typedef EMACS_INT Bytind; -typedef EMACS_INT Memind; +typedef int Bufpos; +typedef int Bytind; +typedef int Memind; /* Counts of bytes or chars */ -typedef EMACS_INT Bytecount; -typedef EMACS_INT Charcount; +typedef int Bytecount; +typedef int Charcount; /* Length in bytes of a string in external format */ -typedef EMACS_INT Extcount; +typedef int Extcount; typedef struct lstream Lstream; @@ -340,17 +323,20 @@ typedef struct extent *EXTENT; struct frame; /* "frame.h" */ struct window; /* "window.h" */ -typedef struct Lisp_Event Lisp_Event; /* "events.h" */ -typedef struct Lisp_Face Lisp_Face; /* "faces.h" */ -typedef struct Lisp_Process Lisp_Process; /* "procimpl.h" */ +struct Lisp_Event; /* "events.h" */ +typedef struct Lisp_Event Lisp_Event; +struct Lisp_Face; +typedef struct Lisp_Face Lisp_Face; +struct Lisp_Process; /* "process.c" */ +typedef struct Lisp_Process Lisp_Process; struct stat; /* <sys/stat.h> */ +struct Lisp_Color_Instance; typedef struct Lisp_Color_Instance Lisp_Color_Instance; +struct Lisp_Font_Instance; typedef struct Lisp_Font_Instance Lisp_Font_Instance; +struct Lisp_Image_Instance; typedef struct Lisp_Image_Instance Lisp_Image_Instance; -typedef struct Lisp_Gui_Item Lisp_Gui_Item; struct display_line; -struct display_glyph_area; -struct display_box; struct redisplay_info; struct window_mirror; struct scrollbar_instance; @@ -420,6 +406,47 @@ Dynarr_declare (struct console_type_entry); } console_type_entry_dynarr; +/* Need to declare this here. */ +enum external_data_format +{ + /* 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 `binary' coding system: + + a) On input, bytes 0 - 255 are converted into characters 0 - 255. + b) On output, characters 0 - 255 are converted into bytes 0 - 255 + and other characters are converted into `X'. + */ + FORMAT_BINARY, + + /* Format used for filenames. In the original Mule, this is + user-definable with the `pathname-coding-system' variable. + For the moment, we just use the `binary' coding system. */ + FORMAT_FILENAME, + + /* Format used for output to the terminal. This should be controlled + by the `terminal-coding-system' variable. Under kterm, this will + be some ISO2022 system. On some DOS machines, this is Shift-JIS. */ + FORMAT_TERMINAL, + + /* Format used for input from the terminal. This should be controlled + by the `keyboard-coding-system' variable. */ + FORMAT_KEYBOARD, + + /* Format used for the external Unix environment -- argv[], stuff + from getenv(), stuff from the /etc/passwd file, etc. + + Perhaps should be the same as FORMAT_FILENAME. */ + FORMAT_OS, + + /* 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. */ + FORMAT_CTEXT +}; + +#define FORMAT_NATIVE FORMAT_FILENAME + enum run_hooks_condition { RUN_HOOKS_TO_COMPLETION, @@ -437,14 +464,6 @@ }; #endif -enum edge_style -{ - EDGE_ETCHED_IN, - EDGE_ETCHED_OUT, - EDGE_BEVEL_IN, - EDGE_BEVEL_OUT -}; - #ifndef ERROR_CHECK_TYPECHECK typedef enum error_behavior @@ -501,6 +520,32 @@ #define POINTER_TYPE_P(type) ((type) == Lisp_Type_Record) +/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. + In particular, it must be large enough to contain a pointer. + config.h can override this, e.g. to use `long long' for bigger lisp ints. */ + +#ifndef SIZEOF_EMACS_INT +# define SIZEOF_EMACS_INT SIZEOF_VOID_P +#endif + +#ifndef EMACS_INT +# if SIZEOF_EMACS_INT == SIZEOF_LONG +# define EMACS_INT long +# elif SIZEOF_EMACS_INT == SIZEOF_INT +# define EMACS_INT int +# elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG +# define EMACS_INT long long +# else +# error Unable to determine suitable type for EMACS_INT +# endif +#endif + +#ifndef EMACS_UINT +# define EMACS_UINT unsigned EMACS_INT +#endif + +#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR) + /* Overridden by m/next.h */ #ifndef ASSERT_VALID_POINTER # define ASSERT_VALID_POINTER(pnt) (assert ((((EMACS_UINT) pnt) & 3) == 0)) @@ -513,8 +558,7 @@ #define INT_VALBITS (BITS_PER_EMACS_INT - INT_GCBITS) #define VALBITS (BITS_PER_EMACS_INT - GCBITS) -#define EMACS_INT_MAX ((EMACS_INT) ((1UL << INT_VALBITS) -1UL)) -#define EMACS_INT_MIN (-(EMACS_INT_MAX) - 1) +#define EMACS_INT_MAX ((1UL << INT_VALBITS) -1UL) #ifdef USE_UNION_TYPE # include "lisp-union.h" @@ -522,7 +566,7 @@ # include "lisp-disunion.h" #endif /* !USE_UNION_TYPE */ -#define XPNTR(x) ((void *) XPNTRVAL(x)) +#define XPNTR(x) ((void *) (XPNTRVAL(x))) /* WARNING WARNING WARNING. You must ensure on your own that proper GC protection is provided for the elements in this array. */ @@ -534,8 +578,8 @@ /* Close your eyes now lest you vomit or spontaneously combust ... */ #define HACKEQ_UNSAFE(obj1, obj2) \ - (EQ (obj1, obj2) || (!POINTER_TYPE_P (XTYPE (obj1)) \ - && !POINTER_TYPE_P (XTYPE (obj2)) \ + (EQ (obj1, obj2) || (!POINTER_TYPE_P (XGCTYPE (obj1)) \ + && !POINTER_TYPE_P (XGCTYPE (obj2)) \ && XCHAR_OR_INT (obj1) == XCHAR_OR_INT (obj2))) #ifdef DEBUG_XEMACS @@ -565,6 +609,7 @@ to mean "no such value". */ #define UNBOUNDP(val) EQ (val, Qunbound) +#define GC_UNBOUNDP(val) GC_EQ (val, Qunbound) /*********** cons ***********/ @@ -593,6 +638,7 @@ #define XCONS(x) XRECORD (x, cons, Lisp_Cons) #define XSETCONS(x, p) XSETRECORD (x, p, cons) #define CONSP(x) RECORDP (x, cons) +#define GC_CONSP(x) GC_RECORDP (x, cons) #define CHECK_CONS(x) CHECK_RECORD (x, cons) #define CONCHECK_CONS(x) CONCHECK_RECORD (x, cons) @@ -602,6 +648,7 @@ extern Lisp_Object Qnil; #define NILP(x) EQ (x, Qnil) +#define GC_NILP(x) GC_EQ (x, Qnil) #define XCAR(a) (XCONS (a)->car) #define XCDR(a) (XCONS (a)->cdr) #define LISTP(x) (CONSP(x) || NILP(x)) @@ -661,7 +708,7 @@ #define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do { \ Lisp_Object prev_tail_##list = Qnil; \ Lisp_Object tail_##list; \ - EMACS_INT len_##list; \ + int len_##list; \ EXTERNAL_LIST_LOOP_4 (elt, list, tail_##list, len_##list) \ { \ if (condition) \ @@ -718,26 +765,26 @@ #define EXTERNAL_LIST_LOOP_1(list) \ Lisp_Object ELL1_elt, ELL1_hare, ELL1_tortoise; \ -EMACS_INT ELL1_len; \ -EXTERNAL_LIST_LOOP_6 (ELL1_elt, list, ELL1_len, ELL1_hare, \ - ELL1_tortoise, CIRCULAR_LIST_SUSPICION_LENGTH) +int ELL1_len; \ +EXTERNAL_LIST_LOOP_6(ELL1_elt, list, ELL1_len, ELL1_hare, \ + ELL1_tortoise, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_LIST_LOOP_2(elt, list) \ Lisp_Object hare_##elt, tortoise_##elt; \ -EMACS_INT len_##elt; \ -EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt, \ - tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) +int len_##elt; \ +EXTERNAL_LIST_LOOP_6(elt, list, len_##elt, hare_##elt, \ + tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_LIST_LOOP_3(elt, list, tail) \ Lisp_Object tortoise_##elt; \ -EMACS_INT len_##elt; \ -EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, tail, \ - tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) +int len_##elt; \ +EXTERNAL_LIST_LOOP_6(elt, list, len_##elt, tail, \ + tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_LIST_LOOP_4(elt, list, tail, len) \ Lisp_Object tortoise_##elt; \ -EXTERNAL_LIST_LOOP_6 (elt, list, len, tail, \ - tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) +EXTERNAL_LIST_LOOP_6(elt, list, len, tail, \ + tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_LIST_LOOP_6(elt, list, len, hare, \ @@ -762,30 +809,30 @@ /* Optimized and safe macros for looping over external alists. */ -#define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list) \ -Lisp_Object hare_##elt, tortoise_##elt; \ -EMACS_INT len_##elt; \ -EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \ - len_##elt, hare_##elt, tortoise_##elt, \ +#define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list) \ +Lisp_Object hare_##elt, tortoise_##elt; \ +int len_##elt; \ +EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \ + len_##elt, hare_##elt, tortoise_##elt, \ CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_ALIST_LOOP_5(elt, elt_car, elt_cdr, list, tail) \ Lisp_Object tortoise_##elt; \ -EMACS_INT len_##elt; \ -EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \ - len_##elt, tail, tortoise_##elt, \ - CIRCULAR_LIST_SUSPICION_LENGTH) \ +int len_##elt; \ +EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, \ + len_##elt, tail, tortoise_##elt, \ + CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_ALIST_LOOP_6(elt, elt_car, elt_cdr, list, tail, len) \ Lisp_Object tortoise_##elt; \ -EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \ - len, tail, tortoise_##elt, \ - CIRCULAR_LIST_SUSPICION_LENGTH) +EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, \ + len, tail, tortoise_##elt, \ + CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, hare, \ tortoise, suspicion_length) \ -EXTERNAL_LIST_LOOP_6 (elt, list, len, hare, tortoise, suspicion_length) \ +EXTERNAL_LIST_LOOP_6(elt, list, len, hare, tortoise, suspicion_length) \ if (CONSP (elt) ? (elt_car = XCAR (elt), elt_cdr = XCDR (elt), 0) :1) \ continue; \ else @@ -794,20 +841,20 @@ /* Optimized and safe macros for looping over external property lists. */ #define EXTERNAL_PROPERTY_LIST_LOOP_3(key, value, list) \ Lisp_Object key, value, hare_##key, tortoise_##key; \ -EMACS_INT len_##key; \ -EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len_##key, hare_##key, \ +int len_##key; \ +EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len_##key, hare_##key,\ tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_PROPERTY_LIST_LOOP_4(key, value, list, tail) \ Lisp_Object key, value, tail, tortoise_##key; \ -EMACS_INT len_##key; \ -EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len_##key, tail, \ +int len_##key; \ +EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len_##key, tail, \ tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH) #define EXTERNAL_PROPERTY_LIST_LOOP_5(key, value, list, tail, len) \ Lisp_Object key, value, tail, tortoise_##key; \ -EMACS_INT len; \ -EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail, \ +int len; \ +EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, tail, \ tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH) @@ -859,12 +906,12 @@ ) /* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */ -INLINE_HEADER int TRUE_LIST_P (Lisp_Object object); -INLINE_HEADER int +INLINE int TRUE_LIST_P (Lisp_Object object); +INLINE int TRUE_LIST_P (Lisp_Object object) { Lisp_Object hare, tortoise; - EMACS_INT len; + int len; for (hare = tortoise = object, len = 0; CONSP (hare); @@ -886,7 +933,7 @@ #define CHECK_TRUE_LIST(list) do { \ Lisp_Object CTL_list = (list); \ Lisp_Object CTL_hare, CTL_tortoise; \ - EMACS_INT CTL_len; \ + int CTL_len; \ \ for (CTL_hare = CTL_tortoise = CTL_list, CTL_len = 0; \ CONSP (CTL_hare); \ @@ -920,13 +967,14 @@ #define XSTRING(x) XRECORD (x, string, Lisp_String) #define XSETSTRING(x, p) XSETRECORD (x, p, string) #define STRINGP(x) RECORDP (x, string) +#define GC_STRINGP(x) GC_RECORDP (x, string) #define CHECK_STRING(x) CHECK_RECORD (x, string) #define CONCHECK_STRING(x) CONCHECK_RECORD (x, string) #ifdef MULE -Charcount bytecount_to_charcount (const Bufbyte *ptr, Bytecount len); -Bytecount charcount_to_bytecount (const Bufbyte *ptr, Charcount len); +Charcount bytecount_to_charcount (CONST Bufbyte *ptr, Bytecount len); +Bytecount charcount_to_bytecount (CONST Bufbyte *ptr, Charcount len); #else /* not MULE */ @@ -945,14 +993,14 @@ #define string_byte_addr(s, i) (&((s)->data[i])) #define set_string_length(s, len) ((void) ((s)->size = (len))) #define set_string_data(s, ptr) ((void) ((s)->data = (ptr))) -#define set_string_byte(s, i, b) ((void) ((s)->data[i] = (b))) +#define set_string_byte(s, i, c) ((void) ((s)->data[i] = (c))) void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta); #ifdef MULE -INLINE_HEADER Charcount string_char_length (Lisp_String *s); -INLINE_HEADER Charcount +INLINE Charcount string_char_length (Lisp_String *s); +INLINE Charcount string_char_length (Lisp_String *s) { return bytecount_to_charcount (string_data (s), string_length (s)); @@ -967,19 +1015,10 @@ # define string_char_length(s) string_length (s) # define string_char(s, i) ((Emchar) string_byte (s, i)) # define string_char_addr(s, i) string_byte_addr (s, i) -# define set_string_char(s, i, c) set_string_byte (s, i, (Bufbyte)c) +# define set_string_char(s, i, c) set_string_byte (s, i, c) #endif /* not MULE */ -/* Return the true size of a struct with a variable-length array field. */ -#define FLEXIBLE_ARRAY_STRUCT_SIZEOF(flexible_array_structtype, \ - flexible_array_field, \ - flexible_array_length) \ - (offsetof (flexible_array_structtype, flexible_array_field) + \ - (offsetof (flexible_array_structtype, flexible_array_field[1]) - \ - offsetof (flexible_array_structtype, flexible_array_field[0])) * \ - (flexible_array_length)) - /*********** vector ***********/ struct Lisp_Vector @@ -997,6 +1036,7 @@ #define XVECTOR(x) XRECORD (x, vector, Lisp_Vector) #define XSETVECTOR(x, p) XSETRECORD (x, p, vector) #define VECTORP(x) RECORDP (x, vector) +#define GC_VECTORP(x) GC_RECORDP (x, vector) #define CHECK_VECTOR(x) CHECK_RECORD (x, vector) #define CONCHECK_VECTOR(x) CONCHECK_RECORD (x, vector) @@ -1035,10 +1075,12 @@ #define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector) #define XSETBIT_VECTOR(x, p) XSETRECORD (x, p, bit_vector) #define BIT_VECTORP(x) RECORDP (x, bit_vector) +#define GC_BIT_VECTORP(x) GC_RECORDP (x, bit_vector) #define CHECK_BIT_VECTOR(x) CHECK_RECORD (x, bit_vector) #define CONCHECK_BIT_VECTOR(x) CONCHECK_RECORD (x, bit_vector) #define BITP(x) (INTP (x) && (XINT (x) == 0 || XINT (x) == 1)) +#define GC_BITP(x) (GC_INTP (x) && (XINT (x) == 0 || XINT (x) == 1)) #define CHECK_BIT(x) do { \ if (!BITP (x)) \ @@ -1053,42 +1095,45 @@ #define bit_vector_length(v) ((v)->size) #define bit_vector_next(v) ((v)->next) -INLINE_HEADER int bit_vector_bit (Lisp_Bit_Vector *v, size_t n); -INLINE_HEADER int -bit_vector_bit (Lisp_Bit_Vector *v, size_t n) +INLINE int bit_vector_bit (Lisp_Bit_Vector *v, int i); +INLINE int +bit_vector_bit (Lisp_Bit_Vector *v, int i) { - return ((v->bits[n >> LONGBITS_LOG2] >> (n & (LONGBITS_POWER_OF_2 - 1))) + unsigned int ui = (unsigned int) i; + + return (((v)->bits[ui >> LONGBITS_LOG2] >> (ui & (LONGBITS_POWER_OF_2 - 1))) & 1); } -INLINE_HEADER void set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value); -INLINE_HEADER void -set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value) +INLINE void set_bit_vector_bit (Lisp_Bit_Vector *v, int i, int value); +INLINE void +set_bit_vector_bit (Lisp_Bit_Vector *v, int i, int value) { + unsigned int ui = (unsigned int) i; if (value) - v->bits[n >> LONGBITS_LOG2] |= (1UL << (n & (LONGBITS_POWER_OF_2 - 1))); + (v)->bits[ui >> LONGBITS_LOG2] |= (1U << (ui & (LONGBITS_POWER_OF_2 - 1))); else - v->bits[n >> LONGBITS_LOG2] &= ~(1UL << (n & (LONGBITS_POWER_OF_2 - 1))); + (v)->bits[ui >> LONGBITS_LOG2] &= ~(1U << (ui & (LONGBITS_POWER_OF_2 - 1))); } /* Number of longs required to hold LEN bits */ #define BIT_VECTOR_LONG_STORAGE(len) \ - (((len) + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2) + ((len + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2) /*********** symbol ***********/ -typedef struct Lisp_Symbol Lisp_Symbol; struct Lisp_Symbol { struct lrecord_header lheader; /* next symbol in this obarray bucket */ - Lisp_Symbol *next; - Lisp_String *name; + struct Lisp_Symbol *next; + struct Lisp_String *name; Lisp_Object value; Lisp_Object function; Lisp_Object plist; }; +typedef struct Lisp_Symbol Lisp_Symbol; #define SYMBOL_IS_KEYWORD(sym) \ ((string_byte (symbol_name (XSYMBOL (sym)), 0) == ':') \ @@ -1101,6 +1146,7 @@ #define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol) #define XSETSYMBOL(x, p) XSETRECORD (x, p, symbol) #define SYMBOLP(x) RECORDP (x, symbol) +#define GC_SYMBOLP(x) GC_RECORDP (x, symbol) #define CHECK_SYMBOL(x) CHECK_RECORD (x, symbol) #define CONCHECK_SYMBOL(x) CONCHECK_RECORD (x, symbol) @@ -1117,11 +1163,10 @@ struct Lisp_Subr { struct lrecord_header lheader; - short min_args; - short max_args; - const char *prompt; - const char *doc; - const char *name; + short min_args, max_args; + CONST char *prompt; + CONST char *doc; + CONST char *name; lisp_fn_t subr_fn; }; typedef struct Lisp_Subr Lisp_Subr; @@ -1130,31 +1175,30 @@ #define XSUBR(x) XRECORD (x, subr, Lisp_Subr) #define XSETSUBR(x, p) XSETRECORD (x, p, subr) #define SUBRP(x) RECORDP (x, subr) +#define GC_SUBRP(x) GC_RECORDP (x, subr) #define CHECK_SUBR(x) CHECK_RECORD (x, subr) #define CONCHECK_SUBR(x) CONCHECK_RECORD (x, subr) -#define subr_function(subr) ((subr)->subr_fn) -#define SUBR_FUNCTION(subr,max_args) \ - ((Lisp_Object (*) (EXFUN_##max_args)) (subr)->subr_fn) -#define subr_name(subr) ((subr)->name) +#define subr_function(subr) (subr)->subr_fn +#define subr_name(subr) (subr)->name /*********** marker ***********/ -typedef struct Lisp_Marker Lisp_Marker; struct Lisp_Marker { struct lrecord_header lheader; - Lisp_Marker *next; - Lisp_Marker *prev; + struct Lisp_Marker *next, *prev; struct buffer *buffer; Memind memind; char insertion_type; }; +typedef struct Lisp_Marker Lisp_Marker; DECLARE_LRECORD (marker, Lisp_Marker); #define XMARKER(x) XRECORD (x, marker, Lisp_Marker) #define XSETMARKER(x, p) XSETRECORD (x, p, marker) #define MARKERP(x) RECORDP (x, marker) +#define GC_MARKERP(x) GC_RECORDP (x, marker) #define CHECK_MARKER(x) CHECK_RECORD (x, marker) #define CONCHECK_MARKER(x) CONCHECK_RECORD (x, marker) @@ -1167,11 +1211,12 @@ /*********** char ***********/ #define CHARP(x) (XTYPE (x) == Lisp_Type_Char) +#define GC_CHARP(x) (XGCTYPE (x) == Lisp_Type_Char) #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER Emchar XCHAR (Lisp_Object obj); -INLINE_HEADER Emchar +INLINE Emchar XCHAR (Lisp_Object obj); +INLINE Emchar XCHAR (Lisp_Object obj) { assert (CHARP (obj)); @@ -1180,7 +1225,7 @@ #else -#define XCHAR(x) ((Emchar)XCHARVAL (x)) +#define XCHAR(x) XCHARVAL (x) #endif @@ -1208,6 +1253,7 @@ #define XFLOAT(x) XRECORD (x, float, Lisp_Float) #define XSETFLOAT(x, p) XSETRECORD (x, p, float) #define FLOATP(x) RECORDP (x, float) +#define GC_FLOATP(x) GC_RECORDP (x, float) #define CHECK_FLOAT(x) CHECK_RECORD (x, float) #define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float) @@ -1227,38 +1273,44 @@ } while (0) # define INT_OR_FLOATP(x) (INTP (x) || FLOATP (x)) +# define GC_INT_OR_FLOATP(x) (GC_INTP (x) || GC_FLOATP (x)) #else /* not LISP_FLOAT_TYPE */ #define XFLOAT(x) --- error! No float support. --- #define XSETFLOAT(x, p) --- error! No float support. --- #define FLOATP(x) 0 +#define GC_FLOATP(x) 0 #define CHECK_FLOAT(x) --- error! No float support. --- #define CONCHECK_FLOAT(x) --- error! No float support. --- #define XFLOATINT(n) XINT(n) #define CHECK_INT_OR_FLOAT CHECK_INT #define CONCHECK_INT_OR_FLOAT CONCHECK_INT -#define INT_OR_FLOATP(x) INTP (x) +#define INT_OR_FLOATP(x) (INTP (x)) +# define GC_INT_OR_FLOATP(x) (GC_INTP (x)) #endif /* not LISP_FLOAT_TYPE */ /*********** int ***********/ +#define GC_INTP(x) INTP (x) + #define ZEROP(x) EQ (x, Qzero) +#define GC_ZEROP(x) GC_EQ (x, Qzero) #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER EMACS_INT XINT (Lisp_Object obj); -INLINE_HEADER EMACS_INT +INLINE EMACS_INT XINT (Lisp_Object obj); +INLINE EMACS_INT XINT (Lisp_Object obj) { assert (INTP (obj)); return XREALINT (obj); } -INLINE_HEADER EMACS_INT XCHAR_OR_INT (Lisp_Object obj); -INLINE_HEADER EMACS_INT +INLINE EMACS_INT XCHAR_OR_INT (Lisp_Object obj); +INLINE EMACS_INT XCHAR_OR_INT (Lisp_Object obj) { assert (INTP (obj) || CHARP (obj)); @@ -1283,6 +1335,7 @@ } while (0) #define NATNUMP(x) (INTP (x) && XINT (x) >= 0) +#define GC_NATNUMP(x) (GC_INTP (x) && XINT (x) >= 0) #define CHECK_NATNUM(x) do { \ if (!NATNUMP (x)) \ @@ -1326,7 +1379,7 @@ /*********** readonly objects ***********/ - + #define CHECK_C_WRITEABLE(obj) \ do { if (c_readonly (obj)) c_write_error (obj); } while (0) @@ -1389,10 +1442,7 @@ /* element disappears if it's a cons and its car is unmarked. */ WEAK_LIST_KEY_ASSOC, /* element disappears if it's a cons and its cdr is unmarked. */ - WEAK_LIST_VALUE_ASSOC, - /* element disappears if it's a cons and neither its car nor - its cdr is marked. */ - WEAK_LIST_FULL_ASSOC + WEAK_LIST_VALUE_ASSOC }; struct weak_list @@ -1407,6 +1457,7 @@ #define XWEAK_LIST(x) XRECORD (x, weak_list, struct weak_list) #define XSETWEAK_LIST(x, p) XSETRECORD (x, p, weak_list) #define WEAK_LISTP(x) RECORDP (x, weak_list) +#define GC_WEAK_LISTP(x) GC_RECORDP (x, weak_list) #define CHECK_WEAK_LIST(x) CHECK_RECORD (x, weak_list) #define CONCHECK_WEAK_LIST(x) CONCHECK_RECORD (x, weak_list) @@ -1415,8 +1466,9 @@ Lisp_Object make_weak_list (enum weak_list_type type); /* The following two are only called by the garbage collector */ -int finish_marking_weak_lists (void); -void prune_weak_lists (void); +int finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object), + void (*markobj) (Lisp_Object)); +void prune_weak_lists (int (*obj_marked_p) (Lisp_Object)); /*********** lcrecord lists ***********/ @@ -1425,19 +1477,20 @@ struct lcrecord_header header; Lisp_Object free; size_t size; - const struct lrecord_implementation *implementation; + CONST struct lrecord_implementation *implementation; }; DECLARE_LRECORD (lcrecord_list, struct lcrecord_list); #define XLCRECORD_LIST(x) XRECORD (x, lcrecord_list, struct lcrecord_list) #define XSETLCRECORD_LIST(x, p) XSETRECORD (x, p, lcrecord_list) #define LCRECORD_LISTP(x) RECORDP (x, lcrecord_list) +#define GC_LCRECORD_LISTP(x) GC_RECORDP (x, lcrecord_list) /* #define CHECK_LCRECORD_LIST(x) CHECK_RECORD (x, lcrecord_list) Lcrecord lists should never escape to the Lisp level, so functions should not be doing this. */ Lisp_Object make_lcrecord_list (size_t size, - const struct lrecord_implementation + CONST struct lrecord_implementation *implementation); Lisp_Object allocate_managed_lcrecord (Lisp_Object lcrecord_list); void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord); @@ -1496,23 +1549,12 @@ /* Can't be const, because then subr->doc is read-only and Snarf_documentation chokes */ +#define subr_lheader_initializer { 0, { 0, 0, 0 } } + #define DEFUN(lname, Fname, min_args, max_args, prompt, arglist) \ Lisp_Object Fname (EXFUN_##max_args); \ - static struct Lisp_Subr S##Fname = \ - { \ - { /* struct lrecord_header */ \ - lrecord_type_subr, /* lrecord_type_index */ \ - 1, /* mark bit */ \ - 1, /* c_readonly bit */ \ - 1 /* lisp_readonly bit */ \ - }, \ - min_args, \ - max_args, \ - prompt, \ - 0, /* doc string */ \ - lname, \ - (lisp_fn_t) Fname \ - }; \ + static struct Lisp_Subr S##Fname = { subr_lheader_initializer, \ + min_args, max_args, prompt, 0, lname, (lisp_fn_t) Fname }; \ Lisp_Object Fname (DEFUN_##max_args arglist) /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a @@ -1549,12 +1591,6 @@ extern int specpdl_depth_counter; #define specpdl_depth() specpdl_depth_counter - -#define CHECK_FUNCTION(fun) do { \ - while (NILP (Ffunctionp (fun))) \ - signal_invalid_function_error (fun); \ - } while (0) - /************************************************************************/ /* Checking for QUIT */ @@ -1616,8 +1652,8 @@ #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i)) #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj)) -unsigned long string_hash (const char *xv); -unsigned long memory_hash (const void *xv, size_t size); +unsigned long string_hash (CONST void *xv); +unsigned long memory_hash (CONST void *xv, size_t size); unsigned long internal_hash (Lisp_Object obj, int depth); unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth); @@ -1630,10 +1666,10 @@ #ifdef HAVE_LIBINTL_H #include <libintl.h> #else -char *dgettext (const char *, const char *); -char *gettext (const char *); -char *textdomain (const char *); -char *bindtextdomain (const char *, const char *); +char *dgettext (CONST char *, CONST char *); +char *gettext (CONST char *); +char *textdomain (CONST char *); +char *bindtextdomain (CONST char *, CONST char *); #endif /* HAVE_LIBINTL_H */ #define GETTEXT(x) gettext(x) @@ -1775,7 +1811,8 @@ gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \ gcprolist = &gcpro4 )) -#define GCPRO5(var1, var2, var3, var4, var5) ((void) ( \ +#define GCPRO5(var1, var2, var3, var4, var5) \ + ((void) ( \ gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \ gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \ @@ -1807,7 +1844,8 @@ ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \ gcprolist = &ngcpro4 )) -#define NGCPRO5(var1, var2, var3, var4, var5) ((void) ( \ +#define NGCPRO5(var1, var2, var3, var4, var5) \ + ((void) ( \ ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \ ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \ @@ -1839,7 +1877,8 @@ nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \ gcprolist = &nngcpro4 )) -#define NNGCPRO5(var1, var2, var3, var4, var5) ((void) ( \ +#define NNGCPRO5(var1, var2, var3, var4, var5) \ + ((void) ( \ nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \ nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \ @@ -1901,24 +1940,6 @@ /* Call staticpro (&var) to protect static variable `var'. */ void staticpro (Lisp_Object *); -/* Call staticpro_nodump (&var) to protect static variable `var'. */ -/* var will not be saved at dump time */ -void staticpro_nodump (Lisp_Object *); - -/* Call dumpstruct(&var, &desc) to dump the structure pointed to by `var'. */ -void dumpstruct (void *, const struct struct_description *); - -/* Call dumpopaque(&var, size) to dump the opaque static structure `var'. */ -void dumpopaque (void *, size_t); - -/* Call pdump_wire(&var) to ensure that var is properly updated after pdump. */ -void pdump_wire (Lisp_Object *); - -/* Call pdump_wire(&var) to ensure that var is properly updated after - pdump. var must point to a linked list of objects out of which - some may not be dumped */ -void pdump_wire_list (Lisp_Object *); - /* Nonzero means Emacs has already been initialized. Used during startup to detect startup of dumped Emacs. */ extern int initialized; @@ -1968,7 +1989,7 @@ #endif #endif #ifndef IS_ANY_SEP -#define IS_ANY_SEP(c) IS_DIRECTORY_SEP (c) +#define IS_ANY_SEP(c) (IS_DIRECTORY_SEP (c)) #endif #ifdef HAVE_INTTYPES_H @@ -2017,36 +2038,26 @@ extern EMACS_INT gc_generation_number[1]; int c_readonly (Lisp_Object); int lisp_readonly (Lisp_Object); -Lisp_Object build_string (const char *); -Lisp_Object build_ext_string (const char *, Lisp_Object); -Lisp_Object build_translated_string (const char *); -Lisp_Object make_string (const Bufbyte *, Bytecount); -Lisp_Object make_ext_string (const Extbyte *, EMACS_INT, Lisp_Object); +Lisp_Object build_string (CONST char *); +Lisp_Object build_ext_string (CONST char *, enum external_data_format); +Lisp_Object build_translated_string (CONST char *); +Lisp_Object make_string (CONST Bufbyte *, Bytecount); +Lisp_Object make_ext_string (CONST Extbyte *, EMACS_INT, + enum external_data_format); Lisp_Object make_uninit_string (Bytecount); Lisp_Object make_float (double); -Lisp_Object make_string_nocopy (const Bufbyte *, Bytecount); +Lisp_Object make_string_nocopy (CONST Bufbyte *, Bytecount); void free_cons (Lisp_Cons *); void free_list (Lisp_Object); void free_alist (Lisp_Object); void mark_conses_in_list (Lisp_Object); void free_marker (Lisp_Marker *); int object_dead_p (Lisp_Object); -void mark_object (Lisp_Object obj); -int marked_p (Lisp_Object obj); #ifdef MEMORY_USAGE_STATS size_t malloced_storage_size (void *, size_t, struct overhead_stats *); size_t fixed_type_block_overhead (size_t); #endif -#ifdef PDUMP -void pdump (void); -int pdump_load (const char *); - -extern char *pdump_start, *pdump_end; -#define DUMPEDP(adr) ((((char *)(adr)) < pdump_end) && (((char *)(adr)) >= pdump_start)) -#else -#define DUMPEDP(adr) 0 -#endif /* Defined in buffer.c */ Lisp_Object make_buffer (struct buffer *); @@ -2056,15 +2067,11 @@ extern int find_file_use_truenames; /* Defined in callproc.c */ -char *egetenv (const char *); +char *egetenv (CONST char *); /* Defined in console.c */ void stuff_buffered_input (Lisp_Object); -/* Defined in console-msw.c */ -EXFUN (Fmswindows_message_box, 3); -extern int mswindows_message_outputted; - /* Defined in data.c */ DECLARE_DOESNT_RETURN (c_write_error (Lisp_Object)); DECLARE_DOESNT_RETURN (lisp_write_error (Lisp_Object)); @@ -2073,7 +2080,7 @@ Lisp_Object)); Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); DECLARE_DOESNT_RETURN (dead_wrong_type_argument (Lisp_Object, Lisp_Object)); -void check_int_range (EMACS_INT, EMACS_INT, EMACS_INT); +void check_int_range (int, int, int); enum arith_comparison { arith_equal, @@ -2088,7 +2095,7 @@ unsigned int lisp_to_word (Lisp_Object); /* Defined in dired.c */ -Lisp_Object make_directory_hash_table (const char *); +Lisp_Object make_directory_hash_table (CONST char *); Lisp_Object wasteful_word_to_lisp (unsigned int); /* Defined in doc.c */ @@ -2096,32 +2103,32 @@ Lisp_Object read_doc_string (Lisp_Object); /* Defined in doprnt.c */ -Bytecount emacs_doprnt_c (Lisp_Object, const Bufbyte *, Lisp_Object, +Bytecount emacs_doprnt_c (Lisp_Object, CONST Bufbyte *, Lisp_Object, Bytecount, ...); -Bytecount emacs_doprnt_va (Lisp_Object, const Bufbyte *, Lisp_Object, +Bytecount emacs_doprnt_va (Lisp_Object, CONST Bufbyte *, Lisp_Object, Bytecount, va_list); -Bytecount emacs_doprnt_lisp (Lisp_Object, const Bufbyte *, Lisp_Object, - Bytecount, int, const Lisp_Object *); -Bytecount emacs_doprnt_lisp_2 (Lisp_Object, const Bufbyte *, Lisp_Object, +Bytecount emacs_doprnt_lisp (Lisp_Object, CONST Bufbyte *, Lisp_Object, + Bytecount, int, CONST Lisp_Object *); +Bytecount emacs_doprnt_lisp_2 (Lisp_Object, CONST Bufbyte *, Lisp_Object, Bytecount, int, ...); -Lisp_Object emacs_doprnt_string_c (const Bufbyte *, Lisp_Object, +Lisp_Object emacs_doprnt_string_c (CONST Bufbyte *, Lisp_Object, Bytecount, ...); -Lisp_Object emacs_doprnt_string_va (const Bufbyte *, Lisp_Object, +Lisp_Object emacs_doprnt_string_va (CONST Bufbyte *, Lisp_Object, Bytecount, va_list); -Lisp_Object emacs_doprnt_string_lisp (const Bufbyte *, Lisp_Object, - Bytecount, int, const Lisp_Object *); -Lisp_Object emacs_doprnt_string_lisp_2 (const Bufbyte *, Lisp_Object, +Lisp_Object emacs_doprnt_string_lisp (CONST Bufbyte *, Lisp_Object, + Bytecount, int, CONST Lisp_Object *); +Lisp_Object emacs_doprnt_string_lisp_2 (CONST Bufbyte *, Lisp_Object, Bytecount, int, ...); /* Defined in editfns.c */ void uncache_home_directory (void); -Extbyte *get_home_directory (void); -char *user_login_name (uid_t *); +char *get_home_directory (void); +char *user_login_name (int *); Bufpos bufpos_clip_to_bounds (Bufpos, Bufpos, Bufpos); Bytind bytind_clip_to_bounds (Bytind, Bytind, Bytind); void buffer_insert1 (struct buffer *, Lisp_Object); -Lisp_Object make_string_from_buffer (struct buffer *, Bufpos, Charcount); -Lisp_Object make_string_from_buffer_no_extents (struct buffer *, Bufpos, Charcount); +Lisp_Object make_string_from_buffer (struct buffer *, int, int); +Lisp_Object make_string_from_buffer_no_extents (struct buffer *, int, int); Lisp_Object save_excursion_save (void); Lisp_Object save_restriction_save (void); Lisp_Object save_excursion_restore (Lisp_Object); @@ -2131,19 +2138,18 @@ Lisp_Object save_current_buffer_restore (Lisp_Object); /* Defined in emacs.c */ -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (const char *, +DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (CONST char *, ...), 1, 2); -int stderr_out (const char *, ...) PRINTF_ARGS (1, 2); -int stdout_out (const char *, ...) PRINTF_ARGS (1, 2); +int stderr_out (CONST char *, ...) PRINTF_ARGS (1, 2); +int stdout_out (CONST char *, ...) PRINTF_ARGS (1, 2); SIGTYPE fatal_error_signal (int); Lisp_Object make_arg_list (int, char **); void make_argc_argv (Lisp_Object, int *, char ***); void free_argc_argv (char **); -Lisp_Object decode_env_path (const char *, const char *); -Lisp_Object decode_path (const char *); +Lisp_Object decode_env_path (CONST char *, CONST char *); +Lisp_Object decode_path (CONST char *); /* Nonzero means don't do interactive redisplay and don't change tty modes */ -extern int noninteractive, noninteractive1; -extern int fatal_error_in_progress; +extern int noninteractive; extern int preparing_for_armageddon; extern int emacs_priority; extern int running_asynch_code; @@ -2154,46 +2160,42 @@ void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior); Lisp_Object maybe_signal_continuable_error (Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error (const char *, +DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error (CONST char *, ...), 1, 2); -void maybe_error (Lisp_Object, Error_behavior, const char *, +void maybe_error (Lisp_Object, Error_behavior, CONST char *, ...) PRINTF_ARGS (3, 4); -Lisp_Object continuable_error (const char *, ...) PRINTF_ARGS (1, 2); +Lisp_Object continuable_error (CONST char *, ...) PRINTF_ARGS (1, 2); Lisp_Object maybe_continuable_error (Lisp_Object, Error_behavior, - const char *, ...) PRINTF_ARGS (3, 4); -DECLARE_DOESNT_RETURN (signal_simple_error (const char *, Lisp_Object)); -void maybe_signal_simple_error (const char *, Lisp_Object, + CONST char *, ...) PRINTF_ARGS (3, 4); +DECLARE_DOESNT_RETURN (signal_simple_error (CONST char *, Lisp_Object)); +void maybe_signal_simple_error (CONST char *, Lisp_Object, Lisp_Object, Error_behavior); -Lisp_Object signal_simple_continuable_error (const char *, Lisp_Object); -Lisp_Object maybe_signal_simple_continuable_error (const char *, Lisp_Object, +Lisp_Object signal_simple_continuable_error (CONST char *, Lisp_Object); +Lisp_Object maybe_signal_simple_continuable_error (CONST char *, Lisp_Object, Lisp_Object, Error_behavior); DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error_with_frob - (Lisp_Object, const char *, + (Lisp_Object, CONST char *, ...), 2, 3); void maybe_error_with_frob (Lisp_Object, Lisp_Object, Error_behavior, - const char *, ...) PRINTF_ARGS (4, 5); -Lisp_Object continuable_error_with_frob (Lisp_Object, const char *, + CONST char *, ...) PRINTF_ARGS (4, 5); +Lisp_Object continuable_error_with_frob (Lisp_Object, CONST char *, ...) PRINTF_ARGS (2, 3); Lisp_Object maybe_continuable_error_with_frob -(Lisp_Object, Lisp_Object, Error_behavior, const char *, ...) PRINTF_ARGS (4, 5); -DECLARE_DOESNT_RETURN (signal_simple_error_2 (const char *, +(Lisp_Object, Lisp_Object, Error_behavior, CONST char *, ...) PRINTF_ARGS (4, 5); +DECLARE_DOESNT_RETURN (signal_simple_error_2 (CONST char *, Lisp_Object, Lisp_Object)); -void maybe_signal_simple_error_2 (const char *, Lisp_Object, Lisp_Object, +void maybe_signal_simple_error_2 (CONST char *, Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior); -Lisp_Object signal_simple_continuable_error_2 (const char *, +Lisp_Object signal_simple_continuable_error_2 (CONST char *, Lisp_Object, Lisp_Object); -Lisp_Object maybe_signal_simple_continuable_error_2 (const char *, Lisp_Object, +Lisp_Object maybe_signal_simple_continuable_error_2 (CONST char *, Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_malformed_list_error (Lisp_Object)); -DECLARE_DOESNT_RETURN (signal_malformed_property_list_error (Lisp_Object)); -DECLARE_DOESNT_RETURN (signal_circular_list_error (Lisp_Object)); -DECLARE_DOESNT_RETURN (signal_circular_property_list_error (Lisp_Object)); - -Lisp_Object signal_void_function_error (Lisp_Object); -Lisp_Object signal_invalid_function_error (Lisp_Object); -Lisp_Object signal_wrong_number_of_arguments_error (Lisp_Object, int); - +void signal_malformed_list_error (Lisp_Object); +void signal_malformed_property_list_error (Lisp_Object); +void signal_circular_list_error (Lisp_Object); +void signal_circular_property_list_error (Lisp_Object); +void signal_void_function_error (Lisp_Object); Lisp_Object run_hook_with_args_in_buffer (struct buffer *, int, Lisp_Object *, enum run_hooks_condition); Lisp_Object run_hook_with_args (int, Lisp_Object *, enum run_hooks_condition); @@ -2233,13 +2235,13 @@ Lisp_Object eval_in_buffer (struct buffer *, Lisp_Object); Lisp_Object call0_with_handler (Lisp_Object, Lisp_Object); Lisp_Object call1_with_handler (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object eval_in_buffer_trapping_errors (const char *, struct buffer *, +Lisp_Object eval_in_buffer_trapping_errors (CONST char *, struct buffer *, Lisp_Object); -Lisp_Object run_hook_trapping_errors (const char *, Lisp_Object); -Lisp_Object safe_run_hook_trapping_errors (const char *, Lisp_Object, int); -Lisp_Object call0_trapping_errors (const char *, Lisp_Object); -Lisp_Object call1_trapping_errors (const char *, Lisp_Object, Lisp_Object); -Lisp_Object call2_trapping_errors (const char *, +Lisp_Object run_hook_trapping_errors (CONST char *, Lisp_Object); +Lisp_Object safe_run_hook_trapping_errors (CONST char *, Lisp_Object, int); +Lisp_Object call0_trapping_errors (CONST char *, Lisp_Object); +Lisp_Object call1_trapping_errors (CONST char *, Lisp_Object, Lisp_Object); +Lisp_Object call2_trapping_errors (CONST char *, Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object call_with_suspended_errors (lisp_fn_t, volatile Lisp_Object, Lisp_Object, Error_behavior, int, ...); @@ -2258,7 +2260,7 @@ void do_autoload (Lisp_Object, Lisp_Object); Lisp_Object un_autoload (Lisp_Object); void warn_when_safe_lispobj (Lisp_Object, Lisp_Object, Lisp_Object); -void warn_when_safe (Lisp_Object, Lisp_Object, const char *, +void warn_when_safe (Lisp_Object, Lisp_Object, CONST char *, ...) PRINTF_ARGS (3, 4); @@ -2269,39 +2271,38 @@ Lisp_Object enqueue_misc_user_event (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object enqueue_misc_user_event_pos (Lisp_Object, Lisp_Object, Lisp_Object, int, int, int, int); -extern int modifier_keys_are_sticky; /* Defined in event-Xt.c */ -void enqueue_Xt_dispatch_event (Lisp_Object event); void signal_special_Xt_user_event (Lisp_Object, Lisp_Object, Lisp_Object); /* Defined in events.c */ void clear_event_resource (void); Lisp_Object allocate_event (void); +int event_to_character (Lisp_Event *, int, int, int); /* Defined in fileio.c */ void record_auto_save (void); void force_auto_save_soon (void); -DECLARE_DOESNT_RETURN (report_file_error (const char *, Lisp_Object)); -void maybe_report_file_error (const char *, Lisp_Object, +DECLARE_DOESNT_RETURN (report_file_error (CONST char *, Lisp_Object)); +void maybe_report_file_error (CONST char *, Lisp_Object, Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_file_error (const char *, Lisp_Object)); -void maybe_signal_file_error (const char *, Lisp_Object, +DECLARE_DOESNT_RETURN (signal_file_error (CONST char *, Lisp_Object)); +void maybe_signal_file_error (CONST char *, Lisp_Object, Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_double_file_error (const char *, const char *, +DECLARE_DOESNT_RETURN (signal_double_file_error (CONST char *, CONST char *, Lisp_Object)); -void maybe_signal_double_file_error (const char *, const char *, +void maybe_signal_double_file_error (CONST char *, CONST char *, Lisp_Object, Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_double_file_error_2 (const char *, const char *, +DECLARE_DOESNT_RETURN (signal_double_file_error_2 (CONST char *, CONST char *, Lisp_Object, Lisp_Object)); -void maybe_signal_double_file_error_2 (const char *, const char *, +void maybe_signal_double_file_error_2 (CONST char *, CONST char *, Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior); Lisp_Object lisp_strerror (int); Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); -ssize_t read_allowing_quit (int, void *, size_t); -ssize_t write_allowing_quit (int, const void *, size_t); +int read_allowing_quit (int, void *, size_t); +int write_allowing_quit (int, CONST void *, size_t); int internal_delete_file (Lisp_Object); /* Defined in filelock.c */ @@ -2332,6 +2333,7 @@ Lisp_Object remassq_no_quit (Lisp_Object, Lisp_Object); Lisp_Object remrassq_no_quit (Lisp_Object, Lisp_Object); +void pure_put (Lisp_Object, Lisp_Object, Lisp_Object); int plists_differ (Lisp_Object, Lisp_Object, int, int, int); Lisp_Object internal_plist_get (Lisp_Object, Lisp_Object); void internal_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object); @@ -2348,7 +2350,7 @@ Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object nconc2 (Lisp_Object, Lisp_Object); Lisp_Object bytecode_nconc2 (Lisp_Object *); -void check_losing_bytecode (const char *, Lisp_Object); +void check_losing_bytecode (CONST char *, Lisp_Object); /* Defined in getloadavg.c */ int getloadavg (double[], int); @@ -2360,7 +2362,6 @@ /* Defined in indent.c */ int bi_spaces_at_point (struct buffer *, Bytind); int column_at_point (struct buffer *, Bufpos, int); -int string_column_at_point (Lisp_String *, Bufpos, int); int current_column (struct buffer *); void invalidate_current_column (void); Bufpos vmotion (struct window *, Bufpos, int, int *); @@ -2374,7 +2375,7 @@ void close_load_descs (void); int locate_file (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object *, int); EXFUN (Flocate_file_clear_hashing, 1); -int isfloat_string (const char *); +int isfloat_string (CONST char *); /* Well, I've decided to enable this. -- ben */ /* And I've decided to make it work right. -- sb */ @@ -2411,32 +2412,32 @@ /* Defined in minibuf.c */ extern int minibuf_level; -Charcount scmp_1 (const Bufbyte *, const Bufbyte *, Charcount, int); +Charcount scmp_1 (CONST Bufbyte *, CONST Bufbyte *, Charcount, int); #define scmp(s1, s2, len) scmp_1 (s1, s2, len, completion_ignore_case) extern int completion_ignore_case; -int regexp_ignore_completion_p (const Bufbyte *, Lisp_Object, +int regexp_ignore_completion_p (CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount); Lisp_Object clear_echo_area (struct frame *, Lisp_Object, int); Lisp_Object clear_echo_area_from_print (struct frame *, Lisp_Object, int); -void echo_area_append (struct frame *, const Bufbyte *, Lisp_Object, +void echo_area_append (struct frame *, CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount, Lisp_Object); -void echo_area_message (struct frame *, const Bufbyte *, Lisp_Object, +void echo_area_message (struct frame *, CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount, Lisp_Object); Lisp_Object echo_area_status (struct frame *); int echo_area_active (struct frame *); Lisp_Object echo_area_contents (struct frame *); -void message_internal (const Bufbyte *, Lisp_Object, Bytecount, Bytecount); -void message_append_internal (const Bufbyte *, Lisp_Object, +void message_internal (CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount); +void message_append_internal (CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount); -void message (const char *, ...) PRINTF_ARGS (1, 2); -void message_append (const char *, ...) PRINTF_ARGS (1, 2); -void message_no_translate (const char *, ...) PRINTF_ARGS (1, 2); +void message (CONST char *, ...) PRINTF_ARGS (1, 2); +void message_append (CONST char *, ...) PRINTF_ARGS (1, 2); +void message_no_translate (CONST char *, ...) PRINTF_ARGS (1, 2); void clear_message (void); /* Defined in print.c */ void write_string_to_stdio_stream (FILE *, struct console *, - const Bufbyte *, Bytecount, Bytecount, - Lisp_Object, int); + CONST Bufbyte *, Bytecount, Bytecount, + enum external_data_format); void debug_print (Lisp_Object); void debug_short_backtrace (int); void temp_output_buffer_setup (Lisp_Object); @@ -2444,9 +2445,9 @@ /* NOTE: Do not call this with the data of a Lisp_String. Use princ. * Note: stream should be defaulted before calling * (eg Qnil means stdout, not Vstandard_output, etc) */ -void write_c_string (const char *, Lisp_Object); +void write_c_string (CONST char *, Lisp_Object); /* Same goes for this function. */ -void write_string_1 (const Bufbyte *, Bytecount, Lisp_Object); +void write_string_1 (CONST Bufbyte *, Bytecount, Lisp_Object); void print_cons (Lisp_Object, Lisp_Object, int); void print_vector (Lisp_Object, Lisp_Object, int); void print_string (Lisp_Object, Lisp_Object, int); @@ -2463,7 +2464,7 @@ void internal_object_printer (Lisp_Object, Lisp_Object, int); /* Defined in profile.c */ -void mark_profiling_info (void); +void mark_profiling_info (void (*) (Lisp_Object)); void profile_increase_call_count (Lisp_Object); extern int profiling_active; extern int profiling_redisplay_flag; @@ -2485,11 +2486,10 @@ Bufpos find_next_newline (struct buffer *, Bufpos, int); Bufpos find_next_newline_no_quit (struct buffer *, Bufpos, int); Bytind bi_find_next_newline_no_quit (struct buffer *, Bytind, int); -Bytind bi_find_next_emchar_in_string (Lisp_String*, Emchar, Bytind, EMACS_INT); Bufpos find_before_next_newline (struct buffer *, Bufpos, Bufpos, int); struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, char *, int, Error_behavior); -Bytecount fast_string_match (Lisp_Object, const Bufbyte *, +Bytecount fast_string_match (Lisp_Object, CONST Bufbyte *, Lisp_Object, Bytecount, Bytecount, int, Error_behavior, int); Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object); @@ -2511,9 +2511,9 @@ Error_behavior, int, Lisp_Object); /* Defined in symbols.c */ -int hash_string (const Bufbyte *, Bytecount); -Lisp_Object intern (const char *); -Lisp_Object oblookup (Lisp_Object, const Bufbyte *, Bytecount); +int hash_string (CONST Bufbyte *, Bytecount); +Lisp_Object intern (CONST char *); +Lisp_Object oblookup (Lisp_Object, CONST Bufbyte *, Bytecount); void map_obarray (Lisp_Object, int (*) (Lisp_Object, void *), void *); Lisp_Object indirect_function (Lisp_Object, int); Lisp_Object symbol_value_in_buffer (Lisp_Object, Lisp_Object); @@ -2527,7 +2527,7 @@ Lisp_Object follow_past_lisp_magic); /* Defined in syntax.c */ -Bufpos scan_words (struct buffer *, Bufpos, int); +int scan_words (struct buffer *, int, int); /* Defined in undo.c */ Lisp_Object truncate_undo_list (Lisp_Object, int, int); @@ -2543,7 +2543,7 @@ #endif /* Defined in vm-limit.c */ -void memory_warnings (void *, void (*) (const char *)); +void memory_warnings (void *, void (*) (CONST char *)); /* Defined in window.c */ Lisp_Object save_window_excursion_unwind (Lisp_Object); @@ -2579,7 +2579,6 @@ EXFUN (Fchar_after, 2); EXFUN (Fchar_to_string, 1); EXFUN (Fcheck_valid_plist, 1); -EXFUN (Fvalid_plist_p, 1); EXFUN (Fclear_range_table, 1); EXFUN (Fcoding_category_list, 0); EXFUN (Fcoding_category_system, 1); @@ -2610,7 +2609,6 @@ EXFUN (Fdefault_value, 1); EXFUN (Fdefine_key, 3); EXFUN (Fdelete_region, 3); -EXFUN (Fdelete_process, 1); EXFUN (Fdelq, 2); EXFUN (Fdestructive_alist_to_plist, 1); EXFUN (Fdetect_coding_region, 3); @@ -2660,7 +2658,6 @@ EXFUN (Fforward_line, 2); EXFUN (Ffset, 2); EXFUN (Ffuncall, MANY); -EXFUN (Ffunctionp, 1); EXFUN (Fgeq, MANY); EXFUN (Fget, 3); EXFUN (Fget_buffer_process, 1); @@ -2688,9 +2685,10 @@ EXFUN (Fleq, MANY); EXFUN (Flist, MANY); EXFUN (Flistp, 1); +#ifdef HAVE_SHLIB EXFUN (Flist_modules, 0); EXFUN (Fload_module, 3); -EXFUN (Flookup_key, 3); +#endif EXFUN (Flss, MANY); EXFUN (Fmake_byte_code, MANY); EXFUN (Fmake_coding_system, 4); @@ -2739,6 +2737,7 @@ EXFUN (Fprocess_status, 1); EXFUN (Fprogn, UNEVALLED); EXFUN (Fprovide, 1); +EXFUN (Fpurecopy, 1); EXFUN (Fput, 3); EXFUN (Fput_range_table, 4); EXFUN (Fput_text_property, 5); @@ -2749,7 +2748,6 @@ EXFUN (Freally_free, 1); EXFUN (Frem, 2); EXFUN (Fremassq, 2); -EXFUN (Freplace_list, 2); EXFUN (Fselected_frame, 1); EXFUN (Fset, 2); EXFUN (Fset_coding_category_system, 2); @@ -2799,100 +2797,82 @@ EXFUN (Fwiden, 1); -extern Lisp_Object Q_style, Qabort, Qactually_requested; -extern Lisp_Object Qactivate_menubar_hook; -extern Lisp_Object Qafter, Qall, Qand, Qappend; +extern Lisp_Object Q_style, Qactually_requested, Qactivate_menubar_hook; +extern Lisp_Object Qafter, Qall, Qand; extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload; extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore; -extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary; -extern Lisp_Object Qbitmap, Qbitp, Qblinking; -extern Lisp_Object Qboolean, Qbottom, Qbottom_margin, Qbuffer; +extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary, Qbitmap, Qbitp, Qblinking; +extern Lisp_Object Qboolean, Qbottom, Qbuffer, Qbuffer_file_coding_system; extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only, Qbutton; -extern Lisp_Object Qbyte_code, Qcall_interactively, Qcancel, Qcategory; +extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory; extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qccl, Qcdr; extern Lisp_Object Qchannel, Qchar, Qchar_or_string_p, Qcharacter, Qcharacterp; extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; -extern Lisp_Object Qcenter, Qcircular_list, Qcircular_property_list; -extern Lisp_Object Qcoding_system_error; +extern Lisp_Object Qcircular_list, Qcircular_property_list; +extern Lisp_Object Qcoding_system_error, Qcoding_system_p; extern Lisp_Object Qcolor, Qcolor_pixmap_image_instance_p; extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case; -extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcopies, Qcr; -extern Lisp_Object Qcritical, Qcrlf, Qctext, Qcurrent_menubar, Qctext, Qcursor; +extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcr, Qcritical; +extern Lisp_Object Qcrlf, Qctext, Qcurrent_menubar, Qcursor; extern Lisp_Object Qcyclic_variable_indirection, Qdata, Qdead, Qdecode; extern Lisp_Object Qdefault, Qdefun, Qdelete, Qdelq, Qdevice, Qdevice_live_p; -extern Lisp_Object Qdialog; extern Lisp_Object Qdim, Qdimension, Qdisabled, Qdisplay, Qdisplay_table; -extern Lisp_Object Qdoc_string, Qdomain_error, Qduplex, Qdynarr_overhead; +extern Lisp_Object Qdoc_string, Qdomain_error, Qdynarr_overhead; extern Lisp_Object Qempty, Qencode, Qend_of_buffer, Qend_of_file, Qend_open; extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qeq, Qeql, Qequal; extern Lisp_Object Qerror, Qerror_conditions, Qerror_message, Qescape_quoted; extern Lisp_Object Qeval, Qevent_live_p, Qexit, Qextent_live_p, Qextents; -extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep; -extern Lisp_Object Qfile_name, Qfile_error; +extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep, Qfile_error; extern Lisp_Object Qfont, Qforce_g0_on_output, Qforce_g1_on_output; extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground; -extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfrom_page, Qfull_assoc; -extern Lisp_Object Qfuncall, Qfunction; -extern Lisp_Object Qgap_overhead, Qgeneric, Qgeometry, Qglobal, Qheight; -extern Lisp_Object Qhelp, Qhighlight, Qhorizontal, Qicon; -extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qignore, Qimage, Qinfo; -extern Lisp_Object Qinherit; +extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfunction, Qgap_overhead; +extern Lisp_Object Qgeneric, Qgeometry, Qglobal, Qheight, Qhighlight, Qicon; +extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qimage, Qinfo, Qinherit; extern Lisp_Object Qinhibit_quit, Qinhibit_read_only; extern Lisp_Object Qinput_charset_conversion, Qinteger; extern Lisp_Object Qinteger_char_or_marker_p, Qinteger_or_char_p; extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive, Qinternal; extern Lisp_Object Qinvalid_function, Qinvalid_read_syntax, Qio_error; -extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeyboard, Qkeymap; -extern Lisp_Object Qlambda, Qlast_command, Qlayout, Qlandscape; -extern Lisp_Object Qleft, Qleft_margin, Qlet, Qlf; +extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeymap, Qlambda, Qleft, Qlf; extern Lisp_Object Qlist, Qlistp, Qload, Qlock_shift, Qmacro, Qmagic; -extern Lisp_Object Qmakunbound, Qmalformed_list, Qmalformed_property_list; +extern Lisp_Object Qmalformed_list, Qmalformed_property_list; extern Lisp_Object Qmalloc_overhead, Qmark, Qmarkers; -extern Lisp_Object Qmenubar; extern Lisp_Object Qmax, Qmemory, Qmessage, Qminus, Qmnemonic, Qmodifiers; extern Lisp_Object Qmono_pixmap_image_instance_p, Qmotion; -extern Lisp_Object Qmouse_leave_buffer_hook, Qmsprinter, Qmswindows; -extern Lisp_Object Qname, Qnas, Qnatnump, Qnative_layout; -extern Lisp_Object Qno, Qno_ascii_cntl, Qno_ascii_eol, Qno_catch; +extern Lisp_Object Qmouse_leave_buffer_hook, Qmswindows, Qname, Qnas, Qnatnump; +extern Lisp_Object Qno_ascii_cntl, Qno_ascii_eol, Qno_catch; extern Lisp_Object Qno_conversion, Qno_iso6429, Qnone, Qnot, Qnothing; extern Lisp_Object Qnothing_image_instance_p, Qnotice; -extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp; -extern Lisp_Object Qobject, Qok, Qold_assoc, Qold_delete, Qold_delq; -extern Lisp_Object Qold_rassoc; -extern Lisp_Object Qold_rassq, Qonly, Qor, Qother; -extern Lisp_Object Qorientation, Qoutput_charset_conversion; -extern Lisp_Object Qoverflow_error, Qpoint, Qpointer, Qpointer_glyph_p; -extern Lisp_Object Qpointer_image_instance_p, Qportrait, Qpost_read_conversion; -extern Lisp_Object Qpre_write_conversion, Qprint, Qprinter, Qprint_length; +extern Lisp_Object Qnumber_char_or_marker_p, Qnumber_or_marker_p, Qnumberp; +extern Lisp_Object Qobject, Qold_assoc, Qold_delete, Qold_delq, Qold_rassoc; +extern Lisp_Object Qold_rassq, Qonly, Qor, Qother, Qoutput_charset_conversion; +extern Lisp_Object Qoverflow_error, Qpath, Qpoint, Qpointer, Qpointer_glyph_p; +extern Lisp_Object Qpointer_image_instance_p, Qpost_read_conversion; +extern Lisp_Object Qpre_write_conversion, Qprint, Qprint_length; extern Lisp_Object Qprint_string_length, Qprocess, Qprogn, Qprovide, Qquit; extern Lisp_Object Qquote, Qrange_error, Qrassoc, Qrassq, Qread_char; extern Lisp_Object Qread_from_minibuffer, Qreally_early_error_handler; extern Lisp_Object Qregion_beginning, Qregion_end, Qrequire, Qresource; -extern Lisp_Object Qretry, Qreturn, Qreverse, Qright, Qright_margin; -extern Lisp_Object Qrun_hooks, Qsans_modifiers; -extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qselected; -extern Lisp_Object Qself_insert_command, Qself_insert_defer_undo; -extern Lisp_Object Qsequencep, Qset, Qsetting_constant; -extern Lisp_Object Qseven, Qshift_jis, Qshort; +extern Lisp_Object Qreturn, Qreverse, Qright, Qrun_hooks, Qsans_modifiers; +extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qselected, Qself_insert_command; +extern Lisp_Object Qsequencep, Qsetting_constant, Qseven, Qshift_jis, Qshort; extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace; extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open; extern Lisp_Object Qstream, Qstring, Qstring_lessp, Qsubwindow; -extern Lisp_Object Qsubwindow_image_instance_p; -extern Lisp_Object Qsymbol, Qsyntax, Qt, Qterminal, Qtest; -extern Lisp_Object Qtext, Qtext_image_instance_p, Qthis_command, Qtimeout; -extern Lisp_Object Qtimestamp, Qtoolbar, Qtop, Qtop_margin, Qtop_level; -extern Lisp_Object Qto_page, Qtrue_list_p, Qtty, Qtype; +extern Lisp_Object Qsubwindow_image_instance_p, Qsymbol, Qsyntax, Qt, Qtest; +extern Lisp_Object Qtext, Qtext_image_instance_p, Qtimeout, Qtimestamp; +extern Lisp_Object Qtoolbar, Qtop, Qtop_level, Qtrue_list_p, Qtty, Qtype; extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error; extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories; extern Lisp_Object Qvalue_assoc, Qvalues; -extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvertical; -extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning; -extern Lisp_Object Qwidth, Qwidget, Qwindow; +extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvector; +extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwidget, Qwindow; extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments; -extern Lisp_Object Qwrong_type_argument, Qx, Qy, Qyes, Qyes_or_no_p; +extern Lisp_Object Qwrong_type_argument, Qx, Qy, Qyes_or_no_p; extern Lisp_Object Vactivate_menubar_hook, Vascii_canon_table; extern Lisp_Object Vascii_downcase_table, Vascii_eqv_table; -extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vblank_menubar; +extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vbinary_process_input; +extern Lisp_Object Vbinary_process_output, Vblank_menubar; extern Lisp_Object Vcharset_ascii, Vcharset_composite, Vcharset_control_1; extern Lisp_Object Vcoding_system_for_read, Vcoding_system_for_write; extern Lisp_Object Vcoding_system_hash_table, Vcommand_history; @@ -2901,8 +2881,7 @@ extern Lisp_Object Vconsole_list, Vcontrolling_terminal; extern Lisp_Object Vcurrent_compiled_function_annotation, Vcurrent_load_list; extern Lisp_Object Vcurrent_mouse_event, Vcurrent_prefix_arg, Vdata_directory; -extern Lisp_Object Vdirectory_sep_char, Vdisabled_command_hook; -extern Lisp_Object Vdoc_directory, Vinternal_doc_file_name; +extern Lisp_Object Vdisabled_command_hook, Vdoc_directory, Vinternal_doc_file_name; extern Lisp_Object Vecho_area_buffer, Vemacs_major_version; extern Lisp_Object Vemacs_minor_version, Vexec_directory, Vexec_path; extern Lisp_Object Vexecuting_macro, Vfeatures, Vfile_domain; @@ -2925,6 +2904,9 @@ extern Lisp_Object Vstandard_input, Vstandard_output, Vstdio_str; extern Lisp_Object Vsynchronous_sounds, Vsystem_name, Vterminal_coding_system; extern Lisp_Object Vthis_command_keys, Vunread_command_event; +extern Lisp_Object Vwin32_generate_fake_inodes, Vwin32_pipe_read_delay; extern Lisp_Object Vx_initial_argv_list; -#endif /* INCLUDED_lisp_h_ */ +extern Lisp_Object Qmakunbound, Qset; + +#endif /* _XEMACS_LISP_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/lread.c --- a/src/lread.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lread.c Mon Aug 13 11:20:41 2007 +0200 @@ -218,14 +218,14 @@ static DOESNT_RETURN -syntax_error (const char *string) +syntax_error (CONST char *string) { signal_error (Qinvalid_read_syntax, list1 (build_translated_string (string))); } static Lisp_Object -continuable_syntax_error (const char *string) +continuable_syntax_error (CONST char *string) { return Fsignal (Qinvalid_read_syntax, list1 (build_translated_string (string))); @@ -259,9 +259,9 @@ #ifdef DEBUG_XEMACS /* testing Mule */ static int testing_mule = 0; /* Change via debugger */ if (testing_mule) { - if (c >= 0x20 && c <= 0x7E) stderr_out ("%c", c); - else if (c == '\n') stderr_out ("\\n\n"); - else stderr_out ("\\%o ", c); + if (c >= 0x20 && c <= 0x7E) fprintf (stderr, "%c", c); + else if (c == '\n') fprintf (stderr, "\\n\n"); + else fprintf (stderr, "\\%o ", c); } #endif return c; @@ -443,6 +443,12 @@ Lisp_Object list = Vload_force_doc_string_list; Lisp_Object tail; int fd = XINT (XCAR (Vload_descriptor_list)); + /* NOTE: If purify_flag is true, we're in-place modifying objects that + may be in purespace (and if not, they will be). Therefore, we have + to be VERY careful to make sure that all objects that we create + are purecopied -- objects in purespace are not marked for GC, and + if we leave any impure objects inside of pure ones, we're really + screwed. */ GCPRO1 (list); /* restore the old value first just in case an error occurs. */ @@ -473,12 +479,13 @@ ivan = Fread (juan); if (!CONSP (ivan)) signal_simple_error ("invalid lazy-loaded byte code", ivan); - XCOMPILED_FUNCTION (john)->instructions = XCAR (ivan); + /* Remember to purecopy; see above. */ + XCOMPILED_FUNCTION (john)->instructions = Fpurecopy (XCAR (ivan)); /* v18 or v19 bytecode file. Need to Ebolify. */ if (XCOMPILED_FUNCTION (john)->flags.ebolified && VECTORP (XCDR (ivan))) ebolify_bytecode_constants (XCDR (ivan)); - XCOMPILED_FUNCTION (john)->constants = XCDR (ivan); + XCOMPILED_FUNCTION (john)->constants = Fpurecopy (XCDR (ivan)); NUNGCPRO; } doc = compiled_function_documentation (XCOMPILED_FUNCTION (john)); @@ -676,7 +683,7 @@ { /* Lisp_Object's must be malloc'ed, not stack-allocated */ Lisp_Object lispstream = Qnil; - const int block_size = 8192; + CONST int block_size = 8192; struct gcpro ngcpro1; NGCPRO1 (lispstream); @@ -903,23 +910,22 @@ nil, a list, or a string (for backward compatibility), with the following semantics: - a) nil - no suffix, just search for file name intact - (semantically different from "empty suffix list", which - would be meaningless.) + a) nil - no suffix, just search for file name intact (semantically + different from "empty suffix list") b) list - list of suffixes to append to file name. Each of these must be a string. c) string - colon-separated suffixes to append to file name (backward compatibility). - All of this got hairy, so I decided to use a mapper. Calling a - function for each suffix shouldn't slow things down, since - locate_file is rarely called with enough suffixes for funcalls to - make any difference. */ + All of this got hairy, so I decided to use write a mapper. Calling + a function for each suffix shouldn't slow things down, since + locate_file is rarely call with enough suffixes for it to make a + difference. */ /* Map FUN over SUFFIXES, as described above. FUN will be called with a char * containing the current file name, and ARG. Mapping stops when FUN returns non-zero. */ -static void +void locate_file_map_suffixes (Lisp_Object filename, Lisp_Object suffixes, int (*fun) (char *, void *), void *arg) @@ -978,12 +984,12 @@ else { /* Case c) */ - const char *nsuffix = (const char *) XSTRING_DATA (suffixes); + CONST char *nsuffix = XSTRING_DATA (suffixes); while (1) { char *esuffix = (char *) strchr (nsuffix, ':'); - int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix); + int lsuffix = ((esuffix) ? (esuffix - nsuffix) : strlen (nsuffix)); /* Concatenate path element/specified name with the suffix. */ strncpy (fn + fn_len, nsuffix, lsuffix); @@ -1029,7 +1035,7 @@ if (closure->storeptr) *closure->storeptr = build_string (fn); -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT /* If we actually opened the file, set close-on-exec flag on the new descriptor so that subprocesses can't whack at it. */ @@ -1870,7 +1876,7 @@ return Lstream_byte_count (XLSTREAM (Vread_buffer_stream)) - 1; } -static Lisp_Object parse_integer (const Bufbyte *buf, Bytecount len, int base); +static Lisp_Object parse_integer (CONST Bufbyte *buf, Bytecount len, int base); static Lisp_Object read_atom (Lisp_Object readcharfun, @@ -1941,6 +1947,7 @@ sym = Fmake_symbol ( make_string ((Bufbyte *) read_ptr, len)); else { + /* intern will purecopy pname if necessary */ Lisp_Object name = make_string ((Bufbyte *) read_ptr, len); sym = Fintern (name, Qnil); } @@ -1950,10 +1957,10 @@ static Lisp_Object -parse_integer (const Bufbyte *buf, Bytecount len, int base) +parse_integer (CONST Bufbyte *buf, Bytecount len, int base) { - const Bufbyte *lim = buf + len; - const Bufbyte *p = buf; + CONST Bufbyte *lim = buf + len; + CONST Bufbyte *p = buf; EMACS_UINT num = 0; int negativland = 0; @@ -2036,7 +2043,6 @@ { unsigned_char_dynarr *dyn = Dynarr_new (unsigned_char); Emchar c; - Lisp_Object val; while (1) { @@ -2049,12 +2055,8 @@ if (c >= 0) unreadchar (readcharfun, c); - val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0), - Dynarr_length (dyn)); - - Dynarr_free (dyn); - - return val; + return make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0), + Dynarr_length (dyn)); } @@ -2696,10 +2698,10 @@ #define EXP_INT 16 int -isfloat_string (const char *cp) +isfloat_string (CONST char *cp) { int state = 0; - const Bufbyte *ucp = (const Bufbyte *) cp; + CONST Bufbyte *ucp = (CONST Bufbyte *) cp; if (*ucp == '+' || *ucp == '-') ucp++; @@ -3002,8 +3004,13 @@ i < len; i++, p++) { - Lisp_Cons *otem = XCONS (tem); - tem = Fcar (tem); + struct Lisp_Cons *otem = XCONS (tem); +#if 0 /* FSFmacs defun hack */ + if (read_pure) + tem = Fpurecopy (Fcar (tem)); + else +#endif + tem = Fcar (tem); *p = tem; tem = otem->cdr; free_cons (otem); @@ -3034,7 +3041,7 @@ for (iii = 0; CONSP (stuff); iii++) { - Lisp_Cons *victim = XCONS (stuff); + struct Lisp_Cons *victim = XCONS (stuff); make_byte_code_args[iii] = Fcar (stuff); if ((purify_flag || load_force_doc_strings) && CONSP (make_byte_code_args[iii]) @@ -3142,17 +3149,8 @@ } void -reinit_vars_of_lread (void) -{ - Vread_buffer_stream = Qnil; - staticpro_nodump (&Vread_buffer_stream); -} - -void vars_of_lread (void) { - reinit_vars_of_lread (); - DEFVAR_LISP ("values", &Vvalues /* List of values of all expressions which were read, evaluated and printed. Order is reverse chronological. @@ -3270,6 +3268,9 @@ with values saved when the image is dumped. */ staticpro (&Vload_descriptor_list); + Vread_buffer_stream = Qnil; + staticpro (&Vread_buffer_stream); + /* Initialized in init_lread. */ staticpro (&Vload_force_doc_string_list); diff -r 12e008d41344 -r 697ef44129c6 src/lrecord.h --- a/src/lrecord.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lrecord.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,18 +21,18 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_lrecord_h_ -#define INCLUDED_lrecord_h_ +#ifndef _XEMACS_LRECORD_H_ +#define _XEMACS_LRECORD_H_ /* The "lrecord" type of Lisp object is used for all object types other than a few simple ones. This allows many types to be - implemented but only a few bits required in a Lisp object for type - information. (The tradeoff is that each object has its type marked - in it, thereby increasing its size.) All lrecords begin with a - `struct lrecord_header', which identifies the lisp object type, by - providing an index into a table of `struct lrecord_implementation', - which describes the behavior of the lisp object. It also contains - some other data bits. + implemented but only a few bits required in a Lisp object for + type information. (The tradeoff is that each object has its + type marked in it, thereby increasing its size.) The first + four bytes of all lrecords is either a pointer to a struct + lrecord_implementation, which contains methods describing how + to process this object, or an index into an array of pointers + to struct lrecord_implementations plus some other data bits. Lrecords are of two types: straight lrecords, and lcrecords. Straight lrecords are used for those types of objects that have @@ -42,12 +42,12 @@ the lrecord_implementation for the object. There are special routines in alloc.c to deal with each such object type. - Lcrecords are used for less common sorts of objects that don't do - their own allocation. Each such object is malloc()ed individually, - and the objects are chained together through a `next' pointer. - Lcrecords have a `struct lcrecord_header' at the top, which - contains a `struct lrecord_header' and a `next' pointer, and are - allocated using alloc_lcrecord(). + Lcrecords are used for less common sorts of objects that don't + do their own allocation. Each such object is malloc()ed + individually, and the objects are chained together through + a `next' pointer. Lcrecords have a `struct lcrecord_header' + at the top, which contains a `struct lrecord_header' and + a `next' pointer, and are allocated using alloc_lcrecord(). Creating a new lcrecord type is fairly easy; just follow the lead of some existing type (e.g. hash tables). Note that you @@ -60,41 +60,35 @@ struct lrecord_header { /* index into lrecord_implementations_table[] */ - unsigned int type :8; - - /* If `mark' is 0 after the GC mark phase, the object will be freed - during the GC sweep phase. There are 2 ways that `mark' can be 1: - - by being referenced from other objects during the GC mark phase - - because it is permanently on, for c_readonly objects */ - unsigned int mark :1; - - /* 1 if the object resides in logically read-only space, and does not - reference other non-c_readonly objects. - Invariant: if (c_readonly == 1), then (mark == 1 && lisp_readonly == 1) */ - unsigned int c_readonly :1; - - /* 1 if the object is readonly from lisp */ - unsigned int lisp_readonly :1; + unsigned char type; + struct { + /* 1 if the object is marked during GC. */ + unsigned mark :1; + /* 1 if the object resides in read-only space */ + unsigned c_readonly : 1; + /* 1 if the object is readonly from lisp */ + unsigned lisp_readonly : 1; + } flags; }; struct lrecord_implementation; -int lrecord_type_index (const struct lrecord_implementation *implementation); +int lrecord_type_index (CONST struct lrecord_implementation *implementation); -#define set_lheader_implementation(header,imp) do { \ +# define set_lheader_implementation(header,imp) do { \ struct lrecord_header* SLI_header = (header); \ - SLI_header->type = (imp)->lrecord_type_index; \ - SLI_header->mark = 0; \ - SLI_header->c_readonly = 0; \ - SLI_header->lisp_readonly = 0; \ + (SLI_header)->type = lrecord_type_index (imp); \ + (SLI_header)->flags.mark = 0; \ + (SLI_header)->flags.c_readonly = 0; \ + (SLI_header)->flags.lisp_readonly = 0; \ } while (0) struct lcrecord_header { struct lrecord_header lheader; - /* The `next' field is normally used to chain all lcrecords together + /* The `next' field is normally used to chain all lrecords together so that the GC can find (and free) all of them. - `alloc_lcrecord' threads lcrecords together. + `alloc_lcrecord' threads records together. The `next' field may be used for other purposes as long as some other mechanism is provided for letting the GC do its work. @@ -126,75 +120,14 @@ Lisp_Object chain; }; -enum lrecord_type -{ - /* Symbol value magic types come first to make SYMBOL_VALUE_MAGIC_P fast. - #### This should be replaced by a symbol_value_magic_p flag - in the Lisp_Symbol lrecord_header. */ - lrecord_type_symbol_value_forward, - lrecord_type_symbol_value_varalias, - lrecord_type_symbol_value_lisp_magic, - lrecord_type_symbol_value_buffer_local, - lrecord_type_max_symbol_value_magic = lrecord_type_symbol_value_buffer_local, - - lrecord_type_symbol, - lrecord_type_subr, - lrecord_type_cons, - lrecord_type_vector, - lrecord_type_string, - lrecord_type_lcrecord_list, - lrecord_type_compiled_function, - lrecord_type_weak_list, - lrecord_type_bit_vector, - lrecord_type_float, - lrecord_type_hash_table, - lrecord_type_lstream, - lrecord_type_process, - lrecord_type_charset, - lrecord_type_coding_system, - lrecord_type_char_table, - lrecord_type_char_table_entry, - lrecord_type_range_table, - lrecord_type_opaque, - lrecord_type_opaque_ptr, - lrecord_type_buffer, - lrecord_type_extent, - lrecord_type_extent_info, - lrecord_type_extent_auxiliary, - lrecord_type_marker, - lrecord_type_event, - lrecord_type_keymap, - lrecord_type_command_builder, - lrecord_type_timeout, - lrecord_type_specifier, - lrecord_type_console, - lrecord_type_device, - lrecord_type_frame, - lrecord_type_window, - lrecord_type_window_configuration, - lrecord_type_gui_item, - lrecord_type_popup_data, - lrecord_type_toolbar_button, - lrecord_type_color_instance, - lrecord_type_font_instance, - lrecord_type_image_instance, - lrecord_type_glyph, - lrecord_type_face, - lrecord_type_database, - lrecord_type_tooltalk_message, - lrecord_type_tooltalk_pattern, - lrecord_type_ldap, - lrecord_type_pgconn, - lrecord_type_pgresult, - lrecord_type_devmode, - lrecord_type_count /* must be last */ -}; +/* see alloc.c for an explanation */ +Lisp_Object this_one_is_unmarkable (Lisp_Object obj, + void (*markobj) (Lisp_Object)); struct lrecord_implementation { - const char *name; - - /* `marker' is called at GC time, to make sure that all Lisp_Objects + CONST char *name; + /* This function is called at GC time, to make sure that all Lisp_Objects pointed to by this object get properly marked. It should call the mark_object function on all Lisp_Objects in the object. If the return value is non-nil, it should be a Lisp_Object to be @@ -203,219 +136,79 @@ recursion, so the object returned should preferably be the one with the deepest level of Lisp_Object pointers. This function can be NULL, meaning no GC marking is necessary. */ - Lisp_Object (*marker) (Lisp_Object); - - /* `printer' converts the object to a printed representation. - This can be NULL; in this case default_object_printer() will be - used instead. */ + Lisp_Object (*marker) (Lisp_Object, void (*mark_object) (Lisp_Object)); + /* This can be NULL if the object is an lcrecord; the + default_object_printer() in print.c will be used. */ void (*printer) (Lisp_Object, Lisp_Object printcharfun, int escapeflag); - - /* `finalizer' is called at GC time when the object is about to + /* This function is called at GC time when the object is about to be freed, and at dump time (FOR_DISKSAVE will be non-zero in this case). It should perform any necessary cleanup (e.g. freeing - malloc()ed memory). This can be NULL, meaning no special + malloc()ed memory. This can be NULL, meaning no special finalization is necessary. - WARNING: remember that `finalizer' is called at dump time even + WARNING: remember that the finalizer is called at dump time even though the object is not being freed. */ void (*finalizer) (void *header, int for_disksave); - /* This can be NULL, meaning compare objects with EQ(). */ int (*equal) (Lisp_Object obj1, Lisp_Object obj2, int depth); - - /* `hash' generates hash values for use with hash tables that have - `equal' as their test function. This can be NULL, meaning use - the Lisp_Object itself as the hash. But, you must still satisfy - the constraint that if two objects are `equal', then they *must* - hash to the same value in order for hash tables to work properly. - This means that `hash' can be NULL only if the `equal' method is - also NULL. */ + /* This can be NULL, meaning use the Lisp_Object itself as the hash; + but *only* if the `equal' function is EQ (if two objects are + `equal', they *must* hash to the same value or the hashing won't + work). */ unsigned long (*hash) (Lisp_Object, int); - - /* External data layout description */ - const struct lrecord_description *description; - - /* These functions allow any object type to have builtin property - lists that can be manipulated from the lisp level with - `get', `put', `remprop', and `object-plist'. */ Lisp_Object (*getprop) (Lisp_Object obj, Lisp_Object prop); int (*putprop) (Lisp_Object obj, Lisp_Object prop, Lisp_Object val); int (*remprop) (Lisp_Object obj, Lisp_Object prop); Lisp_Object (*plist) (Lisp_Object obj); - /* Only one of `static_size' and `size_in_bytes_method' is non-0. - If both are 0, this type is not instantiable by alloc_lcrecord(). */ + /* Only one of these is non-0. If both are 0, it means that this type + is not instantiable by alloc_lcrecord(). */ size_t static_size; - size_t (*size_in_bytes_method) (const void *header); - - /* The (constant) index into lrecord_implementations_table */ - enum lrecord_type lrecord_type_index; - + size_t (*size_in_bytes_method) (CONST void *header); + /* A unique subtag-code (dynamically) assigned to this datatype. */ + /* (This is a pointer so the rest of this structure can be read-only.) */ + int *lrecord_type_index; /* A "basic" lrecord is any lrecord that's not an lcrecord, i.e. one that does not have an lcrecord_header at the front and which is (usually) allocated in frob blocks. We only use this flag for some consistency checking, and that only when error-checking is enabled. */ - unsigned int basic_p :1; + int basic_p; }; -extern const struct lrecord_implementation *lrecord_implementations_table[]; +extern CONST struct lrecord_implementation *lrecord_implementations_table[]; #define XRECORD_LHEADER_IMPLEMENTATION(obj) \ - LHEADER_IMPLEMENTATION (XRECORD_LHEADER (obj)) -#define LHEADER_IMPLEMENTATION(lh) lrecord_implementations_table[(lh)->type] + (lrecord_implementations_table[XRECORD_LHEADER (obj)->type]) +#define LHEADER_IMPLEMENTATION(lh) (lrecord_implementations_table[(lh)->type]) extern int gc_in_progress; -#define MARKED_RECORD_P(obj) (XRECORD_LHEADER (obj)->mark) -#define MARKED_RECORD_HEADER_P(lheader) ((lheader)->mark) -#define MARK_RECORD_HEADER(lheader) ((void) ((lheader)->mark = 1)) -#define UNMARK_RECORD_HEADER(lheader) ((void) ((lheader)->mark = 0)) - -#define C_READONLY_RECORD_HEADER_P(lheader) ((lheader)->c_readonly) -#define LISP_READONLY_RECORD_HEADER_P(lheader) ((lheader)->lisp_readonly) -#define SET_C_READONLY_RECORD_HEADER(lheader) do { \ - struct lrecord_header *SCRRH_lheader = (lheader); \ - SCRRH_lheader->c_readonly = 1; \ - SCRRH_lheader->lisp_readonly = 1; \ - SCRRH_lheader->mark = 1; \ -} while (0) -#define SET_LISP_READONLY_RECORD_HEADER(lheader) \ - ((void) ((lheader)->lisp_readonly = 1)) -#define RECORD_MARKER(lheader) lrecord_markers[(lheader)->type] - -/* External description stuff - - A lrecord external description is an array of values. The first - value of each line is a type, the second the offset in the lrecord - structure. Following values are parameters, their presence, type - and number is type-dependant. - - The description ends with a "XD_END" or "XD_SPECIFIER_END" record. - - Some example descriptions : - - static const struct lrecord_description cons_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Cons, car) }, - { XD_LISP_OBJECT, offsetof (Lisp_Cons, cdr) }, - { XD_END } - }; - - Which means "two lisp objects starting at the 'car' and 'cdr' elements" +#define MARKED_RECORD_P(obj) (gc_in_progress && XRECORD_LHEADER (obj)->flags.mark) +#define MARKED_RECORD_HEADER_P(lheader) ((lheader)->flags.mark) +#define MARK_RECORD_HEADER(lheader) ((void) ((lheader)->flags.mark = 1)) +#define UNMARK_RECORD_HEADER(lheader) ((void) ((lheader)->flags.mark = 0)) - 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 } - }; - "A pointer to string data at 'data', the size of the pointed array being the value - of the size variable plus 1, and one lisp object at 'plist'" - - The existing types : - XD_LISP_OBJECT - A Lisp object. This is also the type to use for pointers to other lrecords. - - XD_LISP_OBJECT_ARRAY - An array of Lisp objects or pointers to lrecords. - The third element is the count. - - XD_LO_RESET_NIL - Lisp objects which will be reset to Qnil when dumping. Useful for cleaning - up caches. - - XD_LO_LINK - Link in a linked list of objects of the same type. - - XD_OPAQUE_PTR - Pointer to undumpable data. Must be NULL when dumping. - - XD_STRUCT_PTR - Pointer to described struct. Parameters are number of structures and - struct_description. - - XD_OPAQUE_DATA_PTR - Pointer to dumpable opaque data. Parameter is the size of the data. - Pointed data must be relocatable without changes. - - XD_C_STRING - Pointer to a C string. +#define UNMARKABLE_RECORD_HEADER_P(lheader) \ + (LHEADER_IMPLEMENTATION (lheader)->marker == this_one_is_unmarkable) - XD_DOC_STRING - Pointer to a doc string (C string if positive, opaque value if negative) - - XD_INT_RESET - An integer which will be reset to a given value in the dump file. - - - XD_SIZE_T - size_t value. Used for counts. - - XD_INT - int value. Used for counts. - - XD_LONG - long value. Used for counts. - - XD_BYTECOUNT - bytecount value. Used for counts. - - XD_END - Special type indicating the end of the array. - - XD_SPECIFIER_END - Special type indicating the end of the array for a specifier. Extra - description is going to be fetched from the specifier methods. - - - Special macros: - XD_INDIRECT(line, delta) - Usable where a "count" or "size" is requested. Gives the value of - the element which is at line number 'line' in the description (count - starts at zero) and adds delta to it. -*/ +#define C_READONLY_RECORD_HEADER_P(lheader) ((lheader)->flags.c_readonly) +#define LISP_READONLY_RECORD_HEADER_P(lheader) ((lheader)->flags.lisp_readonly) +#define SET_C_READONLY_RECORD_HEADER(lheader) \ + ((void) ((lheader)->flags.c_readonly = (lheader)->flags.lisp_readonly = 1)) +#define SET_LISP_READONLY_RECORD_HEADER(lheader) \ + ((void) ((lheader)->flags.lisp_readonly = 1)) -enum lrecord_description_type { - XD_LISP_OBJECT_ARRAY, - XD_LISP_OBJECT, - XD_LO_RESET_NIL, - XD_LO_LINK, - XD_OPAQUE_PTR, - XD_STRUCT_PTR, - XD_OPAQUE_DATA_PTR, - XD_C_STRING, - XD_DOC_STRING, - XD_INT_RESET, - XD_SIZE_T, - XD_INT, - XD_LONG, - XD_BYTECOUNT, - XD_END, - XD_SPECIFIER_END -}; +/* Declaring the following structures as const puts them in the + text (read-only) segment, which makes debugging inconvenient + because this segment is not mapped when processing a core- + dump file */ -struct lrecord_description { - enum lrecord_description_type type; - int offset; - EMACS_INT data1; - const struct struct_description *data2; -}; - -struct struct_description { - size_t size; - const struct lrecord_description *description; -}; - -#define XD_INDIRECT(val, delta) (-1-((val)|(delta<<8))) - -#define XD_IS_INDIRECT(code) (code<0) -#define XD_INDIRECT_VAL(code) ((-1-code) & 255) -#define XD_INDIRECT_DELTA(code) (((-1-code)>>8) & 255) - -#define XD_DYNARR_DESC(base_type, sub_desc) \ - { XD_STRUCT_PTR, offsetof (base_type, base), XD_INDIRECT(1, 0), sub_desc }, \ - { XD_INT, offsetof (base_type, cur) }, \ - { XD_INT_RESET, offsetof (base_type, max), XD_INDIRECT(1, 0) } +#ifdef DEBUG_XEMACS +#define CONST_IF_NOT_DEBUG +#else +#define CONST_IF_NOT_DEBUG CONST +#endif /* DEFINE_LRECORD_IMPLEMENTATION is for objects with constant size. DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION is for objects whose size varies. @@ -427,47 +220,38 @@ # define DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) #endif -#define DEFINE_BASIC_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \ -DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) +#define DEFINE_BASIC_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,structtype) \ +DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,0,0,0,0,structtype) -#define DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof(structtype),0,1,structtype) - -#define DEFINE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \ -DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) +#define DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,structtype) \ +MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizeof(structtype),0,1,structtype) -#define DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype) +#define DEFINE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,structtype) \ +DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,0,0,0,0,structtype) -#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype) - -#define DEFINE_BASIC_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,1,structtype) +#define DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,structtype) \ +MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizeof (structtype),0,0,structtype) -#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \ -MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype) \ +#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,sizer,structtype) \ +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,0,0,0,0,sizer,structtype) -#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ -DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -const struct lrecord_implementation lrecord_##c_name = \ - { name, marker, printer, nuker, equal, hash, desc, \ - getprop, putprop, remprop, plist, size, sizer, \ - lrecord_type_##c_name, basic_p } +#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,sizer,structtype) \ +MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,0,sizer,0,structtype) \ -extern Lisp_Object (*lrecord_markers[]) (Lisp_Object); +#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,getprop,putprop,remprop,props,size,sizer,basic_p,structtype) \ +DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ +static int lrecord_##c_name##_lrecord_type_index; \ +CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name = \ + { name, marker, printer, nuker, equal, hash, \ + getprop, putprop, remprop, props, size, sizer, \ + &(lrecord_##c_name##_lrecord_type_index), basic_p } \ -#define INIT_LRECORD_IMPLEMENTATION(type) do { \ - lrecord_implementations_table[lrecord_type_##type] = &lrecord_##type; \ - lrecord_markers[lrecord_type_##type] = \ - lrecord_implementations_table[lrecord_type_##type]->marker; \ -} while (0) - -#define LRECORDP(a) (XTYPE (a) == Lisp_Type_Record) +#define LRECORDP(a) (XTYPE ((a)) == Lisp_Type_Record) #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a)) #define RECORD_TYPEP(x, ty) \ - (LRECORDP (x) && XRECORD_LHEADER (x)->type == (ty)) + (LRECORDP (x) && \ + lrecord_implementations_table[XRECORD_LHEADER (x)->type] == (ty)) /* NOTE: the DECLARE_LRECORD() must come before the associated DEFINE_LRECORD_*() or you will get compile errors. @@ -481,24 +265,24 @@ #ifdef ERROR_CHECK_TYPECHECK # define DECLARE_LRECORD(c_name, structtype) \ -extern const struct lrecord_implementation lrecord_##c_name; \ -INLINE_HEADER structtype * \ -error_check_##c_name (Lisp_Object obj); \ -INLINE_HEADER structtype * \ +extern CONST_IF_NOT_DEBUG struct lrecord_implementation \ + lrecord_##c_name; \ +INLINE structtype *error_check_##c_name (Lisp_Object obj); \ +INLINE structtype * \ error_check_##c_name (Lisp_Object obj) \ { \ - assert (RECORD_TYPEP (obj, lrecord_type_##c_name)); \ + assert (RECORD_TYPEP (obj, &lrecord_##c_name) || \ + MARKED_RECORD_P (obj)); \ return (structtype *) XPNTR (obj); \ } \ extern Lisp_Object Q##c_name##p # define DECLARE_NONRECORD(c_name, type_enum, structtype) \ -INLINE_HEADER structtype * \ -error_check_##c_name (Lisp_Object obj); \ -INLINE_HEADER structtype * \ +INLINE structtype *error_check_##c_name (Lisp_Object obj); \ +INLINE structtype * \ error_check_##c_name (Lisp_Object obj) \ { \ - assert (XTYPE (obj) == type_enum); \ + assert (XGCTYPE (obj) == type_enum); \ return (structtype *) XPNTR (obj); \ } \ extern Lisp_Object Q##c_name##p @@ -509,14 +293,16 @@ # define XSETRECORD(var, p, c_name) do \ { \ XSETOBJ (var, Lisp_Type_Record, p); \ - assert (RECORD_TYPEP (var, lrecord_type_##c_name)); \ + assert (RECORD_TYPEP (var, &lrecord_##c_name) || \ + MARKED_RECORD_P (var)); \ } while (0) #else /* not ERROR_CHECK_TYPECHECK */ # define DECLARE_LRECORD(c_name, structtype) \ extern Lisp_Object Q##c_name##p; \ -extern const struct lrecord_implementation lrecord_##c_name +extern CONST_IF_NOT_DEBUG struct lrecord_implementation \ + lrecord_##c_name # define DECLARE_NONRECORD(c_name, type_enum, structtype) \ extern Lisp_Object Q##c_name##p # define XRECORD(x, c_name, structtype) ((structtype *) XPNTR (x)) @@ -526,7 +312,8 @@ #endif /* not ERROR_CHECK_TYPECHECK */ -#define RECORDP(x, c_name) RECORD_TYPEP (x, lrecord_type_##c_name) +#define RECORDP(x, c_name) RECORD_TYPEP (x, &lrecord_##c_name) +#define GC_RECORDP(x, c_name) gc_record_type_p (x, &lrecord_##c_name) /* Note: we now have two different kinds of type-checking macros. The "old" kind has now been renamed CONCHECK_foo. The reason for @@ -552,7 +339,7 @@ way out and disabled returning from a signal entirely. */ #define CONCHECK_RECORD(x, c_name) do { \ - if (!RECORD_TYPEP (x, lrecord_type_##c_name)) \ + if (!RECORD_TYPEP (x, &lrecord_##c_name)) \ x = wrong_type_argument (Q##c_name##p, x); \ } while (0) #define CONCHECK_NONRECORD(x, lisp_enum, predicate) do {\ @@ -560,7 +347,7 @@ x = wrong_type_argument (predicate, x); \ } while (0) #define CHECK_RECORD(x, c_name) do { \ - if (!RECORD_TYPEP (x, lrecord_type_##c_name)) \ + if (!RECORD_TYPEP (x, &lrecord_##c_name)) \ dead_wrong_type_argument (Q##c_name##p, x); \ } while (0) #define CHECK_NONRECORD(x, lisp_enum, predicate) do { \ @@ -568,21 +355,24 @@ dead_wrong_type_argument (predicate, x); \ } while (0) -void *alloc_lcrecord (size_t size, const struct lrecord_implementation *); +void *alloc_lcrecord (size_t size, CONST struct lrecord_implementation *); #define alloc_lcrecord_type(type, lrecord_implementation) \ ((type *) alloc_lcrecord (sizeof (type), lrecord_implementation)) +int gc_record_type_p (Lisp_Object frob, + CONST struct lrecord_implementation *type); + /* Copy the data from one lcrecord structure into another, but don't overwrite the header information. */ #define copy_lcrecord(dst, src) \ - memcpy ((char *) (dst) + sizeof (struct lcrecord_header), \ - (char *) (src) + sizeof (struct lcrecord_header), \ - sizeof (*(dst)) - sizeof (struct lcrecord_header)) + memcpy ((char *) dst + sizeof (struct lcrecord_header), \ + (char *) src + sizeof (struct lcrecord_header), \ + sizeof (*dst) - sizeof (struct lcrecord_header)) #define zero_lcrecord(lcr) \ - memset ((char *) (lcr) + sizeof (struct lcrecord_header), 0, \ - sizeof (*(lcr)) - sizeof (struct lcrecord_header)) + memset ((char *) lcr + sizeof (struct lcrecord_header), 0, \ + sizeof (*lcr) - sizeof (struct lcrecord_header)) -#endif /* INCLUDED_lrecord_h_ */ +#endif /* _XEMACS_LRECORD_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/lstream.c --- a/src/lstream.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lstream.c Mon Aug 13 11:20:41 2007 +0200 @@ -26,6 +26,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "insdel.h" @@ -51,7 +52,7 @@ /* Functions are as follows: -Lstream *Lstream_new (Lstream_implementation *imp, const char *mode) +Lstream *Lstream_new (Lstream_implementation *imp, CONST char *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 @@ -94,12 +95,12 @@ void Lstream_fungetc (Lstream *stream, int c) Function equivalents of the above macros. -ssize_t Lstream_read (Lstream *stream, void *data, size_t size) +int Lstream_read (Lstream *stream, void *data, size_t size) Read SIZE bytes of DATA from the stream. Return the number of bytes read. 0 means EOF. -1 means an error occurred and no bytes were read. -ssize_t Lstream_write (Lstream *stream, void *data, size_t size) +int Lstream_write (Lstream *stream, void *data, size_t size) Write SIZE bytes of DATA to the stream. Return the number of bytes written. -1 means an error occurred and no bytes were written. @@ -133,10 +134,10 @@ #define MAX_READ_SIZE 512 static Lisp_Object -mark_lstream (Lisp_Object obj) +mark_lstream (Lisp_Object obj, void (*markobj) (Lisp_Object)) { Lstream *lstr = XLSTREAM (obj); - return lstr->imp->marker ? (lstr->imp->marker) (obj) : Qnil; + return lstr->imp->marker ? (lstr->imp->marker) (obj, markobj) : Qnil; } static void @@ -179,15 +180,15 @@ } static size_t -sizeof_lstream (const void *header) +sizeof_lstream (CONST void *header) { - const Lstream *lstr = (const Lstream *) header; + CONST Lstream *lstr = (CONST Lstream *) header; return sizeof (*lstr) + lstr->imp->size - 1; } DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("stream", lstream, mark_lstream, print_lstream, - finalize_lstream, 0, 0, 0, + finalize_lstream, 0, 0, sizeof_lstream, Lstream); void @@ -209,12 +210,12 @@ } } -static const Lstream_implementation *lstream_types[32]; +static CONST Lstream_implementation *lstream_types[32]; static Lisp_Object Vlstream_free_list[32]; static int lstream_type_count; Lstream * -Lstream_new (const Lstream_implementation *imp, const char *mode) +Lstream_new (CONST Lstream_implementation *imp, CONST char *mode) { Lstream *p; int i; @@ -281,7 +282,7 @@ #define Lstream_internal_error(reason, lstr) \ Lstream_signal_simple_error ("Internal error: " reason, lstr) -static void Lstream_signal_simple_error (const char *reason, Lstream *lstr) +static void Lstream_signal_simple_error (CONST char *reason, Lstream *lstr) { Lisp_Object obj; XSETLSTREAM (obj, lstr); @@ -301,11 +302,11 @@ int Lstream_flush_out (Lstream *lstr) { - ssize_t num_written; + int num_written; while (lstr->out_buffer_ind > 0) { - size_t size = lstr->out_buffer_ind; + int size = lstr->out_buffer_ind; if (! (lstr->flags & LSTREAM_FL_IS_OPEN)) Lstream_internal_error ("lstream not open", lstr); if (! (lstr->flags & LSTREAM_FL_WRITE)) @@ -318,8 +319,8 @@ character at the end. We need to spit back that incomplete character. */ { - const unsigned char *data = lstr->out_buffer; - const unsigned char *dataend = data + size - 1; + CONST unsigned char *data = lstr->out_buffer; + CONST unsigned char *dataend = data + size - 1; assert (size > 0); /* safety check ... */ /* Optimize the most common case. */ if (!BYTE_ASCII_P (*dataend)) @@ -346,7 +347,7 @@ the attempt to write the data might have resulted in an EWOULDBLOCK error. */ return 0; - else if (num_written >= lstr->out_buffer_ind) + else if (num_written >= (int) lstr->out_buffer_ind) lstr->out_buffer_ind = 0; else if (num_written > 0) { @@ -388,36 +389,31 @@ if it's getting EWOULDBLOCK errors. We have to keep stocking them up until they can be written, so as to avoid losing data. */ -static size_t +static int Lstream_adding (Lstream *lstr, size_t num, int force) { - size_t size = num + lstr->out_buffer_ind; - - if (size <= lstr->out_buffer_size) - return num; - + /* Compute the size that the outbuffer needs to be after the + chars are added. */ + size_t size_needed = max (lstr->out_buffer_size, + num + lstr->out_buffer_ind); /* Maybe chop it down so that we don't buffer more characters than our advertised buffering size. */ - if ((size > lstr->buffering_size) && !force) - { - size = lstr->buffering_size; - /* There might be more data buffered than the buffering size. */ - if (size <= lstr->out_buffer_ind) - return 0; - } - - DO_REALLOC (lstr->out_buffer, lstr->out_buffer_size, size, unsigned char); - - return size - lstr->out_buffer_ind; + if (!force) + size_needed = min (lstr->buffering_size, size_needed); + DO_REALLOC (lstr->out_buffer, lstr->out_buffer_size, + size_needed, unsigned char); + /* There might be more data buffered than the buffering size, + so make sure we don't return a negative number here. */ + return max (0, min (num, size_needed - lstr->out_buffer_ind)); } /* Like Lstream_write(), but does not handle line-buffering correctly. */ -static ssize_t -Lstream_write_1 (Lstream *lstr, const void *data, size_t size) +static int +Lstream_write_1 (Lstream *lstr, CONST void *data, size_t size) { - const unsigned char *p = (const unsigned char *) data; - ssize_t off = 0; + CONST unsigned char *p = (CONST unsigned char *) data; + int off = 0; if (! (lstr->flags & LSTREAM_FL_IS_OPEN)) Lstream_internal_error ("lstream not open", lstr); if (! (lstr->flags & LSTREAM_FL_WRITE)) @@ -428,7 +424,7 @@ while (1) { /* Figure out how much we can add to the buffer */ - size_t chunk = Lstream_adding (lstr, size, 0); + int chunk = Lstream_adding (lstr, size, 0); if (chunk == 0) { if (couldnt_write_last_time) @@ -471,30 +467,33 @@ /* If the stream is not line-buffered, then we can just call Lstream_write_1(), which writes in chunks. Otherwise, we repeatedly call Lstream_putc(), which knows how to handle - line buffering. Returns number of bytes written. */ + line buffering. */ -ssize_t -Lstream_write (Lstream *lstr, const void *data, size_t size) +int +Lstream_write (Lstream *lstr, CONST void *data, size_t size) { - size_t i; - const unsigned char *p = (const unsigned char *) data; + int i; + CONST unsigned char *p = (CONST unsigned char *) data; if (size == 0) return size; if (lstr->buffering != LSTREAM_LINE_BUFFERED) return Lstream_write_1 (lstr, data, size); - for (i = 0; i < size; i++) + for (i = 0; i < (int) size; i++) { if (Lstream_putc (lstr, p[i]) < 0) break; } - return i == 0 ? -1 : (ssize_t) i; + return i == 0 ? -1 : 0; } int Lstream_was_blocked_p (Lstream *lstr) { - return lstr->imp->was_blocked_p ? lstr->imp->was_blocked_p (lstr) : 0; + if (lstr->imp->was_blocked_p) + return (lstr->imp->was_blocked_p) (lstr); + else + return 0; } static int @@ -512,16 +511,16 @@ /* Assuming the buffer is empty, fill it up again. */ -static ssize_t +static int Lstream_read_more (Lstream *lstr) { #if 0 - ssize_t size_needed = max (1, min (MAX_READ_SIZE, lstr->buffering_size)); + int size_needed = max (1, min (MAX_READ_SIZE, lstr->buffering_size)); #else /* If someone requested a larger buffer size, so be it! */ - ssize_t size_needed = max (1, lstr->buffering_size); + int size_needed = max (1, lstr->buffering_size); #endif - ssize_t size_gotten; + int size_gotten; DO_REALLOC (lstr->in_buffer, lstr->in_buffer_size, size_needed, unsigned char); @@ -531,11 +530,11 @@ return size_gotten < 0 ? -1 : size_gotten; } -ssize_t +int Lstream_read (Lstream *lstr, void *data, size_t size) { unsigned char *p = (unsigned char *) data; - size_t off = 0; + int off = 0; size_t chunk; int error_occurred = 0; @@ -547,7 +546,7 @@ if (chunk > 0) { /* The bytes come back in reverse order. */ - for (; off < chunk; off++) + for (; off < (int) chunk; off++) p[off] = lstr->unget_buffer[--lstr->unget_buffer_ind]; lstr->byte_count += chunk; size -= chunk; @@ -569,7 +568,7 @@ /* If we need some more, try to get some more from the stream's end */ if (size > 0) { - ssize_t retval = Lstream_read_more (lstr); + int retval = Lstream_read_more (lstr); if (retval < 0) error_occurred = 1; if (retval <= 0) @@ -583,7 +582,7 @@ /* It's quite possible for us to get passed an incomplete character at the end. We need to spit back that incomplete character. */ - const unsigned char *dataend = p + off - 1; + CONST unsigned char *dataend = p + off - 1; /* Optimize the most common case. */ if (!BYTE_ASCII_P (*dataend)) { @@ -593,7 +592,7 @@ VALIDATE_CHARPTR_BACKWARD (dataend); if (dataend + REP_BYTES_BY_FIRST_BYTE (*dataend) != p + off) { - size_t newoff = dataend - p; + int newoff = dataend - p; /* If not, chop the size down to ignore the last char and stash it away for next time. */ Lstream_unread (lstr, dataend, off - newoff); @@ -602,24 +601,25 @@ } } - return off == 0 && error_occurred ? -1 : (ssize_t) off; + return ((off == 0 && error_occurred) ? -1 : off); } void -Lstream_unread (Lstream *lstr, const void *data, size_t size) +Lstream_unread (Lstream *lstr, CONST void *data, size_t size) { - const unsigned char *p = (const unsigned char *) data; + int i; + unsigned char *p = (unsigned char *) data; /* Make sure buffer is big enough */ + DO_REALLOC (lstr->unget_buffer, lstr->unget_buffer_size, lstr->unget_buffer_ind + size, unsigned char); - lstr->byte_count -= size; - /* Bytes have to go on in reverse order -- they are reversed again when read back. */ - while (size--) - lstr->unget_buffer[lstr->unget_buffer_ind++] = p[size]; + for (i = size - 1; i >= 0; i--) + lstr->unget_buffer[lstr->unget_buffer_ind++] = p[i]; + lstr->byte_count -= size; } int @@ -646,11 +646,15 @@ static int Lstream_pseudo_close (Lstream *lstr) { + int rc; + if (!lstr->flags & LSTREAM_FL_IS_OPEN) Lstream_internal_error ("lstream is not open", lstr); /* don't check errors here -- best not to risk file descriptor loss */ - return Lstream_flush (lstr); + rc = Lstream_flush (lstr); + + return rc; } int @@ -725,7 +729,7 @@ Lstream_fputc (Lstream *lstr, int c) { unsigned char ch = (unsigned char) c; - ssize_t retval = Lstream_write_1 (lstr, &ch, 1); + int retval = Lstream_write_1 (lstr, &ch, 1); if (retval >= 0 && lstr->buffering == LSTREAM_LINE_BUFFERED && ch == '\n') return Lstream_flush_out (lstr); return retval < 0 ? -1 : 0; @@ -764,7 +768,7 @@ sizeof (struct stdio_stream)); static Lisp_Object -make_stdio_stream_1 (FILE *stream, int flags, const char *mode) +make_stdio_stream_1 (FILE *stream, int flags, CONST char *mode) { Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_stdio, mode); @@ -788,42 +792,24 @@ return make_stdio_stream_1 (stream, flags, "w"); } -/* #### From reading the Unix 98 specification, it appears that if we - want stdio_reader() to be completely correct, we should check for - 0 < val < size and if so, check to see if an error has occurred. - If an error has occurred, but val is non-zero, we should go ahead - and act as if the read was successful, but remember in some fashion - or other, that an error has occurred, and report that on the next - call to stdio_reader instead of calling fread() again. - - Currently, in such a case, we end up calling fread() twice and we - assume that - - 1) this is not harmful, and - 2) the error will still be reported on the second read. - - This is probably reasonable, so I don't think we should change this - code (it could even be argued that the error might have fixed - itself, so we should do the fread() again. */ - -static ssize_t +static int stdio_reader (Lstream *stream, unsigned char *data, size_t size) { struct stdio_stream *str = STDIO_STREAM_DATA (stream); - size_t val = fread (data, 1, size, str->file); + size_t val = fread (data, 1, (size_t) size, str->file); if (!val && ferror (str->file)) return -1; - return val; + return (int) val; } -static ssize_t -stdio_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +stdio_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct stdio_stream *str = STDIO_STREAM_DATA (stream); size_t val = fwrite (data, 1, size, str->file); if (!val && ferror (str->file)) return -1; - return val; + return (int) val; } static int @@ -851,6 +837,9 @@ if (stream->flags & LSTREAM_FL_WRITE) return fflush (str->file); else + /* call fpurge? Only exists on some systems. #### Why not add a + configure check for HAVE_FPURGE and utilize it on systems that + support it? --hniksic */ return 0; } @@ -864,6 +853,7 @@ if (stream->flags & LSTREAM_FL_WRITE) return fflush (str->file); else + /* call fpurge? Only exists on some systems. */ return 0; } @@ -896,7 +886,7 @@ ignored when writing); -1 for unlimited. */ static Lisp_Object make_filedesc_stream_1 (int filedesc, int offset, int count, int flags, - const char *mode) + CONST char *mode) { Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_filedesc, mode); @@ -931,16 +921,14 @@ return make_filedesc_stream_1 (filedesc, offset, count, flags, "w"); } -static ssize_t +static int filedesc_reader (Lstream *stream, unsigned char *data, size_t size) { - ssize_t nread; + int nread; struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); if (str->end_pos >= 0) size = min (size, (size_t) (str->end_pos - str->current_pos)); - nread = str->allow_quit ? - read_allowing_quit (str->fd, data, size) : - read (str->fd, data, size); + nread = (str->allow_quit ? read_allowing_quit : read) (str->fd, data, size); if (nread > 0) str->current_pos += nread; return nread; @@ -960,11 +948,11 @@ return 0; } -static ssize_t -filedesc_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +filedesc_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); - ssize_t retval; + int retval; int need_newline = 0; /* This function would be simple if it were not for the blasted @@ -976,9 +964,9 @@ if (str->pty_flushing) { /* To make life easy, only send out one line at the most. */ - const unsigned char *ptr; + CONST unsigned char *ptr; - ptr = (const unsigned char *) memchr (data, '\n', size); + ptr = (CONST unsigned char *) memchr (data, '\n', size); if (ptr) need_newline = 1; else @@ -993,9 +981,8 @@ /**** start of non-PTY-crap ****/ if (size > 0) - retval = str->allow_quit ? - write_allowing_quit (str->fd, data, size) : - write (str->fd, data, size); + retval = ((str->allow_quit ? write_allowing_quit : write) + (str->fd, data, size)); else retval = 0; if (retval < 0 && errno_would_block_p (errno) && str->blocked_ok) @@ -1018,10 +1005,8 @@ out for EWOULDBLOCK. */ if (str->chars_sans_newline >= str->pty_max_bytes) { - ssize_t retval2 = str->allow_quit ? - write_allowing_quit (str->fd, &str->eof_char, 1) : - write (str->fd, &str->eof_char, 1); - + int retval2 = ((str->allow_quit ? write_allowing_quit : write) + (str->fd, &str->eof_char, 1)); if (retval2 > 0) str->chars_sans_newline = 0; else if (retval2 < 0) @@ -1051,10 +1036,8 @@ if (need_newline) { Bufbyte nl = '\n'; - ssize_t retval2 = str->allow_quit ? - write_allowing_quit (str->fd, &nl, 1) : - write (str->fd, &nl, 1); - + int retval2 = ((str->allow_quit ? write_allowing_quit : write) + (str->fd, &nl, 1)); if (retval2 > 0) { str->chars_sans_newline = 0; @@ -1187,7 +1170,7 @@ return obj; } -static ssize_t +static int lisp_string_reader (Lstream *stream, unsigned char *data, size_t size) { struct lisp_string_stream *str = LISP_STRING_STREAM_DATA (stream); @@ -1231,7 +1214,7 @@ } static Lisp_Object -lisp_string_marker (Lisp_Object stream) +lisp_string_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) { struct lisp_string_stream *str = LISP_STRING_STREAM_DATA (XLSTREAM (stream)); return str->obj; @@ -1244,7 +1227,7 @@ struct fixed_buffer_stream { - const unsigned char *inbuf; + CONST unsigned char *inbuf; unsigned char *outbuf; size_t size; size_t offset; @@ -1254,30 +1237,30 @@ sizeof (struct fixed_buffer_stream)); Lisp_Object -make_fixed_buffer_input_stream (const void *buf, size_t size) +make_fixed_buffer_input_stream (CONST unsigned char *buf, size_t size) { Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_fixed_buffer, "r"); struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr); - str->inbuf = (const unsigned char *) buf; + str->inbuf = buf; str->size = size; XSETLSTREAM (obj, lstr); return obj; } Lisp_Object -make_fixed_buffer_output_stream (void *buf, size_t size) +make_fixed_buffer_output_stream (unsigned char *buf, size_t size) { Lisp_Object obj; Lstream *lstr = Lstream_new (lstream_fixed_buffer, "w"); struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr); - str->outbuf = (unsigned char *) buf; + str->outbuf = buf; str->size = size; XSETLSTREAM (obj, lstr); return obj; } -static ssize_t +static int fixed_buffer_reader (Lstream *stream, unsigned char *data, size_t size) { struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (stream); @@ -1287,8 +1270,8 @@ return size; } -static ssize_t -fixed_buffer_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +fixed_buffer_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (stream); if (str->offset == str->size) @@ -1311,7 +1294,7 @@ return 0; } -const unsigned char * +CONST unsigned char * fixed_buffer_input_stream_ptr (Lstream *stream) { assert (stream->imp == lstream_fixed_buffer); @@ -1349,8 +1332,8 @@ return obj; } -static ssize_t -resizing_buffer_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +resizing_buffer_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct resizing_buffer_stream *str = RESIZING_BUFFER_STREAM_DATA (stream); DO_REALLOC (str->buf, str->allocked, str->stored + size, unsigned char); @@ -1411,8 +1394,8 @@ return obj; } -static ssize_t -dynarr_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +dynarr_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct dynarr_stream *str = DYNARR_STREAM_DATA (stream); Dynarr_add_many (str->dyn, data, size); @@ -1455,7 +1438,7 @@ static Lisp_Object make_lisp_buffer_stream_1 (struct buffer *buf, Bufpos start, Bufpos end, - int flags, const char *mode) + int flags, CONST char *mode) { Lisp_Object obj; Lstream *lstr; @@ -1535,7 +1518,7 @@ return lstr; } -static ssize_t +static int lisp_buffer_reader (Lstream *stream, unsigned char *data, size_t size) { struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (stream); @@ -1593,8 +1576,8 @@ return data - orig_data; } -static ssize_t -lisp_buffer_writer (Lstream *stream, const unsigned char *data, size_t size) +static int +lisp_buffer_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (stream); Bufpos pos; @@ -1629,13 +1612,13 @@ } static Lisp_Object -lisp_buffer_marker (Lisp_Object stream) +lisp_buffer_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) { struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (XLSTREAM (stream)); - mark_object (str->start); - mark_object (str->end); + markobj (str->start); + markobj (str->end); return str->buffer; } @@ -1690,21 +1673,13 @@ } void -reinit_vars_of_lstream (void) +vars_of_lstream (void) { int i; for (i = 0; i < countof (Vlstream_free_list); i++) { Vlstream_free_list[i] = Qnil; - staticpro_nodump (&Vlstream_free_list[i]); + staticpro (&Vlstream_free_list[i]); } } - -void -vars_of_lstream (void) -{ - INIT_LRECORD_IMPLEMENTATION (lstream); - - reinit_vars_of_lstream (); -} diff -r 12e008d41344 -r 697ef44129c6 src/lstream.h --- a/src/lstream.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/lstream.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Written by Ben Wing. */ -#ifndef INCLUDED_lstream_h_ -#define INCLUDED_lstream_h_ +#ifndef _XEMACS_LSTREAM_H_ +#define _XEMACS_LSTREAM_H_ /************************************************************************/ /* definition of Lstream object */ @@ -74,7 +74,7 @@ typedef struct lstream_implementation { - const char *name; + CONST char *name; size_t size; /* Number of additional bytes to be allocated with this stream. Access this data using Lstream_data(). */ /* Read some data from the stream's end and store it into DATA, which @@ -95,7 +95,7 @@ /* The omniscient mly, blinded by the irresistable thrall of Common Lisp, thinks that it is bogus that the types and implementations of input and output streams are the same. */ - ssize_t (*reader) (Lstream *stream, unsigned char *data, size_t size); + int (*reader) (Lstream *stream, unsigned char *data, size_t size); /* Send some data to the stream's end. Data to be sent is in DATA and is SIZE bytes. Return the number of bytes sent. This function can send and return fewer bytes than is passed in; in @@ -106,7 +106,7 @@ data. (This is useful, e.g., of you're dealing with a non-blocking file descriptor and are getting EWOULDBLOCK errors.) This function can be NULL if the stream is input-only. */ - ssize_t (*writer) (Lstream *stream, const unsigned char *data, size_t size); + int (*writer) (Lstream *stream, CONST unsigned char *data, size_t size); /* Return non-zero if the last write operation on the stream resulted in an attempt to block (EWOULDBLOCK). If this method does not exists, the implementation returns 0 */ @@ -129,7 +129,7 @@ int (*closer) (Lstream *stream); /* Mark this object for garbage collection. Same semantics as a standard Lisp_Object marker. This function can be NULL. */ - Lisp_Object (*marker) (Lisp_Object lstream); + Lisp_Object (*marker) (Lisp_Object lstream, void (*markfun) (Lisp_Object)); } Lstream_implementation; #define DEFINE_LSTREAM_IMPLEMENTATION(name,c_name,size) \ @@ -145,7 +145,7 @@ struct lstream { struct lcrecord_header header; - const Lstream_implementation *imp; /* methods for this stream */ + CONST Lstream_implementation *imp; /* methods for this stream */ Lstream_buffering buffering; /* type of buffering in use */ size_t buffering_size; /* number of bytes buffered */ @@ -175,12 +175,12 @@ ((lstr)->imp == lstream_##type) #ifdef ERROR_CHECK_TYPECHECK -INLINE_HEADER struct lstream * +INLINE struct lstream * error_check_lstream_type (struct lstream *stream, - const Lstream_implementation *imp); -INLINE_HEADER struct lstream * + CONST Lstream_implementation *imp); +INLINE struct lstream * error_check_lstream_type (struct lstream *stream, - const Lstream_implementation *imp) + CONST Lstream_implementation *imp) { assert (stream->imp == imp); return stream; @@ -199,8 +199,8 @@ (lstream_##type->m = type##_##m) -Lstream *Lstream_new (const Lstream_implementation *imp, - const char *mode); +Lstream *Lstream_new (CONST Lstream_implementation *imp, + CONST char *mode); void Lstream_reopen (Lstream *lstr); void Lstream_set_buffering (Lstream *lstr, Lstream_buffering buffering, int buffering_size); @@ -209,10 +209,10 @@ int Lstream_fputc (Lstream *lstr, int c); int Lstream_fgetc (Lstream *lstr); void Lstream_fungetc (Lstream *lstr, int c); -ssize_t Lstream_read (Lstream *lstr, void *data, size_t size); -ssize_t Lstream_write (Lstream *lstr, const void *data, size_t size); +int Lstream_read (Lstream *lstr, void *data, size_t size); +int Lstream_write (Lstream *lstr, CONST void *data, size_t size); int Lstream_was_blocked_p (Lstream *lstr); -void Lstream_unread (Lstream *lstr, const void *data, size_t size); +void Lstream_unread (Lstream *lstr, CONST void *data, size_t size); int Lstream_rewind (Lstream *lstr); int Lstream_seekable_p (Lstream *lstr); int Lstream_close (Lstream *lstr); @@ -268,8 +268,8 @@ #include "mule-charset.h" #endif -INLINE_HEADER Emchar Lstream_get_emchar (Lstream *stream); -INLINE_HEADER Emchar +INLINE Emchar Lstream_get_emchar (Lstream *stream); +INLINE Emchar Lstream_get_emchar (Lstream *stream) { int c = Lstream_getc (stream); @@ -277,8 +277,8 @@ Lstream_get_emchar_1 (stream, c); } -INLINE_HEADER int Lstream_put_emchar (Lstream *stream, Emchar ch); -INLINE_HEADER int +INLINE int Lstream_put_emchar (Lstream *stream, Emchar ch); +INLINE int Lstream_put_emchar (Lstream *stream, Emchar ch) { return CHAR_ASCII_P (ch) ? @@ -286,8 +286,8 @@ Lstream_fput_emchar (stream, ch); } -INLINE_HEADER void Lstream_unget_emchar (Lstream *stream, Emchar ch); -INLINE_HEADER void +INLINE void Lstream_unget_emchar (Lstream *stream, Emchar ch); +INLINE void Lstream_unget_emchar (Lstream *stream, Emchar ch) { if (CHAR_ASCII_P (ch)) @@ -339,9 +339,11 @@ Lisp_Object make_lisp_string_input_stream (Lisp_Object string, Bytecount offset, Bytecount len); -Lisp_Object make_fixed_buffer_input_stream (const void *buf, size_t size); -Lisp_Object make_fixed_buffer_output_stream (void *buf, size_t size); -const unsigned char *fixed_buffer_input_stream_ptr (Lstream *stream); +Lisp_Object make_fixed_buffer_input_stream (CONST unsigned char *buf, + size_t size); +Lisp_Object make_fixed_buffer_output_stream (unsigned char *buf, + size_t size); +CONST unsigned char *fixed_buffer_input_stream_ptr (Lstream *stream); unsigned char *fixed_buffer_output_stream_ptr (Lstream *stream); Lisp_Object make_resizing_buffer_output_stream (void); unsigned char *resizing_buffer_stream_ptr (Lstream *stream); @@ -354,4 +356,4 @@ int flags); Bufpos lisp_buffer_stream_startpos (Lstream *stream); -#endif /* INCLUDED_lstream_h_ */ +#endif /* _XEMACS_LSTREAM_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/m/7300.h --- a/src/m/7300.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/7300.h Mon Aug 13 11:20:41 2007 +0200 @@ -25,6 +25,10 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/acorn.h --- a/src/m/acorn.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/acorn.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,19 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +/* ARM note - The RISCiX Norcroft C Compiler has ALL + non-32-bit types as unsigned */ + +#define SIGN_EXTEND_CHAR(c) (((int)(c) << 24) >> 24) + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -27,6 +40,14 @@ /* ARM note - this is done by the Norcroft compiler - symbol is `__arm' */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + #ifdef LDAV_SYMBOL #undef LDAV_SYMBOL #endif diff -r 12e008d41344 -r 697ef44129c6 src/m/alliant-2800.h --- a/src/m/alliant-2800.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/alliant-2800.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -34,6 +39,15 @@ #define sun /* Use X support for Sun keyboard stuff. */ #define C_OPTIMIZE_SWITCH "-Og" /* No concurrent code allowed here. */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ +/* On Alliants, bitfields are unsigned. */ + +#define EXPLICIT_SIGN_EXTEND + /* Concentrix uses a different kernel symbol for load average. */ #undef LDAV_SYMBOL /* Undo definition in s-bsd4-2.h */ diff -r 12e008d41344 -r 697ef44129c6 src/m/alliant.h --- a/src/m/alliant.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/alliant.h Mon Aug 13 11:20:41 2007 +0200 @@ -27,6 +27,11 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -34,6 +39,15 @@ #define ALLIANT +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ +/* On Alliants, bitfields are unsigned. */ + +#define EXPLICIT_SIGN_EXTEND + /* No load average information available for Alliants. */ #undef LOAD_AVE_TYPE diff -r 12e008d41344 -r 697ef44129c6 src/m/alpha.h --- a/src/m/alpha.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/alpha.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,7 +20,7 @@ #ifdef LINUX -# define SYSTEM_MALLOC + # define SYSTEM_MALLOC #endif #ifdef OSF1 diff -r 12e008d41344 -r 697ef44129c6 src/m/altos.h --- a/src/m/altos.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/altos.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,8 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +#define EXPLICIT_SIGN_EXTEND + #define LIB_STANDARD "-lc" #ifdef __GNUC__ diff -r 12e008d41344 -r 697ef44129c6 src/m/amdahl.h --- a/src/m/amdahl.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/amdahl.h Mon Aug 13 11:20:41 2007 +0200 @@ -32,6 +32,11 @@ compiler is so brain damaged that it is not even worth trying to use it. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE /* not actually used anywhere yet! */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -41,6 +46,14 @@ /* However for clarity define amdahl_uts */ #define amdahl_uts +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long*/ diff -r 12e008d41344 -r 697ef44129c6 src/m/arm.h --- a/src/m/arm.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/arm.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,11 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -87,7 +92,16 @@ #define TEXT_START 0 #endif /* USG */ -#ifdef WIN32_NATIVE + +#ifdef USG5_4 +#define DATA_SEG_BITS 0x08000000 +#endif + +#ifdef MSDOS +#define NO_REMAP +#endif + +#ifdef WINDOWSNT #define VIRT_ADDR_VARIES #define DATA_END get_data_end () #define DATA_START get_data_start () @@ -102,6 +116,17 @@ #define SEGMENT_MASK ((SEGMENT_SIZE)-1) #endif +#if 0 +#ifdef __GNUC__ +/* GCC's alloca() is semi-broken. See lisp.h. + + This brokenness has been confirmed under both Linux and NetBSD. + It may also exist on non-Intel architectures. */ +#define BROKEN_ALLOCA_IN_FUNCTION_CALLS +#endif +#endif + + /* XEmacs change: John Hughes <john@AtlanTech.COM> says using vfork under i386-unknown-sysv4.2 makes C-g sometimes cause a SIGSEGV in TTY mode; the problem goes away if you use fork */ diff -r 12e008d41344 -r 697ef44129c6 src/m/att3b.h --- a/src/m/att3b.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/att3b.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,10 +26,23 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically */ #define ATT3B +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/m/aviion.h --- a/src/m/aviion.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/aviion.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,18 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + +/* Define DATA_SEG_BITS if pointers need to be corrected with + a segment field. */ + +#ifdef FIX_ADDRESS +#define DATA_SEG_BITS 0xef000000 +#endif + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -29,6 +41,14 @@ /*#define m88k*/ /*#endif*/ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/m/celerity.h --- a/src/m/celerity.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/celerity.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,10 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ +/* XINT must explicitly sign extend */ + +#define EXPLICIT_SIGN_EXTEND + /* celerity preprocessor defines "accel", however the following is clearer */ #define celerity diff -r 12e008d41344 -r 697ef44129c6 src/m/clipper.h --- a/src/m/clipper.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/clipper.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,11 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically */ @@ -29,6 +34,14 @@ #define DOT_GLOBAL_START +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +/* #define EXPLICIT_SIGN_EXTEND */ + /* USG systems I know of running on Vaxes do not actually support the load average, so disable it for them. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/cnvrgnt.h --- a/src/m/cnvrgnt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/cnvrgnt.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,11 +20,24 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ #define m68000 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. These are commented out since it is not supported by this machine. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/convex.h --- a/src/m/convex.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/convex.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ #ifndef convex /* The compiler doesn't always do this. */ @@ -86,6 +91,9 @@ /* #define NO_REMAP */ +/* Addresses on the Convex have the high bit set. */ +#define DATA_SEG_BITS (1 << (INTBITS-1)) + /* Right shift is logical shift. And the usual way of handling such machines, which involves copying the number into sign_extend_temp, does not work diff -r 12e008d41344 -r 697ef44129c6 src/m/cydra5.h --- a/src/m/cydra5.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/cydra5.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,11 +24,24 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -62,6 +75,11 @@ #define C_ALLOCA #undef HAVE_ALLOCA +/* The data segment in this machine always starts at address 0x10000000. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#define DATA_SEG_BITS 0x20000000 #define DATA_START 0x20000000 /* Define NO_REMAP if memory segmentation makes it not work well diff -r 12e008d41344 -r 697ef44129c6 src/m/delta.h --- a/src/m/delta.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/delta.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,6 +26,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -34,6 +39,14 @@ #define m68000 #define MOTOROLA_DELTA +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ @@ -74,6 +87,20 @@ #define NO_REMAP +/* Some really obscure 4.2-based systems (like Sequent DYNIX) + * do not support asynchronous I/O (using SIGIO) on sockets, + * even though it works fine on tty's. If you have one of + * these systems, define the following, and then use it in + * config.h (or elsewhere) to decide when (not) to use SIGIO. + * + * You'd think this would go in an operating-system description file, + * but since it only occurs on some, but not all, BSD systems, the + * reasonable place to select for it is in the machine description + * file. + */ + +/* #define NO_SOCK_SIGIO */ + /* Machine specific stuff */ #define HAVE_PTYS diff -r 12e008d41344 -r 697ef44129c6 src/m/delta88k.h --- a/src/m/delta88k.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/delta88k.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -37,6 +42,14 @@ does not define it automatically. */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +/* #define EXPLICIT_SIGN_EXTEND */ + /* Data type of load average, as read out of kmem. */ /* No load average on Motorola machines. */ /* #define LOAD_AVE_TYPE double */ diff -r 12e008d41344 -r 697ef44129c6 src/m/dpx2.h --- a/src/m/dpx2.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/dpx2.h Mon Aug 13 11:20:41 2007 +0200 @@ -33,6 +33,11 @@ /* #define ncl_el /* DPX/2 210,220 etc */ /* #define ncl_mr 1 /* DPX/2 320,340 (and 360,380 ?) */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE /**/ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -40,6 +45,14 @@ /* /bin/cc on ncl_el and ncl_mr define m68k and mc68000 */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/dual.h --- a/src/m/dual.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/dual.h Mon Aug 13 11:20:41 2007 +0200 @@ -36,6 +36,10 @@ NOTE-END */ +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/elxsi.h --- a/src/m/elxsi.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/elxsi.h Mon Aug 13 11:20:41 2007 +0200 @@ -28,6 +28,11 @@ /* This file was modified by Matt Crawford <matt@tank.uchicago.edu> to work under Elxsi's 12.0 release of BSD unix. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/*#define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -37,6 +42,15 @@ #define elxsi #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + + /* Name of kernel load average variable */ #undef LDAV_SYMBOL diff -r 12e008d41344 -r 697ef44129c6 src/m/ews4800r.h --- a/src/m/ews4800r.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ews4800r.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,16 @@ /* Synched up with: Mule 2.0. Not in FSF. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -28,6 +38,14 @@ # define mips #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/gould-np1.h --- a/src/m/gould-np1.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/gould-np1.h Mon Aug 13 11:20:41 2007 +0200 @@ -64,6 +64,12 @@ #define C_DEBUG_SWITCH "-g" #define LIBS_DEBUG "-lg" + +/* The data segment in this machine always starts at address 0x1000000 = 16M. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#define DATA_SEG_BITS 0x1000000 #define DATA_START 0x1000000 /* The text segment always starts at 0. diff -r 12e008d41344 -r 697ef44129c6 src/m/gould.h --- a/src/m/gould.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/gould.h Mon Aug 13 11:20:41 2007 +0200 @@ -46,6 +46,11 @@ A site running a pre-release of 2.1 should #define RELEASE2_1 in config.h. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically */ @@ -57,6 +62,14 @@ - it is no longer needed and interferes with a variable in xmenu.c */ #undef sel +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff -r 12e008d41344 -r 697ef44129c6 src/m/hp300bsd.h --- a/src/m/hp300bsd.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/hp300bsd.h Mon Aug 13 11:20:41 2007 +0200 @@ -36,5 +36,9 @@ #define HAVE_ALLOCA +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + #define LOAD_AVE_TYPE long #define LOAD_AVE_CVT(x) ((int) (((double) (x)) / 2048.0 * 100.0)) diff -r 12e008d41344 -r 697ef44129c6 src/m/hp800.h --- a/src/m/hp800.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/hp800.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="hpux" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -32,6 +37,13 @@ # define hp9000s800 #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND #ifdef __hpux /* Now define a symbol for the cpu type, if your compiler @@ -82,6 +94,8 @@ /* the data segment on this machine always starts at address 0x40000000. */ +#define DATA_SEG_BITS 0x40000000 + #ifdef DATA_START #undef DATA_START #endif diff -r 12e008d41344 -r 697ef44129c6 src/m/hp9000s300.h --- a/src/m/hp9000s300.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/hp9000s300.h Mon Aug 13 11:20:41 2007 +0200 @@ -39,6 +39,11 @@ /* #define HPUX_5 */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ @@ -46,6 +51,14 @@ #define hp9000s300 #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Define CANNOT_DUMP on machines where unexec does not work. Then the function dump-emacs will not be defined and temacs will do (load "loadup") automatically unless told otherwise. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/i860.h --- a/src/m/i860.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/i860.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -31,6 +36,14 @@ #define INTEL860 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/ibmps2-aix.h --- a/src/m/ibmps2-aix.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ibmps2-aix.h Mon Aug 13 11:20:41 2007 +0200 @@ -30,6 +30,11 @@ work with certain new X window managers, and may be suboptimal. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -80,6 +85,11 @@ #define DATA_START 0x00800000 #define DATA_END 0 +/* The data segment in this machine always starts at address 0x00800000. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#define DATA_SEG_BITS 0x00800000 #endif #if 0 /* I refuse to promulgate a recommendation that would make diff -r 12e008d41344 -r 697ef44129c6 src/m/ibmrs6000.h --- a/src/m/ibmrs6000.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ibmrs6000.h Mon Aug 13 11:20:41 2007 +0200 @@ -51,6 +51,27 @@ #define DATA_END 0 #endif +/* The data segment in this machine always starts at address 0x20000000. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#ifndef USG5_4 +#define DATA_SEG_BITS 0x20000000 +#else +#define DATA_SEG_BITS 0 +#endif + +#ifdef CANNOT_DUMP +/* Define shared memory segment symbols */ + +#define PURE_SEG_BITS 0x30000000 + +/* Use shared memory. */ +/* This is turned off because it does not always work. See etc/AIX.DUMP. */ +/* #define HAVE_SHM */ +#define SHMKEY 5305035 /* used for shared memory code segments */ +#endif /* CANNOT_DUMP */ + #define N_BADMAG(x) BADMAG(x) #define N_TXTOFF(x) A_TEXTPOS(x) #define N_SYMOFF(x) A_SYMPOS(x) diff -r 12e008d41344 -r 697ef44129c6 src/m/ibmrt-aix.h --- a/src/m/ibmrt-aix.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ibmrt-aix.h Mon Aug 13 11:20:41 2007 +0200 @@ -50,6 +50,12 @@ #define DATA_START 0x20000000 #define DATA_END 0 +/* The data segment in this machine always starts at address 0x20000000. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#define DATA_SEG_BITS 0x20000000 + #define N_BADMAG(x) BADMAG(x) #define N_TXTOFF(x) A_TEXTPOS(x) #define N_SYMOFF(x) A_SYMPOS(x) diff -r 12e008d41344 -r 697ef44129c6 src/m/ibmrt.h --- a/src/m/ibmrt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ibmrt.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ @@ -35,6 +40,14 @@ #define romp /* unfortunately old include files are hanging around. */ #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double /* For AIS (sysV) */ @@ -67,6 +80,11 @@ #define HAVE_ALLOCA +/* The data segment in this machine starts at a fixed address. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#define DATA_SEG_BITS 0x10000000 #define DATA_START 0x10000000 /* The text segment always starts at a fixed address. diff -r 12e008d41344 -r 697ef44129c6 src/m/intel386.h --- a/src/m/intel386.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/intel386.h Mon Aug 13 11:20:41 2007 +0200 @@ -50,6 +50,11 @@ Minor changes merged in 19.1. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -147,11 +152,22 @@ #ifdef USG +#if 0 /* ALLOCA is now autodetected */ +#define HAVE_ALLOCA +#endif #define NO_REMAP #define TEXT_START 0 #endif /* USG */ #endif /* not XENIX */ +#ifdef USG5_4 +#define DATA_SEG_BITS 0x08000000 +#endif + +#ifdef MSDOS +#define NO_REMAP +#endif + #ifdef linux /* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */ /* we cannot get the maximum address for brk */ diff -r 12e008d41344 -r 697ef44129c6 src/m/iris4d.h --- a/src/m/iris4d.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/iris4d.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,11 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -33,6 +38,14 @@ #define IRIS_4D #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* jg@genmagic.genmagic.com (John Giannandrea) says this is unnecessary. */ #if 0 /* Data type of load average, as read out of kmem. */ @@ -86,13 +99,22 @@ #ifdef USG5_4 #undef UNEXEC -#define UNEXEC "unexelf.o" +/* FSF renames this file to unexsgi.o */ +#define UNEXEC "unexelfsgi.o" #else #define UNEXEC "unexmips.o" #endif #define TEXT_START 0x400000 + +/* + * DATA_SEG_BITS forces extra bits to be or'd in with any pointers which + * were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for + * the value field of a LISP_OBJECT). + */ + #define DATA_START 0x10000000 +#define DATA_SEG_BITS 0x10000000 #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/iris5d.h --- a/src/m/iris5d.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/iris5d.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="irix3-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -37,6 +42,14 @@ #define IRIS_4D #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long /* This doesn't quite work on the 4D */ @@ -88,11 +101,19 @@ #ifdef UNEXEC #undef UNEXEC #endif -#define UNEXEC "unexelf.o" +/* FSF renames this file to unexsgi.o */ +#define UNEXEC "unexelfsgi.o" #define TEXT_START 0x400000 +/* + * DATA_SEG_BITS forces extra bits to be or'd in with any pointers which + * were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for + * the value field of a LISP_OBJECT). + */ + #define DATA_START 0x10000000 +#define DATA_SEG_BITS 0x10000000 #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/iris6d.h --- a/src/m/iris6d.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* machine description file for Iris-4D machines. Use with s/irix*.h. - Copyright (C) 1987 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with 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.31. */ - -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically: - Ones defined so far include vax, m68000, ns16000, pyramid, - orion, tahoe, APOLLO and many others */ - -#ifndef mips -#define mips -#endif - -#ifndef IRIS_4D -#define IRIS_4D -#endif - -/* jg@genmagic.genmagic.com (John Giannandrea) says this is unnecessary. */ -#if 0 -/* Data type of load average, as read out of kmem. */ - -#define LOAD_AVE_TYPE long /* This doesn't quite work on the 4D */ - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define LOAD_AVE_CVT(x) (int)(((double)(x)*100)/1024.0) - -/* s-iris3-6.h uses /vmunix */ - -#undef KERNEL_FILE -#define KERNEL_FILE "/unix" -#endif - -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -#undef CANNOT_DUMP - -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ - -/* #define VIRT_ADDR_VARIES */ - -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ /* Sjoerd.Mullender@cwi.nl says no need. */ -/* #define HAVE_ALLOCA */ - -/* Define NO_REMAP if memory segmentation makes it not work well - to change the boundary between the text section and data section - when Emacs is dumped. If you define this, the preloaded Lisp - code will not be sharable; but that's better than failing completely. */ - -#define NO_REMAP - -/* This machine requires completely different unexec code - which lives in a separate file. Specify the file name. */ - -#ifdef USG5_4 -#undef UNEXEC -#define UNEXEC "unexelfsgi.o" -#else -#define UNEXEC "unexmips.o" -#endif - -#define TEXT_START 0x400000 -#define DATA_START 0x10000000 - -#undef LIBS_MACHINE -/* -lsun in case using Yellow Pages for passwords. */ -#define LIBS_DEBUG - -/* Define this if you have a fairly recent system, - in which crt1.o and crt1.n should be used. */ -#define HAVE_CRTN - -#ifndef USG5_4 -#ifdef HAVE_CRTN -/* Must define START-FILES so that the linker can find /usr/lib/crt0.o. */ -#define START_FILES "pre-crt0.o /usr/lib/crt1.o" -#define LIB_STANDARD "-lc /usr/lib/crtn.o" -#else -#define START_FILES "pre-crt0.o /usr/lib/crt0.o" -/* The entry-point label (start of text segment) is `start', not `__start'. */ -#define DEFAULT_ENTRY_ADDRESS start -#define LIB_STANDARD "-lc" -#endif -#endif - -/* Use terminfo instead of termcap. */ - -#define TERMINFO - -/* Letter to use in finding device name of first pty, - if system supports pty's. 'a' means it is /dev/ptya0 */ - -#undef FIRST_PTY_LETTER -#define FIRST_PTY_LETTER 'q' - -/* Define STACK_DIRECTION for alloca.c */ - -#undef STACK_DIRECTION -#define STACK_DIRECTION -1 diff -r 12e008d41344 -r 697ef44129c6 src/m/irist.h --- a/src/m/irist.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/irist.h Mon Aug 13 11:20:41 2007 +0200 @@ -58,6 +58,11 @@ (copy-file), it would say that it is non-critical... #endif /* 0 */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -67,6 +72,14 @@ #define m68000 #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/isi-ov.h --- a/src/m/isi-ov.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/isi-ov.h Mon Aug 13 11:20:41 2007 +0200 @@ -34,6 +34,10 @@ #define m68000 +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #ifdef BSD4_3 diff -r 12e008d41344 -r 697ef44129c6 src/m/luna88k.h --- a/src/m/luna88k.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/luna88k.h Mon Aug 13 11:20:41 2007 +0200 @@ -31,6 +31,15 @@ /* Synched up with: Mule 2.0. Not in FSF. */ +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +#define SIGN_EXTEND_CHAR(c) (c) + +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/m68k.h --- a/src/m/m68k.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/m68k.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,6 +20,14 @@ /* Synched up with: FSF 19.31. */ +/* The following symbol gives information on + the size of various data types. */ + +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ @@ -27,6 +35,14 @@ #define m68k #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Define CANNOT_DUMP on machines where unexec does not work. Then the function dump-emacs will not be defined and temacs will do (load "loadup") automatically unless told otherwise. */ @@ -43,6 +59,9 @@ /* #define VIRT_ADDR_VARIES */ #ifdef linux +#ifdef __ELF__ +#define DATA_SEG_BITS 0x80000000 +#endif #define NO_REMAP #define TEXT_START 0 diff -r 12e008d41344 -r 697ef44129c6 src/m/masscomp.h --- a/src/m/masscomp.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/masscomp.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="rtu" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -31,6 +36,14 @@ /* Masscomp predefines mc68000. */ #define m68000 mc68000 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#undef EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff -r 12e008d41344 -r 697ef44129c6 src/m/mega68.h --- a/src/m/mega68.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/mega68.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,10 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Say this machine is a 68000 */ #define m68000 diff -r 12e008d41344 -r 697ef44129c6 src/m/mg1.h --- a/src/m/mg1.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/mg1.h Mon Aug 13 11:20:41 2007 +0200 @@ -34,6 +34,11 @@ your work; we'd like to distribute this information. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ +/* ns16000 addresses are byte addresses */ +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -42,6 +47,14 @@ #define ns16000 #define mg1 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* mg1 its an unsigned long */ #define LOAD_AVE_TYPE unsigned long diff -r 12e008d41344 -r 697ef44129c6 src/m/mips-nec.h --- a/src/m/mips-nec.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/mips-nec.h Mon Aug 13 11:20:41 2007 +0200 @@ -36,6 +36,16 @@ With this the file mips-siemens.h is obsolete. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -44,6 +54,14 @@ # define mips #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -96,6 +114,10 @@ /* MARCO ??? */ #define TEXT_START 0x400000 +/* +#define DATA_START 0x10000000 +#define DATA_SEG_BITS 0x10000000 +*/ #undef ORDINARY_LINK diff -r 12e008d41344 -r 697ef44129c6 src/m/mips-siemens.h --- a/src/m/mips-siemens.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/mips-siemens.h Mon Aug 13 11:20:41 2007 +0200 @@ -36,6 +36,16 @@ With this the file mips-siemens.h is obsolete. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -44,6 +54,14 @@ # define mips #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -96,7 +114,10 @@ /* MARCO ??? */ #define TEXT_START 0x400000 - +/* +#define DATA_START 0x10000000 +#define DATA_SEG_BITS 0x10000000 +*/ #ifdef UNEXEC #undef UNEXEC #endif diff -r 12e008d41344 -r 697ef44129c6 src/m/mips.h --- a/src/m/mips.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/mips.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,6 +29,16 @@ Note that the proper m- file for the Decstation is m-pmax.h. NOTE-END */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -37,6 +47,14 @@ # define mips #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -45,12 +63,10 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / 256.0) -#ifndef linux /* CDC EP/IX 1.4.3 uses /unix */ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -#endif /* ! linux */ /* Define CANNOT_DUMP on machines where unexec does not work. Then the function dump-emacs will not be defined @@ -90,22 +106,16 @@ /* This machine requires completely different unexec code which lives in a separate file. Specify the file name. */ -#ifndef linux #define UNEXEC "unexmips.o" -#endif /* !linux */ + /* Describe layout of the address space in an executing process. */ -#ifdef linux -#define TEXT_START 0x00400000 -#define DATA_START 0x10000000 -#else /* !linux */ #define TEXT_START 0x400000 #define DATA_START 0x800000 -#endif /* linux */ /* Alter some of the options used when linking. */ -#if !defined(NEWSOS5) && !defined(linux) +#ifndef NEWSOS5 #ifdef BSD /* DECstations don't have this library. */ @@ -128,9 +138,9 @@ #define C_DEBUG_SWITCH "-O -g3" #endif /* not BSD */ -#endif /* !NEWSOS5 && !linux */ +#endif /* not NEWSOS5 */ -#if !defined(NEWSOS5) && !defined(linux) +#ifndef NEWSOS5 #ifdef USG /* Don't try to use SIGIO even though it is defined. */ @@ -157,4 +167,4 @@ #define TERMINFO #undef MAIL_USE_FLOCK /* Someone should check this. */ #endif /* BSD */ -#endif /* !NEWSOS5 && !linux */ +#endif /* not NEWSOS5 */ diff -r 12e008d41344 -r 697ef44129c6 src/m/next.h --- a/src/m/next.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/next.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,6 +26,15 @@ #define NeXT #endif +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ + +#define SIGN_EXTEND_CHAR(c) (c) + +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Say that the text segment of a.out includes the header; the header actually occupies the first few bytes of the text segment and is counted in hdr.a_text. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/nh3000.h --- a/src/m/nh3000.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/nh3000.h Mon Aug 13 11:20:41 2007 +0200 @@ -30,6 +30,11 @@ operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -39,6 +44,14 @@ #define gcx #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +/* #define EXPLICIT_SIGN_EXTEND */ + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -78,3 +91,17 @@ code will not be sharable; but that's better than failing completely. */ #define NO_REMAP + +/* Some really obscure 4.2-based systems (like Sequent DYNIX) + * do not support asynchronous I/O (using SIGIO) on sockets, + * even though it works fine on tty's. If you have one of + * these systems, define the following, and then use it in + * config.h (or elsewhere) to decide when (not) to use SIGIO. + * + * You'd think this would go in an operating-system description file, + * but since it only occurs on some, but not all, BSD systems, the + * reasonable place to select for it is in the machine description + * file. + */ + +/* #define NO_SOCK_SIGIO */ diff -r 12e008d41344 -r 697ef44129c6 src/m/nh4000.h --- a/src/m/nh4000.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/nh4000.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,6 +29,11 @@ operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -38,6 +43,18 @@ #define m88000 #endif +#define VALBITS 26 + +#define GCTYPEBITS 5 + +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +/* #define EXPLICIT_SIGN_EXTEND */ + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -77,3 +94,17 @@ code will not be sharable; but that's better than failing completely. */ #define NO_REMAP + +/* Some really obscure 4.2-based systems (like Sequent DYNIX) + * do not support asynchronous I/O (using SIGIO) on sockets, + * even though it works fine on tty's. If you have one of + * these systems, define the following, and then use it in + * config.h (or elsewhere) to decide when (not) to use SIGIO. + * + * You'd think this would go in an operating-system description file, + * but since it only occurs on some, but not all, BSD systems, the + * reasonable place to select for it is in the machine description + * file. + */ + +/* #define NO_SOCK_SIGIO */ diff -r 12e008d41344 -r 697ef44129c6 src/m/ns32000.h --- a/src/m/ns32000.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ns32000.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,11 +24,24 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/m/nu.h --- a/src/m/nu.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/nu.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,10 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/orion.h --- a/src/m/orion.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/orion.h Mon Aug 13 11:20:41 2007 +0200 @@ -31,6 +31,15 @@ #define orion #endif +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff -r 12e008d41344 -r 697ef44129c6 src/m/orion105.h --- a/src/m/orion105.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/orion105.h Mon Aug 13 11:20:41 2007 +0200 @@ -25,6 +25,9 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + /* Data type of load average, as read out of kmem. */ /* This used to be `double'. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/pfa50.h --- a/src/m/pfa50.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/pfa50.h Mon Aug 13 11:20:41 2007 +0200 @@ -25,6 +25,10 @@ #define m68000 #define mc68000 1 +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -47,6 +51,17 @@ #define LD_SWITCH_MACHINE "-e __start" +#if pfa50 || pfa70 + +/* On A-50/60/70/80, data space has high order byte use. */ +#define VALBITS 26 +#define VALMASK (((1<<VALBITS) - 1) | 0x60000000) +/* XEmacs: markbit is between type bits and value bits */ +/* #define XTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK)) */ +#define XTYPE(a) ((enum Lisp_Type) (((a) >> ((VALBITS) + 1)) & GCTYPEMASK)) + +#endif /* pfa50, pfa70 */ + /* SX/A has alloca in the PW library. */ #define LIB_STANDARD "-lPW -lc" diff -r 12e008d41344 -r 697ef44129c6 src/m/plexus.h --- a/src/m/plexus.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/plexus.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -31,6 +36,14 @@ /* Plexus predefines m68 instead of m68000. */ #define m68000 m68 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#undef EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #undef LOAD_AVE_TYPE diff -r 12e008d41344 -r 697ef44129c6 src/m/pmax.h --- a/src/m/pmax.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/pmax.h Mon Aug 13 11:20:41 2007 +0200 @@ -30,6 +30,7 @@ #undef LD_SWITCH_MACHINE #undef DATA_START #define DATA_START 0x10000000 +#define DATA_SEG_BITS 0x10000000 #if 0 /* I don't see any such conflict in Ultrix 4.2, 4.2a, or 4.3. And diff -r 12e008d41344 -r 697ef44129c6 src/m/powerpc.h --- a/src/m/powerpc.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/powerpc.h Mon Aug 13 11:20:41 2007 +0200 @@ -43,6 +43,10 @@ # endif #endif +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + #ifndef __linux__ /* Data type of load average, as read out of kmem. */ @@ -62,12 +66,32 @@ #define NO_REMAP +#if 0 +#define TEXT_START 0x00001000 +#define TEXT_END 0 +#define DATA_START 0x01000000 +#define DATA_END 0 + +/* The data segment in this machine always starts at address 0x10000000. + An address of data cannot be stored correctly in a Lisp object; + we always lose the high bits. We must tell XPNTR to add them back. */ + +#define DATA_SEG_BITS 0x10000000 +#endif + /* Use type int rather than a union, to represent Lisp_Object */ /* #define NO_UNION_TYPE */ #ifdef CANNOT_DUMP +/* Define shared memory segment symbols */ +#define PURE_SEG_BITS 0x30000000 + +/* Use shared memory. */ +/* This is turned off because it does not always work. See etc/AIX.DUMP. */ +/* #define HAVE_SHM */ +#define SHMKEY 5305035 /* used for shared memory code segments */ #endif /* CANNOT_DUMP */ #define N_BADMAG(x) BADMAG(x) diff -r 12e008d41344 -r 697ef44129c6 src/m/pyramid.h --- a/src/m/pyramid.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/pyramid.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,10 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ +/* XINT must explicitly sign extend */ + +#define EXPLICIT_SIGN_EXTEND + /* pyramid preprocessor defines "pyr", however the following is clearer */ #define pyramid diff -r 12e008d41344 -r 697ef44129c6 src/m/s390.h --- a/src/m/s390.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* machine description file for IBM S390 - Copyright (C) 1987 Free Software Foundation, Inc. - -This file is part of XEmacs. - -GNU Emacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -/* Say this machine is a s390 */ - -#ifndef s390 -#define s390 -#endif - -/* Data type of load average, as read out of kmem. */ - -#define LOAD_AVE_TYPE long - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) diff -r 12e008d41344 -r 697ef44129c6 src/m/sequent-ptx.h --- a/src/m/sequent-ptx.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sequent-ptx.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,6 +26,11 @@ #include "intel386.h" +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ +/* CHECK THIS */ +#define SIGN_EXTEND_CHAR(c) (c) + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -40,6 +45,14 @@ #define CRT0_DUMMIES dummy1, dummy2, dummy3, #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE unsigned long diff -r 12e008d41344 -r 697ef44129c6 src/m/sequent.h --- a/src/m/sequent.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sequent.h Mon Aug 13 11:20:41 2007 +0200 @@ -31,6 +31,11 @@ /* NOTE: this file works for DYNIX release 2.0 (not tested on 1.3) on NS32000's */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -49,6 +54,14 @@ #define DOT_GLOBAL_START +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE unsigned long @@ -131,7 +144,6 @@ * config.h (or elsewhere) to decide when (not) to use SIGIO. */ -/* Note: This definition not used under XEmacs */ #define NO_SOCK_SIGIO /* Define how to search all pty names. diff -r 12e008d41344 -r 697ef44129c6 src/m/sgi-challenge.h --- a/src/m/sgi-challenge.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sgi-challenge.h Mon Aug 13 11:20:41 2007 +0200 @@ -28,6 +28,11 @@ operating system this machine is likely to run. USUAL-OPSYS="irix3-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -49,6 +54,14 @@ #undef HAVE_NATIVE_SOUND #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long /* This doesn't quite work on the 4D */ @@ -103,7 +116,15 @@ #define UNEXEC "unexelfsgi.o" #define TEXT_START 0x400000 + +/* + * DATA_SEG_BITS forces that bit to be or'd in with any pointers which + * are trying to access pure strings (as gnu-emacs only allows 24 bits + * for the value field of a LISP_OBJECT). + */ + #define DATA_START 0x10000000 +#define DATA_SEG_BITS 0x10000000 #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/sparc.h --- a/src/m/sparc.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sparc.h Mon Aug 13 11:20:41 2007 +0200 @@ -42,6 +42,10 @@ # endif #endif +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Mask for address bits within a memory segment */ #define SEGMENT_MASK (SEGSIZ - 1) diff -r 12e008d41344 -r 697ef44129c6 src/m/sps7.h --- a/src/m/sps7.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sps7.h Mon Aug 13 11:20:41 2007 +0200 @@ -32,6 +32,10 @@ #define sps7 +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* Suspect there is something weird about this machine, so turn it off. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/stride.h --- a/src/m/stride.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/stride.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and STRIDE @@ -34,6 +39,14 @@ #define STRIDE #endif +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff -r 12e008d41344 -r 697ef44129c6 src/m/sun1.h --- a/src/m/sun1.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sun1.h Mon Aug 13 11:20:41 2007 +0200 @@ -47,6 +47,10 @@ /* Sun can't write competent compilers */ #define COMPILER_REGISTER_BUG +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/sun2.h --- a/src/m/sun2.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/sun2.h Mon Aug 13 11:20:41 2007 +0200 @@ -51,6 +51,10 @@ /* Sun can't write competent compilers */ #define COMPILER_REGISTER_BUG +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff -r 12e008d41344 -r 697ef44129c6 src/m/tad68k.h --- a/src/m/tad68k.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/tad68k.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,22 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + +/* Now define a symbol for the cpu type, if your compiler + does not define it automatically */ + +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +/* #define EXPLICIT_SIGN_EXTEND */ + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/m/tahoe.h --- a/src/m/tahoe.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/tahoe.h Mon Aug 13 11:20:41 2007 +0200 @@ -29,6 +29,10 @@ Berkeley you are running. NOTE-END */ +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Say this machine is a tahoe */ #ifndef tahoe diff -r 12e008d41344 -r 697ef44129c6 src/m/targon31.h --- a/src/m/targon31.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/targon31.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -32,6 +37,14 @@ /* #define m68k is defined by the Compiler */ /* #define m68000 */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE double */ diff -r 12e008d41344 -r 697ef44129c6 src/m/tek4300.h --- a/src/m/tek4300.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/tek4300.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="bsd4-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ diff -r 12e008d41344 -r 697ef44129c6 src/m/tekxd88.h --- a/src/m/tekxd88.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/tekxd88.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,6 +22,10 @@ /* Synched up with: FSF 19.31. */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -30,6 +34,17 @@ #define m88000 #endif +/* Define how to take a char and sign-extend into an int. + On machines where char is signed, this is a no-op. */ +#define SIGN_EXTEND_CHAR(c) (c) + +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ +/* #define EXPLICIT_SIGN_EXTEND */ + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE double */ /* No load average on XD88. */ /* Convert that into an integer that is 100 for a load average of 1.0 */ diff -r 12e008d41344 -r 697ef44129c6 src/m/template.h --- a/src/m/template.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/template.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,11 +24,24 @@ operating system this machine is likely to run. USUAL-OPSYS="<name of system .h file here, without the .h>" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -69,6 +82,21 @@ #define NO_REMAP +/* Some really obscure 4.2-based systems (like Sequent DYNIX) + * do not support asynchronous I/O (using SIGIO) on sockets, + * even though it works fine on tty's. If you have one of + * these systems, define the following, and then use it in + * config.h (or elsewhere) to decide when (not) to use SIGIO. + * + * You'd think this would go in an operating-system description file, + * but since it only occurs on some, but not all, BSD systems, the + * reasonable place to select for it is in the machine description + * file. + */ + +#define NO_SOCK_SIGIO + + /* After adding support for a new system, modify the large case statement in the `configure' script to recognize reasonable configuration names, and add a description of the system to diff -r 12e008d41344 -r 697ef44129c6 src/m/tower32.h --- a/src/m/tower32.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/tower32.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,12 +24,25 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO are the ones defined so far. */ #define m68000 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/m/tower32v3.h --- a/src/m/tower32v3.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/tower32v3.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,12 +24,25 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO are the ones defined so far. */ #define m68000 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/m/ustation.h --- a/src/m/ustation.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/ustation.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -32,6 +37,14 @@ #define m68000 mc68000 +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#undef EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff -r 12e008d41344 -r 697ef44129c6 src/m/wicat.h --- a/src/m/wicat.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/wicat.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,11 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#undef WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ @@ -35,6 +40,10 @@ /* This flag is used only in alloca.s. */ #define WICAT +/* XINT must explicitly sign-extend */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #undef LOAD_AVE_TYPE diff -r 12e008d41344 -r 697ef44129c6 src/m/windowsnt.h --- a/src/m/windowsnt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/windowsnt.h Mon Aug 13 11:20:41 2007 +0200 @@ -30,6 +30,11 @@ #define NO_ARG_ARRAY +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -40,6 +45,14 @@ #define NO_UNION_TYPE +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -89,6 +102,20 @@ /* #define NO_REMAP */ +/* Some really obscure 4.2-based systems (like Sequent DYNIX) + * do not support asynchronous I/O (using SIGIO) on sockets, + * even though it works fine on tty's. If you have one of + * these systems, define the following, and then use it in + * config.h (or elsewhere) to decide when (not) to use SIGIO. + * + * You'd think this would go in an operating-system description file, + * but since it only occurs on some, but not all, BSD systems, the + * reasonable place to select for it is in the machine description + * file. + */ + +/* #define NO_SOCK_SIGIO */ + /* After adding support for a new system, modify the large case statement in the `configure' script to recognize reasonable configuration names, and add a description of the system to diff -r 12e008d41344 -r 697ef44129c6 src/m/xps100.h --- a/src/m/xps100.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/m/xps100.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,11 +26,24 @@ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +/* #define WORD_MACHINE */ + /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff -r 12e008d41344 -r 697ef44129c6 src/macros.h --- a/src/macros.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/macros.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_macros_h_ -#define INCLUDED_macros_h_ +#ifndef _XEMACS_MACROS_H_ +#define _XEMACS_MACROS_H_ /* Index of next character to fetch from that macro */ @@ -35,4 +35,4 @@ extern Lisp_Object Vexecuting_macro; -#endif /* INCLUDED_macros_h_ */ +#endif /* _XEMACS_MACROS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/make-src-depend --- a/src/make-src-depend Mon Aug 13 11:19:22 2007 +0200 +++ b/src/make-src-depend Mon Aug 13 11:20:41 2007 +0200 @@ -29,7 +29,8 @@ Usage: $myName Generates Makefile dependencies for the XEmacs src directory. -The dependencies are written to stdout.\n"; +The dependencies are written to stdout. +"; die $usage if @ARGV; @@ -52,11 +53,11 @@ s/[ \t]+//g; # Find include dependencies for (/^\#include([^\n]+)/gm) { - if (m@^\"([A-Za-z0-9._-]+\.h)\"@) { + if (m@^\"([A-Za-z0-9_-]+\.h)\"@) { $uses{$file}{$1} = 1 if exists $exists{$1}; - } elsif (m@<([A-Za-z0-9._-]+\.h)>@) { + } elsif (m@<([A-Za-z0-9_-]+\.h)>@) { $uses{$file}{$1} = 1 if exists $generated_header{$1}; - } elsif (m@\"../lwlib/([A-Za-z0-9._-]+\.h)\"@) { + } elsif (m@\"../lwlib/([A-Za-z0-9_-]+\.h)\"@) { $uses{$file}{"\$(LWLIB_SRCDIR)/lwlib.h"} = 1; } } diff -r 12e008d41344 -r 697ef44129c6 src/malloc.c --- a/src/malloc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/malloc.c Mon Aug 13 11:20:41 2007 +0200 @@ -201,8 +201,10 @@ extern char *start_of_data (void); #ifdef BSD +#ifndef DATA_SEG_BITS #define start_of_data() &etext #endif +#endif #ifndef emacs #define start_of_data() &etext @@ -738,7 +740,7 @@ return v; } int -malloc_mem_used (void) +malloc_mem_used () { int i; int size_used; @@ -757,7 +759,7 @@ } int -malloc_mem_free (void) +malloc_mem_free () { int i; int size_unused; @@ -787,7 +789,7 @@ #ifdef USG static void -get_lim_data (void) +get_lim_data () { #ifdef ULIMIT_BREAK_VALUE lim_data = ULIMIT_BREAK_VALUE; @@ -802,7 +804,7 @@ #ifndef BSD4_2 static void -get_lim_data (void) +get_lim_data () { lim_data = vlimit (LIM_DATA, -1); } @@ -810,7 +812,7 @@ #else /* BSD4_2 */ static void -get_lim_data (void) +get_lim_data () { struct rlimit XXrlimit; diff -r 12e008d41344 -r 697ef44129c6 src/marker.c --- a/src/marker.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/marker.c Mon Aug 13 11:20:41 2007 +0200 @@ -36,9 +36,9 @@ #include "buffer.h" static Lisp_Object -mark_marker (Lisp_Object obj) +mark_marker (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Marker *marker = XMARKER (obj); + struct Lisp_Marker *marker = XMARKER (obj); Lisp_Object buf; /* DO NOT mark through the marker's chain. The buffer's markers chain does not preserve markers from gc; @@ -55,7 +55,7 @@ static void print_marker (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Marker *marker = XMARKER (obj); + struct Lisp_Marker *marker = XMARKER (obj); char buf[200]; if (print_readably) @@ -66,7 +66,7 @@ write_c_string (GETTEXT ("in no buffer"), printcharfun); else { - sprintf (buf, "at %ld in ", (long) marker_position (obj)); + sprintf (buf, "at %d in ", marker_position (obj)); write_c_string (buf, printcharfun); print_internal (marker->buffer->name, printcharfun, 0); } @@ -77,8 +77,8 @@ static int marker_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Marker *marker1 = XMARKER (obj1); - Lisp_Marker *marker2 = XMARKER (obj2); + struct Lisp_Marker *marker1 = XMARKER (obj1); + struct Lisp_Marker *marker2 = XMARKER (obj2); return ((marker1->buffer == marker2->buffer) && (marker1->memind == marker2->memind || @@ -95,17 +95,10 @@ return hash; } -static const struct lrecord_description marker_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Marker, next) }, - { XD_LISP_OBJECT, offsetof (Lisp_Marker, prev) }, - { XD_LISP_OBJECT, offsetof (Lisp_Marker, buffer) }, - { XD_END } -}; - DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker, mark_marker, print_marker, 0, - marker_equal, marker_hash, marker_description, - Lisp_Marker); + marker_equal, marker_hash, + struct Lisp_Marker); /* Operations on markers. */ @@ -142,7 +135,7 @@ static void check_marker_circularities (struct buffer *buf) { - Lisp_Marker *tortoise, *hare; + struct Lisp_Marker *tortoise, *hare; tortoise = BUF_MARKERS (buf); hare = tortoise; @@ -173,7 +166,7 @@ { Bufpos charno; struct buffer *b; - Lisp_Marker *m; + struct Lisp_Marker *m; int point_p; CHECK_MARKER (marker); @@ -289,7 +282,7 @@ void unchain_marker (Lisp_Object m) { - Lisp_Marker *marker = XMARKER (m); + struct Lisp_Marker *marker = XMARKER (m); struct buffer *b = marker->buffer; if (b == 0) @@ -316,7 +309,7 @@ Bytind bi_marker_position (Lisp_Object marker) { - Lisp_Marker *m = XMARKER (marker); + struct Lisp_Marker *m = XMARKER (marker); struct buffer *buf = m->buffer; Bytind pos; @@ -353,7 +346,7 @@ void set_bi_marker_position (Lisp_Object marker, Bytind pos) { - Lisp_Marker *m = XMARKER (marker); + struct Lisp_Marker *m = XMARKER (marker); struct buffer *buf = m->buffer; if (!buf) @@ -460,7 +453,7 @@ */ (position)) { - Lisp_Marker *marker; + struct Lisp_Marker *marker; Memind pos; /* A small optimization trick: convert POS to memind now, rather @@ -489,12 +482,12 @@ int compute_buffer_marker_usage (struct buffer *b, struct overhead_stats *ovstats) { - Lisp_Marker *m; + struct Lisp_Marker *m; int total = 0; int overhead; for (m = BUF_MARKERS (b); m; m = m->next) - total += sizeof (Lisp_Marker); + total += sizeof (struct Lisp_Marker); ovstats->was_requested += total; overhead = fixed_type_block_overhead (total); /* #### claiming this is all malloc overhead is not really right, @@ -509,8 +502,6 @@ void syms_of_marker (void) { - INIT_LRECORD_IMPLEMENTATION (marker); - DEFSUBR (Fmarker_position); DEFSUBR (Fmarker_buffer); DEFSUBR (Fset_marker); @@ -542,7 +533,7 @@ { /* Unchain all markers of this buffer and leave them pointing nowhere. */ - REGISTER Lisp_Marker *m, *next; + REGISTER struct Lisp_Marker *m, *next; for (m = BUF_MARKERS (b); m; m = next) { m->buffer = 0; diff -r 12e008d41344 -r 697ef44129c6 src/md5.c --- a/src/md5.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/md5.c Mon Aug 13 11:20:41 2007 +0200 @@ -29,7 +29,10 @@ #include <sys/types.h> #include <string.h> #include <stdio.h> -#include <limits.h> + +#if defined HAVE_LIMITS_H || _LIBC +# include <limits.h> +#endif /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An @@ -107,7 +110,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; -static void md5_process_block (const void *, size_t, struct md5_ctx *); +static void md5_process_block (CONST void *, size_t, struct md5_ctx *); /* Initialize structure containing state of computation. @@ -130,7 +133,7 @@ IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ static void * -md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) +md5_read_ctx (CONST struct md5_ctx *ctx, void *resbuf) { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); @@ -248,7 +251,7 @@ static void -md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) +md5_process_bytes (CONST void *buffer, size_t len, struct md5_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ @@ -303,7 +306,7 @@ It is assumed that LEN % 64 == 0. */ static void -md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) +md5_process_block (CONST void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; const md5_uint32 *words = (const md5_uint32 *) buffer; @@ -479,7 +482,7 @@ { /* Attempt to autodetect the coding of the string. This is VERY hit-and-miss. */ - eol_type_t eol = EOL_AUTODETECT; + enum eol_type eol = EOL_AUTODETECT; coding_system = Fget_coding_system (Qundecided); determine_real_coding_system (XLSTREAM (istream), &coding_system, &eol); @@ -579,8 +582,8 @@ while (1) { Bufbyte tempbuf[1024]; /* some random amount */ - ssize_t size_in_bytes = - Lstream_read (XLSTREAM (instream), tempbuf, sizeof (tempbuf)); + int size_in_bytes = Lstream_read (XLSTREAM (instream), + tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; diff -r 12e008d41344 -r 697ef44129c6 src/mem-limits.h --- a/src/mem-limits.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mem-limits.h Mon Aug 13 11:20:41 2007 +0200 @@ -27,8 +27,8 @@ getrlimit() should be preferred to ulimit(). On Linux, ulimit() is deprecated and always returns -1. */ -#ifndef INCLUDED_mem_limits_h_ -#define INCLUDED_mem_limits_h_ +#ifndef _XEMACS_MEM_LIMITS_H_ +#define _XEMACS_MEM_LIMITS_H_ #ifdef HAVE_CONFIG_H #include <config.h> @@ -38,6 +38,10 @@ #include <ulimit.h> #endif +#ifdef MSDOS +#include <dpmi.h> +#endif + /* Some systems need this before <sys/resource.h>. */ #include <sys/types.h> @@ -66,14 +70,16 @@ #ifndef BSD4_2 #ifndef USG -#ifndef WIN32_NATIVE -#ifndef CYGWIN +#ifndef MSDOS +#ifndef WINDOWSNT +#ifndef __CYGWIN32__ #if defined(__linux__) && defined(powerpc) /*Added Kaoru Fukui*/ #else /*Added Kaoru Fukui*/ #include <sys/vlimit.h> #endif /*Added by Fukui*/ -#endif /* not CYGWIN */ -#endif /* not WIN32_NATIVE */ +#endif /* not __CYGWIN32__ */ +#endif /* not WINDOWSNT */ +#endif /* not MSDOS */ #endif /* not USG */ #else /* if BSD4_2 */ #include <sys/time.h> @@ -90,7 +96,7 @@ typedef char *POINTER; #endif -#ifndef CYGWIN +#ifndef __CYGWIN32__ typedef unsigned long SIZE; #endif @@ -98,9 +104,11 @@ #define EXCEEDS_LISP_PTR(ptr) 0 #ifdef BSD +#ifndef DATA_SEG_BITS extern int etext; #define start_of_data() &etext #endif +#endif #else /* not emacs */ extern char etext; @@ -117,7 +125,7 @@ /* Number of bytes of writable memory we can expect to be able to get */ extern unsigned int lim_data; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#ifdef HEAP_IN_DATA extern unsigned long static_heap_size; extern int initialized; static void @@ -163,7 +171,7 @@ } #else /* not USG */ -#if defined( WIN32_NATIVE ) +#if defined( WINDOWSNT ) static void get_lim_data (void) @@ -175,11 +183,22 @@ #else #if !defined (BSD4_2) && !defined (__osf__) +#ifdef MSDOS +void +get_lim_data (void) +{ + _go32_dpmi_meminfo info; + + _go32_dpmi_get_free_memory_information (&info); + lim_data = info.available_memory; +} +#else /* not MSDOS */ static void get_lim_data (void) { lim_data = vlimit (LIM_DATA, -1); } +#endif /* not MSDOS */ #else /* BSD4_2 */ @@ -196,9 +215,9 @@ #endif } #endif /* BSD4_2 */ -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ #endif /* not USG */ #endif /* not NO_LIM_DATA */ #endif /* not HEAP_IN_DATA */ -#endif /* INCLUDED_mem_limits_h_ */ +#endif /* _XEMACS_MEM_LIMITS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/menubar-msw.c --- a/src/menubar-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/menubar-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,8 +1,7 @@ /* Implements an elisp-programmable menubar -- Win32 Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 1997 Kirill M. Katsnelson <kkm@kis.ru>. - Copyright (C) 2000 Ben Wing. + Copyright (C) 1997 Kirill M. Katsnelson <kkm@kis.ru> This file is part of XEmacs. @@ -71,13 +70,14 @@ * particular knowledge is bad because this may break in Windows NT * 5.0, or Windows 98, or other future version. Instead, I allow the * hash tables to hang around, and not clear them, unless WM_COMMAND is - * received. This is worth some memory but more safe. Hacks welcome, + * received. This is worthy some memory but more safe. Hacks welcome, * anyways! * */ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "commands.h" @@ -93,7 +93,7 @@ #include "window.h" /* #### */ -#define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH 0 +#define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH 0 #define EMPTY_ITEM_ID ((UINT)LISP_TO_VOID (Qunbound)) #define EMPTY_ITEM_NAME "(empty)" @@ -116,109 +116,56 @@ #define MENU_ITEM_ID_BITS(x) (((x) & 0x7FFF) | 0x8000) static HMENU top_level_menu; -/* Translate (in place) %_ to &, %% to %. - Return new length, and (through accel) the accelerator character. - (If there is no accelerator, it will be added on the first character.) - len = number of bytes (not including zero terminator). - maxlen = size of buffer. - We assume and maintain zero-termination. To be absolutely sure - of not hitting an error, maxlen should be >= 2*len + 3. */ - -Bytecount -mswindows_translate_menu_or_dialog_item (Bufbyte *item, Bytecount len, - Bytecount maxlen, Emchar *accel, - Lisp_Object error_name) -{ - Bufbyte *ptr; - - *accel = '\0'; - - /* Escape '&' as '&&' */ - - ptr = item; - while ((ptr = (Bufbyte *) memchr (ptr, '&', len - (ptr - item))) != NULL) - { - if (len + 2 > maxlen) - signal_simple_error ("Menu item produces too long displayable string", - error_name); - memmove (ptr + 1, ptr, (len - (ptr - item)) + 1); - len++; - ptr += 2; - } - - /* Replace XEmacs accelerator '%_' with Windows accelerator '&' - and `%%' with `%'. */ - ptr = item; - while ((ptr = memchr (ptr, '%', len - (ptr - item))) != NULL) - { - if (*(ptr + 1) == '_') - { - *ptr = '&'; - if (!*accel) - /* #### urk ! We need a reference translation table for - case changes that aren't buffer-specific. */ - *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 2)); - memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1); - len--; - } - else if (*(ptr + 1) == '%') - { - memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1); - len--; - } - ptr++; - } - - if (!*accel) - { - if (len + 2 > maxlen) - signal_simple_error ("Menu item produces too long displayable string", - error_name); - ptr = item; - memmove (ptr + 1, ptr, len + 1); - /* #### urk ! We need a reference translation table for - case changes that aren't buffer-specific. */ - *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 1)); - *ptr = '&'; - - len++; - } - - return len; -} +#define MAX_MENUITEM_LENGTH 128 /* * This returns Windows-style menu item string: * "Left Flush\tRight Flush" */ - -/* #### This is junk. Need correct handling of sizes. Use a Bufbyte_dynarr, - not a static buffer. */ static char* -displayable_menu_item (Lisp_Object gui_item, int bar_p, Emchar *accel) +displayable_menu_item (struct gui_item* pgui_item, int bar_p) { - unsigned int ll; - /* We construct the name in a static buffer. That's fine, because menu items longer than 128 chars are probably programming errors, and better be caught than displayed! */ static char buf[MAX_MENUITEM_LENGTH+2]; + char *ptr; + unsigned int ll, lr; /* Left flush part of the string */ - ll = gui_item_display_flush_left (gui_item, buf, MAX_MENUITEM_LENGTH); + ll = gui_item_display_flush_left (pgui_item, buf, MAX_MENUITEM_LENGTH); - ll = mswindows_translate_menu_or_dialog_item ((Bufbyte *) buf, ll, - MAX_MENUITEM_LENGTH, accel, - XGUI_ITEM (gui_item)->name); + /* Escape '&' as '&&' */ + ptr = buf; + while ((ptr=memchr (ptr, '&', ll-(ptr-buf))) != NULL) + { + if (ll+2 >= MAX_MENUITEM_LENGTH) + signal_simple_error ("Menu item produces too long displayable string", + pgui_item->name); + memmove (ptr+1, ptr, (ll-(ptr-buf))+1); + ll++; + ptr+=2; + } + + /* Replace XEmacs accelerator '%_' with Windows accelerator '&' */ + ptr = buf; + while ((ptr=memchr (ptr, '%', ll-(ptr-buf))) != NULL) + { + if (*(ptr+1) == '_') + { + *ptr = '&'; + memmove (ptr+1, ptr+2, ll-(ptr-buf+2)); + ll--; + } + ptr++; + } /* Right flush part, unless we're at the top-level where it's not allowed */ if (!bar_p) { - unsigned int lr; - assert (MAX_MENUITEM_LENGTH > ll + 1); - lr = gui_item_display_flush_right (gui_item, buf + ll + 1, + lr = gui_item_display_flush_right (pgui_item, buf + ll + 1, MAX_MENUITEM_LENGTH - ll - 1); if (lr) buf [ll] = '\t'; @@ -306,7 +253,6 @@ static void populate_menu_add_item (HMENU menu, Lisp_Object path, Lisp_Object hash_tab, Lisp_Object item, - Lisp_Object *accel_list, int flush_right, int bar_p) { MENUITEMINFO item_info; @@ -333,82 +279,72 @@ { /* Submenu */ HMENU submenu; - Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); - struct gcpro gcpro1, gcpro2, gcpro3; - Emchar accel; + struct gui_item gui_item; + struct gcpro gcpro1; - GCPRO3 (gui_item, path, *accel_list); + gui_item_init (&gui_item); + GCPRO_GUI_ITEM (&gui_item); - menu_parse_submenu_keywords (item, gui_item); + menu_parse_submenu_keywords (item, &gui_item); - if (!STRINGP (pgui_item->name)) - signal_simple_error ("Menu name (first element) must be a string", - item); + if (!STRINGP (gui_item.name)) + signal_simple_error ("Menu name (first element) must be a string", item); - if (!gui_item_included_p (gui_item, Vmenubar_configuration)) - { - UNGCPRO; - goto done; - } + if (!gui_item_included_p (&gui_item, Vmenubar_configuration)) + return; - if (!gui_item_active_p (gui_item)) + if (!gui_item_active_p (&gui_item)) item_info.fState = MFS_GRAYED; /* Temptation is to put 'else' right here. Although, the displayed item won't have an arrow indicating that it is a popup. So we go ahead a little bit more and create a popup */ - submenu = create_empty_popup_menu (); + submenu = create_empty_popup_menu(); item_info.fMask |= MIIM_SUBMENU; - item_info.dwTypeData = displayable_menu_item (gui_item, bar_p, &accel); + item_info.dwTypeData = displayable_menu_item (&gui_item, bar_p); item_info.hSubMenu = submenu; - if (accel && bar_p) - *accel_list = Fcons (make_char (accel), *accel_list); - if (!(item_info.fState & MFS_GRAYED)) { /* Now add the full submenu path as a value to the hash table, keyed by menu handle */ if (NILP(path)) - path = list1 (pgui_item->name); + /* list1 cannot GC */ + path = list1 (gui_item.name); else { Lisp_Object arg[2]; arg[0] = path; - arg[1] = list1 (pgui_item->name); + arg[1] = list1 (gui_item.name); + /* Fappend gcpro'es its arg */ path = Fappend (2, arg); } + /* Fputhash GCPRO'es PATH */ Fputhash (hmenu_to_lisp_object (submenu), path, hash_tab); } - UNGCPRO; + UNGCPRO; /* gui_item */ } else if (VECTORP (item)) { /* An ordinary item */ Lisp_Object style, id; - Lisp_Object gui_item = gui_parse_item_keywords (item); - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); - struct gcpro gcpro1, gcpro2; - Emchar accel; + struct gui_item gui_item; + struct gcpro gcpro1; - GCPRO2 (gui_item, *accel_list); + gui_item_init (&gui_item); + GCPRO_GUI_ITEM (&gui_item); - if (!gui_item_included_p (gui_item, Vmenubar_configuration)) - { - UNGCPRO; - goto done; - } + gui_parse_item_keywords (item, &gui_item); - if (!STRINGP (pgui_item->name)) - pgui_item->name = Feval (pgui_item->name); + if (!gui_item_included_p (&gui_item, Vmenubar_configuration)) + return; - if (!gui_item_active_p (gui_item)) + if (!gui_item_active_p (&gui_item)) item_info.fState = MFS_GRAYED; - style = (NILP (pgui_item->selected) || NILP (Feval (pgui_item->selected)) - ? Qnil : pgui_item->style); + style = (NILP (gui_item.selected) || NILP (Feval (gui_item.selected)) + ? Qnil : gui_item.style); if (EQ (style, Qradio)) { @@ -420,18 +356,15 @@ item_info.fState |= MFS_CHECKED; } - id = allocate_menu_item_id (path, pgui_item->name, - pgui_item->suffix); - Fputhash (id, pgui_item->callback, hash_tab); + id = allocate_menu_item_id (path, gui_item.name, + gui_item.suffix); + Fputhash (id, gui_item.callback, hash_tab); - item_info.wID = (UINT) XINT (id); + item_info.wID = (UINT) XINT(id); item_info.fType |= MFT_STRING; - item_info.dwTypeData = displayable_menu_item (gui_item, bar_p, &accel); + item_info.dwTypeData = displayable_menu_item (&gui_item, bar_p); - if (accel && bar_p) - *accel_list = Fcons (make_char (accel), *accel_list); - - UNGCPRO; + UNGCPRO; /* gui_item */ } else { @@ -442,8 +375,6 @@ item_info.fType |= MFT_RIGHTJUSTIFY; InsertMenuItem (menu, UINT_MAX, TRUE, &item_info); - -done:; } /* @@ -463,18 +394,17 @@ { Lisp_Object item_desc; int deep_p, flush_right; - struct gcpro gcpro1, gcpro2, gcpro3; + struct gcpro gcpro1; unsigned long checksum; - Lisp_Object gui_item = allocate_gui_item (); - Lisp_Object accel_list = Qnil; - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); + struct gui_item gui_item; - GCPRO3 (gui_item, accel_list, desc); + gui_item_init (&gui_item); + GCPRO_GUI_ITEM (&gui_item); /* We are sometimes called with the menubar unchanged, and with changed right flush. We have to update the menubar in this case, so account for the compliance setting in the hash value */ - checksum = REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH; + checksum = REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH; /* Will initially contain only "(empty)" */ if (populate_p) @@ -484,15 +414,15 @@ deep_p = !NILP (path); /* Fetch keywords prepending the item list */ - desc = menu_parse_submenu_keywords (desc, gui_item); + desc = menu_parse_submenu_keywords (desc, &gui_item); /* Check that menu name is specified when expected */ - if (NILP (pgui_item->name) && deep_p) + if (NILP (gui_item.name) && deep_p) signal_simple_error ("Menu must have a name", desc); /* Apply filter if specified */ - if (!NILP (pgui_item->filter)) - desc = call1 (pgui_item->filter, desc); + if (!NILP (gui_item.filter)) + desc = call1 (gui_item.filter, desc); /* Loop thru the desc's CDR and add items for each entry */ flush_right = 0; @@ -501,15 +431,14 @@ if (NILP (XCAR (item_desc))) { /* Do not flush right menubar items when MS style compliant */ - if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH) + if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH) flush_right = 1; if (!populate_p) checksum = HASH2 (checksum, LISP_HASH (Qnil)); } else if (populate_p) populate_menu_add_item (menu, path, hash_tab, - XCAR (item_desc), &accel_list, - flush_right, bar_p); + XCAR (item_desc), flush_right, bar_p); else checksum = HASH2 (checksum, checksum_menu_item (XCAR (item_desc))); @@ -523,27 +452,23 @@ /* Add the header to the popup, if told so. The same as in X - an insensitive item, and a separator (Seems to me, there were - two separators in X... In Windows this looks ugly, anyways.) */ - if (!bar_p && !deep_p && popup_menu_titles && !NILP (pgui_item->name)) + two separators in X... In Windows this looks ugly, anyways. */ + if (!bar_p && !deep_p && popup_menu_titles && !NILP(gui_item.name)) { - CHECK_STRING (pgui_item->name); + CHECK_STRING (gui_item.name); InsertMenu (menu, 0, MF_BYPOSITION | MF_STRING | MF_DISABLED, - 0, XSTRING_DATA(pgui_item->name)); + 0, XSTRING_DATA(gui_item.name)); InsertMenu (menu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL); SetMenuDefaultItem (menu, 0, MF_BYPOSITION); } } - - if (bar_p) - Fputhash (Qt, accel_list, hash_tab); - - UNGCPRO; + UNGCPRO; /* gui_item */ return checksum; } static void populate_menu (HMENU menu, Lisp_Object path, Lisp_Object desc, - Lisp_Object hash_tab, int bar_p) + Lisp_Object hash_tab, int bar_p) { populate_or_checksum_helper (menu, path, desc, hash_tab, bar_p, 1); } @@ -555,28 +480,23 @@ } static void -update_frame_menubar_maybe (struct frame *f) +update_frame_menubar_maybe (struct frame* f) { HMENU menubar = GetMenu (FRAME_MSWINDOWS_HANDLE (f)); struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); Lisp_Object desc = (!NILP (w->menubar_visible_p) ? symbol_value_in_buffer (Qcurrent_menubar, w->buffer) : Qnil); - struct gcpro gcpro1; - - GCPRO1 (desc); /* it's safest to do this, just in case some filter - or something changes the value of current-menubar */ top_level_menu = menubar; if (NILP (desc) && menubar != NULL) { /* Menubar has gone */ - FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = Qnil; + FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil; SetMenu (FRAME_MSWINDOWS_HANDLE (f), NULL); DestroyMenu (menubar); DrawMenuBar (FRAME_MSWINDOWS_HANDLE (f)); - UNGCPRO; return; } @@ -590,35 +510,29 @@ if (NILP (desc)) { /* We did not have the bar and are not going to */ - UNGCPRO; return; } /* Now we bail out if the menubar has not changed */ - if (FRAME_MSWINDOWS_MENU_CHECKSUM (f) == checksum_menu (desc)) - { - UNGCPRO; - return; - } + if (FRAME_MSWINDOWS_MENU_CHECKSUM(f) == checksum_menu (desc)) + return; populate: /* Come with empty hash table */ - if (NILP (FRAME_MSWINDOWS_MENU_HASH_TABLE (f))) - FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = + if (NILP (FRAME_MSWINDOWS_MENU_HASH_TABLE(f))) + FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); else - Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); + Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); Fputhash (hmenu_to_lisp_object (menubar), Qnil, - FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); + FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); populate_menu (menubar, Qnil, desc, - FRAME_MSWINDOWS_MENU_HASH_TABLE (f), 1); + FRAME_MSWINDOWS_MENU_HASH_TABLE(f), 1); SetMenu (FRAME_MSWINDOWS_HANDLE (f), menubar); DrawMenuBar (FRAME_MSWINDOWS_HANDLE (f)); - FRAME_MSWINDOWS_MENU_CHECKSUM (f) = checksum_menu (desc); - - UNGCPRO; + FRAME_MSWINDOWS_MENU_CHECKSUM(f) = checksum_menu (desc); } static void @@ -626,8 +540,6 @@ { HMENU menubar = GetMenu (FRAME_MSWINDOWS_HANDLE (f)); Lisp_Object desc = current_frame_menubar (f); - struct gcpro gcpro1; - if (menubar == NULL) return; @@ -635,22 +547,20 @@ triggers. To resolve, we must prevent filters explicitly from mangling with the active menu. In apply_filter probably? Is copy-tree on the whole menu too expensive? */ - if (NILP (desc)) + if (NILP(desc)) /* abort(); */ return; - GCPRO1 (desc); /* just to be safe -- see above */ /* We do the trick by removing all items and re-populating top level */ empty_menu (menubar, 0); - assert (HASH_TABLEP (FRAME_MSWINDOWS_MENU_HASH_TABLE (f))); - Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); + assert (HASH_TABLEP (FRAME_MSWINDOWS_MENU_HASH_TABLE(f))); + Fclrhash (FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); Fputhash (hmenu_to_lisp_object (menubar), Qnil, - FRAME_MSWINDOWS_MENU_HASH_TABLE (f)); + FRAME_MSWINDOWS_MENU_HASH_TABLE(f)); populate_menu (menubar, Qnil, desc, - FRAME_MSWINDOWS_MENU_HASH_TABLE (f), 1); - UNGCPRO; + FRAME_MSWINDOWS_MENU_HASH_TABLE(f), 1); } /* @@ -665,24 +575,13 @@ current_hash_table = Qnil; prune_menubar (f); } - -int -mswindows_char_is_accelerator (struct frame *f, Emchar ch) -{ - Lisp_Object hash = FRAME_MSWINDOWS_MENU_HASH_TABLE (f); - - assert (HASH_TABLEP (hash)); - /* !!#### not Mule-ized */ - return !NILP (memq_no_quit (make_char (tolower (ch)), - Fgethash (Qt, hash, Qnil))); -} /*------------------------------------------------------------------------*/ /* Message handlers */ /*------------------------------------------------------------------------*/ static Lisp_Object -unsafe_handle_wm_initmenupopup_1 (HMENU menu, struct frame *f) +unsafe_handle_wm_initmenupopup_1 (HMENU menu, struct frame* f) { /* This function can call lisp, beat dogs and stick chewing gum to everything! */ @@ -714,7 +613,7 @@ } static Lisp_Object -unsafe_handle_wm_initmenu_1 (struct frame *f) +unsafe_handle_wm_initmenu_1 (struct frame* f) { /* This function can call lisp */ @@ -731,7 +630,7 @@ update_frame_menubar_maybe (f); current_menudesc = current_frame_menubar (f); - current_hash_table = FRAME_MSWINDOWS_MENU_HASH_TABLE (f); + current_hash_table = FRAME_MSWINDOWS_MENU_HASH_TABLE(f); assert (HASH_TABLEP (current_hash_table)); return Qt; @@ -744,7 +643,7 @@ * command if we return nil */ Lisp_Object -mswindows_handle_wm_command (struct frame *f, WORD id) +mswindows_handle_wm_command (struct frame* f, WORD id) { /* Try to map the command id through the proper hash table */ Lisp_Object data, fn, arg, frame; @@ -786,7 +685,7 @@ /*------------------------------------------------------------------------*/ static HMENU wm_initmenu_menu; -static struct frame *wm_initmenu_frame; +static struct frame* wm_initmenu_frame; static Lisp_Object unsafe_handle_wm_initmenupopup (Lisp_Object u_n_u_s_e_d) @@ -801,7 +700,7 @@ } Lisp_Object -mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm) +mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame* frm) { /* We cannot pass hmenu as a lisp object. Use static var */ wm_initmenu_menu = hmenu; @@ -810,10 +709,10 @@ } Lisp_Object -mswindows_handle_wm_initmenu (HMENU hmenu, struct frame *f) +mswindows_handle_wm_initmenu (HMENU hmenu, struct frame* f) { /* Handle only frame menubar, ignore if from popup or system menu */ - if (GetMenu (FRAME_MSWINDOWS_HANDLE (f)) == hmenu) + if (GetMenu (FRAME_MSWINDOWS_HANDLE(f)) == hmenu) { wm_initmenu_frame = f; return mswindows_protect_modal_loop (unsafe_handle_wm_initmenu, Qnil); @@ -827,28 +726,25 @@ /*------------------------------------------------------------------------*/ static void -mswindows_update_frame_menubars (struct frame *f) +mswindows_update_frame_menubars (struct frame* f) { update_frame_menubar_maybe (f); } static void -mswindows_free_frame_menubars (struct frame *f) +mswindows_free_frame_menubars (struct frame* f) { - FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = Qnil; + FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil; } static void mswindows_popup_menu (Lisp_Object menu_desc, Lisp_Object event) { struct frame *f = selected_frame (); - Lisp_Event *eev = NULL; + struct Lisp_Event *eev = NULL; HMENU menu; POINT pt; int ok; - struct gcpro gcpro1; - - GCPRO1 (menu_desc); /* to be safe -- see above */ if (!NILP (event)) { @@ -886,7 +782,7 @@ current_menudesc = menu_desc; current_hash_table = make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); - menu = create_empty_popup_menu (); + menu = create_empty_popup_menu(); Fputhash (hmenu_to_lisp_object (menu), Qnil, current_hash_table); top_level_menu = menu; @@ -905,13 +801,11 @@ mswindows_unmodalize_signal_maybe (); /* This is probably the only real reason for failure */ - if (!ok) - { - menu_cleanup (f); - signal_simple_error ("Cannot track popup menu while in menu", - menu_desc); - } - UNGCPRO; + if (!ok) { + menu_cleanup (f); + signal_simple_error ("Cannot track popup menu while in menu", + menu_desc); + } } diff -r 12e008d41344 -r 697ef44129c6 src/menubar-msw.h --- a/src/menubar-msw.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/menubar-msw.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,8 +26,8 @@ Initially written by kkm 12/24/97, */ -#ifndef INCLUDED_menubar_msw_h_ -#define INCLUDED_menubar_msw_h_ +#ifndef _XEMACS_MENUBAR_MSW_H_ +#define _XEMACS_MENUBAR_MSW_H_ #ifdef HAVE_MENUBARS @@ -39,5 +39,5 @@ #endif /* HAVE_MENUBARS */ -#endif /* INCLUDED_menubar_msw_h_ */ +#endif /* _XEMACS_MENUBAR_MSW_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/menubar-x.c --- a/src/menubar-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/menubar-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -21,14 +21,7 @@ /* Synched up with: Not in FSF. */ -/* Authorship: - - Created 16-dec-91 by Jamie Zawinski. - Menu filters and many other keywords added by Stig for 19.12. - Original device-abstraction work and GC cleanup work by Ben Wing for 19.13. - Menu accelerators c. 1997? by ??. Moved here from event-stream.c. - Other work post-1996 by ??. -*/ +/* created 16-dec-91 by jwz */ #include <config.h> #include "lisp.h" @@ -36,15 +29,12 @@ #include "console-x.h" #include "EmacsFrame.h" #include "gui-x.h" -#include "../lwlib/lwlib.h" #include "buffer.h" #include "commands.h" /* zmacs_regions */ +#include "gui.h" #include "events.h" #include "frame.h" -#include "gui.h" -#include "keymap.h" -#include "menubar.h" #include "opaque.h" #include "window.h" @@ -104,11 +94,14 @@ prohibits GC. */ /* !!#### This function has not been Mule-ized */ int menubar_root_p = (menu_type == MENUBAR_TYPE && depth == 0); + widget_value *wv; + Lisp_Object wv_closure; int count = specpdl_depth (); int partition_seen = 0; - widget_value *wv = xmalloc_widget_value (); - Lisp_Object wv_closure = make_opaque_ptr (wv); + wv = xmalloc_widget_value (); + + wv_closure = make_opaque_ptr (wv); record_unwind_protect (widget_value_unwind, wv_closure); if (STRINGP (desc)) @@ -127,7 +120,7 @@ } else { - wv->name = xstrdup (string_chars); + wv->name = string_chars; wv->enabled = 1; /* dverna Dec. 98: command_builder_operate_menu_accelerator will manipulate the accel as a Lisp_Object if the widget has a name. @@ -138,11 +131,9 @@ } else if (VECTORP (desc)) { - Lisp_Object gui_item = gui_parse_item_keywords (desc); - if (!button_item_to_widget_value (Qmenubar, - gui_item, wv, 1, + if (!button_item_to_widget_value (desc, wv, 1, (menu_type == MENUBAR_TYPE - && depth <= 1), 1)) + && depth <= 1))) { /* :included form was nil */ wv = NULL; @@ -165,9 +156,8 @@ wv->type = CASCADE_TYPE; wv->enabled = 1; wv->name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc))); - wv->name = strdup_and_add_accel (wv->name); - accel = gui_name_accelerator (LISP_GETTEXT (XCAR (desc))); + accel = menu_name_to_accelerator (wv->name); wv->accel = LISP_TO_VOID (accel); desc = Fcdr (desc); @@ -235,7 +225,6 @@ incr_wv->type = INCREMENTAL_TYPE; incr_wv->enabled = 1; incr_wv->name = wv->name; - incr_wv->name = xstrdup (wv->name); /* This is automatically GC protected through the call to lw_map_widget_values(); no need to worry. */ @@ -252,7 +241,7 @@ widget_value *title_wv = xmalloc_widget_value (); widget_value *sep_wv = xmalloc_widget_value (); title_wv->type = TEXT_TYPE; - title_wv->name = xstrdup (wv->name); + title_wv->name = wv->name; title_wv->enabled = 1; title_wv->next = sep_wv; sep_wv->type = SEPARATOR_TYPE; @@ -268,7 +257,7 @@ widget_value *dummy; /* Add a fake entry so the menus show up */ wv->contents = dummy = xmalloc_widget_value (); - dummy->name = xstrdup ("(inactive)"); + dummy->name = "(inactive)"; dummy->accel = LISP_TO_VOID (Qnil); dummy->enabled = 0; dummy->selected = 0; @@ -278,12 +267,12 @@ dummy->next = NULL; goto menu_item_done; - } + } } else if (menubar_root_p) { - wv->name = xstrdup ("menubar"); + wv->name = (char *) "menubar"; wv->type = CASCADE_TYPE; /* Well, nothing else seems to fit and this is ignored anyway... */ } @@ -303,7 +292,7 @@ { if (partition_seen) error ( - "More than one partition (nil) in menubar description"); + "More than one partition (nil) in menubar description"); partition_seen = 1; next = xmalloc_widget_value (); next->type = PUSHRIGHT_TYPE; @@ -330,7 +319,7 @@ else signal_simple_error ("Unrecognized menu descriptor", desc); - menu_item_done: +menu_item_done: if (wv) { @@ -347,7 +336,7 @@ static widget_value * menu_item_descriptor_to_widget_value (Lisp_Object desc, int menu_type, /* if this is a menubar, - popup or sub menu */ + popup or sub menu */ int deep_p, /* */ int filter_p) /* if :filter forms should run now */ @@ -371,8 +360,8 @@ static Lisp_Object restore_in_menu_callback (Lisp_Object val) { - in_menu_callback = XINT (val); - return Qnil; + in_menu_callback = XINT(val); + return Qnil; } #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */ @@ -479,7 +468,7 @@ wv->accel = LISP_TO_VOID (Qnil); wv->contents = xmalloc_widget_value (); wv->contents->type = TEXT_TYPE; - wv->contents->name = xstrdup ("No menu"); + wv->contents->name = (char *) "No menu"; wv->contents->next = NULL; wv->contents->accel = LISP_TO_VOID (Qnil); } @@ -522,21 +511,24 @@ static widget_value * compute_menubar_data (struct frame *f, Lisp_Object menubar, int deep_p) { + widget_value *data; + if (NILP (menubar)) - return 0; + data = 0; else { - widget_value *data; + Lisp_Object old_buffer; int count = specpdl_depth (); - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - Fset_buffer (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer); + old_buffer = Fcurrent_buffer (); + record_unwind_protect (Fset_buffer, old_buffer); + Fset_buffer ( XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer); data = menu_item_descriptor_to_widget_value (menubar, MENUBAR_TYPE, deep_p, 0); + Fset_buffer (old_buffer); unbind_to (count, Qnil); - - return data; } + return data; } static int @@ -546,7 +538,7 @@ Lisp_Object menubar; int menubar_visible; long id; - /* As with the toolbar, the minibuffer does not have its own menubar. */ + /* As for the toolbar, the minibuffer does not have its own menubar. */ struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); if (! FRAME_X_P (f)) @@ -667,7 +659,9 @@ static void -make_dummy_xbutton_event (XEvent *dummy, Widget daddy, Lisp_Event *eev) +make_dummy_xbutton_event (XEvent *dummy, + Widget daddy, + struct Lisp_Event *eev) /* NULL for eev means query pointer */ { XButtonPressedEvent *btn = (XButtonPressedEvent *) dummy; @@ -680,6 +674,7 @@ if (eev) { Position shellx, shelly, framex, framey; + Widget shell = XtParent (daddy); Arg al [2]; btn->time = eev->timestamp; btn->button = eev->event.button.button; @@ -687,16 +682,9 @@ btn->subwindow = (Window) NULL; btn->x = eev->event.button.x; btn->y = eev->event.button.y; - shellx = shelly = 0; -#ifndef HAVE_WMCOMMAND - { - Widget shell = XtParent (daddy); - - XtSetArg (al [0], XtNx, &shellx); - XtSetArg (al [1], XtNy, &shelly); - XtGetValues (shell, al, 2); - } -#endif + XtSetArg (al [0], XtNx, &shellx); + XtSetArg (al [1], XtNy, &shelly); + XtGetValues (shell, al, 2); XtSetArg (al [0], XtNx, &framex); XtSetArg (al [1], XtNy, &framey); XtGetValues (daddy, al, 2); @@ -786,7 +774,7 @@ widget_value *data; Widget parent; Widget menu; - Lisp_Event *eev = NULL; + struct Lisp_Event *eev = NULL; XEvent xev; Lisp_Object frame; @@ -841,7 +829,7 @@ them. We don't want the *first* command event to alter the state of the region, so that the region can be available as an argument for the second command. - */ + */ if (zmacs_regions) zmacs_region_stays = 1; @@ -852,516 +840,9 @@ } - -#if 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); - } -} - -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); -} - -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; -} - -int -x_kludge_lw_menu_active (void) -{ - return lw_menu_active; -} - -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 /* LWLIB_MENUBARS_LUCID */ - - void syms_of_menubar_x (void) { -#if defined(LWLIB_MENUBARS_LUCID) - DEFSUBR (Faccelerate_menu); -#endif } void @@ -1373,15 +854,9 @@ } void -reinit_vars_of_menubar_x (void) +vars_of_menubar_x (void) { last_popup_menu_selection_callback_id = (LWLIB_ID) -1; -} - -void -vars_of_menubar_x (void) -{ - reinit_vars_of_menubar_x (); #if defined (LWLIB_MENUBARS_LUCID) Fprovide (intern ("lucid-menubars")); diff -r 12e008d41344 -r 697ef44129c6 src/menubar.c --- a/src/menubar.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/menubar.c Mon Aug 13 11:20:41 2007 +0200 @@ -21,13 +21,8 @@ /* Synched up with: Not in FSF. */ -/* Authorship: - - Created by Ben Wing as part of device-abstraction work for 19.12. - Menu filters and many other keywords added by Stig for 19.12. - Menu accelerators c. 1997? by ??. Moved here from event-stream.c. - Much other work post-1996 by ??. -*/ +/* #### There ain't much here because menubars have not been + properly abstracted yet. */ #include <config.h> #include "lisp.h" @@ -36,7 +31,6 @@ #include "device.h" #include "frame.h" #include "gui.h" -#include "keymap.h" #include "menubar.h" #include "redisplay.h" #include "window.h" @@ -60,30 +54,6 @@ Lisp_Object Vmenubar_pointer_glyph; -/* 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; - static int menubar_variable_changed (Lisp_Object sym, Lisp_Object *val, Lisp_Object in_object, int flags) @@ -125,17 +95,15 @@ } Lisp_Object -current_frame_menubar (const struct frame* f) +current_frame_menubar (CONST struct frame* f) { struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); return symbol_value_in_buffer (Qcurrent_menubar, w->buffer); } Lisp_Object -menu_parse_submenu_keywords (Lisp_Object desc, Lisp_Object gui_item) +menu_parse_submenu_keywords (Lisp_Object desc, struct gui_item* pgui_item) { - Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item); - /* Menu descriptor should be a list */ CHECK_CONS (desc); @@ -162,7 +130,7 @@ desc = XCDR (desc); if (!NILP (desc)) CHECK_CONS (desc); - gui_item_add_keyval_pair (gui_item, key, val, ERROR_ME); + gui_item_add_keyval_pair (pgui_item, key, val, ERROR_ME); } /* Return the rest - supposed to be a list of items */ @@ -183,11 +151,11 @@ (desc, path)) { Lisp_Object path_entry, submenu_desc, submenu; - struct gcpro gcpro1, gcpro2; - Lisp_Object gui_item = allocate_gui_item (); - Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); + struct gcpro gcpro1; + struct gui_item gui_item; - GCPRO2 (gui_item, desc); + gui_item_init (&gui_item); + GCPRO_GUI_ITEM (&gui_item); EXTERNAL_LIST_LOOP (path_entry, path) { @@ -196,15 +164,15 @@ RETURN_UNGCPRO (Qnil); /* Parse this menu */ - desc = menu_parse_submenu_keywords (desc, gui_item); + desc = menu_parse_submenu_keywords (desc, &gui_item); /* Check that this (sub)menu is active */ - if (!gui_item_active_p (gui_item)) + if (!gui_item_active_p (&gui_item)) RETURN_UNGCPRO (Qnil); /* Apply :filter */ - if (!NILP (pgui_item->filter)) - desc = call1 (pgui_item->filter, desc); + if (!NILP (gui_item.filter)) + desc = call1 (gui_item.filter, desc); /* Find the next menu on the path inside this one */ EXTERNAL_LIST_LOOP (submenu_desc, desc) @@ -223,7 +191,7 @@ descend: /* Prepare for the next iteration */ - gui_item_init (gui_item); + gui_item_init (&gui_item); } /* We have successfully descended down the end of the path */ @@ -322,12 +290,11 @@ DEFUN ("normalize-menu-item-name", Fnormalize_menu_item_name, 1, 2, 0, /* Convert a menu item name string into normal form, and return the new string. Menu item names should be converted to normal form before being compared. -This removes %_'s (accelerator indications) and converts %% to %. */ (name, buffer)) { struct buffer *buf = decode_buffer (buffer, 0); - Lisp_String *n; + struct Lisp_String *n; Charcount end; int i; Bufbyte *name_data; @@ -378,18 +345,6 @@ syms_of_menubar (void) { defsymbol (&Qcurrent_menubar, "current-menubar"); - - 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"); - DEFSUBR (Fpopup_menu); DEFSUBR (Fnormalize_menu_item_name); DEFSUBR (Fmenu_find_real_submenu); @@ -398,21 +353,32 @@ void vars_of_menubar (void) { - /* put in Vblank_menubar a menubar value which has no visible - * items. This is a bit tricky due to various quirks. We - * could use '(["" nil nil]), but this is apparently equivalent - * to '(nil), and a new frame created with this menubar will - * get a vertically-squished menubar. If we use " " as the - * button title instead of "", we get an etched button border. - * So we use - * '(("No active menubar" ["" nil nil])) - * which creates a menu whose title is "No active menubar", - * and this works fine. - */ + { + /* put in Vblank_menubar a menubar value which has no visible + * items. This is a bit tricky due to various quirks. We + * could use '(["" nil nil]), but this is apparently equivalent + * to '(nil), and a new frame created with this menubar will + * get a vertically-squished menubar. If we use " " as the + * button title instead of "", we get an etched button border. + * So we use + * '(("No active menubar" ["" nil nil])) + * which creates a menu whose title is "No active menubar", + * and this works fine. + */ - Vblank_menubar = list1 (list2 (build_string ("No active menubar"), - vector3 (build_string (""), Qnil, Qnil))); - staticpro (&Vblank_menubar); + Lisp_Object menu_item[3]; + static CONST char *blank_msg = "No active menubar"; + + menu_item[0] = build_string (""); + menu_item[1] = Qnil; + menu_item[2] = Qnil; + Vblank_menubar = Fcons (Fcons (build_string (blank_msg), + Fcons (Fvector (3, &menu_item[0]), + Qnil)), + Qnil); + Vblank_menubar = Fpurecopy (Vblank_menubar); + staticpro (&Vblank_menubar); + } DEFVAR_BOOL ("popup-menu-titles", &popup_menu_titles /* If true, popup menus will have title bars at the top. @@ -440,18 +406,8 @@ toplevel menus, it is ignored. This string is not displayed in the menu itself. -Menu accelerators can be indicated in the string by putting the -sequence "%_" before the character corresponding to the key that will -invoke the menu or menu item. Uppercase and lowercase accelerators -are equivalent. The sequence "%%" is also special, and is translated -into a single %. - -If no menu accelerator is present in the string, XEmacs will act as if -the first character has been tagged as an accelerator. - -Immediately following the name string of the menu, various optional -keyword-value pairs are permitted: currently, :filter, :active, :included, -and :config. (See below.) +Immediately following the name string of the menu, any of three +optional keyword-value pairs is permitted. If an element of a menu (or menubar) is a string, then that string will be presented as unselectable text. @@ -459,29 +415,6 @@ If an element of a menu is a string consisting solely of hyphens, then that item will be presented as a solid horizontal line. -If an element of a menu is a string beginning with "--:", it will be -presented as a line whose appearance is controlled by the rest of the -text in the string. The allowed line specs are system-dependent, and -currently work only under X Windows (with Lucid and Motif menubars); -otherwise, a solid horizontal line is presented, as if the string were -all hyphens. - -The possibilities are: - - "--:singleLine" - "--:doubleLine" - "--:singleDashedLine" - "--:doubleDashedLine" - "--:noLine" - "--:shadowEtchedIn" - "--:shadowEtchedOut" - "--:shadowEtchedInDash" - "--:shadowEtchedOutDash" - "--:shadowDoubleEtchedIn" (Lucid menubars only) - "--:shadowDoubleEtchedOut" (Lucid menubars only) - "--:shadowDoubleEtchedInDash" (Lucid menubars only) - "--:shadowDoubleEtchedOutDash" (Lucid menubars only) - If an element of a menu is a list, it is treated as a submenu. The name of that submenu (the first element in the list) will be used as the name of the item representing this menu on the parent. @@ -491,39 +424,33 @@ which are flushright. Otherwise, the element must be a vector, which describes a menu item. -A menu item is of the following form: - - [ "name" callback :<keyword> <value> :<keyword> <value> ... ] - -The following forms are also accepted for compatibility, but deprecated: +A menu item can have any of the following forms: [ "name" callback <active-p> ] [ "name" callback <active-p> <suffix> ] + [ "name" callback :<keyword> <value> :<keyword> <value> ... ] The name is the string to display on the menu; it is filtered through the resource database, so it is possible for resources to override what string -is actually displayed. Menu accelerator indicators (the sequence `%_') are -also processed; see above. If the name is not a string, it will be -evaluated with `eval', and the result should be a string. +is actually displayed. If the `callback' of a menu item 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'. -In the deprecated forms, <active-p> is equivalent to using the :active -keyword, and <suffix> is equivalent to using the :suffix keyword. +The possible keywords are this: -The possible keywords are: - - :active <form> The expression is evaluated just before the menu is + :active <form> Same as <active-p> in the first two forms: the + expression is evaluated just before the menu is displayed, and the menu will be selectable only if the result is non-nil. - :suffix <form> The expression is evaluated just before the menu is - displayed and the resulting string is appended to - the displayed name, providing a convenient way of - adding the name of a command's ``argument'' to the - menu, like ``Kill Buffer NAME''. + :suffix <form> Same as <suffix> in the second form: the expression + is evaluated just before the menu is displayed and + resulting string is appended to the displayed name, + providing a convenient way of adding the name of a + command's ``argument'' to the menu, like + ``Kill Buffer NAME''. :keys "string" Normally, the keyboard equivalents of commands in menus are displayed when the `callback' is a symbol. @@ -560,42 +487,47 @@ See the variable `menubar-configuration'. :filter <function> A menu filter can only be used in a menu item list. - (i.e. not in a menu item itself). It is used to - incrementally create a submenu only when it is selected - by the user and not every time the menubar is activated. - The filter function is passed the list of menu items in - the submenu and must return a list of menu items to be - used for the menu. It must not destructively modify - the list of menu items passed to it. It is called only - when the menu is about to be displayed, so other menus - may already be displayed. Vile and terrible things will - happen if a menu filter function changes the current - buffer, window, or frame. It also should not raise, - lower, or iconify any frames. Basically, the filter - function should have no side-effects. + (i.e.: not in a menu item itself). It is used to + sensitize or incrementally create a submenu only when + it is selected by the user and not every time the + menubar is activated. The filter function is passed + the list of menu items in the submenu and must return a + list of menu items to be used for the menu. It is + called only when the menu is about to be displayed, so + other menus may already be displayed. Vile and + terrible things will happen if a menu filter function + changes the current buffer, window, or frame. It + also should not raise, lower, or iconify any frames. + Basically, the filter function should have no + side-effects. :key-sequence keys Used in FSF Emacs as an hint to an equivalent keybinding. - Ignored by XEmacs for easymenu.el compatibility. + Ignored by XEnacs for easymenu.el compatability. + + :label <form> (unimplemented!) Like :suffix, but replaces label + completely. + (might be added in 21.2). For example: - ("%_File" + ("File" :filter file-menu-filter ; file-menu-filter is a function that takes ; one argument (a list of menu items) and ; returns a list of menu items - [ "Save %_As..." write-file t ] - [ "%_Revert Buffer" revert-buffer (buffer-modified-p) ] - [ "R%_ead Only" toggle-read-only :style toggle + [ "Save As..." write-file t ] + [ "Revert Buffer" revert-buffer (buffer-modified-p) ] + [ "Read Only" toggle-read-only :style toggle :selected buffer-read-only ] ) -See menubar-items.el for many more examples. +See x-menubar.el for many more examples. After the menubar is clicked upon, but before any menus are popped up, the functions on the `activate-menubar-hook' are invoked to make top-level changes to the menus and menubar. Note, however, that the use of menu filters (using the :filter keyword) is usually a more efficient way to -dynamically alter or sensitize menus. */, menubar_variable_changed); +dynamically alter or sensitize menus. +*/, menubar_variable_changed); Vcurrent_menubar = Qnil; @@ -641,80 +573,6 @@ default pointer is used. */ ); - 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. - -NOTE: This currently only has any effect under X Windows. -*/ ); - 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. - -NOTE: This currently only has any effect under X Windows. - -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; - - 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. -NOTE: This currently only has any effect under X Windows. - -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. -*/ ); - Fprovide (intern ("menubar")); } @@ -729,9 +587,11 @@ set_specifier_fallback (Vmenubar_visible_p, list1 (Fcons (Qnil, Qt))); set_specifier_caching (Vmenubar_visible_p, - offsetof (struct window, menubar_visible_p), + slot_offset (struct window, + menubar_visible_p), menubar_visible_p_changed, - offsetof (struct frame, menubar_visible_p), + slot_offset (struct frame, + menubar_visible_p), menubar_visible_p_changed_in_frame); } @@ -739,6 +599,4 @@ complex_vars_of_menubar (void) { Vmenubar_pointer_glyph = Fmake_glyph_internal (Qpointer); - - Vmenu_accelerator_map = Fmake_keymap (Qnil); } diff -r 12e008d41344 -r 697ef44129c6 src/menubar.h --- a/src/menubar.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/menubar.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,52 +20,21 @@ /* Synched up with: Not in FSF. */ -/* #### Still needs some device-abstraction work. */ +/* #### Not properly abstracted for device-independence. */ -#ifndef INCLUDED_menubar_h_ -#define INCLUDED_menubar_h_ +#ifndef _XEMACS_MENUBAR_H_ +#define _XEMACS_MENUBAR_H_ #ifdef HAVE_MENUBARS #include "gui.h" void update_frame_menubars (struct frame *f); void free_frame_menubars (struct frame *f); Lisp_Object menu_parse_submenu_keywords (Lisp_Object desc, - Lisp_Object gui_item); -Lisp_Object current_frame_menubar (const struct frame* f); + struct gui_item* pgui_item); +Lisp_Object current_frame_menubar (CONST struct frame* f); EXFUN (Fmenu_find_real_submenu, 2); -extern Lisp_Object Vmenu_accelerator_prefix; -extern Lisp_Object Vmenu_accelerator_modifiers; -extern Lisp_Object Vmenu_accelerator_enabled; -extern Lisp_Object Vmenu_accelerator_map; - -extern Lisp_Object Qmenu_force; -extern Lisp_Object Qmenu_fallback; - -extern Lisp_Object Qmenu_quit; -extern Lisp_Object Qmenu_up; -extern Lisp_Object Qmenu_down; -extern Lisp_Object Qmenu_left; -extern Lisp_Object Qmenu_right; -extern Lisp_Object Qmenu_select; -extern Lisp_Object Qmenu_escape; - - -/* #### kluuuuuuuuuuuuuuuuuuuuuuuuuuuudge! - The author of the accelerator code didn't know what the hell he was doing. - Someone needs to abstract this properly. */ -#if defined(HAVE_X_WINDOWS) && defined(LWLIB_MENUBARS_LUCID) -extern int x_kludge_lw_menu_active (void); -struct command_builder; -Lisp_Object command_builder_find_menu_accelerator (struct command_builder - *builder); -Lisp_Object command_builder_operate_menu_accelerator (struct command_builder - *builder); - -extern int in_menu_callback; -#endif - #endif /* HAVE_MENUBARS */ -#endif /* INCLUDED_menubar_h_ */ +#endif /* _XEMACS_MENUBAR_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/minibuf.c --- a/src/minibuf.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/minibuf.c Mon Aug 13 11:20:41 2007 +0200 @@ -205,7 +205,7 @@ if IGNORE_CASE is true. */ Charcount -scmp_1 (const Bufbyte *s1, const Bufbyte *s2, Charcount len, +scmp_1 (CONST Bufbyte *s1, CONST Bufbyte *s2, Charcount len, int ignore_case) { Charcount l = len; @@ -244,7 +244,7 @@ int -regexp_ignore_completion_p (const Bufbyte *nonreloc, +regexp_ignore_completion_p (CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { @@ -387,7 +387,7 @@ { if (!ZEROP (bucket)) { - Lisp_Symbol *next; + struct Lisp_Symbol *next; if (!SYMBOLP (bucket)) { signal_simple_error ("Bad obarray passed to try-completions", @@ -590,7 +590,7 @@ { if (!ZEROP (bucket)) { - Lisp_Symbol *next = symbol_next (XSYMBOL (bucket)); + struct Lisp_Symbol *next = symbol_next (XSYMBOL (bucket)); elt = bucket; eltstring = Fsymbol_name (elt); if (next) @@ -681,8 +681,8 @@ } else { - write_string_to_stdio_stream (stderr, 0, (const Bufbyte *) "\n", 0, 1, - Qterminal, 0); + write_string_to_stdio_stream (stderr, 0, (CONST Bufbyte *) "\n", 0, 1, + FORMAT_TERMINAL); return Qnil; } } @@ -702,7 +702,7 @@ } void -echo_area_append (struct frame *f, const Bufbyte *nonreloc, Lisp_Object reloc, +echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, Lisp_Object label) { @@ -711,12 +711,6 @@ struct gcpro gcpro1; Lisp_Object frame; - /* There is an inlining bug in egcs-20000131 c++ that can be worked - around as follows: */ -#if defined (__GNUC__) && defined (__cplusplus) - alloca (4); -#endif - /* some callers pass in a null string as a way of clearing the echo area. check for length == 0 now; if this case, neither nonreloc nor reloc may be valid. */ @@ -751,12 +745,12 @@ if (STRINGP (reloc)) nonreloc = XSTRING_DATA (reloc); write_string_to_stdio_stream (stderr, 0, nonreloc, offset, length, - Qterminal, 0); + FORMAT_TERMINAL); } } void -echo_area_message (struct frame *f, const Bufbyte *nonreloc, +echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, Lisp_Object label) { @@ -801,7 +795,7 @@ /* Dump an informative message to the echo area. This function takes a string in internal format. */ void -message_internal (const Bufbyte *nonreloc, Lisp_Object reloc, +message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { /* This function can call lisp */ @@ -811,7 +805,7 @@ } void -message_append_internal (const Bufbyte *nonreloc, Lisp_Object reloc, +message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { /* This function can call lisp */ @@ -825,7 +819,7 @@ on the format string; message_no_translate() does not. */ static void -message_1 (const char *fmt, va_list args) +message_1 (CONST char *fmt, va_list args) { /* This function can call lisp */ if (fmt) @@ -833,7 +827,7 @@ struct gcpro gcpro1; /* message_internal() might GC, e.g. if there are after-change-hooks on the echo area buffer */ - Lisp_Object obj = emacs_doprnt_string_va ((const Bufbyte *) fmt, Qnil, + Lisp_Object obj = emacs_doprnt_string_va ((CONST Bufbyte *) fmt, Qnil, -1, args); GCPRO1 (obj); message_internal (0, obj, 0, -1); @@ -844,7 +838,7 @@ } static void -message_append_1 (const char *fmt, va_list args) +message_append_1 (CONST char *fmt, va_list args) { /* This function can call lisp */ if (fmt) @@ -852,7 +846,7 @@ struct gcpro gcpro1; /* message_internal() might GC, e.g. if there are after-change-hooks on the echo area buffer */ - Lisp_Object obj = emacs_doprnt_string_va ((const Bufbyte *) fmt, Qnil, + Lisp_Object obj = emacs_doprnt_string_va ((CONST Bufbyte *) fmt, Qnil, -1, args); GCPRO1 (obj); message_append_internal (0, obj, 0, -1); @@ -870,7 +864,7 @@ } void -message (const char *fmt, ...) +message (CONST char *fmt, ...) { /* This function can call lisp */ /* I think it's OK to pass the data of Lisp strings as arguments to @@ -886,7 +880,7 @@ } void -message_append (const char *fmt, ...) +message_append (CONST char *fmt, ...) { /* This function can call lisp */ va_list args; @@ -899,7 +893,7 @@ } void -message_no_translate (const char *fmt, ...) +message_no_translate (CONST char *fmt, ...) { /* This function can call lisp */ /* I think it's OK to pass the data of Lisp strings as arguments to @@ -942,15 +936,9 @@ } void -reinit_vars_of_minibuf (void) +vars_of_minibuf (void) { minibuf_level = 0; -} - -void -vars_of_minibuf (void) -{ - reinit_vars_of_minibuf (); staticpro (&Vminibuf_prompt); Vminibuf_prompt = Qnil; @@ -977,7 +965,7 @@ } void -reinit_complex_vars_of_minibuf (void) +complex_vars_of_minibuf (void) { /* This function can GC */ #ifdef I18N3 @@ -986,14 +974,8 @@ #endif Vminibuffer_zero = Fget_buffer_create - (build_string (DEFER_GETTEXT (" *Minibuf-0*"))); + (Fpurecopy (build_string (DEFER_GETTEXT (" *Minibuf-0*")))); Vecho_area_buffer = Fget_buffer_create - (build_string (DEFER_GETTEXT (" *Echo Area*"))); + (Fpurecopy (build_string (DEFER_GETTEXT (" *Echo Area*")))); } - -void -complex_vars_of_minibuf (void) -{ - reinit_complex_vars_of_minibuf (); -} diff -r 12e008d41344 -r 697ef44129c6 src/miscplay.c --- a/src/miscplay.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,795 +0,0 @@ -/* miscplay.c - general routines related to playing sounds - ** - ** Copyright (C) 1995,96 by Markus Gutschke (gutschk@math.uni-muenster.de) - ** This was sawed out from version 1.3 of linuxplay.c by - ** Robert Bihlmeyer <robbe@orcus.priv.at>. - ** - ** Parts of this code were inspired by sunplay.c, which is copyright 1989 by - ** Jef Poskanzer and 1991,92 by Jamie Zawinski; c.f. sunplay.c for further - ** information. - ** - ** Permission to use, copy, modify, and distribute this software and its - ** documentation for any purpose and without fee is hereby granted, provided - ** that the above copyright notice appear in all copies and that both that - ** copyright notice and this permission notice appear in supporting - ** documentation. This software is provided "as is" without express or - ** implied warranty. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "miscplay.h" -#include "lisp.h" -#include "syssignal.h" -#include "sysfile.h" -#define warn(str) message("audio: %s ",GETTEXT(str)) - -#include <stdlib.h> - -#ifdef __GNUC__ -#define UNUSED(x) ((void)(x)) -#else -#define UNUSED(x) -#endif - -/* Maintain global variable for keeping parser state information; this struct - is set to zero before the first invocation of the parser. The use of a - global variable prevents multiple concurrent executions of this code, but - this does not happen anyways... */ -enum wvState -{ wvMain, - wvSubchunk, - wvOutOfBlock, - wvSkipChunk, - wvSoundChunk, - wvFatal, - wvFatalNotify -}; - -static union { - struct { - int align; - enum wvState state; - size_t left; - unsigned char leftover[HEADERSZ]; - signed long chunklength; - } wave; - struct { - int align; - int isdata; - int skipping; - size_t left; - unsigned char leftover[HEADERSZ]; - } audio; -} parsestate; - -/* Use a global buffer as scratch-pad for possible conversions of the - sampling format */ -unsigned char miscplay_sndbuf[SNDBUFSZ]; - -/* Initialize global parser state information to zero */ -void reset_parsestate() -{ - memset(&parsestate,0,sizeof(parsestate)); -} - -/* Verify that we could fully parse the entire soundfile; this is needed - only for files in WAVE format */ -int parse_wave_complete() -{ - if (parsestate.wave.state != wvOutOfBlock && - parsestate.wave.state != wvFatal) { - warn("Unexpected end of WAVE file"); - return 0; - } else - return 1; -} - -/* There is no special treatment required for parsing raw data files; we - assume that these files contain data in 8bit unsigned format that - has been sampled at 8kHz; there is no extra header */ -static size_t parseraw(void **data,size_t *sz,void **outbuf) -{ - int rc = *sz; - - *outbuf = *data; - *sz = 0; - return(rc); -} - -/* Currently we cannot cope with files in VOC format; if you really need - to play these files, they should be converted by using SOX */ -static size_t parsevoc(void **data,size_t *sz,void **outbuf) -{ - UNUSED(data); - UNUSED(sz); - UNUSED(outbuf); - return(0); -} - -/* We need to perform some look-ahead in order to parse files in WAVE format; - this might require re-partioning of the data segments if headers cross the - boundaries between two read operations. This is done in a two-step way: - first we request a certain amount of bytes... */ -static inline int waverequire(void **data,size_t *sz,size_t rq) -{ - int rc = 1; - - if (rq > HEADERSZ) { - warn("Header size exceeded while parsing WAVE file"); - parsestate.wave.state = wvFatal; - *sz = 0; - return(0); } - if ((rq -= parsestate.wave.left) <= 0) - return(rc); - if (rq > *sz) {rq = *sz; rc = 0;} - memcpy(parsestate.wave.leftover+parsestate.wave.left, - *data,rq); - parsestate.wave.left += rq; - (*(unsigned char **)data) += rq; - *sz -= rq; - return(rc); -} - -/* ...and next we remove this many bytes from the buffer */ -static inline void waveremove(size_t rq) -{ - if (parsestate.wave.left <= rq) - parsestate.wave.left = 0; - else { - parsestate.wave.left -= rq; - memmove(parsestate.wave.leftover, - parsestate.wave.leftover+rq, - parsestate.wave.left); } - return; -} - -/* Sound files in WAVE format can contain an arbitrary amount of tagged - chunks; this requires quite some effort for parsing the data */ -static size_t parsewave(void **data,size_t *sz,void **outbuf) -{ - for (;;) - switch (parsestate.wave.state) { - case wvMain: - if (!waverequire(data,sz,20)) - return(0); - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - parsestate.wave.chunklength = parsestate.wave.leftover[16] + - 256*(parsestate.wave.leftover[17] + - 256*(parsestate.wave.leftover[18] + - 256*parsestate.wave.leftover[19])); - waveremove(20); - parsestate.wave.state = wvSubchunk; - break; - case wvSubchunk: - if (!waverequire(data,sz,parsestate.wave.chunklength)) - return(0); - parsestate.wave.align = parsestate.wave.chunklength < 14 ? 1 - : parsestate.wave.leftover[12]; - if (parsestate.wave.align != 1 && - parsestate.wave.align != 2 && - parsestate.wave.align != 4) { - warn("Illegal datawidth detected while parsing WAVE file"); - parsestate.wave.state = wvFatal; } - else - parsestate.wave.state = wvOutOfBlock; - waveremove(parsestate.wave.chunklength); - break; - case wvOutOfBlock: - if (!waverequire(data,sz,8)) - return(0); - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - parsestate.wave.chunklength = parsestate.wave.leftover[4] + - 256*(parsestate.wave.leftover[5] + - 256*(parsestate.wave.leftover[6] + - 256*(parsestate.wave.leftover[7] & 0x7F))); - if (memcmp(parsestate.wave.leftover,"data",4)) - parsestate.wave.state = wvSkipChunk; - else - parsestate.wave.state = wvSoundChunk; - waveremove(8); - break; - case wvSkipChunk: - if (parsestate.wave.chunklength > 0 && *sz > 0 && - (signed long)*sz < (signed long)parsestate.wave.chunklength) { - parsestate.wave.chunklength -= *sz; - *sz = 0; } - else { - if (parsestate.wave.chunklength > 0 && *sz > 0) { - *sz -= parsestate.wave.chunklength; - (*(unsigned char **)data) += parsestate.wave.chunklength; } - parsestate.wave.state = wvOutOfBlock; } - break; - case wvSoundChunk: { - size_t count,rq; - if (parsestate.wave.left) { /* handle leftover bytes from last - alignment operation */ - count = parsestate.wave.left; - rq = HEADERSZ-count; - if (rq > (size_t) parsestate.wave.chunklength) - rq = parsestate.wave.chunklength; - if (!waverequire(data,sz,rq)) { - parsestate.wave.chunklength -= parsestate.wave.left - count; - return(0); } - parsestate.wave.chunklength -= rq; - *outbuf = parsestate.wave.leftover; - parsestate.wave.left = 0; - return(rq); } - if (*sz >= (size_t) parsestate.wave.chunklength) { - count = parsestate.wave.chunklength; - rq = 0; } - else { - count = *sz; - count -= rq = count % parsestate.wave.align; } - *outbuf = *data; - (*(unsigned char **)data) += count; - *sz -= count; - if ((parsestate.wave.chunklength -= count) < parsestate.wave.align) { - parsestate.wave.state = wvOutOfBlock; - /* Some broken software (e.g. SOX) attaches junk to the end of a sound - chunk; so, let's ignore this... */ - if (parsestate.wave.chunklength) - parsestate.wave.state = wvSkipChunk; } - else if (rq) - /* align data length to a multiple of datasize; keep additional data - in "leftover" buffer --- this is necessary to ensure proper - functioning of the sndcnv... routines */ - waverequire(data,sz,rq); - return(count); } - case wvFatalNotify: - warn("Irrecoverable error while parsing WAVE file"); - parsestate.wave.state = wvFatal; - break; - case wvFatal: - default: - *sz = 0; - return(0); } -} - -/* Strip the header from files in Sun/DEC audio format; this requires some - extra processing as the header can be an arbitrary size and it might - result in alignment errors for subsequent conversions --- thus we do - some buffering, where needed */ -static size_t parsesundecaudio(void **data,size_t *sz,void **outbuf) -{ - /* There is data left over from the last invocation of this function; join - it with the new data and return a sound chunk that is as big as a - single entry */ - if (parsestate.audio.left) { - if (parsestate.audio.left + *sz > (size_t) parsestate.audio.align) { - int count; - memmove(parsestate.audio.leftover + parsestate.audio.left, - *data, - count = parsestate.audio.align - parsestate.audio.left); - *outbuf = parsestate.audio.leftover; - *sz -= count; - *data = (*(char **)data) + count; - parsestate.audio.left = 0; - return(parsestate.audio.align); } - else { - /* We need even more data in order to get one complete single entry! */ - memmove(parsestate.audio.leftover + parsestate.audio.left, - *data, - *sz); - *data = (*(char **)data) + *sz; - parsestate.audio.left += *sz; - *sz = 0; - return(0); } } - - /* This is the main sound chunk, strip of any extra data that does not fit - the alignment requirements and move these bytes into the leftover buffer*/ - if (parsestate.audio.isdata) { - int rc = *sz; - *outbuf = *data; - if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { - memmove(parsestate.audio.leftover, - (char *)*outbuf + rc - parsestate.audio.left, - parsestate.audio.left); - rc -= parsestate.audio.left; } - *sz = 0; - return(rc); } - - /* This is the first invocation of this function; we need to parse the - header information and determine how many bytes we need to skip until - the start of the sound chunk */ - if (!parsestate.audio.skipping) { - unsigned char *header = (unsigned char *) *data; - if (*sz < 8) { - warn("Irrecoverable error while parsing Sun/DEC audio file"); - return(0); } - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - if (header[3]) { /* Sun audio (big endian) */ - parsestate.audio.align = ((header[15] > 2)+1)*header[23]; - parsestate.audio.skipping = header[7]+256*(header[6]+256* - (header[5]+256*header[4])); } - else { /* DEC audio (little endian) */ - parsestate.audio.align = ((header[12] > 2)+1)*header[20]; - parsestate.audio.skipping = header[4]+256*(header[5]+256* - (header[6]+256*header[7])); }} - - /* We are skipping extra data that has been attached to header; most usually - this will be just a comment, such as the original filename and/or the - creation date. Make sure that we do not return less than one single sound - sample entry to the caller; if this happens, rather decide to move those - few bytes into the leftover buffer and deal with it later */ - if (*sz >= (size_t) parsestate.audio.skipping) { - /* Skip just the header information and return the sound chunk */ - int rc = *sz - parsestate.audio.skipping; - *outbuf = (char *)*data + parsestate.audio.skipping; - if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { - memmove(parsestate.audio.leftover, - (char *)*outbuf + rc - parsestate.audio.left, - parsestate.audio.left); - rc -= parsestate.audio.left; } - *sz = 0; - parsestate.audio.skipping = 0; - parsestate.audio.isdata++; - return(rc); } - else { - /* Skip everything */ - parsestate.audio.skipping -= *sz; - return(0); } -} - -/* If the soundcard could not be set to natively support the data format, we - try to do some limited on-the-fly conversion to a different format; if - no conversion is needed, though, we can output directly */ -size_t sndcnvnop(void **data,size_t *sz,void **outbuf) -{ - int rc = *sz; - - *outbuf = *data; - *sz = 0; - return(rc); -} - -/* Convert 8 bit unsigned stereo data to 8 bit unsigned mono data */ -size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) - *dest++ = (unsigned char)(((int)*(src)++ + - (int)*(src)++) / 2); - *data = src; - return(rc); -} - -/* Convert 8 bit signed stereo data to 8 bit signed mono data */ -size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc, count; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) - *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + - (int)*((signed char *)(src++))) / 2); - *data = src; - return(rc); -} - -/* Convert 8 bit signed stereo data to 8 bit unsigned mono data */ -size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) - *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + - (int)*((signed char *)(src++))) / 2) ^ 0x80; - *data = src; - return(rc); -} - -/* Convert 8 bit signed mono data to 8 bit unsigned mono data */ -size_t sndcnv2unsigned(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz; - if (count > SNDBUFSZ) { *sz -= SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) - *dest++ = *(src)++ ^ 0x80; - *data = src; - return(rc); -} - -/* Convert a number in the range -32768..32767 to an 8 bit ulaw encoded - number --- I hope, I got this conversion right :-) */ -static inline signed char int2ulaw(int i) -{ - /* Lookup table for fast calculation of number of bits that need shifting*/ - static short int t_bits[128] = { - 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7}; - REGISTER int bits,logi; - - /* unrolling this condition (hopefully) improves execution speed */ - if (i < 0) { - if ((i = (132-i)) > 0x7FFF) i = 0x7FFF; - logi = (i >> ((bits = t_bits[i/256])+4)); - return((bits << 4 | logi) ^ 0x7F); } - else { - if ((i = 132+i) > 0x7FFF) i = 0x7FFF; - logi = (i >> ((bits = t_bits[i/256])+4)); - return(~(bits << 4 | logi)); } -} - -/* Convert from 8 bit ulaw mono to 8 bit linear mono */ -size_t sndcnvULaw_2linear(void **data,size_t *sz,void **outbuf) -{ - /* conversion table stolen from Linux's ulaw.h */ - static unsigned char ulaw_dsp[] = { - 3, 7, 11, 15, 19, 23, 27, 31, - 35, 39, 43, 47, 51, 55, 59, 63, - 66, 68, 70, 72, 74, 76, 78, 80, - 82, 84, 86, 88, 90, 92, 94, 96, - 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, - 113, 114, 114, 115, 115, 116, 116, 117, - 117, 118, 118, 119, 119, 120, 120, 121, - 121, 121, 122, 122, 122, 122, 123, 123, - 123, 123, 124, 124, 124, 124, 125, 125, - 125, 125, 125, 125, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 253, 249, 245, 241, 237, 233, 229, 225, - 221, 217, 213, 209, 205, 201, 197, 193, - 190, 188, 186, 184, 182, 180, 178, 176, - 174, 172, 170, 168, 166, 164, 162, 160, - 158, 157, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 147, 146, 145, 144, 143, - 143, 142, 142, 141, 141, 140, 140, 139, - 139, 138, 138, 137, 137, 136, 136, 135, - 135, 135, 134, 134, 134, 134, 133, 133, - 133, 133, 132, 132, 132, 132, 131, 131, - 131, 131, 131, 131, 130, 130, 130, 130, - 130, 130, 130, 130, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - unsigned char *p=(unsigned char *)*data; - - *outbuf = *data; - while ((*sz)--) - *p++ = ulaw_dsp[*p]; - *sz = 0; - *data = p; - return p - (unsigned char *)*outbuf; -} - -/* Convert 8 bit ulaw stereo data to 8 bit ulaw mono data */ -size_t sndcnvULaw_2mono(void **data,size_t *sz,void **outbuf) -{ - - static short int ulaw2int[256] = { - /* Precomputed lookup table for conversion from ulaw to 15 bit signed */ - -16062,-15550,-15038,-14526,-14014,-13502,-12990,-12478, - -11966,-11454,-10942,-10430, -9918, -9406, -8894, -8382, - -7998, -7742, -7486, -7230, -6974, -6718, -6462, -6206, - -5950, -5694, -5438, -5182, -4926, -4670, -4414, -4158, - -3966, -3838, -3710, -3582, -3454, -3326, -3198, -3070, - -2942, -2814, -2686, -2558, -2430, -2302, -2174, -2046, - -1950, -1886, -1822, -1758, -1694, -1630, -1566, -1502, - -1438, -1374, -1310, -1246, -1182, -1118, -1054, -990, - -942, -910, -878, -846, -814, -782, -750, -718, - -686, -654, -622, -590, -558, -526, -494, -462, - -438, -422, -406, -390, -374, -358, -342, -326, - -310, -294, -278, -262, -246, -230, -214, -198, - -186, -178, -170, -162, -154, -146, -138, -130, - -122, -114, -106, -98, -90, -82, -74, -66, - -60, -56, -52, -48, -44, -40, -36, -32, - -28, -24, -20, -16, -12, -8, -4, +0, - +16062,+15550,+15038,+14526,+14014,+13502,+12990,+12478, - +11966,+11454,+10942,+10430, +9918, +9406, +8894, +8382, - +7998, +7742, +7486, +7230, +6974, +6718, +6462, +6206, - +5950, +5694, +5438, +5182, +4926, +4670, +4414, +4158, - +3966, +3838, +3710, +3582, +3454, +3326, +3198, +3070, - +2942, +2814, +2686, +2558, +2430, +2302, +2174, +2046, - +1950, +1886, +1822, +1758, +1694, +1630, +1566, +1502, - +1438, +1374, +1310, +1246, +1182, +1118, +1054, +990, - +942, +910, +878, +846, +814, +782, +750, +718, - +686, +654, +622, +590, +558, +526, +494, +462, - +438, +422, +406, +390, +374, +358, +342, +326, - +310, +294, +278, +262, +246, +230, +214, +198, - +186, +178, +170, +162, +154, +146, +138, +130, - +122, +114, +106, +98, +90, +82, +74, +66, - +60, +56, +52, +48, +44, +40, +36, +32, - +28, +24, +20, +16, +12, +8, +4, +0}; - - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) - /* it is not possible to directly interpolate between two ulaw encoded - data bytes, thus we need to convert to linear format first and later - we convert back to ulaw format */ - *dest++ = int2ulaw(ulaw2int[*(src)++] + - ulaw2int[*(src)++]); - *data = src; - return(rc); -} - -size_t sndcnv16swap(void **data,size_t *sz,void **outbuf) -{ - size_t cnt = *sz / 2; - unsigned short *p; - - *outbuf = *data; - p = (unsigned short *) *outbuf; - while (cnt--) { - *p++ = ((*p & 0x00ff) << 8) | (*p >> 8); - } - *data = p; - cnt = *sz; - *sz = 0; - return cnt; -} - -/* Convert 16 bit little endian signed stereo data to 16 bit little endian - signed mono data */ -size_t sndcnv16_2monoLE(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - signed short i; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - for (count /= 2; count--; ) { - i = ((int)(src[0]) + - 256*(int)(src[1]) + - (int)(src[2]) + - 256*(int)(src[3])) / 2; - src += 4; - *dest++ = (unsigned char)(i & 0xFF); - *dest++ = (unsigned char)((i / 256) & 0xFF); } - *data = src; - return(rc); -} - -/* Convert 16 bit big endian signed stereo data to 16 bit big endian - signed mono data */ -size_t sndcnv16_2monoBE(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - signed short i; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - for (count /= 2; count--; ) { - i = ((int)(src[1]) + - 256*(int)(src[0]) + - (int)(src[3]) + - 256*(int)(src[2])) / 2; - src += 4; - *dest++ = (unsigned char)((i / 256) & 0xFF); - *dest++ = (unsigned char)(i & 0xFF); } - *data = src; - return(rc); -} - -/* Convert 16 bit little endian signed data to 8 bit unsigned data */ -size_t sndcnv2byteLE(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) { - *dest++ = (unsigned char)(((signed char *)src)[1] ^ (signed char)0x80); - src += 2; - } - *data = src; - return(rc); -} - -/* Convert 16 bit big endian signed data to 8 bit unsigned data */ -size_t sndcnv2byteBE(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 2; - if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) { - *dest++ = (unsigned char)(((signed char *)src)[0] ^ (signed char)0x80); - src += 2; - } - *data = src; - return(rc); -} - -/* Convert 16 bit little endian signed stereo data to 8 bit unsigned - mono data */ -size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 4; - if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) { - *dest++ = (unsigned char)(((int)((signed char *)src)[1] + - (int)((signed char *)src)[3]) / 2 ^ 0x80); - src += 4; - } - *data = src; - return(rc); -} - -/* Convert 16 bit big endian signed stereo data to 8 bit unsigned - mono data */ -size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf) -{ - REGISTER unsigned char *src; - REGISTER unsigned char *dest; - int rc,count; - - count = *sz / 4; - if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } - else *sz = 0; - rc = count; - src = (unsigned char *) *data; - *outbuf = - dest = miscplay_sndbuf; - while (count--) { - *dest++ = (unsigned char)(((int)((signed char *)src)[0] + - (int)((signed char *)src)[2]) / 2 ^ 0x80); - src += 4; - } - *data = src; - return(rc); -} - -/* Look at the header of the sound file and try to determine the format; - we can recognize files in VOC, WAVE, and, Sun/DEC-audio format--- everything - else is assumed to be raw 8 bit unsigned data sampled at 8kHz */ -fmtType analyze_format(unsigned char *format,int *fmt,int *speed, - int *tracks, - size_t (**parsesndfile)(void **,size_t *sz, - void **)) -{ - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - if (!memcmp(format,"Creative Voice File\x1A\x1A\x00",22) && - (format[22]+256*format[23]) == - ((0x1233-format[24]-256*format[25])&0xFFFF)) { /* VOC */ - *fmt = AFMT_U8; - *speed = 8000; - *tracks = 2; - *parsesndfile = parsevoc; - return(fmtVoc); } - else if (!memcmp(format,"RIFF",4) && - !memcmp(format+8,"WAVEfmt ",8)) { /* WAVE */ - if (memcmp(format+20,"\001\000\001"/* PCM mono */,4) && - memcmp(format+20,"\001\000\002"/* PCM stereo */,4)) - return(fmtIllegal); - *fmt = (format[32]/(*tracks = format[22])) == 1 ? - AFMT_U8 : AFMT_S16_LE; - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - *speed = format[24]+256*(format[25]+256* - (format[26]+256*format[27])); - *parsesndfile = parsewave; - return(fmtWave); } - else if (!memcmp(format,".snd",4)) { /* Sun Audio (big endian) */ - if (format[7]+256*(format[6]+256*(format[5]+256*format[4])) < 24) { - *fmt = AFMT_MU_LAW; - *speed = 8000; - *tracks = 1; - *parsesndfile = parsesundecaudio; - return(fmtSunAudio); } - if (!memcmp(format+12,"\000\000\000\001",4)) *fmt = AFMT_MU_LAW; - else if (!memcmp(format+12,"\000\000\000\002",4)) *fmt = AFMT_S8; - else if (!memcmp(format+12,"\000\000\000\003",4)) *fmt = AFMT_S16_BE; - else return(fmtIllegal); - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - *speed = format[19]+256*(format[18]+256* - (format[17]+256*format[16])); - *tracks = format[23]; - *parsesndfile = parsesundecaudio; - return(fmtSunAudio); } - else if (!memcmp(format,".sd",4)) { /* DEC Audio (little endian) */ - if (format[4]+256*(format[5]+256*(format[6]+256*format[7])) < 24) { - *fmt = AFMT_MU_LAW; - *speed = 8000; - *tracks = 1; - *parsesndfile = parsesundecaudio; - return(fmtSunAudio); } - if (!memcmp(format+12,"\001\000\000",4)) *fmt = AFMT_MU_LAW; - else if (!memcmp(format+12,"\002\000\000",4)) *fmt = AFMT_S8; - else if (!memcmp(format+12,"\003\000\000",4)) *fmt = AFMT_S16_LE; - else return(fmtIllegal); - /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ - *speed = format[16]+256*(format[17]+256* - (format[18]+256*format[19])); - *tracks = format[20]; - *parsesndfile = parsesundecaudio; - return(fmtSunAudio); } - else { - *fmt = AFMT_U8; - *speed = 8000; - *tracks = 1; - *parsesndfile = parseraw; - return(fmtRaw); } -} diff -r 12e008d41344 -r 697ef44129c6 src/miscplay.h --- a/src/miscplay.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* miscplay.h - general routines related to playing sounds - ** - ** Copyright (C) 1995,96 by Markus Gutschke (gutschk@math.uni-muenster.de) - ** This was sawed out from version 1.3 of linuxplay.c by - ** Robert Bihlmeyer <robbe@orcus.priv.at>. - ** - ** Parts of this code were inspired by sunplay.c, which is copyright 1989 by - ** Jef Poskanzer and 1991,92 by Jamie Zawinski; c.f. sunplay.c for further - ** information. - ** - ** Permission to use, copy, modify, and distribute this software and its - ** documentation for any purpose and without fee is hereby granted, provided - ** that the above copyright notice appear in all copies and that both that - ** copyright notice and this permission notice appear in supporting - ** documentation. This software is provided "as is" without express or - ** implied warranty. - */ - -#ifndef INCLUDED_miscplay_h_ -#define INCLUDED_miscplay_h_ - -#include <stdlib.h> - -#define HEADERSZ 256 /* has to be at least as big as the biggest header */ -#define SNDBUFSZ 2048 /* has to be at least as big as HEADERSZ */ - -/* Audio data formats from <linux/soundcard.h> */ -#define AFMT_MU_LAW 0x00000001 -#define AFMT_A_LAW 0x00000002 -#define AFMT_IMA_ADPCM 0x00000004 -#define AFMT_U8 0x00000008 -#define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/ -#define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */ -#define AFMT_S8 0x00000040 -#define AFMT_U16_LE 0x00000080 /* Little endian U16 */ -#define AFMT_U16_BE 0x00000100 /* Big endian U16 */ -#define AFMT_MPEG 0x00000200 /* MPEG (2) audio */ - -typedef enum {fmtIllegal,fmtRaw,fmtVoc,fmtWave,fmtSunAudio} fmtType; - -size_t sndcnvnop(void **data,size_t *sz,void **outbuf); -size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf); -size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf); -size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf); -size_t sndcnv2unsigned(void **data,size_t *sz,void **outbuf); -size_t sndcnvULaw_2linear(void **data,size_t *sz,void **outbuf); -size_t sndcnvULaw_2mono(void **data,size_t *sz,void **outbuf); -size_t sndcnv16swap(void **data,size_t *sz,void **outbuf); -size_t sndcnv16_2monoLE(void **data,size_t *sz,void **outbuf); -size_t sndcnv16_2monoBE(void **data,size_t *sz,void **outbuf); -size_t sndcnv2byteLE(void **data,size_t *sz,void **outbuf); -size_t sndcnv2byteBE(void **data,size_t *sz,void **outbuf); -size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf); -size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf); - -fmtType analyze_format(unsigned char *format,int *fmt,int *speed, - int *tracks, - size_t (**parsesndfile)(void **,size_t *sz, - void **)); -void reset_parsestate(void); -int parse_wave_complete(void); - -#endif /* INCLUDED_miscplay_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/mule-canna.c --- a/src/mule-canna.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule-canna.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -/* CANNA interface -*- coding: euc-jp -*- +/* CANNA interface Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. @@ -190,7 +190,6 @@ static Lisp_Object storeResults (unsigned char *, int, jrKanjiStatus *); static Lisp_Object kanjiYomiList (int, int); -static Lisp_Object CANNA_mode_keys (void); #ifdef CANNA_MULE static void m2c (unsigned char *, int, unsigned char *); @@ -327,9 +326,10 @@ } /* For whatever reason, calling Fding directly from libCanna loses */ -static void -call_Fding (void) +static void call_Fding() { + extern Lisp_Object Fding(); + Fding (Qnil, Qnil, Qnil); } @@ -421,7 +421,8 @@ } else { - extern void (*jrBeepFunc) (void); + extern void (*jrBeepFunc)(); + Lisp_Object CANNA_mode_keys (); jrBeepFunc = call_Fding; @@ -534,7 +535,7 @@ return val; } -static Lisp_Object +Lisp_Object CANNA_mode_keys (void) { #define CANNAWORKBUFSIZE 32 @@ -717,8 +718,7 @@ } DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, 1, 1, 0, /* -Return the result of kana-to-kanji conversion. -Clause separator is set. +¤«¤Ê´Á»úÊÑ´¹¤·¤¿·ë²Ì¤òÊÖ´Ô¤¹¤ë¡£Ê¸ÀáÀڤ꤬¤·¤Æ¤¢¤ë¡£ */ (yomi)) { @@ -773,7 +773,7 @@ } DEFUN ("canna-henkan-next", Fcanna_henkan_next, 1, 1, 0, /* -Return the list of candidates. +¸õÊä°ìÍ÷¤òµá¤á¤ë¡£ */ (bunsetsu)) { @@ -798,7 +798,7 @@ } else { - endp = XCDR (res) = Fcons (make_string (p, slen), Qnil); + endp = XCDR (endp) = Fcons (make_string (p, slen), Qnil); } p += slen + 1; } @@ -806,7 +806,7 @@ } DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, 2, 2, 0, /* -Specify the length of a clause. +ʸÀá¤ÎŤµ¤ò»ØÄꤹ¤ë¡£ */ (bunsetsu, bunlen)) { @@ -826,7 +826,7 @@ } DEFUN ("canna-henkan-kakutei", Fcanna_henkan_kakutei, 2, 2, 0, /* -Select a candidate. +¸õÊäÁªÂò¡£ */ (bun, kouho)) { @@ -845,7 +845,7 @@ } DEFUN ("canna-henkan-end", Fcanna_henkan_end, 0, 0, 0, /* -End conversion. +ÊÑ´¹½ªÎ»¡£ */ ()) { @@ -858,7 +858,7 @@ } DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, 0, 0, 0, /* -Quit conversion. +ÊÑ´¹½ªÎ»¡£ */ ()) { @@ -1022,6 +1022,9 @@ void syms_of_mule_canna (void) { + DEFVAR_LISP ("CANNA", &VCANNA); /* hir@nec, 1992.5.21 */ + VCANNA = Qt; /* hir@nec, 1992.5.21 */ + DEFSUBR (Fcanna_key_proc); DEFSUBR (Fcanna_initialize); DEFSUBR (Fcanna_finalize); @@ -1045,9 +1048,6 @@ void vars_of_mule_canna (void) { - DEFVAR_LISP ("CANNA", &VCANNA); /* hir@nec, 1992.5.21 */ - VCANNA = Qt; /* hir@nec, 1992.5.21 */ - DEFVAR_LISP ("canna-kakutei-string", &Vcanna_kakutei_string /* */ ); @@ -1777,9 +1777,9 @@ /* EUC multibyte string to MULE internal string */ static void -c2mu (unsigned char *cp, int l, unsigned char *mp) +c2mu (char *cp, int l, char *mp) { - unsigned char ch, *ep = cp+l; + char ch, *ep = cp+l; while ((cp < ep) && (ch = *cp)) { diff -r 12e008d41344 -r 697ef44129c6 src/mule-ccl.c --- a/src/mule-ccl.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule-ccl.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ /* CCL (Code Conversion Language) interpreter. - Copyright (C) 1995, 1997, 1998, 1999 Electrotechnical Laboratory, JAPAN. + Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. This file is part of XEmacs. @@ -19,19 +19,11 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with : FSF Emacs 20.3.10 without ExCCL - * (including {Read|Write}MultibyteChar) */ +/* Synched up with : FSF Emacs 20.2 */ #ifdef emacs #include <config.h> - -#if 0 -#ifdef STDC_HEADERS -#include <stdlib.h> -#endif -#endif - #include "lisp.h" #include "buffer.h" #include "mule-charset.h" @@ -45,29 +37,9 @@ #endif /* not emacs */ -/* This contains all code conversion map available to CCL. */ -/* -Lisp_Object Vcode_conversion_map_vector; -*/ - /* Alist of fontname patterns vs corresponding CCL program. */ Lisp_Object Vfont_ccl_encoder_alist; -/* This symbol is a property which assocates with ccl program vector. - Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */ -Lisp_Object Qccl_program; - -/* These symbols are properties which associate with code conversion - map and their ID respectively. */ -/* -Lisp_Object Qcode_conversion_map; -Lisp_Object Qcode_conversion_map_id; -*/ - -/* Symbols of ccl program have this property, a value of the property - is an index for Vccl_protram_table. */ -Lisp_Object Qccl_program_idx; - /* Vector of CCL program names vs corresponding program data. */ Lisp_Object Vccl_program_table; @@ -181,18 +153,18 @@ #define CCL_WriteConstJump 0x08 /* Write constant and jump: 1:A--D--D--R--E--S--S-000XXXXX - 2:const + 2:CONST ------------------------------ - write (const); + write (CONST); IC += ADDRESS; */ #define CCL_WriteConstReadJump 0x09 /* Write constant, read, and jump: 1:A--D--D--R--E--S--S-rrrXXXXX - 2:const + 2:CONST 3:A--D--D--R--E--S--S-rrrYYYYY ----------------------------- - write (const); + write (CONST); IC += 2; read (reg[rrr]); IC += ADDRESS; @@ -299,8 +271,7 @@ write (reg[RRR] OPERATION reg[Rrr]); */ -#define CCL_Call 0x13 /* Call the CCL program whose ID is - (CC..C). +#define CCL_Call 0x13 /* Write a constant: 1:CCCCCCCCCCCCCCCCCCCC000XXXXX ------------------------------ call (CC..C) @@ -422,7 +393,7 @@ IC += 2; */ -#define CCL_Extension 0x1F /* Extended CCL code +#define CCL_Extention 0x1F /* Extended CCL code 1:ExtendedCOMMNDRrrRRRrrrXXXXX 2:ARGUEMENT 3:... @@ -430,192 +401,6 @@ extended_command (rrr,RRR,Rrr,ARGS) */ -/* - Here after, Extended CCL Instructions. - Bit length of extended command is 14. - Therefore, the instruction code range is 0..16384(0x3fff). - */ - -/* Read a multibyte characeter. - A code point is stored into reg[rrr]. A charset ID is stored into - reg[RRR]. */ - -#define CCL_ReadMultibyteChar2 0x00 /* Read Multibyte Character - 1:ExtendedCOMMNDRrrRRRrrrXXXXX */ - -/* Write a multibyte character. - Write a character whose code point is reg[rrr] and the charset ID - is reg[RRR]. */ - -#define CCL_WriteMultibyteChar2 0x01 /* Write Multibyte Character - 1:ExtendedCOMMNDRrrRRRrrrXXXXX */ - -#if 0 -/* Translate a character whose code point is reg[rrr] and the charset - ID is reg[RRR] by a translation table whose ID is reg[Rrr]. - - A translated character is set in reg[rrr] (code point) and reg[RRR] - (charset ID). */ - -#define CCL_TranslateCharacter 0x02 /* Translate a multibyte character - 1:ExtendedCOMMNDRrrRRRrrrXXXXX */ - -/* Translate a character whose code point is reg[rrr] and the charset - ID is reg[RRR] by a translation table whose ID is ARGUMENT. - - A translated character is set in reg[rrr] (code point) and reg[RRR] - (charset ID). */ - -#define CCL_TranslateCharacterConstTbl 0x03 /* Translate a multibyte character - 1:ExtendedCOMMNDRrrRRRrrrXXXXX - 2:ARGUMENT(Translation Table ID) - */ - -/* Iterate looking up MAPs for reg[rrr] starting from the Nth (N = - reg[RRR]) MAP until some value is found. - - Each MAP is a Lisp vector whose element is number, nil, t, or - lambda. - If the element is nil, ignore the map and proceed to the next map. - If the element is t or lambda, finish without changing reg[rrr]. - If the element is a number, set reg[rrr] to the number and finish. - - Detail of the map structure is descibed in the comment for - CCL_MapMultiple below. */ - -#define CCL_IterateMultipleMap 0x10 /* Iterate multiple maps - 1:ExtendedCOMMNDXXXRRRrrrXXXXX - 2:NUMBER of MAPs - 3:MAP-ID1 - 4:MAP-ID2 - ... - */ - -/* Map the code in reg[rrr] by MAPs starting from the Nth (N = - reg[RRR]) map. - - MAPs are supplied in the succeeding CCL codes as follows: - - When CCL program gives this nested structure of map to this command: - ((MAP-ID11 - MAP-ID12 - (MAP-ID121 MAP-ID122 MAP-ID123) - MAP-ID13) - (MAP-ID21 - (MAP-ID211 (MAP-ID2111) MAP-ID212) - MAP-ID22)), - the compiled CCL codes has this sequence: - CCL_MapMultiple (CCL code of this command) - 16 (total number of MAPs and SEPARATORs) - -7 (1st SEPARATOR) - MAP-ID11 - MAP-ID12 - -3 (2nd SEPARATOR) - MAP-ID121 - MAP-ID122 - MAP-ID123 - MAP-ID13 - -7 (3rd SEPARATOR) - MAP-ID21 - -4 (4th SEPARATOR) - MAP-ID211 - -1 (5th SEPARATOR) - MAP_ID2111 - MAP-ID212 - MAP-ID22 - - A value of each SEPARATOR follows this rule: - MAP-SET := SEPARATOR [(MAP-ID | MAP-SET)]+ - SEPARATOR := -(number of MAP-IDs and SEPARATORs in the MAP-SET) - - (*)....Nest level of MAP-SET must not be over than MAX_MAP_SET_LEVEL. - - When some map fails to map (i.e. it doesn't have a value for - reg[rrr]), the mapping is treated as identity. - - The mapping is iterated for all maps in each map set (set of maps - separated by SEPARATOR) except in the case that lambda is - encountered. More precisely, the mapping proceeds as below: - - At first, VAL0 is set to reg[rrr], and it is translated by the - first map to VAL1. Then, VAL1 is translated by the next map to - VAL2. This mapping is iterated until the last map is used. The - result of the mapping is the last value of VAL?. - - But, when VALm is mapped to VALn and VALn is not a number, the - mapping proceed as below: - - If VALn is nil, the lastest map is ignored and the mapping of VALm - proceed to the next map. - - In VALn is t, VALm is reverted to reg[rrr] and the mapping of VALm - proceed to the next map. - - If VALn is lambda, the whole mapping process terminates, and VALm - is the result of this mapping. - - Each map is a Lisp vector of the following format (a) or (b): - (a)......[STARTPOINT VAL1 VAL2 ...] - (b)......[t VAL STARTPOINT ENDPOINT], - where - STARTPOINT is an offset to be used for indexing a map, - ENDPOINT is a maximum index number of a map, - VAL and VALn is a number, nil, t, or lambda. - - Valid index range of a map of type (a) is: - STARTPOINT <= index < STARTPOINT + map_size - 1 - Valid index range of a map of type (b) is: - STARTPOINT <= index < ENDPOINT */ - -#define CCL_MapMultiple 0x11 /* Mapping by multiple code conversion maps - 1:ExtendedCOMMNDXXXRRRrrrXXXXX - 2:N-2 - 3:SEPARATOR_1 (< 0) - 4:MAP-ID_1 - 5:MAP-ID_2 - ... - M:SEPARATOR_x (< 0) - M+1:MAP-ID_y - ... - N:SEPARATOR_z (< 0) - */ - -#define MAX_MAP_SET_LEVEL 20 - -typedef struct -{ - int rest_length; - int orig_val; -} tr_stack; - -static tr_stack mapping_stack[MAX_MAP_SET_LEVEL]; -static tr_stack *mapping_stack_pointer; -#endif - -#define PUSH_MAPPING_STACK(restlen, orig) \ -{ \ - mapping_stack_pointer->rest_length = (restlen); \ - mapping_stack_pointer->orig_val = (orig); \ - mapping_stack_pointer++; \ -} - -#define POP_MAPPING_STACK(restlen, orig) \ -{ \ - mapping_stack_pointer--; \ - (restlen) = mapping_stack_pointer->rest_length; \ - (orig) = mapping_stack_pointer->orig_val; \ -} \ - -#define CCL_MapSingle 0x12 /* Map by single code conversion map - 1:ExtendedCOMMNDXXXRRRrrrXXXXX - 2:MAP-ID - ------------------------------ - Map reg[rrr] by MAP-ID. - If some valid mapping is found, - set reg[rrr] to the result, - else - set reg[RRR] to -1. - */ /* CCL arithmetic/logical operators. */ #define CCL_PLUS 0x00 /* X = Y + Z */ @@ -638,28 +423,18 @@ #define CCL_GE 0x14 /* X = (X >= Y) */ #define CCL_NE 0x15 /* X = (X != Y) */ -#define CCL_DECODE_SJIS 0x16 /* X = HIGHER_BYTE (DE-SJIS (Y, Z)) +#define CCL_ENCODE_SJIS 0x16 /* X = HIGHER_BYTE (SJIS (Y, Z)) + r[7] = LOWER_BYTE (SJIS (Y, Z) */ +#define CCL_DECODE_SJIS 0x17 /* X = HIGHER_BYTE (DE-SJIS (Y, Z)) r[7] = LOWER_BYTE (DE-SJIS (Y, Z)) */ -#define CCL_ENCODE_SJIS 0x17 /* X = HIGHER_BYTE (SJIS (Y, Z)) - r[7] = LOWER_BYTE (SJIS (Y, Z) */ -/* Suspend CCL program because of reading from empty input buffer or - writing to full output buffer. When this program is resumed, the - same I/O command is executed. The `if (1)' is for warning suppression. */ -#define CCL_SUSPEND(stat) \ - do { \ - ic--; \ - ccl->status = stat; \ - if (1) goto ccl_finish; \ - } while (0) - -/* Terminate CCL program because of invalid command. Should not occur - in the normal case. The `if (1)' is for warning suppression. */ -#define CCL_INVALID_CMD \ - do { \ - ccl->status = CCL_STAT_INVALID_CMD; \ - if (1) goto ccl_error_handler; \ - } while (0) +/* Macros for exit status of CCL program. */ +#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */ +#define CCL_STAT_SUSPEND 1 /* Terminated because of empty input + buffer or full output buffer. */ +#define CCL_STAT_INVALID_CMD 2 /* Terminated because of invalid + command. */ +#define CCL_STAT_QUIT 3 /* Terminated because of quit. */ /* Encode one character CH to multibyte form and write to the current output buffer. If CH is less than 256, CH is written as is. */ @@ -672,8 +447,7 @@ else \ { \ Bufbyte work[MAX_EMCHAR_LEN]; \ - int len = ( ch < ( conversion_mode == CCL_MODE_ENCODING ? \ - 256 : 128 ) ) ? \ + int len = ( ch < 256 ) ? \ simple_set_charptr_emchar (work, ch) : \ non_ascii_set_charptr_emchar (work, ch); \ Dynarr_add_many (destination, work, len); \ @@ -682,32 +456,22 @@ /* Write a string at ccl_prog[IC] of length LEN to the current output buffer. */ -#define CCL_WRITE_STRING(len) do { \ - if (!destination) \ - { \ - ccl->status = CCL_STAT_INVALID_CMD; \ - goto ccl_error_handler; \ - } \ - else \ - { \ - Bufbyte work[MAX_EMCHAR_LEN]; \ - for (i = 0; i < len; i++) \ - { \ - int ch = (XINT (ccl_prog[ic + (i / 3)]) \ - >> ((2 - (i % 3)) * 8)) & 0xFF; \ - int bytes = \ - ( ch < ( conversion_mode == CCL_MODE_ENCODING ? \ - 256 : 128 ) ) ? \ - simple_set_charptr_emchar (work, ch) : \ - non_ascii_set_charptr_emchar (work, ch); \ - Dynarr_add_many (destination, work, bytes); \ - } \ - } \ +#define CCL_WRITE_STRING(len) do { \ + if (!destination) \ + { \ + ccl->status = CCL_STAT_INVALID_CMD; \ + goto ccl_error_handler; \ + } \ + else \ + for (i = 0; i < len; i++) \ + Dynarr_add(destination, \ + (XINT (ccl_prog[ic + (i / 3)]) \ + >> ((2 - (i % 3)) * 8)) & 0xFF); \ } while (0) /* Read one byte from the current input buffer into Rth register. */ #define CCL_READ_CHAR(r) do { \ - if (!src && !ccl->last_block) \ + if (!src) \ { \ ccl->status = CCL_STAT_INVALID_CMD; \ goto ccl_error_handler; \ @@ -717,7 +481,7 @@ else if (ccl->last_block) \ { \ ic = ccl->eof_ic; \ - goto ccl_repeat; \ + goto ccl_finish; \ } \ else \ /* Suspend CCL program because of \ @@ -727,7 +491,7 @@ same I/O command is executed. */ \ { \ ic--; \ - ccl->status = CCL_STAT_SUSPEND_BY_SRC; \ + ccl->status = CCL_STAT_SUSPEND; \ goto ccl_finish; \ } \ } while (0) @@ -752,41 +516,31 @@ int ic; /* Instruction Counter. */ }; -/* For the moment, we only support depth 256 of stack. */ -static struct ccl_prog_stack ccl_prog_stack_struct[256]; - int -ccl_driver (struct ccl_program *ccl, const unsigned char *source, - unsigned_char_dynarr *destination, int src_bytes, - int *consumed, int conversion_mode) +ccl_driver (struct ccl_program *ccl, CONST unsigned char *source, unsigned_char_dynarr *destination, int src_bytes, int *consumed) { int *reg = ccl->reg; int ic = ccl->ic; int code = -1; /* init to illegal value, */ int field1, field2; Lisp_Object *ccl_prog = ccl->prog; - const unsigned char *src = source, *src_end = src + src_bytes; + CONST unsigned char *src = source, *src_end = src + src_bytes; int jump_address = 0; /* shut up the compiler */ + int i, j, op; - int stack_idx = ccl->stack_idx; - /* Instruction counter of the current CCL code. */ - int this_ic = 0; + int stack_idx = 0; + /* For the moment, we only support depth 256 of stack. */ + struct ccl_prog_stack ccl_prog_stack_struct[256]; if (ic >= ccl->eof_ic) ic = CCL_HEADER_MAIN; -#if 0 /* not for XEmacs ? */ - if (ccl->buf_magnification ==0) /* We can't produce any bytes. */ - dst = NULL; -#endif - #ifdef CCL_DEBUG ccl_backtrace_idx = 0; #endif for (;;) { - ccl_repeat: #ifdef CCL_DEBUG ccl_backtrace_table[ccl_backtrace_idx++] = ic; if (ccl_backtrace_idx >= CCL_DEBUG_BACKTRACE_LEN) @@ -805,7 +559,6 @@ break; } - this_ic = ic; code = XINT (ccl_prog[ic]); ic++; field1 = code >> 8; field2 = (code & 0xFF) >> 5; @@ -814,7 +567,6 @@ #define RRR (field1 & 7) #define Rrr ((field1 >> 3) & 7) #define ADDR field1 -#define EXCMD (field1 >> 6) switch (code & 0x1F) { @@ -1004,13 +756,9 @@ ic = ccl_prog_stack_struct[stack_idx].ic; break; } - if (src) - src = src_end; - /* ccl->ic should points to this command code again to - suppress further processing. */ - ic--; /* Terminate CCL program successfully. */ ccl->status = CCL_STAT_SUCCESS; + ccl->ic = CCL_HEADER_MAIN; goto ccl_finish; case CCL_ExprSelfConst: /* 00000OPERATION000000rrrXXXXX */ @@ -1108,8 +856,8 @@ case CCL_LE: reg[rrr] = i <= j; break; case CCL_GE: reg[rrr] = i >= j; break; case CCL_NE: reg[rrr] = i != j; break; + case CCL_ENCODE_SJIS: ENCODE_SJIS (i, j, reg[rrr], reg[7]); break; case CCL_DECODE_SJIS: DECODE_SJIS (i, j, reg[rrr], reg[7]); break; - case CCL_ENCODE_SJIS: ENCODE_SJIS (i, j, reg[rrr], reg[7]); break; default: ccl->status = CCL_STAT_INVALID_CMD; goto ccl_error_handler; @@ -1124,463 +872,6 @@ ic = jump_address; break; - case CCL_Extension: - switch (EXCMD) - { - case CCL_ReadMultibyteChar2: - if (!src) - CCL_INVALID_CMD; - - do { - if (src >= src_end) - { - src++; - goto ccl_read_multibyte_character_suspend; - } - - i = *src++; -#if 0 - if (i == LEADING_CODE_COMPOSITION) - { - if (src >= src_end) - goto ccl_read_multibyte_character_suspend; - if (*src == 0xFF) - { - ccl->private_state = COMPOSING_WITH_RULE_HEAD; - src++; - } - else - ccl->private_state = COMPOSING_NO_RULE_HEAD; - - continue; - } - if (ccl->private_state != COMPOSING_NO) - { - /* composite character */ - if (i < 0xA0) - ccl->private_state = COMPOSING_NO; - else - { - if (COMPOSING_WITH_RULE_RULE == ccl->private_state) - { - ccl->private_state = COMPOSING_WITH_RULE_HEAD; - continue; - } - else if (COMPOSING_WITH_RULE_HEAD == ccl->private_state) - ccl->private_state = COMPOSING_WITH_RULE_RULE; - - if (i == 0xA0) - { - if (src >= src_end) - goto ccl_read_multibyte_character_suspend; - i = *src++ & 0x7F; - } - else - i -= 0x20; - } - } -#endif - - if (i < 0x80) - { - /* ASCII */ - reg[rrr] = i; - reg[RRR] = LEADING_BYTE_ASCII; - } - else if (i <= MAX_LEADING_BYTE_OFFICIAL_1) - { - if (src >= src_end) - goto ccl_read_multibyte_character_suspend; - reg[RRR] = i; - reg[rrr] = (*src++ & 0x7F); - } - else if (i <= MAX_LEADING_BYTE_OFFICIAL_2) - { - if ((src + 1) >= src_end) - goto ccl_read_multibyte_character_suspend; - reg[RRR] = i; - i = (*src++ & 0x7F); - reg[rrr] = ((i << 7) | (*src & 0x7F)); - src++; - } - else if (i == PRE_LEADING_BYTE_PRIVATE_1) - { - if ((src + 1) >= src_end) - goto ccl_read_multibyte_character_suspend; - reg[RRR] = *src++; - reg[rrr] = (*src++ & 0x7F); - } - else if (i == PRE_LEADING_BYTE_PRIVATE_2) - { - if ((src + 2) >= src_end) - goto ccl_read_multibyte_character_suspend; - reg[RRR] = *src++; - i = (*src++ & 0x7F); - reg[rrr] = ((i << 7) | (*src & 0x7F)); - src++; - } - else - { - /* INVALID CODE. Return a single byte character. */ - reg[RRR] = LEADING_BYTE_ASCII; - reg[rrr] = i; - } - break; - } while (1); - break; - - ccl_read_multibyte_character_suspend: - src--; - if (ccl->last_block) - { - ic = ccl->eof_ic; - goto ccl_repeat; - } - else - CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC); - - break; - - case CCL_WriteMultibyteChar2: - i = reg[RRR]; /* charset */ - if (i == LEADING_BYTE_ASCII) - i = reg[rrr] & 0xFF; -#if 0 - else if (i == CHARSET_COMPOSITION) - i = MAKE_COMPOSITE_CHAR (reg[rrr]); -#endif - else if (XCHARSET_DIMENSION (CHARSET_BY_LEADING_BYTE (i)) == 1) - i = ((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7) - | (reg[rrr] & 0x7F); - else if (i < MIN_LEADING_BYTE_OFFICIAL_2) - i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14) | reg[rrr]; - else - i = ((i - FIELD1_TO_PRIVATE_LEADING_BYTE) << 14) | reg[rrr]; - - CCL_WRITE_CHAR (i); - - break; - -#if 0 - case CCL_TranslateCharacter: - i = reg[RRR]; /* charset */ - if (i == LEADING_BYTE_ASCII) - i = reg[rrr]; - else if (i == CHARSET_COMPOSITION) - { - reg[RRR] = -1; - break; - } - else if (CHARSET_DIMENSION (i) == 1) - i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); - else if (i < MIN_LEADING_BYTE_OFFICIAL_2) - i = ((i - 0x8F) << 14) | (reg[rrr] & 0x3FFF); - else - i = ((i - 0xE0) << 14) | (reg[rrr] & 0x3FFF); - - op = translate_char (GET_TRANSLATION_TABLE (reg[Rrr]), - i, -1, 0, 0); - SPLIT_CHAR (op, reg[RRR], i, j); - if (j != -1) - i = (i << 7) | j; - - reg[rrr] = i; - break; - - case CCL_TranslateCharacterConstTbl: - op = XINT (ccl_prog[ic]); /* table */ - ic++; - i = reg[RRR]; /* charset */ - if (i == LEADING_BYTE_ASCII) - i = reg[rrr]; - else if (i == CHARSET_COMPOSITION) - { - reg[RRR] = -1; - break; - } - else if (CHARSET_DIMENSION (i) == 1) - i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); - else if (i < MIN_LEADING_BYTE_OFFICIAL_2) - i = ((i - 0x8F) << 14) | (reg[rrr] & 0x3FFF); - else - i = ((i - 0xE0) << 14) | (reg[rrr] & 0x3FFF); - - op = translate_char (GET_TRANSLATION_TABLE (op), i, -1, 0, 0); - SPLIT_CHAR (op, reg[RRR], i, j); - if (j != -1) - i = (i << 7) | j; - - reg[rrr] = i; - break; - - case CCL_IterateMultipleMap: - { - Lisp_Object map, content, attrib, value; - int point, size, fin_ic; - - j = XINT (ccl_prog[ic++]); /* number of maps. */ - fin_ic = ic + j; - op = reg[rrr]; - if ((j > reg[RRR]) && (j >= 0)) - { - ic += reg[RRR]; - i = reg[RRR]; - } - else - { - reg[RRR] = -1; - ic = fin_ic; - break; - } - - for (;i < j;i++) - { - - size = XVECTOR (Vcode_conversion_map_vector)->size; - point = XINT (ccl_prog[ic++]); - if (point >= size) continue; - map = - XVECTOR (Vcode_conversion_map_vector)->contents[point]; - - /* Check map varidity. */ - if (!CONSP (map)) continue; - map = XCONS(map)->cdr; - if (!VECTORP (map)) continue; - size = XVECTOR (map)->size; - if (size <= 1) continue; - - content = XVECTOR (map)->contents[0]; - - /* check map type, - [STARTPOINT VAL1 VAL2 ...] or - [t ELELMENT STARTPOINT ENDPOINT] */ - if (NUMBERP (content)) - { - point = XUINT (content); - point = op - point + 1; - if (!((point >= 1) && (point < size))) continue; - content = XVECTOR (map)->contents[point]; - } - else if (EQ (content, Qt)) - { - if (size != 4) continue; - if ((op >= XUINT (XVECTOR (map)->contents[2])) - && (op < XUINT (XVECTOR (map)->contents[3]))) - content = XVECTOR (map)->contents[1]; - else - continue; - } - else - continue; - - if (NILP (content)) - continue; - else if (NUMBERP (content)) - { - reg[RRR] = i; - reg[rrr] = XINT(content); - break; - } - else if (EQ (content, Qt) || EQ (content, Qlambda)) - { - reg[RRR] = i; - break; - } - else if (CONSP (content)) - { - attrib = XCONS (content)->car; - value = XCONS (content)->cdr; - if (!NUMBERP (attrib) || !NUMBERP (value)) - continue; - reg[RRR] = i; - reg[rrr] = XUINT (value); - break; - } - } - if (i == j) - reg[RRR] = -1; - ic = fin_ic; - } - break; - - case CCL_MapMultiple: - { - Lisp_Object map, content, attrib, value; - int point, size, map_vector_size; - int map_set_rest_length, fin_ic; - - map_set_rest_length = - XINT (ccl_prog[ic++]); /* number of maps and separators. */ - fin_ic = ic + map_set_rest_length; - if ((map_set_rest_length > reg[RRR]) && (reg[RRR] >= 0)) - { - ic += reg[RRR]; - i = reg[RRR]; - map_set_rest_length -= i; - } - else - { - ic = fin_ic; - reg[RRR] = -1; - break; - } - mapping_stack_pointer = mapping_stack; - op = reg[rrr]; - PUSH_MAPPING_STACK (0, op); - reg[RRR] = -1; - map_vector_size = XVECTOR (Vcode_conversion_map_vector)->size; - for (;map_set_rest_length > 0;i++, map_set_rest_length--) - { - point = XINT(ccl_prog[ic++]); - if (point < 0) - { - point = -point; - if (mapping_stack_pointer - >= &mapping_stack[MAX_MAP_SET_LEVEL]) - { - CCL_INVALID_CMD; - } - PUSH_MAPPING_STACK (map_set_rest_length - point, - reg[rrr]); - map_set_rest_length = point + 1; - reg[rrr] = op; - continue; - } - - if (point >= map_vector_size) continue; - map = (XVECTOR (Vcode_conversion_map_vector) - ->contents[point]); - - /* Check map varidity. */ - if (!CONSP (map)) continue; - map = XCONS (map)->cdr; - if (!VECTORP (map)) continue; - size = XVECTOR (map)->size; - if (size <= 1) continue; - - content = XVECTOR (map)->contents[0]; - - /* check map type, - [STARTPOINT VAL1 VAL2 ...] or - [t ELEMENT STARTPOINT ENDPOINT] */ - if (NUMBERP (content)) - { - point = XUINT (content); - point = op - point + 1; - if (!((point >= 1) && (point < size))) continue; - content = XVECTOR (map)->contents[point]; - } - else if (EQ (content, Qt)) - { - if (size != 4) continue; - if ((op >= XUINT (XVECTOR (map)->contents[2])) && - (op < XUINT (XVECTOR (map)->contents[3]))) - content = XVECTOR (map)->contents[1]; - else - continue; - } - else - continue; - - if (NILP (content)) - continue; - else if (NUMBERP (content)) - { - op = XINT (content); - reg[RRR] = i; - i += map_set_rest_length; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - } - else if (CONSP (content)) - { - attrib = XCONS (content)->car; - value = XCONS (content)->cdr; - if (!NUMBERP (attrib) || !NUMBERP (value)) - continue; - reg[RRR] = i; - op = XUINT (value); - i += map_set_rest_length; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - } - else if (EQ (content, Qt)) - { - reg[RRR] = i; - op = reg[rrr]; - i += map_set_rest_length; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - } - else if (EQ (content, Qlambda)) - { - break; - } - else - CCL_INVALID_CMD; - } - ic = fin_ic; - } - reg[rrr] = op; - break; - - case CCL_MapSingle: - { - Lisp_Object map, attrib, value, content; - int size, point; - j = XINT (ccl_prog[ic++]); /* map_id */ - op = reg[rrr]; - if (j >= XVECTOR (Vcode_conversion_map_vector)->size) - { - reg[RRR] = -1; - break; - } - map = XVECTOR (Vcode_conversion_map_vector)->contents[j]; - if (!CONSP (map)) - { - reg[RRR] = -1; - break; - } - map = XCONS(map)->cdr; - if (!VECTORP (map)) - { - reg[RRR] = -1; - break; - } - size = XVECTOR (map)->size; - point = XUINT (XVECTOR (map)->contents[0]); - point = op - point + 1; - reg[RRR] = 0; - if ((size <= 1) || - (!((point >= 1) && (point < size)))) - reg[RRR] = -1; - else - { - content = XVECTOR (map)->contents[point]; - if (NILP (content)) - reg[RRR] = -1; - else if (NUMBERP (content)) - reg[rrr] = XINT (content); - else if (EQ (content, Qt)) - reg[RRR] = i; - else if (CONSP (content)) - { - attrib = XCONS (content)->car; - value = XCONS (content)->cdr; - if (!NUMBERP (attrib) || !NUMBERP (value)) - continue; - reg[rrr] = XUINT(value); - break; - } - else - reg[RRR] = -1; - } - } - break; -#endif - - default: - CCL_INVALID_CMD; - } - break; - default: ccl->status = CCL_STAT_INVALID_CMD; goto ccl_error_handler; @@ -1595,18 +886,13 @@ there. */ char msg[256]; -#if 0 /* not for XEmacs ? */ - if (!dst) - dst = destination; -#endif - switch (ccl->status) { /* Terminate CCL program because of invalid command. Should not occur in the normal case. */ case CCL_STAT_INVALID_CMD: sprintf(msg, "\nCCL: Invalid command %x (ccl_code = %x) at %d.", - code & 0x1F, code, this_ic); + code & 0x1F, code, ic); #ifdef CCL_DEBUG { int i = ccl_backtrace_idx - 1; @@ -1622,10 +908,9 @@ sprintf(msg, " %d", ccl_backtrace_table[i]); Dynarr_add_many (destination, (unsigned char *) msg, strlen (msg)); } - goto ccl_finish; } #endif - break; + goto ccl_finish; case CCL_STAT_QUIT: sprintf(msg, "\nCCL: Quited."); @@ -1640,8 +925,6 @@ ccl_finish: ccl->ic = ic; - ccl->stack_idx = stack_idx; - ccl->prog = ccl_prog; if (consumed) *consumed = src - source; if (destination) return Dynarr_length (destination); @@ -1650,91 +933,31 @@ } /* Setup fields of the structure pointed by CCL appropriately for the - execution of compiled CCL code in VEC (vector of integer). - If VEC is nil, we skip setting ups based on VEC. */ + execution of compiled CCL code in VEC (vector of integer). */ void setup_ccl_program (struct ccl_program *ccl, Lisp_Object vec) { int i; - if (VECTORP (vec)) - { - ccl->size = XVECTOR_LENGTH (vec); - ccl->prog = XVECTOR_DATA (vec); - ccl->eof_ic = XINT (XVECTOR_DATA (vec)[CCL_HEADER_EOF]); - ccl->buf_magnification = XINT (XVECTOR_DATA (vec)[CCL_HEADER_BUF_MAG]); - } + ccl->size = XVECTOR_LENGTH (vec); + ccl->prog = XVECTOR_DATA (vec); ccl->ic = CCL_HEADER_MAIN; + ccl->eof_ic = XINT (XVECTOR_DATA (vec)[CCL_HEADER_EOF]); + ccl->buf_magnification = XINT (XVECTOR_DATA (vec)[CCL_HEADER_BUF_MAG]); for (i = 0; i < 8; i++) ccl->reg[i] = 0; ccl->last_block = 0; - ccl->private_state = 0; ccl->status = 0; - ccl->stack_idx = 0; } -/* Resolve symbols in the specified CCL code (Lisp vector). This - function converts symbols of code conversion maps and character - translation tables embeded in the CCL code into their ID numbers. */ - -static Lisp_Object -resolve_symbol_ccl_program (Lisp_Object ccl) -{ - int i, veclen; - Lisp_Object result, contents /*, prop */; - - result = ccl; - veclen = XVECTOR_LENGTH (result); - - /* Set CCL program's table ID */ - for (i = 0; i < veclen; i++) - { - contents = XVECTOR_DATA (result)[i]; - if (SYMBOLP (contents)) - { - if (EQ(result, ccl)) - result = Fcopy_sequence (ccl); - -#if 0 - prop = Fget (contents, Qtranslation_table_id); - if (NUMBERP (prop)) - { - XVECTOR_DATA (result)[i] = prop; - continue; - } - prop = Fget (contents, Qcode_conversion_map_id); - if (NUMBERP (prop)) - { - XVECTOR_DATA (result)[i] = prop; - continue; - } - prop = Fget (contents, Qccl_program_idx); - if (NUMBERP (prop)) - { - XVECTOR_DATA (result)[i] = prop; - continue; - } -#endif - } - } - - return result; -} - - #ifdef emacs DEFUN ("ccl-execute", Fccl_execute, 2, 2, 0, /* Execute CCL-PROGRAM with registers initialized by REGISTERS. - -CCL-PROGRAM is a symbol registered by register-ccl-program, -or a compiled code generated by `ccl-compile' (for backward compatibility, -in this case, the execution is slower). -No I/O commands should appear in CCL-PROGRAM. - +CCL-PROGRAM is a compiled code generated by `ccl-compile', + no I/O commands should appear in the CCL program. REGISTERS is a vector of [R0 R1 ... R7] where RN is an initial value of Nth register. - As side effect, each element of REGISTER holds the value of corresponding register after the execution. */ @@ -1742,25 +965,11 @@ { struct ccl_program ccl; int i; - Lisp_Object ccl_id; - if (SYMBOLP (ccl_prog) && - !NILP (ccl_id = Fget (ccl_prog, Qccl_program_idx, Qnil))) - { - ccl_prog = XVECTOR_DATA (Vccl_program_table)[XUINT (ccl_id)]; - CHECK_LIST (ccl_prog); - ccl_prog = XCDR (ccl_prog); - CHECK_VECTOR (ccl_prog); - } - else - { - CHECK_VECTOR (ccl_prog); - ccl_prog = resolve_symbol_ccl_program (ccl_prog); - } - + CHECK_VECTOR (ccl_prog); CHECK_VECTOR (reg); if (XVECTOR_LENGTH (reg) != 8) - error ("Invalid length of vector REGISTERS"); + signal_simple_error ("Vector should be of length 8", reg); setup_ccl_program (&ccl, ccl_prog); for (i = 0; i < 8; i++) @@ -1768,8 +977,8 @@ ? XINT (XVECTOR_DATA (reg)[i]) : 0); - ccl_driver (&ccl, (const unsigned char *)0, (unsigned_char_dynarr *)0, - 0, (int *)0, CCL_MODE_ENCODING); + ccl_driver (&ccl, (CONST unsigned char *)0, (unsigned_char_dynarr *)0, + 0, (int *)0); QUIT; if (ccl.status != CCL_STAT_SUCCESS) error ("Error in CCL program at %dth code", ccl.ic); @@ -1781,26 +990,18 @@ DEFUN ("ccl-execute-on-string", Fccl_execute_on_string, 3, 4, 0, /* Execute CCL-PROGRAM with initial STATUS on STRING. - -CCL-PROGRAM is a symbol registered by register-ccl-program, -or a compiled code generated by `ccl-compile' (for backward compatibility, -in this case, the execution is slower). - +CCL-PROGRAM is a compiled code generated by `ccl-compile'. Read buffer is set to STRING, and write buffer is allocated automatically. - -If IC is nil, it is initialized to head of the CCL program.\n\ STATUS is a vector of [R0 R1 ... R7 IC], where R0..R7 are initial values of corresponding registers, IC is the instruction counter specifying from where to start the program. If R0..R7 are nil, they are initialized to 0. If IC is nil, it is initialized to head of the CCL program. - +Returns the contents of write buffer as a string, + and as side effect, STATUS is updated. If optional 4th arg CONTINUE is non-nil, keep IC on read operation when read buffer is exausted, else, IC is always set to the end of CCL-PROGRAM on exit. - -It returns the contents of write buffer as a string, - and as side effect, STATUS is updated. */ (ccl_prog, status, str, contin)) { @@ -1809,22 +1010,8 @@ int i, produced; unsigned_char_dynarr *outbuf; struct gcpro gcpro1, gcpro2, gcpro3; - Lisp_Object ccl_id; - if (SYMBOLP (ccl_prog) && - !NILP (ccl_id = Fget (ccl_prog, Qccl_program_idx, Qnil))) - { - ccl_prog = XVECTOR (Vccl_program_table)->contents[XUINT (ccl_id)]; - CHECK_LIST (ccl_prog); - ccl_prog = XCDR (ccl_prog); - CHECK_VECTOR (ccl_prog); - } - else - { - CHECK_VECTOR (ccl_prog); - ccl_prog = resolve_symbol_ccl_program (ccl_prog); - } - + CHECK_VECTOR (ccl_prog); CHECK_VECTOR (status); if (XVECTOR_LENGTH (status) != 9) signal_simple_error ("Vector should be of length 9", status); @@ -1848,7 +1035,7 @@ outbuf = Dynarr_new (unsigned_char); ccl.last_block = NILP (contin); produced = ccl_driver (&ccl, XSTRING_DATA (str), outbuf, - XSTRING_LENGTH (str), (int *)0, CCL_MODE_DECODING); + XSTRING_LENGTH (str), (int *)0); for (i = 0; i < 8; i++) XVECTOR_DATA (status)[i] = make_int(ccl.reg[i]); XSETINT (XVECTOR_DATA (status)[8], ccl.ic); @@ -1858,8 +1045,7 @@ Dynarr_free (outbuf); QUIT; if (ccl.status != CCL_STAT_SUCCESS - && ccl.status != CCL_STAT_SUSPEND_BY_SRC - && ccl.status != CCL_STAT_SUSPEND_BY_DST) + && ccl.status != CCL_STAT_SUSPEND) error ("Error in CCL program at %dth code", ccl.ic); return val; @@ -1877,10 +1063,7 @@ CHECK_SYMBOL (name); if (!NILP (ccl_prog)) - { - CHECK_VECTOR (ccl_prog); - ccl_prog = resolve_symbol_ccl_program (ccl_prog); - } + CHECK_VECTOR (ccl_prog); for (i = 0; i < len; i++) { @@ -1908,107 +1091,15 @@ } XVECTOR_DATA (Vccl_program_table)[i] = Fcons (name, ccl_prog); - Fput (name, Qccl_program_idx, make_int (i)); return make_int (i); } -#if 0 -/* Register code conversion map. - A code conversion map consists of numbers, Qt, Qnil, and Qlambda. - The first element is start code point. - The rest elements are mapped numbers. - Symbol t means to map to an original number before mapping. - Symbol nil means that the corresponding element is empty. - Symbol lambda menas to terminate mapping here. -*/ - -DEFUN ("register-code-conversion-map", Fregister_code_conversion_map, - Sregister_code_conversion_map, - 2, 2, 0, - "Register SYMBOL as code conversion map MAP.\n\ -Return index number of the registered map.") - (symbol, map) - Lisp_Object symbol, map; -{ - int len = XVECTOR (Vcode_conversion_map_vector)->size; - int i; - Lisp_Object index; - - CHECK_SYMBOL (symbol, 0); - CHECK_VECTOR (map, 1); - - for (i = 0; i < len; i++) - { - Lisp_Object slot = XVECTOR (Vcode_conversion_map_vector)->contents[i]; - - if (!CONSP (slot)) - break; - - if (EQ (symbol, XCONS (slot)->car)) - { - index = make_int (i); - XCONS (slot)->cdr = map; - Fput (symbol, Qcode_conversion_map, map); - Fput (symbol, Qcode_conversion_map_id, index); - return index; - } - } - - if (i == len) - { - Lisp_Object new_vector = Fmake_vector (make_int (len * 2), Qnil); - int j; - - for (j = 0; j < len; j++) - XVECTOR (new_vector)->contents[j] - = XVECTOR (Vcode_conversion_map_vector)->contents[j]; - Vcode_conversion_map_vector = new_vector; - } - - index = make_int (i); - Fput (symbol, Qcode_conversion_map, map); - Fput (symbol, Qcode_conversion_map_id, index); - XVECTOR (Vcode_conversion_map_vector)->contents[i] = Fcons (symbol, map); - return index; -} -#endif - - void syms_of_mule_ccl (void) { - DEFSUBR (Fccl_execute); - DEFSUBR (Fccl_execute_on_string); - DEFSUBR (Fregister_ccl_program); -#if 0 - DEFSUBR (&Fregister_code_conversion_map); -#endif -} - -void -vars_of_mule_ccl (void) -{ staticpro (&Vccl_program_table); Vccl_program_table = Fmake_vector (make_int (32), Qnil); - Qccl_program = intern ("ccl-program"); - staticpro (&Qccl_program); - - Qccl_program_idx = intern ("ccl-program-idx"); - staticpro (&Qccl_program_idx); - -#if 0 - Qcode_conversion_map = intern ("code-conversion-map"); - staticpro (&Qcode_conversion_map); - - Qcode_conversion_map_id = intern ("code-conversion-map-id"); - staticpro (&Qcode_conversion_map_id); - - DEFVAR_LISP ("code-conversion-map-vector", &Vcode_conversion_map_vector /* -Vector of code conversion maps.*/ ); - Vcode_conversion_map_vector = Fmake_vector (make_int (16), Qnil); -#endif - DEFVAR_LISP ("font-ccl-encoder-alist", &Vfont_ccl_encoder_alist /* Alist of fontname patterns vs corresponding CCL program. Each element looks like (REGEXP . CCL-CODE), @@ -2022,6 +1113,10 @@ If the font is single-byte font, the register R2 is not used. */ ); Vfont_ccl_encoder_alist = Qnil; + + DEFSUBR (Fccl_execute); + DEFSUBR (Fccl_execute_on_string); + DEFSUBR (Fregister_ccl_program); } #endif /* emacs */ diff -r 12e008d41344 -r 697ef44129c6 src/mule-ccl.h --- a/src/mule-ccl.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule-ccl.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,5 +1,5 @@ /* Header for CCL (Code Conversion Language) interpreter. - Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. + Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. This file is part of XEmacs. @@ -19,18 +19,10 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF Emacs 20.3.10 */ - -#ifndef INCLUDED_mule_ccl_h_ -#define INCLUDED_mule_ccl_h_ +/* Synched up with: FSF Emacs 20.2 */ -/* Macros for exit status of CCL program. */ -#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */ -#define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */ -#define CCL_STAT_SUSPEND_BY_DST 2 /* Terminated by output buffer full. */ -#define CCL_STAT_INVALID_CMD 3 /* Terminated because of invalid - command. */ -#define CCL_STAT_QUIT 4 /* Terminated because of quit. */ +#ifndef _CCL_H +#define _CCL_H /* Structure to hold information about running CCL code. Read comments in the file ccl.c for the detail of each field. */ @@ -43,31 +35,19 @@ int reg[8]; /* CCL registers, reg[7] is used for condition flag of relational operations. */ - int private_state; /* CCL instruction may use this - for private use, mainly for preservation - internal states for suspending. - This variable is set to 0 when ccl is - set up. */ int last_block; /* Set to 1 while processing the last block. */ int status; /* Exit status of the CCL program. */ int buf_magnification; /* Output buffer magnification. How many times bigger the output buffer should be than the input buffer. */ - int stack_idx; /* How deep the call of CCL_Call is nested. */ }; - -#define CCL_MODE_ENCODING 0 -#define CCL_MODE_DECODING 1 - -int ccl_driver (struct ccl_program *ccl, const unsigned char *source, - unsigned_char_dynarr *destination, int src_bytes, - int *consumed, int conversion_mode); +int ccl_driver (struct ccl_program *ccl, CONST unsigned char *source, + unsigned_char_dynarr *destination, int src_bytes, int *consumed); void setup_ccl_program (struct ccl_program *ccl, Lisp_Object val); /* Alist of fontname patterns vs corresponding CCL program. */ extern Lisp_Object Vfont_ccl_encoder_alist; -extern Lisp_Object Qccl_program; -#endif /* INCLUDED_mule_ccl_h_ */ +#endif /* _CCL_H */ diff -r 12e008d41344 -r 697ef44129c6 src/mule-charset.c --- a/src/mule-charset.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule-charset.c Mon Aug 13 11:20:41 2007 +0200 @@ -32,7 +32,6 @@ #include "lstream.h" #include "device.h" #include "faces.h" -#include "mule-ccl.h" /* The various pre-defined charsets. */ @@ -74,17 +73,11 @@ #endif /* ENABLE_COMPOSITE_CHARS */ -struct charset_lookup *chlook; +/* Table of charsets indexed by leading byte. */ +Lisp_Object charset_by_leading_byte[128]; -static const struct lrecord_description charset_lookup_description_1[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (struct charset_lookup, charset_by_leading_byte), 128+4*128*2 }, - { XD_END } -}; - -static const struct struct_description charset_lookup_description = { - sizeof (struct charset_lookup), - charset_lookup_description_1 -}; +/* Table of charsets indexed by type/final-byte/direction. */ +Lisp_Object charset_by_attributes[4][128][2]; /* Table of number of bytes in the string representation of a character indexed by the first byte of that representation. @@ -92,9 +85,9 @@ rep_bytes_by_first_byte(c) is more efficient than the equivalent canonical computation: - XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c)) */ + (BYTE_ASCII_P (c) ? 1 : XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c))) */ -const Bytecount rep_bytes_by_first_byte[0xA0] = +Bytecount rep_bytes_by_first_byte[0xA0] = { /* 0x00 - 0x7f are for straight ASCII */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -118,6 +111,7 @@ Lisp_Object Qregistry, Qfinal, Qgraphic; Lisp_Object Qdirection; Lisp_Object Qreverse_direction_charset; +Lisp_Object Qccl_program; Lisp_Object Qleading_byte; Lisp_Object Qshort_name, Qlong_name; @@ -150,6 +144,9 @@ Lisp_Object Vcharset_hash_table; +static Bufbyte next_allocated_1_byte_leading_byte; +static Bufbyte next_allocated_2_byte_leading_byte; + /* Composite characters are characters constructed by overstriking two or more regular characters. @@ -217,7 +214,7 @@ Use the macro charptr_emchar() instead. */ Emchar -non_ascii_charptr_emchar (const Bufbyte *str) +non_ascii_charptr_emchar (CONST Bufbyte *str) { Bufbyte i0 = *str, i1, i2 = 0; Lisp_Object charset; @@ -264,8 +261,7 @@ if (f3 < 0x20) return 0; - if (f3 != 0x20 && f3 != 0x7F && !(f2 >= MIN_CHAR_FIELD2_PRIVATE && - f2 <= MAX_CHAR_FIELD2_PRIVATE)) + if (f3 != 0x20 && f3 != 0x7F) return 1; /* @@ -274,8 +270,6 @@ FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE); - if (EQ (charset, Qnil)) - return 0; return (XCHARSET_CHARS (charset) == 96); } else @@ -300,8 +294,7 @@ } #endif /* ENABLE_COMPOSITE_CHARS */ - if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F - && !(f1 >= MIN_CHAR_FIELD1_PRIVATE && f1 <= MAX_CHAR_FIELD1_PRIVATE)) + if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F) return 1; if (f1 <= MAX_CHAR_FIELD1_OFFICIAL) @@ -311,8 +304,6 @@ charset = CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE); - if (EQ (charset, Qnil)) - return 0; return (XCHARSET_CHARS (charset) == 96); } } @@ -327,7 +318,7 @@ charptr_copy_char() instead. */ Bytecount -non_ascii_charptr_copy_char (const Bufbyte *ptr, Bufbyte *str) +non_ascii_charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *str) { Bufbyte *strptr = str; *strptr = *ptr++; @@ -404,22 +395,22 @@ /************************************************************************/ static Lisp_Object -mark_charset (Lisp_Object obj) +mark_charset (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Charset *cs = XCHARSET (obj); + struct Lisp_Charset *cs = XCHARSET (obj); - mark_object (cs->short_name); - mark_object (cs->long_name); - mark_object (cs->doc_string); - mark_object (cs->registry); - mark_object (cs->ccl_program); + markobj (cs->short_name); + markobj (cs->long_name); + markobj (cs->doc_string); + markobj (cs->registry); + markobj (cs->ccl_program); return cs->name; } static void print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Charset *cs = XCHARSET (obj); + struct Lisp_Charset *cs = XCHARSET (obj); char buf[200]; if (print_readably) @@ -450,20 +441,9 @@ write_c_string (buf, printcharfun); } -static const struct lrecord_description charset_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Charset, name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Charset, doc_string) }, - { XD_LISP_OBJECT, offsetof (Lisp_Charset, registry) }, - { XD_LISP_OBJECT, offsetof (Lisp_Charset, short_name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Charset, long_name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Charset, reverse_direction_charset) }, - { XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, - mark_charset, print_charset, 0, 0, 0, charset_description, - Lisp_Charset); + mark_charset, print_charset, 0, 0, 0, + struct Lisp_Charset); /* Make a new charset. */ static Lisp_Object @@ -474,10 +454,8 @@ Lisp_Object reg) { Lisp_Object obj; - Lisp_Charset *cs = alloc_lcrecord_type (Lisp_Charset, &lrecord_charset); - - zero_lcrecord (cs); - + struct Lisp_Charset *cs = + alloc_lcrecord_type (struct Lisp_Charset, &lrecord_charset); XSETCHARSET (obj, cs); CHARSET_ID (cs) = id; @@ -505,12 +483,15 @@ /* some charsets do not have final characters. This includes ASCII, Control-1, Composite, and the two faux private charsets. */ - assert (NILP (chlook->charset_by_attributes[type][final][direction])); - chlook->charset_by_attributes[type][final][direction] = obj; + assert (NILP (charset_by_attributes[type][final][direction])); + charset_by_attributes[type][final][direction] = obj; } - assert (NILP (chlook->charset_by_leading_byte[id - 128])); - chlook->charset_by_leading_byte[id - 128] = obj; + assert (NILP (charset_by_leading_byte[id - 128])); + charset_by_leading_byte[id - 128] = obj; + if (id < 0xA0) + /* official leading byte */ + rep_bytes_by_first_byte[id] = rep_bytes; /* Some charsets are "faux" and don't have names or really exist at all except in the leading-byte table. */ @@ -526,17 +507,17 @@ if (dimension == 1) { - if (chlook->next_allocated_1_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_1) + if (next_allocated_1_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_1) lb = 0; else - lb = chlook->next_allocated_1_byte_leading_byte++; + lb = next_allocated_1_byte_leading_byte++; } else { - if (chlook->next_allocated_2_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_2) + if (next_allocated_2_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_2) lb = 0; else - lb = chlook->next_allocated_2_byte_leading_byte++; + lb = next_allocated_2_byte_leading_byte++; } if (!lb) @@ -833,7 +814,7 @@ int id, dimension, columns, graphic, final; int direction, type; Lisp_Object registry, doc_string, short_name, long_name; - Lisp_Charset *cs; + struct Lisp_Charset *cs; charset = Fget_charset (charset); if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) @@ -982,7 +963,7 @@ */ (charset, prop)) { - Lisp_Charset *cs; + struct Lisp_Charset *cs; charset = Fget_charset (charset); cs = XCHARSET (charset); @@ -1069,14 +1050,11 @@ /************************************************************************/ DEFUN ("make-char", Fmake_char, 2, 3, 0, /* -Make a character from CHARSET and octets ARG1 and ARG2. -ARG2 is required only for characters from two-dimensional charsets. -For example, (make-char 'latin-iso8859-2 185) will return the Latin 2 -character s with caron. +Make a multi-byte character from CHARSET and octets ARG1 and ARG2. */ (charset, arg1, arg2)) { - Lisp_Charset *cs; + struct Lisp_Charset *cs; int a1, a2; int lowlim, highlim; @@ -1089,11 +1067,7 @@ else /* CHARSET_CHARS (cs) == 96) */ lowlim = 32, highlim = 127; CHECK_INT (arg1); - /* It is useful (and safe, according to Olivier Galibert) to strip - the 8th bit off ARG1 and ARG2 becaue it allows programmers to - write (make-char 'latin-iso8859-2 CODE) where code is the actual - Latin 2 code of the character. */ - a1 = XINT (arg1) & 0x7f; + a1 = XINT (arg1); if (a1 < lowlim || a1 > highlim) args_out_of_range_3 (arg1, make_int (lowlim), make_int (highlim)); @@ -1106,7 +1080,7 @@ } CHECK_INT (arg2); - a2 = XINT (arg2) & 0x7f; + a2 = XINT (arg2); if (a2 < lowlim || a2 > highlim) args_out_of_range_3 (arg2, make_int (lowlim), make_int (highlim)); @@ -1131,47 +1105,20 @@ (ch, n)) { Lisp_Object charset; - int octet0, octet1; + int c1, c2, int_n; CHECK_CHAR_COERCE_INT (ch); - - BREAKUP_CHAR (XCHAR (ch), charset, octet0, octet1); - - if (NILP (n) || EQ (n, Qzero)) - return make_int (octet0); - else if (EQ (n, make_int (1))) - return make_int (octet1); - else - signal_simple_error ("Octet number must be 0 or 1", n); -} - -DEFUN ("split-char", Fsplit_char, 1, 1, 0, /* -Return list of charset and one or two position-codes of CHAR. -*/ - (character)) -{ - /* This function can GC */ - struct gcpro gcpro1, gcpro2; - Lisp_Object charset = Qnil; - Lisp_Object rc = Qnil; - int c1, c2; - - GCPRO2 (charset, rc); - CHECK_CHAR_COERCE_INT (character); - - BREAKUP_CHAR (XCHAR (character), charset, c1, c2); - - if (XCHARSET_DIMENSION (Fget_charset (charset)) == 2) - { - rc = list3 (XCHARSET_NAME (charset), make_int (c1), make_int (c2)); - } + if (NILP (n)) + int_n = 0; else { - rc = list2 (XCHARSET_NAME (charset), make_int (c1)); + CHECK_INT (n); + int_n = XINT (n); + if (int_n != 0 && int_n != 1) + signal_simple_error ("Octet number must be 0 or 1", n); } - UNGCPRO; - - return rc; + BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); + return make_int (int_n == 0 ? c1 : c2); } @@ -1256,8 +1203,6 @@ void syms_of_mule_charset (void) { - INIT_LRECORD_IMPLEMENTATION (charset); - DEFSUBR (Fcharsetp); DEFSUBR (Ffind_charset); DEFSUBR (Fget_charset); @@ -1279,7 +1224,6 @@ DEFSUBR (Fmake_char); DEFSUBR (Fchar_charset); DEFSUBR (Fchar_octet); - DEFSUBR (Fsplit_char); #ifdef ENABLE_COMPOSITE_CHARS DEFSUBR (Fmake_composite_char); @@ -1292,6 +1236,7 @@ defsymbol (&Qgraphic, "graphic"); defsymbol (&Qdirection, "direction"); defsymbol (&Qreverse_direction_charset, "reverse-direction-charset"); + defsymbol (&Qccl_program, "ccl-program"); defsymbol (&Qshort_name, "short-name"); defsymbol (&Qlong_name, "long-name"); @@ -1332,21 +1277,18 @@ { int i, j, k; - chlook = xnew (struct charset_lookup); - dumpstruct (&chlook, &charset_lookup_description); - /* Table of charsets indexed by leading byte. */ - for (i = 0; i < countof (chlook->charset_by_leading_byte); i++) - chlook->charset_by_leading_byte[i] = Qnil; + for (i = 0; i < countof (charset_by_leading_byte); i++) + charset_by_leading_byte[i] = Qnil; /* Table of charsets indexed by type/final-byte/direction. */ - for (i = 0; i < countof (chlook->charset_by_attributes); i++) - for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++) - for (k = 0; k < countof (chlook->charset_by_attributes[0][0]); k++) - chlook->charset_by_attributes[i][j][k] = Qnil; + for (i = 0; i < countof (charset_by_attributes); i++) + for (j = 0; j < countof (charset_by_attributes[0]); j++) + for (k = 0; k < countof (charset_by_attributes[0][0]); k++) + charset_by_attributes[i][j][k] = Qnil; - chlook->next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1; - chlook->next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2; + next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1; + next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2; } void @@ -1359,7 +1301,6 @@ /* Predefined character sets. We store them into variables for ease of access. */ - staticpro (&Vcharset_ascii); Vcharset_ascii = make_charset (LEADING_BYTE_ASCII, Qascii, 1, CHARSET_TYPE_94, 1, 0, 'B', @@ -1368,7 +1309,6 @@ build_string ("ASCII)"), build_string ("ASCII (ISO646 IRV)"), build_string ("\\(iso8859-[0-9]*\\|-ascii\\)")); - staticpro (&Vcharset_control_1); Vcharset_control_1 = make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2, CHARSET_TYPE_94, 1, 1, 0, @@ -1377,7 +1317,6 @@ build_string ("Control characters"), build_string ("Control characters 128-191"), build_string ("")); - staticpro (&Vcharset_latin_iso8859_1); Vcharset_latin_iso8859_1 = make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2, CHARSET_TYPE_96, 1, 1, 'A', @@ -1386,7 +1325,6 @@ build_string ("ISO8859-1 (Latin-1)"), build_string ("ISO8859-1 (Latin-1)"), build_string ("iso8859-1")); - staticpro (&Vcharset_latin_iso8859_2); Vcharset_latin_iso8859_2 = make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2, CHARSET_TYPE_96, 1, 1, 'B', @@ -1395,7 +1333,6 @@ build_string ("ISO8859-2 (Latin-2)"), build_string ("ISO8859-2 (Latin-2)"), build_string ("iso8859-2")); - staticpro (&Vcharset_latin_iso8859_3); Vcharset_latin_iso8859_3 = make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2, CHARSET_TYPE_96, 1, 1, 'C', @@ -1404,7 +1341,6 @@ build_string ("ISO8859-3 (Latin-3)"), build_string ("ISO8859-3 (Latin-3)"), build_string ("iso8859-3")); - staticpro (&Vcharset_latin_iso8859_4); Vcharset_latin_iso8859_4 = make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2, CHARSET_TYPE_96, 1, 1, 'D', @@ -1413,7 +1349,6 @@ build_string ("ISO8859-4 (Latin-4)"), build_string ("ISO8859-4 (Latin-4)"), build_string ("iso8859-4")); - staticpro (&Vcharset_thai_tis620); Vcharset_thai_tis620 = make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2, CHARSET_TYPE_96, 1, 1, 'T', @@ -1422,7 +1357,6 @@ build_string ("TIS620 (Thai)"), build_string ("TIS620.2529 (Thai)"), build_string ("tis620")); - staticpro (&Vcharset_greek_iso8859_7); Vcharset_greek_iso8859_7 = make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2, CHARSET_TYPE_96, 1, 1, 'F', @@ -1431,7 +1365,6 @@ build_string ("ISO8859-7 (Greek)"), build_string ("ISO8859-7 (Greek)"), build_string ("iso8859-7")); - staticpro (&Vcharset_arabic_iso8859_6); Vcharset_arabic_iso8859_6 = make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2, CHARSET_TYPE_96, 1, 1, 'G', @@ -1440,7 +1373,6 @@ build_string ("ISO8859-6 (Arabic)"), build_string ("ISO8859-6 (Arabic)"), build_string ("iso8859-6")); - staticpro (&Vcharset_hebrew_iso8859_8); Vcharset_hebrew_iso8859_8 = make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2, CHARSET_TYPE_96, 1, 1, 'H', @@ -1449,7 +1381,6 @@ build_string ("ISO8859-8 (Hebrew)"), build_string ("ISO8859-8 (Hebrew)"), build_string ("iso8859-8")); - staticpro (&Vcharset_katakana_jisx0201); Vcharset_katakana_jisx0201 = make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2, CHARSET_TYPE_94, 1, 1, 'I', @@ -1458,7 +1389,6 @@ build_string ("JISX0201.1976 (Japanese Kana)"), build_string ("JISX0201.1976 Japanese Kana"), build_string ("jisx0201.1976")); - staticpro (&Vcharset_latin_jisx0201); Vcharset_latin_jisx0201 = make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2, CHARSET_TYPE_94, 1, 0, 'J', @@ -1467,7 +1397,6 @@ build_string ("JISX0201.1976 (Japanese Roman)"), build_string ("JISX0201.1976 Japanese Roman"), build_string ("jisx0201.1976")); - staticpro (&Vcharset_cyrillic_iso8859_5); Vcharset_cyrillic_iso8859_5 = make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2, CHARSET_TYPE_96, 1, 1, 'L', @@ -1476,7 +1405,6 @@ build_string ("ISO8859-5 (Cyrillic)"), build_string ("ISO8859-5 (Cyrillic)"), build_string ("iso8859-5")); - staticpro (&Vcharset_latin_iso8859_9); Vcharset_latin_iso8859_9 = make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2, CHARSET_TYPE_96, 1, 1, 'M', @@ -1485,7 +1413,6 @@ build_string ("ISO8859-9 (Latin-5)"), build_string ("ISO8859-9 (Latin-5)"), build_string ("iso8859-9")); - staticpro (&Vcharset_japanese_jisx0208_1978); Vcharset_japanese_jisx0208_1978 = make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3, CHARSET_TYPE_94X94, 2, 0, '@', @@ -1494,8 +1421,7 @@ build_string ("JISX0208.1978 (Japanese)"), build_string ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"), - build_string ("\\(jisx0208\\|jisc6226\\)\\.1978")); - staticpro (&Vcharset_chinese_gb2312); + build_string ("\\(jisx0208\\|jisc6226\\).19")); Vcharset_chinese_gb2312 = make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3, CHARSET_TYPE_94X94, 2, 0, 'A', @@ -1504,7 +1430,6 @@ build_string ("GB2312)"), build_string ("GB2312 Chinese simplified"), build_string ("gb2312")); - staticpro (&Vcharset_japanese_jisx0208); Vcharset_japanese_jisx0208 = make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3, CHARSET_TYPE_94X94, 2, 0, 'B', @@ -1513,7 +1438,6 @@ build_string ("JISX0208.1983/1990 (Japanese)"), build_string ("JISX0208.1983/1990 Japanese Kanji"), build_string ("jisx0208.19\\(83\\|90\\)")); - staticpro (&Vcharset_korean_ksc5601); Vcharset_korean_ksc5601 = make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3, CHARSET_TYPE_94X94, 2, 0, 'C', @@ -1522,7 +1446,6 @@ build_string ("KSC5601 (Korean"), build_string ("KSC5601 Korean Hangul and Hanja"), build_string ("ksc5601")); - staticpro (&Vcharset_japanese_jisx0212); Vcharset_japanese_jisx0212 = make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3, CHARSET_TYPE_94X94, 2, 0, 'D', @@ -1533,7 +1456,6 @@ build_string ("jisx0212")); #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$" - staticpro (&Vcharset_chinese_cns11643_1); Vcharset_chinese_cns11643_1 = make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3, CHARSET_TYPE_94X94, 2, 0, 'G', @@ -1543,7 +1465,6 @@ build_string ("CNS 11643 Plane 1 Chinese traditional"), build_string (CHINESE_CNS_PLANE_RE("1"))); - staticpro (&Vcharset_chinese_cns11643_2); Vcharset_chinese_cns11643_2 = make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3, CHARSET_TYPE_94X94, 2, 0, 'H', @@ -1553,7 +1474,6 @@ build_string ("CNS 11643 Plane 2 Chinese traditional"), build_string (CHINESE_CNS_PLANE_RE("2"))); - staticpro (&Vcharset_chinese_big5_1); Vcharset_chinese_big5_1 = make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3, CHARSET_TYPE_94X94, 2, 0, '0', @@ -1563,7 +1483,6 @@ build_string ("Big5 Level-1 Chinese traditional"), build_string ("big5")); - staticpro (&Vcharset_chinese_big5_2); Vcharset_chinese_big5_2 = make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3, CHARSET_TYPE_94X94, 2, 0, '1', @@ -1579,7 +1498,6 @@ /* #### For simplicity, we put composite chars into a 96x96 charset. This is going to lead to problems because you can run out of room, esp. as we don't yet recycle numbers. */ - staticpro (&Vcharset_composite); Vcharset_composite = make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3, CHARSET_TYPE_96X96, 2, 0, 0, @@ -1589,7 +1507,6 @@ build_string ("Composite characters"), build_string ("")); - /* #### not dumped properly */ composite_char_row_next = 32; composite_char_col_next = 32; diff -r 12e008d41344 -r 697ef44129c6 src/mule-charset.h --- a/src/mule-charset.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule-charset.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Rewritten by Ben Wing <ben@xemacs.org>. */ -#ifndef INCLUDED_mule_charset_h_ -#define INCLUDED_mule_charset_h_ +#ifndef _XEMACS_MULE_CHARSET_H +#define _XEMACS_MULE_CHARSET_H /* 1. Character Sets @@ -239,7 +239,7 @@ Character set Encoding (PC == position-code) ------------- -------- (LB == leading-byte) - ASCII PC1 | + ASCII PC1 | Control-1 LB | PC1 + 0xA0 Dimension-1 official LB | PC1 + 0x80 Dimension-1 private 0x9E | LB | PC1 + 0x80 @@ -332,48 +332,40 @@ #define LEADING_BYTE_COMPOSITE 0x80 /* for a composite character */ #define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */ -/* Note the gap in each official charset can cause core dump - as first and last values are used to determine whether - charset is defined or not in non_ascii_valid_char_p */ +/** The following are for 1-byte characters in an official charset. **/ -/** The following are for 1-byte characters in an official charset. **/ -enum LEADING_BYTE_OFFICIAL_1 -{ - LEADING_BYTE_LATIN_ISO8859_1 = 0x81, /* Right half of ISO 8859-1 */ - LEADING_BYTE_LATIN_ISO8859_2, /* 0x82 Right half of ISO 8859-2 */ - LEADING_BYTE_LATIN_ISO8859_3, /* 0x83 Right half of ISO 8859-3 */ - LEADING_BYTE_LATIN_ISO8859_4, /* 0x84 Right half of ISO 8859-4 */ - LEADING_BYTE_THAI_TIS620, /* 0x85 TIS620-2533 */ - LEADING_BYTE_GREEK_ISO8859_7, /* 0x86 Right half of ISO 8859-7 */ - LEADING_BYTE_ARABIC_ISO8859_6, /* 0x87 Right half of ISO 8859-6 */ - LEADING_BYTE_HEBREW_ISO8859_8, /* 0x88 Right half of ISO 8859-8 */ - LEADING_BYTE_KATAKANA_JISX0201, /* 0x89 Right half of JIS X0201-1976 */ - LEADING_BYTE_LATIN_JISX0201, /* 0x8A Left half of JIS X0201-1976 */ - LEADING_BYTE_CYRILLIC_ISO8859_5,/* 0x8B Right half of ISO 8859-5 */ - LEADING_BYTE_LATIN_ISO8859_9 /* 0x8C Right half of ISO 8859-9 */ - /* 0x8D unused */ -}; +#define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */ +#define LEADING_BYTE_LATIN_ISO8859_2 0x82 /* Right half of ISO 8859-2 */ +#define LEADING_BYTE_LATIN_ISO8859_3 0x83 /* Right half of ISO 8859-3 */ +#define LEADING_BYTE_LATIN_ISO8859_4 0x84 /* Right half of ISO 8859-4 */ +#define LEADING_BYTE_THAI_TIS620 0x85 /* TIS620-2533 */ +#define LEADING_BYTE_GREEK_ISO8859_7 0x86 /* Right half of ISO 8859-7 */ +#define LEADING_BYTE_ARABIC_ISO8859_6 0x87 /* Right half of ISO 8859-6 */ +#define LEADING_BYTE_HEBREW_ISO8859_8 0x88 /* Right half of ISO 8859-8 */ +#define LEADING_BYTE_KATAKANA_JISX0201 0x89 /* Right half of JIS X0201-1976 */ +#define LEADING_BYTE_LATIN_JISX0201 0x8A /* Left half of JIS X0201-1976 */ +#define LEADING_BYTE_CYRILLIC_ISO8859_5 0x8C /* Right half of ISO 8859-5 */ +#define LEADING_BYTE_LATIN_ISO8859_9 0x8D /* Right half of ISO 8859-9 */ #define MIN_LEADING_BYTE_OFFICIAL_1 LEADING_BYTE_LATIN_ISO8859_1 #define MAX_LEADING_BYTE_OFFICIAL_1 LEADING_BYTE_LATIN_ISO8859_9 /** The following are for 2-byte characters in an official charset. **/ -enum LEADING_BYTE_OFFICIAL_2 -{ - LEADING_BYTE_JAPANESE_JISX0208_1978 = 0x90, /* Japanese JIS X0208-1978 */ - LEADING_BYTE_CHINESE_GB2312, /* 0x91 Chinese Hanzi GB2312-1980 */ - LEADING_BYTE_JAPANESE_JISX0208, /* 0x92 Japanese JIS X0208-1983 */ - LEADING_BYTE_KOREAN_KSC5601, /* 0x93 Hangul KS C5601-1987 */ - LEADING_BYTE_JAPANESE_JISX0212, /* 0x94 Japanese JIS X0212-1990 */ - LEADING_BYTE_CHINESE_CNS11643_1, /* 0x95 Chinese CNS11643 Set 1 */ - LEADING_BYTE_CHINESE_CNS11643_2, /* 0x96 Chinese CNS11643 Set 2 */ - LEADING_BYTE_CHINESE_BIG5_1, /* 0x97 Big5 Level 1 */ - LEADING_BYTE_CHINESE_BIG5_2 /* 0x98 Big5 Level 2 */ - /* 0x99 unused */ - /* 0x9A unused */ - /* 0x9B unused */ - /* 0x9C unused */ -}; + +#define LEADING_BYTE_JAPANESE_JISX0208_1978 0x90/* Japanese JIS X0208-1978 */ +#define LEADING_BYTE_CHINESE_GB2312 0x91 /* Chinese Hanzi GB2312-1980 */ +#define LEADING_BYTE_JAPANESE_JISX0208 0x92 /* Japanese JIS X0208-1983 */ +#define LEADING_BYTE_KOREAN_KSC5601 0x93 /* Hangul KS C5601-1987 */ +#define LEADING_BYTE_JAPANESE_JISX0212 0x94 /* Japanese JIS X0212-1990 */ +#define LEADING_BYTE_CHINESE_CNS11643_1 0x95 /* Chinese CNS11643 Set 1 */ +#define LEADING_BYTE_CHINESE_CNS11643_2 0x96 /* Chinese CNS11643 Set 2 */ +#define LEADING_BYTE_CHINESE_BIG5_1 0x97 /* Big5 Level 1 */ +#define LEADING_BYTE_CHINESE_BIG5_2 0x98 /* Big5 Level 2 */ + /* 0x99 unused */ + /* 0x9A unused */ + /* 0x9B unused */ + /* 0x9C unused */ + /* 0x9D unused */ #define MIN_LEADING_BYTE_OFFICIAL_2 LEADING_BYTE_JAPANESE_JISX0208_1978 #define MAX_LEADING_BYTE_OFFICIAL_2 LEADING_BYTE_CHINESE_BIG5_2 @@ -401,8 +393,8 @@ /* Is this a prefix for a private leading byte? */ -INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb); -INLINE_HEADER int +INLINE int LEADING_BYTE_PREFIX_P (unsigned char lb); +INLINE int LEADING_BYTE_PREFIX_P (unsigned char lb) { return (lb == PRE_LEADING_BYTE_PRIVATE_1 || @@ -456,10 +448,7 @@ int id; Lisp_Object name; - Lisp_Object doc_string; - Lisp_Object registry; - Lisp_Object short_name; - Lisp_Object long_name; + Lisp_Object doc_string, registry, short_name, long_name; Lisp_Object reverse_direction_charset; @@ -492,12 +481,12 @@ /* Which half of font to be used to display this character set */ unsigned int graphic; }; -typedef struct Lisp_Charset Lisp_Charset; -DECLARE_LRECORD (charset, Lisp_Charset); -#define XCHARSET(x) XRECORD (x, charset, Lisp_Charset) +DECLARE_LRECORD (charset, struct Lisp_Charset); +#define XCHARSET(x) XRECORD (x, charset, struct Lisp_Charset) #define XSETCHARSET(x, p) XSETRECORD (x, p, charset) #define CHARSETP(x) RECORDP (x, charset) +#define GC_CHARSETP(x) GC_RECORDP (x, charset) #define CHECK_CHARSET(x) CHECK_RECORD (x, charset) #define CONCHECK_CHARSET(x) CONCHECK_RECORD (x, charset) @@ -511,7 +500,7 @@ /* Leading byte and id have been regrouped. -- OG */ #define CHARSET_ID(cs) ((cs)->id) -#define CHARSET_LEADING_BYTE(cs) ((Bufbyte) CHARSET_ID(cs)) +#define CHARSET_LEADING_BYTE(cs) ((Bufbyte)(CHARSET_ID(cs))) #define CHARSET_NAME(cs) ((cs)->name) #define CHARSET_SHORT_NAME(cs) ((cs)->short_name) #define CHARSET_LONG_NAME(cs) ((cs)->long_name) @@ -551,59 +540,59 @@ #define XCHARSET_REVERSE_DIRECTION_CHARSET(cs) \ CHARSET_REVERSE_DIRECTION_CHARSET (XCHARSET (cs)) -struct charset_lookup { - /* Table of charsets indexed by leading byte. */ - Lisp_Object charset_by_leading_byte[128]; +/* Table of charsets indexed by (leading byte - 128). */ +extern Lisp_Object charset_by_leading_byte[128]; + +/* Table of charsets indexed by type/final-byte/direction. */ +extern Lisp_Object charset_by_attributes[4][128][2]; - /* Table of charsets indexed by type/final-byte/direction. */ - Lisp_Object charset_by_attributes[4][128][2]; - Bufbyte next_allocated_1_byte_leading_byte; - Bufbyte next_allocated_2_byte_leading_byte; -}; +/* Table of number of bytes in the string representation of a character + indexed by the first byte of that representation. + + This value can be derived other ways -- e.g. something like -extern struct charset_lookup *chlook; + (BYTE_ASCII_P (first_byte) ? 1 : + XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte))) + + but it's faster this way. */ +extern Bytecount rep_bytes_by_first_byte[0xA0]; #ifdef ERROR_CHECK_TYPECHECK /* int not Bufbyte even though that is the actual type of a leading byte. This way, out-ot-range values will get caught rather than automatically truncated. */ -INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); -INLINE_HEADER Lisp_Object +INLINE Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); +INLINE Lisp_Object CHARSET_BY_LEADING_BYTE (int lb) { assert (lb >= 0x80 && lb <= 0xFF); - return chlook->charset_by_leading_byte[lb - 128]; + return charset_by_leading_byte[lb - 128]; } #else -#define CHARSET_BY_LEADING_BYTE(lb) (chlook->charset_by_leading_byte[(lb) - 128]) +#define CHARSET_BY_LEADING_BYTE(lb) (charset_by_leading_byte[(lb) - 128]) #endif #define CHARSET_BY_ATTRIBUTES(type, final, dir) \ - (chlook->charset_by_attributes[type][final][dir]) - + (charset_by_attributes[type][final][dir]) -/* Table of number of bytes in the string representation of a character - indexed by the first byte of that representation. +#ifdef ERROR_CHECK_TYPECHECK - This value can be derived in other ways -- e.g. something like - XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte)) - but it's faster this way. */ -extern const Bytecount rep_bytes_by_first_byte[0xA0]; - -/* Number of bytes in the string representation of a character. */ -INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb); -INLINE_HEADER int +/* Number of bytes in the string representation of a character */ +INLINE int REP_BYTES_BY_FIRST_BYTE (int fb); +INLINE int REP_BYTES_BY_FIRST_BYTE (int fb) { -#ifdef ERROR_CHECK_TYPECHECK - assert (0 <= fb && fb < 0xA0); -#endif + assert (fb >= 0 && fb < 0xA0); return rep_bytes_by_first_byte[fb]; } +#else +#define REP_BYTES_BY_FIRST_BYTE(fb) (rep_bytes_by_first_byte[fb]) +#endif + /************************************************************************/ /* Dealing with characters */ @@ -677,8 +666,8 @@ FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ -INLINE_HEADER Bufbyte CHAR_LEADING_BYTE (Emchar c); -INLINE_HEADER Bufbyte +INLINE Bufbyte CHAR_LEADING_BYTE (Emchar c); +INLINE Bufbyte CHAR_LEADING_BYTE (Emchar c) { if (CHAR_ASCII_P (c)) @@ -712,8 +701,8 @@ FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ -INLINE_HEADER Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); -INLINE_HEADER Emchar +INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); +INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2) { if (EQ (charset, Vcharset_ascii)) @@ -750,8 +739,8 @@ : ((c1) = CHAR_FIELD2 (c), \ (c2) = CHAR_FIELD3 (c)) -INLINE_HEADER void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); -INLINE_HEADER void +INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); +INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) { *charset = CHAR_CHARSET (c); @@ -788,9 +777,9 @@ int Lstream_fput_emchar (Lstream *stream, Emchar ch); void Lstream_funget_emchar (Lstream *stream, Emchar ch); -int copy_internal_to_external (const Bufbyte *internal, Bytecount len, +int copy_internal_to_external (CONST Bufbyte *internal, Bytecount len, unsigned char *external); -Bytecount copy_external_to_internal (const unsigned char *external, +Bytecount copy_external_to_internal (CONST unsigned char *external, int len, Bufbyte *internal); -#endif /* INCLUDED_mule_charset_h_ */ +#endif /* _XEMACS_MULE_CHARSET_H */ diff -r 12e008d41344 -r 697ef44129c6 src/mule-mcpath.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mule-mcpath.c Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,306 @@ +/* Support for Non-ASCII Path Name + Copyright (C) 1985, 1986, 1992, 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1995 Sun Microsystems, Inc. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Mule 2.3. Not in FSF. */ + +/* mcpath.h should be included in config.h */ +#include <config.h> +#include "lisp.h" + +#include "sysfile.h" +#include "buffer.h" +#include "mule.h" + +Lisp_Object Qpathname_coding_system = 0; + +static void +mcpath_encode_code (struct Lisp_Coding_System *cp) +{ + Lisp_Object coding_system; + + coding_system = Fsymbol_value (Qpathname_coding_system); + + mule_encode_code (coding_system, cp); + CODE_CNTL (cp) |= CC_END; +} + +static int +mule_encode_path_1 (unsigned char *src, unsigned int srcsize, + unsigned char *dst, unsigned int dstsize) +{ + struct Lisp_Coding_System code; + + mcpath_encode_code (&code); + if (CODE_TYPE (&code) > MULE_AUTOCONV) + { + unsigned char *buf; + + /* get_conversion_buffer () is not */ + /* re-entrant. */ + buf = (unsigned char *) alloca (MULE_ENCODE_BUF_SIZE (srcsize, &code)); + if (buf) + { + int len; + Lisp_Object dummy = Qnil; + + len = mule_encode (&code, src, buf, srcsize, &dummy); + if (!CODE_CHAR (&code) && len <= dstsize) + { + memcpy (dst, buf, len); + return len; + } + } + } + return -1; /* use original */ +} + +static unsigned char * +mule_decode_path_1 (unsigned char *src, unsigned char *dst, + unsigned int dstsize) +{ + struct Lisp_Coding_System code; + + mcpath_encode_code (&code); + if (CODE_TYPE (&code) > MULE_AUTOCONV) + { + int len; + unsigned char *buf; + + len = strlen (src) + 1; /* + 1 for '\0' */ + + /* get_conversion_buffer () is not */ + /* re-entrant. */ + buf = (unsigned char *) alloca (MULE_DECODE_BUF_SIZE (len, &code)); + if (buf) + { + CODE_CNTL (&code) |= CC_END; + len = mule_decode (&code, src, buf, len); + if (!CODE_CHAR (&code) && len <= dstsize) + { + memcpy (dst, buf, len); /* len should include '\0' */ + return dst; + } + } + } + return src; +} + +static unsigned char * +mule_decode_path (unsigned char *path, unsigned char ext_path[MC_MAXPATHLEN]) +{ + return + (Qpathname_coding_system + ? mule_decode_path_1 (path, ext_path, MC_MAXPATHLEN) + : path); /* in case of before initialization */ +} + +static unsigned char * +mule_encode_path (unsigned char *path, unsigned char *encode_buffer, + unsigned int size) +{ + int len; + + len = mule_encode_path_1 (path, strlen (path), encode_buffer, size); + if (len > 0) + path = encode_buffer; +#ifdef MSDOS + /* convert the MSDOS style path delimiter to the UNIX style. Note + that now the code is *internal*, so we can simply compare each + character with '\\'. And this operation will alter the contents + of Lisp Object, PATH. */ + { + unsigned char *p = path; + + while (*p) + { + if (*p == '\\') + *p = '/'; + p++; + } + } +#endif /* MSDOS */ + return path; +} + +#if 0 /* example of how they do it (similar junk deleted) ... */ + +int +mc_creat (unsigned char *path, int mode) +{ + unsigned char buffer[MC_MAXPATHLEN]; + return creat (mule_decode_path (path, buffer), mode); +} + +int +mc_readlink (unsigned char *path, unsigned char *buf, int size) +{ + unsigned char buffer[MC_MAXPATHLEN], buffer2[MAXPATHLEN]; + int nread; + + nread = readlink (mule_decode_path (path, buffer), buffer2, MAXPATHLEN); + if (nread > 0) + { + int len; + unsigned char *p; + + len = mule_encode_path_1 (buffer2, nread, buffer, sizeof (buffer)); + if (0 <= len && len <= size) + { + memcpy (buf, buffer, len); + return len; + } + } + return -1; +} + +int +mc_chdir (unsigned char *path) +{ + unsigned char buffer[MC_MAXPATHLEN]; + + path = mule_decode_path (path, buffer); + +#ifdef MSDOS + if ((path[0] != 0) && (path[1] == ':')) + { + int drive = (tolower (path[0]) - 'a'); + if (getdisk () != drive) + setdisk (drive); + } + + /* If path != "/" and path != "a:/" and path ends with slash, remove + it. */ + { + int len = strlen (path); + + if (strcmp (path + 1, ":/") && (len > 1) && (path[len - 1] == '/')) + { + if (path != buffer) /* It is not good to modify original path. */ + { + memcpy (buffer, path, len - 1); /* no need to copy last /. */ + path = buffer; + } + path[len - 1] = 0; + } + } +#endif /* MSDOS */ + + return chdir (path); +} + +#ifdef MSDOS +#ifndef HAVE_GETWD +unsigned char * +mc_getcwd (unsigned char *null, size_t size) +{ + unsigned char buffer[MAXPATHLEN]; + unsigned char *path; + + path = (unsigned char *) getcwd ((char *)buffer, MAXPATHLEN); + if (path) + { + /* here, should be (path == buffer). */ + path = (unsigned char *) xmalloc (MC_MAXPATHLEN); /* MSDOS */ + if (path) + { + int len; + int buffer_length = strlen (buffer) + 1; + + len = mule_encode_path_1 (buffer, buffer_length, path, MC_MAXPATHLEN); + if (len < 0) + { + /* conversion failed. use value that is returned from system. */ + memcpy (path, buffer, buffer_length); + } + } + } + return path; +} +#else /* HAVE_GETWD */ +unsigned char * +mc_getwd (unsigned char path[]) +{ + unsigned char *p; + + p = getwd (path); + if (p) + { + unsigned char buffer[MC_MAXPATHLEN]; + int len; + + len = mule_encode_path_1 (path, strlen (path) + 1, buffer, sizeof buffer); + if (len > 0) + { + memcpy (path, buffer, len); + } + } + return p; +} +#endif /* HAVE_GETWD */ +#endif /* MSDOS */ + +/* In callproc.c, execvp() is called like this: + * execvp (new_argv[0], new_argv); + * following implement depends this. + */ +#ifndef NO_MC_EXECVP +void +mc_execvp (unsigned char *path, unsigned char *argv[]) +{ + unsigned char buffer[MC_MAXPATHLEN]; + argv[0] = path = mule_decode_path (path, buffer); + execvp (path, argv); +} +#endif /* !NO_MC_EXECVP */ + +static DIRENTRY mcpath_directory_entry; +DIRENTRY * +mc_readdir (DIR *d) +{ + SYSTEM_DIRENTRY *sp; + DIRENTRY *dp = &mcpath_directory_entry; + + sp = readdir (d); + if (!sp) return 0; + +#ifndef MSDOS + dp->d_ino = sp->d_ino; +#endif /* MSDOS */ + { /* copy d_name with conversion. */ + int len; + + len = mule_encode_path_1 (sp->d_name, NAMLEN (sp), + dp->d_name, sizeof (dp->d_name) - 1); + if (len < 0) + { + len = NAMLEN (sp); +#ifdef MCPATH_ASSERT + assert (len < sizeof (dp->d_name)); +#endif + memcpy (dp->d_name, sp->d_name, len); + } + dp->d_name[len] = 0; + } + return dp; +} + +#endif /* 0 */ + diff -r 12e008d41344 -r 697ef44129c6 src/mule-mcpath.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mule-mcpath.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,95 @@ +/* Support for Non-ASCII Path Name + Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc. + Copyright (C) 1995 Sun Microsystems, Inc. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Mule 2.3. Not in FSF. */ + +/* This part cannot be surround with #ifdef emacs, because it is needed */ +/* during generate xmakefile. */ +#ifndef MCPATH +# define MCPATH +#endif /* !MCPATH */ + +/* not to confuse while compiling etc/*.c */ +#ifdef emacs +#ifdef MCPATH +# ifndef _MCPATH_H /* enable to include twice */ + +#if 1 + +/* !!! This page is copied from dired.c except that DIRENTRY is + changed to SYSTEM_DIRENTRY. Don't modify this page. */ + +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> + +/* The d_nameln member of a struct dirent includes the '\0' character + on some systems, but not on others. What's worse, you can't tell + at compile-time which one it will be, since it really depends on + the sort of system providing the filesystem you're reading from, + not the system you are running on. Paul Eggert + <eggert@bi.twinsun.com> says this occurs when Emacs is running on a + SunOS 4.1.2 host, reading a directory that is remote-mounted from a + Solaris 2.1 host and is in a native Solaris 2.1 filesystem. + + Since applying strlen to the name always works, we'll just do that. */ +#define NAMLEN(p) strlen (p->d_name) + +#ifdef SYSV_SYSTEM_DIR + +#include <dirent.h> +#define SYSTEM_DIRENTRY struct dirent + +#else /* not SYSV_SYSTEM_DIR */ + +#ifdef NONSYSTEM_DIR_LIBRARY +#include "ndir.h" +#else /* not NONSYSTEM_DIR_LIBRARY */ +#ifdef MSDOS +#include <dirent.h> +#else +#include <sys/dir.h> +#endif +#endif /* not NONSYSTEM_DIR_LIBRARY */ + +#ifndef MSDOS +#define SYSTEM_DIRENTRY struct direct + +extern DIR *opendir (); +extern struct direct *readdir (); + +#endif /* not MSDOS */ +#endif /* not SYSV_SYSTEM_DIR */ +#endif + + /* maximum buffer size to do conversion. */ +#define MCPATH_BUFSIZ(s) (((s) * 3) + 256) +#define MC_MAXPATHLEN MCPATH_BUFSIZ (MAXPATHLEN) + +#define DIRENTRY struct mcpath_direntry +struct mcpath_direntry +{ + /* emacs 19.28 uses d_ino and d_name. */ +#ifndef MSDOS + int d_ino; +#endif /* not MSDOS */ + unsigned char d_name [MCPATH_BUFSIZ (MAXNAMLEN) + 1]; +}; diff -r 12e008d41344 -r 697ef44129c6 src/mule-wnnfns.c --- a/src/mule-wnnfns.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule-wnnfns.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -/* -*- coding: iso-2022-jp -*- +/* Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. @@ -1875,23 +1875,10 @@ } void -reinit_vars_of_mule_wnn (void) +vars_of_mule_wnn (void) { int i; - for (i = 0; i < NSERVER; i++) - { - wnnfns_buf[i] = (struct wnn_buf *) 0; - wnnfns_env_norm[i] = (struct wnn_env *) 0; - wnnfns_env_rev[i] = (struct wnn_env *) 0; - } -} - -void -vars_of_mule_wnn (void) -{ - reinit_vars_of_mule_wnn (); - DEFVAR_INT ("lb-sisheng", &lb_sisheng /* Leading character for Sisheng. */ ); @@ -1914,6 +1901,13 @@ Vwnn_uniq_level = Qwnn_uniq; + for (i = 0; i < NSERVER; i++) + { + wnnfns_buf[i] = (struct wnn_buf *) 0; + wnnfns_env_norm[i] = (struct wnn_env *) 0; + wnnfns_env_rev[i] = (struct wnn_env *) 0; + } + Fprovide(intern("wnn")); } diff -r 12e008d41344 -r 697ef44129c6 src/mule.c --- a/src/mule.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/mule.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,7 +40,7 @@ int i, len; char *p; Lisp_Object temp; - Lisp_String *s; + struct Lisp_String *s; CHECK_CONS (pattern); len = XINT (Flength (pattern)); diff -r 12e008d41344 -r 697ef44129c6 src/nas.c --- a/src/nas.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/nas.c Mon Aug 13 11:20:41 2007 +0200 @@ -108,6 +108,7 @@ #else /* !emacs */ # define warn(str) fprintf (stderr, "%s\n", (str)) +# define CONST const #endif /* emacs */ #ifdef XTOOLKIT @@ -145,18 +146,10 @@ #else char *server #endif - ); -char * -init_play ( -#ifdef XTOOLKIT - Display *display -#else - char *server -#endif ) { char *err_message; - SIGTYPE (*old_sigpipe) (int); + SIGTYPE (*old_sigpipe) (); #ifdef XTOOLKIT char * server = DisplayString (display); @@ -230,7 +223,7 @@ return NULL; } -static void +void close_down_play (void) { @@ -245,7 +238,7 @@ \********************************************************************/ static void -doneCB (AuServer *auserver, +doneCB (AuServer *aud, AuEventHandlerRec *handler, AuEvent *ev, AuPointer data) @@ -281,23 +274,23 @@ if (list == NULL) { - AuPointer my_buf; + unsigned char *my_buf; if (buf==NULL) { - if ((my_buf= (AuPointer) malloc (SoundNumBytes (s)))==NULL) + if ((my_buf=malloc (SoundNumBytes (s)))==NULL) { return; } - if (SoundReadFile ((char *) my_buf, SoundNumBytes (s), s) != SoundNumBytes (s)) + if (SoundReadFile (my_buf, SoundNumBytes (s), s) != SoundNumBytes (s)) { free (my_buf); return; } } else - my_buf = (AuPointer) buf; + my_buf=buf; id = AuSoundCreateBucketFromData (aud, s, @@ -329,7 +322,6 @@ #endif /* CACHE_SOUNDS */ -void wait_for_sounds (void); void wait_for_sounds (void) @@ -343,12 +335,11 @@ } } -int play_sound_file (char *sound_file, int volume); int play_sound_file (char *sound_file, int volume) { - SIGTYPE (*old_sigpipe) (int); + SIGTYPE (*old_sigpipe) (); #ifdef ROBUST_PLAY old_sigpipe=signal (SIGPIPE, sigpipe_handle); @@ -436,7 +427,6 @@ return 1; } -int play_sound_data (unsigned char *data, int length, int volume); int play_sound_data (unsigned char *data, int length, @@ -444,7 +434,7 @@ { Sound s; int offset; - SIGTYPE (*old_sigpipe) (int); + SIGTYPE (*old_sigpipe) (); #if !defined (XTEVENTS) AuEvent ev; @@ -623,11 +613,11 @@ /* Create a name from the sound. */ static char * -NameFromData (const char *buf, +NameFromData (CONST unsigned char *buf, int len) { - char name[9]; + unsigned char name[9]; int i; char *s; @@ -652,11 +642,11 @@ if (i==8) { - strcpy (s = (char *) malloc (10), name); + strcpy (s=malloc (10), name); } else { - strcpy (s = (char *) malloc (15), "short sound"); + strcpy (s=malloc (15), "short sound"); } return s; @@ -667,7 +657,7 @@ */ static SndInfo * -SndOpenDataForReading (const char *data, +SndOpenDataForReading (CONST char *data, int length) { @@ -739,15 +729,15 @@ /* These functions here are for faking file I/O from buffer. */ /* The "file" position */ -static size_t file_posn; +static int file_posn; /* The length of the "file" */ -static size_t file_len; +static int file_len; /* The actual "file" data. */ -static const void* file_data; +CONST static char* file_data; /* Like fopen, but for a buffer in memory */ static void -dopen (const void* data, size_t length) +dopen(CONST char* data, int length) { file_data = data; file_len = length; @@ -756,13 +746,15 @@ /* Like fread, but for a buffer in memory */ static int -dread (void* buf, size_t size, size_t nitems) +dread(char* buf, int size, int nitems) { - size_t nread = size * nitems; + int nread; + + nread = size * nitems; if (file_posn + nread <= file_len) { - memcpy(buf, (char *) file_data + file_posn, size * nitems); + memcpy(buf, file_data + file_posn, size * nitems); file_posn += nread; return nitems; } @@ -774,17 +766,19 @@ /* Like fgetc, but for a buffer in memory */ static int -dgetc (void) +dgetc() { + int ch; + if (file_posn < file_len) - return ((char *)file_data)[file_posn++]; + return file_data[file_posn++]; else return -1; } /* Like fseek, but for a buffer in memory */ static int -dseek (long offset, int from) +dseek(long offset, int from) { if (from == 0) file_posn = offset; @@ -797,8 +791,8 @@ } /* Like ftell, but for a buffer in memory */ -static long -dtell (void) +static int +dtell() { return file_posn; } @@ -806,7 +800,7 @@ /* Data buffer analogs for FileReadS and FileReadL in NAS. */ static unsigned short -DataReadS (int swapit) +DataReadS(int swapit) { unsigned short us; @@ -817,7 +811,7 @@ } static AuUint32 -DataReadL (int swapit) +DataReadL(int swapit) { AuUint32 ul; @@ -828,7 +822,7 @@ } static int -readChunk (RiffChunk *c) +readChunk(RiffChunk *c) { int status; char n; @@ -844,8 +838,8 @@ read the wave data from a buffer in memory. */ static WaveInfo * -WaveOpenDataForReading (const char *data, - int length) +WaveOpenDataForReading(CONST char *data, + int length) { RiffChunk ck; RIFF_FOURCC fourcc; @@ -987,20 +981,20 @@ if (!(s = (Sound) malloc (sizeof (SoundRec)))) return NULL; - if ((s->formatInfo = SndOpenDataForReading ((char *) data, length)) != NULL) + if ((s->formatInfo = SndOpenDataForReading (data, length)) != NULL) { - if (!((int(*)(Sound))(SoundFileInfo[SoundFileFormatSnd].toSound)) (s)) + if (!(SoundFileInfo[SoundFileFormatSnd].toSound) (s)) { - SndCloseFile ((SndInfo *) (s->formatInfo)); + SndCloseFile (s->formatInfo); free (s); return NULL; } } - else if ((s->formatInfo = WaveOpenDataForReading ((char *) data, length)) != NULL) + else if ((s->formatInfo = WaveOpenDataForReading (data, length)) != NULL) { - if (!((int(*)(Sound))(SoundFileInfo[SoundFileFormatWave].toSound)) (s)) + if (!(SoundFileInfo[SoundFileFormatWave].toSound) (s)) { - WaveCloseFile ((WaveInfo *) (s->formatInfo)); + WaveCloseFile (s->formatInfo); free (s); return NULL; } @@ -1008,3 +1002,4 @@ return s; } + diff -r 12e008d41344 -r 697ef44129c6 src/nativesound.h --- a/src/nativesound.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* Sound functions. - Copyright (C) 2000 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* These are defined in the appropriate file (sunplay.c, sgiplay.c, - or hpplay.c). */ - -void play_sound_file (char *name, int volume); -int play_sound_data (unsigned char *data, int length, int volume); diff -r 12e008d41344 -r 697ef44129c6 src/ndir.h --- a/src/ndir.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ndir.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,15 +23,12 @@ last edit: 09-Jul-1983 D A Gwyn */ -#ifndef INCLUDED_ndir_h_ -#define INCLUDED_ndir_h_ - #define DIRBLKSIZ 512 /* size of directory block */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #define MAXNAMLEN 255 -#else /* not WIN32_NATIVE */ +#else /* not WINDOWSNT */ #define MAXNAMLEN 15 /* maximum filename length */ -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ struct direct /* data from readdir() */ @@ -50,7 +47,7 @@ char dd_buf[DIRBLKSIZ]; /* directory block */ } DIR; /* stream data from opendir() */ -DIR *opendir (const char *filename); +DIR *opendir (CONST char *filename); int closedir (DIR *dirp); struct direct *readdir (DIR *dirp); struct direct *readdirver (DIR *dirp); @@ -58,5 +55,3 @@ void seekdir (DIR *dirp, long loc); #define rewinddir( dirp ) seekdir( dirp, 0L ) - -#endif /* INCLUDED_ndir_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/nt.c --- a/src/nt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/nt.c Mon Aug 13 11:20:41 2007 +0200 @@ -25,6 +25,8 @@ /* Sync'ed with Emacs 19.34.6 by Marc Paquette <marcpa@cam.org> */ #include <config.h> + +#undef signal #define getwd _getwd #include "lisp.h" #undef getwd @@ -33,12 +35,37 @@ #include "syssignal.h" #include "sysproc.h" #include "sysfile.h" -#include "syspwd.h" -#include "sysdir.h" + +#include <ctype.h> +#include <direct.h> +#include <errno.h> +#include <fcntl.h> +#include <io.h> +#include <pwd.h> +#include <signal.h> +#include <stddef.h> /* for offsetof */ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> -#include "syswindows.h" +#include <windows.h> +#ifndef __MINGW32__ +#include <mmsystem.h> +#else +typedef void (CALLBACK TIMECALLBACK)(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2); + +typedef TIMECALLBACK FAR *LPTIMECALLBACK; +DWORD WINAPI timeGetTime(void); +MMRESULT WINAPI timeSetEvent(UINT uDelay, UINT uResolution, + LPTIMECALLBACK fptc, DWORD dwUser, UINT fuEvent); +MMRESULT WINAPI timeKillEvent(UINT uTimerID); +MMRESULT WINAPI timeGetDevCaps(TIMECAPS* ptc, UINT cbtc); +MMRESULT WINAPI timeBeginPeriod(UINT uPeriod); +MMRESULT WINAPI timeEndPeriod(UINT uPeriod); +#endif #include "nt.h" +#include <sys/dir.h> #include "ntheap.h" @@ -48,7 +75,7 @@ #endif extern Lisp_Object Vmswindows_get_true_file_attributes; -int nt_fake_unix_uid; +extern char *get_home_directory(void); static char startup_dir[ MAXPATHLEN ]; @@ -105,40 +132,39 @@ the_passwd_shell, }; -uid_t -getuid (void) -{ - return nt_fake_unix_uid; +int +getuid () +{ + return the_passwd.pw_uid; } -uid_t -geteuid (void) +int +geteuid () { - return nt_fake_unix_uid; + /* I could imagine arguing for checking to see whether the user is + in the Administrators group and returning a UID of 0 for that + case, but I don't know how wise that would be in the long run. */ + return getuid (); } -gid_t -getgid (void) +int +getgid () { return the_passwd.pw_gid; } -gid_t -getegid (void) +int +getegid () { return getgid (); } struct passwd * -getpwuid (uid_t uid) +getpwuid (int uid) { - if (uid == nt_fake_unix_uid) - { - the_passwd.pw_gid = the_passwd.pw_uid = uid; - return &the_passwd; - } - else - return NULL; + if (uid == the_passwd.pw_uid) + return &the_passwd; + return NULL; } struct passwd * @@ -157,14 +183,8 @@ } void -init_user_info (void) +init_user_info () { - /* This code is pretty much of ad hoc nature. There is no unix-like - UIDs under Windows NT. There is no concept of root user, because - all security is ACL-based. Instead, let's use a simple variable, - nt-fake-unix-uid, which would allow the user to have a uid of - choice. --kkm, 02/03/2000 */ -#if 0 /* Find the user's real name by opening the process token and looking up the name associated with the user-sid in that token. @@ -240,18 +260,6 @@ the_passwd.pw_gid = 123; } - if (token) - CloseHandle (token); -#else - /* Obtain only logon id here, uid part is moved to getuid */ - char name[256]; - DWORD length = sizeof (name); - if (GetUserName (name, &length)) - strcpy (the_passwd.pw_name, name); - else - strcpy (the_passwd.pw_name, "unknown"); -#endif - /* Ensure HOME and SHELL are defined. */ #if 0 /* @@ -264,8 +272,11 @@ putenv ((GetVersion () & 0x80000000) ? "SHELL=command" : "SHELL=cmd"); /* Set dir and shell from environment variables. */ - strcpy (the_passwd.pw_dir, (char *)get_home_directory()); + strcpy (the_passwd.pw_dir, get_home_directory()); strcpy (the_passwd.pw_shell, getenv ("SHELL")); + + if (token) + CloseHandle (token); } /* Normalize filename by converting all path separators to @@ -273,7 +284,9 @@ case path name components to lower case. */ static void -normalize_filename (char *fp, char path_sep) +normalize_filename (fp, path_sep) + REGISTER char *fp; + char path_sep; { char sep; char *elem; @@ -329,14 +342,16 @@ /* Destructively turn backslashes into slashes. */ void -dostounix_filename (char *p) +dostounix_filename (p) + REGISTER char *p; { normalize_filename (p, '/'); } /* Destructively turn slashes into backslashes. */ void -unixtodos_filename (char *p) +unixtodos_filename (p) + REGISTER char *p; { normalize_filename (p, '\\'); } @@ -345,7 +360,10 @@ (From msdos.c...probably should figure out a way to share it, although this code isn't going to ever change.) */ int -crlf_to_lf (int n, unsigned char *buf, unsigned *lf_count) +crlf_to_lf (n, buf, lf_count) + REGISTER int n; + REGISTER unsigned char *buf; + REGISTER unsigned *lf_count; { unsigned char *np = buf; unsigned char *startp = buf; @@ -522,7 +540,9 @@ #define REG_ROOT "SOFTWARE\\GNU\\XEmacs" LPBYTE -nt_get_resource (char *key, LPDWORD lpdwtype) +nt_get_resource (key, lpdwtype) + char *key; + LPDWORD lpdwtype; { LPBYTE lpvalue; HKEY hrootkey = NULL; @@ -567,7 +587,7 @@ } void -init_environment (void) +init_environment () { /* Check for environment variables and use registry if they don't exist */ { @@ -589,9 +609,7 @@ "EMACSLOCKDIR", "INFOPATH" }; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) - cache_system_info (); -#endif + for (i = 0; i < countof (env_vars); i++) { if (!getenv (env_vars[i]) && @@ -1063,22 +1081,16 @@ return dirp; } -int +void closedir (DIR *dirp) { - BOOL retval; - /* If we have a find-handle open, close it. */ if (dir_find_handle != INVALID_HANDLE_VALUE) { - retval = FindClose (dir_find_handle); + FindClose (dir_find_handle); dir_find_handle = INVALID_HANDLE_VALUE; } xfree (dirp); - if (retval) - return 0; - else - return -1; } struct direct * @@ -1191,12 +1203,9 @@ #endif /* 0 */ static FILETIME utc_base_ft; +static long double utc_base; static int init = 0; -#if 0 - -static long double utc_base; - time_t convert_time (FILETIME ft) { @@ -1228,86 +1237,6 @@ ret -= utc_base; return (time_t) (ret * 1e-7); } -#else - -#if defined(MINGW) && CYGWIN_VERSION_DLL_MAJOR <= 21 -#define LowPart u.LowPart -#define HighPart u.HighPart -#endif - -static LARGE_INTEGER utc_base_li; - -time_t -convert_time (FILETIME uft) -{ - time_t ret; -#ifndef MAXLONGLONG - SYSTEMTIME st; - struct tm t; - FILETIME ft; - TIME_ZONE_INFORMATION tzi; - DWORD tzid; -#else - LARGE_INTEGER lft; -#endif - - if (!init) - { - /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */ - SYSTEMTIME st; - - st.wYear = 1970; - st.wMonth = 1; - st.wDay = 1; - st.wHour = 0; - st.wMinute = 0; - st.wSecond = 0; - st.wMilliseconds = 0; - - SystemTimeToFileTime (&st, &utc_base_ft); - - utc_base_li.LowPart = utc_base_ft.dwLowDateTime; - utc_base_li.HighPart = utc_base_ft.dwHighDateTime; - - init = 1; - } - -#ifdef MAXLONGLONG - - /* On a compiler that supports long integers, do it the easy way */ - lft.LowPart = uft.dwLowDateTime; - lft.HighPart = uft.dwHighDateTime; - ret = (time_t) ((lft.QuadPart - utc_base_li.QuadPart) / 10000000); - -#else - - /* Do it the hard way using mktime. */ - FileTimeToLocalFileTime(&uft, &ft); - FileTimeToSystemTime (&ft, &st); - tzid = GetTimeZoneInformation (&tzi); - t.tm_year = st.wYear - 1900; - t.tm_mon = st.wMonth - 1; - t.tm_mday = st.wDay; - t.tm_hour = st.wHour; - t.tm_min = st.wMinute; - t.tm_sec = st.wSecond; - t.tm_isdst = (tzid == TIME_ZONE_ID_DAYLIGHT); - /* st.wMilliseconds not applicable */ - ret = mktime(&t); - if (ret == -1) - { - ret = 0; - } - -#endif - - return ret; -} -#endif -#if defined(MINGW) && CYGWIN_VERSION_DLL_MAJOR <= 21 -#undef LowPart -#undef HighPart -#endif #if 0 /* in case we ever have need of this */ @@ -1385,51 +1314,11 @@ #endif -/* #### aichner@ecf.teradyne.com reported that with the library - provided stat/fstat, (file-exist "d:\\tmp\\") =>> nil, - (file-exist "d:\\tmp") =>> t, when d:\tmp exists. Whenever - we opt to use non-encapsulated stat(), this should serve as - a compatibility test. --kkm */ - -/* Since stat is encapsulated on Windows NT, we need to encapsulate - the equally broken fstat as well. */ -int -mswindows_fstat (int handle, struct stat *buffer) -{ - int ret; - BY_HANDLE_FILE_INFORMATION lpFileInfo; - /* Initialize values */ - buffer->st_mode = 0; - buffer->st_size = 0; - buffer->st_dev = 0; - buffer->st_rdev = 0; - buffer->st_atime = 0; - buffer->st_ctime = 0; - buffer->st_mtime = 0; - buffer->st_nlink = 0; - ret = GetFileInformationByHandle((HANDLE) _get_osfhandle(handle), &lpFileInfo); - if (!ret) - { - return -1; - } - else - { - buffer->st_mtime = convert_time (lpFileInfo.ftLastWriteTime); - buffer->st_atime = convert_time (lpFileInfo.ftLastAccessTime); - if (buffer->st_atime == 0) buffer->st_atime = buffer->st_mtime; - buffer->st_ctime = convert_time (lpFileInfo.ftCreationTime); - if (buffer->st_ctime == 0) buffer->st_ctime = buffer->st_mtime; - buffer->st_size = lpFileInfo.nFileSizeLow; - buffer->st_nlink = (short) lpFileInfo.nNumberOfLinks; - return 0; - } -} - /* MSVC stat function can't cope with UNC names and has other bugs, so replace it with our own. This also allows us to calculate consistent inode values without hacks in the main Emacs code. */ int -mswindows_stat (const char * path, struct stat * buf) +stat (const char * path, struct stat * buf) { char * name; WIN32_FIND_DATA wfd; @@ -1459,7 +1348,7 @@ len = strlen (name); rootdir = (path >= name + len - 1 && (IS_DIRECTORY_SEP (*path) || *path == 0)); - name = strcpy ((char *)alloca (len + 2), name); + name = strcpy (alloca (len + 2), name); if (rootdir) { @@ -1577,12 +1466,14 @@ buf->st_ino = (unsigned short) (fake_inode ^ (fake_inode >> 16)); /* consider files to belong to current user */ - buf->st_uid = buf->st_gid = nt_fake_unix_uid; + buf->st_uid = the_passwd.pw_uid; + buf->st_gid = the_passwd.pw_gid; /* volume_info is set indirectly by map_win32_filename */ buf->st_dev = volume_info.serialnum; buf->st_rdev = volume_info.serialnum; + buf->st_size = wfd.nFileSizeLow; /* Convert timestamps to Unix format. */ @@ -1655,7 +1546,7 @@ } void -init_ntproc (void) +init_ntproc () { /* Initial preparation for subprocess support: replace our standard handles with non-inheritable versions. */ @@ -1788,7 +1679,7 @@ /* Signal pending mask: bit set to 1 means sig is pending */ unsigned signal_pending_mask = 0; -mswindows_sighandler mswindows_sigset (int nsig, mswindows_sighandler handler) +msw_sighandler msw_sigset (int nsig, msw_sighandler handler) { /* We delegate some signals to the system function */ if (nsig == SIGFPE || nsig == SIGABRT || nsig == SIGINT) @@ -1802,13 +1693,13 @@ /* Store handler ptr */ { - mswindows_sighandler old_handler = signal_handlers[nsig]; + msw_sighandler old_handler = signal_handlers[nsig]; signal_handlers[nsig] = handler; return old_handler; } } -int mswindows_sighold (int nsig) +int msw_sighold (int nsig) { if (nsig < 0 || nsig > SIG_MAX) return errno = EINVAL; @@ -1817,7 +1708,7 @@ return 0; } -int mswindows_sigrelse (int nsig) +int msw_sigrelse (int nsig) { if (nsig < 0 || nsig > SIG_MAX) return errno = EINVAL; @@ -1825,12 +1716,12 @@ signal_block_mask &= ~sigmask(nsig); if (signal_pending_mask & sigmask(nsig)) - mswindows_raise (nsig); + msw_raise (nsig); return 0; } -int mswindows_sigpause (int nsig) +int msw_sigpause (int nsig) { /* This is currently not called, because the only call to sigpause inside XEmacs is with SIGCHLD @@ -1841,7 +1732,7 @@ return 0; } -int mswindows_raise (int nsig) +int msw_raise (int nsig) { /* We delegate some raises to the system routine */ if (nsig == SIGFPE || nsig == SIGABRT || nsig == SIGINT) @@ -1907,7 +1798,7 @@ DWORD dw1, DWORD dw2) { /* Just raise a signal indicated by dwUser parameter */ - mswindows_raise (dwUser); + msw_raise (dwUser); } /* Divide time in ms specified by IT by DENOM. Return 1 ms @@ -1990,15 +1881,9 @@ return errno = EINVAL; } - -/*--------------------------------------------------------------------*/ -/* Memory-mapped files */ -/*--------------------------------------------------------------------*/ - int -open_input_file (file_data *p_file, const char *filename) +open_input_file (file_data *p_file, CONST char *filename) { - /* Synched with FSF 20.6. We fixed some warnings. */ HANDLE file; HANDLE file_mapping; void *file_base; @@ -2019,188 +1904,15 @@ if (file_base == 0) return FALSE; - p_file->name = (char *)filename; - p_file->size = size; - p_file->file = file; - p_file->file_mapping = file_mapping; - p_file->file_base = (char *)file_base; - - return TRUE; -} - -int -open_output_file (file_data *p_file, const char *filename, unsigned long size) -{ - /* Synched with FSF 20.6. We fixed some warnings. */ - HANDLE file; - HANDLE file_mapping; - void *file_base; - - file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - if (file == INVALID_HANDLE_VALUE) - return FALSE; - - file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE, - 0, size, NULL); - if (!file_mapping) - return FALSE; - - file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size); - if (file_base == NULL) - return FALSE; - - p_file->name = filename; + p_file->name = (char*)filename; p_file->size = size; p_file->file = file; p_file->file_mapping = file_mapping; - p_file->file_base = (char*) file_base; + p_file->file_base = file_base; return TRUE; } -#if 1 /* !defined(MINGW) */ -/* Return pointer to section header for section containing the given - relative virtual address. */ -static IMAGE_SECTION_HEADER * -rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header) -{ - /* Synched with FSF 20.6. We added MINGW stuff. */ - PIMAGE_SECTION_HEADER section; - int i; - - section = IMAGE_FIRST_SECTION (nt_header); - - for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) - { - /* Some linkers (eg. the NT SDK linker I believe) swapped the - meaning of these two values - or rather, they ignored - VirtualSize entirely and always set it to zero. This affects - some very old exes (eg. gzip dated Dec 1993). Since - mswindows_executable_type relies on this function to work reliably, - we need to cope with this. */ - DWORD real_size = max (section->SizeOfRawData, - section->Misc.VirtualSize); - if (rva >= section->VirtualAddress - && rva < section->VirtualAddress + real_size) - return section; - section++; - } - return NULL; -} -#endif - -void -mswindows_executable_type (const char * filename, int * is_dos_app, - int * is_cygnus_app) -{ - /* Synched with FSF 20.6. We added MINGW stuff and casts. */ - file_data executable; - char * p; - - /* Default values in case we can't tell for sure. */ - *is_dos_app = FALSE; - *is_cygnus_app = FALSE; - - if (!open_input_file (&executable, filename)) - return; - - p = strrchr (filename, '.'); - - /* We can only identify DOS .com programs from the extension. */ - if (p && stricmp (p, ".com") == 0) - *is_dos_app = TRUE; - else if (p && (stricmp (p, ".bat") == 0 || - stricmp (p, ".cmd") == 0)) - { - /* A DOS shell script - it appears that CreateProcess is happy to - accept this (somewhat surprisingly); presumably it looks at - COMSPEC to determine what executable to actually invoke. - Therefore, we have to do the same here as well. */ - /* Actually, I think it uses the program association for that - extension, which is defined in the registry. */ - p = egetenv ("COMSPEC"); - if (p) - mswindows_executable_type (p, is_dos_app, is_cygnus_app); - } - else - { - /* Look for DOS .exe signature - if found, we must also check that - it isn't really a 16- or 32-bit Windows exe, since both formats - start with a DOS program stub. Note that 16-bit Windows - executables use the OS/2 1.x format. */ - -#if 0 /* defined( MINGW ) */ - /* mingw32 doesn't have enough headers to detect cygwin - apps, just do what we can. */ - FILHDR * exe_header; - - exe_header = (FILHDR*) executable.file_base; - if (exe_header->e_magic != DOSMAGIC) - goto unwind; - - if ((char*) exe_header->e_lfanew > (char*) executable.size) - { - /* Some dos headers (pkunzip) have bogus e_lfanew fields. */ - *is_dos_app = TRUE; - } - else if (exe_header->nt_signature != NT_SIGNATURE) - { - *is_dos_app = TRUE; - } -#else - IMAGE_DOS_HEADER * dos_header; - IMAGE_NT_HEADERS * nt_header; - - dos_header = (PIMAGE_DOS_HEADER) executable.file_base; - if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) - goto unwind; - - nt_header = (PIMAGE_NT_HEADERS) ((char*) dos_header + dos_header->e_lfanew); - - if ((char*) nt_header > (char*) dos_header + executable.size) - { - /* Some dos headers (pkunzip) have bogus e_lfanew fields. */ - *is_dos_app = TRUE; - } - else if (nt_header->Signature != IMAGE_NT_SIGNATURE && - LOWORD (nt_header->Signature) != IMAGE_OS2_SIGNATURE) - { - *is_dos_app = TRUE; - } - else if (nt_header->Signature == IMAGE_NT_SIGNATURE) - { - /* Look for cygwin.dll in DLL import list. */ - IMAGE_DATA_DIRECTORY import_dir = - nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]; - IMAGE_IMPORT_DESCRIPTOR * imports; - IMAGE_SECTION_HEADER * section; - - section = rva_to_section (import_dir.VirtualAddress, nt_header); - imports = (IMAGE_IMPORT_DESCRIPTOR *) RVA_TO_PTR (import_dir.VirtualAddress, - section, executable); - - for ( ; imports->Name; imports++) - { - char *dllname = (char*) RVA_TO_PTR (imports->Name, section, executable); - - /* The exact name of the cygwin dll has changed with - various releases, but hopefully this will be reasonably - future proof. */ - if (strncmp (dllname, "cygwin", 6) == 0) - { - *is_cygnus_app = TRUE; - break; - } - } - } -#endif - } - - unwind: - close_file_data (&executable); -} - /* Close the system structures associated with the given file. */ void close_file_data (file_data *p_file) @@ -2210,16 +1922,4 @@ CloseHandle (p_file->file); } -void -vars_of_nt (void) -{ - DEFVAR_INT ("nt-fake-unix-uid", &nt_fake_unix_uid /* -*Set uid returned by `user-uid' and `user-real-uid'. -Under NT and 9x, there is no uids, and even no almighty user called root. -By setting this variable, you can have any uid of choice. Default is 0. -Changes to this variable take effect immediately. -*/ ); - nt_fake_unix_uid = 0; -} - /* end of nt.c */ diff -r 12e008d41344 -r 697ef44129c6 src/nt.h --- a/src/nt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/nt.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,3 +1,6 @@ +#ifndef _NT_H_ +#define _NT_H_ + /* Support routines for the NT version of XEmacs. Copyright (C) 1994 Free Software Foundation, Inc. @@ -23,17 +26,55 @@ /* #define FULL_DEBUG */ -#ifndef INCLUDED_nt_h_ -#define INCLUDED_nt_h_ - -#include "syswindows.h" - #ifdef DEBUG_XEMACS #define DebPrint(stuff) _DebPrint stuff #else #define DebPrint(stuff) #endif +#define R_OK 4 +#define W_OK 2 +#ifdef X_OK +#undef X_OK +#endif +#define X_OK 1 +#define F_OK 0 + +/* File descriptor set emulation. */ + +#if 0 /* These are defined in winsock.h. + FD_SETSIZE is defined 64. Let's not full the runtime. */ + +/* The MSVC multithreaded statically-linked runtime library has limit + of 256 descriptors by default (the single-threaded static library + has a limit of 64 descriptors, and the DLL versions both have a + limit of 512). Beware. Should this be set to 512? */ +#define FD_SETSIZE 256 +typedef struct { + unsigned int bits[FD_SETSIZE / 32]; +} fd_set; + +/* standard access macros */ +#define FD_SET(n, p) \ + do { \ + if ((n) < FD_SETSIZE) { \ + (p)->bits[(n)/32] |= (1 << (n)%32); \ + } \ + } while (0) +#define FD_CLR(n, p) \ + do { \ + if ((n) < FD_SETSIZE) { \ + (p)->bits[(n)/32] &= ~(1 << (n)%32); \ + } \ + } while (0) +#define FD_ISSET(n, p) ((n) < FD_SETSIZE ? ((p)->bits[(n)/32] & (1 << (n)%32)) : 0) +#define FD_ZERO(p) memset((p), 0, sizeof(fd_set)) + +#define SELECT_TYPE fd_set +#define MAXDESC FD_SETSIZE + +#endif /* 0 */ + /* ------------------------------------------------------------------------- */ /* child_process.status values */ @@ -72,7 +113,7 @@ child_process * cp; } filedesc; -extern filedesc fd_info []; +extern filedesc fd_info [ MAXDESC ]; /* fd_info flag definitions */ #define FILE_READ 0x0001 @@ -106,45 +147,7 @@ void set_process_dir (const char * dir); time_t convert_time (FILETIME ft); -extern void init_ntproc (void); -extern void term_ntproc (int unused); - -/* ----------------------------------------------------------------- */ -/* Useful routines for manipulating memory-mapped files. */ - -typedef struct file_data -{ - const char *name; - unsigned long size; - HANDLE file; - HANDLE file_mapping; - char *file_base; -} file_data; - -#define OFFSET_TO_RVA(var,section) \ - (section->VirtualAddress + ((DWORD)(var) - section->PointerToRawData)) - -#define RVA_TO_OFFSET(var,section) \ - (section->PointerToRawData + ((DWORD)(var) - section->VirtualAddress)) +extern void init_ntproc (); +extern void term_ntproc (); -#define RVA_TO_PTR(var,section,filedata) \ - ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base)) - -int open_input_file (file_data *p_file, const char *name); -int open_output_file (file_data *p_file, const char *name, unsigned long size); -void close_file_data (file_data *p_file); -void mswindows_executable_type (const char * filename, int * is_dos_app, - int * is_cygnus_app); - -/* In process-nt.c */ -extern int compare_env (const void *strp1, const void *strp2); - -void mswindows_set_errno (unsigned long win32_error); -void mswindows_set_last_errno (void); - -void wait_for_termination (HANDLE pid); - -int mswindows_fstat (int handle, struct stat *buffer); -int mswindows_stat (const char * path, struct stat * buf); - -#endif /* INCLUDED_nt_h_ */ +#endif /* _NT_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/ntheap.c --- a/src/ntheap.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ntheap.c Mon Aug 13 11:20:41 2007 +0200 @@ -38,10 +38,38 @@ int edata; int etext; +/* The major and minor versions of NT. */ +int nt_major_version; +int nt_minor_version; + +/* Distinguish between Windows NT and Windows 95. */ +int os_subtype; + /* Cache information describing the NT system for later use. */ void cache_system_info (void) { + union + { + struct info + { + char major; + char minor; + short platform; + } info; + DWORD data; + } version; + + /* Cache the version of the operating system. */ + version.data = GetVersion (); + nt_major_version = version.info.major; + nt_minor_version = version.info.minor; + + if (version.info.platform & 0x8000) + os_subtype = OS_WIN95; + else + os_subtype = OS_NT; + /* Cache page size, allocation unit, processor type, etc. */ GetSystemInfo (&sysinfo_cache); syspage_mask = sysinfo_cache.dwPageSize - 1; @@ -80,7 +108,7 @@ return data_region_end; } -static unsigned char * +static char * allocate_heap (void) { /* The base address for our GNU malloc heap is chosen in conjunction @@ -120,8 +148,7 @@ still a pretty decent arena to play in! */ unsigned long base = 0x01B00000; /* 27MB */ - /* Temporary hack for the non-starting problem - use 28 (256Mb) rather than VALBITS (1Gb) */ - unsigned long end = 1 << 28; /* 256MB */ + unsigned long end = 1 << VALBITS; /* 256MB */ void *ptr = NULL; #define NTHEAP_PROBE_BASE 1 @@ -144,7 +171,7 @@ PAGE_NOACCESS); #endif - return (unsigned char*) ptr; + return ptr; } @@ -220,51 +247,24 @@ return result; } -#if !defined (CANNOT_DUMP) && !defined(HEAP_IN_DATA) && !defined(PDUMP) +#if !defined (CANNOT_DUMP) && !defined(HEAP_IN_DATA) /* Recreate the heap from the data that was dumped to the executable. EXECUTABLE_PATH tells us where to find the executable. */ void recreate_heap (char *executable_path) { - /* First reserve the upper part of our heap. (We reserve first - because there have been problems in the past where doing the - mapping first has loaded DLLs into the VA space of our heap.) */ + unsigned char *tmp; - /* Query the region at the end of the committed heap */ - void *tmp; - MEMORY_BASIC_INFORMATION info; - DWORD size; - unsigned char* base = get_heap_end (); - unsigned char* end = base + get_reserved_heap_size () - get_committed_heap_size (); - VirtualQuery (base, &info, sizeof info); - if (info.State != MEM_FREE) - { - /* Oops, something has already reserved or commited it, nothing we can do but exit */ - char buf[256]; - wsprintf(buf, - "XEmacs cannot start because the memory region required by the heap is not available.\n" - "(BaseAddress = 0x%lx, AllocationBase = 0x%lx, Size = 0x%lx, State = %s, Type = %s)", - info.BaseAddress, info.AllocationBase, info.RegionSize, - info.State == MEM_COMMIT ? "COMMITED" : "RESERVED", - info.Type == MEM_IMAGE ? "IMAGE" : info.Type == MEM_MAPPED ? "MAPPED" : "PRIVATE"); - MessageBox(NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP); - exit(1); - } - - /* Now try and reserve as much as possible */ - size = min (info.RegionSize, end - base); - tmp = VirtualAlloc (base, size, MEM_RESERVE, PAGE_NOACCESS); + /* First reserve the upper part of our heap. (We reserve first + because there have been problems in the past where doing the + mapping first has loaded DLLs into the VA space of our heap.) */ + tmp = VirtualAlloc ((void *) get_heap_end (), + get_reserved_heap_size () - get_committed_heap_size (), + MEM_RESERVE, + PAGE_NOACCESS); if (!tmp) - { - /* Can't reserve it, nothing we can do but exit */ - char buf[256]; - wsprintf(buf, - "XEmacs cannot start because it couldn't reserve space required for the heap.\n" - "(VirtualAlloc at 0x%lx of 0x%lx failed (%d))", base, size, GetLastError()); - MessageBox(NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP); - exit (1); - } + exit (1); /* We read in the data for the .bss section from the executable first and map in the heap from the executable second to prevent diff -r 12e008d41344 -r 697ef44129c6 src/ntheap.h --- a/src/ntheap.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ntheap.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,10 +23,10 @@ /* Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> */ /* Synced with FSF Emacs 19.34.6 by Marc Paquette <marcpa@cam.org> */ -#ifndef INCLUDED_ntheap_h_ -#define INCLUDED_ntheap_h_ +#ifndef NTHEAP_H_ +#define NTHEAP_H_ -#include "syswindows.h" +#include <windows.h> /* * Heap related stuff. @@ -51,9 +51,16 @@ /* To prevent zero-initialized variables from being placed into the bss section, use non-zero values to represent an uninitialized state. */ -#define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0) +#define UNINIT_PTR ((void *) 0xF0A0F0A0) #define UNINIT_LONG (0xF0A0F0A0L) +enum { + OS_WIN95 = 1, + OS_NT +}; + +extern int os_subtype; + /* Emulation of Unix sbrk(). */ extern void *sbrk (unsigned long size); @@ -76,4 +83,28 @@ extern unsigned char *round_to_next (unsigned char *address, unsigned long align); -#endif /* INCLUDED_ntheap_h_ */ +/* ----------------------------------------------------------------- */ +/* Useful routines for manipulating memory-mapped files. */ + +typedef struct file_data { + char *name; + unsigned long size; + HANDLE file; + HANDLE file_mapping; + unsigned char *file_base; +} file_data; + +#define OFFSET_TO_RVA(var,section) \ + (section->VirtualAddress + ((DWORD)(var) - section->PointerToRawData)) + +#define RVA_TO_OFFSET(var,section) \ + (section->PointerToRawData + ((DWORD)(var) - section->VirtualAddress)) + +#define RVA_TO_PTR(var,section,filedata) \ + ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base)) + +int open_input_file (file_data *p_file, CONST char *name); +int open_output_file (file_data *p_file, CONST char *name, unsigned long size); +void close_file_data (file_data *p_file); + +#endif /* NTHEAP_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/ntplay.c --- a/src/ntplay.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ntplay.c Mon Aug 13 11:20:41 2007 +0200 @@ -18,14 +18,19 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*/ +#include <windows.h> +#undef CONST #include <config.h> +#include <stdio.h> +#include "sysfile.h" #include "lisp.h" -#include "sysfile.h" -#include "nt.h" -#include "nativesound.h" - -static int play_sound_data_1 (unsigned char *data, int length, +#if defined (__CYGWIN32__) || defined(__MINGW32__) +extern BOOL WINAPI PlaySound(LPCSTR,HMODULE,DWORD); +#else +#include <mmsystem.h> +#endif +static void play_sound_data_1 (unsigned char *data, int length, int volume, int convert); void play_sound_file (char *sound_file, int volume) @@ -46,7 +51,7 @@ return; size = lseek (ofd, 0, SEEK_END); - data = (unsigned char *)xmalloc (size); + data = xmalloc (size); lseek (ofd, 0, SEEK_SET); if (!data) @@ -71,7 +76,7 @@ /* mswindows can't cope with playing a sound from alloca space so we have to convert if necessary */ -static int play_sound_data_1 (unsigned char *data, int length, int volume, +static void play_sound_data_1 (unsigned char *data, int length, int volume, int convert_to_malloc) { DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT; @@ -85,7 +90,7 @@ if (convert_to_malloc) { - sound_data = (unsigned char *)xmalloc (length); + sound_data = xmalloc (length); memcpy (sound_data, data, length); } else @@ -93,11 +98,10 @@ PlaySound(sound_data, NULL, flags); - /* #### Error handling? */ - return 1; + return; } -int play_sound_data (unsigned char *data, int length, int volume) +void play_sound_data (unsigned char *data, int length, int volume) { - return play_sound_data_1 (data, length, volume, TRUE); + play_sound_data_1 (data, length, volume, TRUE); } diff -r 12e008d41344 -r 697ef44129c6 src/ntproc.c --- a/src/ntproc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ntproc.c Mon Aug 13 11:20:41 2007 +0200 @@ -24,6 +24,15 @@ /* Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> */ /* Synced with FSF Emacs 19.34.6 by Marc Paquette <marcpa@cam.org> */ +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> +#include <io.h> +#include <fcntl.h> +#include <signal.h> + +/* must include CRT headers *before* config.h */ +/* ### I don't believe it - martin */ #include <config.h> #undef signal #undef wait @@ -32,6 +41,7 @@ #undef kill #include <windows.h> +#include <sys/socket.h> #ifdef HAVE_A_OUT_H #include <a.out.h> #endif @@ -45,9 +55,6 @@ #include "syswait.h" #include "buffer.h" #include "process.h" - -#include "console-msw.h" - /*#include "w32term.h"*/ /* From 19.34.6: sync in ? --marcpa */ /* #### I'm not going to play with shit. */ @@ -101,7 +108,7 @@ #endif } -/* sys_signal moved to nt.c. It's now called mswindows_signal... */ +/* sys_signal moved to nt.c. It's now called msw_signal... */ /* Defined in <process.h> which conflicts with the local copy */ #define _P_NOWAIT 1 @@ -386,7 +393,7 @@ static const char * process_dir; static BOOL -create_child (const char *exe, char *cmdline, char *env, +create_child (CONST char *exe, char *cmdline, char *env, int * pPid, child_process *cp) { STARTUPINFO start; @@ -399,6 +406,7 @@ xzero (start); start.cb = sizeof (start); +#ifdef HAVE_NTGUI if (NILP (Vwin32_start_process_show_window)) start.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; else @@ -408,6 +416,7 @@ start.hStdInput = GetStdHandle (STD_INPUT_HANDLE); start.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); start.hStdError = GetStdHandle (STD_ERROR_HANDLE); +#endif /* HAVE_NTGUI */ /* Explicitly specify no security */ if (!InitializeSecurityDescriptor (&sec_desc, SECURITY_DESCRIPTOR_REVISION)) @@ -436,8 +445,16 @@ cp->procinfo.hThread=NULL; cp->procinfo.hProcess=NULL; + /* Hack for Windows 95, which assigns large (ie negative) pids */ + if (cp->pid < 0) + cp->pid = -cp->pid; + /* pid must fit in a Lisp_Int */ - +#ifdef USE_UNION_TYPE + cp->pid = (cp->pid & ((1U << VALBITS) - 1)); +#else + cp->pid = (cp->pid & VALMASK); +#endif *pPid = cp->pid; @@ -448,6 +465,155 @@ return FALSE; } +#ifndef __MINGW32__ +/* Return pointer to section header for section containing the given + relative virtual address. */ +static IMAGE_SECTION_HEADER * +rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header) +{ + PIMAGE_SECTION_HEADER section; + int i; + + section = IMAGE_FIRST_SECTION (nt_header); + + for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) + { + if (rva >= section->VirtualAddress + && rva < section->VirtualAddress + section->SizeOfRawData) + return section; + section++; + } + return NULL; +} +#endif + +void +win32_executable_type (CONST char * filename, int * is_dos_app, int * is_cygnus_app) +{ + file_data executable; + char * p; + + /* Default values in case we can't tell for sure. */ + *is_dos_app = FALSE; + *is_cygnus_app = FALSE; + + if (!open_input_file (&executable, filename)) + return; + + p = strrchr (filename, '.'); + + /* We can only identify DOS .com programs from the extension. */ + if (p && stricmp (p, ".com") == 0) + *is_dos_app = TRUE; + else if (p && (stricmp (p, ".bat") == 0 || + stricmp (p, ".cmd") == 0)) + { + /* A DOS shell script - it appears that CreateProcess is happy to + accept this (somewhat surprisingly); presumably it looks at + COMSPEC to determine what executable to actually invoke. + Therefore, we have to do the same here as well. */ + /* Actually, I think it uses the program association for that + extension, which is defined in the registry. */ + p = egetenv ("COMSPEC"); + if (p) + win32_executable_type (p, is_dos_app, is_cygnus_app); + } + else + { + /* Look for DOS .exe signature - if found, we must also check that + it isn't really a 16- or 32-bit Windows exe, since both formats + start with a DOS program stub. Note that 16-bit Windows + executables use the OS/2 1.x format. */ + +#ifdef __MINGW32__ + /* mingw32 doesn't have enough headers to detect cygwin + apps, just do what we can. */ + FILHDR * exe_header; + + exe_header = (FILHDR*) executable.file_base; + if (exe_header->e_magic != DOSMAGIC) + goto unwind; + + if ((char *) exe_header->e_lfanew > (char *) executable.size) + { + /* Some dos headers (pkunzip) have bogus e_lfanew fields. */ + *is_dos_app = TRUE; + } + else if (exe_header->nt_signature != NT_SIGNATURE) + { + *is_dos_app = TRUE; + } +#else + IMAGE_DOS_HEADER * dos_header; + IMAGE_NT_HEADERS * nt_header; + + dos_header = (PIMAGE_DOS_HEADER) executable.file_base; + if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) + goto unwind; + + nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); + + if ((char *) nt_header > (char *) dos_header + executable.size) + { + /* Some dos headers (pkunzip) have bogus e_lfanew fields. */ + *is_dos_app = TRUE; + } + else if (nt_header->Signature != IMAGE_NT_SIGNATURE && + LOWORD (nt_header->Signature) != IMAGE_OS2_SIGNATURE) + { + *is_dos_app = TRUE; + } + else if (nt_header->Signature == IMAGE_NT_SIGNATURE) + { + /* Look for cygwin.dll in DLL import list. */ + IMAGE_DATA_DIRECTORY import_dir = + nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]; + IMAGE_IMPORT_DESCRIPTOR * imports; + IMAGE_SECTION_HEADER * section; + + section = rva_to_section (import_dir.VirtualAddress, nt_header); + imports = RVA_TO_PTR (import_dir.VirtualAddress, section, executable); + + for ( ; imports->Name; imports++) + { + char * dllname = RVA_TO_PTR (imports->Name, section, executable); + + if (strcmp (dllname, "cygwin.dll") == 0) + { + *is_cygnus_app = TRUE; + break; + } + } + } +#endif + } + + unwind: + close_file_data (&executable); +} + +int +compare_env (const void *strp1, const void *strp2) +{ + const char *str1 = *(const char**)strp1, *str2 = *(const char**)strp2; + + while (*str1 && *str2 && *str1 != '=' && *str2 != '=') + { + if ((*str1) > (*str2)) + return 1; + else if ((*str1) < (*str2)) + return -1; + str1++, str2++; + } + + if (*str1 == '=' && *str2 == '=') + return 0; + else if (*str1 == '=') + return -1; + else + return 1; +} + void merge_and_sort_env (char **envp1, char **envp2, char **new_envp) { @@ -465,7 +631,7 @@ *nptr++ = *optr++; num += optr - envp2; - qsort (new_envp, num, sizeof (char*), compare_env); + qsort (new_envp, num, sizeof (char *), compare_env); *nptr = NULL; } @@ -473,8 +639,8 @@ /* When a new child process is created we need to register it in our list, so intercept spawn requests. */ int -sys_spawnve (int mode, const char *cmdname, - const char * const *argv, const char *const *envp) +sys_spawnve (int mode, CONST char *cmdname, + CONST char * CONST *argv, CONST char *CONST *envp) { Lisp_Object program, full; char *cmdline, *env, *parg, **targ; @@ -510,13 +676,11 @@ errno = EINVAL; return -1; } - TO_EXTERNAL_FORMAT (LISP_STRING, full, - C_STRING_ALLOCA, cmdname, - Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (full, cmdname); } else { - cmdname = (char*)alloca (strlen (argv[0]) + 1); + (char*)cmdname = alloca (strlen (argv[0]) + 1); strcpy ((char*)cmdname, argv[0]); } UNGCPRO; @@ -524,21 +688,21 @@ /* make sure argv[0] and cmdname are both in DOS format */ unixtodos_filename ((char*)cmdname); /* #### KLUDGE */ - ((const char**)argv)[0] = cmdname; + ((CONST char**)argv)[0] = cmdname; /* Determine whether program is a 16-bit DOS executable, or a Win32 executable that is implicitly linked to the Cygnus dll (implying it was compiled with the Cygnus GNU toolchain and hence relies on cygwin.dll to parse the command line - we use this to decide how to escape quote chars in command line args that must be quoted). */ - mswindows_executable_type (cmdname, &is_dos_app, &is_cygnus_app); + win32_executable_type (cmdname, &is_dos_app, &is_cygnus_app); /* On Windows 95, if cmdname is a DOS app, we invoke a helper application to start it by specifying the helper app as cmdname, while leaving the real app name as argv[0]. */ if (is_dos_app) { - cmdname = (char*) alloca (MAXPATHLEN); + cmdname = alloca (MAXPATHLEN); if (egetenv ("CMDPROXY")) strcpy ((char*)cmdname, egetenv ("CMDPROXY")); else @@ -585,7 +749,7 @@ /* Override escape char by binding win32-quote-process-args to desired character, or use t for auto-selection. */ if (INTP (Vwin32_quote_process_args)) - escape_char = (char) XINT (Vwin32_quote_process_args); + escape_char = XINT (Vwin32_quote_process_args); else escape_char = is_cygnus_app ? '"' : '\\'; } @@ -637,7 +801,7 @@ } arglen += strlen (*targ++) + 1; } - cmdline = (char*) alloca (arglen); + cmdline = alloca (arglen); targ = (char**)argv; parg = cmdline; while (*targ) @@ -719,7 +883,7 @@ /* and envp... */ arglen = 1; - targ = (char**) envp; + targ = (char**)envp; numenv = 1; /* for end null */ while (*targ) { @@ -733,11 +897,11 @@ numenv++; /* merge env passed in and extra env into one, and sort it. */ - targ = (char **) alloca (numenv * sizeof (char*)); - merge_and_sort_env ((char**) envp, extra_env, targ); + targ = (char **) alloca (numenv * sizeof (char *)); + merge_and_sort_env ((char**)envp, extra_env, targ); /* concatenate env entries. */ - env = (char*) alloca (arglen); + env = alloca (arglen); parg = env; while (*targ) { @@ -781,7 +945,7 @@ GetClassName (hwnd, window_class, sizeof (window_class)); if (strcmp (window_class, - mswindows_windows9x_p() + (os_subtype == OS_WIN95) ? "tty" : "ConsoleWindowClass") == 0) { @@ -874,7 +1038,7 @@ if (NILP (Vwin32_start_process_share_console) && cp && cp->hwnd) { #if 1 - if (mswindows_windows9x_p()) + if (os_subtype == OS_WIN95) { /* Another possibility is to try terminating the VDM out-right by @@ -935,7 +1099,7 @@ #if 0 /* Sync with FSF Emacs 19.34.6 note: ifdef'ed out in XEmacs */ -extern int report_file_error (const char *, Lisp_Object); +extern int report_file_error (CONST char *, Lisp_Object); #endif /* The following two routines are used to manipulate stdin, stdout, and stderr of our child processes. @@ -1028,6 +1192,12 @@ /* Some miscellaneous functions that are Windows specific, but not GUI specific (ie. are applicable in terminal or batch mode as well). */ +/* lifted from fileio.c */ +#define CORRECT_DIR_SEPS(s) \ + do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ + else unixtodos_filename (s); \ + } while (0) + DEFUN ("win32-short-file-name", Fwin32_short_file_name, 1, 1, "", /* Return the short file name version (8.3) of the full path of FILENAME. If FILENAME does not exist, return nil. @@ -1257,7 +1427,7 @@ /* Sync with FSF Emacs 19.34.6 note: dwWinThreadId declared in w32term.h and defined in w32fns.c, both of which are not in current - XEmacs. #### Check what we lose by ifdef'ing out these. --marcpa */ + XEmacs. ### Check what we lose by ifdef'ing out these. --marcpa */ #if 0 /* Need to set input thread locale if present. */ if (dwWinThreadId) @@ -1270,8 +1440,11 @@ void -syms_of_ntproc (void) +syms_of_ntproc () { + Qhigh = intern ("high"); + Qlow = intern ("low"); + DEFSUBR (Fwin32_short_file_name); DEFSUBR (Fwin32_long_file_name); DEFSUBR (Fwin32_set_process_priority); @@ -1280,14 +1453,6 @@ DEFSUBR (Fwin32_get_default_locale_id); DEFSUBR (Fwin32_get_valid_locale_ids); DEFSUBR (Fwin32_set_current_locale); -} - - -void -vars_of_ntproc (void) -{ - defsymbol (&Qhigh, "high"); - defsymbol (&Qlow, "low"); DEFVAR_LISP ("win32-quote-process-args", &Vwin32_quote_process_args /* Non-nil enables quoting of process arguments to ensure correct parsing. @@ -1318,7 +1483,7 @@ subprocess group, but may allow Emacs to interrupt a subprocess that doesn't otherwise respond to interrupts from Emacs. */ ); - Vwin32_start_process_share_console = Qt; + Vwin32_start_process_share_console = Qnil; DEFVAR_LISP ("win32-pipe-read-delay", &Vwin32_pipe_read_delay /* Forced delay before reading subprocess output. @@ -1343,5 +1508,4 @@ Vwin32_generate_fake_inodes = Qnil; #endif } - /* end of ntproc.c */ diff -r 12e008d41344 -r 697ef44129c6 src/objects-msw.c --- a/src/objects-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -49,692 +49,689 @@ #include "device.h" #include "insdel.h" +#if defined(__CYGWIN32__) || defined(__MINGW32__) +#define stricmp strcasecmp +#define FONTENUMPROC FONTENUMEXPROC +#define ntmTm ntmentm +#endif + typedef struct colormap_t { - const char *name; - COLORREF colorref; + CONST char *name; + CONST COLORREF colorref; } colormap_t; /* Colors from X11R6 "XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp" */ -/* MSWindows tends to round up the numbers in it's palette, ie where X uses - * 127, MSWindows uses 128. Colors commented as "Adjusted" are tweaked to - * match the Windows standard palette to increase the likelyhood of - * mswindows_color_to_string() finding a named match. - */ -static const colormap_t mswindows_X_color_map[] = +static CONST colormap_t mswindows_X_color_map[] = { - {"white" , PALETTERGB (255, 255, 255) }, - {"black" , PALETTERGB (0, 0, 0) }, - {"snow" , PALETTERGB (255, 250, 250) }, - {"GhostWhite" , PALETTERGB (248, 248, 255) }, - {"WhiteSmoke" , PALETTERGB (245, 245, 245) }, - {"gainsboro" , PALETTERGB (220, 220, 220) }, - {"FloralWhite" , PALETTERGB (255, 250, 240) }, - {"OldLace" , PALETTERGB (253, 245, 230) }, - {"linen" , PALETTERGB (250, 240, 230) }, - {"AntiqueWhite" , PALETTERGB (250, 235, 215) }, - {"PapayaWhip" , PALETTERGB (255, 239, 213) }, - {"BlanchedAlmond" , PALETTERGB (255, 235, 205) }, - {"bisque" , PALETTERGB (255, 228, 196) }, - {"PeachPuff" , PALETTERGB (255, 218, 185) }, - {"NavajoWhite" , PALETTERGB (255, 222, 173) }, - {"moccasin" , PALETTERGB (255, 228, 181) }, - {"cornsilk" , PALETTERGB (255, 248, 220) }, - {"ivory" , PALETTERGB (255, 255, 240) }, - {"LemonChiffon" , PALETTERGB (255, 250, 205) }, - {"seashell" , PALETTERGB (255, 245, 238) }, - {"honeydew" , PALETTERGB (240, 255, 240) }, - {"MintCream" , PALETTERGB (245, 255, 250) }, - {"azure" , PALETTERGB (240, 255, 255) }, - {"AliceBlue" , PALETTERGB (240, 248, 255) }, - {"lavender" , PALETTERGB (230, 230, 250) }, - {"LavenderBlush" , PALETTERGB (255, 240, 245) }, - {"MistyRose" , PALETTERGB (255, 228, 225) }, - {"DarkSlateGray" , PALETTERGB (47, 79, 79) }, - {"DarkSlateGrey" , PALETTERGB (47, 79, 79) }, - {"DimGray" , PALETTERGB (105, 105, 105) }, - {"DimGrey" , PALETTERGB (105, 105, 105) }, - {"SlateGray" , PALETTERGB (112, 128, 144) }, - {"SlateGrey" , PALETTERGB (112, 128, 144) }, - {"LightSlateGray" , PALETTERGB (119, 136, 153) }, - {"LightSlateGrey" , PALETTERGB (119, 136, 153) }, - {"gray" , PALETTERGB (190, 190, 190) }, - {"grey" , PALETTERGB (190, 190, 190) }, - {"LightGrey" , PALETTERGB (211, 211, 211) }, - {"LightGray" , PALETTERGB (211, 211, 211) }, - {"MidnightBlue" , PALETTERGB (25, 25, 112) }, - {"navy" , PALETTERGB (0, 0, 128) }, - {"NavyBlue" , PALETTERGB (0, 0, 128) }, - {"CornflowerBlue" , PALETTERGB (100, 149, 237) }, - {"DarkSlateBlue" , PALETTERGB (72, 61, 139) }, - {"SlateBlue" , PALETTERGB (106, 90, 205) }, - {"MediumSlateBlue" , PALETTERGB (123, 104, 238) }, - {"LightSlateBlue" , PALETTERGB (132, 112, 255) }, - {"MediumBlue" , PALETTERGB (0, 0, 205) }, - {"RoyalBlue" , PALETTERGB (65, 105, 225) }, - {"blue" , PALETTERGB (0, 0, 255) }, - {"DodgerBlue" , PALETTERGB (30, 144, 255) }, - {"DeepSkyBlue" , PALETTERGB (0, 191, 255) }, - {"SkyBlue" , PALETTERGB (135, 206, 235) }, - {"LightSkyBlue" , PALETTERGB (135, 206, 250) }, - {"SteelBlue" , PALETTERGB (70, 130, 180) }, - {"LightSteelBlue" , PALETTERGB (176, 196, 222) }, - {"LightBlue" , PALETTERGB (173, 216, 230) }, - {"PowderBlue" , PALETTERGB (176, 224, 230) }, - {"PaleTurquoise" , PALETTERGB (175, 238, 238) }, - {"DarkTurquoise" , PALETTERGB (0, 206, 209) }, - {"MediumTurquoise" , PALETTERGB (72, 209, 204) }, - {"turquoise" , PALETTERGB (64, 224, 208) }, - {"cyan" , PALETTERGB (0, 255, 255) }, - {"LightCyan" , PALETTERGB (224, 255, 255) }, - {"CadetBlue" , PALETTERGB (95, 158, 160) }, - {"MediumAquamarine" , PALETTERGB (102, 205, 170) }, - {"aquamarine" , PALETTERGB (127, 255, 212) }, - {"DarkGreen" , PALETTERGB (0, 128, 0) }, /* Adjusted */ - {"DarkOliveGreen" , PALETTERGB (85, 107, 47) }, - {"DarkSeaGreen" , PALETTERGB (143, 188, 143) }, - {"SeaGreen" , PALETTERGB (46, 139, 87) }, - {"MediumSeaGreen" , PALETTERGB (60, 179, 113) }, - {"LightSeaGreen" , PALETTERGB (32, 178, 170) }, - {"PaleGreen" , PALETTERGB (152, 251, 152) }, - {"SpringGreen" , PALETTERGB (0, 255, 127) }, - {"LawnGreen" , PALETTERGB (124, 252, 0) }, - {"green" , PALETTERGB (0, 255, 0) }, - {"chartreuse" , PALETTERGB (127, 255, 0) }, - {"MediumSpringGreen" , PALETTERGB (0, 250, 154) }, - {"GreenYellow" , PALETTERGB (173, 255, 47) }, - {"LimeGreen" , PALETTERGB (50, 205, 50) }, - {"YellowGreen" , PALETTERGB (154, 205, 50) }, - {"ForestGreen" , PALETTERGB (34, 139, 34) }, - {"OliveDrab" , PALETTERGB (107, 142, 35) }, - {"DarkKhaki" , PALETTERGB (189, 183, 107) }, - {"khaki" , PALETTERGB (240, 230, 140) }, - {"PaleGoldenrod" , PALETTERGB (238, 232, 170) }, - {"LightGoldenrodYellow", PALETTERGB (250, 250, 210) }, - {"LightYellow" , PALETTERGB (255, 255, 224) }, - {"LightYellow" , PALETTERGB (255, 255, 225) }, /* Adjusted */ - {"yellow" , PALETTERGB (255, 255, 0) }, - {"gold" , PALETTERGB (255, 215, 0) }, - {"LightGoldenrod" , PALETTERGB (238, 221, 130) }, - {"goldenrod" , PALETTERGB (218, 165, 32) }, - {"DarkGoldenrod" , PALETTERGB (184, 134, 11) }, - {"RosyBrown" , PALETTERGB (188, 143, 143) }, - {"IndianRed" , PALETTERGB (205, 92, 92) }, - {"SaddleBrown" , PALETTERGB (139, 69, 19) }, - {"sienna" , PALETTERGB (160, 82, 45) }, - {"peru" , PALETTERGB (205, 133, 63) }, - {"burlywood" , PALETTERGB (222, 184, 135) }, - {"beige" , PALETTERGB (245, 245, 220) }, - {"wheat" , PALETTERGB (245, 222, 179) }, - {"SandyBrown" , PALETTERGB (244, 164, 96) }, - {"tan" , PALETTERGB (210, 180, 140) }, - {"chocolate" , PALETTERGB (210, 105, 30) }, - {"firebrick" , PALETTERGB (178, 34, 34) }, - {"brown" , PALETTERGB (165, 42, 42) }, - {"DarkSalmon" , PALETTERGB (233, 150, 122) }, - {"salmon" , PALETTERGB (250, 128, 114) }, - {"LightSalmon" , PALETTERGB (255, 160, 122) }, - {"orange" , PALETTERGB (255, 165, 0) }, - {"DarkOrange" , PALETTERGB (255, 140, 0) }, - {"coral" , PALETTERGB (255, 127, 80) }, - {"LightCoral" , PALETTERGB (240, 128, 128) }, - {"tomato" , PALETTERGB (255, 99, 71) }, - {"OrangeRed" , PALETTERGB (255, 69, 0) }, - {"red" , PALETTERGB (255, 0, 0) }, - {"HotPink" , PALETTERGB (255, 105, 180) }, - {"DeepPink" , PALETTERGB (255, 20, 147) }, - {"pink" , PALETTERGB (255, 192, 203) }, - {"LightPink" , PALETTERGB (255, 182, 193) }, - {"PaleVioletRed" , PALETTERGB (219, 112, 147) }, - {"maroon" , PALETTERGB (176, 48, 96) }, - {"MediumVioletRed" , PALETTERGB (199, 21, 133) }, - {"VioletRed" , PALETTERGB (208, 32, 144) }, - {"magenta" , PALETTERGB (255, 0, 255) }, - {"violet" , PALETTERGB (238, 130, 238) }, - {"plum" , PALETTERGB (221, 160, 221) }, - {"orchid" , PALETTERGB (218, 112, 214) }, - {"MediumOrchid" , PALETTERGB (186, 85, 211) }, - {"DarkOrchid" , PALETTERGB (153, 50, 204) }, - {"DarkViolet" , PALETTERGB (148, 0, 211) }, - {"BlueViolet" , PALETTERGB (138, 43, 226) }, - {"purple" , PALETTERGB (160, 32, 240) }, - {"MediumPurple" , PALETTERGB (147, 112, 219) }, - {"thistle" , PALETTERGB (216, 191, 216) }, - {"snow1" , PALETTERGB (255, 250, 250) }, - {"snow2" , PALETTERGB (238, 233, 233) }, - {"snow3" , PALETTERGB (205, 201, 201) }, - {"snow4" , PALETTERGB (139, 137, 137) }, - {"seashell1" , PALETTERGB (255, 245, 238) }, - {"seashell2" , PALETTERGB (238, 229, 222) }, - {"seashell3" , PALETTERGB (205, 197, 191) }, - {"seashell4" , PALETTERGB (139, 134, 130) }, - {"AntiqueWhite1" , PALETTERGB (255, 239, 219) }, - {"AntiqueWhite2" , PALETTERGB (238, 223, 204) }, - {"AntiqueWhite3" , PALETTERGB (205, 192, 176) }, - {"AntiqueWhite4" , PALETTERGB (139, 131, 120) }, - {"bisque1" , PALETTERGB (255, 228, 196) }, - {"bisque2" , PALETTERGB (238, 213, 183) }, - {"bisque3" , PALETTERGB (205, 183, 158) }, - {"bisque4" , PALETTERGB (139, 125, 107) }, - {"PeachPuff1" , PALETTERGB (255, 218, 185) }, - {"PeachPuff2" , PALETTERGB (238, 203, 173) }, - {"PeachPuff3" , PALETTERGB (205, 175, 149) }, - {"PeachPuff4" , PALETTERGB (139, 119, 101) }, - {"NavajoWhite1" , PALETTERGB (255, 222, 173) }, - {"NavajoWhite2" , PALETTERGB (238, 207, 161) }, - {"NavajoWhite3" , PALETTERGB (205, 179, 139) }, - {"NavajoWhite4" , PALETTERGB (139, 121, 94) }, - {"LemonChiffon1" , PALETTERGB (255, 250, 205) }, - {"LemonChiffon2" , PALETTERGB (238, 233, 191) }, - {"LemonChiffon3" , PALETTERGB (205, 201, 165) }, - {"LemonChiffon4" , PALETTERGB (139, 137, 112) }, - {"cornsilk1" , PALETTERGB (255, 248, 220) }, - {"cornsilk2" , PALETTERGB (238, 232, 205) }, - {"cornsilk3" , PALETTERGB (205, 200, 177) }, - {"cornsilk4" , PALETTERGB (139, 136, 120) }, - {"ivory1" , PALETTERGB (255, 255, 240) }, - {"ivory2" , PALETTERGB (240, 240, 208) }, /* Adjusted */ - {"ivory3" , PALETTERGB (205, 205, 193) }, - {"ivory4" , PALETTERGB (139, 139, 131) }, - {"honeydew1" , PALETTERGB (240, 255, 240) }, - {"honeydew2" , PALETTERGB (224, 238, 224) }, - {"honeydew3" , PALETTERGB (193, 205, 193) }, - {"honeydew4" , PALETTERGB (131, 139, 131) }, - {"LavenderBlush1" , PALETTERGB (255, 240, 245) }, - {"LavenderBlush2" , PALETTERGB (238, 224, 229) }, - {"LavenderBlush3" , PALETTERGB (205, 193, 197) }, - {"LavenderBlush4" , PALETTERGB (139, 131, 134) }, - {"MistyRose1" , PALETTERGB (255, 228, 225) }, - {"MistyRose2" , PALETTERGB (238, 213, 210) }, - {"MistyRose3" , PALETTERGB (205, 183, 181) }, - {"MistyRose4" , PALETTERGB (139, 125, 123) }, - {"azure1" , PALETTERGB (240, 255, 255) }, - {"azure2" , PALETTERGB (224, 238, 238) }, - {"azure3" , PALETTERGB (193, 205, 205) }, - {"azure4" , PALETTERGB (131, 139, 139) }, - {"SlateBlue1" , PALETTERGB (131, 111, 255) }, - {"SlateBlue2" , PALETTERGB (122, 103, 238) }, - {"SlateBlue3" , PALETTERGB (105, 89, 205) }, - {"SlateBlue4" , PALETTERGB (71, 60, 139) }, - {"RoyalBlue1" , PALETTERGB (72, 118, 255) }, - {"RoyalBlue2" , PALETTERGB (67, 110, 238) }, - {"RoyalBlue3" , PALETTERGB (58, 95, 205) }, - {"RoyalBlue4" , PALETTERGB (39, 64, 139) }, - {"blue1" , PALETTERGB (0, 0, 255) }, - {"blue2" , PALETTERGB (0, 0, 238) }, - {"blue3" , PALETTERGB (0, 0, 205) }, - {"blue4" , PALETTERGB (0, 0, 139) }, - {"DodgerBlue1" , PALETTERGB (30, 144, 255) }, - {"DodgerBlue2" , PALETTERGB (28, 134, 238) }, - {"DodgerBlue3" , PALETTERGB (24, 116, 205) }, - {"DodgerBlue4" , PALETTERGB (16, 78, 139) }, - {"SteelBlue1" , PALETTERGB (99, 184, 255) }, - {"SteelBlue2" , PALETTERGB (92, 172, 238) }, - {"SteelBlue3" , PALETTERGB (79, 148, 205) }, - {"SteelBlue4" , PALETTERGB (54, 100, 139) }, - {"DeepSkyBlue1" , PALETTERGB (0, 191, 255) }, - {"DeepSkyBlue2" , PALETTERGB (0, 178, 238) }, - {"DeepSkyBlue3" , PALETTERGB (0, 154, 205) }, - {"DeepSkyBlue4" , PALETTERGB (0, 104, 139) }, - {"SkyBlue1" , PALETTERGB (135, 206, 255) }, - {"SkyBlue2" , PALETTERGB (126, 192, 238) }, - {"SkyBlue3" , PALETTERGB (108, 166, 205) }, - {"SkyBlue4" , PALETTERGB (74, 112, 139) }, - {"LightSkyBlue1" , PALETTERGB (176, 226, 255) }, - {"LightSkyBlue2" , PALETTERGB (164, 211, 238) }, - {"LightSkyBlue3" , PALETTERGB (141, 182, 205) }, - {"LightSkyBlue4" , PALETTERGB (96, 123, 139) }, - {"SlateGray1" , PALETTERGB (198, 226, 255) }, - {"SlateGray2" , PALETTERGB (185, 211, 238) }, - {"SlateGray3" , PALETTERGB (159, 182, 205) }, - {"SlateGray4" , PALETTERGB (108, 123, 139) }, - {"LightSteelBlue1" , PALETTERGB (202, 225, 255) }, - {"LightSteelBlue2" , PALETTERGB (188, 210, 238) }, - {"LightSteelBlue3" , PALETTERGB (162, 181, 205) }, - {"LightSteelBlue4" , PALETTERGB (110, 123, 139) }, - {"LightBlue1" , PALETTERGB (191, 239, 255) }, - {"LightBlue2" , PALETTERGB (178, 223, 238) }, - {"LightBlue3" , PALETTERGB (154, 192, 205) }, - {"LightBlue4" , PALETTERGB (104, 131, 139) }, - {"LightCyan1" , PALETTERGB (224, 255, 255) }, - {"LightCyan2" , PALETTERGB (209, 238, 238) }, - {"LightCyan3" , PALETTERGB (180, 205, 205) }, - {"LightCyan4" , PALETTERGB (122, 139, 139) }, - {"PaleTurquoise1" , PALETTERGB (187, 255, 255) }, - {"PaleTurquoise2" , PALETTERGB (174, 238, 238) }, - {"PaleTurquoise3" , PALETTERGB (150, 205, 205) }, - {"PaleTurquoise4" , PALETTERGB (102, 139, 139) }, - {"CadetBlue1" , PALETTERGB (152, 245, 255) }, - {"CadetBlue2" , PALETTERGB (144, 220, 240) }, /* Adjusted */ - {"CadetBlue3" , PALETTERGB (122, 197, 205) }, - {"CadetBlue4" , PALETTERGB (83, 134, 139) }, - {"turquoise1" , PALETTERGB (0, 245, 255) }, - {"turquoise2" , PALETTERGB (0, 229, 238) }, - {"turquoise3" , PALETTERGB (0, 197, 205) }, - {"turquoise4" , PALETTERGB (0, 134, 139) }, - {"cyan1" , PALETTERGB (0, 255, 255) }, - {"cyan2" , PALETTERGB (0, 238, 238) }, - {"cyan3" , PALETTERGB (0, 205, 205) }, - {"cyan4" , PALETTERGB (0, 139, 139) }, - {"DarkSlateGray1" , PALETTERGB (151, 255, 255) }, - {"DarkSlateGray2" , PALETTERGB (141, 238, 238) }, - {"DarkSlateGray3" , PALETTERGB (121, 205, 205) }, - {"DarkSlateGray4" , PALETTERGB (82, 139, 139) }, - {"aquamarine1" , PALETTERGB (127, 255, 212) }, - {"aquamarine2" , PALETTERGB (118, 238, 198) }, - {"aquamarine3" , PALETTERGB (102, 205, 170) }, - {"aquamarine4" , PALETTERGB (69, 139, 116) }, - {"DarkSeaGreen1" , PALETTERGB (193, 255, 193) }, - {"DarkSeaGreen2" , PALETTERGB (180, 238, 180) }, - {"DarkSeaGreen3" , PALETTERGB (155, 205, 155) }, - {"DarkSeaGreen4" , PALETTERGB (105, 139, 105) }, - {"SeaGreen1" , PALETTERGB (84, 255, 159) }, - {"SeaGreen2" , PALETTERGB (78, 238, 148) }, - {"SeaGreen3" , PALETTERGB (67, 205, 128) }, - {"SeaGreen4" , PALETTERGB (46, 139, 87) }, - {"PaleGreen1" , PALETTERGB (154, 255, 154) }, - {"PaleGreen2" , PALETTERGB (144, 238, 144) }, - {"PaleGreen3" , PALETTERGB (124, 205, 124) }, - {"PaleGreen4" , PALETTERGB (84, 139, 84) }, - {"SpringGreen1" , PALETTERGB (0, 255, 127) }, - {"SpringGreen2" , PALETTERGB (0, 238, 118) }, - {"SpringGreen3" , PALETTERGB (0, 205, 102) }, - {"SpringGreen4" , PALETTERGB (0, 139, 69) }, - {"green1" , PALETTERGB (0, 255, 0) }, - {"green2" , PALETTERGB (0, 238, 0) }, - {"green3" , PALETTERGB (0, 205, 0) }, - {"green4" , PALETTERGB (0, 139, 0) }, - {"chartreuse1" , PALETTERGB (127, 255, 0) }, - {"chartreuse2" , PALETTERGB (118, 238, 0) }, - {"chartreuse3" , PALETTERGB (102, 205, 0) }, - {"chartreuse4" , PALETTERGB (69, 139, 0) }, - {"OliveDrab1" , PALETTERGB (192, 255, 62) }, - {"OliveDrab2" , PALETTERGB (179, 238, 58) }, - {"OliveDrab3" , PALETTERGB (154, 205, 50) }, - {"OliveDrab4" , PALETTERGB (105, 139, 34) }, - {"DarkOliveGreen1" , PALETTERGB (202, 255, 112) }, - {"DarkOliveGreen2" , PALETTERGB (188, 238, 104) }, - {"DarkOliveGreen3" , PALETTERGB (162, 205, 90) }, - {"DarkOliveGreen4" , PALETTERGB (110, 139, 61) }, - {"khaki1" , PALETTERGB (255, 246, 143) }, - {"khaki2" , PALETTERGB (238, 230, 133) }, - {"khaki3" , PALETTERGB (205, 198, 115) }, - {"khaki4" , PALETTERGB (139, 134, 78) }, - {"LightGoldenrod1" , PALETTERGB (255, 236, 139) }, - {"LightGoldenrod2" , PALETTERGB (238, 220, 130) }, - {"LightGoldenrod3" , PALETTERGB (205, 190, 112) }, - {"LightGoldenrod4" , PALETTERGB (139, 129, 76) }, - {"LightYellow1" , PALETTERGB (255, 255, 224) }, - {"LightYellow2" , PALETTERGB (238, 238, 209) }, - {"LightYellow3" , PALETTERGB (205, 205, 180) }, - {"LightYellow4" , PALETTERGB (139, 139, 122) }, - {"yellow1" , PALETTERGB (255, 255, 0) }, - {"yellow2" , PALETTERGB (238, 238, 0) }, - {"yellow3" , PALETTERGB (205, 205, 0) }, - {"yellow4" , PALETTERGB (139, 139, 0) }, - {"gold1" , PALETTERGB (255, 215, 0) }, - {"gold2" , PALETTERGB (238, 201, 0) }, - {"gold3" , PALETTERGB (205, 173, 0) }, - {"gold4" , PALETTERGB (139, 117, 0) }, - {"goldenrod1" , PALETTERGB (255, 193, 37) }, - {"goldenrod2" , PALETTERGB (238, 180, 34) }, - {"goldenrod3" , PALETTERGB (205, 155, 29) }, - {"goldenrod4" , PALETTERGB (139, 105, 20) }, - {"DarkGoldenrod1" , PALETTERGB (255, 185, 15) }, - {"DarkGoldenrod2" , PALETTERGB (238, 173, 14) }, - {"DarkGoldenrod3" , PALETTERGB (205, 149, 12) }, - {"DarkGoldenrod4" , PALETTERGB (139, 101, 8) }, - {"RosyBrown1" , PALETTERGB (255, 193, 193) }, - {"RosyBrown2" , PALETTERGB (238, 180, 180) }, - {"RosyBrown3" , PALETTERGB (205, 155, 155) }, - {"RosyBrown4" , PALETTERGB (139, 105, 105) }, - {"IndianRed1" , PALETTERGB (255, 106, 106) }, - {"IndianRed2" , PALETTERGB (238, 99, 99) }, - {"IndianRed3" , PALETTERGB (205, 85, 85) }, - {"IndianRed4" , PALETTERGB (139, 58, 58) }, - {"sienna1" , PALETTERGB (255, 130, 71) }, - {"sienna2" , PALETTERGB (238, 121, 66) }, - {"sienna3" , PALETTERGB (205, 104, 57) }, - {"sienna4" , PALETTERGB (139, 71, 38) }, - {"burlywood1" , PALETTERGB (255, 211, 155) }, - {"burlywood2" , PALETTERGB (238, 197, 145) }, - {"burlywood3" , PALETTERGB (205, 170, 125) }, - {"burlywood4" , PALETTERGB (139, 115, 85) }, - {"wheat1" , PALETTERGB (255, 231, 186) }, - {"wheat2" , PALETTERGB (238, 216, 174) }, - {"wheat3" , PALETTERGB (205, 186, 150) }, - {"wheat4" , PALETTERGB (139, 126, 102) }, - {"tan1" , PALETTERGB (255, 165, 79) }, - {"tan2" , PALETTERGB (238, 154, 73) }, - {"tan3" , PALETTERGB (205, 133, 63) }, - {"tan4" , PALETTERGB (139, 90, 43) }, - {"chocolate1" , PALETTERGB (255, 127, 36) }, - {"chocolate2" , PALETTERGB (238, 118, 33) }, - {"chocolate3" , PALETTERGB (205, 102, 29) }, - {"chocolate4" , PALETTERGB (139, 69, 19) }, - {"firebrick1" , PALETTERGB (255, 48, 48) }, - {"firebrick2" , PALETTERGB (238, 44, 44) }, - {"firebrick3" , PALETTERGB (205, 38, 38) }, - {"firebrick4" , PALETTERGB (139, 26, 26) }, - {"brown1" , PALETTERGB (255, 64, 64) }, - {"brown2" , PALETTERGB (238, 59, 59) }, - {"brown3" , PALETTERGB (205, 51, 51) }, - {"brown4" , PALETTERGB (139, 35, 35) }, - {"salmon1" , PALETTERGB (255, 140, 105) }, - {"salmon2" , PALETTERGB (238, 130, 98) }, - {"salmon3" , PALETTERGB (205, 112, 84) }, - {"salmon4" , PALETTERGB (139, 76, 57) }, - {"LightSalmon1" , PALETTERGB (255, 160, 122) }, - {"LightSalmon2" , PALETTERGB (238, 149, 114) }, - {"LightSalmon3" , PALETTERGB (205, 129, 98) }, - {"LightSalmon4" , PALETTERGB (139, 87, 66) }, - {"orange1" , PALETTERGB (255, 165, 0) }, - {"orange2" , PALETTERGB (238, 154, 0) }, - {"orange3" , PALETTERGB (205, 133, 0) }, - {"orange4" , PALETTERGB (139, 90, 0) }, - {"DarkOrange1" , PALETTERGB (255, 127, 0) }, - {"DarkOrange2" , PALETTERGB (238, 118, 0) }, - {"DarkOrange3" , PALETTERGB (205, 102, 0) }, - {"DarkOrange4" , PALETTERGB (139, 69, 0) }, - {"coral1" , PALETTERGB (255, 114, 86) }, - {"coral2" , PALETTERGB (238, 106, 80) }, - {"coral3" , PALETTERGB (205, 91, 69) }, - {"coral4" , PALETTERGB (139, 62, 47) }, - {"tomato1" , PALETTERGB (255, 99, 71) }, - {"tomato2" , PALETTERGB (238, 92, 66) }, - {"tomato3" , PALETTERGB (205, 79, 57) }, - {"tomato4" , PALETTERGB (139, 54, 38) }, - {"OrangeRed1" , PALETTERGB (255, 69, 0) }, - {"OrangeRed2" , PALETTERGB (238, 64, 0) }, - {"OrangeRed3" , PALETTERGB (205, 55, 0) }, - {"OrangeRed4" , PALETTERGB (139, 37, 0) }, - {"red1" , PALETTERGB (255, 0, 0) }, - {"red2" , PALETTERGB (238, 0, 0) }, - {"red3" , PALETTERGB (205, 0, 0) }, - {"red4" , PALETTERGB (139, 0, 0) }, - {"DeepPink1" , PALETTERGB (255, 20, 147) }, - {"DeepPink2" , PALETTERGB (238, 18, 137) }, - {"DeepPink3" , PALETTERGB (205, 16, 118) }, - {"DeepPink4" , PALETTERGB (139, 10, 80) }, - {"HotPink1" , PALETTERGB (255, 110, 180) }, - {"HotPink2" , PALETTERGB (238, 106, 167) }, - {"HotPink3" , PALETTERGB (205, 96, 144) }, - {"HotPink4" , PALETTERGB (139, 58, 98) }, - {"pink1" , PALETTERGB (255, 181, 197) }, - {"pink2" , PALETTERGB (238, 169, 184) }, - {"pink3" , PALETTERGB (205, 145, 158) }, - {"pink4" , PALETTERGB (139, 99, 108) }, - {"LightPink1" , PALETTERGB (255, 174, 185) }, - {"LightPink2" , PALETTERGB (238, 162, 173) }, - {"LightPink3" , PALETTERGB (205, 140, 149) }, - {"LightPink4" , PALETTERGB (139, 95, 101) }, - {"PaleVioletRed1" , PALETTERGB (255, 130, 171) }, - {"PaleVioletRed2" , PALETTERGB (238, 121, 159) }, - {"PaleVioletRed3" , PALETTERGB (205, 104, 137) }, - {"PaleVioletRed4" , PALETTERGB (139, 71, 93) }, - {"maroon1" , PALETTERGB (255, 52, 179) }, - {"maroon2" , PALETTERGB (238, 48, 167) }, - {"maroon3" , PALETTERGB (205, 41, 144) }, - {"maroon4" , PALETTERGB (139, 28, 98) }, - {"VioletRed1" , PALETTERGB (255, 62, 150) }, - {"VioletRed2" , PALETTERGB (238, 58, 140) }, - {"VioletRed3" , PALETTERGB (205, 50, 120) }, - {"VioletRed4" , PALETTERGB (139, 34, 82) }, - {"magenta1" , PALETTERGB (255, 0, 255) }, - {"magenta2" , PALETTERGB (238, 0, 238) }, - {"magenta3" , PALETTERGB (205, 0, 205) }, - {"magenta4" , PALETTERGB (139, 0, 139) }, - {"orchid1" , PALETTERGB (255, 131, 250) }, - {"orchid2" , PALETTERGB (238, 122, 233) }, - {"orchid3" , PALETTERGB (205, 105, 201) }, - {"orchid4" , PALETTERGB (139, 71, 137) }, - {"plum1" , PALETTERGB (255, 187, 255) }, - {"plum2" , PALETTERGB (238, 174, 238) }, - {"plum3" , PALETTERGB (205, 150, 205) }, - {"plum4" , PALETTERGB (139, 102, 139) }, - {"MediumOrchid1" , PALETTERGB (224, 102, 255) }, - {"MediumOrchid2" , PALETTERGB (209, 95, 238) }, - {"MediumOrchid3" , PALETTERGB (180, 82, 205) }, - {"MediumOrchid4" , PALETTERGB (122, 55, 139) }, - {"DarkOrchid1" , PALETTERGB (191, 62, 255) }, - {"DarkOrchid2" , PALETTERGB (178, 58, 238) }, - {"DarkOrchid3" , PALETTERGB (154, 50, 205) }, - {"DarkOrchid4" , PALETTERGB (104, 34, 139) }, - {"purple1" , PALETTERGB (155, 48, 255) }, - {"purple2" , PALETTERGB (145, 44, 238) }, - {"purple3" , PALETTERGB (125, 38, 205) }, - {"purple4" , PALETTERGB (85, 26, 139) }, - {"MediumPurple1" , PALETTERGB (171, 130, 255) }, - {"MediumPurple2" , PALETTERGB (159, 121, 238) }, - {"MediumPurple3" , PALETTERGB (137, 104, 205) }, - {"MediumPurple4" , PALETTERGB (93, 71, 139) }, - {"thistle1" , PALETTERGB (255, 225, 255) }, - {"thistle2" , PALETTERGB (238, 210, 238) }, - {"thistle3" , PALETTERGB (205, 181, 205) }, - {"thistle4" , PALETTERGB (139, 123, 139) }, - {"gray0" , PALETTERGB (0, 0, 0) }, - {"grey0" , PALETTERGB (0, 0, 0) }, - {"gray1" , PALETTERGB (3, 3, 3) }, - {"grey1" , PALETTERGB (3, 3, 3) }, - {"gray2" , PALETTERGB (5, 5, 5) }, - {"grey2" , PALETTERGB (5, 5, 5) }, - {"gray3" , PALETTERGB (8, 8, 8) }, - {"grey3" , PALETTERGB (8, 8, 8) }, - {"gray4" , PALETTERGB (10, 10, 10) }, - {"grey4" , PALETTERGB (10, 10, 10) }, - {"gray5" , PALETTERGB (13, 13, 13) }, - {"grey5" , PALETTERGB (13, 13, 13) }, - {"gray6" , PALETTERGB (15, 15, 15) }, - {"grey6" , PALETTERGB (15, 15, 15) }, - {"gray7" , PALETTERGB (18, 18, 18) }, - {"grey7" , PALETTERGB (18, 18, 18) }, - {"gray8" , PALETTERGB (20, 20, 20) }, - {"grey8" , PALETTERGB (20, 20, 20) }, - {"gray9" , PALETTERGB (23, 23, 23) }, - {"grey9" , PALETTERGB (23, 23, 23) }, - {"gray10" , PALETTERGB (26, 26, 26) }, - {"grey10" , PALETTERGB (26, 26, 26) }, - {"gray11" , PALETTERGB (28, 28, 28) }, - {"grey11" , PALETTERGB (28, 28, 28) }, - {"gray12" , PALETTERGB (31, 31, 31) }, - {"grey12" , PALETTERGB (31, 31, 31) }, - {"gray13" , PALETTERGB (33, 33, 33) }, - {"grey13" , PALETTERGB (33, 33, 33) }, - {"gray14" , PALETTERGB (36, 36, 36) }, - {"grey14" , PALETTERGB (36, 36, 36) }, - {"gray15" , PALETTERGB (38, 38, 38) }, - {"grey15" , PALETTERGB (38, 38, 38) }, - {"gray16" , PALETTERGB (41, 41, 41) }, - {"grey16" , PALETTERGB (41, 41, 41) }, - {"gray17" , PALETTERGB (43, 43, 43) }, - {"grey17" , PALETTERGB (43, 43, 43) }, - {"gray18" , PALETTERGB (46, 46, 46) }, - {"grey18" , PALETTERGB (46, 46, 46) }, - {"gray19" , PALETTERGB (48, 48, 48) }, - {"grey19" , PALETTERGB (48, 48, 48) }, - {"gray20" , PALETTERGB (51, 51, 51) }, - {"grey20" , PALETTERGB (51, 51, 51) }, - {"gray21" , PALETTERGB (54, 54, 54) }, - {"grey21" , PALETTERGB (54, 54, 54) }, - {"gray22" , PALETTERGB (56, 56, 56) }, - {"grey22" , PALETTERGB (56, 56, 56) }, - {"gray23" , PALETTERGB (59, 59, 59) }, - {"grey23" , PALETTERGB (59, 59, 59) }, - {"gray24" , PALETTERGB (61, 61, 61) }, - {"grey24" , PALETTERGB (61, 61, 61) }, - {"gray25" , PALETTERGB (64, 64, 64) }, - {"grey25" , PALETTERGB (64, 64, 64) }, - {"gray26" , PALETTERGB (66, 66, 66) }, - {"grey26" , PALETTERGB (66, 66, 66) }, - {"gray27" , PALETTERGB (69, 69, 69) }, - {"grey27" , PALETTERGB (69, 69, 69) }, - {"gray28" , PALETTERGB (71, 71, 71) }, - {"grey28" , PALETTERGB (71, 71, 71) }, - {"gray29" , PALETTERGB (74, 74, 74) }, - {"grey29" , PALETTERGB (74, 74, 74) }, - {"gray30" , PALETTERGB (77, 77, 77) }, - {"grey30" , PALETTERGB (77, 77, 77) }, - {"gray31" , PALETTERGB (79, 79, 79) }, - {"grey31" , PALETTERGB (79, 79, 79) }, - {"gray32" , PALETTERGB (82, 82, 82) }, - {"grey32" , PALETTERGB (82, 82, 82) }, - {"gray33" , PALETTERGB (84, 84, 84) }, - {"grey33" , PALETTERGB (84, 84, 84) }, - {"gray34" , PALETTERGB (87, 87, 87) }, - {"grey34" , PALETTERGB (87, 87, 87) }, - {"gray35" , PALETTERGB (89, 89, 89) }, - {"grey35" , PALETTERGB (89, 89, 89) }, - {"gray36" , PALETTERGB (92, 92, 92) }, - {"grey36" , PALETTERGB (92, 92, 92) }, - {"gray37" , PALETTERGB (94, 94, 94) }, - {"grey37" , PALETTERGB (94, 94, 94) }, - {"gray38" , PALETTERGB (97, 97, 97) }, - {"grey38" , PALETTERGB (97, 97, 97) }, - {"gray39" , PALETTERGB (99, 99, 99) }, - {"grey39" , PALETTERGB (99, 99, 99) }, - {"gray40" , PALETTERGB (102, 102, 102) }, - {"grey40" , PALETTERGB (102, 102, 102) }, - {"gray41" , PALETTERGB (105, 105, 105) }, - {"grey41" , PALETTERGB (105, 105, 105) }, - {"gray42" , PALETTERGB (107, 107, 107) }, - {"grey42" , PALETTERGB (107, 107, 107) }, - {"gray43" , PALETTERGB (110, 110, 110) }, - {"grey43" , PALETTERGB (110, 110, 110) }, - {"gray44" , PALETTERGB (112, 112, 112) }, - {"grey44" , PALETTERGB (112, 112, 112) }, - {"gray45" , PALETTERGB (115, 115, 115) }, - {"grey45" , PALETTERGB (115, 115, 115) }, - {"gray46" , PALETTERGB (117, 117, 117) }, - {"grey46" , PALETTERGB (117, 117, 117) }, - {"gray47" , PALETTERGB (120, 120, 120) }, - {"grey47" , PALETTERGB (120, 120, 120) }, - {"gray48" , PALETTERGB (122, 122, 122) }, - {"grey48" , PALETTERGB (122, 122, 122) }, - {"gray49" , PALETTERGB (125, 125, 125) }, - {"grey49" , PALETTERGB (125, 125, 125) }, - {"gray50" , PALETTERGB (128, 128, 128) }, /* Adjusted */ - {"grey50" , PALETTERGB (128, 128, 128) }, /* Adjusted */ - {"gray51" , PALETTERGB (130, 130, 130) }, - {"grey51" , PALETTERGB (130, 130, 130) }, - {"gray52" , PALETTERGB (133, 133, 133) }, - {"grey52" , PALETTERGB (133, 133, 133) }, - {"gray53" , PALETTERGB (135, 135, 135) }, - {"grey53" , PALETTERGB (135, 135, 135) }, - {"gray54" , PALETTERGB (138, 138, 138) }, - {"grey54" , PALETTERGB (138, 138, 138) }, - {"gray55" , PALETTERGB (140, 140, 140) }, - {"grey55" , PALETTERGB (140, 140, 140) }, - {"gray56" , PALETTERGB (143, 143, 143) }, - {"grey56" , PALETTERGB (143, 143, 143) }, - {"gray57" , PALETTERGB (145, 145, 145) }, - {"grey57" , PALETTERGB (145, 145, 145) }, - {"gray58" , PALETTERGB (148, 148, 148) }, - {"grey58" , PALETTERGB (148, 148, 148) }, - {"gray59" , PALETTERGB (150, 150, 150) }, - {"grey59" , PALETTERGB (150, 150, 150) }, - {"gray60" , PALETTERGB (153, 153, 153) }, - {"grey60" , PALETTERGB (153, 153, 153) }, - {"gray61" , PALETTERGB (156, 156, 156) }, - {"grey61" , PALETTERGB (156, 156, 156) }, - {"gray62" , PALETTERGB (158, 158, 158) }, - {"grey62" , PALETTERGB (158, 158, 158) }, - {"gray63" , PALETTERGB (161, 161, 161) }, - {"grey63" , PALETTERGB (161, 161, 161) }, - {"gray64" , PALETTERGB (163, 163, 163) }, - {"grey64" , PALETTERGB (163, 163, 163) }, - {"gray65" , PALETTERGB (166, 166, 166) }, - {"grey65" , PALETTERGB (166, 166, 166) }, - {"gray66" , PALETTERGB (168, 168, 168) }, - {"grey66" , PALETTERGB (168, 168, 168) }, - {"gray67" , PALETTERGB (171, 171, 171) }, - {"grey67" , PALETTERGB (171, 171, 171) }, - {"gray68" , PALETTERGB (173, 173, 173) }, - {"grey68" , PALETTERGB (173, 173, 173) }, - {"gray69" , PALETTERGB (176, 176, 176) }, - {"grey69" , PALETTERGB (176, 176, 176) }, - {"gray70" , PALETTERGB (179, 179, 179) }, - {"grey70" , PALETTERGB (179, 179, 179) }, - {"gray71" , PALETTERGB (181, 181, 181) }, - {"grey71" , PALETTERGB (181, 181, 181) }, - {"gray72" , PALETTERGB (184, 184, 184) }, - {"grey72" , PALETTERGB (184, 184, 184) }, - {"gray73" , PALETTERGB (186, 186, 186) }, - {"grey73" , PALETTERGB (186, 186, 186) }, - {"gray74" , PALETTERGB (189, 189, 189) }, - {"grey74" , PALETTERGB (189, 189, 189) }, - {"gray75" , PALETTERGB (192, 192, 192) }, /* Adjusted */ - {"grey75" , PALETTERGB (192, 192, 192) }, /* Adjusted */ - {"gray76" , PALETTERGB (194, 194, 194) }, - {"grey76" , PALETTERGB (194, 194, 194) }, - {"gray77" , PALETTERGB (196, 196, 196) }, - {"grey77" , PALETTERGB (196, 196, 196) }, - {"gray78" , PALETTERGB (199, 199, 199) }, - {"grey78" , PALETTERGB (199, 199, 199) }, - {"gray79" , PALETTERGB (201, 201, 201) }, - {"grey79" , PALETTERGB (201, 201, 201) }, - {"gray80" , PALETTERGB (204, 204, 204) }, - {"grey80" , PALETTERGB (204, 204, 204) }, - {"gray81" , PALETTERGB (207, 207, 207) }, - {"grey81" , PALETTERGB (207, 207, 207) }, - {"gray82" , PALETTERGB (209, 209, 209) }, - {"grey82" , PALETTERGB (209, 209, 209) }, - {"gray83" , PALETTERGB (212, 212, 212) }, - {"grey83" , PALETTERGB (212, 212, 212) }, - {"gray84" , PALETTERGB (214, 214, 214) }, - {"grey84" , PALETTERGB (214, 214, 214) }, - {"gray85" , PALETTERGB (217, 217, 217) }, - {"grey85" , PALETTERGB (217, 217, 217) }, - {"gray86" , PALETTERGB (219, 219, 219) }, - {"grey86" , PALETTERGB (219, 219, 219) }, - {"gray87" , PALETTERGB (222, 222, 222) }, - {"grey87" , PALETTERGB (222, 222, 222) }, - {"gray88" , PALETTERGB (224, 224, 224) }, - {"grey88" , PALETTERGB (224, 224, 224) }, - {"gray89" , PALETTERGB (227, 227, 227) }, - {"grey89" , PALETTERGB (227, 227, 227) }, - {"gray90" , PALETTERGB (229, 229, 229) }, - {"grey90" , PALETTERGB (229, 229, 229) }, - {"gray91" , PALETTERGB (232, 232, 232) }, - {"grey91" , PALETTERGB (232, 232, 232) }, - {"gray92" , PALETTERGB (235, 235, 235) }, - {"grey92" , PALETTERGB (235, 235, 235) }, - {"gray93" , PALETTERGB (237, 237, 237) }, - {"grey93" , PALETTERGB (237, 237, 237) }, - {"gray94" , PALETTERGB (240, 240, 240) }, - {"grey94" , PALETTERGB (240, 240, 240) }, - {"gray95" , PALETTERGB (242, 242, 242) }, - {"grey95" , PALETTERGB (242, 242, 242) }, - {"gray96" , PALETTERGB (245, 245, 245) }, - {"grey96" , PALETTERGB (245, 245, 245) }, - {"gray97" , PALETTERGB (247, 247, 247) }, - {"grey97" , PALETTERGB (247, 247, 247) }, - {"gray98" , PALETTERGB (250, 250, 250) }, - {"grey98" , PALETTERGB (250, 250, 250) }, - {"gray99" , PALETTERGB (252, 252, 252) }, - {"grey99" , PALETTERGB (252, 252, 252) }, - {"gray100" , PALETTERGB (255, 255, 255) }, - {"grey100" , PALETTERGB (255, 255, 255) }, - {"DarkGrey" , PALETTERGB (169, 169, 169) }, - {"DarkGray" , PALETTERGB (169, 169, 169) }, - {"DarkBlue" , PALETTERGB (0, 0, 128) }, /* Adjusted == Navy */ - {"DarkCyan" , PALETTERGB (0, 128, 128) }, /* Adjusted */ - {"DarkMagenta" , PALETTERGB (128, 0, 128) }, /* Adjusted */ - {"DarkRed" , PALETTERGB (128, 0, 0) }, /* Adjusted */ - {"LightGreen" , PALETTERGB (144, 238, 144) }, - /* Added to match values in the default Windows palette: */ - {"DarkYellow" , PALETTERGB (128, 128, 0) }, - {"PaleYellow" , PALETTERGB (255, 255, 128) } + {"snow" , PALETTERGB (255, 250, 250) }, + {"GhostWhite" , PALETTERGB (248, 248, 255) }, + {"WhiteSmoke" , PALETTERGB (245, 245, 245) }, + {"gainsboro" , PALETTERGB (220, 220, 220) }, + {"FloralWhite" , PALETTERGB (255, 250, 240) }, + {"OldLace" , PALETTERGB (253, 245, 230) }, + {"linen" , PALETTERGB (250, 240, 230) }, + {"AntiqueWhite" , PALETTERGB (250, 235, 215) }, + {"PapayaWhip" , PALETTERGB (255, 239, 213) }, + {"BlanchedAlmond" , PALETTERGB (255, 235, 205) }, + {"bisque" , PALETTERGB (255, 228, 196) }, + {"PeachPuff" , PALETTERGB (255, 218, 185) }, + {"NavajoWhite" , PALETTERGB (255, 222, 173) }, + {"moccasin" , PALETTERGB (255, 228, 181) }, + {"cornsilk" , PALETTERGB (255, 248, 220) }, + {"ivory" , PALETTERGB (255, 255, 240) }, + {"LemonChiffon" , PALETTERGB (255, 250, 205) }, + {"seashell" , PALETTERGB (255, 245, 238) }, + {"honeydew" , PALETTERGB (240, 255, 240) }, + {"MintCream" , PALETTERGB (245, 255, 250) }, + {"azure" , PALETTERGB (240, 255, 255) }, + {"AliceBlue" , PALETTERGB (240, 248, 255) }, + {"lavender" , PALETTERGB (230, 230, 250) }, + {"LavenderBlush" , PALETTERGB (255, 240, 245) }, + {"MistyRose" , PALETTERGB (255, 228, 225) }, + {"white" , PALETTERGB (255, 255, 255) }, + {"black" , PALETTERGB (0, 0, 0) }, + {"DarkSlateGray" , PALETTERGB (47, 79, 79) }, + {"DarkSlateGrey" , PALETTERGB (47, 79, 79) }, + {"DimGray" , PALETTERGB (105, 105, 105) }, + {"DimGrey" , PALETTERGB (105, 105, 105) }, + {"SlateGray" , PALETTERGB (112, 128, 144) }, + {"SlateGrey" , PALETTERGB (112, 128, 144) }, + {"LightSlateGray" , PALETTERGB (119, 136, 153) }, + {"LightSlateGrey" , PALETTERGB (119, 136, 153) }, + {"gray" , PALETTERGB (190, 190, 190) }, + {"grey" , PALETTERGB (190, 190, 190) }, + {"LightGrey" , PALETTERGB (211, 211, 211) }, + {"LightGray" , PALETTERGB (211, 211, 211) }, + {"MidnightBlue" , PALETTERGB (25, 25, 112) }, + {"navy" , PALETTERGB (0, 0, 128) }, + {"NavyBlue" , PALETTERGB (0, 0, 128) }, + {"CornflowerBlue" , PALETTERGB (100, 149, 237) }, + {"DarkSlateBlue" , PALETTERGB (72, 61, 139) }, + {"SlateBlue" , PALETTERGB (106, 90, 205) }, + {"MediumSlateBlue" , PALETTERGB (123, 104, 238) }, + {"LightSlateBlue" , PALETTERGB (132, 112, 255) }, + {"MediumBlue" , PALETTERGB (0, 0, 205) }, + {"RoyalBlue" , PALETTERGB (65, 105, 225) }, + {"blue" , PALETTERGB (0, 0, 255) }, + {"DodgerBlue" , PALETTERGB (30, 144, 255) }, + {"DeepSkyBlue" , PALETTERGB (0, 191, 255) }, + {"SkyBlue" , PALETTERGB (135, 206, 235) }, + {"LightSkyBlue" , PALETTERGB (135, 206, 250) }, + {"SteelBlue" , PALETTERGB (70, 130, 180) }, + {"LightSteelBlue" , PALETTERGB (176, 196, 222) }, + {"LightBlue" , PALETTERGB (173, 216, 230) }, + {"PowderBlue" , PALETTERGB (176, 224, 230) }, + {"PaleTurquoise" , PALETTERGB (175, 238, 238) }, + {"DarkTurquoise" , PALETTERGB (0, 206, 209) }, + {"MediumTurquoise" , PALETTERGB (72, 209, 204) }, + {"turquoise" , PALETTERGB (64, 224, 208) }, + {"cyan" , PALETTERGB (0, 255, 255) }, + {"LightCyan" , PALETTERGB (224, 255, 255) }, + {"CadetBlue" , PALETTERGB (95, 158, 160) }, + {"MediumAquamarine" , PALETTERGB (102, 205, 170) }, + {"aquamarine" , PALETTERGB (127, 255, 212) }, + {"DarkGreen" , PALETTERGB (0, 100, 0) }, + {"DarkOliveGreen" , PALETTERGB (85, 107, 47) }, + {"DarkSeaGreen" , PALETTERGB (143, 188, 143) }, + {"SeaGreen" , PALETTERGB (46, 139, 87) }, + {"MediumSeaGreen" , PALETTERGB (60, 179, 113) }, + {"LightSeaGreen" , PALETTERGB (32, 178, 170) }, + {"PaleGreen" , PALETTERGB (152, 251, 152) }, + {"SpringGreen" , PALETTERGB (0, 255, 127) }, + {"LawnGreen" , PALETTERGB (124, 252, 0) }, + {"green" , PALETTERGB (0, 255, 0) }, + {"chartreuse" , PALETTERGB (127, 255, 0) }, + {"MediumSpringGreen" , PALETTERGB (0, 250, 154) }, + {"GreenYellow" , PALETTERGB (173, 255, 47) }, + {"LimeGreen" , PALETTERGB (50, 205, 50) }, + {"YellowGreen" , PALETTERGB (154, 205, 50) }, + {"ForestGreen" , PALETTERGB (34, 139, 34) }, + {"OliveDrab" , PALETTERGB (107, 142, 35) }, + {"DarkKhaki" , PALETTERGB (189, 183, 107) }, + {"khaki" , PALETTERGB (240, 230, 140) }, + {"PaleGoldenrod" , PALETTERGB (238, 232, 170) }, + {"LightGoldenrodYellow" , PALETTERGB (250, 250, 210) }, + {"LightYellow" , PALETTERGB (255, 255, 224) }, + {"yellow" , PALETTERGB (255, 255, 0) }, + {"gold" , PALETTERGB (255, 215, 0) }, + {"LightGoldenrod" , PALETTERGB (238, 221, 130) }, + {"goldenrod" , PALETTERGB (218, 165, 32) }, + {"DarkGoldenrod" , PALETTERGB (184, 134, 11) }, + {"RosyBrown" , PALETTERGB (188, 143, 143) }, + {"IndianRed" , PALETTERGB (205, 92, 92) }, + {"SaddleBrown" , PALETTERGB (139, 69, 19) }, + {"sienna" , PALETTERGB (160, 82, 45) }, + {"peru" , PALETTERGB (205, 133, 63) }, + {"burlywood" , PALETTERGB (222, 184, 135) }, + {"beige" , PALETTERGB (245, 245, 220) }, + {"wheat" , PALETTERGB (245, 222, 179) }, + {"SandyBrown" , PALETTERGB (244, 164, 96) }, + {"tan" , PALETTERGB (210, 180, 140) }, + {"chocolate" , PALETTERGB (210, 105, 30) }, + {"firebrick" , PALETTERGB (178, 34, 34) }, + {"brown" , PALETTERGB (165, 42, 42) }, + {"DarkSalmon" , PALETTERGB (233, 150, 122) }, + {"salmon" , PALETTERGB (250, 128, 114) }, + {"LightSalmon" , PALETTERGB (255, 160, 122) }, + {"orange" , PALETTERGB (255, 165, 0) }, + {"DarkOrange" , PALETTERGB (255, 140, 0) }, + {"coral" , PALETTERGB (255, 127, 80) }, + {"LightCoral" , PALETTERGB (240, 128, 128) }, + {"tomato" , PALETTERGB (255, 99, 71) }, + {"OrangeRed" , PALETTERGB (255, 69, 0) }, + {"red" , PALETTERGB (255, 0, 0) }, + {"HotPink" , PALETTERGB (255, 105, 180) }, + {"DeepPink" , PALETTERGB (255, 20, 147) }, + {"pink" , PALETTERGB (255, 192, 203) }, + {"LightPink" , PALETTERGB (255, 182, 193) }, + {"PaleVioletRed" , PALETTERGB (219, 112, 147) }, + {"maroon" , PALETTERGB (176, 48, 96) }, + {"MediumVioletRed" , PALETTERGB (199, 21, 133) }, + {"VioletRed" , PALETTERGB (208, 32, 144) }, + {"magenta" , PALETTERGB (255, 0, 255) }, + {"violet" , PALETTERGB (238, 130, 238) }, + {"plum" , PALETTERGB (221, 160, 221) }, + {"orchid" , PALETTERGB (218, 112, 214) }, + {"MediumOrchid" , PALETTERGB (186, 85, 211) }, + {"DarkOrchid" , PALETTERGB (153, 50, 204) }, + {"DarkViolet" , PALETTERGB (148, 0, 211) }, + {"BlueViolet" , PALETTERGB (138, 43, 226) }, + {"purple" , PALETTERGB (160, 32, 240) }, + {"MediumPurple" , PALETTERGB (147, 112, 219) }, + {"thistle" , PALETTERGB (216, 191, 216) }, + {"snow1" , PALETTERGB (255, 250, 250) }, + {"snow2" , PALETTERGB (238, 233, 233) }, + {"snow3" , PALETTERGB (205, 201, 201) }, + {"snow4" , PALETTERGB (139, 137, 137) }, + {"seashell1" , PALETTERGB (255, 245, 238) }, + {"seashell2" , PALETTERGB (238, 229, 222) }, + {"seashell3" , PALETTERGB (205, 197, 191) }, + {"seashell4" , PALETTERGB (139, 134, 130) }, + {"AntiqueWhite1" , PALETTERGB (255, 239, 219) }, + {"AntiqueWhite2" , PALETTERGB (238, 223, 204) }, + {"AntiqueWhite3" , PALETTERGB (205, 192, 176) }, + {"AntiqueWhite4" , PALETTERGB (139, 131, 120) }, + {"bisque1" , PALETTERGB (255, 228, 196) }, + {"bisque2" , PALETTERGB (238, 213, 183) }, + {"bisque3" , PALETTERGB (205, 183, 158) }, + {"bisque4" , PALETTERGB (139, 125, 107) }, + {"PeachPuff1" , PALETTERGB (255, 218, 185) }, + {"PeachPuff2" , PALETTERGB (238, 203, 173) }, + {"PeachPuff3" , PALETTERGB (205, 175, 149) }, + {"PeachPuff4" , PALETTERGB (139, 119, 101) }, + {"NavajoWhite1" , PALETTERGB (255, 222, 173) }, + {"NavajoWhite2" , PALETTERGB (238, 207, 161) }, + {"NavajoWhite3" , PALETTERGB (205, 179, 139) }, + {"NavajoWhite4" , PALETTERGB (139, 121, 94) }, + {"LemonChiffon1" , PALETTERGB (255, 250, 205) }, + {"LemonChiffon2" , PALETTERGB (238, 233, 191) }, + {"LemonChiffon3" , PALETTERGB (205, 201, 165) }, + {"LemonChiffon4" , PALETTERGB (139, 137, 112) }, + {"cornsilk1" , PALETTERGB (255, 248, 220) }, + {"cornsilk2" , PALETTERGB (238, 232, 205) }, + {"cornsilk3" , PALETTERGB (205, 200, 177) }, + {"cornsilk4" , PALETTERGB (139, 136, 120) }, + {"ivory1" , PALETTERGB (255, 255, 240) }, + {"ivory2" , PALETTERGB (238, 238, 224) }, + {"ivory3" , PALETTERGB (205, 205, 193) }, + {"ivory4" , PALETTERGB (139, 139, 131) }, + {"honeydew1" , PALETTERGB (240, 255, 240) }, + {"honeydew2" , PALETTERGB (224, 238, 224) }, + {"honeydew3" , PALETTERGB (193, 205, 193) }, + {"honeydew4" , PALETTERGB (131, 139, 131) }, + {"LavenderBlush1" , PALETTERGB (255, 240, 245) }, + {"LavenderBlush2" , PALETTERGB (238, 224, 229) }, + {"LavenderBlush3" , PALETTERGB (205, 193, 197) }, + {"LavenderBlush4" , PALETTERGB (139, 131, 134) }, + {"MistyRose1" , PALETTERGB (255, 228, 225) }, + {"MistyRose2" , PALETTERGB (238, 213, 210) }, + {"MistyRose3" , PALETTERGB (205, 183, 181) }, + {"MistyRose4" , PALETTERGB (139, 125, 123) }, + {"azure1" , PALETTERGB (240, 255, 255) }, + {"azure2" , PALETTERGB (224, 238, 238) }, + {"azure3" , PALETTERGB (193, 205, 205) }, + {"azure4" , PALETTERGB (131, 139, 139) }, + {"SlateBlue1" , PALETTERGB (131, 111, 255) }, + {"SlateBlue2" , PALETTERGB (122, 103, 238) }, + {"SlateBlue3" , PALETTERGB (105, 89, 205) }, + {"SlateBlue4" , PALETTERGB (71, 60, 139) }, + {"RoyalBlue1" , PALETTERGB (72, 118, 255) }, + {"RoyalBlue2" , PALETTERGB (67, 110, 238) }, + {"RoyalBlue3" , PALETTERGB (58, 95, 205) }, + {"RoyalBlue4" , PALETTERGB (39, 64, 139) }, + {"blue1" , PALETTERGB (0, 0, 255) }, + {"blue2" , PALETTERGB (0, 0, 238) }, + {"blue3" , PALETTERGB (0, 0, 205) }, + {"blue4" , PALETTERGB (0, 0, 139) }, + {"DodgerBlue1" , PALETTERGB (30, 144, 255) }, + {"DodgerBlue2" , PALETTERGB (28, 134, 238) }, + {"DodgerBlue3" , PALETTERGB (24, 116, 205) }, + {"DodgerBlue4" , PALETTERGB (16, 78, 139) }, + {"SteelBlue1" , PALETTERGB (99, 184, 255) }, + {"SteelBlue2" , PALETTERGB (92, 172, 238) }, + {"SteelBlue3" , PALETTERGB (79, 148, 205) }, + {"SteelBlue4" , PALETTERGB (54, 100, 139) }, + {"DeepSkyBlue1" , PALETTERGB (0, 191, 255) }, + {"DeepSkyBlue2" , PALETTERGB (0, 178, 238) }, + {"DeepSkyBlue3" , PALETTERGB (0, 154, 205) }, + {"DeepSkyBlue4" , PALETTERGB (0, 104, 139) }, + {"SkyBlue1" , PALETTERGB (135, 206, 255) }, + {"SkyBlue2" , PALETTERGB (126, 192, 238) }, + {"SkyBlue3" , PALETTERGB (108, 166, 205) }, + {"SkyBlue4" , PALETTERGB (74, 112, 139) }, + {"LightSkyBlue1" , PALETTERGB (176, 226, 255) }, + {"LightSkyBlue2" , PALETTERGB (164, 211, 238) }, + {"LightSkyBlue3" , PALETTERGB (141, 182, 205) }, + {"LightSkyBlue4" , PALETTERGB (96, 123, 139) }, + {"SlateGray1" , PALETTERGB (198, 226, 255) }, + {"SlateGray2" , PALETTERGB (185, 211, 238) }, + {"SlateGray3" , PALETTERGB (159, 182, 205) }, + {"SlateGray4" , PALETTERGB (108, 123, 139) }, + {"LightSteelBlue1" , PALETTERGB (202, 225, 255) }, + {"LightSteelBlue2" , PALETTERGB (188, 210, 238) }, + {"LightSteelBlue3" , PALETTERGB (162, 181, 205) }, + {"LightSteelBlue4" , PALETTERGB (110, 123, 139) }, + {"LightBlue1" , PALETTERGB (191, 239, 255) }, + {"LightBlue2" , PALETTERGB (178, 223, 238) }, + {"LightBlue3" , PALETTERGB (154, 192, 205) }, + {"LightBlue4" , PALETTERGB (104, 131, 139) }, + {"LightCyan1" , PALETTERGB (224, 255, 255) }, + {"LightCyan2" , PALETTERGB (209, 238, 238) }, + {"LightCyan3" , PALETTERGB (180, 205, 205) }, + {"LightCyan4" , PALETTERGB (122, 139, 139) }, + {"PaleTurquoise1" , PALETTERGB (187, 255, 255) }, + {"PaleTurquoise2" , PALETTERGB (174, 238, 238) }, + {"PaleTurquoise3" , PALETTERGB (150, 205, 205) }, + {"PaleTurquoise4" , PALETTERGB (102, 139, 139) }, + {"CadetBlue1" , PALETTERGB (152, 245, 255) }, + {"CadetBlue2" , PALETTERGB (142, 229, 238) }, + {"CadetBlue3" , PALETTERGB (122, 197, 205) }, + {"CadetBlue4" , PALETTERGB (83, 134, 139) }, + {"turquoise1" , PALETTERGB (0, 245, 255) }, + {"turquoise2" , PALETTERGB (0, 229, 238) }, + {"turquoise3" , PALETTERGB (0, 197, 205) }, + {"turquoise4" , PALETTERGB (0, 134, 139) }, + {"cyan1" , PALETTERGB (0, 255, 255) }, + {"cyan2" , PALETTERGB (0, 238, 238) }, + {"cyan3" , PALETTERGB (0, 205, 205) }, + {"cyan4" , PALETTERGB (0, 139, 139) }, + {"DarkSlateGray1" , PALETTERGB (151, 255, 255) }, + {"DarkSlateGray2" , PALETTERGB (141, 238, 238) }, + {"DarkSlateGray3" , PALETTERGB (121, 205, 205) }, + {"DarkSlateGray4" , PALETTERGB (82, 139, 139) }, + {"aquamarine1" , PALETTERGB (127, 255, 212) }, + {"aquamarine2" , PALETTERGB (118, 238, 198) }, + {"aquamarine3" , PALETTERGB (102, 205, 170) }, + {"aquamarine4" , PALETTERGB (69, 139, 116) }, + {"DarkSeaGreen1" , PALETTERGB (193, 255, 193) }, + {"DarkSeaGreen2" , PALETTERGB (180, 238, 180) }, + {"DarkSeaGreen3" , PALETTERGB (155, 205, 155) }, + {"DarkSeaGreen4" , PALETTERGB (105, 139, 105) }, + {"SeaGreen1" , PALETTERGB (84, 255, 159) }, + {"SeaGreen2" , PALETTERGB (78, 238, 148) }, + {"SeaGreen3" , PALETTERGB (67, 205, 128) }, + {"SeaGreen4" , PALETTERGB (46, 139, 87) }, + {"PaleGreen1" , PALETTERGB (154, 255, 154) }, + {"PaleGreen2" , PALETTERGB (144, 238, 144) }, + {"PaleGreen3" , PALETTERGB (124, 205, 124) }, + {"PaleGreen4" , PALETTERGB (84, 139, 84) }, + {"SpringGreen1" , PALETTERGB (0, 255, 127) }, + {"SpringGreen2" , PALETTERGB (0, 238, 118) }, + {"SpringGreen3" , PALETTERGB (0, 205, 102) }, + {"SpringGreen4" , PALETTERGB (0, 139, 69) }, + {"green1" , PALETTERGB (0, 255, 0) }, + {"green2" , PALETTERGB (0, 238, 0) }, + {"green3" , PALETTERGB (0, 205, 0) }, + {"green4" , PALETTERGB (0, 139, 0) }, + {"chartreuse1" , PALETTERGB (127, 255, 0) }, + {"chartreuse2" , PALETTERGB (118, 238, 0) }, + {"chartreuse3" , PALETTERGB (102, 205, 0) }, + {"chartreuse4" , PALETTERGB (69, 139, 0) }, + {"OliveDrab1" , PALETTERGB (192, 255, 62) }, + {"OliveDrab2" , PALETTERGB (179, 238, 58) }, + {"OliveDrab3" , PALETTERGB (154, 205, 50) }, + {"OliveDrab4" , PALETTERGB (105, 139, 34) }, + {"DarkOliveGreen1" , PALETTERGB (202, 255, 112) }, + {"DarkOliveGreen2" , PALETTERGB (188, 238, 104) }, + {"DarkOliveGreen3" , PALETTERGB (162, 205, 90) }, + {"DarkOliveGreen4" , PALETTERGB (110, 139, 61) }, + {"khaki1" , PALETTERGB (255, 246, 143) }, + {"khaki2" , PALETTERGB (238, 230, 133) }, + {"khaki3" , PALETTERGB (205, 198, 115) }, + {"khaki4" , PALETTERGB (139, 134, 78) }, + {"LightGoldenrod1" , PALETTERGB (255, 236, 139) }, + {"LightGoldenrod2" , PALETTERGB (238, 220, 130) }, + {"LightGoldenrod3" , PALETTERGB (205, 190, 112) }, + {"LightGoldenrod4" , PALETTERGB (139, 129, 76) }, + {"LightYellow1" , PALETTERGB (255, 255, 224) }, + {"LightYellow2" , PALETTERGB (238, 238, 209) }, + {"LightYellow3" , PALETTERGB (205, 205, 180) }, + {"LightYellow4" , PALETTERGB (139, 139, 122) }, + {"yellow1" , PALETTERGB (255, 255, 0) }, + {"yellow2" , PALETTERGB (238, 238, 0) }, + {"yellow3" , PALETTERGB (205, 205, 0) }, + {"yellow4" , PALETTERGB (139, 139, 0) }, + {"gold1" , PALETTERGB (255, 215, 0) }, + {"gold2" , PALETTERGB (238, 201, 0) }, + {"gold3" , PALETTERGB (205, 173, 0) }, + {"gold4" , PALETTERGB (139, 117, 0) }, + {"goldenrod1" , PALETTERGB (255, 193, 37) }, + {"goldenrod2" , PALETTERGB (238, 180, 34) }, + {"goldenrod3" , PALETTERGB (205, 155, 29) }, + {"goldenrod4" , PALETTERGB (139, 105, 20) }, + {"DarkGoldenrod1" , PALETTERGB (255, 185, 15) }, + {"DarkGoldenrod2" , PALETTERGB (238, 173, 14) }, + {"DarkGoldenrod3" , PALETTERGB (205, 149, 12) }, + {"DarkGoldenrod4" , PALETTERGB (139, 101, 8) }, + {"RosyBrown1" , PALETTERGB (255, 193, 193) }, + {"RosyBrown2" , PALETTERGB (238, 180, 180) }, + {"RosyBrown3" , PALETTERGB (205, 155, 155) }, + {"RosyBrown4" , PALETTERGB (139, 105, 105) }, + {"IndianRed1" , PALETTERGB (255, 106, 106) }, + {"IndianRed2" , PALETTERGB (238, 99, 99) }, + {"IndianRed3" , PALETTERGB (205, 85, 85) }, + {"IndianRed4" , PALETTERGB (139, 58, 58) }, + {"sienna1" , PALETTERGB (255, 130, 71) }, + {"sienna2" , PALETTERGB (238, 121, 66) }, + {"sienna3" , PALETTERGB (205, 104, 57) }, + {"sienna4" , PALETTERGB (139, 71, 38) }, + {"burlywood1" , PALETTERGB (255, 211, 155) }, + {"burlywood2" , PALETTERGB (238, 197, 145) }, + {"burlywood3" , PALETTERGB (205, 170, 125) }, + {"burlywood4" , PALETTERGB (139, 115, 85) }, + {"wheat1" , PALETTERGB (255, 231, 186) }, + {"wheat2" , PALETTERGB (238, 216, 174) }, + {"wheat3" , PALETTERGB (205, 186, 150) }, + {"wheat4" , PALETTERGB (139, 126, 102) }, + {"tan1" , PALETTERGB (255, 165, 79) }, + {"tan2" , PALETTERGB (238, 154, 73) }, + {"tan3" , PALETTERGB (205, 133, 63) }, + {"tan4" , PALETTERGB (139, 90, 43) }, + {"chocolate1" , PALETTERGB (255, 127, 36) }, + {"chocolate2" , PALETTERGB (238, 118, 33) }, + {"chocolate3" , PALETTERGB (205, 102, 29) }, + {"chocolate4" , PALETTERGB (139, 69, 19) }, + {"firebrick1" , PALETTERGB (255, 48, 48) }, + {"firebrick2" , PALETTERGB (238, 44, 44) }, + {"firebrick3" , PALETTERGB (205, 38, 38) }, + {"firebrick4" , PALETTERGB (139, 26, 26) }, + {"brown1" , PALETTERGB (255, 64, 64) }, + {"brown2" , PALETTERGB (238, 59, 59) }, + {"brown3" , PALETTERGB (205, 51, 51) }, + {"brown4" , PALETTERGB (139, 35, 35) }, + {"salmon1" , PALETTERGB (255, 140, 105) }, + {"salmon2" , PALETTERGB (238, 130, 98) }, + {"salmon3" , PALETTERGB (205, 112, 84) }, + {"salmon4" , PALETTERGB (139, 76, 57) }, + {"LightSalmon1" , PALETTERGB (255, 160, 122) }, + {"LightSalmon2" , PALETTERGB (238, 149, 114) }, + {"LightSalmon3" , PALETTERGB (205, 129, 98) }, + {"LightSalmon4" , PALETTERGB (139, 87, 66) }, + {"orange1" , PALETTERGB (255, 165, 0) }, + {"orange2" , PALETTERGB (238, 154, 0) }, + {"orange3" , PALETTERGB (205, 133, 0) }, + {"orange4" , PALETTERGB (139, 90, 0) }, + {"DarkOrange1" , PALETTERGB (255, 127, 0) }, + {"DarkOrange2" , PALETTERGB (238, 118, 0) }, + {"DarkOrange3" , PALETTERGB (205, 102, 0) }, + {"DarkOrange4" , PALETTERGB (139, 69, 0) }, + {"coral1" , PALETTERGB (255, 114, 86) }, + {"coral2" , PALETTERGB (238, 106, 80) }, + {"coral3" , PALETTERGB (205, 91, 69) }, + {"coral4" , PALETTERGB (139, 62, 47) }, + {"tomato1" , PALETTERGB (255, 99, 71) }, + {"tomato2" , PALETTERGB (238, 92, 66) }, + {"tomato3" , PALETTERGB (205, 79, 57) }, + {"tomato4" , PALETTERGB (139, 54, 38) }, + {"OrangeRed1" , PALETTERGB (255, 69, 0) }, + {"OrangeRed2" , PALETTERGB (238, 64, 0) }, + {"OrangeRed3" , PALETTERGB (205, 55, 0) }, + {"OrangeRed4" , PALETTERGB (139, 37, 0) }, + {"red1" , PALETTERGB (255, 0, 0) }, + {"red2" , PALETTERGB (238, 0, 0) }, + {"red3" , PALETTERGB (205, 0, 0) }, + {"red4" , PALETTERGB (139, 0, 0) }, + {"DeepPink1" , PALETTERGB (255, 20, 147) }, + {"DeepPink2" , PALETTERGB (238, 18, 137) }, + {"DeepPink3" , PALETTERGB (205, 16, 118) }, + {"DeepPink4" , PALETTERGB (139, 10, 80) }, + {"HotPink1" , PALETTERGB (255, 110, 180) }, + {"HotPink2" , PALETTERGB (238, 106, 167) }, + {"HotPink3" , PALETTERGB (205, 96, 144) }, + {"HotPink4" , PALETTERGB (139, 58, 98) }, + {"pink1" , PALETTERGB (255, 181, 197) }, + {"pink2" , PALETTERGB (238, 169, 184) }, + {"pink3" , PALETTERGB (205, 145, 158) }, + {"pink4" , PALETTERGB (139, 99, 108) }, + {"LightPink1" , PALETTERGB (255, 174, 185) }, + {"LightPink2" , PALETTERGB (238, 162, 173) }, + {"LightPink3" , PALETTERGB (205, 140, 149) }, + {"LightPink4" , PALETTERGB (139, 95, 101) }, + {"PaleVioletRed1" , PALETTERGB (255, 130, 171) }, + {"PaleVioletRed2" , PALETTERGB (238, 121, 159) }, + {"PaleVioletRed3" , PALETTERGB (205, 104, 137) }, + {"PaleVioletRed4" , PALETTERGB (139, 71, 93) }, + {"maroon1" , PALETTERGB (255, 52, 179) }, + {"maroon2" , PALETTERGB (238, 48, 167) }, + {"maroon3" , PALETTERGB (205, 41, 144) }, + {"maroon4" , PALETTERGB (139, 28, 98) }, + {"VioletRed1" , PALETTERGB (255, 62, 150) }, + {"VioletRed2" , PALETTERGB (238, 58, 140) }, + {"VioletRed3" , PALETTERGB (205, 50, 120) }, + {"VioletRed4" , PALETTERGB (139, 34, 82) }, + {"magenta1" , PALETTERGB (255, 0, 255) }, + {"magenta2" , PALETTERGB (238, 0, 238) }, + {"magenta3" , PALETTERGB (205, 0, 205) }, + {"magenta4" , PALETTERGB (139, 0, 139) }, + {"orchid1" , PALETTERGB (255, 131, 250) }, + {"orchid2" , PALETTERGB (238, 122, 233) }, + {"orchid3" , PALETTERGB (205, 105, 201) }, + {"orchid4" , PALETTERGB (139, 71, 137) }, + {"plum1" , PALETTERGB (255, 187, 255) }, + {"plum2" , PALETTERGB (238, 174, 238) }, + {"plum3" , PALETTERGB (205, 150, 205) }, + {"plum4" , PALETTERGB (139, 102, 139) }, + {"MediumOrchid1" , PALETTERGB (224, 102, 255) }, + {"MediumOrchid2" , PALETTERGB (209, 95, 238) }, + {"MediumOrchid3" , PALETTERGB (180, 82, 205) }, + {"MediumOrchid4" , PALETTERGB (122, 55, 139) }, + {"DarkOrchid1" , PALETTERGB (191, 62, 255) }, + {"DarkOrchid2" , PALETTERGB (178, 58, 238) }, + {"DarkOrchid3" , PALETTERGB (154, 50, 205) }, + {"DarkOrchid4" , PALETTERGB (104, 34, 139) }, + {"purple1" , PALETTERGB (155, 48, 255) }, + {"purple2" , PALETTERGB (145, 44, 238) }, + {"purple3" , PALETTERGB (125, 38, 205) }, + {"purple4" , PALETTERGB (85, 26, 139) }, + {"MediumPurple1" , PALETTERGB (171, 130, 255) }, + {"MediumPurple2" , PALETTERGB (159, 121, 238) }, + {"MediumPurple3" , PALETTERGB (137, 104, 205) }, + {"MediumPurple4" , PALETTERGB (93, 71, 139) }, + {"thistle1" , PALETTERGB (255, 225, 255) }, + {"thistle2" , PALETTERGB (238, 210, 238) }, + {"thistle3" , PALETTERGB (205, 181, 205) }, + {"thistle4" , PALETTERGB (139, 123, 139) }, + {"gray0" , PALETTERGB (0, 0, 0) }, + {"grey0" , PALETTERGB (0, 0, 0) }, + {"gray1" , PALETTERGB (3, 3, 3) }, + {"grey1" , PALETTERGB (3, 3, 3) }, + {"gray2" , PALETTERGB (5, 5, 5) }, + {"grey2" , PALETTERGB (5, 5, 5) }, + {"gray3" , PALETTERGB (8, 8, 8) }, + {"grey3" , PALETTERGB (8, 8, 8) }, + {"gray4" , PALETTERGB (10, 10, 10) }, + {"grey4" , PALETTERGB (10, 10, 10) }, + {"gray5" , PALETTERGB (13, 13, 13) }, + {"grey5" , PALETTERGB (13, 13, 13) }, + {"gray6" , PALETTERGB (15, 15, 15) }, + {"grey6" , PALETTERGB (15, 15, 15) }, + {"gray7" , PALETTERGB (18, 18, 18) }, + {"grey7" , PALETTERGB (18, 18, 18) }, + {"gray8" , PALETTERGB (20, 20, 20) }, + {"grey8" , PALETTERGB (20, 20, 20) }, + {"gray9" , PALETTERGB (23, 23, 23) }, + {"grey9" , PALETTERGB (23, 23, 23) }, + {"gray10" , PALETTERGB (26, 26, 26) }, + {"grey10" , PALETTERGB (26, 26, 26) }, + {"gray11" , PALETTERGB (28, 28, 28) }, + {"grey11" , PALETTERGB (28, 28, 28) }, + {"gray12" , PALETTERGB (31, 31, 31) }, + {"grey12" , PALETTERGB (31, 31, 31) }, + {"gray13" , PALETTERGB (33, 33, 33) }, + {"grey13" , PALETTERGB (33, 33, 33) }, + {"gray14" , PALETTERGB (36, 36, 36) }, + {"grey14" , PALETTERGB (36, 36, 36) }, + {"gray15" , PALETTERGB (38, 38, 38) }, + {"grey15" , PALETTERGB (38, 38, 38) }, + {"gray16" , PALETTERGB (41, 41, 41) }, + {"grey16" , PALETTERGB (41, 41, 41) }, + {"gray17" , PALETTERGB (43, 43, 43) }, + {"grey17" , PALETTERGB (43, 43, 43) }, + {"gray18" , PALETTERGB (46, 46, 46) }, + {"grey18" , PALETTERGB (46, 46, 46) }, + {"gray19" , PALETTERGB (48, 48, 48) }, + {"grey19" , PALETTERGB (48, 48, 48) }, + {"gray20" , PALETTERGB (51, 51, 51) }, + {"grey20" , PALETTERGB (51, 51, 51) }, + {"gray21" , PALETTERGB (54, 54, 54) }, + {"grey21" , PALETTERGB (54, 54, 54) }, + {"gray22" , PALETTERGB (56, 56, 56) }, + {"grey22" , PALETTERGB (56, 56, 56) }, + {"gray23" , PALETTERGB (59, 59, 59) }, + {"grey23" , PALETTERGB (59, 59, 59) }, + {"gray24" , PALETTERGB (61, 61, 61) }, + {"grey24" , PALETTERGB (61, 61, 61) }, + {"gray25" , PALETTERGB (64, 64, 64) }, + {"grey25" , PALETTERGB (64, 64, 64) }, + {"gray26" , PALETTERGB (66, 66, 66) }, + {"grey26" , PALETTERGB (66, 66, 66) }, + {"gray27" , PALETTERGB (69, 69, 69) }, + {"grey27" , PALETTERGB (69, 69, 69) }, + {"gray28" , PALETTERGB (71, 71, 71) }, + {"grey28" , PALETTERGB (71, 71, 71) }, + {"gray29" , PALETTERGB (74, 74, 74) }, + {"grey29" , PALETTERGB (74, 74, 74) }, + {"gray30" , PALETTERGB (77, 77, 77) }, + {"grey30" , PALETTERGB (77, 77, 77) }, + {"gray31" , PALETTERGB (79, 79, 79) }, + {"grey31" , PALETTERGB (79, 79, 79) }, + {"gray32" , PALETTERGB (82, 82, 82) }, + {"grey32" , PALETTERGB (82, 82, 82) }, + {"gray33" , PALETTERGB (84, 84, 84) }, + {"grey33" , PALETTERGB (84, 84, 84) }, + {"gray34" , PALETTERGB (87, 87, 87) }, + {"grey34" , PALETTERGB (87, 87, 87) }, + {"gray35" , PALETTERGB (89, 89, 89) }, + {"grey35" , PALETTERGB (89, 89, 89) }, + {"gray36" , PALETTERGB (92, 92, 92) }, + {"grey36" , PALETTERGB (92, 92, 92) }, + {"gray37" , PALETTERGB (94, 94, 94) }, + {"grey37" , PALETTERGB (94, 94, 94) }, + {"gray38" , PALETTERGB (97, 97, 97) }, + {"grey38" , PALETTERGB (97, 97, 97) }, + {"gray39" , PALETTERGB (99, 99, 99) }, + {"grey39" , PALETTERGB (99, 99, 99) }, + {"gray40" , PALETTERGB (102, 102, 102) }, + {"grey40" , PALETTERGB (102, 102, 102) }, + {"gray41" , PALETTERGB (105, 105, 105) }, + {"grey41" , PALETTERGB (105, 105, 105) }, + {"gray42" , PALETTERGB (107, 107, 107) }, + {"grey42" , PALETTERGB (107, 107, 107) }, + {"gray43" , PALETTERGB (110, 110, 110) }, + {"grey43" , PALETTERGB (110, 110, 110) }, + {"gray44" , PALETTERGB (112, 112, 112) }, + {"grey44" , PALETTERGB (112, 112, 112) }, + {"gray45" , PALETTERGB (115, 115, 115) }, + {"grey45" , PALETTERGB (115, 115, 115) }, + {"gray46" , PALETTERGB (117, 117, 117) }, + {"grey46" , PALETTERGB (117, 117, 117) }, + {"gray47" , PALETTERGB (120, 120, 120) }, + {"grey47" , PALETTERGB (120, 120, 120) }, + {"gray48" , PALETTERGB (122, 122, 122) }, + {"grey48" , PALETTERGB (122, 122, 122) }, + {"gray49" , PALETTERGB (125, 125, 125) }, + {"grey49" , PALETTERGB (125, 125, 125) }, + {"gray50" , PALETTERGB (127, 127, 127) }, + {"grey50" , PALETTERGB (127, 127, 127) }, + {"gray51" , PALETTERGB (130, 130, 130) }, + {"grey51" , PALETTERGB (130, 130, 130) }, + {"gray52" , PALETTERGB (133, 133, 133) }, + {"grey52" , PALETTERGB (133, 133, 133) }, + {"gray53" , PALETTERGB (135, 135, 135) }, + {"grey53" , PALETTERGB (135, 135, 135) }, + {"gray54" , PALETTERGB (138, 138, 138) }, + {"grey54" , PALETTERGB (138, 138, 138) }, + {"gray55" , PALETTERGB (140, 140, 140) }, + {"grey55" , PALETTERGB (140, 140, 140) }, + {"gray56" , PALETTERGB (143, 143, 143) }, + {"grey56" , PALETTERGB (143, 143, 143) }, + {"gray57" , PALETTERGB (145, 145, 145) }, + {"grey57" , PALETTERGB (145, 145, 145) }, + {"gray58" , PALETTERGB (148, 148, 148) }, + {"grey58" , PALETTERGB (148, 148, 148) }, + {"gray59" , PALETTERGB (150, 150, 150) }, + {"grey59" , PALETTERGB (150, 150, 150) }, + {"gray60" , PALETTERGB (153, 153, 153) }, + {"grey60" , PALETTERGB (153, 153, 153) }, + {"gray61" , PALETTERGB (156, 156, 156) }, + {"grey61" , PALETTERGB (156, 156, 156) }, + {"gray62" , PALETTERGB (158, 158, 158) }, + {"grey62" , PALETTERGB (158, 158, 158) }, + {"gray63" , PALETTERGB (161, 161, 161) }, + {"grey63" , PALETTERGB (161, 161, 161) }, + {"gray64" , PALETTERGB (163, 163, 163) }, + {"grey64" , PALETTERGB (163, 163, 163) }, + {"gray65" , PALETTERGB (166, 166, 166) }, + {"grey65" , PALETTERGB (166, 166, 166) }, + {"gray66" , PALETTERGB (168, 168, 168) }, + {"grey66" , PALETTERGB (168, 168, 168) }, + {"gray67" , PALETTERGB (171, 171, 171) }, + {"grey67" , PALETTERGB (171, 171, 171) }, + {"gray68" , PALETTERGB (173, 173, 173) }, + {"grey68" , PALETTERGB (173, 173, 173) }, + {"gray69" , PALETTERGB (176, 176, 176) }, + {"grey69" , PALETTERGB (176, 176, 176) }, + {"gray70" , PALETTERGB (179, 179, 179) }, + {"grey70" , PALETTERGB (179, 179, 179) }, + {"gray71" , PALETTERGB (181, 181, 181) }, + {"grey71" , PALETTERGB (181, 181, 181) }, + {"gray72" , PALETTERGB (184, 184, 184) }, + {"grey72" , PALETTERGB (184, 184, 184) }, + {"gray73" , PALETTERGB (186, 186, 186) }, + {"grey73" , PALETTERGB (186, 186, 186) }, + {"gray74" , PALETTERGB (189, 189, 189) }, + {"grey74" , PALETTERGB (189, 189, 189) }, + {"gray75" , PALETTERGB (191, 191, 191) }, + {"grey75" , PALETTERGB (191, 191, 191) }, + {"gray76" , PALETTERGB (194, 194, 194) }, + {"grey76" , PALETTERGB (194, 194, 194) }, + {"gray77" , PALETTERGB (196, 196, 196) }, + {"grey77" , PALETTERGB (196, 196, 196) }, + {"gray78" , PALETTERGB (199, 199, 199) }, + {"grey78" , PALETTERGB (199, 199, 199) }, + {"gray79" , PALETTERGB (201, 201, 201) }, + {"grey79" , PALETTERGB (201, 201, 201) }, + {"gray80" , PALETTERGB (204, 204, 204) }, + {"grey80" , PALETTERGB (204, 204, 204) }, + {"gray81" , PALETTERGB (207, 207, 207) }, + {"grey81" , PALETTERGB (207, 207, 207) }, + {"gray82" , PALETTERGB (209, 209, 209) }, + {"grey82" , PALETTERGB (209, 209, 209) }, + {"gray83" , PALETTERGB (212, 212, 212) }, + {"grey83" , PALETTERGB (212, 212, 212) }, + {"gray84" , PALETTERGB (214, 214, 214) }, + {"grey84" , PALETTERGB (214, 214, 214) }, + {"gray85" , PALETTERGB (217, 217, 217) }, + {"grey85" , PALETTERGB (217, 217, 217) }, + {"gray86" , PALETTERGB (219, 219, 219) }, + {"grey86" , PALETTERGB (219, 219, 219) }, + {"gray87" , PALETTERGB (222, 222, 222) }, + {"grey87" , PALETTERGB (222, 222, 222) }, + {"gray88" , PALETTERGB (224, 224, 224) }, + {"grey88" , PALETTERGB (224, 224, 224) }, + {"gray89" , PALETTERGB (227, 227, 227) }, + {"grey89" , PALETTERGB (227, 227, 227) }, + {"gray90" , PALETTERGB (229, 229, 229) }, + {"grey90" , PALETTERGB (229, 229, 229) }, + {"gray91" , PALETTERGB (232, 232, 232) }, + {"grey91" , PALETTERGB (232, 232, 232) }, + {"gray92" , PALETTERGB (235, 235, 235) }, + {"grey92" , PALETTERGB (235, 235, 235) }, + {"gray93" , PALETTERGB (237, 237, 237) }, + {"grey93" , PALETTERGB (237, 237, 237) }, + {"gray94" , PALETTERGB (240, 240, 240) }, + {"grey94" , PALETTERGB (240, 240, 240) }, + {"gray95" , PALETTERGB (242, 242, 242) }, + {"grey95" , PALETTERGB (242, 242, 242) }, + {"gray96" , PALETTERGB (245, 245, 245) }, + {"grey96" , PALETTERGB (245, 245, 245) }, + {"gray97" , PALETTERGB (247, 247, 247) }, + {"grey97" , PALETTERGB (247, 247, 247) }, + {"gray98" , PALETTERGB (250, 250, 250) }, + {"grey98" , PALETTERGB (250, 250, 250) }, + {"gray99" , PALETTERGB (252, 252, 252) }, + {"grey99" , PALETTERGB (252, 252, 252) }, + {"gray100" , PALETTERGB (255, 255, 255) }, + {"grey100" , PALETTERGB (255, 255, 255) }, + {"DarkGrey" , PALETTERGB (169, 169, 169) }, + {"DarkGray" , PALETTERGB (169, 169, 169) }, + {"DarkBlue" , PALETTERGB (0, 0, 139) }, + {"DarkCyan" , PALETTERGB (0, 139, 139) }, + {"DarkMagenta" , PALETTERGB (139, 0, 139) }, + {"DarkRed" , PALETTERGB (139, 0, 0) }, + {"LightGreen" , PALETTERGB (144, 238, 144) } }; typedef struct fontmap_t { - const char *name; - int value; + CONST char *name; + CONST int value; } fontmap_t; /* Default weight first, preferred names listed before synonyms */ -static const fontmap_t fontweight_map[] = +static CONST fontmap_t fontweight_map[] = { {"Regular" , FW_REGULAR}, /* The standard font weight */ {"Thin" , FW_THIN}, @@ -754,7 +751,7 @@ /* Default charset first, no synonyms allowed because these names are * matched against the names reported by win32 by match_font() */ -static const fontmap_t charset_map[] = +static CONST fontmap_t charset_map[] = { {"Western" , ANSI_CHARSET}, {"Symbol" , SYMBOL_CHARSET}, @@ -796,7 +793,7 @@ } COLORREF -mswindows_string_to_color(const char *name) +mswindows_string_to_color(CONST char *name) { int i; @@ -859,39 +856,22 @@ } else if (*name) /* Can't be an empty string */ { - char *nospaces = (char*) alloca (strlen (name)+1); - char *c = nospaces; + char *nospaces = alloca (strlen (name)+1); + char *c=nospaces; while (*name) if (*name != ' ') - *c++ = *name++; + *(c++) = *(name++); else name++; *c = '\0'; - for (i = 0; i < countof (mswindows_X_color_map); i++) + for (i=0; i< countof (mswindows_X_color_map); i++) if (!stricmp (nospaces, mswindows_X_color_map[i].name)) return (mswindows_X_color_map[i].colorref); } return (COLORREF) -1; } -Lisp_Object -mswindows_color_to_string (COLORREF color) -{ - int i; - char buf[8]; - COLORREF pcolor = PALETTERGB (GetRValue (color), GetGValue (color), - GetBValue (color)); - - for (i=0; i < countof (mswindows_X_color_map); i++) - if (pcolor == (mswindows_X_color_map[i].colorref)) - return build_string (mswindows_X_color_map[i].name); - - sprintf (buf, "#%02X%02X%02X", - GetRValue (color), GetGValue (color), GetBValue (color)); - return build_string (buf); -} - /* * Returns non-zero if the two supplied font patterns match. * If they match and fontname is not NULL, copies the logical OR of the @@ -957,15 +937,15 @@ struct font_enum_t { HDC hdc; - Lisp_Object list; + struct device *d; }; static int CALLBACK font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, int FontType, struct font_enum_t *font_enum) { + struct mswindows_font_enum *fontlist, **fonthead; char fontname[MSW_FONTSIZE]; - Lisp_Object fontname_lispstr; int i; /* @@ -986,7 +966,7 @@ /* Formula for pointsize->height from LOGFONT docs in Platform SDK */ sprintf (fontname, "%s::%d::", lpelfe->elfLogFont.lfFaceName, MulDiv (lpntme->ntmTm.tmHeight - lpntme->ntmTm.tmInternalLeading, - 72, GetDeviceCaps (font_enum->hdc, LOGPIXELSY))); + 72, DEVICE_MSWINDOWS_LOGPIXELSY (font_enum->d))); /* * The enumerated font character set strings are not to be trusted because @@ -1004,11 +984,25 @@ if (i==countof (charset_map)) strcpy (fontname, charset_map[0].name); - /* Add the font name to the list if not already there */ - fontname_lispstr = build_string (fontname); - if (NILP (memq_no_quit (fontname_lispstr, font_enum->list))) - font_enum->list = Fcons (fontname_lispstr, font_enum->list); + /* Check that the new font is not a duplicate */ + fonthead = &DEVICE_MSWINDOWS_FONTLIST (font_enum->d); + fontlist = *fonthead; + while (fontlist) + if (!strcmp (fontname, fontlist->fontname)) + return 1; /* found a duplicate */ + else + fontlist = fontlist->next; + /* Insert entry at head */ + fontlist = *fonthead; + *fonthead = xmalloc (sizeof (struct mswindows_font_enum)); + if (*fonthead == NULL) + { + *fonthead = fontlist; + return 0; + } + strcpy ((*fonthead)->fontname, fontname); + (*fonthead)->next = fontlist; return 1; } @@ -1024,13 +1018,13 @@ } /* - * Enumerate the available on the HDC fonts and return a list of string - * font names. + * Enumerate the available fonts. Called by mswindows_init_device(). + * Fills in the device's device-type-specfic fontlist. */ -Lisp_Object -mswindows_enumerate_fonts (HDC hdc) +void +mswindows_enumerate_fonts (struct device *d) { - /* This cannot CG */ + HDC hdc = CreateCompatibleDC (NULL); LOGFONT logfont; struct font_enum_t font_enum; @@ -1039,76 +1033,26 @@ logfont.lfFaceName[0] = '\0'; logfont.lfPitchAndFamily = DEFAULT_PITCH; font_enum.hdc = hdc; - font_enum.list = Qnil; + font_enum.d = d; + DEVICE_MSWINDOWS_FONTLIST (d) = NULL; EnumFontFamiliesEx (hdc, &logfont, (FONTENUMPROC) font_enum_callback_1, (LPARAM) (&font_enum), 0); - return font_enum.list; + DeleteDC (hdc); } -static HFONT -mswindows_create_font_variant (Lisp_Font_Instance* f, - int under, int strike) -{ - /* Cannot GC */ - - LOGFONT lf; - HFONT hfont; - - assert (FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike) == NULL); - - if (GetObject (FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0), - sizeof (lf), (void*) &lf) == 0) - { - hfont = MSWINDOWS_BAD_HFONT; - } - else - { - lf.lfUnderline = under; - lf.lfStrikeOut = strike; - - hfont = CreateFontIndirect (&lf); - if (hfont == NULL) - hfont = MSWINDOWS_BAD_HFONT; - } - - FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike) = hfont; - return hfont; -} - -HFONT -mswindows_get_hfont (Lisp_Font_Instance* f, - int under, int strike) -{ - /* Cannot GC */ - HFONT hfont = FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike); - - if (hfont == NULL) - hfont = mswindows_create_font_variant (f, under, strike); - - /* If strikeout/underline variant of the font could not be - created, then use the base version of the font */ - if (hfont == MSWINDOWS_BAD_HFONT) - hfont = FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0); - - assert (hfont != NULL && hfont != MSWINDOWS_BAD_HFONT); - - return hfont; -} /************************************************************************/ /* methods */ /************************************************************************/ static int -mswindows_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, +mswindows_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object name, Lisp_Object device, Error_behavior errb) { - const char *extname; + CONST char *extname; COLORREF color; - TO_EXTERNAL_FORMAT (LISP_STRING, name, - C_STRING_ALLOCA, extname, - Qctext); + GET_C_STRING_CTEXT_DATA_ALLOCA (name, extname); color = mswindows_string_to_color(extname); if (color != -1) { @@ -1122,15 +1066,16 @@ #if 0 static void -mswindows_mark_color_instance (Lisp_Color_Instance *c) +mswindows_mark_color_instance (struct Lisp_Color_Instance *c, + void (*markobj) (Lisp_Object)) { } #endif static void -mswindows_print_color_instance (Lisp_Color_Instance *c, - Lisp_Object printcharfun, - int escapeflag) +mswindows_print_color_instance (struct Lisp_Color_Instance *c, + Lisp_Object printcharfun, + int escapeflag) { char buf[32]; COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c); @@ -1140,7 +1085,7 @@ } static void -mswindows_finalize_color_instance (Lisp_Color_Instance *c) +mswindows_finalize_color_instance (struct Lisp_Color_Instance *c) { if (c->data) { @@ -1150,21 +1095,21 @@ } static int -mswindows_color_instance_equal (Lisp_Color_Instance *c1, - Lisp_Color_Instance *c2, - int depth) +mswindows_color_instance_equal (struct Lisp_Color_Instance *c1, + struct Lisp_Color_Instance *c2, + int depth) { return (COLOR_INSTANCE_MSWINDOWS_COLOR(c1) == COLOR_INSTANCE_MSWINDOWS_COLOR(c2)); } static unsigned long -mswindows_color_instance_hash (Lisp_Color_Instance *c, int depth) +mswindows_color_instance_hash (struct Lisp_Color_Instance *c, int depth) { - return (unsigned long) COLOR_INSTANCE_MSWINDOWS_COLOR(c); + return (unsigned long)(COLOR_INSTANCE_MSWINDOWS_COLOR(c)); } static Lisp_Object -mswindows_color_instance_rgb_components (Lisp_Color_Instance *c) +mswindows_color_instance_rgb_components (struct Lisp_Color_Instance *c) { COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c); return list3 (make_int (GetRValue (color) * 257), @@ -1175,36 +1120,38 @@ static int mswindows_valid_color_name_p (struct device *d, Lisp_Object color) { - const char *extname; + CONST char *extname; - TO_EXTERNAL_FORMAT (LISP_STRING, color, - C_STRING_ALLOCA, extname, - Qctext); + GET_C_STRING_CTEXT_DATA_ALLOCA (color, extname); return (mswindows_string_to_color(extname)!=-1); } static void -mswindows_finalize_font_instance (Lisp_Font_Instance *f); +mswindows_finalize_font_instance (struct Lisp_Font_Instance *f) +{ + if (f->data) + { + DeleteObject(f->data); + f->data=0; + } +} -/* - * This is a work horse for both mswindows_initialize_font_instanc and - * msprinter_initialize_font_instance. - */ + static int -initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, - Lisp_Object device_font_list, HDC hdc, - Error_behavior errb) +mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name, + Lisp_Object device, Error_behavior errb) { - const char *extname; + CONST char *extname; LOGFONT logfont; int fields, i; int pt; char fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8]; char effects[LF_FACESIZE], charset[LF_FACESIZE]; char *c; - HFONT hfont, hfont2; + HDC hdc; + HFONT holdfont; TEXTMETRIC metrics; extname = XSTRING_DATA (name); @@ -1308,7 +1255,7 @@ } /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform SDK */ - logfont.lfHeight = -MulDiv(pt, GetDeviceCaps (hdc, LOGPIXELSY), 72); + logfont.lfHeight = -MulDiv(pt, DEVICE_MSWINDOWS_LOGPIXELSY (XDEVICE (device)), 72); logfont.lfWidth = 0; /* Effects */ @@ -1406,137 +1353,86 @@ /* Default to monospaced if the specified fontname doesn't exist. */ logfont.lfPitchAndFamily = FF_MODERN; - /* Windows will silently substitute a default font if the fontname specifies - a non-existent font. This is bad for screen fonts because it doesn't - allow higher-level code to see the error and to act appropriately. - For instance complex_vars_of_faces() sets up a fallback list of fonts - for the default face. */ - - if (!NILP (device_font_list)) - { - Lisp_Object fonttail; - char truename[MSW_FONTSIZE]; + /* Windows will silently substitute a default font if the fontname + * specifies a non-existent font. So we check the font against the device's + * list of font patterns to make sure that at least one of them matches. */ + { + struct mswindows_font_enum *fontlist; + char truename[MSW_FONTSIZE]; + int done = 0; + + sprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects, charset); + fontlist = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device)); + while (fontlist && !done) + { + done = match_font (fontlist->fontname, truename, NULL); + fontlist = fontlist->next; + } + if (!done) + { + maybe_signal_simple_error ("No matching font", name, Qfont, errb); + return 0; + } + } - sprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects, charset); - LIST_LOOP (fonttail, device_font_list) - { - if (match_font (XSTRING_DATA (XCAR (fonttail)), truename, NULL)) - break; - } - if (NILP (fonttail)) - { - maybe_signal_simple_error ("No matching font", name, Qfont, errb); - return 0; - } - } - - if ((hfont = CreateFontIndirect(&logfont)) == NULL) + if ((f->data = CreateFontIndirect(&logfont)) == NULL) { maybe_signal_simple_error ("Couldn't create font", name, Qfont, errb); return 0; } - f->data = xnew_and_zero (struct mswindows_font_instance_data); - FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0) = hfont; - - /* Some underlined fonts have the descent of one pixel more than their - non-underlined counterparts. Font variants though are assumed to have - identical metrics. So get the font metrics from the underlined variant - of the font */ - hfont2 = mswindows_create_font_variant (f, 1, 0); - if (hfont2 != MSWINDOWS_BAD_HFONT) - hfont = hfont2; - - hfont2 = (HFONT) SelectObject (hdc, hfont); - if (!hfont2) + hdc = CreateCompatibleDC (NULL); + if (hdc) { - mswindows_finalize_font_instance (f); - maybe_signal_simple_error ("Couldn't map font", name, Qfont, errb); - return 0; + holdfont = SelectObject(hdc, f->data); + if (holdfont) + { + GetTextMetrics (hdc, &metrics); + SelectObject(hdc, holdfont); + DeleteDC (hdc); + f->width = (unsigned short) metrics.tmAveCharWidth; + f->height = (unsigned short) metrics.tmHeight; + f->ascent = (unsigned short) metrics.tmAscent; + f->descent = (unsigned short) metrics.tmDescent; + f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH); + return 1; + } + DeleteDC (hdc); } - GetTextMetrics (hdc, &metrics); - SelectObject(hdc, hfont2); - - f->width = (unsigned short) metrics.tmAveCharWidth; - f->height = (unsigned short) metrics.tmHeight; - f->ascent = (unsigned short) metrics.tmAscent; - f->descent = (unsigned short) metrics.tmDescent; - f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH); - - return 1; -} - -static int -mswindows_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, - Lisp_Object device, Error_behavior errb) -{ - HDC hdc = CreateCompatibleDC (NULL); - Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device)); - int res = initialize_font_instance (f, name, font_list, hdc, errb); - DeleteDC (hdc); - return res; -} - -static int -msprinter_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, - Lisp_Object device, Error_behavior errb) -{ - HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (device)); - Lisp_Object font_list = DEVICE_MSPRINTER_FONTLIST (XDEVICE (device)); - return initialize_font_instance (f, name, font_list, hdc, errb); -} - -static void -mswindows_finalize_font_instance (Lisp_Font_Instance *f) -{ - int i; - - if (f->data) - { - for (i = 0; i < MSWINDOWS_NUM_FONT_VARIANTS; i++) - { - if (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i) != NULL - && FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i) != MSWINDOWS_BAD_HFONT) - DeleteObject (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i)); - } - - xfree (f->data); - f->data = 0; - } + mswindows_finalize_font_instance (f); + maybe_signal_simple_error ("Couldn't map font", name, Qfont, errb); + return 0; } #if 0 static void -mswindows_mark_font_instance (Lisp_Font_Instance *f) +mswindows_mark_font_instance (struct Lisp_Font_Instance *f, + void (*markobj) (Lisp_Object)) { } #endif static void -mswindows_print_font_instance (Lisp_Font_Instance *f, - Lisp_Object printcharfun, - int escapeflag) +mswindows_print_font_instance (struct Lisp_Font_Instance *f, + Lisp_Object printcharfun, + int escapeflag) { - char buf[10]; - sprintf (buf, " 0x%lx", - (unsigned long)FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0)); - write_c_string (buf, printcharfun); } static Lisp_Object mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device) { - Lisp_Object fonttail, result = Qnil; - char *extpattern; + Lisp_Object result = Qnil; + struct mswindows_font_enum *fontlist; + char fontname[MSW_FONTSIZE], *extpattern; - TO_EXTERNAL_FORMAT (LISP_STRING, pattern, - C_STRING_ALLOCA, extpattern, - Qctext); - - LIST_LOOP (fonttail, DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device))) + GET_C_STRING_CTEXT_DATA_ALLOCA (pattern, extpattern); + fontlist = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device)); + while (fontlist) { - if (match_font (XSTRING_DATA (XCAR (fonttail)), extpattern, NULL)) - result = Fcons (XCAR (fonttail), result); + if (match_font (fontlist->fontname, extpattern, fontname)) + result = Fcons (build_string (fontname), result); + fontlist = fontlist->next; } return Fnreverse (result); @@ -1553,12 +1449,12 @@ * Missing parts of the font spec should be filled in with these values: * Courier New:Regular:10::Western */ static Lisp_Object -mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb) +mswindows_font_instance_truename (struct Lisp_Font_Instance *f, Error_behavior errb) { int nsep=0; char *name = (char *) XSTRING_DATA (f->name); char* ptr = name; - char* extname = (char*) alloca (strlen (name) + 19); + char* extname = alloca (strlen (name) + 19); strcpy (extname, name); while ((ptr = strchr (ptr, ':')) != 0) @@ -1584,14 +1480,14 @@ default:; } - return build_ext_string (extname, Qnative); + return build_ext_string (extname, FORMAT_OS); } #ifdef MULE static int mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Bufbyte *nonreloc, Lisp_Object reloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { /* #### Implement me */ @@ -1667,29 +1563,6 @@ CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset); CONSOLE_HAS_METHOD (mswindows, find_charset_font); #endif - - /* Printer methods - delegate most to windows methods, - since graphical objects behave the same way. */ - - CONSOLE_INHERITS_METHOD (msprinter, mswindows, initialize_color_instance); -/* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_color_instance); */ - CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_color_instance); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_color_instance); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_equal); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_hash); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_rgb_components); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, valid_color_name_p); - - CONSOLE_HAS_METHOD (msprinter, initialize_font_instance); -/* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_font_instance); */ - CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_font_instance); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_font_instance); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, list_fonts); -#ifdef MULE - CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_spec_matches_charset); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, find_charset_font); -#endif } void diff -r 12e008d41344 -r 697ef44129c6 src/objects-msw.h --- a/src/objects-msw.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects-msw.h Mon Aug 13 11:20:41 2007 +0200 @@ -31,8 +31,8 @@ */ -#ifndef INCLUDED_objects_msw_h_ -#define INCLUDED_objects_msw_h_ +#ifndef _XEMACS_OBJECTS_MSW_H_ +#define _XEMACS_OBJECTS_MSW_H_ #include "objects.h" @@ -46,33 +46,6 @@ #define COLOR_INSTANCE_MSWINDOWS_COLOR(c) \ (MSWINDOWS_COLOR_INSTANCE_DATA (c)->color) -/* The four HFONTS are for the 4 (underlined, strikethrough) - combinations. Only the one at index 0, neither underlined nor - struk through is created with the font instance. Other fonts are - created as necessary during redisplay, using the one at index 0 - as protptype */ -#define MSWINDOWS_NUM_FONT_VARIANTS 4 -struct mswindows_font_instance_data -{ - HFONT hfont [MSWINDOWS_NUM_FONT_VARIANTS]; -}; - -#define MSWINDOWS_FONT_INSTANCE_DATA(c) \ - ((struct mswindows_font_instance_data *) (c)->data) +#define FONT_INSTANCE_MSWINDOWS_HFONT(c) ((HFONT) (c)->data) -#define FONT_INSTANCE_MSWINDOWS_HFONT_I(c,i) \ - (MSWINDOWS_FONT_INSTANCE_DATA(c)->hfont[(i)]) - -#define FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT(c,under,strike) \ - FONT_INSTANCE_MSWINDOWS_HFONT_I (c, (!!(strike)<<1)|!!(under)) - -/* If font creation during redisplay fails, then the following - value is used to prevent future attempts to create this font. - Redisplay uses the "main" font when encounters this value */ -#define MSWINDOWS_BAD_HFONT ((HFONT)INVALID_HANDLE_VALUE) - -HFONT mswindows_get_hfont (Lisp_Font_Instance* f, int under, int strike); - -Lisp_Object mswindows_color_to_string (COLORREF color); - -#endif /* INCLUDED_objects_msw_h_ */ +#endif /* _XEMACS_OBJECTS_MSW_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/objects-tty.c --- a/src/objects-tty.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects-tty.c Mon Aug 13 11:20:41 2007 +0200 @@ -143,7 +143,7 @@ #endif /* 0 */ static int -tty_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, +tty_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object name, Lisp_Object device, Error_behavior errb) { Lisp_Object result; @@ -168,28 +168,29 @@ } static void -tty_mark_color_instance (Lisp_Color_Instance *c) +tty_mark_color_instance (struct Lisp_Color_Instance *c, + void (*markobj) (Lisp_Object)) { - mark_object (COLOR_INSTANCE_TTY_SYMBOL (c)); + markobj (COLOR_INSTANCE_TTY_SYMBOL (c)); } static void -tty_print_color_instance (Lisp_Color_Instance *c, +tty_print_color_instance (struct Lisp_Color_Instance *c, Lisp_Object printcharfun, int escapeflag) { } static void -tty_finalize_color_instance (Lisp_Color_Instance *c) +tty_finalize_color_instance (struct Lisp_Color_Instance *c) { if (c->data) xfree (c->data); } static int -tty_color_instance_equal (Lisp_Color_Instance *c1, - Lisp_Color_Instance *c2, +tty_color_instance_equal (struct Lisp_Color_Instance *c1, + struct Lisp_Color_Instance *c2, int depth) { return (EQ (COLOR_INSTANCE_TTY_SYMBOL (c1), @@ -197,7 +198,7 @@ } static unsigned long -tty_color_instance_hash (Lisp_Color_Instance *c, int depth) +tty_color_instance_hash (struct Lisp_Color_Instance *c, int depth) { return LISP_HASH (COLOR_INSTANCE_TTY_SYMBOL (c)); } @@ -214,13 +215,13 @@ static int -tty_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, +tty_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name, Lisp_Object device, Error_behavior errb) { Bufbyte *str = XSTRING_DATA (name); Lisp_Object charset = Qnil; - if (strncmp ((const char *) str, "normal", 6)) + if (strncmp ((CONST char *) str, "normal", 6)) return 0; str += 6; if (*str) @@ -229,7 +230,7 @@ if (*str != '/') return 0; str++; - charset = Ffind_charset (intern ((const char *) str)); + charset = Ffind_charset (intern ((CONST char *) str)); if (NILP (charset)) return 0; #else @@ -255,20 +256,21 @@ } static void -tty_mark_font_instance (Lisp_Font_Instance *f) +tty_mark_font_instance (struct Lisp_Font_Instance *f, + void (*markobj) (Lisp_Object)) { - mark_object (FONT_INSTANCE_TTY_CHARSET (f)); + markobj (FONT_INSTANCE_TTY_CHARSET (f)); } static void -tty_print_font_instance (Lisp_Font_Instance *f, +tty_print_font_instance (struct Lisp_Font_Instance *f, Lisp_Object printcharfun, int escapeflag) { } static void -tty_finalize_font_instance (Lisp_Font_Instance *f) +tty_finalize_font_instance (struct Lisp_Font_Instance *f) { if (f->data) xfree (f->data); @@ -284,10 +286,10 @@ static int tty_font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Bufbyte *nonreloc, Lisp_Object reloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { - const Bufbyte *the_nonreloc = nonreloc; + CONST Bufbyte *the_nonreloc = nonreloc; if (!the_nonreloc) the_nonreloc = XSTRING_DATA (reloc); @@ -296,14 +298,14 @@ if (UNBOUNDP (charset)) return !memchr (the_nonreloc, '/', length); - the_nonreloc = (const Bufbyte *) memchr (the_nonreloc, '/', length); + the_nonreloc = (CONST Bufbyte *) memchr (the_nonreloc, '/', length); if (!the_nonreloc) return 0; the_nonreloc++; { - Lisp_String *s = symbol_name (XSYMBOL (XCHARSET_NAME (charset))); - return !strcmp ((const char *) the_nonreloc, - (const char *) string_data (s)); + struct Lisp_String *s = symbol_name (XSYMBOL (XCHARSET_NAME (charset))); + return !strcmp ((CONST char *) the_nonreloc, + (CONST char *) string_data (s)); } } @@ -315,7 +317,7 @@ { Bufbyte *fontname = XSTRING_DATA (font); - if (strchr ((const char *) fontname, '/')) + if (strchr ((CONST char *) fontname, '/')) { if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0, font, 0, -1)) diff -r 12e008d41344 -r 697ef44129c6 src/objects-tty.h --- a/src/objects-tty.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects-tty.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_objects_tty_h_ -#define INCLUDED_objects_tty_h_ +#ifndef _XEMACS_OBJECTS_TTY_H_ +#define _XEMACS_OBJECTS_TTY_H_ #include "objects.h" @@ -49,4 +49,4 @@ extern Lisp_Object Vtty_color_alist, Vtty_dynamic_color_bg; extern Lisp_Object Vtty_dynamic_color_fg; -#endif /* INCLUDED_objects_tty_h_ */ +#endif /* _XEMACS_OBJECTS_TTY_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/objects-x.c --- a/src/objects-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -45,13 +45,11 @@ /* Replacement for XAllocColor() that tries to return the nearest available color if the colormap is full. Original was from FSFmacs, - but rewritten by Jareth Hein <jareth@camelot-soft.com> 97/11/25 - Modified by Lee Kindness <lkindness@csl.co.uk> 31/08/99 to handle previous - total failure which was due to a read/write colorcell being the nearest - match - tries the next nearest... + but rewritten by Jareth Hein <jareth@camelot-soft.com> 97/11/25 */ - Return value is 1 for normal success, 2 for nearest color success, - 3 for Non-deallocable sucess. */ +/* Return value is 1 for normal success, 2 for nearest color success, + 3 for Non-deallocable sucess, and 0 for absolute failure (shouldn't + happen?) */ int allocate_nearest_color (Display *display, Colormap colormap, Visual *visual, XColor *color_def) @@ -68,7 +66,7 @@ { /* We're dealing with a TrueColor/DirectColor visual, so play games with the RGB values in the XColor struct. */ - /* #### JH: I'm not sure how a call to XAllocColor can fail in a + /* ### JH: I'm not sure how a call to XAllocColor can fail in a TrueColor or DirectColor visual, so I will just reformat the request to match the requirements of the visual, and re-issue the request. If this fails for anybody, I wanna know about it @@ -117,7 +115,7 @@ else { int rd, gr, bl; - /* #### JH: I'm punting here, knowing that doing this will at + /* ### JH: I'm punting here, knowing that doing this will at least draw the color correctly. However, unless we convert all of the functions that allocate colors (graphics libraries, etc) to use this function doing this is very @@ -142,35 +140,30 @@ } else { - XColor *cells = NULL; - /* JH: I can't believe there's no way to go backwards from a - colormap ID and get its visual and number of entries, but X - apparently isn't built that way... */ - int no_cells = visual->map_entries; - status = 0; - if (XAllocColor (display, colormap, color_def) != 0) status = 1; - else while( status != 2 ) + else { /* If we got to this point, the colormap is full, so we're going to try and get the next closest color. The algorithm used is a least-squares matching, which is what X uses for closest color matching with StaticColor visuals. */ + XColor *cells; + /* JH: I can't believe there's no way to go backwards from a + colormap ID and get its visual and number of entries, but X + apparently isn't built that way... */ + int no_cells = visual->map_entries; int nearest; long nearest_delta, trial_delta; int x; - if( cells == NULL ) - { - cells = alloca_array (XColor, no_cells); - for (x = 0; x < no_cells; x++) - cells[x].pixel = x; + cells = alloca_array (XColor, no_cells); - /* read the current colormap */ - XQueryColors (display, colormap, cells, no_cells); - } + for (x = 0; x < no_cells; x++) + cells[x].pixel = x; + /* read the current colormap */ + XQueryColors (display, colormap, cells, no_cells); nearest = 0; /* I'm assuming CSE so I'm not going to condense this. */ nearest_delta = ((((color_def->red >> 8) - (cells[0].red >> 8)) @@ -191,10 +184,7 @@ + (((color_def->blue >> 8) - (cells[x].blue >> 8)) * ((color_def->blue >> 8) - (cells[x].blue >> 8)))); - - /* less? Ignore cells marked as previously failing */ - if( (trial_delta < nearest_delta) && - (cells[x].pixel != ULONG_MAX) ) + if (trial_delta < nearest_delta) { nearest = x; nearest_delta = trial_delta; @@ -203,15 +193,12 @@ color_def->red = cells[nearest].red; color_def->green = cells[nearest].green; color_def->blue = cells[nearest].blue; - if (XAllocColor (display, colormap, color_def) != 0) - status = 2; - else - /* LSK: Either the colour map has changed since - * we read it, or the colour is allocated - * read/write... Mark this cmap entry so it's - * ignored in the next iteration. - */ - cells[nearest].pixel = ULONG_MAX; + if (XAllocColor (display, colormap, color_def) != 0) { + status = 2; + } else { + status = 0; /* JH: how does this happen??? DOES this happen??? */ + fprintf(stderr,"allocate_nearest_color returned 0!!!\n"); + } } } return status; @@ -221,19 +208,21 @@ x_parse_nearest_color (struct device *d, XColor *color, Bufbyte *name, Bytecount len, Error_behavior errb) { - Display *dpy = DEVICE_X_DISPLAY (d); - Colormap cmap = DEVICE_X_COLORMAP (d); - Visual *visual = DEVICE_X_VISUAL (d); + Display *dpy; + Colormap cmap; + Visual *visual; int result; + dpy = DEVICE_X_DISPLAY (d); + cmap = DEVICE_X_COLORMAP(d); + visual = DEVICE_X_VISUAL (d); + xzero (*color); { - const Extbyte *extname; + CONST Extbyte *extname; Extcount extnamelen; - TO_EXTERNAL_FORMAT (DATA, (name, len), - ALLOCA, (extname, extnamelen), - Qbinary); + GET_CHARPTR_EXT_BINARY_DATA_ALLOCA (name, len, extname, extnamelen); result = XParseColor (dpy, cmap, (char *) extname, color); } if (!result) @@ -254,7 +243,7 @@ } static int -x_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, +x_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object name, Lisp_Object device, Error_behavior errb) { XColor color; @@ -280,7 +269,7 @@ } static void -x_print_color_instance (Lisp_Color_Instance *c, +x_print_color_instance (struct Lisp_Color_Instance *c, Lisp_Object printcharfun, int escapeflag) { @@ -292,7 +281,7 @@ } static void -x_finalize_color_instance (Lisp_Color_Instance *c) +x_finalize_color_instance (struct Lisp_Color_Instance *c) { if (c->data) { @@ -315,8 +304,8 @@ be comparing their names or pixel values instead. */ static int -x_color_instance_equal (Lisp_Color_Instance *c1, - Lisp_Color_Instance *c2, +x_color_instance_equal (struct Lisp_Color_Instance *c1, + struct Lisp_Color_Instance *c2, int depth) { XColor color1 = COLOR_INSTANCE_X_COLOR (c1); @@ -327,14 +316,14 @@ } static unsigned long -x_color_instance_hash (Lisp_Color_Instance *c, int depth) +x_color_instance_hash (struct Lisp_Color_Instance *c, int depth) { XColor color = COLOR_INSTANCE_X_COLOR (c); return HASH3 (color.red, color.green, color.blue); } static Lisp_Object -x_color_instance_rgb_components (Lisp_Color_Instance *c) +x_color_instance_rgb_components (struct Lisp_Color_Instance *c) { XColor color = COLOR_INSTANCE_X_COLOR (c); return (list3 (make_int (color.red), @@ -349,11 +338,12 @@ Display *dpy = DEVICE_X_DISPLAY (d); Colormap cmap = DEVICE_X_COLORMAP (d); - const char *extname; + CONST char *extname; - TO_EXTERNAL_FORMAT (LISP_STRING, color, C_STRING_ALLOCA, extname, Qctext); + GET_C_STRING_CTEXT_DATA_ALLOCA (color, extname); - return XParseColor (dpy, cmap, extname, &c); + return XParseColor (dpy, cmap, + extname, &c); } @@ -362,14 +352,15 @@ /************************************************************************/ static int -x_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, +x_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name, Lisp_Object device, Error_behavior errb) { - Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device)); + Display *dpy; XFontStruct *xf; - const char *extname; + CONST char *extname; - TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, extname, Qctext); + dpy = DEVICE_X_DISPLAY (XDEVICE (device)); + GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, extname); xf = XLoadQueryFont (dpy, extname); if (!xf) @@ -456,13 +447,14 @@ } static void -x_mark_font_instance (Lisp_Font_Instance *f) +x_mark_font_instance (struct Lisp_Font_Instance *f, + void (*markobj) (Lisp_Object)) { - mark_object (FONT_INSTANCE_X_TRUENAME (f)); + markobj (FONT_INSTANCE_X_TRUENAME (f)); } static void -x_print_font_instance (Lisp_Font_Instance *f, +x_print_font_instance (struct Lisp_Font_Instance *f, Lisp_Object printcharfun, int escapeflag) { @@ -472,7 +464,7 @@ } static void -x_finalize_font_instance (Lisp_Font_Instance *f) +x_finalize_font_instance (struct Lisp_Font_Instance *f) { if (f->data) @@ -772,7 +764,7 @@ } static Lisp_Object -x_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb) +x_font_instance_truename (struct Lisp_Font_Instance *f, Error_behavior errb) { struct device *d = XDEVICE (f->device); @@ -800,7 +792,7 @@ } static Lisp_Object -x_font_instance_properties (Lisp_Font_Instance *f) +x_font_instance_properties (struct Lisp_Font_Instance *f) { struct device *d = XDEVICE (f->device); int i; @@ -858,16 +850,14 @@ char **names; int count = 0; Lisp_Object result = Qnil; - const char *patternext; + CONST char *patternext; - TO_EXTERNAL_FORMAT (LISP_STRING, pattern, - C_STRING_ALLOCA, patternext, - Qbinary); + GET_C_STRING_BINARY_DATA_ALLOCA (pattern, patternext); names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)), patternext, MAX_FONT_COUNT, &count); while (count--) - result = Fcons (build_ext_string (names [count], Qbinary), result); + result = Fcons (build_ext_string (names [count], FORMAT_BINARY), result); if (names) XFreeFontNames (names); return result; @@ -877,7 +867,7 @@ static int x_font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Bufbyte *nonreloc, Lisp_Object reloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { if (UNBOUNDP (charset)) @@ -889,7 +879,7 @@ */ if (EQ (charset, Vcharset_ascii)) { - const Bufbyte *the_nonreloc = nonreloc; + CONST Bufbyte *the_nonreloc = nonreloc; int i; Bytecount the_length = length; @@ -901,7 +891,7 @@ { for (i = 0;; i++) { - const Bufbyte *new_nonreloc = (const Bufbyte *) + CONST Bufbyte *new_nonreloc = (CONST Bufbyte *) memchr (the_nonreloc, '-', the_length); if (!new_nonreloc) break; @@ -932,27 +922,23 @@ char **names; int count = 0; Lisp_Object result = Qnil; - const char *patternext; + CONST char *patternext; int i; - TO_EXTERNAL_FORMAT (LISP_STRING, font, - C_STRING_ALLOCA, patternext, - Qbinary); + GET_C_STRING_BINARY_DATA_ALLOCA (font, patternext); names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)), patternext, MAX_FONT_COUNT, &count); - /* #### This code seems awfully bogus -- mrb */ + /* ### This code seems awfully bogus -- mrb */ for (i = 0; i < count; i ++) { - const char *intname; + CONST Bufbyte *intname; - TO_INTERNAL_FORMAT (C_STRING, names[i], - C_STRING_ALLOCA, intname, - Qbinary); + GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA (names[i], intname); if (x_font_spec_matches_charset (XDEVICE (device), charset, - (Bufbyte *) intname, Qnil, 0, -1)) + intname, Qnil, 0, -1)) { - result = build_string (intname); + result = build_string ((char *) intname); break; } } diff -r 12e008d41344 -r 697ef44129c6 src/objects-x.h --- a/src/objects-x.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects-x.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_objects_x_h_ -#define INCLUDED_objects_x_h_ +#ifndef _XEMACS_OBJECTS_X_H_ +#define _XEMACS_OBJECTS_X_H_ #include "objects.h" @@ -64,5 +64,4 @@ #define FONT_INSTANCE_X_TRUENAME(f) (X_FONT_INSTANCE_DATA (f)->truename) #endif /* HAVE_X_WINDOWS */ - -#endif /* INCLUDED_objects_x_h_ */ +#endif /* _XEMACS_OBJECTS_X_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/objects.c --- a/src/objects.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects.c Mon Aug 13 11:20:41 2007 +0200 @@ -57,12 +57,12 @@ Lisp_Object Qcolor_instancep; static Lisp_Object -mark_color_instance (Lisp_Object obj) +mark_color_instance (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); - mark_object (c->name); + struct Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); + markobj (c->name); if (!NILP (c->device)) /* Vthe_null_color_instance */ - MAYBE_DEVMETH (XDEVICE (c->device), mark_color_instance, (c)); + MAYBE_DEVMETH (XDEVICE (c->device), mark_color_instance, (c, markobj)); return c->device; } @@ -72,7 +72,7 @@ int escapeflag) { char buf[100]; - Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); + struct Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); if (print_readably) error ("printing unreadable object #<color-instance 0x%x>", c->header.uid); @@ -90,7 +90,7 @@ static void finalize_color_instance (void *header, int for_disksave) { - Lisp_Color_Instance *c = (Lisp_Color_Instance *) header; + struct Lisp_Color_Instance *c = (struct Lisp_Color_Instance *) header; if (!NILP (c->device)) { @@ -102,11 +102,11 @@ static int color_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Color_Instance *c1 = XCOLOR_INSTANCE (obj1); - Lisp_Color_Instance *c2 = XCOLOR_INSTANCE (obj2); + struct Lisp_Color_Instance *c1 = XCOLOR_INSTANCE (obj1); + struct Lisp_Color_Instance *c2 = XCOLOR_INSTANCE (obj2); return (c1 == c2) || - (EQ (c1->device, c2->device) && + ((EQ (c1->device, c2->device)) && DEVICEP (c1->device) && HAS_DEVMETH_P (XDEVICE (c1->device), color_instance_equal) && DEVMETH (XDEVICE (c1->device), color_instance_equal, (c1, c2, depth))); @@ -115,7 +115,7 @@ static unsigned long color_instance_hash (Lisp_Object obj, int depth) { - Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); + struct Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); struct device *d = DEVICEP (c->device) ? XDEVICE (c->device) : 0; return HASH2 ((unsigned long) d, @@ -127,8 +127,8 @@ DEFINE_LRECORD_IMPLEMENTATION ("color-instance", color_instance, mark_color_instance, print_color_instance, finalize_color_instance, color_instance_equal, - color_instance_hash, 0, - Lisp_Color_Instance); + color_instance_hash, + struct Lisp_Color_Instance); DEFUN ("make-color-instance", Fmake_color_instance, 1, 3, 0, /* Return a new `color-instance' object named NAME (a string). @@ -149,14 +149,14 @@ */ (name, device, no_error)) { - Lisp_Color_Instance *c; + struct Lisp_Color_Instance *c; Lisp_Object val; int retval; CHECK_STRING (name); XSETDEVICE (device, decode_device (device)); - c = alloc_lcrecord_type (Lisp_Color_Instance, &lrecord_color_instance); + c = alloc_lcrecord_type (struct Lisp_Color_Instance, &lrecord_color_instance); c->name = name; c->device = device; c->data = 0; @@ -195,7 +195,7 @@ */ (color_instance)) { - Lisp_Color_Instance *c; + struct Lisp_Color_Instance *c; CHECK_COLOR_INSTANCE (color_instance); c = XCOLOR_INSTANCE (color_instance); @@ -237,13 +237,13 @@ Error_behavior errb); static Lisp_Object -mark_font_instance (Lisp_Object obj) +mark_font_instance (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Font_Instance *f = XFONT_INSTANCE (obj); + struct Lisp_Font_Instance *f = XFONT_INSTANCE (obj); - mark_object (f->name); + markobj (f->name); if (!NILP (f->device)) /* Vthe_null_font_instance */ - MAYBE_DEVMETH (XDEVICE (f->device), mark_font_instance, (f)); + MAYBE_DEVMETH (XDEVICE (f->device), mark_font_instance, (f, markobj)); return f->device; } @@ -252,7 +252,7 @@ print_font_instance (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { char buf[200]; - Lisp_Font_Instance *f = XFONT_INSTANCE (obj); + struct Lisp_Font_Instance *f = XFONT_INSTANCE (obj); if (print_readably) error ("printing unreadable object #<font-instance 0x%x>", f->header.uid); write_c_string ("#<font-instance ", printcharfun); @@ -269,7 +269,7 @@ static void finalize_font_instance (void *header, int for_disksave) { - Lisp_Font_Instance *f = (Lisp_Font_Instance *) header; + struct Lisp_Font_Instance *f = (struct Lisp_Font_Instance *) header; if (!NILP (f->device)) { @@ -301,7 +301,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("font-instance", font_instance, mark_font_instance, print_font_instance, finalize_font_instance, font_instance_equal, - font_instance_hash, 0, Lisp_Font_Instance); + font_instance_hash, struct Lisp_Font_Instance); DEFUN ("make-font-instance", Fmake_font_instance, 1, 3, 0, /* Return a new `font-instance' object named NAME. @@ -317,7 +317,7 @@ */ (name, device, no_error)) { - Lisp_Font_Instance *f; + struct Lisp_Font_Instance *f; Lisp_Object val; int retval = 0; Error_behavior errb = decode_error_behavior_flag (no_error); @@ -329,7 +329,7 @@ XSETDEVICE (device, decode_device (device)); - f = alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance); + f = alloc_lcrecord_type (struct Lisp_Font_Instance, &lrecord_font_instance); f->name = name; f->device = device; @@ -417,15 +417,15 @@ font_instance_truename_internal (Lisp_Object font_instance, Error_behavior errb) { - Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance); - + struct Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance); + if (NILP (f->device)) { maybe_signal_simple_error ("Couldn't determine font truename", font_instance, Qfont, errb); return Qnil; } - + return DEVMETH_OR_GIVEN (XDEVICE (f->device), font_instance_truename, (f, errb), f->name); } @@ -447,7 +447,7 @@ */ (font_instance)) { - Lisp_Font_Instance *f; + struct Lisp_Font_Instance *f; CHECK_FONT_INSTANCE (font_instance); f = XFONT_INSTANCE (font_instance); @@ -482,19 +482,19 @@ static void color_create (Lisp_Object obj) { - Lisp_Specifier *color = XCOLOR_SPECIFIER (obj); + struct Lisp_Specifier *color = XCOLOR_SPECIFIER (obj); COLOR_SPECIFIER_FACE (color) = Qnil; COLOR_SPECIFIER_FACE_PROPERTY (color) = Qnil; } static void -color_mark (Lisp_Object obj) +color_mark (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Specifier *color = XCOLOR_SPECIFIER (obj); + struct Lisp_Specifier *color = XCOLOR_SPECIFIER (obj); - mark_object (COLOR_SPECIFIER_FACE (color)); - mark_object (COLOR_SPECIFIER_FACE_PROPERTY (color)); + markobj (COLOR_SPECIFIER_FACE (color)); + markobj (COLOR_SPECIFIER_FACE_PROPERTY (color)); } /* No equal or hash methods; ignore the face the color is based off @@ -507,7 +507,7 @@ { /* When called, we're inside of call_with_suspended_errors(), so we can freely error. */ - Lisp_Object device = DOMAIN_DEVICE (domain); + Lisp_Object device = DFW_DEVICE (domain); struct device *d = XDEVICE (device); if (COLOR_INSTANCEP (instantiator)) @@ -622,7 +622,7 @@ void set_color_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property) { - Lisp_Specifier *color = XCOLOR_SPECIFIER (obj); + struct Lisp_Specifier *color = XCOLOR_SPECIFIER (obj); COLOR_SPECIFIER_FACE (color) = face; COLOR_SPECIFIER_FACE_PROPERTY (color) = property; @@ -631,7 +631,19 @@ DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /* Return t if OBJECT is a color specifier. -See `make-color-specifier' for a description of possible color instantiators. +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) */ (object)) { @@ -648,19 +660,19 @@ static void font_create (Lisp_Object obj) { - Lisp_Specifier *font = XFONT_SPECIFIER (obj); + struct Lisp_Specifier *font = XFONT_SPECIFIER (obj); FONT_SPECIFIER_FACE (font) = Qnil; FONT_SPECIFIER_FACE_PROPERTY (font) = Qnil; } static void -font_mark (Lisp_Object obj) +font_mark (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Specifier *font = XFONT_SPECIFIER (obj); + struct Lisp_Specifier *font = XFONT_SPECIFIER (obj); - mark_object (FONT_SPECIFIER_FACE (font)); - mark_object (FONT_SPECIFIER_FACE_PROPERTY (font)); + markobj (FONT_SPECIFIER_FACE (font)); + markobj (FONT_SPECIFIER_FACE_PROPERTY (font)); } /* No equal or hash methods; ignore the face the font is based off @@ -670,7 +682,7 @@ int font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Bufbyte *nonreloc, Lisp_Object reloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length) { return DEVMETH_OR_GIVEN (d, font_spec_matches_charset, @@ -694,7 +706,7 @@ { /* When called, we're inside of call_with_suspended_errors(), so we can freely error. */ - Lisp_Object device = DOMAIN_DEVICE (domain); + Lisp_Object device = DFW_DEVICE (domain); struct device *d = XDEVICE (device); Lisp_Object instance; @@ -820,7 +832,7 @@ void set_font_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property) { - Lisp_Specifier *font = XFONT_SPECIFIER (obj); + struct Lisp_Specifier *font = XFONT_SPECIFIER (obj); FONT_SPECIFIER_FACE (font) = face; FONT_SPECIFIER_FACE_PROPERTY (font) = property; @@ -829,7 +841,16 @@ DEFUN ("font-specifier-p", Ffont_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a font specifier. -See `make-font-specifier' for a description of possible font instantiators. +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) */ (object)) { @@ -846,19 +867,19 @@ static void face_boolean_create (Lisp_Object obj) { - Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj); + struct Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj); FACE_BOOLEAN_SPECIFIER_FACE (face_boolean) = Qnil; FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean) = Qnil; } static void -face_boolean_mark (Lisp_Object obj) +face_boolean_mark (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj); + struct Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj); - mark_object (FACE_BOOLEAN_SPECIFIER_FACE (face_boolean)); - mark_object (FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean)); + markobj (FACE_BOOLEAN_SPECIFIER_FACE (face_boolean)); + markobj (FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean)); } /* No equal or hash methods; ignore the face the face-boolean is based off @@ -956,7 +977,7 @@ set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property) { - Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj); + struct Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj); FACE_BOOLEAN_SPECIFIER_FACE (face_boolean) = face; FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean) = property; @@ -965,8 +986,15 @@ DEFUN ("face-boolean-specifier-p", Fface_boolean_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a face-boolean specifier. -See `make-face-boolean-specifier' for a description of possible -face-boolean instantiators. +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. */ (object)) { @@ -981,9 +1009,6 @@ void syms_of_objects (void) { - INIT_LRECORD_IMPLEMENTATION (color_instance); - INIT_LRECORD_IMPLEMENTATION (font_instance); - DEFSUBR (Fcolor_specifier_p); DEFSUBR (Ffont_specifier_p); DEFSUBR (Fface_boolean_specifier_p); @@ -1011,24 +1036,6 @@ defsymbol (&Qface_boolean, "face-boolean"); } -static const struct lrecord_description color_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct color_specifier, face) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct color_specifier, face_property) }, - { XD_END } -}; - -static const struct lrecord_description font_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct font_specifier, face) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct font_specifier, face_property) }, - { XD_END } -}; - -static const struct lrecord_description face_boolean_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct face_boolean_specifier, face) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct face_boolean_specifier, face_property) }, - { XD_END } -}; - void specifier_type_create_objects (void) { @@ -1063,20 +1070,12 @@ } void -reinit_specifier_type_create_objects (void) +vars_of_objects (void) { - REINITIALIZE_SPECIFIER_TYPE (color); - REINITIALIZE_SPECIFIER_TYPE (font); - REINITIALIZE_SPECIFIER_TYPE (face_boolean); -} - -void -reinit_vars_of_objects (void) -{ - staticpro_nodump (&Vthe_null_color_instance); + staticpro (&Vthe_null_color_instance); { - Lisp_Color_Instance *c = - alloc_lcrecord_type (Lisp_Color_Instance, &lrecord_color_instance); + struct Lisp_Color_Instance *c = + alloc_lcrecord_type (struct Lisp_Color_Instance, &lrecord_color_instance); c->name = Qnil; c->device = Qnil; c->data = 0; @@ -1084,10 +1083,10 @@ XSETCOLOR_INSTANCE (Vthe_null_color_instance, c); } - staticpro_nodump (&Vthe_null_font_instance); + staticpro (&Vthe_null_font_instance); { - Lisp_Font_Instance *f = - alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance); + struct Lisp_Font_Instance *f = + alloc_lcrecord_type (struct Lisp_Font_Instance, &lrecord_font_instance); f->name = Qnil; f->device = Qnil; f->data = 0; @@ -1100,9 +1099,3 @@ XSETFONT_INSTANCE (Vthe_null_font_instance, f); } } - -void -vars_of_objects (void) -{ - reinit_vars_of_objects (); -} diff -r 12e008d41344 -r 697ef44129c6 src/objects.h --- a/src/objects.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/objects.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_objects_h_ -#define INCLUDED_objects_h_ +#ifndef _XEMACS_OBJECTS_H_ +#define _XEMACS_OBJECTS_H_ #include "specifier.h" @@ -38,7 +38,7 @@ Lisp_Object face_property; /* property of that face */ }; -#define COLOR_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, color) +#define COLOR_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, color)) #define COLOR_SPECIFIER_FACE(g) (COLOR_SPECIFIER_DATA (g)->face) #define COLOR_SPECIFIER_FACE_PROPERTY(g) \ (COLOR_SPECIFIER_DATA (g)->face_property) @@ -63,7 +63,7 @@ Lisp_Object face_property; /* property of that face */ }; -#define FONT_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, font) +#define FONT_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, font)) #define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face) #define FONT_SPECIFIER_FACE_PROPERTY(g) \ (FONT_SPECIFIER_DATA (g)->face_property) @@ -88,7 +88,7 @@ Lisp_Object face_property; /* property of that face */ }; -#define FACE_BOOLEAN_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, face_boolean) +#define FACE_BOOLEAN_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, face_boolean)) #define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face) #define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \ (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property) @@ -111,6 +111,15 @@ * Color Instance Object * ****************************************************************************/ +DECLARE_LRECORD (color_instance, struct Lisp_Color_Instance); +#define XCOLOR_INSTANCE(x) \ + XRECORD (x, color_instance, struct Lisp_Color_Instance) +#define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance) +#define COLOR_INSTANCEP(x) RECORDP (x, color_instance) +#define GC_COLOR_INSTANCEP(x) GC_RECORDP (x, color_instance) +#define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance) +#define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance) + EXFUN (Fmake_color_instance, 3); extern Lisp_Object Vthe_null_color_instance; @@ -125,13 +134,6 @@ void *data; }; -DECLARE_LRECORD (color_instance, Lisp_Color_Instance); -#define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance) -#define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance) -#define COLOR_INSTANCEP(x) RECORDP (x, color_instance) -#define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance) -#define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance) - #define COLOR_INSTANCE_NAME(c) ((c)->name) #define COLOR_INSTANCE_DEVICE(c) ((c)->device) @@ -139,16 +141,17 @@ * Font Instance Object * ****************************************************************************/ -DECLARE_LRECORD (font_instance, Lisp_Font_Instance); -#define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance) +DECLARE_LRECORD (font_instance, struct Lisp_Font_Instance); +#define XFONT_INSTANCE(x) XRECORD (x, font_instance, struct Lisp_Font_Instance) #define XSETFONT_INSTANCE(x, p) XSETRECORD (x, p, font_instance) #define FONT_INSTANCEP(x) RECORDP (x, font_instance) +#define GC_FONT_INSTANCEP(x) GC_RECORDP (x, font_instance) #define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance) #define CONCHECK_FONT_INSTANCE(x) CONCHECK_RECORD (x, font_instance) #ifdef MULE int font_spec_matches_charset (struct device *d, Lisp_Object charset, - const Bufbyte *nonreloc, + CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length); #endif @@ -183,4 +186,4 @@ #define FONT_INSTANCE_WIDTH(f) ((f)->width) #define FONT_INSTANCE_HEIGHT(f) ((f)->height) -#endif /* INCLUDED_objects_h_ */ +#endif /* _XEMACS_OBJECTS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/offix-types.h --- a/src/offix-types.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/offix-types.h Mon Aug 13 11:20:41 2007 +0200 @@ -14,8 +14,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef INCLUDED_offix_types_h_ -#define INCLUDED_offix_types_h_ +#ifndef __DragAndDropTypesH__ +#define __DragAndDropTypesH__ #define DndNotDnd -1 #define DndUnknown 0 @@ -31,4 +31,4 @@ #define DndEND 10 -#endif /* INCLUDED_offix_types_h_ */ +#endif diff -r 12e008d41344 -r 697ef44129c6 src/offix.h --- a/src/offix.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/offix.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,8 +19,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef INCLUDED_offix_h_ -#define INCLUDED_offix_h_ +#ifndef __DragAndDropH__ +#define __DragAndDropH__ 1L /* The standard DND types are defined here */ #include "offix-types.h" @@ -63,7 +63,6 @@ int width,int height, char *image,char *mask, int hot_x,int hot_y); - -#endif /* INCLUDED_offix_h_ */ +#endif diff -r 12e008d41344 -r 697ef44129c6 src/opaque.c --- a/src/opaque.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/opaque.c Mon Aug 13 11:20:41 2007 +0200 @@ -32,31 +32,79 @@ OPAQUE OBJECTS SHOULD NEVER ESCAPE TO THE LISP LEVEL. Some code depends on this. As such, opaque objects are a generalization of the Qunbound marker. + + "Opaque lists" are used to keep track of lots of opaque objects + of a particular size so that they can be efficiently "freed" and + re-used again without actually entering the Lisp allocation system + (and consequently doing a malloc()). */ #include <config.h> #include "lisp.h" #include "opaque.h" +#include <stddef.h> +Lisp_Object Qopaquep; + +static int in_opaque_list_marking; + +/* Holds freed opaque objects created with make_opaque_ptr(). + We do this quite often so it's a noticeable win if we don't + create GC junk. */ Lisp_Object Vopaque_ptr_free_list; +static Lisp_Object +mark_opaque (Lisp_Object obj, void (*markobj) (Lisp_Object)) +{ + Lisp_Opaque *p = XOPAQUE (obj); + /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */ + Lisp_Object size_or_chain = p->size_or_chain; +#ifdef ERROR_CHECK_GC + if (!in_opaque_list_marking) + /* size is non-int for objects on an opaque free list. We sure + as hell better not be marking any of these objects unless + we're marking an opaque list. */ + assert (GC_INTP (size_or_chain)); + else + /* marking an opaque on the free list doesn't do any recursive + markings, so we better not have non-freed opaques on a free + list. */ + assert (!GC_INTP (size_or_chain)); +#endif + if (GC_INTP (size_or_chain) && OPAQUE_MARKFUN (p)) + return OPAQUE_MARKFUN (p) (obj, markobj); + else + return size_or_chain; +} + /* Should never, ever be called. (except by an external debugger) */ static void print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - const Lisp_Opaque *p = XOPAQUE (obj); + CONST Lisp_Opaque *p = XOPAQUE (obj); + /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */ + Lisp_Object size_or_chain = p->size_or_chain; char buf[200]; + char size_buf[50]; - sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque, size=%lu) 0x%lx>", - (long)(p->size), (unsigned long) p); + if (INTP (size_or_chain)) + sprintf (size_buf, "size=%lu", (unsigned long) OPAQUE_SIZE (p)); + else + sprintf (size_buf, "freed"); + + sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque, %s) 0x%lx>", + size_buf, (unsigned long) p); write_c_string (buf, printcharfun); } static size_t -sizeof_opaque (const void *header) +sizeof_opaque (CONST void *header) { - const Lisp_Opaque *p = (const Lisp_Opaque *) header; - return offsetof (Lisp_Opaque, data) + p->size; + CONST Lisp_Opaque *p = (CONST Lisp_Opaque *) header; + /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */ + Lisp_Object size_or_chain = p->size_or_chain; + return offsetof (Lisp_Opaque, data) + + (GC_INTP (size_or_chain) ? XINT (size_or_chain) : 0); } /* Return an opaque object of size SIZE. @@ -64,11 +112,12 @@ If DATA is OPAQUE_UNINIT, the object's data is uninitialized. Else the object's data is initialized by copying from DATA. */ Lisp_Object -make_opaque (const void *data, size_t size) +make_opaque (size_t size, CONST void *data) { Lisp_Opaque *p = (Lisp_Opaque *) alloc_lcrecord (offsetof (Lisp_Opaque, data) + size, &lrecord_opaque); - p->size = size; + p->markfun = 0; + p->size_or_chain = make_int (size); if (data == OPAQUE_CLEAR) memset (p->data, '\0', size); @@ -89,9 +138,21 @@ static int equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int depth) { - size_t size; - return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) && - !memcmp (XOPAQUE_DATA (obj1), XOPAQUE_DATA (obj2), size)); +#ifdef DEBUG_XEMACS + { + /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */ + Lisp_Object size_or_chain_1 = XOPAQUE (obj1)->size_or_chain; + Lisp_Object size_or_chain_2 = XOPAQUE (obj2)->size_or_chain; + assert (INTP (size_or_chain_1)); + assert (INTP (size_or_chain_2)); + assert (!XOPAQUE_MARKFUN (obj1) && !XOPAQUE_MARKFUN (obj2)); + } +#endif + { + size_t size; + return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) && + !memcmp (XOPAQUE_DATA (obj1), XOPAQUE_DATA (obj2), size)); + } } /* This will not work correctly for opaques with subobjects! */ @@ -99,59 +160,102 @@ static unsigned long hash_opaque (Lisp_Object obj, int depth) { +#ifdef DEBUG_XEMACS + { + /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */ + Lisp_Object size_or_chain = XOPAQUE (obj)->size_or_chain; + assert (INTP (size_or_chain)); + assert (!XOPAQUE_MARKFUN (obj)); + } +#endif if (XOPAQUE_SIZE (obj) == sizeof (unsigned long)) return *((unsigned long *) XOPAQUE_DATA (obj)); else return memory_hash (XOPAQUE_DATA (obj), XOPAQUE_SIZE (obj)); } -static const struct lrecord_description opaque_description[] = { - { XD_END } -}; +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque, + mark_opaque, print_opaque, 0, + equal_opaque, hash_opaque, + sizeof_opaque, Lisp_Opaque); + +static Lisp_Object +mark_opaque_list (Lisp_Object obj, void (*markobj) (Lisp_Object)) +{ + in_opaque_list_marking++; + markobj (XOPAQUE_LIST (obj)->free); + in_opaque_list_marking--; + return Qnil; +} + +Lisp_Object +make_opaque_list (size_t size, + Lisp_Object (*markfun) (Lisp_Object obj, + void (*markobj) (Lisp_Object))) +{ + Lisp_Object val; + Lisp_Opaque_List *p = + alloc_lcrecord_type (Lisp_Opaque_List, &lrecord_opaque_list); + + p->markfun = markfun; + p->size = size; + p->free = Qnil; + XSETOPAQUE_LIST (val, p); + return val; +} + +DEFINE_LRECORD_IMPLEMENTATION ("opaque-list", opaque_list, + mark_opaque_list, internal_object_printer, + 0, 0, 0, Lisp_Opaque_List); -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque, - 0, print_opaque, 0, - equal_opaque, hash_opaque, - opaque_description, - sizeof_opaque, Lisp_Opaque); +Lisp_Object +allocate_managed_opaque (Lisp_Object opaque_list, CONST void *data) +{ + Lisp_Opaque_List *li = XOPAQUE_LIST (opaque_list); + Lisp_Object val; + + if (!NILP (li->free)) + { + val = li->free; + li->free = XOPAQUE (val)->size_or_chain; +#ifdef ERROR_CHECK_GC + assert (NILP (li->free) || OPAQUEP (li->free)); +#endif + XOPAQUE (val)->size_or_chain = make_int (li->size); + if (data) + memcpy (XOPAQUE (val)->data, data, li->size); + else + memset (XOPAQUE (val)->data, 0, li->size); + } + else + val = make_opaque (li->size, data); + XOPAQUE (val)->markfun = li->markfun; + return val; +} + +void +free_managed_opaque (Lisp_Object opaque_list, Lisp_Object opaque) +{ + Lisp_Opaque_List *li = XOPAQUE_LIST (opaque_list); + +#ifdef ERROR_CHECK_GC + { + /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */ + Lisp_Object size_or_chain = XOPAQUE (opaque)->size_or_chain; + assert (INTP (size_or_chain)); + } +#endif + XOPAQUE (opaque)->size_or_chain = li->free; + li->free = opaque; +} /* stuff to handle opaque pointers */ -/* Should never, ever be called. (except by an external debugger) */ -static void -print_opaque_ptr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - const Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj); - char buf[200]; - - sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque-ptr, adr=0x%lx) 0x%lx>", - (long)(p->ptr), (unsigned long) p); - write_c_string (buf, printcharfun); -} - -static int -equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int depth) +Lisp_Object +make_opaque_ptr (CONST void *val) { - return (XOPAQUE_PTR (obj1)->ptr == XOPAQUE_PTR (obj2)->ptr); -} - -static unsigned long -hash_opaque_ptr (Lisp_Object obj, int depth) -{ - return (unsigned long) XOPAQUE_PTR (obj)->ptr; -} - -DEFINE_LRECORD_IMPLEMENTATION ("opaque-ptr", opaque_ptr, - 0, print_opaque_ptr, 0, - equal_opaque_ptr, hash_opaque_ptr, 0, - Lisp_Opaque_Ptr); - -Lisp_Object -make_opaque_ptr (void *val) -{ - Lisp_Object res = allocate_managed_lcrecord(Vopaque_ptr_free_list); - set_opaque_ptr (res, val); - return res; + return allocate_managed_opaque (Vopaque_ptr_free_list, + (CONST void *) &val); } /* Be very very careful with this. Same admonitions as with @@ -160,21 +264,18 @@ void free_opaque_ptr (Lisp_Object ptr) { - free_managed_lcrecord (Vopaque_ptr_free_list, ptr); + free_managed_opaque (Vopaque_ptr_free_list, ptr); } -void -reinit_opaque_once_early (void) +Lisp_Object +make_opaque_long (long val) { - Vopaque_ptr_free_list = make_lcrecord_list (sizeof (Lisp_Opaque_Ptr), &lrecord_opaque_ptr); - staticpro_nodump (&Vopaque_ptr_free_list); + return make_opaque (sizeof (val), (void *) &val); } void init_opaque_once_early (void) { - INIT_LRECORD_IMPLEMENTATION (opaque); - INIT_LRECORD_IMPLEMENTATION (opaque_ptr); - - reinit_opaque_once_early (); + Vopaque_ptr_free_list = make_opaque_list (sizeof (void *), 0); + staticpro (&Vopaque_ptr_free_list); } diff -r 12e008d41344 -r 697ef44129c6 src/opaque.h --- a/src/opaque.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/opaque.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,11 +23,10 @@ /* Written by Ben Wing, October 1993. */ -#ifndef INCLUDED_opaque_h_ -#define INCLUDED_opaque_h_ +#ifndef _XEMACS_OPAQUE_H_ +#define _XEMACS_OPAQUE_H_ -typedef union -{ +typedef union { struct { Lisp_Object obj; } obj; struct { void *p; } p; struct { double d; } d; @@ -36,46 +35,69 @@ typedef struct Lisp_Opaque { struct lcrecord_header header; - size_t size; + Lisp_Object (*markfun) (Lisp_Object obj, void (*markobj) (Lisp_Object)); + /* An integral size for non-freed objects, an opaque or nil for + freed objects. */ + Lisp_Object size_or_chain; max_align_t data[1]; } Lisp_Opaque; +typedef struct Lisp_Opaque_List +{ + struct lcrecord_header header; + /* `markfun' allows you to put lisp objects inside of opaque objects + without having to create a new object type. */ + Lisp_Object (*markfun) (Lisp_Object obj, void (*markobj) (Lisp_Object)); + Lisp_Object free; + size_t size; +} Lisp_Opaque_List; + DECLARE_LRECORD (opaque, Lisp_Opaque); #define XOPAQUE(x) XRECORD (x, opaque, Lisp_Opaque) #define XSETOPAQUE(x, p) XSETRECORD (x, p, opaque) #define OPAQUEP(x) RECORDP (x, opaque) +#define GC_OPAQUEP(x) GC_RECORDP (x, opaque) /* #define CHECK_OPAQUE(x) CHECK_RECORD (x, opaque) Opaque pointers should never escape to the Lisp level, so functions should not be doing this. */ -/* Alternative DATA arguments to make_opaque() */ -#define OPAQUE_CLEAR ((const void *) 0) -#define OPAQUE_UNINIT ((const void *) -1) +DECLARE_LRECORD (opaque_list, Lisp_Opaque_List); +#define XOPAQUE_LIST(x) XRECORD (x, opaque_list, Lisp_Opaque_List) +#define XSETOPAQUE_LIST(x, p) XSETRECORD (x, p, opaque_list) +#define OPAQUE_LISTP(x) RECORDP (x, opaque_list) +#define GC_OPAQUE_LISTP(x) GC_RECORDP (x, opaque_list) +/* #define CHECK_OPAQUE_LIST(x) CHECK_RECORD (x, opaque_list) + Opaque lists should never escape to the Lisp level, so + functions should not be doing this. */ -#define OPAQUE_SIZE(op) ((op)->size) +/* Alternative DATA arguments to make_opaque */ +#define OPAQUE_CLEAR ((CONST void *) 0) +#define OPAQUE_UNINIT ((CONST void *) -1) + +Lisp_Object make_opaque (size_t size, CONST void *data); +Lisp_Object make_opaque_ptr (CONST void *val); +Lisp_Object make_opaque_long (long val); +void free_opaque_ptr (Lisp_Object ptr); + +#define OPAQUE_SIZE(op) XINT ((op)->size_or_chain) #define OPAQUE_DATA(op) ((void *) ((op)->data)) #define OPAQUE_MARKFUN(op) ((op)->markfun) #define XOPAQUE_SIZE(op) OPAQUE_SIZE (XOPAQUE (op)) #define XOPAQUE_DATA(op) OPAQUE_DATA (XOPAQUE (op)) #define XOPAQUE_MARKFUN(op) OPAQUE_MARKFUN (XOPAQUE (op)) -Lisp_Object make_opaque (const void *data, size_t size); - -typedef struct Lisp_Opaque_Ptr -{ - struct lcrecord_header header; - void *ptr; -} Lisp_Opaque_Ptr; +#define get_opaque_ptr(op) (* (void **) XOPAQUE_DATA (op)) +#define set_opaque_ptr(op, ptr) (get_opaque_ptr (op) = (void *) ptr) +#define get_opaque_long(op) (* (long *) XOPAQUE_DATA (op)) +#define set_opaque_long(op, ptr) (get_opaque_long (op) = ptr) +#define set_opaque_markfun(op, fun) (XOPAQUE_MARKFUN (op) = fun) -DECLARE_LRECORD (opaque_ptr, Lisp_Opaque_Ptr); -#define XOPAQUE_PTR(x) XRECORD (x, opaque_ptr, Lisp_Opaque_Ptr) -#define XSETOPAQUE_PTR(x, p) XSETRECORD (x, p, opaque_ptr) -#define OPAQUE_PTRP(x) RECORDP (x, opaque_ptr) +Lisp_Object make_opaque_list (size_t size, + Lisp_Object (*markfun) + (Lisp_Object obj, + void (*markobj) (Lisp_Object))); +Lisp_Object allocate_managed_opaque (Lisp_Object opaque_list, + CONST void *data); +void free_managed_opaque (Lisp_Object opaque_list, Lisp_Object opaque); -Lisp_Object make_opaque_ptr (void *val); -void free_opaque_ptr (Lisp_Object ptr); - -#define get_opaque_ptr(op) (XOPAQUE_PTR (op)->ptr) -#define set_opaque_ptr(op, ptr_) (XOPAQUE_PTR (op)->ptr = (ptr_)) - -#endif /* INCLUDED_opaque_h_ */ +#endif /* _XEMACS_OPAQUE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/paths.h.in --- a/src/paths.h.in Mon Aug 13 11:19:22 2007 +0200 +++ b/src/paths.h.in Mon Aug 13 11:20:41 2007 +0200 @@ -50,6 +50,11 @@ is where architecture-independent files are searched for. + PATH_LOCK The name of the directory that contains lock files + with which we record what files are being modified in + Emacs. This directory should be writable by everyone. + If this is specified, the string must end with a slash! + PATH_INFO This is where the info documentation is installed. PATH_INFOPATH The default value of `Info-directory-list'. @@ -60,13 +65,9 @@ #define PATH_VERSION "@version@" -#ifdef EXEC_PREFIX_USER_DEFINED #define PATH_EXEC_PREFIX "@EXEC_PREFIX@" -#endif -#ifdef PREFIX_USER_DEFINED #define PATH_PREFIX "@PREFIX@" -#endif #ifdef LISPDIR_USER_DEFINED #define PATH_LOADSEARCH "@LISPDIR@" @@ -96,8 +97,8 @@ #define PATH_DATA "@ETCDIR@" #endif -#ifdef DOCDIR_USER_DEFINED -#define PATH_DOC "@DOCDIR@" +#ifdef LOCKDIR_USER_DEFINED +#define PATH_LOCK "@LOCKDIR@" #endif #ifdef INFODIR_USER_DEFINED diff -r 12e008d41344 -r 697ef44129c6 src/postgresql.c --- a/src/postgresql.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1909 +0,0 @@ -/* - postgresql.c -- Emacs Lisp binding to libpq.so - Copyright (C) 2000 Electrotechnical Laboratory, JAPAN. - Licensed to the Free Software Foundation. - - Author: SL Baur <steve@beopen.com> - Maintainer: SL Baur <steve@beopen.com> - -Please send patches to this file to me first before submitting them to -xemacs-patches. - - -KNOWN PROBLEMS (Last update 15-March-2000) -+ None. - -Implementation notes: -0. Supported PostgreSQL versions - This code was developed against libpq-6.5.3 and libpq-7.0-beta1. Earlier - versions may work. V7 support is more complete than V6.5 support. -1. Mule - Non-ASCII databases have been tested on both 6.5 and 7.0. -2. Asynchronous Operation - Starting with libpq-7.0, an asynchronous interface is offered. This - binding supports the asynchronous calls to a limited extent. Since the - XEmacs 21.2 core does not support a sensible interface to add managed but - unreadable (by XEmacs) file descriptors to the main select code, polling - is required to drive the asynchronous calls. XtAppAddInput would work - fine, but we want to be able to use the database when running strictly in - tty mode. -3. Completeness - Various calls have been deliberately not exported to Lisp. The - unexported calls are either left-over backwards compatibility code that - aren't needed, calls that cannot be implemented sensibly, or calls that - cannot be implemented safely. A list of all global functions in libpq - but not exported to Lisp is below. -4. Policy - This interface tries very hard to not set any policy towards how database - code in Emacs Lisp will be written. -5. Documentation - For full lisp programming documentation, see the XEmacs Lisp Reference - Manual. For PostgreSQL documentation, see the PostgreSQL distribution. - -TODO (in rough order of priority): -1. Asynchronous notifies need to be implemented to the extent they can be. -2. The large object interface needs work with Emacs buffers in addition - to files. Need two functions buffer->large_object, and large_object-> - buffer. -*/ - -/* - Unimplemented functions: [TODO] - PQsetNoticeProcessor - - Implemented, but undocumented functions: [TODO] - PQgetline (copy in/out) - PQputline (copy in/out) - PQgetlineAsync (copy in/out Asynch.) - PQputnbytes (copy in/out Asynch.) - PQendcopy (copy in/out) - - Unsupported functions: - PQsetdbLogin -- This function is deprecated, has a subset of the - functionality of PQconnectdb, and is better done in Lisp. - PQsetdb -- Same as for PQsetdbLogin - PQsocket -- Abstraction error, file descriptors should not be leaked - into Lisp code - PQprint -- print to a file descriptor, deprecated, better done in Lisp - PQdisplayTuples -- deprecated - PQprintTuples -- really, really deprecated - PQmblen -- Returns the length in bytes of multibyte character encoded - string. - PQtrace -- controls debug print tracing to a tty. - PQuntrace -- Ditto. I don't see any way to do this sensibly. - PQoidStatus -- deprecated and nearly identical to PQoidValue - PQfn -- "Fast path" interface - lo_open (large object) [*] - lo_close (large object) [*] - lo_read (large object) [*] - lo_write (large object) [*] - lo_lseek (large object) [*] - lo_creat (large object) [*] - lo_tell (large object) [*] - lo_unlink (large object) [*] -*/ - -#include <config.h> - -/* This must be portable with XEmacs 21.1 so long as it is the official - released version of XEmacs and provides the basis of InfoDock. The - interface to lcrecord handling has changed with 21.2, so unfortunately - we will need a few snippets of backwards compatibility code. -*/ -#if (EMACS_MAJOR_VERSION == 21) && (EMACS_MINOR_VERSION < 2) -#define RUNNING_XEMACS_21_1 1 -#endif - -/* #define POSTGRES_LO_IMPORT_IS_VOID 1 */ - -#include "lisp.h" -#include "sysdep.h" -#include "buffer.h" -#include "postgresql.h" - -#ifdef RUNNING_XEMACS_21_1 /* handle interface changes */ -#define PG_OS_CODING FORMAT_FILENAME -#define TO_EXTERNAL_FORMAT(a,from,b,to,c) GET_C_STRING_EXT_DATA_ALLOCA(from,FORMAT_FILENAME,to) -#else -#ifdef MULE -#define PG_OS_CODING Fget_coding_system(Vpg_coding_system) -#else -#define PG_OS_CODING Qnative -#endif -Lisp_Object Vpg_coding_system; -#endif - -#define CHECK_LIVE_CONNECTION(P) { \ - if (!P || (PQstatus (P) != CONNECTION_OK)) { \ - char *e = "bad value"; \ - if (P) e = PQerrorMessage (P); \ - error ("dead connection [%s]", e); \ - } } -#define PUKE_IF_NULL(p) { \ - if (!p) error ("bad value"); \ - } - -static Lisp_Object VXPGHOST; -static Lisp_Object VXPGUSER; -static Lisp_Object VXPGOPTIONS; -static Lisp_Object VXPGPORT; -static Lisp_Object VXPGTTY; /* This needs to be blanked! */ -static Lisp_Object VXPGDATABASE; -static Lisp_Object VXPGREALM; -#ifdef MULE -static Lisp_Object VXPGCLIENTENCODING; -#endif /* MULE */ - -/* Other variables: - PGAUTHTYPE -- not used after PostgreSQL 6.5 - PGGEQO - PGCOSTINDEX - PGCOSTHEAP - PGTZ - PGDATESTYLE -*/ -#ifndef HAVE_POSTGRESQLV7 -static Lisp_Object VXPGAUTHTYPE; -#endif -static Lisp_Object VXPGGEQO, VXPGCOSTINDEX, VXPGCOSTHEAP, VXPGTZ, VXPGDATESTYLE; - -static Lisp_Object Qpostgresql; -static Lisp_Object Qpg_connection_ok, Qpg_connection_bad; -static Lisp_Object Qpg_connection_started, Qpg_connection_made; -static Lisp_Object Qpg_connection_awaiting_response, Qpg_connection_auth_ok; -static Lisp_Object Qpg_connection_setenv; - -static Lisp_Object Qpqdb, Qpquser, Qpqpass, Qpqhost, Qpqport, Qpqtty; -static Lisp_Object Qpqoptions, Qpqstatus, Qpqerrormessage, Qpqbackendpid; - -static Lisp_Object Qpgres_empty_query, Qpgres_command_ok, Qpgres_tuples_ok; -static Lisp_Object Qpgres_copy_out, Qpgres_copy_in, Qpgres_bad_response; -static Lisp_Object Qpgres_nonfatal_error, Qpgres_fatal_error; - -static Lisp_Object Qpgres_polling_failed, Qpgres_polling_reading; -static Lisp_Object Qpgres_polling_writing, Qpgres_polling_ok; -static Lisp_Object Qpgres_polling_active; -/****/ - -/* PGconn is an opaque object and we need to be able to store them in - Lisp code because libpq supports multiple connections. -*/ -Lisp_Object Qpgconnp; - -static Lisp_Object -make_pgconn (Lisp_PGconn *pgconn) -{ - Lisp_Object lisp_pgconn; - XSETPGCONN (lisp_pgconn, pgconn); - return lisp_pgconn; -} - -static Lisp_Object -#ifdef RUNNING_XEMACS_21_1 -mark_pgconn (Lisp_Object obj, void (*markobj) (Lisp_Object)) -#else -mark_pgconn (Lisp_Object obj) -#endif -{ - return Qnil; -} - -static void -print_pgconn (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - char buf[256]; - PGconn *P; - ConnStatusType cst; - char *host="", *db="", *user="", *port=""; - - P = (XPGCONN (obj))->pgconn; - - if (!P) /* this may happen since we allow PQfinish() to be called */ - strcpy (buf, "#<PGconn DEAD>"); /* evil! */ - else if ((cst = PQstatus (P)) == CONNECTION_OK) - { - if (!(host = PQhost (P))) - host = ""; - port = PQport (P); - db = PQdb (P); - if (!(user = PQuser (P))) - user = ""; - sprintf (buf, "#<PGconn %s:%s %s/%s>", /* evil! */ - !strlen (host) ? "localhost" : host, - port, - user, - db); - } - else if (cst == CONNECTION_BAD) - strcpy (buf, "#<PGconn BAD>"); /* evil! */ - else - strcpy (buf, "#<PGconn connecting>"); /* evil! */ - - if (print_readably) - error ("printing unreadable object %s", buf); - else - write_c_string (buf, printcharfun); -} - -static Lisp_PGconn * -allocate_pgconn (void) -{ -#ifdef RUNNING_XEMACS_21_1 - Lisp_PGconn *pgconn = alloc_lcrecord_type (Lisp_PGconn, - lrecord_pgconn); -#else - Lisp_PGconn *pgconn = alloc_lcrecord_type (Lisp_PGconn, - &lrecord_pgconn); -#endif - pgconn->pgconn = (PGconn *)NULL; - return pgconn; -} - -static void -finalize_pgconn (void *header, int for_disksave) -{ - Lisp_PGconn *pgconn = (Lisp_PGconn *)header; - - if (for_disksave) - signal_simple_error ("Can't dump an emacs containing PGconn objects", - make_pgconn (pgconn)); - - if (pgconn->pgconn) - { - PQfinish (pgconn->pgconn); - pgconn->pgconn = (PGconn *)NULL; - } -} - -#ifdef RUNNING_XEMACS_21_1 -DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, - mark_pgconn, print_pgconn, finalize_pgconn, - NULL, NULL, - Lisp_PGconn); -#else -DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, - mark_pgconn, print_pgconn, finalize_pgconn, - NULL, NULL, - 0, - Lisp_PGconn); -#endif -/****/ - -/* PGresult is an opaque object and we need to be able to store them in - Lisp code. -*/ -Lisp_Object Qpgresultp; - -static Lisp_Object -make_pgresult (Lisp_PGresult *pgresult) -{ - Lisp_Object lisp_pgresult; - XSETPGRESULT (lisp_pgresult, pgresult); - return lisp_pgresult; -} - -static Lisp_Object -#ifdef RUNNING_XEMACS_21_1 -mark_pgresult (Lisp_Object obj, void (*markobj) (Lisp_Object)) -#else -mark_pgresult (Lisp_Object obj) -#endif -{ - return Qnil; -} - -#define RESULT_TUPLES_FMT "#<PGresult %s[%d] - %s>" -#define RESULT_CMD_TUPLES_FMT "#<PGresult %s[%s] - %s>" -#define RESULT_DEFAULT_FMT "#<PGresult %s - %s>" -static void -print_pgresult (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - char buf[1024]; - PGresult *res; - - res = (XPGRESULT (obj))->pgresult; - - if (res) - { - switch (PQresultStatus (res)) - { - case PGRES_TUPLES_OK: - /* Add number of tuples of result to output */ - sprintf (buf, RESULT_TUPLES_FMT, /* evil! */ - PQresStatus (PQresultStatus (res)), - PQntuples (res), - PQcmdStatus (res)); - break; - case PGRES_COMMAND_OK: - /* Add number of tuples affected by output-less command */ - if (!strlen (PQcmdTuples (res))) goto notuples; - sprintf (buf, RESULT_CMD_TUPLES_FMT, /* evil! */ - PQresStatus (PQresultStatus (res)), - PQcmdTuples (res), - PQcmdStatus (res)); - break; - default: -notuples: - /* No counts to print */ - sprintf (buf, RESULT_DEFAULT_FMT, /* evil! */ - PQresStatus (PQresultStatus (res)), - PQcmdStatus (res)); - break; - } - } - else - strcpy (buf, "#<PGresult DEAD>"); /* evil! */ - - if (print_readably) - error ("printing unreadable object %s", buf); - else - write_c_string (buf, printcharfun); -} - -#undef RESULT_TUPLES_FMT -#undef RESULT_CMD_TUPLES_FMT -#undef RESULT_DEFAULT_FMT - -static Lisp_PGresult * -allocate_pgresult (void) -{ -#ifdef RUNNING_XEMACS_21_1 - Lisp_PGresult *pgresult = alloc_lcrecord_type (Lisp_PGresult, - lrecord_pgresult); -#else - Lisp_PGresult *pgresult = alloc_lcrecord_type (Lisp_PGresult, - &lrecord_pgresult); -#endif - pgresult->pgresult = (PGresult *)NULL; - return pgresult; -} - -static void -finalize_pgresult (void *header, int for_disksave) -{ - Lisp_PGresult *pgresult = (Lisp_PGresult *)header; - - if (for_disksave) - signal_simple_error ("Can't dump an emacs containing PGresult objects", - make_pgresult (pgresult)); - - if (pgresult->pgresult) - { - PQclear (pgresult->pgresult); - pgresult->pgresult = (PGresult *)NULL; - } -} - -#ifdef RUNNING_XEMACS_21_1 -DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, - mark_pgresult, print_pgresult, finalize_pgresult, - NULL, NULL, - Lisp_PGresult); -#else -DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, - mark_pgresult, print_pgresult, finalize_pgresult, - NULL, NULL, - 0, - Lisp_PGresult); -#endif - -/***********************/ - -/* notices */ -static void -xemacs_notice_processor (void *arg, const char *msg) -{ - warn_when_safe (Qpostgresql, Qnotice, "%s", msg); -} - -/* There are four ways (as of PostgreSQL v7) to connect to a database. - Two of them, PQsetdb and PQsetdbLogin, are deprecated. Both of those - routines take a number of positional parameters and are better done in Lisp. - Note that PQconnectStart does not exist prior to v7. -*/ - -DEFUN ("pq-conn-defaults", Fpq_conn_defaults, 0, 0, 0, /* -Return a connection default structure. -*/ - ()) -{ - /* This function can GC */ - PQconninfoOption *pcio; - Lisp_Object temp, temp1; - int i; - - pcio = PQconndefaults(); - if (!pcio) return Qnil; /* can never happen in libpq-7.0 */ - temp = list1 (Fcons (build_ext_string (pcio[0].keyword, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].envvar, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].compiled, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].val, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].label, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].dispchar, PG_OS_CODING), - Fcons (make_int (pcio[0].dispsize), Qnil)))))))); - - for (i = 1; pcio[i].keyword; i++) - { - temp1 = list1 (Fcons (build_ext_string (pcio[i].keyword, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].envvar, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].compiled, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].val, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].label, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].dispchar, PG_OS_CODING), - Fcons (make_int (pcio[i].dispsize), Qnil)))))))); - { - Lisp_Object args[2]; - args[0] = temp; - args[1] = temp1; - /* Fappend GCPROs its arguments */ - temp = Fappend (2, args); - } - } - - return temp; -} - -/* PQconnectdb Makes a new connection to a backend. -PGconn *PQconnectdb(const char *conninfo) -*/ - -DEFUN ("pq-connectdb", Fpq_connectdb, 1, 1, 0, /* -Make a new connection to a PostgreSQL backend. -*/ - (conninfo)) -{ - PGconn *P; - Lisp_PGconn *lisp_pgconn; - char *error_message = "Out of Memory?"; - char *c_conninfo; - - CHECK_STRING (conninfo); - - TO_EXTERNAL_FORMAT(LISP_STRING, conninfo, - C_STRING_ALLOCA, c_conninfo, Qnative); - P = PQconnectdb (c_conninfo); - if (P && (PQstatus (P) == CONNECTION_OK)) - { - (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL); - lisp_pgconn = allocate_pgconn(); - lisp_pgconn->pgconn = P; - return make_pgconn (lisp_pgconn); - } - else - { - /* Connection failed. Destroy the connection and signal an error. */ - char buf[BLCKSZ]; - strcpy (buf, error_message); - if (P) - { - /* storage for the error message gets erased when call PQfinish */ - /* so we must temporarily stash it somewhere */ - strncpy (buf, PQerrorMessage (P), sizeof (buf)); - buf[sizeof (buf) - 1] = '\0'; - PQfinish (P); - } - error ("libpq: %s", buf); - } -} - -/* PQconnectStart Makes a new asynchronous connection to a backend. -PGconn *PQconnectStart(const char *conninfo) -*/ - -#ifdef HAVE_POSTGRESQLV7 -DEFUN ("pq-connect-start", Fpq_connect_start, 1, 1, 0, /* -Make a new asynchronous connection to a PostgreSQL backend. -*/ - (conninfo)) -{ - PGconn *P; - Lisp_PGconn *lisp_pgconn; - char *error_message = "Out of Memory?"; - char *c_conninfo; - - CHECK_STRING (conninfo); - TO_EXTERNAL_FORMAT (LISP_STRING, conninfo, - C_STRING_ALLOCA, c_conninfo, Qnative); - P = PQconnectStart (c_conninfo); - - if (P && (PQstatus (P) != CONNECTION_BAD)) - { - (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL); - lisp_pgconn = allocate_pgconn(); - lisp_pgconn->pgconn = P; - - return make_pgconn (lisp_pgconn); - } - else - { - /* capture the error message before destroying the object */ - char buf[BLCKSZ]; - strcpy (buf, error_message); - if (P) - { - strncpy (buf, PQerrorMessage (P), sizeof (buf)); - buf[sizeof (buf) - 1] = '\0'; - PQfinish (P); - } - error ("libpq: %s", buf); - } -} - -DEFUN ("pq-connect-poll", Fpq_connect_poll, 1, 1, 0, /* -Poll an asynchronous connection for completion -*/ - (conn)) -{ - PGconn *P; - PostgresPollingStatusType polling_status; - - CHECK_PGCONN (conn); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - polling_status = PQconnectPoll (P); - switch (polling_status) - { - case PGRES_POLLING_FAILED: - /* Something Bad has happened */ - { - char *e = PQerrorMessage (P); - error ("libpq: %s", e); - } - case PGRES_POLLING_OK: - return Qpgres_polling_ok; - case PGRES_POLLING_READING: - return Qpgres_polling_reading; - case PGRES_POLLING_WRITING: - return Qpgres_polling_writing; - case PGRES_POLLING_ACTIVE: - return Qpgres_polling_active; - default: - /* they've added a new field we don't know about */ - error ("Help! Unknown status code %08x from backend!", polling_status); - } -} - -#ifdef MULE -DEFUN ("pq-client-encoding", Fpq_client_encoding, 1, 1, 0, /* -Return client coding system. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return make_int (PQclientEncoding (P)); -} - -DEFUN ("pq-set-client-encoding", Fpq_set_client_encoding, 2, 2, 0, /* -Set client coding system. -*/ - (conn, encoding)) -{ - PGconn *P; - int rc; - char *c_encoding; - - CHECK_PGCONN (conn); - CHECK_STRING (encoding); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - TO_EXTERNAL_FORMAT (LISP_STRING, encoding, - C_STRING_ALLOCA, c_encoding, Qnative); - - if ((rc = PQsetClientEncoding (P, c_encoding)) < 0) - error ("bad encoding"); - else - return make_int (rc); -} - -#endif -#endif /* HAVE_POSTGRESQLV7 */ - -/* PQfinish Close the connection to the backend. Also frees memory - used by the PGconn object. -void PQfinish(PGconn *conn) -*/ -DEFUN ("pq-finish", Fpq_finish, 1, 1, 0, /* -Close the connection to the backend. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - PUKE_IF_NULL (P); - - PQfinish (P); - /* #### PQfinish deallocates the PGconn structure, so we now have a - dangling pointer. */ - /* Genocided all @'s ... */ - (XPGCONN (conn))->pgconn = (PGconn *)NULL; /* You feel DEAD inside */ - return Qnil; -} - -DEFUN ("pq-clear", Fpq_clear, 1, 1, 0, /* -Forcibly erase a PGresult object. -*/ - (res)) -{ - PGresult *R; - - CHECK_PGRESULT (res); - R = (XPGRESULT (res))->pgresult; - PUKE_IF_NULL (R); - - PQclear (R); - /* Genocided all @'s ... */ - (XPGRESULT (res))->pgresult = (PGresult *)NULL; /* You feel DEAD inside */ - - return Qnil; -} - -DEFUN ("pq-is-busy", Fpq_is_busy, 1, 1, 0, /* -Return t if PQgetResult would block waiting for input. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return PQisBusy (P) ? Qt : Qnil; -} - -DEFUN ("pq-consume-input", Fpq_consume_input, 1, 1, 0, /* -Consume any available input from the backend. -Returns nil if something bad happened. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return PQconsumeInput (P) ? Qt : Qnil; -} - -/* PQreset Reset the communication port with the backend. -void PQreset(PGconn *conn) -*/ -DEFUN ("pq-reset", Fpq_reset, 1, 1, 0, /* -Reset the connection to the backend. -This function will close the connection to the backend and attempt to -reestablish a new connection to the same postmaster, using all the same -parameters previously used. This may be useful for error recovery if a -working connection is lost. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - PUKE_IF_NULL (P);/* we can resurrect a BAD connection, but not a dead one. */ - - PQreset (P); - - return Qnil; -} - -#ifdef HAVE_POSTGRESQLV7 -DEFUN ("pq-reset-start", Fpq_reset_start, 1, 1, 0, /* -Reset connection to the backend asynchronously. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - if (PQresetStart (P)) return Qt; - { - char *e = PQerrorMessage (P); - error ("libpq: %s", e); - } -} - -DEFUN ("pq-reset-poll", Fpq_reset_poll, 1, 1, 0, /* -Poll an asynchronous reset for completion. -*/ - (conn)) -{ - PGconn *P; - PostgresPollingStatusType polling_status; - - CHECK_PGCONN (conn); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - polling_status = PQresetPoll (P); - switch (polling_status) - { - case PGRES_POLLING_FAILED: - /* Something Bad has happened */ - { - char *e = PQerrorMessage (P); - error ("libpq: %s", e); - } - case PGRES_POLLING_OK: - return Qpgres_polling_ok; - case PGRES_POLLING_READING: - return Qpgres_polling_reading; - case PGRES_POLLING_WRITING: - return Qpgres_polling_writing; - case PGRES_POLLING_ACTIVE: - return Qpgres_polling_active; - default: - /* they've added a new field we don't know about */ - error ("Help! Unknown status code %08x from backend!", polling_status); - } -} -#endif - -DEFUN ("pq-request-cancel", Fpq_request_cancel, 1, 1, 0, /* -Attempt to request cancellation of the current operation. - -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. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return PQrequestCancel (P) ? Qt : Qnil; -} - -/* accessor function for the PGconn object */ -DEFUN ("pq-pgconn", Fpq_pgconn, 2, 2, 0, /* -Accessor function for the PGconn object. -Currently recognized symbols for the field: -pq::db Database name -pq::user Database user name -pq::pass Database user's password -pq::host Hostname of PostgreSQL backend connected to -pq::port TCP port number of connection -pq::tty Debugging TTY (not used in Emacs) -pq::options Additional backend options -pq::status Connection status (either OK or BAD) -pq::error-message Last error message from the backend -pq::backend-pid Process ID of backend process -*/ - (conn, field)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - PUKE_IF_NULL (P); /* BAD connections still have state to query */ - - if (EQ(field, Qpqdb)) - /* PQdb Returns the database name of the connection. - char *PQdb(PGconn *conn) - */ - return build_ext_string (PQdb(P), PG_OS_CODING); - else if (EQ (field, Qpquser)) - /* PQuser Returns the user name of the connection. - char *PQuser(PGconn *conn) - */ - return build_ext_string (PQuser(P), PG_OS_CODING); - else if (EQ (field, Qpqpass)) - /* PQpass Returns the password of the connection. - char *PQpass(PGconn *conn) - */ - return build_ext_string (PQpass(P), PG_OS_CODING); - else if (EQ (field, Qpqhost)) - /* PQhost Returns the server host name of the connection. - char *PQhost(PGconn *conn) - */ - return build_ext_string (PQhost(P), PG_OS_CODING); - else if (EQ (field, Qpqport)) - { - char *p; - /* PQport Returns the port of the connection. - char *PQport(PGconn *conn) - */ - if ((p = PQport(P))) - return make_int(atoi(p)); - else - return make_int(-1); - } - else if (EQ (field, Qpqtty)) - /* PQtty Returns the debug tty of the connection. - char *PQtty(PGconn *conn) - */ - return build_ext_string (PQtty(P), PG_OS_CODING); - else if (EQ (field, Qpqoptions)) - /* PQoptions Returns the backend options used in the connection. - char *PQoptions(PGconn *conn) - */ - return build_ext_string (PQoptions(P), PG_OS_CODING); - else if (EQ (field, Qpqstatus)) - { - ConnStatusType cst; - /* PQstatus Returns the status of the connection. The status can be - CONNECTION_OK or CONNECTION_BAD. - ConnStatusType PQstatus(PGconn *conn) - */ - switch ((cst = PQstatus (P))) - { - case CONNECTION_OK: return Qpg_connection_ok; - case CONNECTION_BAD: return Qpg_connection_bad; -#ifdef HAVE_POSTGRESQLV7 - case CONNECTION_STARTED: return Qpg_connection_started; - case CONNECTION_MADE: return Qpg_connection_made; - case CONNECTION_AWAITING_RESPONSE: return Qpg_connection_awaiting_response; - case CONNECTION_AUTH_OK: return Qpg_connection_auth_ok; - case CONNECTION_SETENV: return Qpg_connection_setenv; -#endif /* HAVE_POSTGRESQLV7 */ - default: - /* they've added a new field we don't know about */ - error ("Help! Unknown connection status code %08x from backend!", cst); - } - } - else if (EQ (field, Qpqerrormessage)) - /* PQerrorMessage Returns the error message most recently generated - by an operation on the connection. - char *PQerrorMessage(PGconn* conn); - */ - return build_ext_string (PQerrorMessage(P), PG_OS_CODING); - else if (EQ (field, Qpqbackendpid)) - /* PQbackendPID Returns the process ID of the backend server handling - this connection. - int PQbackendPID(PGconn *conn); - */ - return make_int (PQbackendPID(P)); - else - error ("bad PGconn accessor"); -} - -/* Query functions */ -DEFUN ("pq-exec", Fpq_exec, 2, 2, 0, /* -Submit a query to Postgres and wait for the result. -*/ - (conn, query)) -{ - PGconn *P; - Lisp_PGresult *lisp_pgresult; - PGresult *R; - char *c_query; - - CHECK_PGCONN (conn); - CHECK_STRING (query); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - TO_EXTERNAL_FORMAT (LISP_STRING, query, - C_STRING_ALLOCA, c_query, Qnative); - - R = PQexec (P, c_query); - { - char *tag, buf[BLCKSZ]; - - if (!R) error ("query: out of memory"); - else - switch (PQresultStatus (R)) - { - case PGRES_BAD_RESPONSE: - tag = "bad response [%s]"; - goto err; - case PGRES_NONFATAL_ERROR: - tag = "non-fatal error [%s]"; - goto err; - case PGRES_FATAL_ERROR: - tag = "fatal error [%s]"; -err: - strncpy (buf, PQresultErrorMessage (R), sizeof (buf)); - buf [sizeof (buf) - 1] = '\0'; - PQclear (R); - error (tag, buf); - /*NOTREACHED*/ - default: - break; - } - } - - lisp_pgresult = allocate_pgresult (); - lisp_pgresult->pgresult = R; - - return make_pgresult (lisp_pgresult); -} - -DEFUN ("pq-send-query", Fpq_send_query, 2, 2, 0, /* -Submit a query to Postgres and don't wait for the result. -Returns: t if successfully submitted - nil if error (conn->errorMessage is set) -*/ - (conn, query)) -{ - PGconn *P; - char *c_query; - - CHECK_PGCONN (conn); - CHECK_STRING (query); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - TO_EXTERNAL_FORMAT (LISP_STRING, query, - C_STRING_ALLOCA, c_query, Qnative); - - if (PQsendQuery (P, c_query)) return Qt; - else error ("async query: %s", PQerrorMessage (P)); -} - -DEFUN ("pq-get-result", Fpq_get_result, 1, 1, 0, /* -Retrieve an asynchronous result from a query. -NIL is returned when no more query work remains. -*/ - (conn)) -{ - PGconn *P; - Lisp_PGresult *lisp_pgresult; - PGresult *R; - - CHECK_PGCONN (conn); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - R = PQgetResult (P); - if (!R) return Qnil; /* not an error, there's no more data to get */ - - { - char *tag, buf[BLCKSZ]; - - switch (PQresultStatus (R)) - { - case PGRES_BAD_RESPONSE: - tag = "bad response [%s]"; - goto err; - case PGRES_NONFATAL_ERROR: - tag = "non-fatal error [%s]"; - goto err; - case PGRES_FATAL_ERROR: - tag = "fatal error [%s]"; -err: - strncpy (buf, PQresultErrorMessage (R), sizeof (buf)); - buf[sizeof (buf) - 1] = '\0'; - PQclear (R); - error (tag, buf); - /*NOTREACHED*/ - default: - break; - } - } - - lisp_pgresult = allocate_pgresult(); - lisp_pgresult->pgresult = R; - - return make_pgresult (lisp_pgresult); -} - -DEFUN ("pq-result-status", Fpq_result_status, 1, 1, 0, /* -Return result status of the query. -*/ - (result)) -{ - PGresult *R; - ExecStatusType est; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - switch ((est = PQresultStatus (R))) { - case PGRES_EMPTY_QUERY: return Qpgres_empty_query; - case PGRES_COMMAND_OK: return Qpgres_command_ok; - case PGRES_TUPLES_OK: return Qpgres_tuples_ok; - case PGRES_COPY_OUT: return Qpgres_copy_out; - case PGRES_COPY_IN: return Qpgres_copy_in; - case PGRES_BAD_RESPONSE: return Qpgres_bad_response; - case PGRES_NONFATAL_ERROR: return Qpgres_nonfatal_error; - case PGRES_FATAL_ERROR: return Qpgres_fatal_error; - default: - /* they've added a new field we don't know about */ - error ("Help! Unknown exec status code %08x from backend!", est); - } -} - -DEFUN ("pq-res-status", Fpq_res_status, 1, 1, 0, /* -Return stringified result status of the query. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return build_ext_string (PQresStatus (PQresultStatus (R)), PG_OS_CODING); -} - -/* Sundry PGresult accessor functions */ -DEFUN ("pq-result-error-message", Fpq_result_error_message, 1, 1, 0, /* -Return last message associated with the query. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return build_ext_string (PQresultErrorMessage (R), PG_OS_CODING); -} - -DEFUN ("pq-ntuples", Fpq_ntuples, 1, 1, 0, /* -Return the number of tuples (instances) in the query result. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return make_int (PQntuples (R)); -} - -DEFUN ("pq-nfields", Fpq_nfields, 1, 1, 0, /* -Return the number of fields (attributes) in each tuple of the query result. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return make_int (PQnfields (R)); -} - -DEFUN ("pq-binary-tuples", Fpq_binary_tuples, 1, 1, 0, /* -Return t if the query result contains binary data, nil otherwise. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return (PQbinaryTuples (R)) ? Qt : Qnil; -} - -DEFUN ("pq-fname", Fpq_fname, 2, 2, 0, /* -Return the field (attribute) name associated with the given field index. -Field indices start at 0. -*/ - (result, field_index)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (field_index); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return build_ext_string (PQfname (R, XINT (field_index)), PG_OS_CODING); -} - -DEFUN ("pq-fnumber", Fpq_fnumber, 2, 2, 0, /* -Return the number of fields (attributes) in each tuple of the query result. -*/ - (result, field_name)) -{ - PGresult *R; - char *c_field_name; - - CHECK_PGRESULT (result); - CHECK_STRING (field_name); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - TO_EXTERNAL_FORMAT (LISP_STRING, field_name, - C_STRING_ALLOCA, c_field_name, Qnative); - - return make_int (PQfnumber (R, c_field_name)); -} - -DEFUN ("pq-ftype", Fpq_ftype, 2, 2, 0, /* -Return the field type associated with the given field index. -The integer returned is the internal coding of the type. Field indices -start at 0. -*/ - (result, field_num)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (field_num); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return make_int (PQftype (R, XINT (field_num))); -} - -DEFUN ("pq-fsize", Fpq_fsize, 2, 2, 0, /* -Return the field size in bytes associated with the given field index. -Field indices start at 0. -*/ - (result, field_index)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (field_index); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return make_int (PQftype (R, XINT (field_index))); -} - -DEFUN ("pq-fmod", Fpq_fmod, 2, 2, 0, /* -Return the type modifier associated with a field. -Field indices start at 0. -*/ - (result, field_index)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (field_index); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return make_int (PQfmod (R, XINT (field_index))); -} - -DEFUN ("pq-get-value", Fpq_get_value, 3, 3, 0, /* -Return a single field (attribute) value of one tuple of a PGresult. -Tuple and field indices start at 0. -*/ - (result, tup_num, field_num)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (tup_num); - CHECK_INT (field_num); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return build_ext_string (PQgetvalue (R, XINT (tup_num), XINT (field_num)), - PG_OS_CODING); -} - -DEFUN ("pq-get-length", Fpq_get_length, 3, 3, 0, /* -Returns the length of a field value in bytes. -If result is binary, i.e. a result of a binary portal, then the -length returned does NOT include the size field of the varlena. (The -data returned by PQgetvalue doesn't either.) -*/ - (result, tup_num, field_num)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (tup_num); - CHECK_INT (field_num); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return make_int (PQgetlength (R, XINT (tup_num), XINT (field_num))); -} - -DEFUN ("pq-get-is-null", Fpq_get_is_null, 3, 3, 0, /* -Returns the null status of a field value. -*/ - (result, tup_num, field_num)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - CHECK_INT (tup_num); - CHECK_INT (field_num); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return PQgetisnull (R, XINT (tup_num), XINT (field_num)) ? Qt : Qnil; -} - -DEFUN ("pq-cmd-status", Fpq_cmd_status, 1, 1, 0, /* -Returns the command status string from the SQL command that generated the result. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return build_ext_string (PQcmdStatus (R), PG_OS_CODING); -} - -DEFUN ("pq-cmd-tuples", Fpq_cmd_tuples, 1, 1, 0, /* -Returns the number of rows affected by the SQL command. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - - return build_ext_string (PQcmdTuples (R), PG_OS_CODING); -} - -DEFUN ("pq-oid-value", Fpq_oid_value, 1, 1, 0, /* -Returns the object id of the tuple inserted. -*/ - (result)) -{ - PGresult *R; - - CHECK_PGRESULT (result); - R = (XPGRESULT (result))->pgresult; - PUKE_IF_NULL (R); - -#ifdef HAVE_POSTGRESQLV7 - return make_int (PQoidValue (R)); -#else - /* Use the old interface */ - return make_int (atoi (PQoidStatus (R))); -#endif -} - -#ifdef HAVE_POSTGRESQLV7 -DEFUN ("pq-set-nonblocking", Fpq_set_nonblocking, 2, 2, 0, /* -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. - -Needs to be called only on a connected database connection. -*/ - (conn, arg)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return make_int (PQsetnonblocking (P, !NILP (arg))); -} - -DEFUN ("pq-is-nonblocking", Fpq_is_nonblocking, 1, 1, 0, /* -Return the blocking status of the database connection. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return PQisnonblocking (P) ? Qt : Qnil; -} - -DEFUN ("pq-flush", Fpq_flush, 1, 1, 0, /* -Force the write buffer to be written (or at least try). -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return make_int (PQflush (P)); -} -#endif - -DEFUN ("pq-notifies", Fpq_notifies, 1, 1, 0, /* -Return the latest async notification that has not yet been handled. -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. -*/ - (conn)) -{ - /* This function cannot GC */ - PGconn *P; - PGnotify *PGN; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - PGN = PQnotifies (P); - if (!PGN) - return Qnil; - else - { - Lisp_Object temp; - - temp = list2 (build_ext_string (PGN->relname, PG_OS_CODING), make_int (PGN->be_pid)); - free ((void *)PGN); - return temp; - } -} - -#if defined (HAVE_POSTGRESQLV7) && defined(MULE) -DEFUN ("pq-env-2-encoding", Fpq_env_2_encoding, 0, 0, 0, /* -Get encoding id from environment variable PGCLIENTENCODING. -*/ - ()) -{ - return make_int (PQenv2encoding ()); -} -#endif /* MULE */ - -DEFUN ("pq-lo-import", Fpq_lo_import, 2, 2, 0, /* -*/ - (conn, filename)) -{ - PGconn *P; - char *c_filename; - - CHECK_PGCONN (conn); - CHECK_STRING (filename); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - TO_EXTERNAL_FORMAT (LISP_STRING, filename, - C_STRING_ALLOCA, c_filename, - Qfile_name); - - return make_int ((int)lo_import (P, c_filename)); -} - -DEFUN ("pq-lo-export", Fpq_lo_export, 3, 3, 0, /* -*/ - (conn, oid, filename)) -{ - PGconn *P; - char *c_filename; - - CHECK_PGCONN (conn); - CHECK_INT (oid); - CHECK_STRING (filename); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - TO_EXTERNAL_FORMAT (LISP_STRING, filename, - C_STRING_ALLOCA, c_filename, Qfile_name); - - return make_int ((int)lo_export (P, XINT (oid), c_filename)); -} - -DEFUN ("pq-make-empty-pgresult", Fpq_make_empty_pgresult, 2, 2, 0, /* -Make an empty PGresult object with the given status. -*/ - (conn, status)) -{ - PGconn *P; - Lisp_PGresult *lpgr; - PGresult *R; - ExecStatusType est; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); /* needed here? */ - - if (EQ (status, Qpgres_empty_query)) est = PGRES_EMPTY_QUERY; - else if (EQ (status, Qpgres_command_ok)) est = PGRES_COMMAND_OK; - else if (EQ (status, Qpgres_tuples_ok)) est = PGRES_TUPLES_OK; - else if (EQ (status, Qpgres_copy_out)) est = PGRES_COPY_OUT; - else if (EQ (status, Qpgres_copy_in)) est = PGRES_COPY_IN; - else if (EQ (status, Qpgres_bad_response)) est = PGRES_BAD_RESPONSE; - else if (EQ (status, Qpgres_nonfatal_error)) est = PGRES_NONFATAL_ERROR; - else if (EQ (status, Qpgres_fatal_error)) est = PGRES_FATAL_ERROR; - else signal_simple_error ("bad status symbol", status); - - R = PQmakeEmptyPGresult (P, est); - if (!R) error ("out of memory?"); - - lpgr = allocate_pgresult (); - lpgr->pgresult = R; - - return make_pgresult (lpgr); -} - -DEFUN ("pq-get-line", Fpq_get_line, 1, 1, 0, /* -Retrieve a line from server in copy in operation. -The return value is a dotted pair where the cons cell is an integer code: - -1: Copying is complete - 0: A record is complete - 1: A record is incomplete, it will be continued in the next `pq-get-line' - operation. -and the cdr cell is returned string data. - -The copy operation is complete when the value `\.' (backslash dot) is -returned. -*/ - (conn)) -{ - char buffer[BLCKSZ]; /* size of a Postgres disk block */ - PGconn *P; - int ret; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - ret = PQgetline (P, buffer, sizeof (buffer)); - - return Fcons (make_int (ret), build_ext_string (buffer, PG_OS_CODING)); -} - -DEFUN ("pq-put-line", Fpq_put_line, 2, 2, 0, /* -Send a line to the server in copy out operation. - -Returns t if the operation succeeded, nil otherwise. -*/ - (conn, string)) -{ - PGconn *P; - char *c_string; - - CHECK_PGCONN (conn); - CHECK_STRING (string); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - TO_EXTERNAL_FORMAT (LISP_STRING, string, - C_STRING_ALLOCA, c_string, Qnative); - - return !PQputline (P, c_string) ? Qt : Qnil; -} - -DEFUN ("pq-get-line-async", Fpq_get_line_async, 1, 1, 0, /* -Get a line from the server in copy in operation asynchronously. - -This routine is for applications that want to do "COPY <rel> to stdout" -asynchronously, that is without blocking. Having issued the COPY command -and gotten a PGRES_COPY_OUT response, the app should call PQconsumeInput -and this routine until the end-of-data signal is detected. Unlike -PQgetline, this routine takes responsibility for detecting end-of-data. - -On each call, PQgetlineAsync will return data if a complete newline- -terminated data line is available in libpq's input buffer, or if the -incoming data line is too long to fit in the buffer offered by the caller. -Otherwise, no data is returned until the rest of the line arrives. - -If -1 is returned, the end-of-data signal has been recognized (and removed -from libpq's input buffer). The caller *must* next call PQendcopy and -then return to normal processing. - -RETURNS: - -1 if the end-of-copy-data marker has been recognized - 0 if no data is available - >0 the number of bytes returned. -The data returned will not extend beyond a newline character. If possible -a whole line will be returned at one time. But if the buffer offered by -the caller is too small to hold a line sent by the backend, then a partial -data line will be returned. This can be detected by testing whether the -last returned byte is '\n' or not. -The returned string is *not* null-terminated. -*/ - (conn)) -{ - PGconn *P; - char buffer[BLCKSZ]; - int ret; - - CHECK_PGCONN (conn); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - ret = PQgetlineAsync (P, buffer, sizeof (buffer)); - - if (ret == -1) return Qt; /* done! */ - else if (!ret) return Qnil; /* no data yet */ - else return Fcons (make_int (ret), - make_ext_string ((Extbyte *) buffer, ret, PG_OS_CODING)); -} - -DEFUN ("pq-put-nbytes", Fpq_put_nbytes, 2, 2, 0, /* -Asynchronous copy out. -*/ - (conn, data)) -{ - /* NULs are not allowed. I don't think this matters at this time. */ - PGconn *P; - char *c_data; - - CHECK_PGCONN (conn); - CHECK_STRING (data); - - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - TO_EXTERNAL_FORMAT (LISP_STRING, data, - C_STRING_ALLOCA, c_data, Qnative); - - return !PQputnbytes (P, c_data, strlen (c_data)) ? Qt : Qnil; -} - -DEFUN ("pq-end-copy", Fpq_end_copy, 1, 1, 0, /* -End a copying operation. -*/ - (conn)) -{ - PGconn *P; - - CHECK_PGCONN (conn); - P = (XPGCONN (conn))->pgconn; - CHECK_LIVE_CONNECTION (P); - - return PQendcopy (P) ? Qt : Qnil; -} - -void -syms_of_postgresql(void) -{ -#ifndef RUNNING_XEMACS_21_1 - INIT_LRECORD_IMPLEMENTATION (pgconn); - INIT_LRECORD_IMPLEMENTATION (pgresult); -#endif - defsymbol (&Qpostgresql, "postgresql"); - - /* opaque exported types */ - defsymbol (&Qpgconnp, "pgconnp"); - defsymbol (&Qpgresultp, "pgresultp"); - - /* connection status types */ - defsymbol (&Qpg_connection_ok, "pg::connection-ok"); - defsymbol (&Qpg_connection_bad, "pg::connection-bad"); - defsymbol (&Qpg_connection_started, "pg::connection-started"); - defsymbol (&Qpg_connection_made, "pg::connection-made"); - defsymbol (&Qpg_connection_awaiting_response, "pg::connection-awaiting-response"); - defsymbol (&Qpg_connection_auth_ok, "pg::connection-auth-ok"); - defsymbol (&Qpg_connection_setenv, "pg::connection-setenv"); - - /* Fields of PGconn */ - defsymbol (&Qpqdb, "pq::db"); - defsymbol (&Qpquser, "pq::user"); - defsymbol (&Qpqpass, "pq::pass"); - defsymbol (&Qpqhost, "pq::host"); - defsymbol (&Qpqport, "pq::port"); - defsymbol (&Qpqtty, "pq::tty"); - defsymbol (&Qpqoptions, "pq::options"); - defsymbol (&Qpqstatus, "pq::status"); - defsymbol (&Qpqerrormessage, "pq::error-message"); - defsymbol (&Qpqbackendpid, "pq::backend-pid"); - - /* Query status results */ - defsymbol (&Qpgres_empty_query, "pgres::empty-query"); - defsymbol (&Qpgres_command_ok, "pgres::command-ok"); - defsymbol (&Qpgres_tuples_ok, "pgres::tuples-ok"); - defsymbol (&Qpgres_copy_out, "pgres::copy-out"); - defsymbol (&Qpgres_copy_in, "pgres::copy-in"); - defsymbol (&Qpgres_bad_response, "pgres::bad-response"); - defsymbol (&Qpgres_nonfatal_error, "pgres::nonfatal-error"); - defsymbol (&Qpgres_fatal_error, "pgres::fatal-error"); - - /* Poll status results */ - defsymbol (&Qpgres_polling_failed, "pgres::polling-failed"); - defsymbol (&Qpgres_polling_reading, "pgres::polling-reading"); - defsymbol (&Qpgres_polling_writing, "pgres::polling-writing"); - defsymbol (&Qpgres_polling_ok, "pgres::polling-ok"); - defsymbol (&Qpgres_polling_active, "pgres::polling-active"); - -#ifdef HAVE_POSTGRESQLV7 - DEFSUBR (Fpq_connect_start); - DEFSUBR (Fpq_connect_poll); -#ifdef MULE - DEFSUBR (Fpq_client_encoding); - DEFSUBR (Fpq_set_client_encoding); -#endif /* MULE */ -#endif /* HAVE_POSTGRESQLV7 */ - DEFSUBR (Fpq_conn_defaults); - DEFSUBR (Fpq_connectdb); - DEFSUBR (Fpq_finish); - DEFSUBR (Fpq_clear); - DEFSUBR (Fpq_is_busy); - DEFSUBR (Fpq_consume_input); - - DEFSUBR (Fpq_reset); -#ifdef HAVE_POSTGRESQLV7 - DEFSUBR (Fpq_reset_start); - DEFSUBR (Fpq_reset_poll); -#endif - DEFSUBR (Fpq_request_cancel); - DEFSUBR (Fpq_pgconn); - - DEFSUBR (Fpq_exec); - DEFSUBR (Fpq_send_query); - DEFSUBR (Fpq_get_result); - DEFSUBR (Fpq_result_status); - DEFSUBR (Fpq_res_status); - DEFSUBR (Fpq_result_error_message); - DEFSUBR (Fpq_ntuples); - DEFSUBR (Fpq_nfields); - DEFSUBR (Fpq_binary_tuples); - DEFSUBR (Fpq_fname); - DEFSUBR (Fpq_fnumber); - DEFSUBR (Fpq_ftype); - DEFSUBR (Fpq_fsize); - DEFSUBR (Fpq_fmod); - /***/ - DEFSUBR (Fpq_get_value); - DEFSUBR (Fpq_get_length); - DEFSUBR (Fpq_get_is_null); - DEFSUBR (Fpq_cmd_status); - DEFSUBR (Fpq_cmd_tuples); - DEFSUBR (Fpq_oid_value); - -#ifdef HAVE_POSTGRESQLV7 - DEFSUBR (Fpq_set_nonblocking); - DEFSUBR (Fpq_is_nonblocking); - DEFSUBR (Fpq_flush); -#endif - DEFSUBR (Fpq_notifies); - -#if defined (HAVE_POSTGRESQLV7) && defined(MULE) - DEFSUBR (Fpq_env_2_encoding); -#endif - - DEFSUBR (Fpq_lo_import); - DEFSUBR (Fpq_lo_export); - - DEFSUBR (Fpq_make_empty_pgresult); - - /* copy in/out functions */ - DEFSUBR (Fpq_get_line); - DEFSUBR (Fpq_put_line); - DEFSUBR (Fpq_get_line_async); - DEFSUBR (Fpq_put_nbytes); - DEFSUBR (Fpq_end_copy); -} - -void -vars_of_postgresql(void) -{ - char *p; - - Fprovide (Qpostgresql); -#ifdef HAVE_POSTGRESQLV7 - Fprovide (intern ("postgresqlv7")); -#endif -#ifndef RUNNING_XEMACS_21_1 - Vpg_coding_system = Qnative; - DEFVAR_LISP ("pg-coding-system", &Vpg_coding_system /* -Default Postgres client coding system. -*/ ); -#endif - - if ((p = getenv ("PGHOST"))) - { - VXPGHOST = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGHOST = Qnil; - } - DEFVAR_LISP ("pg:host", &VXPGHOST /* -Default PostgreSQL server name. -If not set, the server running on the local host is used. The -initial value is set from the PGHOST environment variable. -*/ ); - - if ((p = getenv ("PGUSER"))) - { - VXPGUSER = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGUSER = Qnil; - } - DEFVAR_LISP ("pg:user", &VXPGUSER /* -Default PostgreSQL user name. -This value is used when connecting to a database for authentication. -The initial value is set from the PGUSER environment variable. -*/ ); - - if ((p = getenv ("PGOPTIONS"))) - { - VXPGOPTIONS = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGOPTIONS = Qnil; - } - DEFVAR_LISP ("pg:options", &VXPGOPTIONS /* -Default PostgreSQL user name. -This value is used when connecting to a database for authentication. -The initial value is set from the PGUSER environment variable. -*/ ); - - if ((p = getenv ("PGPORT"))) - { - VXPGPORT = make_int (atoi (p)); - } - else - { - VXPGPORT = Qnil; - } - DEFVAR_LISP ("pg:port", &VXPGPORT /* -Default port to connect to PostgreSQL backend. -This value is used when connecting to a database. -The initial value is set from the PGPORT environment variable. -*/ ); - - if ((p = getenv ("PGTTY"))) - { - VXPGTTY = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGTTY = Qnil; - } - DEFVAR_LISP ("pg:tty", &VXPGTTY /* -Default debugging TTY. -There is no useful setting of this variable in the XEmacs Lisp API. -The initial value is set from the PGTTY environment variable. -*/ ); - - if ((p = getenv ("PGDATABASE"))) - { - VXPGDATABASE = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGDATABASE = Qnil; - } - DEFVAR_LISP ("pg:database", &VXPGDATABASE /* -Default database to connect to. -The initial value is set from the PGDATABASE environment variable. -*/ ); - - if ((p = getenv ("PGREALM"))) - { - VXPGREALM = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGREALM = Qnil; - } - DEFVAR_LISP ("pg:realm", &VXPGREALM /* -Default kerberos realm to use for authentication. -The initial value is set from the PGREALM environment variable. -*/ ); - -#ifdef MULE - /* It's not clear whether this is any use. My intent is to - autodetect the coding system from the database. */ - if ((p = getenv ("PGCLIENTENCODING"))) - { - VXPGCLIENTENCODING = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGCLIENTENCODING = Qnil; - } - DEFVAR_LISP ("pg:client-encoding", &VXPGCLIENTENCODING /* -Default client encoding to use. -The initial value is set from the PGCLIENTENCODING environment variable. -*/ ); -#endif - -#if !defined(HAVE_POSTGRESQLV7) - if ((p = getenv ("PGAUTHTYPE"))) - { - VXPGAUTHTYPE = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGAUTHTYPE = Qnil; - } - DEFVAR_LISP ("pg:authtype", &VXPGAUTHTYPE /* -Default authentication to use. -The initial value is set from the PGAUTHTYPE environment variable. - -WARNING: This variable has gone away in versions of PostgreSQL newer -than 6.5. -*/ ); -#endif - - if ((p = getenv ("PGGEQO"))) - { - VXPGGEQO = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGGEQO = Qnil; - } - DEFVAR_LISP ("pg:geqo", &VXPGGEQO /* -Genetic Query Optimizer options. -The initial value is set from the PGGEQO environment variable. -*/ ); - - if ((p = getenv ("PGCOSTINDEX"))) - { - VXPGCOSTINDEX = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGCOSTINDEX = Qnil; - } - DEFVAR_LISP ("pg:cost-index", &VXPGCOSTINDEX /* -Default cost index options. -The initial value is set from the PGCOSTINDEX environment variable. -*/ ); - - if ((p = getenv ("PGCOSTHEAP"))) - { - VXPGCOSTHEAP = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGCOSTHEAP = Qnil; - } - DEFVAR_LISP ("pg:cost-heap", &VXPGCOSTHEAP /* -Default cost heap options. -The initial value is set from the PGCOSTHEAP environment variable. -*/ ); - - if ((p = getenv ("PGTZ"))) - { - VXPGTZ = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGTZ = Qnil; - } - DEFVAR_LISP ("pg:tz", &VXPGTZ /* -Default timezone to use. -The initial value is set from the PGTZ environment variable. -*/ ); - - if ((p = getenv ("PGDATESTYLE"))) - { - VXPGDATESTYLE = build_ext_string (p, PG_OS_CODING); - } - else - { - VXPGDATESTYLE = Qnil; - } - DEFVAR_LISP ("pg:date-style", &VXPGDATESTYLE /* -Default date style to use. -The initial value is set from the PGDATESTYLE environment variable. -*/ ); -} diff -r 12e008d41344 -r 697ef44129c6 src/postgresql.h --- a/src/postgresql.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - postgresql.h -- Emacs Lisp binding to libpq.so - Copyright (C) 2000 Electrotechnical Laboratory, JAPAN. - Licensed to the Free Software Foundation. - - Author: SL Baur <steve@beopen.com> - Maintainer: SL Baur <steve@beopen.com> - -Please send patches to this file to me first before submitting them to -xemacs-patches. -*/ - -#ifndef INCLUDED_postgresql_h_ -#define INCLUDED_postgresql_h_ 1 - -#include LIBPQ_FE_H_FILE /* main PostgreSQL header file */ - -#define BLCKSZ 8192 /* size of a default Postgres disk block */ -/* - This file contains the GCC bug workaround code for the private - LRECORD types. -*/ - -/* PGconn is an opaque object and we need to be able to store them in - Lisp code because libpq supports multiple connections. -*/ -struct Lisp_PGconn -{ - struct lcrecord_header header; - PGconn *pgconn; -}; -typedef struct Lisp_PGconn Lisp_PGconn; - -DECLARE_LRECORD (pgconn, Lisp_PGconn); - -#define XPGCONN(x) XRECORD (x, pgconn, Lisp_PGconn) -#define XSETPGCONN(x, p) XSETRECORD (x, p, pgconn) -#define PGCONNP(x) RECORDP (x, pgconn) -#define CHECK_PGCONN(x) CHECK_RECORD (x, pgconn) -#define CONCHECK_PGCONN(x) CONCHECK_RECORD (x, pgconn) - -/****/ - -/* PGresult is an opaque object and we need to be able to store them in - Lisp code. -*/ -struct Lisp_PGresult -{ - struct lcrecord_header header; - PGresult *pgresult; -}; -typedef struct Lisp_PGresult Lisp_PGresult; - -DECLARE_LRECORD (pgresult, Lisp_PGresult); - -#define XPGRESULT(x) XRECORD (x, pgresult, Lisp_PGresult) -#define XSETPGRESULT(x, p) XSETRECORD (x, p, pgresult) -#define PGRESULTP(x) RECORDP (x, pgresult) -#define CHECK_PGRESULT(x) CHECK_RECORD (x, pgresult) -#define CONCHECK_PGRESULT(x) CONCHECK_RECORD (x, pgresult) - -#endif /* INCLUDED_postgresql_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/print.c --- a/src/print.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/print.c Mon Aug 13 11:20:41 2007 +0200 @@ -1,6 +1,6 @@ /* Lisp object printing and output streams. Copyright (C) 1985, 1986, 1988, 1992-1995 Free Software Foundation, Inc. - Copyright (C) 1995, 1996, 2000 Ben Wing. + Copyright (C) 1995, 1996 Ben Wing. This file is part of XEmacs. @@ -38,10 +38,8 @@ #include "insdel.h" #include "lstream.h" #include "sysfile.h" -#ifdef WIN32_NATIVE -#include "console-msw.h" -#endif +#include <limits.h> #include <float.h> /* Define if not in float.h */ #ifndef DBL_DIG @@ -53,13 +51,14 @@ /* The subroutine object for external-debugging-output is kept here for the convenience of the debugger. */ Lisp_Object Qexternal_debugging_output; +Lisp_Object Qalternate_debugging_output; /* Avoid actual stack overflow in print. */ static int print_depth; /* Detect most circularities to print finite output. */ #define PRINT_CIRCLE 200 -static Lisp_Object being_printed[PRINT_CIRCLE]; +Lisp_Object being_printed[PRINT_CIRCLE]; /* Maximum length of list or vector to print in full; noninteger means effectively infinity */ @@ -93,6 +92,9 @@ Lisp_Object Vprint_gensym; Lisp_Object Vprint_gensym_alist; +Lisp_Object Qprint_escape_newlines; +Lisp_Object Qprint_readably; + Lisp_Object Qdisplay_error; Lisp_Object Qprint_message_label; @@ -105,47 +107,38 @@ int stdout_needs_newline; -#ifdef WIN32_NATIVE -static int no_useful_stderr; -#endif +/* Write a string (in internal format) to stdio stream STREAM. */ -static void -std_handle_out_external (FILE *stream, Lisp_Object lstream, - const Extbyte *extptr, Extcount extlen, - /* is this really stdout/stderr? - (controls termscript writing) */ - int output_is_std_handle, - int must_flush) +void +write_string_to_stdio_stream (FILE *stream, struct console *con, + CONST Bufbyte *str, + Bytecount offset, Bytecount len, + enum external_data_format fmt) { + int extlen; + CONST Extbyte *extptr; + + GET_CHARPTR_EXT_DATA_ALLOCA (str + offset, len, fmt, extptr, extlen); if (stream) { -#ifdef WIN32_NATIVE - if (!no_useful_stderr) - no_useful_stderr = GetStdHandle (STD_ERROR_HANDLE) == 0 ? 1 : -1; - - /* we typically have no useful stdout/stderr under windows if we're - being invoked graphically. */ - if (!noninteractive || no_useful_stderr > 0) - mswindows_output_console_string (extptr, extlen); - else + fwrite (extptr, 1, extlen, stream); +#ifdef WINDOWSNT + /* Q122442 says that pipes are "treated as files, not as + devices", and that this is a feature. Before I found that + article, I thought it was a bug. Thanks MS, I feel much + better now. - kkm */ + if (stream == stdout || stream == stderr) + fflush (stream); #endif - { - fwrite (extptr, 1, extlen, stream); -#ifdef WIN32_NATIVE - /* Q122442 says that pipes are "treated as files, not as - devices", and that this is a feature. Before I found that - article, I thought it was a bug. Thanks MS, I feel much - better now. - kkm */ - must_flush = 1; -#endif - if (must_flush) - fflush (stream); - } } else - Lstream_write (XLSTREAM (lstream), extptr, extlen); - - if (output_is_std_handle) + { + assert (CONSOLE_TTY_P (con)); + Lstream_write (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream), + extptr, extlen); + } + if (stream == stdout || stream == stderr || + (!stream && CONSOLE_TTY_DATA (con)->is_stdio)) { if (termscript) { @@ -156,132 +149,12 @@ } } -/* #### The following function should be replaced a call to the - emacs_doprnt_*() functions. This is the only way to ensure that - I18N3 works properly (many implementations of the *printf() - functions, including the ones included in glibc, do not implement - the %###$ argument-positioning syntax). - - Note, however, that to do this, we'd have to - - 1) pre-allocate all the lstreams and do whatever else was necessary - to make sure that no allocation occurs, since these functions may be - called from fatal_error_signal(). - - 2) (to be really correct) make a new lstream that outputs using - mswindows_output_console_string(). */ - -static int -std_handle_out_va (FILE *stream, const char *fmt, va_list args) -{ - Bufbyte kludge[8192]; - Extbyte *extptr; - Extcount extlen; - int retval; - - retval = vsprintf ((char *) kludge, fmt, args); - if (initialized && !fatal_error_in_progress) - TO_EXTERNAL_FORMAT (DATA, (kludge, strlen ((char *) kludge)), - ALLOCA, (extptr, extlen), - Qnative); - else - { - extptr = (Extbyte *) kludge; - extlen = (Extcount) strlen ((char *) kludge); - } - - std_handle_out_external (stream, Qnil, extptr, extlen, 1, 1); - return retval; -} - -/* Output portably to stderr or its equivalent; call GETTEXT on the - format string. Automatically flush when done. */ - -int -stderr_out (const char *fmt, ...) -{ - int retval; - va_list args; - va_start (args, fmt); - retval = - std_handle_out_va - (stderr, initialized && !fatal_error_in_progress ? GETTEXT (fmt) : fmt, - args); - va_end (args); - return retval; -} - -/* Output portably to stdout or its equivalent; call GETTEXT on the - format string. Automatically flush when done. */ - -int -stdout_out (const char *fmt, ...) -{ - int retval; - va_list args; - va_start (args, fmt); - retval = - std_handle_out_va - (stdout, initialized && !fatal_error_in_progress ? GETTEXT (fmt) : fmt, - args); - va_end (args); - return retval; -} - -DOESNT_RETURN -fatal (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - - stderr_out ("\nXEmacs: "); - std_handle_out_va (stderr, GETTEXT (fmt), args); - stderr_out ("\n"); - - va_end (args); - exit (1); -} - -/* Write a string (in internal format) to stdio stream STREAM. */ - -void -write_string_to_stdio_stream (FILE *stream, struct console *con, - const Bufbyte *str, - Bytecount offset, Bytecount len, - Lisp_Object coding_system, - int must_flush) -{ - Extcount extlen; - const Extbyte *extptr; - - /* #### yuck! sometimes this function is called with string data, - and the following call may gc. */ - { - Bufbyte *puta = (Bufbyte *) alloca (len); - memcpy (puta, str + offset, len); - TO_EXTERNAL_FORMAT (DATA, (puta, len), - ALLOCA, (extptr, extlen), - coding_system); - } - - if (stream) - std_handle_out_external (stream, Qnil, extptr, extlen, - stream == stdout || stream == stderr, must_flush); - else - { - assert (CONSOLE_TTY_P (con)); - std_handle_out_external (0, CONSOLE_TTY_DATA (con)->outstream, - extptr, extlen, - CONSOLE_TTY_DATA (con)->is_stdio, must_flush); - } -} - /* Write a string to the output location specified in FUNCTION. Arguments NONRELOC, RELOC, OFFSET, and LEN are as in buffer_insert_string_1() in insdel.c. */ static void -output_string (Lisp_Object function, const Bufbyte *nonreloc, +output_string (Lisp_Object function, CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount len) { /* This function can GC */ @@ -291,7 +164,7 @@ other functions that take both a nonreloc and a reloc, or things may get confused and an assertion failure in fixup_internal_substring() may get triggered. */ - const Bufbyte *newnonreloc = nonreloc; + CONST Bufbyte *newnonreloc = nonreloc; struct gcpro gcpro1, gcpro2; /* Emacs won't print while GCing, but an external debugger might */ @@ -367,7 +240,7 @@ else if (EQ (function, Qt) || EQ (function, Qnil)) { write_string_to_stdio_stream (stdout, 0, newnonreloc, offset, len, - Qterminal, print_unbuffered); + FORMAT_TERMINAL); } else { @@ -476,7 +349,7 @@ /* Used for printing a single-byte character (*not* any Emchar). */ #define write_char_internal(string_of_length_1, stream) \ - output_string (stream, (const Bufbyte *) (string_of_length_1), \ + output_string (stream, (CONST Bufbyte *) (string_of_length_1), \ Qnil, 0, 1) /* NOTE: Do not call this with the data of a Lisp_String, as @@ -489,7 +362,7 @@ canonicalize_printcharfun() (i.e. Qnil means stdout, not Vstandard_output, etc.) */ void -write_string_1 (const Bufbyte *str, Bytecount size, Lisp_Object stream) +write_string_1 (CONST Bufbyte *str, Bytecount size, Lisp_Object stream) { /* This function can GC */ #ifdef ERROR_CHECK_BUFPOS @@ -499,10 +372,10 @@ } void -write_c_string (const char *str, Lisp_Object stream) +write_c_string (CONST char *str, Lisp_Object stream) { /* This function can GC */ - write_string_1 ((const Bufbyte *) str, strlen (str), stream); + write_string_1 ((CONST Bufbyte *) str, strlen (str), stream); } @@ -758,13 +631,8 @@ { int first = 1; int speccount = specpdl_depth (); - Lisp_Object frame = Qnil; - struct gcpro gcpro1; - GCPRO1 (stream); specbind (Qprint_message_label, Qerror); - stream = print_prepare (stream, &frame); - tail = Fcdr (error_object); if (EQ (type, Qerror)) { @@ -786,8 +654,6 @@ tail = Fcdr (tail); first = 0; } - print_finish (stream, frame); - UNGCPRO; unbind_to (speccount, Qnil); return; /* not reached */ @@ -845,10 +711,11 @@ #ifdef LISP_FLOAT_TYPE Lisp_Object Vfloat_output_format; +Lisp_Object Qfloat_output_format; /* * This buffer should be at least as large as the max string size of the - * largest float, printed in the biggest notation. This is undoubtedly + * largest float, printed in the biggest notation. This is undoubtably * 20d float_output_format, with the negative of the C-constant "HUGE" * from <math.h>. * @@ -933,60 +800,47 @@ } #endif /* LISP_FLOAT_TYPE */ -/* Print NUMBER to BUFFER. This is equivalent to sprintf(buffer, - "%ld", number), only much faster. +/* Print NUMBER to BUFFER. The digits are first written in reverse + order (the least significant digit first), and are then reversed. + This is equivalent to sprintf(buffer, "%ld", number), only much + faster. BUFFER should accept 24 bytes. This should suffice for the longest - numbers on 64-bit machines, including the `-' sign and the trailing - \0. */ + numbers on 64-bit machines. */ void long_to_string (char *buffer, long number) { -#if (SIZEOF_LONG != 4) && (SIZEOF_LONG != 8) - /* Huh? */ - sprintf (buffer, "%ld", number); -#else /* (SIZEOF_LONG == 4) || (SIZEOF_LONG == 8) */ - char *p = buffer; - int force = 0; + char *p; + int i, len; if (number < 0) { - *p++ = '-'; + *buffer++ = '-'; number = -number; } + p = buffer; -#define FROB(figure) do { \ - if (force || number >= figure) \ - *p++ = number / figure + '0', number %= figure, force = 1; \ - } while (0) -#if SIZEOF_LONG == 8 - FROB (1000000000000000000L); - FROB (100000000000000000L); - FROB (10000000000000000L); - FROB (1000000000000000L); - FROB (100000000000000L); - FROB (10000000000000L); - FROB (1000000000000L); - FROB (100000000000L); - FROB (10000000000L); -#endif /* SIZEOF_LONG == 8 */ - FROB (1000000000); - FROB (100000000); - FROB (10000000); - FROB (1000000); - FROB (100000); - FROB (10000); - FROB (1000); - FROB (100); - FROB (10); -#undef FROB - *p++ = number + '0'; - *p = '\0'; -#endif /* (SIZEOF_LONG == 4) || (SIZEOF_LONG == 8) */ + /* Print the digits to the string. */ + do + { + *p++ = number % 10 + '0'; + number /= 10; + } + while (number); + + /* And reverse them. */ + len = p - buffer - 1; + for (i = len / 2; i >= 0; i--) + { + char c = buffer[i]; + buffer[i] = buffer[len - i]; + buffer[len - i] = c; + } + buffer[len + 1] = '\0'; } static void -print_vector_internal (const char *start, const char *end, +print_vector_internal (CONST char *start, CONST char *end, Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { @@ -1093,7 +947,7 @@ void print_string (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_String *s = XSTRING (obj); + struct Lisp_String *s = XSTRING (obj); /* We distinguish between Bytecounts and Charcounts, to make Vprint_string_length work correctly under Mule. */ Charcount size = string_char_length (s); @@ -1242,9 +1096,7 @@ case Lisp_Type_Int_Even: case Lisp_Type_Int_Odd: { - /* ASCII Decimal representation uses 2.4 times as many bits as - machine binary. */ - char buf[3 * sizeof (EMACS_INT) + 5]; + char buf[24]; long_to_string (buf, XINT (obj)); write_c_string (buf, printcharfun); break; @@ -1257,61 +1109,36 @@ Emchar ch = XCHAR (obj); char *p = buf; *p++ = '?'; - if (ch < 32) - { - *p++ = '\\'; - switch (ch) - { - case '\t': *p++ = 't'; break; - case '\n': *p++ = 'n'; break; - case '\r': *p++ = 'r'; break; - default: - *p++ = '^'; - *p++ = ch + 64; - if ((ch + 64) == '\\') - *p++ = '\\'; - break; - } - } - else if (ch < 127) + if (ch == '\n') + *p++ = '\\', *p++ = 'n'; + else if (ch == '\r') + *p++ = '\\', *p++ = 'r'; + else if (ch == '\t') + *p++ = '\\', *p++ = 't'; + else if (ch < 32) { - /* syntactically special characters should be escaped. */ - switch (ch) - { - case ' ': - case '"': - case '#': - case '\'': - case '(': - case ')': - case ',': - case '.': - case ';': - case '?': - case '[': - case '\\': - case ']': - case '`': - *p++ = '\\'; - } - *p++ = ch; + *p++ = '\\', *p++ = '^'; + *p++ = ch + 64; + if ((ch + 64) == '\\') + *p++ = '\\'; } else if (ch == 127) - { - *p++ = '\\', *p++ = '^', *p++ = '?'; - } - else if (ch < 160) + *p++ = '\\', *p++ = '^', *p++ = '?'; + else if (ch >= 128 && ch < 160) { *p++ = '\\', *p++ = '^'; - p += set_charptr_emchar ((Bufbyte *) p, ch + 64); + p += set_charptr_emchar ((Bufbyte *)p, ch + 64); } + else if (ch < 127 + && !isdigit (ch) + && !isalpha (ch) + && ch != '^') /* must not backslash this or it will + be interpreted as the start of a + control char */ + *p++ = '\\', *p++ = ch; else - { - p += set_charptr_emchar ((Bufbyte *) p, ch); - } - - output_string (printcharfun, (Bufbyte *) buf, Qnil, 0, p - buf); - + p += set_charptr_emchar ((Bufbyte *)p, ch); + output_string (printcharfun, (Bufbyte *)buf, Qnil, 0, p - buf); break; } @@ -1386,7 +1213,7 @@ /* This function can GC */ /* #### Bug!! (intern "") isn't printed in some distinguished way */ /* #### (the reader also loses on it) */ - Lisp_String *name = symbol_name (XSYMBOL (obj)); + struct Lisp_String *name = symbol_name (XSYMBOL (obj)); Bytecount size = string_length (name); struct gcpro gcpro1, gcpro2; @@ -1520,8 +1347,8 @@ getting rid of this function altogether? Does anything actually *use* it? --hniksic */ -static int alternate_do_pointer; -static char alternate_do_string[5000]; +int alternate_do_pointer; +char alternate_do_string[5000]; DEFUN ("alternate-debugging-output", Falternate_debugging_output, 1, 1, 0, /* Append CHARACTER to the array `alternate_do_string'. @@ -1534,13 +1361,11 @@ Bufbyte str[MAX_EMCHAR_LEN]; Bytecount len; int extlen; - const Extbyte *extptr; + CONST Extbyte *extptr; CHECK_CHAR_COERCE_INT (character); len = set_charptr_emchar (str, XCHAR (character)); - TO_EXTERNAL_FORMAT (DATA, (str, len), - ALLOCA, (extptr, extlen), - Qterminal); + GET_CHARPTR_EXT_DATA_ALLOCA (str, len, FORMAT_TERMINAL, extptr, extlen); memcpy (alternate_do_string + alternate_do_pointer, extptr, extlen); alternate_do_pointer += extlen; alternate_do_string[alternate_do_pointer] = 0; @@ -1554,10 +1379,6 @@ to stderr. You can use this function to write directly to the terminal. This function can be used as the STREAM argument of Fprint() or the like. -Under MS Windows, this writes output to the console window (which is -created, if necessary), unless XEmacs is being run noninteractively -\(i.e. using the `-batch' argument). - If you have opened a termscript file (using `open-termscript'), then the output also will be logged to this file. */ @@ -1592,7 +1413,7 @@ write_string_to_stdio_stream (file, con, XSTRING_DATA (char_or_string), 0, XSTRING_LENGTH (char_or_string), - Qterminal, 1); + FORMAT_TERMINAL); else { Bufbyte str[MAX_EMCHAR_LEN]; @@ -1600,7 +1421,7 @@ CHECK_CHAR_COERCE_INT (char_or_string); len = set_charptr_emchar (str, XCHAR (char_or_string)); - write_string_to_stdio_stream (file, con, str, 0, len, Qterminal, 1); + write_string_to_stdio_stream (file, con, str, 0, len, FORMAT_TERMINAL); } return char_or_string; @@ -1629,41 +1450,39 @@ #if 1 /* Debugging kludge -- unbuffered */ -static int debug_print_length = 50; -static int debug_print_level = 15; -static int debug_print_readably = -1; +static int debug_print_length = 50; +static int debug_print_level = 15; +Lisp_Object debug_temp; static void debug_print_no_newline (Lisp_Object debug_print_obj) { /* This function can GC */ - int save_print_readably = print_readably; - int save_print_depth = print_depth; - Lisp_Object save_Vprint_length = Vprint_length; - Lisp_Object save_Vprint_level = Vprint_level; - Lisp_Object save_Vinhibit_quit = Vinhibit_quit; + int old_print_readably = print_readably; + int old_print_depth = print_depth; + Lisp_Object old_print_length = Vprint_length; + Lisp_Object old_print_level = Vprint_level; + Lisp_Object old_inhibit_quit = Vinhibit_quit; struct gcpro gcpro1, gcpro2, gcpro3; - GCPRO3 (save_Vprint_level, save_Vprint_length, save_Vinhibit_quit); + GCPRO3 (old_print_level, old_print_length, old_inhibit_quit); if (gc_in_progress) stderr_out ("** gc-in-progress! Bad idea to print anything! **\n"); print_depth = 0; - print_readably = debug_print_readably != -1 ? debug_print_readably : 0; + print_readably = 0; print_unbuffered++; /* Could use unwind-protect, but why bother? */ if (debug_print_length > 0) Vprint_length = make_int (debug_print_length); if (debug_print_level > 0) Vprint_level = make_int (debug_print_level); - print_internal (debug_print_obj, Qexternal_debugging_output, 1); - - Vinhibit_quit = save_Vinhibit_quit; - Vprint_level = save_Vprint_level; - Vprint_length = save_Vprint_length; - print_depth = save_print_depth; - print_readably = save_print_readably; + Vinhibit_quit = old_inhibit_quit; + Vprint_level = old_print_level; + Vprint_length = old_print_length; + print_depth = old_print_depth; + print_readably = old_print_readably; print_unbuffered--; UNGCPRO; } @@ -1673,6 +1492,7 @@ { debug_print_no_newline (debug_print_obj); stderr_out ("\n"); + fflush (stderr); } /* Debugging kludge -- unbuffered */ @@ -1705,6 +1525,7 @@ Fbacktrace (Qexternal_debugging_output, Qt); stderr_out ("\n"); + fflush (stderr); Vinhibit_quit = old_inhibit_quit; Vprint_level = old_print_level; @@ -1722,11 +1543,13 @@ int first = 1; struct backtrace *bt = backtrace_list; stderr_out (" ["); + fflush (stderr); while (length > 0 && bt) { if (!first) { stderr_out (", "); + fflush (stderr); } if (COMPILED_FUNCTIONP (*bt->function)) { @@ -1739,12 +1562,15 @@ if (!NILP (ann)) { stderr_out ("<compiled-function from "); + fflush (stderr); debug_print_no_newline (ann); stderr_out (">"); + fflush (stderr); } else { stderr_out ("<compiled-function of unknown origin>"); + fflush (stderr); } } else @@ -1754,6 +1580,7 @@ bt = bt->next; } stderr_out ("]\n"); + fflush (stderr); } #endif /* debugging kludge */ @@ -1762,8 +1589,15 @@ void syms_of_print (void) { + defsymbol (&Qprint_escape_newlines, "print-escape-newlines"); + defsymbol (&Qprint_readably, "print-readably"); + defsymbol (&Qstandard_output, "standard-output"); +#ifdef LISP_FLOAT_TYPE + defsymbol (&Qfloat_output_format, "float-output-format"); +#endif + defsymbol (&Qprint_length, "print-length"); defsymbol (&Qprint_string_length, "print-string-length"); @@ -1780,6 +1614,7 @@ DEFSUBR (Fterpri); DEFSUBR (Fwrite_char); DEFSUBR (Falternate_debugging_output); + defsymbol (&Qalternate_debugging_output, "alternate-debugging-output"); DEFSUBR (Fexternal_debugging_output); DEFSUBR (Fopen_termscript); defsymbol (&Qexternal_debugging_output, "external-debugging-output"); @@ -1787,15 +1622,9 @@ } void -reinit_vars_of_print (void) +vars_of_print (void) { alternate_do_pointer = 0; -} - -void -vars_of_print (void) -{ - reinit_vars_of_print (); DEFVAR_LISP ("standard-output", &Vstandard_output /* Output stream `print' uses by default for outputting a character. diff -r 12e008d41344 -r 697ef44129c6 src/process-nt.c --- a/src/process-nt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/process-nt.c Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2000 Ben Wing. + Copyright (C) 1995, 1996 Ben Wing. This file is part of XEmacs. @@ -26,17 +26,18 @@ #include <config.h> #include "lisp.h" -#include "buffer.h" -#include "console-msw.h" #include "hash.h" #include "lstream.h" -#include "nt.h" #include "process.h" #include "procimpl.h" #include "sysdep.h" +#include <windows.h> +#ifndef __MINGW32__ #include <shellapi.h> +#else #include <errno.h> +#endif #include <signal.h> #ifdef HAVE_SOCKETS #include <winsock.h> @@ -45,29 +46,15 @@ /* Arbitrary size limit for code fragments passed to run_in_other_process */ #define FRAGMENT_CODE_SIZE 32 +/* Bound by winnt.el */ +Lisp_Object Qnt_quote_process_args; + /* Implementation-specific data. Pointed to by Lisp_Process->process_data */ struct nt_process_data { HANDLE h_process; - DWORD dwProcessId; - HWND hwnd; /* console window */ }; -/* Control how args are quoted to ensure correct parsing by child - process. */ -Lisp_Object Vmswindows_quote_process_args; - -/* Control whether create_child causes the process to inherit Emacs' - console window, or be given a new one of its own. The default is - nil, to allow multiple DOS programs to run on Win95. Having separate - consoles also allows Emacs to cleanly terminate process groups. */ -Lisp_Object Vmswindows_start_process_share_console; - -/* Control whether create_child cause the process to inherit Emacs' - error mode setting. The default is t, to minimize the possibility of - subprocesses blocking when accessing unmounted drives. */ -Lisp_Object Vmswindows_start_process_inherit_error_mode; - #define NT_DATA(p) ((struct nt_process_data*)((p)->process_data)) /*-----------------------------------------------------------------------*/ @@ -77,25 +64,10 @@ /* This one breaks process abstraction. Prototype is in console-msw.h, used by select_process method in event-msw.c */ HANDLE -get_nt_process_handle (Lisp_Process *p) +get_nt_process_handle (struct Lisp_Process *p) { return (NT_DATA (p)->h_process); } - -static struct Lisp_Process * -find_process_from_pid (DWORD pid) -{ - Lisp_Object tail, proc; - - for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) - { - proc = XCAR (tail); - if (NT_DATA (XPROCESS (proc))->dwProcessId == pid) - return XPROCESS (proc); - } - return 0; -} - /*-----------------------------------------------------------------------*/ /* Running remote threads. See Microsoft Systems Journal 1994 Number 5 */ @@ -196,7 +168,7 @@ LPVOID data, size_t data_size) { process_memory pm; - const size_t code_size = FRAGMENT_CODE_SIZE; + CONST size_t code_size = FRAGMENT_CODE_SIZE; /* Need at most 3 extra bytes of memory, for data alignment */ size_t total_size = code_size + data_size + 3; LPVOID remote_data; @@ -252,8 +224,6 @@ /* Sending signals */ /*-----------------------------------------------------------------------*/ -/* ---------------------------- the NT way ------------------------------- */ - /* * We handle the following signals: * @@ -317,34 +287,19 @@ * Return nonzero if successful. */ +/* This code assigns a return value of GetProcAddress to function pointers + of many different types. Instead of heavy obscure casts, we just disable + warnings about assignments to different function pointer types. */ +#pragma warning (disable : 4113) + static int -send_signal_the_nt_way (struct nt_process_data *cp, int pid, int signo) +send_signal (HANDLE h_process, int signo) { - HANDLE h_process; HMODULE h_kernel = GetModuleHandle ("kernel32"); - int close_process = 0; DWORD retval; assert (h_kernel != NULL); - if (cp) - { - pid = cp->dwProcessId; - h_process = cp->h_process; - } - else - { - close_process = 1; - /* Try to open the process with required privileges */ - h_process = OpenProcess (PROCESS_CREATE_THREAD - | PROCESS_QUERY_INFORMATION - | PROCESS_VM_OPERATION - | PROCESS_VM_WRITE, - FALSE, pid); - if (!h_process) - return 0; - } - switch (signo) { case SIGKILL: @@ -353,9 +308,7 @@ case SIGHUP: { sigkill_data d; - - d.adr_ExitProcess = - (void (WINAPI *) (UINT)) GetProcAddress (h_kernel, "ExitProcess"); + d.adr_ExitProcess = GetProcAddress (h_kernel, "ExitProcess"); assert (d.adr_ExitProcess); retval = run_in_other_process (h_process, (LPTHREAD_START_ROUTINE)sigkill_proc, @@ -366,7 +319,6 @@ { sigint_data d; d.adr_GenerateConsoleCtrlEvent = - (BOOL (WINAPI *) (DWORD, DWORD)) GetProcAddress (h_kernel, "GenerateConsoleCtrlEvent"); assert (d.adr_GenerateConsoleCtrlEvent); d.event = CTRL_C_EVENT; @@ -379,8 +331,6 @@ assert (0); } - if (close_process) - CloseHandle (h_process); return (int)retval > 0 ? 1 : 0; } @@ -395,7 +345,6 @@ assert (h_kernel != NULL); d.adr_SetConsoleCtrlHandler = - (BOOL (WINAPI *) (LPVOID, BOOL)) GetProcAddress (h_kernel, "SetConsoleCtrlHandler"); assert (d.adr_SetConsoleCtrlHandler); run_in_other_process (h_process, (LPTHREAD_START_ROUTINE)sig_enable_proc, @@ -404,214 +353,6 @@ #pragma warning (default : 4113) -/* ---------------------------- the 95 way ------------------------------- */ - -static BOOL CALLBACK -find_child_console (HWND hwnd, struct nt_process_data *cp) -{ - DWORD thread_id; - DWORD process_id; - - thread_id = GetWindowThreadProcessId (hwnd, &process_id); - if (process_id == cp->dwProcessId) - { - char window_class[32]; - - GetClassName (hwnd, window_class, sizeof (window_class)); - if (strcmp (window_class, - mswindows_windows9x_p () - ? "tty" - : "ConsoleWindowClass") == 0) - { - cp->hwnd = hwnd; - return FALSE; - } - } - /* keep looking */ - return TRUE; -} - -static int -send_signal_the_95_way (struct nt_process_data *cp, int pid, int signo) -{ - HANDLE h_process; - int close_process = 0; - int rc = 1; - - if (cp) - { - pid = cp->dwProcessId; - h_process = cp->h_process; - - /* Try to locate console window for process. */ - EnumWindows (find_child_console, (LPARAM) cp); - } - else - { - close_process = 1; - /* Try to open the process with required privileges */ - h_process = OpenProcess (PROCESS_TERMINATE, FALSE, pid); - if (!h_process) - return 0; - } - - if (signo == SIGINT) - { - if (NILP (Vmswindows_start_process_share_console) && cp && cp->hwnd) - { - BYTE control_scan_code = (BYTE) MapVirtualKey (VK_CONTROL, 0); - BYTE vk_break_code = VK_CANCEL; - BYTE break_scan_code = (BYTE) MapVirtualKey (vk_break_code, 0); - HWND foreground_window; - - if (break_scan_code == 0) - { - /* Fake Ctrl-C if we can't manage Ctrl-Break. */ - vk_break_code = 'C'; - break_scan_code = (BYTE) MapVirtualKey (vk_break_code, 0); - } - - foreground_window = GetForegroundWindow (); - if (foreground_window) - { - /* NT 5.0, and apparently also Windows 98, will not allow - a Window to be set to foreground directly without the - user's involvement. The workaround is to attach - ourselves to the thread that owns the foreground - window, since that is the only thread that can set the - foreground window. */ - DWORD foreground_thread, child_thread; - foreground_thread = - GetWindowThreadProcessId (foreground_window, NULL); - if (foreground_thread == GetCurrentThreadId () - || !AttachThreadInput (GetCurrentThreadId (), - foreground_thread, TRUE)) - foreground_thread = 0; - - child_thread = GetWindowThreadProcessId (cp->hwnd, NULL); - if (child_thread == GetCurrentThreadId () - || !AttachThreadInput (GetCurrentThreadId (), - child_thread, TRUE)) - child_thread = 0; - - /* Set the foreground window to the child. */ - if (SetForegroundWindow (cp->hwnd)) - { - /* Generate keystrokes as if user had typed Ctrl-Break or - Ctrl-C. */ - keybd_event (VK_CONTROL, control_scan_code, 0, 0); - keybd_event (vk_break_code, break_scan_code, - (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY), 0); - keybd_event (vk_break_code, break_scan_code, - (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY) - | KEYEVENTF_KEYUP, 0); - keybd_event (VK_CONTROL, control_scan_code, - KEYEVENTF_KEYUP, 0); - - /* Sleep for a bit to give time for Emacs frame to respond - to focus change events (if Emacs was active app). */ - Sleep (100); - - SetForegroundWindow (foreground_window); - } - /* Detach from the foreground and child threads now that - the foreground switching is over. */ - if (foreground_thread) - AttachThreadInput (GetCurrentThreadId (), - foreground_thread, FALSE); - if (child_thread) - AttachThreadInput (GetCurrentThreadId (), - child_thread, FALSE); - } - } - /* Ctrl-Break is NT equivalent of SIGINT. */ - else if (!GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, pid)) - { -#if 0 /* FSF Emacs */ - DebPrint (("sys_kill.GenerateConsoleCtrlEvent return %d " - "for pid %lu\n", GetLastError (), pid)); - errno = EINVAL; -#endif - rc = 0; - } - } - else - { - if (NILP (Vmswindows_start_process_share_console) && cp && cp->hwnd) - { -#if 1 - if (mswindows_windows9x_p ()) - { -/* - Another possibility is to try terminating the VDM out-right by - calling the Shell VxD (id 0x17) V86 interface, function #4 - "SHELL_Destroy_VM", ie. - - mov edx,4 - mov ebx,vm_handle - call shellapi - - First need to determine the current VM handle, and then arrange for - the shellapi call to be made from the system vm (by using - Switch_VM_and_callback). - - Could try to invoke DestroyVM through CallVxD. - -*/ -#if 0 - /* On Win95, posting WM_QUIT causes the 16-bit subsystem - to hang when cmdproxy is used in conjunction with - command.com for an interactive shell. Posting - WM_CLOSE pops up a dialog that, when Yes is selected, - does the same thing. TerminateProcess is also less - than ideal in that subprocesses tend to stick around - until the machine is shutdown, but at least it - doesn't freeze the 16-bit subsystem. */ - PostMessage (cp->hwnd, WM_QUIT, 0xff, 0); -#endif - if (!TerminateProcess (h_process, 0xff)) - { -#if 0 /* FSF Emacs */ - DebPrint (("sys_kill.TerminateProcess returned %d " - "for pid %lu\n", GetLastError (), pid)); - errno = EINVAL; -#endif - rc = 0; - } - } - else -#endif - PostMessage (cp->hwnd, WM_CLOSE, 0, 0); - } - /* Kill the process. On W32 this doesn't kill child processes - so it doesn't work very well for shells which is why it's not - used in every case. */ - else if (!TerminateProcess (h_process, 0xff)) - { -#if 0 /* FSF Emacs */ - DebPrint (("sys_kill.TerminateProcess returned %d " - "for pid %lu\n", GetLastError (), pid)); - errno = EINVAL; -#endif - rc = 0; - } - } - - if (close_process) - CloseHandle (h_process); - - return rc; -} - -/* -------------------------- all-OS functions ---------------------------- */ - -static int -send_signal (struct nt_process_data *cp, int pid, int signo) -{ - return send_signal_the_nt_way (cp, pid, signo) - || send_signal_the_95_way (cp, pid, signo); -} - /* * Signal error if SIGNO is not supported */ @@ -633,17 +374,17 @@ */ static void -nt_alloc_process_data (Lisp_Process *p) +nt_alloc_process_data (struct Lisp_Process *p) { p->process_data = xnew_and_zero (struct nt_process_data); } static void -nt_finalize_process_data (Lisp_Process *p, int for_disksave) +nt_finalize_process_data (struct Lisp_Process *p, int for_disksave) { assert (!for_disksave); - if (NT_DATA (p)->h_process) - CloseHandle (NT_DATA (p)->h_process); + if (NT_DATA(p)->h_process) + CloseHandle (NT_DATA(p)->h_process); } /* @@ -668,6 +409,8 @@ * must signal an error instead. */ +/* #### This function completely ignores Vprocess_environment */ + static void signal_cannot_launch (Lisp_Object image_file, DWORD err) { @@ -675,49 +418,14 @@ signal_simple_error_2 ("Error starting", image_file, lisp_strerror (errno)); } -static void -ensure_console_window_exists (void) -{ - if (mswindows_windows9x_p ()) - mswindows_hide_console (); -} - -int -compare_env (const void *strp1, const void *strp2) -{ - const char *str1 = *(const char**)strp1, *str2 = *(const char**)strp2; - - while (*str1 && *str2 && *str1 != '=' && *str2 != '=') - { - if ((*str1) > (*str2)) - return 1; - else if ((*str1) < (*str2)) - return -1; - str1++, str2++; - } - - if (*str1 == '=' && *str2 == '=') - return 0; - else if (*str1 == '=') - return -1; - else - return 1; -} - static int -nt_create_process (Lisp_Process *p, +nt_create_process (struct Lisp_Process *p, Lisp_Object *argv, int nargv, Lisp_Object program, Lisp_Object cur_dir) { - /* Synched up with sys_spawnve in FSF 20.6. Significantly different - but still synchable. */ - HANDLE hmyshove, hmyslurp, hprocin, hprocout, hprocerr; - Extbyte *command_line; + HANDLE hmyshove, hmyslurp, hprocin, hprocout; + LPTSTR command_line; BOOL do_io, windowed; - char *proc_env; - - /* No need to DOS-ize the filename; expand-file-name (called prior) - already does this. */ /* Find out whether the application is windowed or not */ { @@ -765,371 +473,51 @@ CreatePipe (&hprocin, &hmyshove, &sa, 0); CreatePipe (&hmyslurp, &hprocout, &sa, 0); - /* Duplicate the stdout handle for use as stderr */ - DuplicateHandle(GetCurrentProcess(), hprocout, GetCurrentProcess(), - &hprocerr, 0, TRUE, DUPLICATE_SAME_ACCESS); - /* Stupid Win32 allows to create a pipe with *both* ends either inheritable or not. We need process ends inheritable, and local ends not inheritable. */ - DuplicateHandle (GetCurrentProcess(), hmyshove, GetCurrentProcess(), - &htmp, 0, FALSE, - DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS); + DuplicateHandle (GetCurrentProcess(), hmyshove, GetCurrentProcess(), &htmp, + 0, FALSE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS); hmyshove = htmp; - DuplicateHandle (GetCurrentProcess(), hmyslurp, GetCurrentProcess(), - &htmp, 0, FALSE, - DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS); + DuplicateHandle (GetCurrentProcess(), hmyslurp, GetCurrentProcess(), &htmp, + 0, FALSE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS); hmyslurp = htmp; } - /* Convert an argv vector into Win32 style command line. */ + /* Convert an argv vector into Win32 style command line by a call to + lisp function `nt-quote-process-args' which see (in winnt.el)*/ { int i; - Bufbyte **quoted_args; - int is_dos_app, is_cygnus_app; - int is_command_shell; - int do_quoting = 0; - char escape_char = 0; - - nargv++; /* include program; we access argv offset by 1 below */ - quoted_args = alloca_array (Bufbyte *, nargv); - - /* Determine whether program is a 16-bit DOS executable, or a Win32 - executable that is implicitly linked to the Cygnus dll (implying it - was compiled with the Cygnus GNU toolchain and hence relies on - cygwin.dll to parse the command line - we use this to decide how to - escape quote chars in command line args that must be quoted). */ - mswindows_executable_type (XSTRING_DATA (program), - &is_dos_app, &is_cygnus_app); - - { - /* #### Bleeeeeeeeeeeeeeeeech!!!! The command shells appear to - use '^' as a quote character, at least under NT. #### I haven't - tested 95. If it allows no quoting conventions at all, set - escape_char to 0 and the code below will work. (e.g. NT tolerates - no quoting -- this command - - cmd /c "ls "/Program Files"" - - actually works.) */ - - struct gcpro gcpro1, gcpro2; - Lisp_Object progname = Qnil; - - GCPRO2 (program, progname); - progname = Ffile_name_nondirectory (program); - progname = Fdowncase (progname, Qnil); - - is_command_shell = - internal_equal (progname, build_string ("command.com"), 0) - || internal_equal (progname, build_string ("cmd.exe"), 0); - UNGCPRO; - } - -#if 0 - /* #### we need to port this. */ - /* On Windows 95, if cmdname is a DOS app, we invoke a helper - application to start it by specifying the helper app as cmdname, - while leaving the real app name as argv[0]. */ - if (is_dos_app) - { - cmdname = (char*) alloca (MAXPATHLEN); - if (egetenv ("CMDPROXY")) - strcpy ((char*)cmdname, egetenv ("CMDPROXY")); - else - { - strcpy ((char*)cmdname, XSTRING_DATA (Vinvocation_directory)); - strcat ((char*)cmdname, "cmdproxy.exe"); - } - } -#endif - - /* we have to do some conjuring here to put argv and envp into the - form CreateProcess wants... argv needs to be a space separated/null - terminated list of parameters, and envp is a null - separated/double-null terminated list of parameters. - - Additionally, zero-length args and args containing whitespace or - quote chars need to be wrapped in double quotes - for this to work, - embedded quotes need to be escaped as well. The aim is to ensure - the child process reconstructs the argv array we start with - exactly, so we treat quotes at the beginning and end of arguments - as embedded quotes. + Lisp_Object args_or_ret = Qnil; + struct gcpro gcpro1; - The Win32 GNU-based library from Cygnus doubles quotes to escape - them, while MSVC uses backslash for escaping. (Actually the MSVC - startup code does attempt to recognize doubled quotes and accept - them, but gets it wrong and ends up requiring three quotes to get a - single embedded quote!) So by default we decide whether to use - quote or backslash as the escape character based on whether the - binary is apparently a Cygnus compiled app. - - Note that using backslash to escape embedded quotes requires - additional special handling if an embedded quote is already - preceded by backslash, or if an arg requiring quoting ends with - backslash. In such cases, the run of escape characters needs to be - doubled. For consistency, we apply this special handling as long - as the escape character is not quote. - - Since we have no idea how large argv and envp are likely to be we - figure out list lengths on the fly and allocate them. */ - - if (!NILP (Vmswindows_quote_process_args)) - { - do_quoting = 1; - /* Override escape char by binding mswindows-quote-process-args to - desired character, or use t for auto-selection. */ - if (INTP (Vmswindows_quote_process_args)) - escape_char = (char) XINT (Vmswindows_quote_process_args); - else - escape_char = is_command_shell ? '^' : is_cygnus_app ? '"' : '\\'; - } - - /* do argv... */ - for (i = 0; i < nargv; ++i) - { - Bufbyte *targ = XSTRING_DATA (i == 0 ? program : argv[i - 1]); - Bufbyte *p = targ; - int need_quotes = 0; - int escape_char_run = 0; - int arglen = 0; - - if (*p == 0) - need_quotes = 1; - for ( ; *p; p++) - { - if (*p == '"') - { - /* allow for embedded quotes to be escaped */ - if (escape_char) - arglen++; - need_quotes = 1; - /* handle the case where the embedded quote is already escaped */ - if (escape_char_run > 0) - { - /* To preserve the arg exactly, we need to double the - preceding escape characters (plus adding one to - escape the quote character itself). */ - arglen += escape_char_run; - } - } - else if (*p == ' ' || *p == '\t') - { - need_quotes = 1; - } - - if (escape_char && *p == escape_char && escape_char != '"') - escape_char_run++; - else - escape_char_run = 0; - } - if (need_quotes) - { - arglen += 2; - /* handle the case where the arg ends with an escape char - we - must not let the enclosing quote be escaped. */ - if (escape_char_run > 0) - arglen += escape_char_run; - } - arglen += strlen (targ) + 1; - - quoted_args[i] = alloca_array (Bufbyte, arglen); - } + GCPRO1 (args_or_ret); for (i = 0; i < nargv; ++i) - { - Bufbyte *targ = XSTRING_DATA (i == 0 ? program : argv[i - 1]); - Bufbyte *p = targ; - int need_quotes = 0; - Bufbyte *parg = quoted_args[i]; - - if (*p == 0) - need_quotes = 1; - - if (do_quoting) - { - for ( ; *p; p++) - if (*p == ' ' || *p == '\t' || *p == '"') - need_quotes = 1; - } - if (need_quotes) - { - int escape_char_run = 0; - Bufbyte * first; - Bufbyte * last; + args_or_ret = Fcons (*argv++, args_or_ret); + args_or_ret = Fnreverse (args_or_ret); + args_or_ret = Fcons (program, args_or_ret); - p = targ; - first = p; - last = p + strlen (p) - 1; - *parg++ = '"'; -#if 0 - /* This version does not escape quotes if they occur at the - beginning or end of the arg - this could lead to incorrect - behavior when the arg itself represents a command line - containing quoted args. I believe this was originally done - as a hack to make some things work, before - `mswindows-quote-process-args' was added. */ - while (*p) - { - if (*p == '"' && p > first && p < last) - *parg++ = escape_char; /* escape embedded quotes */ - *parg++ = *p++; - } -#else - for ( ; *p; p++) - { - if (escape_char && *p == '"') - { - /* double preceding escape chars if any */ - while (escape_char_run > 0) - { - *parg++ = escape_char; - escape_char_run--; - } - /* escape all quote chars, even at beginning or end */ - *parg++ = escape_char; - } - *parg++ = *p; + args_or_ret = call1 (Qnt_quote_process_args, args_or_ret); - if (escape_char && *p == escape_char && escape_char != '"') - escape_char_run++; - else - escape_char_run = 0; - } - /* double escape chars before enclosing quote */ - while (escape_char_run > 0) - { - *parg++ = escape_char; - escape_char_run--; - } -#endif - *parg++ = '"'; - } - else - { - strcpy (parg, targ); - parg += strlen (targ); - } - *parg = '\0'; - } - - { - int total_cmdline_len = 0; - Extcount *extargcount = (Extcount *) alloca_array (Extcount, nargv); - Extbyte **extarg = (Extbyte **) alloca_array (Extbyte *, nargv); - Extbyte *command_ptr; - - for (i = 0; i < nargv; ++i) - { - TO_EXTERNAL_FORMAT (C_STRING, quoted_args[i], ALLOCA, - (extarg[i], extargcount[i]), Qmswindows_tstr); - /* account for space and terminating null */ - total_cmdline_len += extargcount[i] + EITCHAR_SIZE; - } + if (!STRINGP (args_or_ret)) + /* Luser wrote his/her own clever version */ + error ("Bogus return value from `nt-quote-process-args'"); - command_line = alloca_array (char, total_cmdline_len); - command_ptr = command_line; - for (i = 0; i < nargv; ++i) - { - memcpy (command_ptr, extarg[i], extargcount[i]); - command_ptr += extargcount[i]; - EICOPY_TCHAR (command_ptr, ' '); - command_ptr += EITCHAR_SIZE; - } - EICOPY_TCHAR (command_ptr, '\0'); - command_ptr += EITCHAR_SIZE; - } - } - /* Set `proc_env' to a nul-separated array of the strings in - Vprocess_environment terminated by 2 nuls. */ - - { - char **env; - REGISTER Lisp_Object tem; - REGISTER char **new_env; - REGISTER int new_length = 0, i, new_space; - char *penv; - - for (tem = Vprocess_environment; - (CONSP (tem) - && STRINGP (XCAR (tem))); - tem = XCDR (tem)) - new_length++; - - /* FSF adds an extra env var to hold the current process ID of the - Emacs process. Apparently this is used only by emacsserver.c, - which we have superseded to gnuserv.c. (#### Does it work under - MS Windows?) + command_line = alloca_array (char, (XSTRING_LENGTH (program) + + XSTRING_LENGTH (args_or_ret) + 2)); + strcpy (command_line, XSTRING_DATA (program)); + strcat (command_line, " "); + strcat (command_line, XSTRING_DATA (args_or_ret)); - sprintf (ppid_env_var_buffer, "EM_PARENT_PROCESS_ID=%d", - GetCurrentProcessId ()); - arglen += strlen (ppid_env_var_buffer) + 1; - numenv++; - */ - - /* new_length + 1 to include terminating 0. */ - env = new_env = alloca_array (char *, new_length + 1); - - /* Copy the Vprocess_environment strings into new_env. */ - for (tem = Vprocess_environment; - (CONSP (tem) - && STRINGP (XCAR (tem))); - tem = XCDR (tem)) - { - char **ep = env; - char *string = (char *) XSTRING_DATA (XCAR (tem)); - /* See if this string duplicates any string already in the env. - If so, don't put it in. - When an env var has multiple definitions, - we keep the definition that comes first in process-environment. */ - for (; ep != new_env; ep++) - { - char *p = *ep, *q = string; - while (1) - { - if (*q == 0) - /* The string is malformed; might as well drop it. */ - goto duplicate; - if (*q != *p) - break; - if (*q == '=') - goto duplicate; - p++, q++; - } - } - *new_env++ = string; - duplicate: ; - } - *new_env = 0; - - /* Sort the environment variables */ - new_length = new_env - env; - qsort (env, new_length, sizeof (char *), compare_env); - - /* Work out how much space to allocate */ - new_space = 0; - for (i = 0; i < new_length; i++) - { - new_space += strlen(env[i]) + 1; - } - new_space++; - - /* Allocate space and copy variables into it */ - penv = proc_env = (char*) alloca(new_space); - for (i = 0; i < new_length; i++) - { - strcpy(penv, env[i]); - penv += strlen(env[i]) + 1; - } - *penv = 0; + UNGCPRO; /* args_or_ret */ } - + /* Create process */ { STARTUPINFO si; PROCESS_INFORMATION pi; DWORD err; - DWORD flags; xzero (si); si.dwFlags = STARTF_USESHOWWINDOW; @@ -1138,24 +526,14 @@ { si.hStdInput = hprocin; si.hStdOutput = hprocout; - si.hStdError = hprocerr; + si.hStdError = hprocout; si.dwFlags |= STARTF_USESTDHANDLES; } - flags = CREATE_SUSPENDED; - if (mswindows_windows9x_p ()) - flags |= (!NILP (Vmswindows_start_process_share_console) - ? CREATE_NEW_PROCESS_GROUP - : CREATE_NEW_CONSOLE); - else - flags |= CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP; - if (NILP (Vmswindows_start_process_inherit_error_mode)) - flags |= CREATE_DEFAULT_ERROR_MODE; - - ensure_console_window_exists (); - - err = (CreateProcess (NULL, command_line, NULL, NULL, TRUE, flags, - proc_env, (char *) XSTRING_DATA (cur_dir), &si, &pi) + err = (CreateProcess (NULL, command_line, NULL, NULL, TRUE, + CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP + | CREATE_SUSPENDED, + NULL, (char *) XSTRING_DATA (cur_dir), &si, &pi) ? 0 : GetLastError ()); if (do_io) @@ -1163,7 +541,6 @@ /* These just have been inherited; we do not need a copy */ CloseHandle (hprocin); CloseHandle (hprocout); - CloseHandle (hprocerr); } /* Handle process creation failure */ @@ -1181,7 +558,6 @@ if (do_io) { NT_DATA(p)->h_process = pi.hProcess; - NT_DATA(p)->dwProcessId = pi.dwProcessId; init_process_io_handles (p, (void*)hmyslurp, (void*)hmyshove, 0); } else @@ -1197,7 +573,9 @@ ResumeThread (pi.hThread); CloseHandle (pi.hThread); - return ((int)pi.dwProcessId); + /* Hack to support Windows 95 negative pids */ + return ((int)pi.dwProcessId < 0 + ? -(int)pi.dwProcessId : (int)pi.dwProcessId); } } @@ -1210,7 +588,7 @@ */ static void -nt_update_status_if_terminated (Lisp_Process* p) +nt_update_status_if_terminated (struct Lisp_Process* p) { DWORD exit_code; if (GetExitCodeProcess (NT_DATA(p)->h_process, &exit_code) @@ -1244,20 +622,19 @@ static void nt_send_process (Lisp_Object proc, struct lstream* lstream) { - volatile Lisp_Object vol_proc = proc; - Lisp_Process *volatile p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); /* use a reasonable-sized buffer (somewhere around the size of the stream buffer) so as to avoid inundating the stream with blocked data. */ - Bufbyte chunkbuf[512]; + Bufbyte chunkbuf[128]; Bytecount chunklen; while (1) { - ssize_t writeret; + int writeret; - chunklen = Lstream_read (lstream, chunkbuf, 512); + chunklen = Lstream_read (lstream, chunkbuf, 128); if (chunklen <= 0) break; /* perhaps should abort() if < 0? This should never happen. */ @@ -1275,7 +652,7 @@ p->core_dumped = 0; p->tick++; process_tick++; - deactivate_process (*((Lisp_Object *) (&vol_proc))); + deactivate_process (proc); error ("Broken pipe error sending to process %s; closed it", XSTRING_DATA (p->name)); } @@ -1313,18 +690,18 @@ nt_kill_child_process (Lisp_Object proc, int signo, int current_group, int nomsg) { - Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); /* Signal error if SIGNO cannot be sent */ validate_signal_number (signo); /* Send signal */ - if (!send_signal (NT_DATA (p), 0, signo)) - signal_simple_error ("Cannot send signal to process", proc); + if (!send_signal (NT_DATA(p)->h_process, signo)) + error ("Cannot send signal to process"); } /* - * Kill any process in the system given its PID + * Kill any process in the system given its PID. * * Returns zero if a signal successfully sent, or * negative number upon failure @@ -1332,13 +709,26 @@ static int nt_kill_process_by_pid (int pid, int signo) { - struct Lisp_Process *p; - + HANDLE h_process; + int send_result; + /* Signal error if SIGNO cannot be sent */ validate_signal_number (signo); - p = find_process_from_pid (pid); - return send_signal (p ? NT_DATA (p) : 0, pid, signo) ? 0 : -1; + /* Try to open the process with required privileges */ + h_process = OpenProcess (PROCESS_CREATE_THREAD + | PROCESS_QUERY_INFORMATION + | PROCESS_VM_OPERATION + | PROCESS_VM_WRITE, + FALSE, pid); + if (h_process == NULL) + return -1; + + send_result = send_signal (h_process, signo); + + CloseHandle (h_process); + + return send_result ? 0 : -1; } /*-----------------------------------------------------------------------*/ @@ -1395,12 +785,6 @@ /* Ok, got an answer */ if (WSAGETASYNCERROR(msg.lParam) == NO_ERROR) success = 1; - else - { - warn_when_safe(Qstream, Qwarning, - "cannot get IP address for host \"%s\"", - XSTRING_DATA (host)); - } goto done; } else if (msg.message == WM_TIMER && msg.wParam == SOCK_TIMER_ID) @@ -1449,11 +833,9 @@ deactivate and close it via delete-process */ static void -nt_open_network_stream (Lisp_Object name, Lisp_Object host, - Lisp_Object service, - Lisp_Object protocol, void** vinfd, void** voutfd) +nt_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service, + Lisp_Object family, void** vinfd, void** voutfd) { - /* !!#### not Mule-ized */ struct sockaddr_in address; SOCKET s; int port; @@ -1461,8 +843,9 @@ CHECK_STRING (host); - if (!EQ (protocol, Qtcp)) - signal_simple_error ("Unsupported protocol", protocol); + if (!EQ (family, Qtcpip)) + error ("Unsupported protocol family \"%s\"", + string_data (symbol_name (XSYMBOL (family)))); if (INTP (service)) port = htons ((unsigned short) XINT (service)); @@ -1472,7 +855,7 @@ CHECK_STRING (service); svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); if (svc_info == 0) - signal_simple_error ("Unknown service", service); + error ("Unknown service \"%s\"", XSTRING_DATA (service)); port = svc_info->s_port; } @@ -1492,6 +875,7 @@ retval = connect (s, (struct sockaddr *) &address, sizeof (address)); if (retval != NO_ERROR && WSAGetLastError() != WSAEWOULDBLOCK) goto connect_failed; + /* Wait while connection is established */ while (1) { @@ -1534,20 +918,6 @@ connect_failed: closesocket (s); - if (INTP (service)) - { - warn_when_safe (Qstream, Qwarning, - "failure to open network stream to host \"%s\" for service \"%d\"", - XSTRING_DATA (host), - (unsigned short) XINT (service)); - } - else - { - warn_when_safe (Qstream, Qwarning, - "failure to open network stream to host \"%s\" for service \"%s\"", - XSTRING_DATA (host), - XSTRING_DATA (service)); - } report_file_error ("connection failed", list2 (host, name)); } @@ -1581,41 +951,10 @@ void syms_of_process_nt (void) { + defsymbol (&Qnt_quote_process_args, "nt-quote-process-args"); } void vars_of_process_nt (void) { - DEFVAR_LISP ("mswindows-quote-process-args", - &Vmswindows_quote_process_args /* -Non-nil enables quoting of process arguments to ensure correct parsing. -Because Windows does not directly pass argv arrays to child processes, -programs have to reconstruct the argv array by parsing the command -line string. For an argument to contain a space, it must be enclosed -in double quotes or it will be parsed as multiple arguments. - -If the value is a character, that character will be used to escape any -quote characters that appear, otherwise a suitable escape character -will be chosen based on the type of the program (normal or Cygwin). -*/ ); - Vmswindows_quote_process_args = Qt; - - DEFVAR_LISP ("mswindows-start-process-share-console", - &Vmswindows_start_process_share_console /* -When nil, new child processes are given a new console. -When non-nil, they share the Emacs console; this has the limitation of -allowing only only DOS subprocess to run at a time (whether started directly -or indirectly by Emacs), and preventing Emacs from cleanly terminating the -subprocess group, but may allow Emacs to interrupt a subprocess that doesn't -otherwise respond to interrupts from Emacs. -*/ ); - Vmswindows_start_process_share_console = Qnil; - - DEFVAR_LISP ("mswindows-start-process-inherit-error-mode", - &Vmswindows_start_process_inherit_error_mode /* - "When nil, new child processes revert to the default error mode. -When non-nil, they inherit their error mode setting from Emacs, which stops -them blocking when trying to access unmounted drives etc. -*/ ); - Vmswindows_start_process_inherit_error_mode = Qt; } diff -r 12e008d41344 -r 697ef44129c6 src/process-unix.c --- a/src/process-unix.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/process-unix.c Mon Aug 13 11:20:41 2007 +0200 @@ -28,9 +28,6 @@ Kirill M. Katsnelson <kkm@kis.ru>, so please bash him and not the original author(s) */ -/* The IPv6 support is derived from the code for GNU Emacs-20.3 - written by Wolfgang S. Rupprecht */ - #include <config.h> #if !defined (NO_SUBPROCESSES) @@ -127,7 +124,7 @@ to get rid of irrelevant descriptors. */ static int -close_process_descs_mapfun (const void* key, void* contents, void* arg) +close_process_descs_mapfun (CONST void* key, void* contents, void* arg) { Lisp_Object proc; CVOID_TO_LISP (proc, contents); @@ -215,11 +212,9 @@ end of the ptys. */ int failed_count = 0; #endif + int i; int fd; -#ifndef HAVE_GETPT - int i; int c; -#endif #ifdef PTY_ITERATION PTY_ITERATION @@ -266,7 +261,7 @@ #else sprintf (pty_name, "/dev/tty%c%x", c, i); #endif /* no PTY_TTY_NAME_SPRINTF */ -#if !defined(UNIPLUS) && !defined(HAVE_GETPT) +#ifndef UNIPLUS if (access (pty_name, 6) != 0) { close (fd); @@ -313,7 +308,6 @@ #ifdef HAVE_SOCKETS -#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)) static int get_internet_address (Lisp_Object host, struct sockaddr_in *address, Error_behavior errb) @@ -369,10 +363,9 @@ return 1; } -#endif /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */ static void -set_socket_nonblocking_maybe (int fd, int port, const char* proto) +set_socket_nonblocking_maybe (int fd, int port, CONST char* proto) { #ifdef PROCESS_IO_BLOCKING Lisp_Object tail; @@ -391,7 +384,7 @@ else continue; } - else if (INTP (tail_port) && (htons ((unsigned short) XINT (tail_port)) == port)) + else if ((INTP (tail_port)) && (htons ((unsigned short) XINT (tail_port)) == port)) break; } @@ -410,7 +403,7 @@ the numeric status that was returned by `wait'. */ static void -update_status_from_wait_code (Lisp_Process *p, int *w_fmh) +update_status_from_wait_code (struct Lisp_Process *p, int *w_fmh) { /* C compiler lossage when attempting to pass w directly */ int w = *w_fmh; @@ -525,7 +518,7 @@ } /* For any processes that have changed status and are recorded - and such, update the corresponding Lisp_Process. + and such, update the corresponding struct Lisp_Process. We separate this from record_exited_processes() so that we never have to call this function from within a signal handler. We block SIGCHLD in case record_exited_processes() @@ -654,7 +647,7 @@ */ static void -unix_alloc_process_data (Lisp_Process *p) +unix_alloc_process_data (struct Lisp_Process *p) { p->process_data = xnew (struct unix_process_data); @@ -670,9 +663,10 @@ */ static void -unix_mark_process_data (Lisp_Process *proc) +unix_mark_process_data (struct Lisp_Process *proc, + void (*markobj) (Lisp_Object)) { - mark_object (UNIX_DATA(proc)->tty_name); + markobj (UNIX_DATA(proc)->tty_name); } /* @@ -698,7 +692,7 @@ */ static void -unix_init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags) +unix_init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags) { UNIX_DATA(p)->infd = (int)in; } @@ -714,7 +708,7 @@ */ static int -unix_create_process (Lisp_Process *p, +unix_create_process (struct Lisp_Process *p, Lisp_Object *argv, int nargv, Lisp_Object program, Lisp_Object cur_dir) { @@ -779,7 +773,7 @@ UNIX_DATA(p)->subtty = forkin; { -#if !defined(CYGWIN) +#if !defined(__CYGWIN32__) /* child_setup must clobber environ on systems with true vfork. Protect it from permanent change. */ char **save_environ = environ; @@ -928,9 +922,7 @@ } new_argv[i + 1] = 0; - TO_EXTERNAL_FORMAT (LISP_STRING, cur_dir, - C_STRING_ALLOCA, current_dir, - Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (cur_dir, current_dir); child_setup (xforkin, xforkout, xforkout, new_argv, current_dir); } @@ -938,7 +930,7 @@ } /**** End of child code ****/ /**** Back in parent process ****/ -#if !defined(CYGWIN) +#if !defined(__CYGWIN32__) environ = save_environ; #endif } @@ -989,7 +981,7 @@ /* Return nonzero if this process is a ToolTalk connection. */ static int -unix_tooltalk_connection_p (Lisp_Process *p) +unix_tooltalk_connection_p (struct Lisp_Process *p) { return UNIX_DATA(p)->connected_via_filedesc_p; } @@ -997,7 +989,7 @@ /* This is called to set process' virtual terminal size */ static int -unix_set_window_size (Lisp_Process* p, int cols, int rows) +unix_set_window_size (struct Lisp_Process* p, int cols, int rows) { return set_window_size (UNIX_DATA(p)->infd, cols, rows); } @@ -1012,7 +1004,7 @@ #ifdef HAVE_WAITPID static void -unix_update_status_if_terminated (Lisp_Process* p) +unix_update_status_if_terminated (struct Lisp_Process* p) { int w; #ifdef SIGCHLD @@ -1038,7 +1030,7 @@ unix_reap_exited_processes (void) { int i; - Lisp_Process *p; + struct Lisp_Process *p; #ifndef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR record_exited_processes (1); @@ -1137,16 +1129,8 @@ /* Use volatile to protect variables from being clobbered by longjmp. */ SIGTYPE (*volatile old_sigpipe) (int) = 0; volatile Lisp_Object vol_proc = proc; - Lisp_Process *volatile p = XPROCESS (proc); - - /* #### JV: layering violation? + struct Lisp_Process *volatile p = XPROCESS (proc); - This function knows too much about the relation between the encodingstream - (DATA_OUTSTREAM) and te actual output stream p->output_stream. - - If encoding streams properly forwarded all calls, we could simply - use DATA_OUTSTREAM everywhere. */ - if (!SETJMP (send_process_frame)) { /* use a reasonable-sized buffer (somewhere around the size of the @@ -1157,7 +1141,7 @@ while (1) { - ssize_t writeret; + int writeret; chunklen = Lstream_read (lstream, chunkbuf, 512); if (chunklen <= 0) @@ -1181,9 +1165,6 @@ that may allow the program to finish doing output and read more. */ Faccept_process_output (Qnil, make_int (1), Qnil); - /* It could have *really* finished, deleting the process */ - if (NILP(p->pipe_outstream)) - return; old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); Lstream_flush (XLSTREAM (p->pipe_outstream)); @@ -1234,7 +1215,7 @@ Bufbyte eof_char = get_eof_char (XPROCESS (proc)); send_process (proc, Qnil, &eof_char, 0, 1); #else - send_process (proc, Qnil, (const Bufbyte *) "\004", 0, 1); + send_process (proc, Qnil, (CONST Bufbyte *) "\004", 0, 1); #endif return 1; } @@ -1254,7 +1235,7 @@ */ static USID -unix_deactivate_process (Lisp_Process *p) +unix_deactivate_process (struct Lisp_Process *p) { SIGTYPE (*old_sigpipe) (int) = 0; USID usid; @@ -1293,7 +1274,7 @@ int gid; int no_pgrp = 0; int kill_retval; - Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); if (!UNIX_DATA(p)->pty_flag) current_group = 0; @@ -1413,7 +1394,7 @@ */ static Lisp_Object -unix_get_tty_name (Lisp_Process *p) +unix_get_tty_name (struct Lisp_Process *p) { return UNIX_DATA (p)->tty_name; } @@ -1428,43 +1409,6 @@ static Lisp_Object unix_canonicalize_host_name (Lisp_Object host) { -#if defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO) - struct addrinfo hints, *res; - static char addrbuf[NI_MAXHOST]; - Lisp_Object canonname; - int retval; - char *ext_host; - - xzero (hints); - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = 0; - TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, ext_host, Qnative); - retval = getaddrinfo (ext_host, NULL, &hints, &res); - if (retval != 0) - { - char *gai_error; - - TO_INTERNAL_FORMAT (C_STRING, gai_strerror (retval), - C_STRING_ALLOCA, gai_error, - Qnative); - maybe_error (Qprocess, ERROR_ME_NOT, - "%s \"%s\"", gai_error, XSTRING_DATA (host)); - canonname = host; - } - else - { - int gni = getnameinfo (res->ai_addr, res->ai_addrlen, - addrbuf, sizeof(addrbuf), - NULL, 0, NI_NUMERICHOST); - canonname = gni ? host : build_ext_string (addrbuf, Qnative); - - freeaddrinfo (res); - } - - return canonname; -#else /* ! HAVE_GETADDRINFO */ struct sockaddr_in address; if (!get_internet_address (host, &address, ERROR_ME_NOT)) @@ -1475,7 +1419,6 @@ else /* #### any clue what to do here? */ return host; -#endif /* ! HAVE_GETADDRINFO */ } /* open a TCP network connection to a given HOST/SERVICE. Treated @@ -1486,278 +1429,104 @@ static void unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service, - Lisp_Object protocol, void** vinfd, void** voutfd) + Lisp_Object family, void** vinfd, void** voutfd) { - int inch; - int outch; - volatile int s; + struct sockaddr_in address; + int s, inch, outch; volatile int port; volatile int retry = 0; int retval; CHECK_STRING (host); - if (!EQ (protocol, Qtcp) && !EQ (protocol, Qudp)) - error ("Unsupported protocol \"%s\"", - string_data (symbol_name (XSYMBOL (protocol)))); + if (!EQ (family, Qtcpip)) + error ("Unsupported protocol family \"%s\"", + string_data (symbol_name (XSYMBOL (family)))); - { -#if defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO) - struct addrinfo hints, *res; - struct addrinfo * volatile lres; - char *portstring; - volatile int xerrno = 0; - volatile int failed_connect = 0; - char *ext_host; - /* - * Caution: service can either be a string or int. - * Convert to a C string for later use by getaddrinfo. - */ - if (INTP (service)) - { - char portbuf[128]; - snprintf (portbuf, sizeof (portbuf), "%ld", (long) XINT (service)); - portstring = portbuf; - port = htons ((unsigned short) XINT (service)); - } - else - { - CHECK_STRING (service); - TO_EXTERNAL_FORMAT (LISP_STRING, service, - C_STRING_ALLOCA, portstring, - Qnative); - port = 0; - } + if (INTP (service)) + port = htons ((unsigned short) XINT (service)); + else + { + struct servent *svc_info; + CHECK_STRING (service); + svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); + if (svc_info == 0) + error ("Unknown service \"%s\"", XSTRING_DATA (service)); + port = svc_info->s_port; + } - xzero (hints); - hints.ai_flags = 0; - hints.ai_family = AF_UNSPEC; - if (EQ (protocol, Qtcp)) - hints.ai_socktype = SOCK_STREAM; - else /* EQ (protocol, Qudp) */ - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = 0; - TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, ext_host, Qnative); - retval = getaddrinfo (ext_host, portstring, &hints, &res); - if (retval != 0) - { - char *gai_error; - - TO_INTERNAL_FORMAT (C_STRING, gai_strerror (retval), - C_STRING_ALLOCA, gai_error, - Qnative); - error ("%s/%s %s", XSTRING_DATA (host), portstring, gai_error); - } - - /* address loop */ - for (lres = res; lres ; lres = lres->ai_next) - { - if (EQ (protocol, Qtcp)) - s = socket (lres->ai_family, SOCK_STREAM, 0); - else /* EQ (protocol, Qudp) */ - s = socket (lres->ai_family, SOCK_DGRAM, 0); - - if (s < 0) - continue; + get_internet_address (host, &address, ERROR_ME); + address.sin_port = port; - /* Turn off interrupts here -- see comments below. There used to - be code which called bind_polling_period() to slow the polling - period down rather than turn it off, but that seems rather - bogus to me. Best thing here is to use a non-blocking connect - or something, to check for QUIT. */ - - /* Comments that are not quite valid: */ - - /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) - when connect is interrupted. So let's not let it get interrupted. - Note we do not turn off polling, because polling is only used - when not interrupt_input, and thus not normally used on the systems - which have this bug. On systems which use polling, there's no way - to quit if polling is turned off. */ + s = socket (address.sin_family, SOCK_STREAM, 0); + if (s < 0) + report_file_error ("error creating socket", list1 (name)); - /* Slow down polling. Some kernels have a bug which causes retrying - connect to fail after a connect. */ - - slow_down_interrupts (); - - loop: + /* Turn off interrupts here -- see comments below. There used to + be code which called bind_polling_period() to slow the polling + period down rather than turn it off, but that seems rather + bogus to me. Best thing here is to use a non-blocking connect + or something, to check for QUIT. */ - /* A system call interrupted with a SIGALRM or SIGIO comes back - here, with can_break_system_calls reset to 0. */ - SETJMP (break_system_call_jump); - if (QUITP) - { - speed_up_interrupts (); - REALLY_QUIT; - /* In case something really weird happens ... */ - slow_down_interrupts (); - } + /* Comments that are not quite valid: */ - /* Break out of connect with a signal (it isn't otherwise possible). - Thus you don't get screwed with a hung network. */ - can_break_system_calls = 1; - retval = connect (s, lres->ai_addr, lres->ai_addrlen); - can_break_system_calls = 0; - if (retval == -1) - { - xerrno = errno; - if (errno != EISCONN) - { - if (errno == EINTR) - goto loop; - if (errno == EADDRINUSE && retry < 20) - { - /* A delay here is needed on some FreeBSD systems, - and it is harmless, since this retrying takes time anyway - and should be infrequent. - `sleep-for' allowed for quitting this loop with interrupts - slowed down so it can't be used here. Async timers should - already be disabled at this point so we can use `sleep'. */ - sleep (1); - retry++; - goto loop; - } - } + /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) + when connect is interrupted. So let's not let it get interrupted. + Note we do not turn off polling, because polling is only used + when not interrupt_input, and thus not normally used on the systems + which have this bug. On systems which use polling, there's no way + to quit if polling is turned off. */ - failed_connect = 1; - close (s); + /* Slow down polling. Some kernels have a bug which causes retrying + connect to fail after a connect. */ - speed_up_interrupts (); - - continue; - } + slow_down_interrupts (); - if (port == 0) - { - int gni; - char servbuf[NI_MAXSERV]; - - if (EQ (protocol, Qtcp)) - gni = getnameinfo (lres->ai_addr, lres->ai_addrlen, - NULL, 0, servbuf, sizeof(servbuf), - NI_NUMERICSERV); - else /* EQ (protocol, Qudp) */ - gni = getnameinfo (lres->ai_addr, lres->ai_addrlen, - NULL, 0, servbuf, sizeof(servbuf), - NI_NUMERICSERV | NI_DGRAM); - - if (gni == 0) - port = strtol (servbuf, NULL, 10); - } - - break; - } /* address loop */ - - speed_up_interrupts (); - - freeaddrinfo (res); - if (s < 0) - { - errno = xerrno; + loop: - if (failed_connect) - report_file_error ("connection failed", list2 (host, name)); - else - report_file_error ("error creating socket", list1 (name)); - } -#else /* ! HAVE_GETADDRINFO */ - struct sockaddr_in address; - - if (INTP (service)) - port = htons ((unsigned short) XINT (service)); - else - { - struct servent *svc_info; - CHECK_STRING (service); - - if (EQ (protocol, Qtcp)) - svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); - else /* EQ (protocol, Qudp) */ - svc_info = getservbyname ((char *) XSTRING_DATA (service), "udp"); - - if (svc_info == 0) - error ("Unknown service \"%s\"", XSTRING_DATA (service)); - port = svc_info->s_port; - } - - get_internet_address (host, &address, ERROR_ME); - address.sin_port = port; - - if (EQ (protocol, Qtcp)) - s = socket (address.sin_family, SOCK_STREAM, 0); - else /* EQ (protocol, Qudp) */ - s = socket (address.sin_family, SOCK_DGRAM, 0); - - if (s < 0) - report_file_error ("error creating socket", list1 (name)); + /* A system call interrupted with a SIGALRM or SIGIO comes back + here, with can_break_system_calls reset to 0. */ + SETJMP (break_system_call_jump); + if (QUITP) + { + speed_up_interrupts (); + REALLY_QUIT; + /* In case something really weird happens ... */ + slow_down_interrupts (); + } - /* Turn off interrupts here -- see comments below. There used to - be code which called bind_polling_period() to slow the polling - period down rather than turn it off, but that seems rather - bogus to me. Best thing here is to use a non-blocking connect - or something, to check for QUIT. */ - - /* Comments that are not quite valid: */ - - /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) - when connect is interrupted. So let's not let it get interrupted. - Note we do not turn off polling, because polling is only used - when not interrupt_input, and thus not normally used on the systems - which have this bug. On systems which use polling, there's no way - to quit if polling is turned off. */ - - /* Slow down polling. Some kernels have a bug which causes retrying - connect to fail after a connect. */ - - slow_down_interrupts (); - - loop: - - /* A system call interrupted with a SIGALRM or SIGIO comes back - here, with can_break_system_calls reset to 0. */ - SETJMP (break_system_call_jump); - if (QUITP) - { - speed_up_interrupts (); - REALLY_QUIT; - /* In case something really weird happens ... */ - slow_down_interrupts (); - } + /* Break out of connect with a signal (it isn't otherwise possible). + Thus you don't get screwed with a hung network. */ + can_break_system_calls = 1; + retval = connect (s, (struct sockaddr *) &address, sizeof (address)); + can_break_system_calls = 0; + if (retval == -1 && errno != EISCONN) + { + int xerrno = errno; + if (errno == EINTR) + goto loop; + if (errno == EADDRINUSE && retry < 20) + { + /* A delay here is needed on some FreeBSD systems, + and it is harmless, since this retrying takes time anyway + and should be infrequent. + `sleep-for' allowed for quitting this loop with interrupts + slowed down so it can't be used here. Async timers should + already be disabled at this point so we can use `sleep'. */ + sleep (1); + retry++; + goto loop; + } - /* Break out of connect with a signal (it isn't otherwise possible). - Thus you don't get screwed with a hung network. */ - can_break_system_calls = 1; - retval = connect (s, (struct sockaddr *) &address, sizeof (address)); - can_break_system_calls = 0; - if (retval == -1 && errno != EISCONN) - { - int xerrno = errno; - if (errno == EINTR) - goto loop; - if (errno == EADDRINUSE && retry < 20) - { - /* A delay here is needed on some FreeBSD systems, - and it is harmless, since this retrying takes time anyway - and should be infrequent. - `sleep-for' allowed for quitting this loop with interrupts - slowed down so it can't be used here. Async timers should - already be disabled at this point so we can use `sleep'. */ - sleep (1); - retry++; - goto loop; - } + close (s); + + speed_up_interrupts (); - close (s); - - speed_up_interrupts (); + errno = xerrno; + report_file_error ("connection failed", list2 (host, name)); + } - errno = xerrno; - report_file_error ("connection failed", list2 (host, name)); - } - - speed_up_interrupts (); -#endif /* ! HAVE_GETADDRINFO */ - } + speed_up_interrupts (); inch = s; outch = dup (s); @@ -1776,7 +1545,7 @@ #ifdef HAVE_MULTICAST -/* Didier Verna <didier@xemacs.org> Nov. 28 1997. +/* Didier Verna <verna@inf.enst.fr> Nov. 28 1997. This function is similar to open-network-stream-internal, but provides a mean to open an UDP multicast connection instead of a TCP one. Like in the @@ -1855,7 +1624,7 @@ imr.imr_multiaddr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); imr.imr_interface.s_addr = htonl (INADDR_ANY); if (setsockopt (rs, IPPROTO_IP, IP_ADD_MEMBERSHIP, - &imr, sizeof (struct ip_mreq)) < 0) + (char *) &imr, sizeof (struct ip_mreq)) < 0) { close (ws); close (rs); @@ -1921,7 +1690,7 @@ /* scope */ if (setsockopt (ws, IPPROTO_IP, IP_MULTICAST_TTL, - &thettl, sizeof (thettl)) < 0) + (char *) &thettl, sizeof (thettl)) < 0) { close (rs); close (ws); diff -r 12e008d41344 -r 697ef44129c6 src/process.c --- a/src/process.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/process.c Mon Aug 13 11:20:41 2007 +0200 @@ -58,7 +58,7 @@ #include "systty.h" #include "syswait.h" -Lisp_Object Qprocessp, Qprocess_live_p; +Lisp_Object Qprocessp; /* Process methods */ struct process_methods the_process_methods; @@ -71,7 +71,7 @@ /* Qrun => Qopen, Qexit => Qclosed for "network connection" processes */ Lisp_Object Qopen, Qclosed; /* Protocol families */ -Lisp_Object Qtcp, Qudp; +Lisp_Object Qtcpip; #ifdef HAVE_MULTICAST Lisp_Object Qmulticast; /* Will be used for occasional warnings */ @@ -107,27 +107,26 @@ Lisp_Object Vprocess_list; extern Lisp_Object Vlisp_EXEC_SUFFIXES; -Lisp_Object Vnull_device; static Lisp_Object -mark_process (Lisp_Object obj) +mark_process (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Process *proc = XPROCESS (obj); - MAYBE_PROCMETH (mark_process_data, (proc)); - mark_object (proc->name); - mark_object (proc->command); - mark_object (proc->filter); - mark_object (proc->sentinel); - mark_object (proc->buffer); - mark_object (proc->mark); - mark_object (proc->pid); - mark_object (proc->pipe_instream); - mark_object (proc->pipe_outstream); + struct Lisp_Process *proc = XPROCESS (obj); + MAYBE_PROCMETH (mark_process_data, (proc, markobj)); + markobj (proc->name); + markobj (proc->command); + markobj (proc->filter); + markobj (proc->sentinel); + markobj (proc->buffer); + markobj (proc->mark); + markobj (proc->pid); + markobj (proc->pipe_instream); + markobj (proc->pipe_outstream); #ifdef FILE_CODING - mark_object (proc->coding_instream); - mark_object (proc->coding_outstream); + markobj (proc->coding_instream); + markobj (proc->coding_outstream); #endif return proc->status_symbol; } @@ -135,7 +134,7 @@ static void print_process (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Process *proc = XPROCESS (obj); + struct Lisp_Process *proc = XPROCESS (obj); if (print_readably) error ("printing unreadable object #<process %s>", @@ -148,10 +147,10 @@ else { int netp = network_connection_p (obj); - write_c_string ((netp ? GETTEXT ("#<network connection ") : + write_c_string (((netp) ? GETTEXT ("#<network connection ") : GETTEXT ("#<process ")), printcharfun); print_internal (proc->name, printcharfun, 1); - write_c_string ((netp ? " " : " pid "), printcharfun); + write_c_string (((netp) ? " " : " pid "), printcharfun); print_internal (proc->pid, printcharfun, 1); write_c_string (" state:", printcharfun); print_internal (proc->status_symbol, printcharfun, 1); @@ -161,7 +160,7 @@ } #ifdef HAVE_WINDOW_SYSTEM -extern void debug_process_finalization (Lisp_Process *p); +extern void debug_process_finalization (struct Lisp_Process *p); #endif /* HAVE_WINDOW_SYSTEM */ static void @@ -169,7 +168,7 @@ { /* #### this probably needs to be tied into the tty event loop */ /* #### when there is one */ - Lisp_Process *p = (Lisp_Process *) header; + struct Lisp_Process *p = (struct Lisp_Process *) header; #ifdef HAVE_WINDOW_SYSTEM if (!for_disksave) { @@ -187,7 +186,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("process", process, mark_process, print_process, finalize_process, - 0, 0, 0, Lisp_Process); + 0, 0, struct Lisp_Process); /************************************************************************/ /* basic process accessors */ @@ -197,7 +196,8 @@ directly to the child process, rather than en/decoding FILE_CODING streams */ void -get_process_streams (Lisp_Process *p, Lisp_Object *instr, Lisp_Object *outstr) +get_process_streams (struct Lisp_Process *p, + Lisp_Object *instr, Lisp_Object *outstr) { assert (p); assert (NILP (p->pipe_instream) || LSTREAMP(p->pipe_instream)); @@ -206,14 +206,14 @@ *outstr = p->pipe_outstream; } -Lisp_Process * +struct Lisp_Process * get_process_from_usid (USID usid) { - const void *vval; + CONST void *vval; assert (usid != USID_ERROR && usid != USID_DONTHASH); - if (gethash ((const void*)usid, usid_to_process, &vval)) + if (gethash ((CONST void*)usid, usid_to_process, &vval)) { Lisp_Object proc; CVOID_TO_LISP (proc, vval); @@ -224,19 +224,19 @@ } int -get_process_selected_p (Lisp_Process *p) +get_process_selected_p (struct Lisp_Process *p) { return p->selected; } void -set_process_selected_p (Lisp_Process *p, int selected_p) +set_process_selected_p (struct Lisp_Process *p, int selected_p) { p->selected = !!selected_p; } int -connected_via_filedesc_p (Lisp_Process *p) +connected_via_filedesc_p (struct Lisp_Process *p) { return MAYBE_INT_PROCMETH (tooltalk_connection_p, (p)); } @@ -245,7 +245,7 @@ int network_connection_p (Lisp_Object process) { - return CONSP (XPROCESS (process)->pid); + return GC_CONSP (XPROCESS (process)->pid); } #endif @@ -257,14 +257,6 @@ return PROCESSP (obj) ? Qt : Qnil; } -DEFUN ("process-live-p", Fprocess_live_p, 1, 1, 0, /* -Return t if OBJECT is a process that is alive. -*/ - (obj)) -{ - return PROCESSP (obj) && PROCESS_LIVE_P (XPROCESS (obj)) ? Qt : Qnil; -} - DEFUN ("process-list", Fprocess_list, 0, 0, 0, /* Return a list of all processes. */ @@ -280,7 +272,7 @@ { Lisp_Object tail; - if (PROCESSP (name)) + if (GC_PROCESSP (name)) return name; if (!gc_in_progress) @@ -288,7 +280,7 @@ of a signal or crash. */ CHECK_STRING (name); - for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) + for (tail = Vprocess_list; GC_CONSP (tail); tail = XCDR (tail)) { Lisp_Object proc = XCAR (tail); QUIT; @@ -306,18 +298,18 @@ { Lisp_Object buf, tail, proc; - if (NILP (name)) return Qnil; + if (GC_NILP (name)) return Qnil; buf = Fget_buffer (name); - if (NILP (buf)) return Qnil; + if (GC_NILP (buf)) return Qnil; - for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) + for (tail = Vprocess_list; GC_CONSP (tail); tail = XCDR (tail)) { /* jwz: do not quit here - it isn't necessary, as there is no way for Vprocess_list to get circular or overwhelmingly long, and this function is called from layout_mode_element under redisplay. */ /* QUIT; */ proc = XCAR (tail); - if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) + if (GC_PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) return proc; } return Qnil; @@ -339,28 +331,28 @@ /* This may be called during a GC from process_send_signal() from kill_buffer_processes() if emacs decides to abort(). */ - if (PROCESSP (name)) + if (GC_PROCESSP (name)) return name; - if (STRINGP (name)) + if (GC_STRINGP (name)) { obj = Fget_process (name); - if (NILP (obj)) + if (GC_NILP (obj)) obj = Fget_buffer (name); - if (NILP (obj)) + if (GC_NILP (obj)) error ("Process %s does not exist", XSTRING_DATA (name)); } - else if (NILP (name)) + else if (GC_NILP (name)) obj = Fcurrent_buffer (); else obj = name; /* Now obj should be either a buffer object or a process object. */ - if (BUFFERP (obj)) + if (GC_BUFFERP (obj)) { proc = Fget_buffer_process (obj); - if (NILP (proc)) + if (GC_NILP (proc)) error ("Buffer %s has no process", XSTRING_DATA (XBUFFER(obj)->name)); } else @@ -424,7 +416,8 @@ { Lisp_Object val, name1; int i; - Lisp_Process *p = alloc_lcrecord_type (Lisp_Process, &lrecord_process); + struct Lisp_Process *p = + alloc_lcrecord_type (struct Lisp_Process, &lrecord_process); /* If name is already in use, modify it until it is unused. */ name1 = name; @@ -471,7 +464,7 @@ } void -init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags) +init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags) { USID usid = event_stream_create_stream_pair (in, out, &p->pipe_instream, &p->pipe_outstream, @@ -484,7 +477,7 @@ { Lisp_Object proc = Qnil; XSETPROCESS (proc, p); - puthash ((const void*)usid, LISP_TO_VOID (proc), usid_to_process); + puthash ((CONST void*)usid, LISP_TO_VOID (proc), usid_to_process); } MAYBE_PROCMETH (init_process_io_handles, (p, in, out, flags)); @@ -506,7 +499,7 @@ create_process (Lisp_Object process, Lisp_Object *argv, int nargv, Lisp_Object program, Lisp_Object cur_dir) { - Lisp_Process *p = XPROCESS (process); + struct Lisp_Process *p = XPROCESS (process); int pid; /* *_create_process may change status_symbol, if the process @@ -517,7 +510,7 @@ pid = PROCMETH (create_process, (p, argv, nargv, program, cur_dir)); p->pid = make_int (pid); - if (PROCESS_LIVE_P (p)) + if (!NILP(p->pipe_instream)) event_stream_select_process (p); } @@ -666,7 +659,7 @@ DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 5, 0, /* Open a TCP connection for a service to a host. -Return a subprocess-object to represent the connection. +Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. NAME is name for process. It is modified if necessary to make it unique. @@ -678,18 +671,10 @@ Third arg is name of the host to connect to, or its IP address. Fourth arg SERVICE is name of the service desired, or an integer specifying a port number to connect to. -Fifth argument PROTOCOL is a network protocol. Currently 'tcp - (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 -`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' -are usually fine.) Note further that UDP protocol does not guard against -lost packets. +Fifth argument FAMILY is a protocol family. When omitted, 'tcp/ip +\(Internet protocol family TCP/IP) is assumed. */ - (name, buffer, host, service, protocol)) + (name, buffer, host, service, family)) { /* !!#### This function has not been Mule-ized */ /* This function can GC */ @@ -697,17 +682,17 @@ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, ngcpro1; void *inch, *outch; - GCPRO5 (name, buffer, host, service, protocol); + GCPRO5 (name, buffer, host, service, family); CHECK_STRING (name); - if (NILP(protocol)) - protocol = Qtcp; + if (NILP(family)) + family = Qtcpip; else - CHECK_SYMBOL (protocol); + CHECK_SYMBOL (family); /* Since this code is inside HAVE_SOCKETS, existence of open_network_stream is mandatory */ - PROCMETH (open_network_stream, (name, host, service, protocol, + PROCMETH (open_network_stream, (name, host, service, family, &inch, &outch)); if (!NILP (buffer)) @@ -731,7 +716,7 @@ DEFUN ("open-multicast-group-internal", Fopen_multicast_group_internal, 5, 5, 0, /* Open a multicast connection on the specified dest/port/ttl. -Return a subprocess-object to represent the connection. +Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. NAME is name for process. It is modified if necessary to make it unique. @@ -820,7 +805,7 @@ Bytecount nbytes, nchars; Bufbyte chars[1024]; Lisp_Object outstream; - Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); /* If there is a lot of output from the subprocess, the loop in execute_internal_event() might call read_process_output() more @@ -830,7 +815,7 @@ Really, the loop in execute_internal_event() should check itself for a process-filter change, like in status_notify(); but the struct Lisp_Process is not exported outside of this file. */ - if (!PROCESS_LIVE_P (p)) + if (NILP(p->pipe_instream)) return -1; /* already closed */ if (!NILP (p->filter) && (p->filter_does_read)) @@ -965,7 +950,7 @@ void send_process (Lisp_Object proc, - Lisp_Object relocatable, const Bufbyte *nonrelocatable, + Lisp_Object relocatable, CONST Bufbyte *nonrelocatable, int start, int len) { /* This function can GC */ @@ -980,7 +965,7 @@ if (nonrelocatable) lstream = make_fixed_buffer_input_stream (nonrelocatable + start, len); - else if (BUFFERP (relocatable)) + else if (GC_BUFFERP (relocatable)) lstream = make_lisp_buffer_input_stream (XBUFFER (relocatable), start, start + len, 0); else @@ -1039,7 +1024,7 @@ set_process_filter (Lisp_Object proc, Lisp_Object filter, int filter_does_read) { CHECK_PROCESS (proc); - if (PROCESS_LIVE_P (XPROCESS (proc))) { + if (PROCESS_LIVE_P (proc)) { if (EQ (filter, Qt)) event_stream_unselect_process (XPROCESS (proc)); else @@ -1074,25 +1059,24 @@ return XPROCESS (proc)->filter; } -DEFUN ("process-send-region", Fprocess_send_region, 3, 4, 0, /* -Send current contents of the region between START and END as input to PROCESS. +DEFUN ("process-send-region", Fprocess_send_region, 3, 3, 0, /* +Send current contents of region as input to PROCESS. PROCESS may be a process name or an actual process. -BUFFER specifies the buffer to look in; if nil, the current buffer is used. +Called from program, takes three arguments, PROCESS, START and END. If the region is more than 500 or so characters long, it is sent in several bunches. This may happen even for shorter regions. Output from processes can arrive in between bunches. */ - (process, start, end, buffer)) + (process, start, end)) { /* This function can GC */ Lisp_Object proc = get_process (process); Bufpos st, en; - struct buffer *buf = decode_buffer (buffer, 0); + + get_buffer_range_char (current_buffer, start, end, &st, &en, 0); - XSETBUFFER (buffer, buf); - get_buffer_range_char (buf, start, end, &st, &en, 0); - - send_process (proc, buffer, 0, st, en - st); + send_process (proc, Fcurrent_buffer (), 0, + st, en - st); return Qnil; } @@ -1129,7 +1113,6 @@ (process)) { process = get_process (process); - CHECK_LIVE_PROCESS (process); return decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream) ); } @@ -1139,7 +1122,6 @@ (process)) { process = get_process (process); - CHECK_LIVE_PROCESS (process); return encoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_outstream)); } @@ -1149,7 +1131,6 @@ (process)) { process = get_process (process); - CHECK_LIVE_PROCESS (process); return Fcons (decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream)), encoding_stream_coding_system @@ -1164,8 +1145,6 @@ { codesys = Fget_coding_system (codesys); process = get_process (process); - CHECK_LIVE_PROCESS (process); - set_decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream), codesys); return Qnil; @@ -1179,8 +1158,6 @@ { codesys = Fget_coding_system (codesys); process = get_process (process); - CHECK_LIVE_PROCESS (process); - set_encoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_outstream), codesys); return Qnil; @@ -1189,8 +1166,6 @@ DEFUN ("set-process-coding-system", Fset_process_coding_system, 1, 3, 0, /* Set coding-systems of PROCESS to DECODING and ENCODING. -DECODING will be used to decode subprocess output and ENCODING to -encode subprocess input. */ (process, decoding, encoding)) { @@ -1212,7 +1187,7 @@ static Lisp_Object exec_sentinel_unwind (Lisp_Object datum) { - Lisp_Cons *d = XCONS (datum); + struct Lisp_Cons *d = XCONS (datum); XPROCESS (d->car)->sentinel = d->cdr; free_cons (d); return Qnil; @@ -1223,7 +1198,7 @@ { /* This function can GC */ int speccount = specpdl_depth (); - Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); Lisp_Object sentinel = p->sentinel; if (NILP (sentinel)) @@ -1268,13 +1243,13 @@ } -const char * +CONST char * signal_name (int signum) { if (signum >= 0 && signum < NSIG) - return (const char *) sys_siglist[signum]; + return (CONST char *) sys_siglist[signum]; - return (const char *) GETTEXT ("unknown signal"); + return (CONST char *) GETTEXT ("unknown signal"); } void @@ -1293,7 +1268,7 @@ /* Return a string describing a process status list. */ static Lisp_Object -status_message (Lisp_Process *p) +status_message (struct Lisp_Process *p) { Lisp_Object symbol = p->status_symbol; int code = p->exit_code; @@ -1377,7 +1352,7 @@ for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) { Lisp_Object proc = XCAR (tail); - Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); /* p->tick is also volatile. Same thing as above applies. */ int this_process_tick; @@ -1544,7 +1519,9 @@ if (network_connection_p (proc)) error ("Network connection %s is not a subprocess", XSTRING_DATA (XPROCESS(proc)->name)); - CHECK_LIVE_PROCESS (proc); + if (!PROCESS_LIVE_P (proc)) + error ("Process %s is not active", + XSTRING_DATA (XPROCESS(proc)->name)); MAYBE_PROCMETH (kill_child_process, (proc, signo, current_group, nomsg)); } @@ -1645,7 +1622,7 @@ name = string_data (XSYMBOL (sigcode)->name); #define handle_signal(signal) \ - else if (!strcmp ((const char *) name, #signal)) \ + else if (!strcmp ((CONST char *) name, #signal)) \ XSETINT (sigcode, signal) if (0) @@ -1834,7 +1811,7 @@ void deactivate_process (Lisp_Object proc) { - Lisp_Process *p = XPROCESS (proc); + struct Lisp_Process *p = XPROCESS (proc); USID usid; /* It's possible that we got as far in the process-creation @@ -1861,7 +1838,7 @@ p->pipe_outstream); if (usid != USID_DONTHASH) - remhash ((const void*)usid, usid_to_process); + remhash ((CONST void*)usid, usid_to_process); p->pipe_instream = Qnil; p->pipe_outstream = Qnil; @@ -1887,7 +1864,7 @@ (proc)) { /* This function can GC */ - Lisp_Process *p; + struct Lisp_Process *p; proc = get_process (proc); p = XPROCESS (proc); if (network_connection_p (proc)) @@ -1898,7 +1875,7 @@ p->tick++; process_tick++; } - else if (PROCESS_LIVE_P (p)) + else if (!NILP(p->pipe_instream)) { Fkill_process (proc, Qnil); /* Do this now, since remove_process will make sigchld_handler do nothing. */ @@ -1921,16 +1898,16 @@ { Lisp_Object tail; - for (tail = Vprocess_list; CONSP (tail); + for (tail = Vprocess_list; GC_CONSP (tail); tail = XCDR (tail)) { Lisp_Object proc = XCAR (tail); - if (PROCESSP (proc) - && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))) + if (GC_PROCESSP (proc) + && (GC_NILP (buffer) || GC_EQ (XPROCESS (proc)->buffer, buffer))) { if (network_connection_p (proc)) Fdelete_process (proc); - else if (PROCESS_LIVE_P (XPROCESS (proc))) + else if (!NILP (XPROCESS (proc)->pipe_instream)) process_send_signal (proc, SIGHUP, 0, 1); } } @@ -1992,24 +1969,19 @@ void syms_of_process (void) { - INIT_LRECORD_IMPLEMENTATION (process); - defsymbol (&Qprocessp, "processp"); - defsymbol (&Qprocess_live_p, "process-live-p"); defsymbol (&Qrun, "run"); defsymbol (&Qstop, "stop"); defsymbol (&Qopen, "open"); defsymbol (&Qclosed, "closed"); - defsymbol (&Qtcp, "tcp"); - defsymbol (&Qudp, "udp"); + defsymbol (&Qtcpip, "tcp/ip"); #ifdef HAVE_MULTICAST defsymbol(&Qmulticast, "multicast"); /* Used for occasional warnings */ #endif DEFSUBR (Fprocessp); - DEFSUBR (Fprocess_live_p); DEFSUBR (Fget_process); DEFSUBR (Fget_buffer_process); DEFSUBR (Fdelete_process); @@ -2076,22 +2048,6 @@ delete_exited_processes = 1; - DEFVAR_CONST_LISP ("null-device", &Vnull_device /* -Name of the null device, which differs from system to system. -The null device is a filename that acts as a sink for arbitrary amounts of -data, which is discarded, or as a source for a zero-length file. -It is available on all the systems that we currently support, but with -different names (typically either `/dev/null' or `nul'). - -Note that there is also a /dev/zero on most modern Unix versions (including -Cygwin), which acts like /dev/null when used as a sink, but as a source -it sends a non-ending stream of zero bytes. It's used most often along -with memory-mapping. We don't provide a Lisp variable for this because -the operations needing this are lower level than what ELisp programs -typically do, and in any case no equivalent exists under native MS Windows. -*/ ); - Vnull_device = build_string (NULL_DEVICE); - DEFVAR_LISP ("process-connection-type", &Vprocess_connection_type /* Control type of device used to communicate with subprocesses. Values are nil to use a pipe, or t or `pty' to use a pty. diff -r 12e008d41344 -r 697ef44129c6 src/process.h --- a/src/process.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/process.h Mon Aug 13 11:20:41 2007 +0200 @@ -18,8 +18,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef INCLUDED_process_h_ -#define INCLUDED_process_h_ +#ifndef _XEMACS_PROCESS_H_ +#define _XEMACS_PROCESS_H_ #if defined (NO_SUBPROCESSES) #undef XPROCESS @@ -37,21 +37,16 @@ #else /* not NO_SUBPROCESSES */ -/* struct Lisp_Process is defined in procimpl.h; only process-*.c need - to know about the guts of it. */ +/* Only process.c needs to know about the guts of this */ +struct Lisp_Process; -DECLARE_LRECORD (process, Lisp_Process); -#define XPROCESS(x) XRECORD (x, process, Lisp_Process) +DECLARE_LRECORD (process, struct Lisp_Process); +#define XPROCESS(x) XRECORD (x, process, struct Lisp_Process) #define XSETPROCESS(x, p) XSETRECORD (x, p, process) #define PROCESSP(x) RECORDP (x, process) +#define GC_PROCESSP(x) GC_RECORDP (x, process) #define CHECK_PROCESS(x) CHECK_RECORD (x, process) -#define PROCESS_LIVE_P(x) (!NILP ((x)->pipe_instream)) - -#define CHECK_LIVE_PROCESS(x) do { \ - CHECK_PROCESS (x); \ - if (! PROCESS_LIVE_P (XPROCESS (x))) \ - dead_wrong_type_argument (Qprocess_live_p, (x)); \ -} while (0) +#define PROCESS_LIVE_P(x) (!NILP (XPROCESS(x)->pipe_instream)) #ifdef emacs @@ -62,7 +57,7 @@ Lisp_Object buffer, Lisp_Object infd, Lisp_Object outfd); -int connected_via_filedesc_p (Lisp_Process *p); +int connected_via_filedesc_p (struct Lisp_Process *p); void kill_buffer_processes (Lisp_Object buffer); void close_process_descs (void); @@ -74,7 +69,7 @@ extern volatile int synch_process_alive; /* Nonzero => this is a string explaining death of synchronous subprocess. */ -extern const char *synch_process_death; +extern CONST char *synch_process_death; /* If synch_process_death is zero, this is exit code of synchronous subprocess. */ @@ -85,12 +80,12 @@ Lisp_Object status_symbol, int exit_code, int core_dumped); -void get_process_streams (Lisp_Process *p, +void get_process_streams (struct Lisp_Process *p, Lisp_Object *instr, Lisp_Object *outstr); -int get_process_selected_p (Lisp_Process *p); -void set_process_selected_p (Lisp_Process *p, int selected_p); +int get_process_selected_p (struct Lisp_Process *p); +void set_process_selected_p (struct Lisp_Process *p, int selected_p); -Lisp_Process *get_process_from_usid (USID usid); +struct Lisp_Process *get_process_from_usid (USID usid); #ifdef HAVE_SOCKETS int network_connection_p (Lisp_Object process); @@ -98,7 +93,7 @@ #define network_connection_p(x) 0 #endif -extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcp, Qudp; +extern Lisp_Object Qclosed, Qmulticast, Qopen, Qrun, Qstop, Qtcpip; extern Lisp_Object Vprocess_connection_type, Vprocess_list; /* Report all recent events of a change in process status @@ -109,17 +104,17 @@ void deactivate_process (Lisp_Object proc); -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT int #else void #endif child_setup (int in, int out, int err, - char **new_argv, const char *current_dir); + char **new_argv, CONST char *current_dir); Charcount read_process_output (Lisp_Object proc); -const char *signal_name (int signum); +CONST char *signal_name (int signum); Lisp_Object canonicalize_host_name (Lisp_Object host); @@ -139,13 +134,4 @@ #endif /* emacs */ -#ifdef HAVE_GETPT -#define PTY_ITERATION -#define PTY_OPEN \ - if ((fd = getpt()) < 0 || grantpt (fd) < 0 || unlockpt (fd) < 0) \ - return -1; -#define PTY_NAME_SPRINTF -#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ptsname (fd)); -#endif - -#endif /* INCLUDED_process_h_ */ +#endif /* _XEMACS_PROCESS_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/procimpl.h --- a/src/procimpl.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/procimpl.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,10 @@ process-unix.c, process-msw.c etc. The Lisp_Process structure and other contents of this file is not exported to the rest of the world */ -#ifndef INCLUDED_procimpl_h_ -#define INCLUDED_procimpl_h_ +#ifndef _XEMACS_PROCIMPL_H_ +#define _XEMACS_PROCIMPL_H_ + +struct Lisp_Process; /* * Structure which keeps methods of the process implementation. @@ -35,19 +37,21 @@ struct process_methods { - void (*mark_process_data) (Lisp_Process *proc); - void (*print_process_data) (Lisp_Process *proc, Lisp_Object printcharfun); - void (*finalize_process_data) (Lisp_Process *proc, int for_disksave); - void (*alloc_process_data) (Lisp_Process *p); - void (*init_process_io_handles) (Lisp_Process *p, + void (*mark_process_data) (struct Lisp_Process *proc, + void (*markobj) (Lisp_Object)); + void (*print_process_data) (struct Lisp_Process *proc, + Lisp_Object printcharfun); + void (*finalize_process_data) (struct Lisp_Process *proc, int for_disksave); + void (*alloc_process_data) (struct Lisp_Process *p); + void (*init_process_io_handles) (struct Lisp_Process *p, void* in, void* out, int flags); - int (*create_process) (Lisp_Process *p, + int (*create_process) (struct Lisp_Process *p, Lisp_Object *argv, int nargv, Lisp_Object program, Lisp_Object cur_dir); - int (*tooltalk_connection_p) (Lisp_Process *p); + int (*tooltalk_connection_p) (struct Lisp_Process *p); #ifdef HAVE_SOCKETS void (*open_network_stream) (Lisp_Object name, Lisp_Object host, - Lisp_Object service, Lisp_Object protocol, + Lisp_Object service, Lisp_Object family, void** vinfd, void** voutfd); #ifdef HAVE_MULTICAST void (*open_multicast_group) (Lisp_Object name, Lisp_Object dest, @@ -56,16 +60,16 @@ #endif /* HAVE_MULTICAST */ #endif /* HAVE_SOCKETS */ Lisp_Object (*canonicalize_host_name) (Lisp_Object host); - int (*set_window_size) (Lisp_Process* p, int height, int width); + int (*set_window_size) (struct Lisp_Process* p, int height, int width); void (*send_process) (Lisp_Object proc, struct lstream* lstream); void (*reap_exited_processes) (void); - void (*update_status_if_terminated) (Lisp_Process* p); + void (*update_status_if_terminated) (struct Lisp_Process* p); void (*kill_child_process) (Lisp_Object proc, int signo, int current_group, int nomsg); int (*kill_process_by_pid) (int pid, int sigcode); int (*process_send_eof) (Lisp_Object proc); - Lisp_Object (*get_tty_name) (Lisp_Process *p); - USID (*deactivate_process) (Lisp_Process *p); + Lisp_Object (*get_tty_name) (struct Lisp_Process *p); + USID (*deactivate_process) (struct Lisp_Process *p); void (*init_process) (void); }; @@ -155,7 +159,7 @@ /* Random externs from process.c */ extern Lisp_Object Qrun, Qstop, Qopen, Qclosed; -extern Lisp_Object Qtcp, Qudp; +extern Lisp_Object Qtcpip; extern Lisp_Object Vprocess_connection_type; extern Lisp_Object Vprocess_list; @@ -174,11 +178,11 @@ #endif /* PROCESS_IO_BLOCKING */ Lisp_Object make_process_internal (Lisp_Object name); -void init_process_io_handles (Lisp_Process *p, void* in, +void init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags); void send_process (Lisp_Object proc, Lisp_Object relocatable, - const Bufbyte *nonrelocatable, + CONST Bufbyte *nonrelocatable, int start, int len); -#endif /* INCLUDED_procimpl_h_ */ +#endif /* _XEMACS_PROCIMPL_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/profile.c --- a/src/profile.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/profile.c Mon Aug 13 11:20:41 2007 +0200 @@ -57,7 +57,7 @@ even be useful to provide a way to turn on only one profiling mechanism, but I haven't done so yet. --hniksic */ -static struct hash_table *big_profile_table; +struct hash_table *big_profile_table; Lisp_Object Vcall_count_profile_table; int default_profiling_interval; @@ -68,10 +68,10 @@ and is not set the whole time we're in redisplay. */ int profiling_redisplay_flag; -static Lisp_Object QSin_redisplay; -static Lisp_Object QSin_garbage_collection; -static Lisp_Object QSprocessing_events_at_top_level; -static Lisp_Object QSunknown; +Lisp_Object QSin_redisplay; +Lisp_Object QSin_garbage_collection; +Lisp_Object QSprocessing_events_at_top_level; +Lisp_Object QSunknown; /* We use inside_profiling to prevent the handler from writing to the table while another routine is operating on it. We also set @@ -119,10 +119,9 @@ { fun = *backtrace_list->function; - if (!SYMBOLP (fun) - && !COMPILED_FUNCTIONP (fun) - && !SUBRP (fun) - && !CONSP (fun)) + if (!GC_SYMBOLP (fun) && + !GC_COMPILED_FUNCTIONP (fun) && + !GC_SUBRP (fun)) fun = QSunknown; } else @@ -135,14 +134,14 @@ lose because of this. Even worse, if the memory allocation fails, the `error' generated whacks everything hard. */ long count; - const void *vval; + CONST void *vval; if (gethash (LISP_TO_VOID (fun), big_profile_table, &vval)) count = (long) vval; else count = 0; count++; - vval = (const void *) count; + vval = (CONST void *) count; puthash (LISP_TO_VOID (fun), (void *) vval, big_profile_table); } @@ -226,7 +225,7 @@ }; static int -get_profiling_info_maphash (const void *void_key, +get_profiling_info_maphash (CONST void *void_key, void *void_val, void *void_closure) { @@ -263,26 +262,34 @@ return closure.accum; } +struct mark_profiling_info_closure +{ + void (*markfun) (Lisp_Object); +}; + static int -mark_profiling_info_maphash (const void *void_key, +mark_profiling_info_maphash (CONST void *void_key, void *void_val, void *void_closure) { Lisp_Object key; CVOID_TO_LISP (key, void_key); - mark_object (key); + (((struct mark_profiling_info_closure *) void_closure)->markfun) (key); return 0; } void -mark_profiling_info (void) +mark_profiling_info (void (*markfun) (Lisp_Object)) { - /* This function does not GC */ + /* This function does not GC (if markfun doesn't) */ + struct mark_profiling_info_closure closure; + + closure.markfun = markfun; if (big_profile_table) { inside_profiling = 1; - maphash (mark_profiling_info_maphash, big_profile_table, 0); + maphash (mark_profiling_info_maphash, big_profile_table, &closure); inside_profiling = 0; } } diff -r 12e008d41344 -r 697ef44129c6 src/ralloc.c --- a/src/ralloc.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/ralloc.c Mon Aug 13 11:20:41 2007 +0200 @@ -53,6 +53,8 @@ /* Unconditionally use unsigned char * for this. */ typedef unsigned char *POINTER; +typedef unsigned long SIZE; + #ifdef DOUG_LEA_MALLOC #define M_TOP_PAD -2 #include <malloc.h> @@ -67,6 +69,7 @@ #include <stddef.h> +typedef size_t SIZE; typedef void *POINTER; #include <unistd.h> @@ -76,6 +79,7 @@ #endif /* emacs. */ void init_ralloc (void); +#define safe_bcopy(x, y, z) memmove (y, x, z) #define NIL ((POINTER) 0) @@ -94,7 +98,7 @@ /* Declarations for working with the malloc, ralloc, and system breaks. */ /* Function to set the real break value. */ -static POINTER (*real_morecore) (ptrdiff_t size); +static POINTER (*real_morecore) (long size); /* The break value, as seen by malloc (). */ static POINTER virtual_break_value; @@ -181,7 +185,7 @@ struct bp *prev; POINTER *variable; POINTER data; - size_t size; + SIZE size; POINTER new_data; /* temporarily used for relocation */ struct heap *heap; /* Heap this bloc is in. */ } *bloc_ptr; @@ -241,10 +245,10 @@ allocate the memory. */ static POINTER -obtain (POINTER address, size_t size) +obtain (POINTER address, SIZE size) { heap_ptr heap; - size_t already_available; + SIZE already_available; /* Find the heap that ADDRESS falls within. */ for (heap = last_heap; heap; heap = heap->prev) @@ -271,7 +275,7 @@ if (heap == NIL_HEAP) { POINTER new = (*real_morecore)(0); - size_t get; + SIZE get; already_available = (char *)last_heap->end - (char *)address; @@ -321,7 +325,7 @@ If we could not allocate the space, return zero. */ static POINTER -get_more_space (size_t size) +get_more_space (SIZE size) { POINTER ptr = break_value; if (obtain (size)) @@ -335,7 +339,7 @@ If SIZE is more than a page, return the space to the system. */ static void -relinquish (void) +relinquish () { register heap_ptr h; int excess = 0; @@ -384,7 +388,7 @@ long r_alloc_size_in_use (void); long -r_alloc_size_in_use (void) +r_alloc_size_in_use () { return break_value - virtual_break_value; } @@ -416,7 +420,7 @@ memory for the new block. */ static bloc_ptr -get_bloc (size_t size) +get_bloc (SIZE size) { register bloc_ptr new_bloc; register heap_ptr heap; @@ -497,7 +501,7 @@ if (heap == NIL_HEAP) { register bloc_ptr tb = b; - register size_t s = 0; + register SIZE s = 0; /* Add up the size of all the following blocs. */ while (tb != NIL_BLOC) @@ -624,12 +628,12 @@ that come after BLOC in memory. */ static int -resize_bloc (bloc_ptr bloc, size_t size) +resize_bloc (bloc_ptr bloc, SIZE size) { register bloc_ptr b; heap_ptr heap; POINTER address; - size_t old_size; + SIZE old_size; /* No need to ever call this if arena is frozen, bug somewhere! */ if (r_alloc_freeze_level) @@ -677,7 +681,7 @@ } else { - memmove (b->new_data, b->data, b->size); + safe_bcopy (b->data, b->new_data, b->size); *b->variable = b->data = b->new_data; } } @@ -688,7 +692,7 @@ } else { - memmove (bloc->new_data, bloc->data, old_size); + safe_bcopy (bloc->data, bloc->new_data, old_size); memset (bloc->new_data + old_size, 0, size - old_size); *bloc->variable = bloc->data = bloc->new_data; } @@ -704,7 +708,7 @@ } else { - memmove (b->new_data, b->data, b->size); + safe_bcopy (b->data, b->new_data, b->size); *b->variable = b->data = b->new_data; } } @@ -786,9 +790,9 @@ __morecore hook values - in particular, __default_morecore in the GNU malloc package. */ -POINTER r_alloc_sbrk (ptrdiff_t size); +POINTER r_alloc_sbrk (long size); POINTER -r_alloc_sbrk (ptrdiff_t size) +r_alloc_sbrk (long size) { register bloc_ptr b; POINTER address; @@ -809,7 +813,7 @@ not always find a space which is contiguous to the previous. */ POINTER new_bloc_start; heap_ptr h = first_heap; - size_t get = ROUNDUP (size); + SIZE get = ROUNDUP (size); address = (POINTER) ROUNDUP (virtual_break_value); @@ -858,7 +862,7 @@ header. */ for (b = last_bloc; b != NIL_BLOC; b = b->prev) { - memmove (b->new_data, b->data, b->size); + safe_bcopy (b->data, b->new_data, b->size); *b->variable = b->data = b->new_data; } @@ -889,7 +893,7 @@ } else /* size < 0 */ { - size_t excess = (char *)first_heap->bloc_start + SIZE excess = (char *)first_heap->bloc_start - ((char *)virtual_break_value + size); address = virtual_break_value; @@ -904,7 +908,7 @@ for (b = first_bloc; b != NIL_BLOC; b = b->next) { - memmove (b->new_data, b->data, b->size); + safe_bcopy (b->data, b->new_data, b->size); *b->variable = b->data = b->new_data; } } @@ -937,9 +941,9 @@ If we can't allocate the necessary memory, set *PTR to zero, and return zero. */ -POINTER r_alloc (POINTER *ptr, size_t size); +POINTER r_alloc (POINTER *ptr, SIZE size); POINTER -r_alloc (POINTER *ptr, size_t size) +r_alloc (POINTER *ptr, SIZE size) { bloc_ptr new_bloc; @@ -996,9 +1000,9 @@ If more memory cannot be allocated, then leave *PTR unchanged, and return zero. */ -POINTER r_re_alloc (POINTER *ptr, size_t size); +POINTER r_re_alloc (POINTER *ptr, SIZE size); POINTER -r_re_alloc (POINTER *ptr, size_t size) +r_re_alloc (POINTER *ptr, SIZE size) { register bloc_ptr bloc; @@ -1078,7 +1082,7 @@ void r_alloc_thaw (void); void -r_alloc_thaw (void) +r_alloc_thaw () { if (! r_alloc_initialized) @@ -1088,7 +1092,7 @@ abort (); /* This frees all unused blocs. It is not too inefficient, as the resize - and memmove is done only once. Afterwards, all unreferenced blocs are + and bcopy is done only once. Afterwards, all unreferenced blocs are already shrunk to zero size. */ if (!r_alloc_freeze_level) { @@ -1105,11 +1109,14 @@ /* The hook `malloc' uses for the function which gets more space from the system. */ #ifndef DOUG_LEA_MALLOC -extern POINTER (*__morecore) (ptrdiff_t size); +extern POINTER (*__morecore) (long size); #endif /* Initialize various things for memory allocation. */ +#define SET_FUN_PTR(fun_ptr, fun_val) \ + (*((void **) (&fun_ptr)) = ((void *) (fun_val))) + void init_ralloc (void) { @@ -1117,12 +1124,8 @@ return; r_alloc_initialized = 1; - real_morecore = (POINTER (*) (ptrdiff_t)) __morecore; - __morecore = -#ifdef __GNUC__ - (__typeof__ (__morecore)) -#endif - r_alloc_sbrk; + SET_FUN_PTR (real_morecore, __morecore); + SET_FUN_PTR (__morecore, r_alloc_sbrk); first_heap = last_heap = &heap_base; first_heap->next = first_heap->prev = NIL_HEAP; @@ -1169,25 +1172,21 @@ Emacs. This is needed when using Doug Lea's malloc from GNU libc. */ void r_alloc_reinit (void); void -r_alloc_reinit (void) +r_alloc_reinit () { /* Only do this if the hook has been reset, so that we don't get an infinite loop, in case Emacs was linked statically. */ - if ( (POINTER (*) (ptrdiff_t)) __morecore != r_alloc_sbrk) + if ( ((void*) __morecore) != (void *) (r_alloc_sbrk)) { - real_morecore = (POINTER (*) (ptrdiff_t)) __morecore; - __morecore = -#ifdef __GNUC__ - (__typeof__ (__morecore)) -#endif - r_alloc_sbrk; + SET_FUN_PTR (real_morecore, __morecore); + SET_FUN_PTR (__morecore, r_alloc_sbrk); } } #if 0 #ifdef DEBUG void -r_alloc_check (void) +r_alloc_check () { int found = 0; heap_ptr h, ph = 0; @@ -1233,7 +1232,7 @@ { assert (b->prev == pb); assert ((POINTER) MEM_ROUNDUP (b->data) == b->data); - assert ((size_t) MEM_ROUNDUP (b->size) == b->size); + assert ((SIZE) MEM_ROUNDUP (b->size) == b->size); ph = 0; for (h = first_heap; h; h = h->next) @@ -1319,7 +1318,7 @@ #include <stdio.h> typedef void *VM_ADDR; /* VM addresses */ -static const VM_ADDR VM_FAILURE_ADDR = (VM_ADDR) -1; /* mmap returns this when it fails. */ +static CONST VM_ADDR VM_FAILURE_ADDR = (VM_ADDR) -1; /* mmap returns this when it fails. */ /* Configuration for relocating allocator. */ @@ -1693,10 +1692,10 @@ static void Addr_Block_initialize(void); /* Get a suitable VM_ADDR via mmap */ -static VM_ADDR New_Addr_Block (size_t sz); +static VM_ADDR New_Addr_Block( SIZE sz ); /* Free a VM_ADDR allocated via New_Addr_Block */ -static void Free_Addr_Block (VM_ADDR addr, size_t sz); +static void Free_Addr_Block( VM_ADDR addr, SIZE sz ); #ifdef MMAP_GENERATE_ADDRESSES /* Implementation of the three calls for address picking when XEmacs is incharge */ @@ -1707,7 +1706,7 @@ typedef struct addr_chain { POINTER addr; - size_t sz; + SIZE sz; addr_status flag; struct addr_chain *next; } ADDRESS_BLOCK, *ADDRESS_CHAIN; @@ -1719,21 +1718,19 @@ WRT the addition/deletion of address blocks because of the assert in Coalesce() and the strict ordering of blocks by their address */ -static void -Addr_Block_initialize (void) +static void Addr_Block_initialize() { MEMMETER( MVAL( M_Addrlist_Size )++) addr_chain = (ADDRESS_CHAIN) UNDERLYING_MALLOC( sizeof( ADDRESS_BLOCK )); addr_chain->next = 0; /* Last block in chain */ addr_chain->sz = 0x0c000000; /* Size */ - addr_chain->addr = (POINTER) (0x04000000); + addr_chain->addr = (POINTER) (0x04000000 | DATA_SEG_BITS); addr_chain->flag = empty; } /* Coalesce address blocks if they are contiguous. Only empty and unavailable slots are coalesced. */ -static void -Coalesce_Addr_Blocks (void) +static void Coalesce_Addr_Blocks() { ADDRESS_CHAIN p; for (p = addr_chain; p; p = p->next) @@ -1759,8 +1756,7 @@ } /* Get an empty address block of specified size. */ -static VM_ADDR -New_Addr_Block (size_t sz) +static VM_ADDR New_Addr_Block( SIZE sz ) { ADDRESS_CHAIN p = addr_chain; VM_ADDR new_addr = VM_FAILURE_ADDR; @@ -1797,8 +1793,7 @@ /* Free an address block. We mark the block as being empty, and attempt to do any coalescing that may have resulted from this. */ -static void -Free_Addr_Block (VM_ADDR addr, size_t sz) +static void Free_Addr_Block( VM_ADDR addr, SIZE sz ) { ADDRESS_CHAIN p = addr_chain; for (; p; p = p->next ) @@ -1819,21 +1814,18 @@ /* This is an alternate (simpler) implementation in cases where the address is picked by the kernel. */ -static void -Addr_Block_initialize (void) +static void Addr_Block_initialize(void) { /* Nothing. */ } -static VM_ADDR -New_Addr_Block (size_t sz) +static VM_ADDR New_Addr_Block( SIZE sz ) { return mmap (0, sz, PROT_READ|PROT_WRITE, MAP_FLAGS, DEV_ZERO_FD, 0 ); } -static void -Free_Addr_Block (VM_ADDR addr, size_t sz) +static void Free_Addr_Block( VM_ADDR addr, SIZE sz ) { munmap ((caddr_t) addr, sz ); } @@ -1844,13 +1836,13 @@ /* IMPLEMENTATION OF EXPORTED RELOCATOR INTERFACE */ /* - r_alloc (POINTER, SIZE): Allocate a relocatable area with the start + r_alloc( POINTER, SIZE ): Allocate a relocatable area with the start address aliased to the first parameter. */ -POINTER r_alloc (POINTER *ptr, size_t size); +POINTER r_alloc (POINTER *ptr, SIZE size); POINTER -r_alloc (POINTER *ptr, size_t size) +r_alloc (POINTER *ptr, SIZE size) { MMAP_HANDLE mh; @@ -1865,8 +1857,8 @@ mh = new_mmap_handle( size ); if (mh) { - size_t hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0); - size_t mmapped_size = ROUNDUP( size + hysteresis ); + SIZE hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0); + SIZE mmapped_size = ROUNDUP( size + hysteresis ); MEMMETER( MVAL(M_Map)++ ) MEMMETER( MVAL(M_Pages_Map) += (mmapped_size/page_size) ) MEMMETER( MVAL(M_Wastage) += mmapped_size - size ) @@ -1934,9 +1926,9 @@ If more memory cannot be allocated, then leave *PTR unchanged, and return zero. */ -POINTER r_re_alloc (POINTER *ptr, size_t sz); +POINTER r_re_alloc (POINTER *ptr, SIZE sz); POINTER -r_re_alloc (POINTER *ptr, size_t sz) +r_re_alloc (POINTER *ptr, SIZE sz) { if (r_alloc_initialized == 0) { @@ -1952,8 +1944,8 @@ } else { - size_t hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0); - size_t actual_sz = ROUNDUP( sz + hysteresis ); + SIZE hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0); + SIZE actual_sz = ROUNDUP( sz + hysteresis ); MMAP_HANDLE h = find_mmap_handle( ptr ); VM_ADDR new_vm_addr; diff -r 12e008d41344 -r 697ef44129c6 src/rangetab.c --- a/src/rangetab.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/rangetab.c Mon Aug 13 11:20:41 2007 +0200 @@ -41,20 +41,20 @@ is not hard but just requires moving that stuff out of that file. */ static Lisp_Object -mark_range_table (Lisp_Object obj) +mark_range_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Range_Table *rt = XRANGE_TABLE (obj); + struct Lisp_Range_Table *rt = XRANGE_TABLE (obj); int i; for (i = 0; i < Dynarr_length (rt->entries); i++) - mark_object (Dynarr_at (rt->entries, i).val); + markobj (Dynarr_at (rt->entries, i).val); return Qnil; } static void print_range_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Range_Table *rt = XRANGE_TABLE (obj); + struct Lisp_Range_Table *rt = XRANGE_TABLE (obj); char buf[200]; int i; @@ -77,8 +77,8 @@ static int range_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Range_Table *rt1 = XRANGE_TABLE (obj1); - Lisp_Range_Table *rt2 = XRANGE_TABLE (obj2); + struct Lisp_Range_Table *rt1 = XRANGE_TABLE (obj1); + struct Lisp_Range_Table *rt2 = XRANGE_TABLE (obj2); int i; if (Dynarr_length (rt1->entries) != Dynarr_length (rt2->entries)) @@ -107,7 +107,7 @@ static unsigned long range_table_hash (Lisp_Object obj, int depth) { - Lisp_Range_Table *rt = XRANGE_TABLE (obj); + struct Lisp_Range_Table *rt = XRANGE_TABLE (obj); int i; int size = Dynarr_length (rt->entries); unsigned long hash = size; @@ -132,36 +132,10 @@ return hash; } -static const struct lrecord_description rte_description_1[] = { - { XD_LISP_OBJECT, offsetof (range_table_entry, val) }, - { XD_END } -}; - -static const struct struct_description rte_description = { - sizeof (range_table_entry), - rte_description_1 -}; - -static const struct lrecord_description rted_description_1[] = { - XD_DYNARR_DESC (range_table_entry_dynarr, &rte_description), - { XD_END } -}; - -static const struct struct_description rted_description = { - sizeof (range_table_entry_dynarr), - rted_description_1 -}; - -static const struct lrecord_description range_table_description[] = { - { XD_STRUCT_PTR, offsetof (Lisp_Range_Table, entries), 1, &rted_description }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("range-table", range_table, mark_range_table, print_range_table, 0, range_table_equal, range_table_hash, - range_table_description, - Lisp_Range_Table); + struct Lisp_Range_Table); /************************************************************************/ /* Range table operations */ @@ -170,7 +144,7 @@ #ifdef ERROR_CHECK_TYPECHECK static void -verify_range_table (Lisp_Range_Table *rt) +verify_range_table (struct Lisp_Range_Table *rt) { int i; @@ -233,8 +207,8 @@ ()) { Lisp_Object obj; - Lisp_Range_Table *rt = alloc_lcrecord_type (Lisp_Range_Table, - &lrecord_range_table); + struct Lisp_Range_Table *rt = alloc_lcrecord_type (struct Lisp_Range_Table, + &lrecord_range_table); rt->entries = Dynarr_new (range_table_entry); XSETRANGE_TABLE (obj, rt); return obj; @@ -246,13 +220,13 @@ */ (old_table)) { - Lisp_Range_Table *rt, *rtnew; + struct Lisp_Range_Table *rt, *rtnew; Lisp_Object obj; CHECK_RANGE_TABLE (old_table); rt = XRANGE_TABLE (old_table); - rtnew = alloc_lcrecord_type (Lisp_Range_Table, &lrecord_range_table); + rtnew = alloc_lcrecord_type (struct Lisp_Range_Table, &lrecord_range_table); rtnew->entries = Dynarr_new (range_table_entry); Dynarr_add_many (rtnew->entries, Dynarr_atp (rt->entries, 0), @@ -267,7 +241,7 @@ */ (pos, table, default_)) { - Lisp_Range_Table *rt; + struct Lisp_Range_Table *rt; CHECK_RANGE_TABLE (table); rt = XRANGE_TABLE (table); @@ -284,7 +258,7 @@ { int i; int insert_me_here = -1; - Lisp_Range_Table *rt = XRANGE_TABLE (table); + struct Lisp_Range_Table *rt = XRANGE_TABLE (table); /* Now insert in the proper place. This gets tricky because we may be overlapping one or more existing ranges and need @@ -443,47 +417,10 @@ DEFUN ("map-range-table", Fmap_range_table, 2, 2, 0, /* Map FUNCTION over entries in TABLE, calling it with three args, the beginning and end of the range and the corresponding value. - -Results are guaranteed to be correct (i.e. each entry processed -exactly once) if FUNCTION modifies or deletes the current entry -(i.e. passes the current range to `put-range-table' or -`remove-range-table'), but not otherwise. */ (function, table)) { - Lisp_Range_Table *rt; - int i; - - CHECK_RANGE_TABLE (table); - CHECK_FUNCTION (function); - - rt = XRANGE_TABLE (table); - - /* Do not "optimize" by pulling out the length computation below! - FUNCTION may have changed the table. */ - for (i = 0; i < Dynarr_length (rt->entries); i++) - { - struct range_table_entry *entry = Dynarr_atp (rt->entries, i); - EMACS_INT first, last; - Lisp_Object args[4]; - int oldlen; - - again: - first = entry->first; - last = entry->last; - oldlen = Dynarr_length (rt->entries); - args[0] = function; - args[1] = make_int (first); - args[2] = make_int (last); - args[3] = entry->val; - Ffuncall (countof (args), args); - /* Has FUNCTION removed the entry? */ - if (oldlen > Dynarr_length (rt->entries) - && i < Dynarr_length (rt->entries) - && (first != entry->first || last != entry->last)) - goto again; - } - + error ("not yet implemented"); return Qnil; } @@ -741,8 +678,6 @@ void syms_of_rangetab (void) { - INIT_LRECORD_IMPLEMENTATION (range_table); - defsymbol (&Qrange_tablep, "range-table-p"); defsymbol (&Qrange_table, "range-table"); diff -r 12e008d41344 -r 697ef44129c6 src/rangetab.h --- a/src/rangetab.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/rangetab.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Extracted from rangetab.c by O. Galibert, 1998. */ -#ifndef INCLUDED_rangetab_h_ -#define INCLUDED_rangetab_h_ +#ifndef _XEMACS_RANGETAB_H_ +#define _XEMACS_RANGETAB_H_ typedef struct range_table_entry range_table_entry; struct range_table_entry @@ -44,12 +44,13 @@ struct lcrecord_header header; range_table_entry_dynarr *entries; }; -typedef struct Lisp_Range_Table Lisp_Range_Table; -DECLARE_LRECORD (range_table, Lisp_Range_Table); -#define XRANGE_TABLE(x) XRECORD (x, range_table, Lisp_Range_Table) +DECLARE_LRECORD (range_table, struct Lisp_Range_Table); +#define XRANGE_TABLE(x) \ + XRECORD (x, range_table, struct Lisp_Range_Table) #define XSETRANGE_TABLE(x, p) XSETRECORD (x, p, range_table) #define RANGE_TABLEP(x) RECORDP (x, range_table) +#define GC_RANGE_TABLEP(x) GC_RECORDP (x, range_table) #define CHECK_RANGE_TABLE(x) CHECK_RECORD (x, range_table) -#endif /* INCLUDED_rangetab_h_ */ +#endif diff -r 12e008d41344 -r 697ef44129c6 src/realpath.c --- a/src/realpath.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/realpath.c Mon Aug 13 11:20:41 2007 +0200 @@ -22,48 +22,53 @@ /* Synched up with: Not in FSF. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif #include <sys/types.h> +#if defined(HAVE_UNISTD_H) || defined(STDC_HEADERS) +#include <unistd.h> +#endif #include <stdio.h> #include <string.h> +#ifdef _POSIX_VERSION +#include <limits.h> /* for PATH_MAX */ +#else +#include <sys/param.h> /* for MAXPATHLEN */ +#endif #include <errno.h> -#include <limits.h> - -#ifdef HAVE_UNISTD_H -#include <unistd.h> +#ifndef STDC_HEADERS +extern int errno; #endif -#if defined (HAVE_SYS_PARAM_H) -#include <sys/param.h> -#endif - -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #include <direct.h> #endif #include <sys/stat.h> /* for S_IFLNK */ -#if !defined (HAVE_GETCWD) && defined (HAVE_GETWD) -#undef getcwd -#define getcwd(buffer, len) getwd (buffer) +#ifndef PATH_MAX +#ifdef _POSIX_VERSION +#define PATH_MAX _POSIX_PATH_MAX +#else +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 #endif - -#ifndef PATH_MAX -# if defined (_POSIX_PATH_MAX) -# define PATH_MAX _POSIX_PATH_MAX -# elif defined (MAXPATHLEN) -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 1024 -# endif +#endif #endif #define MAX_READLINKS 32 -char * xrealpath (const char *path, char resolved_path []); -char * -xrealpath (const char *path, char resolved_path []) +#ifdef __STDC__ +char *xrealpath(const char *path, char resolved_path []) +#else +char *xrealpath(path, resolved_path) +const char *path; +char resolved_path []; +#endif { char copy_path[PATH_MAX]; char *new_path = resolved_path; @@ -75,10 +80,10 @@ #endif /* Make a copy of the source path since we may need to modify it. */ - strcpy (copy_path, path); + strcpy(copy_path, path); path = copy_path; max_path = copy_path + PATH_MAX - 2; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* ** In NT we have two different cases: (1) the path name begins ** with a drive letter, e.g., "C:"; and (2) the path name begins @@ -104,7 +109,7 @@ */ else if (*path == '/') { - getcwd (new_path, PATH_MAX - 1); + getcwd(new_path, PATH_MAX - 1); new_path += 3; path++; } @@ -114,17 +119,21 @@ */ else { - getcwd (new_path, PATH_MAX - 1); + getcwd(new_path, PATH_MAX - 1); new_path += strlen(new_path); if (new_path[-1] != '/') *new_path++ = '/'; } #else - /* If it's a relative pathname use getcwd for starters. */ + /* If it's a relative pathname use getwd for starters. */ if (*path != '/') { - getcwd (new_path, PATH_MAX - 1); +#ifdef HAVE_GETCWD + getcwd(new_path, PATH_MAX - 1); +#else + getwd(new_path); +#endif new_path += strlen(new_path); if (new_path[-1] != '/') *new_path++ = '/'; @@ -154,20 +163,21 @@ continue; } - /* Handle ".." */ - if (path[1] == '.' && - (path[2] == '\0' || path[2] == '/')) + if (path[1] == '.') { - path += 2; + if (path[2] == '\0' || path[2] == '/') + { + path += 2; - /* Ignore ".." at root. */ - if (new_path == resolved_path + 1) - continue; + /* Ignore ".." at root. */ + if (new_path == resolved_path + 1) + continue; - /* Handle ".." by backing up. */ - while ((--new_path)[-1] != '/') - ; - continue; + /* Handle ".." by backing up. */ + while ((--new_path)[-1] != '/') + ; + continue; + } } } @@ -185,7 +195,7 @@ #ifdef S_IFLNK /* See if latest pathname component is a symlink. */ *new_path = '\0'; - n = readlink (resolved_path, link_path, PATH_MAX - 1); + n = readlink(resolved_path, link_path, PATH_MAX - 1); if (n < 0) { diff -r 12e008d41344 -r 697ef44129c6 src/redisplay-msw.c --- a/src/redisplay-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/redisplay-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -26,9 +26,8 @@ Chuck Thompson Lots of work done by Ben Wing for Mule - - Partially rewritten for mswindows by Jonathan Harris, November 1997 - for 21.0. */ + Partially rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. + */ #include <config.h> #include "lisp.h" @@ -42,11 +41,11 @@ #include "faces.h" #include "frame.h" #include "glyphs-msw.h" -#include "gutter.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" +#include "windows.h" #ifdef MULE #include "mule-ccl.h" #include "mule-charset.h" @@ -57,17 +56,25 @@ /* * Random forward declarations */ -static void mswindows_update_dc (HDC hdc, Lisp_Object fg, Lisp_Object bg, - Lisp_Object bg_pmap); -static void mswindows_set_dc_font (HDC hdc, Lisp_Object font, - int under, int strike); +static void mswindows_update_dc (HDC hdc, Lisp_Object font, Lisp_Object fg, + Lisp_Object bg, Lisp_Object bg_pmap); static void mswindows_output_vertical_divider (struct window *w, int clear); static void mswindows_redraw_exposed_windows (Lisp_Object window, int x, int y, int width, int height); static void mswindows_output_dibitmap (struct frame *f, - Lisp_Image_Instance *p, - struct display_box* db, - struct display_glyph_area* dga); + struct Lisp_Image_Instance *p, + int x, int y, + int clip_x, int clip_y, + int clip_width, int clip_height, + int width, int height, + int pixmap_offset, + int offset_bitmap); +static void mswindows_output_pixmap (struct window *w, struct display_line *dl, + Lisp_Object image_instance, int xpos, + int xoffset, int start_pixpos, int width, + face_index findex, int cursor_start, + int cursor_width, int cursor_height, + int offset_bitmap); typedef struct textual_run { @@ -92,7 +99,7 @@ static int separate_textual_runs (unsigned char *text_storage, textual_run *run_storage, - const Emchar *str, Charcount len) + CONST Emchar *str, Charcount len) { Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a possible valid charset when @@ -158,7 +165,7 @@ char_converter.reg[1] = byte1; char_converter.reg[2] = byte2; char_converter.ic = 0; /* start at beginning each time */ - ccl_driver (&char_converter, 0, 0, 0, 0, CCL_MODE_ENCODING); + ccl_driver (&char_converter, 0, 0, 0, 0); byte1 = char_converter.reg[1]; byte2 = char_converter.reg[2]; } @@ -185,7 +192,7 @@ textual_run *run) { Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset); - Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst); + struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst); SIZE size; if (!fi->proportional_p || !hdc) @@ -193,44 +200,12 @@ else { assert(run->dimension == 1); /* #### FIXME! */ - mswindows_set_dc_font (hdc, font_inst, - cachel->underline, cachel->strikethru); + mswindows_update_dc (hdc, font_inst, Qnil, Qnil, Qnil); GetTextExtentPoint32 (hdc, run->ptr, run->len, &size); return(size.cx); } } -/* - * Given F, retrieve device context. F can be a display frame, or - * a print job. For a print job, page is also started when printer's - * device context is first time requested. - */ -static HDC -get_frame_dc (struct frame *f, int start_page_p) -{ - if (FRAME_MSWINDOWS_P (f)) - return FRAME_MSWINDOWS_DC (f); - else - { - if (start_page_p && !FRAME_MSPRINTER_PAGE_STARTED (f)) - msprinter_start_page (f); - return DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))); - } -} - -/* - * Given F, retrieve compatible device context. F can be a display - * frame, or a print job. - */ -static HDC -get_frame_compdc (struct frame *f) -{ - struct device *d = XDEVICE (FRAME_DEVICE (f)); - if (DEVICE_MSWINDOWS_P (d)) - return DEVICE_MSWINDOWS_HCDC (d); - else - return DEVICE_MSPRINTER_HCDC (d); -} /***************************************************************************** mswindows_update_dc @@ -238,15 +213,18 @@ Given a number of parameters munge the DC so it has those properties. ****************************************************************************/ static void -mswindows_update_dc (HDC hdc, Lisp_Object fg, Lisp_Object bg, - Lisp_Object bg_pmap) +mswindows_update_dc (HDC hdc, Lisp_Object font, Lisp_Object fg, + Lisp_Object bg, Lisp_Object bg_pmap) { + if (!NILP (font)) + SelectObject(hdc, FONT_INSTANCE_MSWINDOWS_HFONT (XFONT_INSTANCE (font))); + + if (!NILP (fg)) { SetTextColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (fg))); } - if (!NILP (bg)) { SetBkMode (hdc, OPAQUE); @@ -258,13 +236,54 @@ } } -static void mswindows_set_dc_font (HDC hdc, Lisp_Object font, - int under, int strike) + +/***************************************************************************** + mswindows_apply_face_effects + + Draw underline and strikeout as if this was X. + #### On mswindows this really should be done as part of drawing the font. + The line width used is chosen arbitrarily from the font height. + ****************************************************************************/ +static void +mswindows_apply_face_effects (HDC hdc, struct display_line *dl, int xpos, + int width, struct Lisp_Font_Instance *fi, + struct face_cachel *cachel, + struct face_cachel *color_cachel) { - SelectObject(hdc, mswindows_get_hfont (XFONT_INSTANCE (font), - under, strike)); + int yclip; + HBRUSH brush, oldbrush; + RECT rect; + + brush = CreateSolidBrush (COLOR_INSTANCE_MSWINDOWS_COLOR ( + XCOLOR_INSTANCE (color_cachel->foreground))); + if (brush) + { + yclip = dl->ypos + dl->descent - dl->clip; + rect.left = xpos; + rect.right = xpos + width; + oldbrush = SelectObject (hdc, brush); + + if (cachel->underline) + { + rect.top = dl->ypos + dl->descent/2; + rect.bottom = rect.top + (fi->height >= 0x20 ? 2 : 1); + if (rect.bottom <= yclip) + FillRect (hdc, &rect, brush); + } + if (cachel->strikethru) + { + rect.top = dl->ypos + dl->descent - (dl->ascent + dl->descent)/2; + rect.bottom = rect.top + (fi->height >= 0x20 ? 2 : 1); + if (rect.bottom <= yclip) + FillRect (hdc, &rect, brush); + } + + SelectObject (hdc, oldbrush); + DeleteObject (brush); + } } + /***************************************************************************** mswindows_output_hline @@ -283,44 +302,37 @@ of its face. ****************************************************************************/ static void -mswindows_output_blank (struct window *w, struct display_line *dl, - struct rune *rb, int start_pixpos) +mswindows_output_blank (struct window *w, struct display_line *dl, struct rune *rb, int start_pixpos) { struct frame *f = XFRAME (w->frame); - HDC hdc = get_frame_dc (f, 1); - RECT rect = { rb->xpos, DISPLAY_LINE_YPOS (dl), - rb->xpos+rb->width, - DISPLAY_LINE_YEND (dl) }; + RECT rect = { rb->xpos, dl->ypos-dl->ascent, + rb->xpos+rb->width, dl->ypos+dl->descent-dl->clip }; struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, rb->findex); Lisp_Object bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex); - /* Unmap all subwindows in the area we are going to blank. */ - redisplay_unmap_subwindows_maybe (f, rb->xpos, DISPLAY_LINE_YPOS (dl), - rb->width, DISPLAY_LINE_HEIGHT (dl)); - if (!IMAGE_INSTANCEP (bg_pmap) || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) bg_pmap = Qnil; if (!NILP(bg_pmap)) { - struct display_box db; - struct display_glyph_area dga; - redisplay_calculate_display_boxes (dl, rb->xpos, - /*rb->object.dglyph.xoffset*/ 0, - start_pixpos, rb->width, - &db, &dga); /* blank the background in the appropriate color */ - mswindows_update_dc (hdc, cachel->foreground, + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, cachel->foreground, cachel->background, Qnil); - redisplay_output_pixmap (w, bg_pmap, &db, &dga, rb->findex, + + mswindows_output_pixmap (w, dl, bg_pmap, + rb->xpos, 0 /*rb->object.dglyph.xoffset*/, + start_pixpos, rb->width, rb->findex, 0, 0, 0, TRUE); } else { - mswindows_update_dc (hdc, Qnil, cachel->background, Qnil); - ExtTextOut (hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, + cachel->background, Qnil); + + ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, + &rect, NULL, 0, NULL); } } @@ -340,24 +352,20 @@ struct face_cachel *cachel=0; Lisp_Object font = Qnil; int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); - HDC hdc = get_frame_dc (f, 1); - unsigned int local_face_index=0; + HDC hdc = FRAME_MSWINDOWS_DC (f); + unsigned int face_index=0; char *p_char = NULL; int n_char = 0; RECT rect = { xpos, - DISPLAY_LINE_YPOS (dl), + dl->ypos - dl->ascent, xpos + width, - DISPLAY_LINE_YEND (dl) }; + dl->ypos + dl->descent - dl->clip}; Lisp_Object bar = symbol_value_in_buffer (Qbar_cursor, WINDOW_BUFFER (w)); int bar_p = image_p || !NILP (bar); int cursor_p = !NILP (w->text_cursor_visible_p); int real_char_p = ch != 0; - /* Unmap all subwindows in the area we are going to blank. */ - redisplay_unmap_subwindows_maybe (f, xpos, DISPLAY_LINE_YPOS (dl), - width, DISPLAY_LINE_HEIGHT (dl)); - if (real_char_p) { /* Use the font from the underlying character */ @@ -380,16 +388,16 @@ /* Use cursor fg/bg for block cursor, or character fg/bg for the bar or when we need to erase the cursor. Output nothing at eol if bar cursor */ - local_face_index = get_builtin_face_cache_index (w, Vtext_cursor_face); + face_index = get_builtin_face_cache_index (w, Vtext_cursor_face); color_cachel = WINDOW_FACE_CACHEL (w, ((!cursor_p || bar_p) ? - findex : local_face_index)); - mswindows_update_dc (hdc, color_cachel->foreground, + findex : face_index)); + mswindows_update_dc (hdc, font, color_cachel->foreground, color_cachel->background, Qnil); - if (real_char_p) - mswindows_set_dc_font (hdc, font, - cachel->underline, cachel->strikethru); - ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect, p_char, n_char, NULL); + if (real_char_p && (cachel->underline || cachel->strikethru)) + mswindows_apply_face_effects (hdc, dl, xpos, width, + XFONT_INSTANCE (font), + cachel, color_cachel); } if (!cursor_p) @@ -398,9 +406,9 @@ if (focus && bar_p) { rect.right = rect.left + (EQ (bar, Qt) ? 1 : min (2, width)); - local_face_index = get_builtin_face_cache_index (w, Vtext_cursor_face); - cachel = WINDOW_FACE_CACHEL (w, local_face_index); - mswindows_update_dc (hdc, Qnil, cachel->background, Qnil); + face_index = get_builtin_face_cache_index (w, Vtext_cursor_face); + cachel = WINDOW_FACE_CACHEL (w, face_index); + mswindows_update_dc (hdc, Qnil, Qnil, cachel->background, Qnil); ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE, &rect, NULL, 0, NULL); } else if (!focus) @@ -416,12 +424,16 @@ n_char = 1; } - local_face_index = get_builtin_face_cache_index (w, Vdefault_face); - cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? findex : local_face_index)); - mswindows_update_dc (hdc, - cachel->foreground, cachel->background, Qnil); + face_index = get_builtin_face_cache_index (w, Vdefault_face); + cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? findex : face_index)); + mswindows_update_dc (hdc, Qnil, cachel->foreground, + cachel->background, Qnil); ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE | ETO_CLIPPED, &rect, p_char, n_char, NULL); + if (cachel->underline || cachel->strikethru) + mswindows_apply_face_effects (hdc, dl, xpos+1, width-2, + XFONT_INSTANCE (font), + cachel, cachel); } } @@ -450,17 +462,15 @@ FINDEX Index for the face cache element describing how to display the text. ****************************************************************************/ -static void +void mswindows_output_string (struct window *w, struct display_line *dl, - Emchar_dynarr *buf, int xpos, int xoffset, int clip_start, - int width, face_index findex, - int cursor, int cursor_start, int cursor_width, - int cursor_height) + Emchar_dynarr *buf, int xpos, int xoffset, int clip_start, + int width, face_index findex) { struct frame *f = XFRAME (w->frame); /* struct device *d = XDEVICE (f->device);*/ Lisp_Object window; - HDC hdc = get_frame_dc (f, 1); + HDC hdc = FRAME_MSWINDOWS_DC (f); int clip_end; Lisp_Object bg_pmap; int len = Dynarr_length (buf); @@ -494,13 +504,9 @@ /* sort out the destination rectangle */ height = DISPLAY_LINE_HEIGHT (dl); rect.left = clip_start; - rect.top = DISPLAY_LINE_YPOS (dl); + rect.top = dl->ypos - dl->ascent; rect.right = clip_end; - rect.bottom = rect.top + height; - - /* make sure the area we are about to display is subwindow free. */ - redisplay_unmap_subwindows_maybe (f, clip_start, DISPLAY_LINE_YPOS (dl), - clip_end - clip_start, DISPLAY_LINE_HEIGHT (dl)); + rect.bottom = height + dl->ypos - dl->ascent; /* output the background pixmap if there is one */ bg_pmap = cachel->background_pixmap; @@ -510,14 +516,13 @@ if (!NILP(bg_pmap)) { - struct display_box db; - struct display_glyph_area dga; - redisplay_calculate_display_boxes (dl, xpos + xoffset, 0, - clip_start, width, &db, &dga); /* blank the background in the appropriate color */ - mswindows_update_dc (hdc, - cachel->foreground, cachel->background, Qnil); - redisplay_output_pixmap (w, bg_pmap, &db, &dga, findex, + mswindows_update_dc (hdc, Qnil, cachel->foreground, + cachel->background, Qnil); + + mswindows_output_pixmap (w, dl, bg_pmap, + xpos, xoffset, + clip_start, width, findex, 0, 0, 0, TRUE); /* output pixmap calls this so we have to recall to get correct references */ @@ -530,27 +535,26 @@ for (i = 0; i < nruns; i++) { Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset); - Lisp_Font_Instance *fi = XFONT_INSTANCE (font); + struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font); int this_width; if (EQ (font, Vthe_null_font_instance)) continue; - mswindows_update_dc (hdc, cachel->foreground, + mswindows_update_dc (hdc, font, cachel->foreground, NILP(bg_pmap) ? cachel->background : Qnil, Qnil); - mswindows_set_dc_font (hdc, font, cachel->underline, cachel->strikethru); this_width = mswindows_text_width_single_run (hdc, cachel, runs + i); /* cope with fonts taller than lines */ - if ((int) fi->height < (int) (height + dl->clip + dl->top_clip)) + if ((int) fi->height < (int) (height + dl->clip)) { int clear_start = max (xpos, clip_start); int clear_end = min (xpos + this_width, clip_end); { redisplay_clear_region (window, findex, clear_start, - DISPLAY_LINE_YPOS (dl), + dl->ypos - dl->ascent, clear_end - clear_start, height); /* output pixmap calls this so we have to recall to get correct @@ -564,25 +568,44 @@ NILP(bg_pmap) ? ETO_CLIPPED | ETO_OPAQUE : ETO_CLIPPED, &rect, (char *) runs[i].ptr, runs[i].len, NULL); + /* #### X does underline/strikethrough here so we do the same. + On mswindows, underline/strikethrough really belongs to the font */ + if (cachel->underline || cachel->strikethru) + mswindows_apply_face_effects (hdc, dl, xpos, this_width, fi, + cachel, cachel); xpos += this_width; } } static void -mswindows_output_dibitmap (struct frame *f, Lisp_Image_Instance *p, - struct display_box* db, - struct display_glyph_area* dga) +mswindows_output_dibitmap (struct frame *f, struct Lisp_Image_Instance *p, + int x, int y, + int clip_x, int clip_y, + int clip_width, int clip_height, + int width, int height, int pixmap_offset, + int offset_bitmap) { - HDC hdc = get_frame_dc (f, 1); - HDC hcompdc = get_frame_compdc (f); + HDC hdc = FRAME_MSWINDOWS_DC (f); HGDIOBJ old=NULL; COLORREF bgcolor = GetBkColor (hdc); - const int real_x = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (p); - const int real_y = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (p); - const int surface_x = IMAGE_INSTANCE_PIXMAP_WIDTH (p); - const int surface_y = IMAGE_INSTANCE_PIXMAP_HEIGHT (p); + int need_clipping = (clip_x || clip_y); + int yoffset=0; + int xoffset=0; - /* first blit the mask */ + /* do we need to offset the pixmap vertically? this is necessary + for background pixmaps. */ + if (offset_bitmap) + { + yoffset = y % IMAGE_INSTANCE_PIXMAP_HEIGHT (p); + xoffset = x % IMAGE_INSTANCE_PIXMAP_WIDTH (p); + /* the width is handled by mswindows_output_pixmap_region */ + } + + if (need_clipping) + { + } + + /* first blt the mask */ if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) { RGBQUAD col; @@ -591,124 +614,200 @@ col.rgbGreen = GetGValue (bgcolor); col.rgbReserved = 0; - old = SelectObject (hcompdc, IMAGE_INSTANCE_MSWINDOWS_MASK (p)); + old = SelectObject (FRAME_MSWINDOWS_CDC (f), + IMAGE_INSTANCE_MSWINDOWS_MASK (p)); - SetDIBColorTable (hcompdc, 1, 1, &col); + SetDIBColorTable (FRAME_MSWINDOWS_CDC (f), 1, 1, &col); - StretchBlt (hdc, - db->xpos, db->ypos, - dga->width, dga->height, - hcompdc, - MulDiv (dga->xoffset, real_x, surface_x), - MulDiv (dga->yoffset, real_y, surface_y), - MulDiv (dga->width, real_x, surface_x), - MulDiv (dga->height, real_y, surface_y), - SRCCOPY); + BitBlt (hdc, + x,y, + width, height, + FRAME_MSWINDOWS_CDC (f), + xoffset,yoffset, + SRCCOPY); - SelectObject (hcompdc, old); + SelectObject (FRAME_MSWINDOWS_CDC (f), old); } - /* Now blit the bitmap itself, or one of its slices. */ - old = SelectObject (hcompdc, - IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE - (p, IMAGE_INSTANCE_PIXMAP_SLICE (p))); + /* now blt the bitmap itself. */ + old = SelectObject (FRAME_MSWINDOWS_CDC (f), + IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)); - StretchBlt (hdc, - db->xpos, db->ypos, - dga->width, dga->height, - hcompdc, - MulDiv (dga->xoffset, real_x, surface_x), - MulDiv (dga->yoffset, real_y, surface_y), - MulDiv (dga->width, real_x, surface_x), - MulDiv (dga->height, real_y, surface_y), - IMAGE_INSTANCE_MSWINDOWS_MASK (p) ? SRCINVERT : SRCCOPY); + BitBlt (hdc, + x,y, + width, height, + FRAME_MSWINDOWS_CDC (f), + xoffset, yoffset, + IMAGE_INSTANCE_MSWINDOWS_MASK (p) ? SRCINVERT : SRCCOPY); - SelectObject (hcompdc, old); + SelectObject (FRAME_MSWINDOWS_CDC (f),old); + + if (need_clipping) + { + } } -/* X gc's have this nice property that setting the bg pixmap will +/* + * X gc's have this nice property that setting the bg pixmap will * output it offset relative to the window. Windows doesn't have this - * feature so we have to emulate this by outputting multiple pixmaps. - * This is only used for background pixmaps. Normal pixmaps are - * outputted once and are scrollable */ + * feature so we have to emulate this by outputting multiple pixmaps + */ static void mswindows_output_dibitmap_region (struct frame *f, - Lisp_Image_Instance *p, - struct display_box *db, - struct display_glyph_area *dga) + struct Lisp_Image_Instance *p, + int x, int y, + int clip_x, int clip_y, + int clip_width, int clip_height, + int width, int height, int pixmap_offset, + int offset_bitmap) { - struct display_box xdb = { db->xpos, db->ypos, db->width, db->height }; - struct display_glyph_area xdga - = { 0, 0, IMAGE_INSTANCE_PIXMAP_WIDTH (p), - IMAGE_INSTANCE_PIXMAP_HEIGHT (p) }; + int pwidth = min (width, IMAGE_INSTANCE_PIXMAP_WIDTH (p)); + int pheight = min (height, IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); int pxoffset = 0, pyoffset = 0; - if (dga) - { - xdga.width = dga->width; - xdga.height = dga->height; - } - else if (!redisplay_normalize_glyph_area (&xdb, &xdga)) - return; - /* when doing a bg pixmap do a partial pixmap first so that we blt whole pixmaps thereafter */ - xdga.height = min (xdga.height, IMAGE_INSTANCE_PIXMAP_HEIGHT (p) - - db->ypos % IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); - while (xdga.height > 0) + if (offset_bitmap) { - xdga.width = min (min (db->width, IMAGE_INSTANCE_PIXMAP_WIDTH (p)), - IMAGE_INSTANCE_PIXMAP_WIDTH (p) - - db->xpos % IMAGE_INSTANCE_PIXMAP_WIDTH (p)); - pxoffset = 0; - while (xdga.width > 0) + pheight = min (pheight, IMAGE_INSTANCE_PIXMAP_HEIGHT (p) - + y % IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); + } + + while (pheight > 0) + { + if (offset_bitmap) { - xdb.xpos = db->xpos + pxoffset; - xdb.ypos = db->ypos + pyoffset; - /* do we need to offset the pixmap vertically? this is necessary - for background pixmaps. */ - xdga.yoffset = xdb.ypos % IMAGE_INSTANCE_PIXMAP_HEIGHT (p); - xdga.xoffset = xdb.xpos % IMAGE_INSTANCE_PIXMAP_WIDTH (p); - /* the width is handled by mswindows_output_pixmap_region */ - mswindows_output_dibitmap (f, p, &xdb, &xdga); - pxoffset += xdga.width; - xdga.width = min ((db->width - pxoffset), - IMAGE_INSTANCE_PIXMAP_WIDTH (p)); + pwidth = min (min (width, IMAGE_INSTANCE_PIXMAP_WIDTH (p)), + IMAGE_INSTANCE_PIXMAP_WIDTH (p) - + x % IMAGE_INSTANCE_PIXMAP_WIDTH (p)); + pxoffset = 0; } - pyoffset += xdga.height; - xdga.height = min ((db->height - pyoffset), - IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); + while (pwidth > 0) + { + mswindows_output_dibitmap (f, p, + x + pxoffset, y + pyoffset, + clip_x, clip_y, + clip_width, clip_height, + pwidth, pheight, pixmap_offset, + offset_bitmap); + pxoffset += pwidth; + pwidth = min ((width-pxoffset), + IMAGE_INSTANCE_PIXMAP_WIDTH (p)); + } + pyoffset += pheight; + pheight = min ((height-pyoffset), + IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); } } -/* Output a pixmap at the desired location. - DB normalized display_box. - DGA normalized display_glyph_area. */ static void -mswindows_output_pixmap (struct window *w, Lisp_Object image_instance, - struct display_box *db, struct display_glyph_area *dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int bg_pixmap) +mswindows_output_pixmap (struct window *w, struct display_line *dl, + Lisp_Object image_instance, int xpos, int xoffset, + int start_pixpos, int width, face_index findex, + int cursor_start, int cursor_width, int cursor_height, + int offset_bitmap) { struct frame *f = XFRAME (w->frame); - HDC hdc = get_frame_dc (f, 1); + HDC hdc = FRAME_MSWINDOWS_DC (f); + + struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + Lisp_Object window; - Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); - Lisp_Object window; + int lheight = DISPLAY_LINE_HEIGHT (dl); + int pheight = ((int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p) > lheight ? lheight : + IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); + int clip_x, clip_y, clip_width, clip_height; + + /* The pixmap_offset is used to center the pixmap on lines which are + shorter than it is. This results in odd effects when scrolling + pixmaps off of the bottom. Let's try not using it. */ +#if 0 + int pixmap_offset = (int) (IMAGE_INSTANCE_PIXMAP_HEIGHT (p) - lheight) / 2; +#else + int pixmap_offset = 0; +#endif XSETWINDOW (window, w); + if ((start_pixpos >= 0 && start_pixpos > xpos) || xoffset) + { + if (start_pixpos > xpos && start_pixpos > xpos + width) + return; + + clip_x = xoffset; + clip_width = width; + if (start_pixpos > xpos) + { + clip_x += (start_pixpos - xpos); + clip_width -= (start_pixpos - xpos); + } + } + else + { + clip_x = 0; + clip_width = 0; + } + + /* Place markers for possible future functionality (clipping the top + half instead of the bottom half; think pixel scrolling). */ + clip_y = 0; + clip_height = pheight; + + /* Clear the area the pixmap is going into. The pixmap itself will + always take care of the full width. We don't want to clear where + it is going to go in order to avoid flicker. So, all we have to + take care of is any area above or below the pixmap. */ + /* #### We take a shortcut for now. We know that since we have + pixmap_offset hardwired to 0 that the pixmap is against the top + edge so all we have to worry about is below it. */ + /* #### Unless the pixmap has a mask in which case we have to clear + the whole damn thing since we can't yet clear just the area not + included in the mask. */ + if (((int) (dl->ypos - dl->ascent + pheight) < + (int) (dl->ypos + dl->descent - dl->clip)) + || IMAGE_INSTANCE_MSWINDOWS_MASK (p)) + { + int clear_x, clear_y, clear_width, clear_height; + + if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) + { + clear_y = dl->ypos - dl->ascent; + clear_height = lheight; + } + else + { + clear_y = dl->ypos - dl->ascent + pheight; + clear_height = lheight - pheight; + } + + if (start_pixpos >= 0 && start_pixpos > xpos) + { + clear_x = start_pixpos; + clear_width = xpos + width - start_pixpos; + } + else + { + clear_x = xpos; + clear_width = width; + } + + if (!offset_bitmap) /* i.e. not a bg pixmap */ + redisplay_clear_region (window, findex, clear_x, clear_y, + clear_width, clear_height); + } + /* Output the pixmap. Have to do this as many times as is required to fill the given area */ - mswindows_update_dc (hdc, + mswindows_update_dc (hdc, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, findex), WINDOW_FACE_CACHEL_BACKGROUND (w, findex), Qnil); - if (bg_pixmap) - mswindows_output_dibitmap_region (f, p, db, dga); - else - mswindows_output_dibitmap (f, p, db, dga); + mswindows_output_dibitmap_region (f, p, xpos - xoffset, + dl->ypos - dl->ascent, + clip_x, clip_y, clip_width, clip_height, + width + xoffset, pheight, pixmap_offset, + offset_bitmap); } #ifdef HAVE_SCROLLBARS @@ -720,7 +819,7 @@ * to by PRC, and paints only the intersection */ static void -mswindows_redisplay_deadbox_maybe (struct window *w, const RECT* prc) +mswindows_redisplay_deadbox_maybe (struct window *w, CONST RECT* prc) { int sbh = window_scrollbar_height (w); int sbw = window_scrollbar_width (w); @@ -743,7 +842,7 @@ if (IntersectRect (&rect_paint, &rect_dead, prc)) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - FillRect (get_frame_dc (f, 1), &rect_paint, + FillRect (FRAME_MSWINDOWS_DC (f), &rect_paint, (HBRUSH) (COLOR_BTNFACE+1)); } } @@ -800,11 +899,12 @@ for (line = 0; line < Dynarr_length (cdla); line++) { struct display_line *cdl = Dynarr_atp (cdla, line); + int top_y = cdl->ypos - cdl->ascent; + int bottom_y = cdl->ypos + cdl->descent; - if (DISPLAY_LINE_YPOS (cdl) + DISPLAY_LINE_HEIGHT (cdl) - >= rect_draw.top) + if (bottom_y >= rect_draw.top) { - if (DISPLAY_LINE_YPOS (cdl) > rect_draw.bottom) + if (top_y > rect_draw.bottom) { if (line == 0) continue; @@ -865,7 +965,6 @@ redraw anyhow. */ MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); #endif - redraw_exposed_gutters (f, x, y, width, height); if (!f->window_face_cache_reset) { @@ -878,55 +977,38 @@ /***************************************************************************** - mswindows_bevel_area + mswindows_bevel_modeline - Draw a 3d border around the specified area on window W. + Draw a 3d border around the modeline on window W. ****************************************************************************/ static void -mswindows_bevel_area (struct window *w, face_index findex, int x, int y, - int width, int height, int thickness, - int edges, enum edge_style style) +mswindows_bevel_modeline (struct window *w, struct display_line *dl) { struct frame *f = XFRAME (w->frame); + Lisp_Object color; + int shadow_width = MODELINE_SHADOW_THICKNESS (w); + RECT rect = { WINDOW_MODELINE_LEFT (w), + dl->ypos - dl->ascent - shadow_width, + WINDOW_MODELINE_RIGHT (w), + dl->ypos + dl->descent + shadow_width}; UINT edge; - UINT border = 0; + + color = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX); + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, color, Qnil); - if (style == EDGE_ETCHED_IN) - edge = EDGE_ETCHED; - else if (style == EDGE_ETCHED_OUT) - edge = EDGE_BUMP; - else if (style == EDGE_BEVEL_IN) - { - if (thickness == 1) - edge = BDR_SUNKENINNER; - else - edge = EDGE_SUNKEN; - } - else /* EDGE_BEVEL_OUT */ - { - if (thickness == 1) - edge = BDR_RAISEDINNER; - else - edge = EDGE_RAISED; - } + if (XINT (w->modeline_shadow_thickness) < 0) + shadow_width = -shadow_width; - if (edges & EDGE_TOP) - border |= BF_TOP; - if (edges & EDGE_LEFT) - border |= BF_LEFT; - if (edges & EDGE_BOTTOM) - border |= BF_BOTTOM; - if (edges & EDGE_RIGHT) - border |= BF_RIGHT; - - { - RECT rect = { x, y, x + width, y + height }; - Lisp_Object color = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); - HDC hdc = get_frame_dc (f, 1); - - mswindows_update_dc (hdc, Qnil, color, Qnil); - DrawEdge (hdc, &rect, edge, border); - } + if (shadow_width < -1) + edge = EDGE_SUNKEN; + else if (shadow_width < 0) + edge = BDR_SUNKENINNER; + else if (shadow_width == 1) + edge = BDR_RAISEDINNER; + else + edge = EDGE_RAISED; + + DrawEdge (FRAME_MSWINDOWS_DC (f), &rect, edge, BF_RECT); } @@ -957,37 +1039,22 @@ } /***************************************************************************** - mswindows_frame_output_begin + mswindows_output_begin Perform any necessary initialization prior to an update. ****************************************************************************/ static void -mswindows_frame_output_begin (struct frame *f) +mswindows_output_begin (struct device *d) { } /***************************************************************************** - mswindows_frame_output_end + mswindows_output_end Perform any necessary flushing of queues when an update has completed. ****************************************************************************/ static void -mswindows_frame_output_end (struct frame *f) -{ - HDWP hdwp = FRAME_MSWINDOWS_DATA (f)->hdwp; - - if (hdwp != 0) - { - EndDeferWindowPos (hdwp); - FRAME_MSWINDOWS_DATA (f)->hdwp = 0; - } - - GdiFlush(); -} - -/* Printer version is more lightweight. */ -static void -msprinter_frame_output_end (struct frame *f) +mswindows_output_end (struct device *d) { GdiFlush(); } @@ -996,14 +1063,13 @@ mswindows_flash (struct device *d) { struct frame *f = device_selected_frame (d); - HDC hdc = get_frame_dc (f, 1); RECT rc; GetClientRect (FRAME_MSWINDOWS_HANDLE (f), &rc); - InvertRect (hdc, &rc); + InvertRect (FRAME_MSWINDOWS_DC (f), &rc); GdiFlush (); Sleep (25); - InvertRect (hdc, &rc); + InvertRect (FRAME_MSWINDOWS_DC (f), &rc); return 1; } @@ -1044,14 +1110,18 @@ rb = Dynarr_atp (rba, start); if (!rb) + { /* Nothing to do so don't do anything. */ return; - - findex = rb->findex; - xpos = rb->xpos; - width = 0; - if (rb->type == RUNE_CHAR) - charset = CHAR_CHARSET (rb->object.chr.ch); + } + else + { + findex = rb->findex; + xpos = rb->xpos; + width = 0; + if (rb->type == RUNE_CHAR) + charset = CHAR_CHARSET (rb->object.chr.ch); + } if (end < 0) end = Dynarr_length (rba); @@ -1074,7 +1144,7 @@ if (Dynarr_length (buf)) { mswindows_output_string (w, dl, buf, xpos, 0, start_pixpos, width, - findex, 0, 0, 0, 0); + findex); xpos = rb->xpos; width = 0; } @@ -1108,9 +1178,10 @@ else if (rb->object.chr.ch == '\n') { /* Clear in case a cursor was formerly here. */ - redisplay_clear_region (window, findex, xpos, - DISPLAY_LINE_YPOS (dl), - rb->width, DISPLAY_LINE_HEIGHT (dl)); + int height = DISPLAY_LINE_HEIGHT (dl); + + redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent, + rb->width, height); elt++; } } @@ -1146,12 +1217,6 @@ else if (rb->type == RUNE_DGLYPH) { Lisp_Object instance; - struct display_box dbox; - struct display_glyph_area dga; - - redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset, - start_pixpos, rb->width, - &dbox, &dga); XSETWINDOW (window, w); instance = glyph_image_instance (rb->object.dglyph.glyph, @@ -1159,52 +1224,61 @@ findex = rb->findex; if (IMAGE_INSTANCEP (instance)) - { - switch (XIMAGE_INSTANCE_TYPE (instance)) + switch (XIMAGE_INSTANCE_TYPE (instance)) + { + case IMAGE_TEXT: { - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - redisplay_output_pixmap (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height, 0); + /* #### This is way losing. See the comment in + add_glyph_rune(). */ + Lisp_Object string = + XIMAGE_INSTANCE_TEXT_STRING (instance); + convert_bufbyte_string_into_emchar_dynarr + (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); + if (rb->cursor_type == CURSOR_ON) mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, 0, 1); - break; - - case IMAGE_WIDGET: - if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance), - Qlayout)) - { - redisplay_output_layout (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - if (rb->cursor_type == CURSOR_ON) - mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, 0, 1); - break; - } - case IMAGE_SUBWINDOW: - redisplay_output_subwindow (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - if (rb->cursor_type == CURSOR_ON) - mswindows_output_cursor (w, dl, xpos, cursor_width, - findex, 0, 1); - break; - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; + findex, Dynarr_at (buf, 0), 0); + else /* #### redisplay-x passes -1 as the width: why ? */ + mswindows_output_string (w, dl, buf, xpos, + rb->object.dglyph.xoffset, + start_pixpos, rb->width, findex); + Dynarr_reset (buf); + } + break; + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + mswindows_output_pixmap (w, dl, instance, xpos, + rb->object.dglyph.xoffset, start_pixpos, + rb->width, findex, cursor_start, + cursor_width, cursor_height, 0); + if (rb->cursor_type == CURSOR_ON) + mswindows_output_cursor (w, dl, xpos, cursor_width, + findex, 0, 1); + break; - case IMAGE_TEXT: - case IMAGE_POINTER: - default: - abort (); - } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT - (XIMAGE_INSTANCE (instance)) = 0; - } + case IMAGE_POINTER: + abort (); + + case IMAGE_SUBWINDOW: + case IMAGE_WIDGET: + redisplay_output_subwindow (w, dl, instance, xpos, + rb->object.dglyph.xoffset, start_pixpos, + rb->width, findex, cursor_start, + cursor_width, cursor_height); + if (rb->cursor_type == CURSOR_ON) + mswindows_output_cursor (w, dl, xpos, cursor_width, + findex, 0, 1); + break; + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); + } + xpos += rb->width; elt++; } @@ -1214,15 +1288,14 @@ } if (Dynarr_length (buf)) - mswindows_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex, - 0, 0, 0, 0); + mswindows_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex); if (dl->modeline && !EQ (Qzero, w->modeline_shadow_thickness) && (f->clear || f->windows_structure_changed || w->shadow_thickness_changed)) - bevel_modeline (w, dl); + mswindows_bevel_modeline (w, dl); Dynarr_free (buf); } @@ -1237,45 +1310,43 @@ mswindows_output_vertical_divider (struct window *w, int clear_unused) { struct frame *f = XFRAME (w->frame); - HDC hdc = get_frame_dc (f, 1); RECT rect; int spacing = XINT (w->vertical_divider_spacing); int shadow = XINT (w->vertical_divider_shadow_thickness); int abs_shadow = abs (shadow); int line_width = XINT (w->vertical_divider_line_width); int div_left = WINDOW_RIGHT (w) - window_divider_width (w); - int y1 = WINDOW_TOP (w); - int y2 = WINDOW_BOTTOM (w); /* Clear left and right spacing areas */ if (spacing) { - rect.top = y1; - rect.bottom = y2; - mswindows_update_dc (hdc, Qnil, + rect.top = WINDOW_TOP (w); + rect.bottom = WINDOW_BOTTOM (w); + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, DEFAULT_INDEX), Qnil); rect.right = WINDOW_RIGHT (w); rect.left = rect.right - spacing; - ExtTextOut (hdc, 0, 0, ETO_OPAQUE, + ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); rect.left = div_left; rect.right = div_left + spacing; - ExtTextOut (hdc, 0, 0, ETO_OPAQUE, + ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); } /* Clear divider face */ - rect.top = y1 + abs_shadow; - rect.bottom = y2 - abs_shadow; + rect.top = WINDOW_TOP (w) + abs_shadow; + rect.bottom = WINDOW_BOTTOM (w) - abs_shadow; rect.left = div_left + spacing + abs_shadow; rect.right = rect.left + line_width; if (rect.left < rect.right) { face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face); - mswindows_update_dc (hdc, Qnil, + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, div_face), Qnil); - ExtTextOut (hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); + ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, + &rect, NULL, 0, NULL); } /* Draw a shadow around the divider */ @@ -1283,7 +1354,7 @@ { /* #### This will be fixed to support arbitrary thickness */ InflateRect (&rect, abs_shadow, abs_shadow); - DrawEdge (hdc, &rect, + DrawEdge (FRAME_MSWINDOWS_DC (f), &rect, shadow > 0 ? EDGE_RAISED : EDGE_SUNKEN, BF_RECT); } } @@ -1296,9 +1367,8 @@ ****************************************************************************/ static int mswindows_text_width (struct frame *f, struct face_cachel *cachel, - const Emchar *str, Charcount len) + CONST Emchar *str, Charcount len) { - HDC hdc = get_frame_dc (f, 0); int width_so_far = 0; unsigned char *text_storage = (unsigned char *) alloca (2 * len); textual_run *runs = alloca_array (textual_run, len); @@ -1308,7 +1378,7 @@ nruns = separate_textual_runs (text_storage, runs, str, len); for (i = 0; i < nruns; i++) - width_so_far += mswindows_text_width_single_run (hdc, + width_so_far += mswindows_text_width_single_run (FRAME_MSWINDOWS_DC (f), cachel, runs + i); return width_so_far; @@ -1328,20 +1398,20 @@ Lisp_Object background_pixmap) { RECT rect = { x, y, x+width, y+height }; - HDC hdc = get_frame_dc (f, 1); if (!NILP (background_pixmap)) { - struct display_box db = { x, y, width, height }; - mswindows_update_dc (hdc, - fcolor, bcolor, background_pixmap); + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), + Qnil, fcolor, bcolor, background_pixmap); + mswindows_output_dibitmap_region - ( f, XIMAGE_INSTANCE (background_pixmap), &db, 0); + ( f, XIMAGE_INSTANCE (background_pixmap), + x, y, 0, 0, 0, 0, width, height, 0, TRUE); } else { - mswindows_update_dc (hdc, Qnil, fcolor, Qnil); - ExtTextOut (hdc, 0, 0, ETO_OPAQUE, + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, fcolor, Qnil); + ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); } @@ -1351,6 +1421,56 @@ #endif } +/***************************************************************************** + mswindows_clear_to_window_end + + Clear the area between ypos1 and ypos2. Each margin area and the + text area is handled separately since they may each have their own + background color. + ****************************************************************************/ +static void +mswindows_clear_to_window_end (struct window *w, int ypos1, int ypos2) +{ + int height = ypos2 - ypos1; + + if (height) + { + struct frame *f = XFRAME (w->frame); + Lisp_Object window; + int bflag = (window_needs_vertical_divider (w) ? 0 : 1); + layout_bounds bounds; + + bounds = calculate_display_line_boundaries (w, bflag); + XSETWINDOW (window, w); + + if (window_is_leftmost (w)) + redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), + ypos1, FRAME_BORDER_WIDTH (f), height); + + if (bounds.left_in - bounds.left_out > 0) + redisplay_clear_region (window, + get_builtin_face_cache_index (w, Vleft_margin_face), + bounds.left_out, ypos1, + bounds.left_in - bounds.left_out, height); + + if (bounds.right_in - bounds.left_in > 0) + redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1, + bounds.right_in - bounds.left_in, height); + + if (bounds.right_out - bounds.right_in > 0) + redisplay_clear_region (window, + get_builtin_face_cache_index (w, Vright_margin_face), + bounds.right_in, ypos1, + bounds.right_out - bounds.right_in, height); + + if (window_is_rightmost (w)) + redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), + ypos1, FRAME_BORDER_WIDTH (f), height); + } + +} + + /* XXX Implement me! */ static void mswindows_clear_frame (struct frame *f) @@ -1367,33 +1487,17 @@ void console_type_create_redisplay_mswindows (void) { - /* redisplay methods - display*/ + /* redisplay methods */ CONSOLE_HAS_METHOD (mswindows, text_width); CONSOLE_HAS_METHOD (mswindows, output_display_block); CONSOLE_HAS_METHOD (mswindows, divider_height); CONSOLE_HAS_METHOD (mswindows, eol_cursor_width); CONSOLE_HAS_METHOD (mswindows, output_vertical_divider); + CONSOLE_HAS_METHOD (mswindows, clear_to_window_end); CONSOLE_HAS_METHOD (mswindows, clear_region); CONSOLE_HAS_METHOD (mswindows, clear_frame); - CONSOLE_HAS_METHOD (mswindows, frame_output_begin); - CONSOLE_HAS_METHOD (mswindows, frame_output_end); + CONSOLE_HAS_METHOD (mswindows, output_begin); + CONSOLE_HAS_METHOD (mswindows, output_end); CONSOLE_HAS_METHOD (mswindows, flash); CONSOLE_HAS_METHOD (mswindows, ring_bell); - CONSOLE_HAS_METHOD (mswindows, bevel_area); - CONSOLE_HAS_METHOD (mswindows, output_string); - CONSOLE_HAS_METHOD (mswindows, output_pixmap); - - /* redisplay methods - printer */ - CONSOLE_HAS_METHOD (msprinter, frame_output_end); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, text_width); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_display_block); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, divider_height); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, eol_cursor_width); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_vertical_divider); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, clear_region); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, clear_frame); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, frame_output_begin); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, bevel_area); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_string); - CONSOLE_INHERITS_METHOD (msprinter, mswindows, output_pixmap); } diff -r 12e008d41344 -r 697ef44129c6 src/redisplay-output.c --- a/src/redisplay-output.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 11:20:41 2007 +0200 @@ -2,7 +2,6 @@ Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1995, 1996 Ben Wing. Copyright (C) 1996 Chuck Thompson. - Copyright (C) 1999 Andy Piper. This file is part of XEmacs. @@ -27,9 +26,6 @@ /* Author: Chuck Thompson */ -/* Heavily hacked for modularity, gutter and subwindow support by Andy - Piper. */ - #include <config.h> #include "lisp.h" @@ -47,17 +43,8 @@ int run_end_begin_glyphs); static void redisplay_output_display_block (struct window *w, struct display_line *dl, int block, int start, int end, int start_pixpos, - int cursor_start, int cursor_width, + int cursor_start, int cursor_width, int cursor_height); -static void redisplay_normalize_display_box (struct display_box* dest, - struct display_glyph_area* src); -static int redisplay_display_boxes_in_window_p (struct window* w, - struct display_box* db, - struct display_glyph_area* dga); -static void redisplay_clear_clipped_region (Lisp_Object locale, face_index findex, - struct display_box* dest, - struct display_glyph_area* glyphsrc, - int fullheight_p, Lisp_Object); /***************************************************************************** sync_rune_structs @@ -101,7 +88,7 @@ For the given LINE in window W, make the current display line equal the desired display line. ****************************************************************************/ -void +static void sync_display_line_structs (struct window *w, int line, int do_blocks, display_line_dynarr *cdla, display_line_dynarr *ddla) @@ -190,28 +177,10 @@ /* Do not compare the values of bufpos and endpos. They do not affect the display characteristics. */ - /* Note: (hanoi 6) spends 95% of its time in redisplay, and about - 30% here. Not using bitfields for rune.type alone gives a redisplay - speed up of 10%. - - #### In profile arcs run of a normal Gnus session this function - is run 6.76 million times, only to return 1 in 6.73 million of - those. - - In addition a quick look GCC sparc assembly shows that GCC is not - doing a good job here. - 1. The function is not inlined (too complicated?) - 2. It seems to be reloading the crb and drb variables all the - time. - 3. It doesn't seem to notice that the second half of these if's - are really a switch statement. - - So I (JV) conjecture - - #### It would really be worth it to arrange for this function to - be (almost) a single call to memcmp. */ - - if (crb->xpos != drb->xpos) + if ((crb->findex != drb->findex) || + (WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))) + return 0; + else if (crb->xpos != drb->xpos) return 0; else if (crb->width != drb->width) return 0; @@ -222,78 +191,14 @@ else if (crb->type == RUNE_CHAR && (crb->object.chr.ch != drb->object.chr.ch)) return 0; - else if (crb->type == RUNE_HLINE && - (crb->object.hline.thickness != drb->object.hline.thickness || - crb->object.hline.yoffset != drb->object.hline.yoffset)) - return 0; else if (crb->type == RUNE_DGLYPH && (!EQ (crb->object.dglyph.glyph, drb->object.dglyph.glyph) || !EQ (crb->object.dglyph.extent, drb->object.dglyph.extent) || crb->object.dglyph.xoffset != drb->object.dglyph.xoffset)) return 0; - /* Only check dirtiness if we know something has changed. */ - else if (crb->type == RUNE_DGLYPH && - (XGLYPH_DIRTYP (crb->object.dglyph.glyph) || - crb->findex != drb->findex)) - { - /* We need some way of telling redisplay_output_layout () that the - only reason we are outputting it is because something has - changed internally. That way we can optimize whether we need - to clear the layout first and also only output the components - that have changed. The image_instance dirty flag and - display_hash are no good to us because these will invariably - have been set anyway if the layout has changed. So it looks - like we need yet another change flag that we can set here and - then clear in redisplay_output_layout (). */ - Lisp_Object window, image; - Lisp_Image_Instance* ii; - XSETWINDOW (window, w); - image = glyph_image_instance (crb->object.dglyph.glyph, - window, ERROR_ME_NOT, 1); - - if (!IMAGE_INSTANCEP (image)) - return 0; - ii = XIMAGE_INSTANCE (image); - - if (TEXT_IMAGE_INSTANCEP (image) && - (crb->findex != drb->findex || - WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))) - return 0; - - /* It is quite common of the two glyphs to be EQ since in many - cases they will actually be the same object. This does not - mean, however, that nothing has changed. We therefore need to - check the current hash of the glyph against the last recorded - display hash and the pending display items. See - update_subwindow (). */ - if (image_instance_changed (image) || - crb->findex != drb->findex || - WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)) - { - /* We now now we are going to re-output the glyph, but since - this is for some internal reason not related to geometry - changes, send a hint to the output routines that they can - take some short cuts. This is most useful for - layouts. This flag should get reset by the output - routines. - - #### It is possible for us to get here when the - face_cachel is dirty. I do not know what the implications - of this are.*/ - IMAGE_INSTANCE_OPTIMIZE_OUTPUT (ii) = 1; - return 0; - } - else - return 1; - } - /* We now do this last so that glyph checks can do their own thing - for face changes. Face changes quite often happen when we are - trying to output something in the gutter, this would normally - lead to a lot of flashing. The indices can quite often be - different and yet the faces are the same, we do not want to - re-output in this instance. */ - else if (crb->findex != drb->findex || - WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)) + else if (crb->type == RUNE_HLINE && + (crb->object.hline.thickness != drb->object.hline.thickness || + crb->object.hline.yoffset != drb->object.hline.yoffset)) return 0; else return 1; @@ -446,14 +351,8 @@ force = 1; if (f->windows_structure_changed || - /* #### Why is this so? We have face cachels so that we don't - have to recalculate all the display blocks when faces - change. I have fixed this for glyphs and am inclined to think - that faces should "Just Work", but I'm not feeling brave - today. Maybe its because the face cachels represent merged - faces rather than simply instantiations in a particular - domain. */ f->faces_changed || + f->glyphs_changed || cdl->ypos != ddl->ypos || cdl->ascent != ddl->ascent || cdl->descent != ddl->descent || @@ -690,46 +589,35 @@ (cdl && (cdl->ypos != ddl->ypos || cdl->ascent != ddl->ascent || cdl->descent != ddl->descent || - cdl->top_clip != ddl->top_clip || cdl->clip != ddl->clip))) { int x, y, width, height; - face_index findex; + Lisp_Object face; must_sync = 1; x = start_pixpos; - y = DISPLAY_LINE_YPOS (ddl); + y = ddl->ypos - ddl->ascent; width = min (next_start_pixpos, block_end) - x; - height = DISPLAY_LINE_HEIGHT (ddl); + height = ddl->ascent + ddl->descent - ddl->clip; if (x < ddl->bounds.left_in) - { - findex = ddl->left_margin_findex ? - ddl->left_margin_findex - : get_builtin_face_cache_index (w, Vleft_margin_face); - } + face = Vleft_margin_face; else if (x < ddl->bounds.right_in) - { - /* no check here because DEFAULT_INDEX == 0 anyway */ - findex = ddl->default_findex; - } + face = Vdefault_face; else if (x < ddl->bounds.right_out) - { - findex = ddl->right_margin_findex ? - ddl->right_margin_findex - : get_builtin_face_cache_index (w, Vright_margin_face); - } + face = Vright_margin_face; else - findex = (face_index) -1; + face = Qnil; - if (findex != (face_index) -1) + if (!NILP (face)) { Lisp_Object window; XSETWINDOW (window, w); /* Clear the empty area. */ - redisplay_clear_region (window, findex, x, y, width, height); + redisplay_clear_region (window, get_builtin_face_cache_index (w, face), + x, y, width, height); /* Mark that we should clear the border. This is necessary because italic fonts may leave @@ -760,11 +648,7 @@ region or if it was a block of a different type, then output the entire ddb. Otherwise, compare cdb and ddb and output only the changed region. */ - if (!force && cdb && ddb->type == cdb->type - /* If there was no buffer being display before the - compare anyway as we might be outputting a gutter. */ - && - (b == old_b || !old_b)) + if (!force && cdb && ddb->type == cdb->type && b == old_b) { must_sync |= compare_display_blocks (w, cdl, ddl, old_block, block, start_pixpos, @@ -802,7 +686,7 @@ cursor_start, cursor_width, cursor_height); } - + start_pixpos = next_start_pixpos; } } @@ -815,23 +699,19 @@ if (f->windows_structure_changed || f->faces_changed || clear_border || f->clear) { - int y = DISPLAY_LINE_YPOS (ddl); - int height = DISPLAY_LINE_HEIGHT (ddl); + int y = ddl->ypos - ddl->ascent; + int height = ddl->ascent + ddl->descent - ddl->clip; - /* If we are in the gutter then we musn't clear the borders. */ - if (y >= WINDOW_TEXT_TOP (w) && (y + height) <= WINDOW_TEXT_BOTTOM (w)) + if (ddl->modeline) { - if (ddl->modeline) - { - y -= MODELINE_SHADOW_THICKNESS (w); - height += (2 * MODELINE_SHADOW_THICKNESS (w)); - } + y -= MODELINE_SHADOW_THICKNESS (w); + height += (2 * MODELINE_SHADOW_THICKNESS (w)); + } - if (window_is_leftmost (w)) - clear_left_border (w, y, height); - if (window_is_rightmost (w)) - clear_right_border (w, y, height); - } + if (window_is_leftmost (w)) + clear_left_border (w, y, height); + if (window_is_rightmost (w)) + clear_right_border (w, y, height); } if (cdla) @@ -898,11 +778,16 @@ } else { - { - MAYBE_DEVMETH (d, frame_output_begin, (f)); - MAYBE_DEVMETH (d, window_output_begin, (w)); - } - rb->cursor_type = CURSOR_OFF; + DEVMETH (d, output_begin, (d)); + + /* #### This is a gross kludge. Cursor handling is such a royal + pain in the ass. */ + if (rb->type == RUNE_DGLYPH && + (EQ (rb->object.dglyph.glyph, Vtruncation_glyph) || + EQ (rb->object.dglyph.glyph, Vcontinuation_glyph))) + rb->cursor_type = NO_CURSOR; + else + rb->cursor_type = CURSOR_OFF; dl->cursor_elt = -1; output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width); } @@ -916,10 +801,7 @@ if (w != XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d)))) { if (!no_output_end) - { - MAYBE_DEVMETH (d, window_output_end, (w)); - MAYBE_DEVMETH (d, frame_output_end, (f)); - } + DEVMETH (d, output_end, (d)); return 1; } @@ -938,10 +820,7 @@ output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width); if (!no_output_end) - { - MAYBE_DEVMETH (d, window_output_end, (w)); - MAYBE_DEVMETH (d, frame_output_end, (f)); - } + DEVMETH (d, output_end, (d)); return 1; } else @@ -973,7 +852,7 @@ } } - while (up ? (cur_dl < Dynarr_length (cla)) : (cur_dl >= 0)) + while ((up ? (cur_dl < Dynarr_length (cla)) : (cur_dl >= 0))) { dl = Dynarr_atp (cla, cur_dl); db = get_display_block_from_line (dl, TEXT); @@ -1005,10 +884,7 @@ make_int (ADJ_BUFPOS), w->buffer); if (!no_output_end) - { - MAYBE_DEVMETH (d, window_output_end, (w)); - MAYBE_DEVMETH (d, frame_output_end, (f)); - } + DEVMETH (d, output_end, (d)); return 1; } @@ -1021,10 +897,7 @@ } if (!no_output_end) - { - MAYBE_DEVMETH (d, window_output_end, (w)); - MAYBE_DEVMETH (d, frame_output_end, (f)); - } + DEVMETH (d, output_end, (d)); return 0; } #undef ADJ_BUFPOS @@ -1079,18 +952,12 @@ (f, dl->ypos - 1, rb->xpos)); if (run_end_begin_meths) - { - MAYBE_DEVMETH (d, frame_output_begin, (f)); - MAYBE_DEVMETH (d, window_output_begin, (w)); - } + DEVMETH (d, output_begin, (d)); output_display_line (w, 0, dla, y, rb->xpos, rb->xpos + rb->width); if (run_end_begin_meths) - { - MAYBE_DEVMETH (d, window_output_end, (w)); - MAYBE_DEVMETH (d, frame_output_end, (f)); - } + DEVMETH (d, output_end, (d)); } } @@ -1128,63 +995,35 @@ { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); - /* Temporarily disabled until generalization is done. */ -#if 0 - struct display_block *db = Dynarr_atp (dl->display_blocks, block); - rune_dynarr *rba = db->runes; - struct rune *rb; - int xpos, width; - rb = Dynarr_atp (rba, start); - if (!rb) - /* Nothing to do so don't do anything. */ - return; - - xpos = max (start_pixpos, rb->xpos); - - if (end < 0) - end = Dynarr_length (rba); - - rb = Dynarr_atp (rba, end - 1); - width = rb->xpos + rb->width - xpos; -#endif - /* now actually output the block. */ DEVMETH (d, output_display_block, (w, dl, block, start, end, start_pixpos, cursor_start, cursor_width, cursor_height)); } - + /**************************************************************************** redisplay_unmap_subwindows Remove subwindows from the area in the box defined by the given parameters. ****************************************************************************/ -static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height, - Lisp_Object ignored_window) +static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height) { - Lisp_Object rest; + int elt; - LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) + for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) { - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest)); + struct subwindow_cachel *cachel = + Dynarr_atp (f->subwindow_cachels, elt); - if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) + if (cachel->being_displayed && - IMAGE_INSTANCE_DISPLAY_X (ii) - + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) > x - && - IMAGE_INSTANCE_DISPLAY_X (ii) < x + width + cachel->x + cachel->width > x && cachel->x < x + width && - IMAGE_INSTANCE_DISPLAY_Y (ii) - + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) > y - && - IMAGE_INSTANCE_DISPLAY_Y (ii) < y + height - && - !EQ (XCAR (rest), ignored_window)) + cachel->y + cachel->height > y && cachel->y < y + height) { - unmap_subwindow (XCAR (rest)); + unmap_subwindow (cachel->subwindow); } } } @@ -1197,382 +1036,81 @@ ****************************************************************************/ void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height) { - if (!NILP (XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))) + if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f))) { - redisplay_unmap_subwindows (f, x, y, width, height, Qnil); - } -} - -static void redisplay_unmap_subwindows_except_us (struct frame* f, int x, int y, int width, - int height, Lisp_Object subwindow) -{ - if (!NILP (XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))) - { - redisplay_unmap_subwindows (f, x, y, width, height, subwindow); + redisplay_unmap_subwindows (f, x, y, width, height); } } /**************************************************************************** redisplay_output_subwindow + output a subwindow. This code borrows heavily from the pixmap stuff, although is much simpler not needing to account for partial pixmaps, backgrounds etc. ****************************************************************************/ void -redisplay_output_subwindow (struct window *w, - Lisp_Object image_instance, - struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height) +redisplay_output_subwindow (struct window *w, struct display_line *dl, + Lisp_Object image_instance, int xpos, int xoffset, + int start_pixpos, int width, face_index findex, + int cursor_start, int cursor_width, int cursor_height) { - Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); Lisp_Object window; - struct display_glyph_area sdga; - - dga->height = IMAGE_INSTANCE_HEIGHT (p); - dga->width = IMAGE_INSTANCE_WIDTH (p); - - /* The first thing we are going to do is update the display - characteristics of the subwindow. This also clears the dirty - flags as a side effect. */ - update_subwindow (image_instance); - - /* This makes the glyph area fit into the display area. */ - if (!redisplay_normalize_glyph_area (db, dga)) - return; - - XSETWINDOW (window, w); - - /* Clear the area the subwindow is going into. */ - redisplay_clear_clipped_region (window, findex, - db, dga, 0, image_instance); - - /* This shrinks the display box to exactly enclose the glyph - area. */ - redisplay_normalize_display_box (db, dga); - - /* if we can't view the whole window we can't view any of it. We - have to be careful here since we may be being asked to display - part of a subwindow, the rest of which is on-screen as well. We - need to allow this case and map the entire subwindow. We also - need to be careful since the subwindow could be outside the - window in the gutter or modeline - we also need to allow these - cases.*/ - sdga.xoffset = -dga->xoffset; - sdga.yoffset = -dga->yoffset; - sdga.height = IMAGE_INSTANCE_HEIGHT (p); - sdga.width = IMAGE_INSTANCE_WIDTH (p); - if (redisplay_display_boxes_in_window_p (w, db, &sdga) < 0) - { - map_subwindow (image_instance, db->xpos, db->ypos, dga); - } - else - { - sdga.xoffset = sdga.yoffset = 0; - map_subwindow (image_instance, db->xpos - dga->xoffset, - db->ypos - dga->yoffset, &sdga); - } -} - -/**************************************************************************** - redisplay_output_layout - - Output a widget hierarchy. This can safely call itself recursively. - - The complexity of outputting layouts is deciding whether to do it or - not. Consider a layout enclosing some text, the text changes and is - marked as dirty, but the enclosing layout has not been marked as - dirty so no updates occur and the text will potentially be truncated. - Alternatively we hold a back pointer in the image instance to the - parent and mark the parent as dirty. But the layout code assumes that - if the layout is dirty then the whole layout should be redisplayed, - so we then get lots of flashing even though only the text has changed - size. Of course if the text shrinks in size then we do actually need - to redisplay the layout to repaint the exposed area. So what happens - if we make a non-structural change like changing color? Either we - redisplay everything, or we redisplay nothing. These are exactly the - issues lwlib has to grapple with. We really need to know what has - actually changed and make a layout decision based on that. We also - really need to know what has changed so that we can only make the - neccessary changes in update_subwindow. This has all now been - implemented, Viva la revolution! - ****************************************************************************/ -void -redisplay_output_layout (struct window *w, - Lisp_Object image_instance, - struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height) -{ - Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); - Lisp_Object window, rest; - Emchar_dynarr *buf = Dynarr_new (Emchar); - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - int layout_height, layout_width; + int lheight = dl->ascent + dl->descent - dl->clip; + int pheight = ((int) IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p) > lheight ? lheight : + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p)); XSETWINDOW (window, w); - layout_height = glyph_height (image_instance, window); - layout_width = glyph_width (image_instance, window); - - dga->height = layout_height; - dga->width = layout_width; -#ifdef DEBUG_WIDGET_OUTPUT - printf ("outputing layout glyph %p\n", p); -#endif - /* This makes the glyph area fit into the display area. */ - if (!redisplay_normalize_glyph_area (db, dga)) - return; - - /* Highly dodgy optimization. We want to only output the whole - layout if we really have to. */ - if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p) - || IMAGE_INSTANCE_LAYOUT_CHANGED (p) - || IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) - || IMAGE_INSTANCE_SIZE_CHANGED (p) - || IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) + /* Clear the area the subwindow is going into. The subwindow itself + will always take care of the full width. We don't want to clear + where it is going to go in order to avoid flicker. So, all we + have to take care of is any area above or below the subwindow. Of + course this is rubbish if the subwindow has transparent areas + (for instance with frames). */ + /* #### We take a shortcut for now. We know that since we have + subwindow_offset hardwired to 0 that the subwindow is against the top + edge so all we have to worry about is below it. */ + if ((int) (dl->ypos - dl->ascent + pheight) < + (int) (dl->ypos + dl->descent - dl->clip)) { - /* First clear the area we are drawing into. This is the easiest - thing to do since we have many gaps that we have to make sure are - filled in. */ - redisplay_clear_clipped_region (window, findex, db, dga, 1, Qnil); - - /* Output a border if required */ - if (!NILP (IMAGE_INSTANCE_LAYOUT_BORDER (p))) - { - int edges = 0; - enum edge_style style; - int ypos = db->ypos; - int height = dga->height; - - if (dga->xoffset >= 0) - edges |= EDGE_LEFT; - if (dga->width - dga->xoffset == layout_width) - edges |= EDGE_RIGHT; - if (dga->yoffset >= 0) - edges |= EDGE_TOP; - if (dga->height - dga->yoffset == layout_height) - edges |= EDGE_BOTTOM; + int clear_x, clear_width; - if (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (p), Qetched_in)) - style = EDGE_ETCHED_IN; - else if (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (p), Qetched_out)) - style = EDGE_ETCHED_OUT; - else if (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (p), Qbevel_in)) - style = EDGE_BEVEL_IN; - else if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (p))) - { - style = EDGE_ETCHED_IN; - if (edges & EDGE_TOP) - { - ypos += XINT (IMAGE_INSTANCE_LAYOUT_BORDER (p)); - height -= XINT (IMAGE_INSTANCE_LAYOUT_BORDER (p)); - } - } - else - style = EDGE_BEVEL_OUT; - - MAYBE_DEVMETH (d, bevel_area, - (w, findex, db->xpos, - ypos, - dga->width, height, 2, edges, style)); - } - } - - /* This shrinks the display box to exactly enclose the glyph - area. */ - redisplay_normalize_display_box (db, dga); - - /* Flip through the widgets in the layout displaying as necessary */ - LIST_LOOP (rest, IMAGE_INSTANCE_LAYOUT_CHILDREN (p)) - { - Lisp_Object child = XCAR (rest); - - struct display_box cdb; - /* For losing HP-UX */ - cdb.xpos = db->xpos; - cdb.ypos = db->ypos; - cdb.width = db->width; - cdb.height = db->height; - - /* First determine if the image is visible at all */ - if (IMAGE_INSTANCEP (child)) - { - Lisp_Image_Instance* childii = XIMAGE_INSTANCE (child); - - /* The enclosing layout offsets are +ve at this point */ - struct display_glyph_area cdga; - cdga.xoffset = IMAGE_INSTANCE_XOFFSET (childii) - dga->xoffset; - cdga.yoffset = IMAGE_INSTANCE_YOFFSET (childii) - dga->yoffset; - cdga.width = glyph_width (child, window); - cdga.height = glyph_height (child, window); - - IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = - IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p); - - /* Although normalization is done by the output routines - we have to do it here so that they don't try and - clear all of db. This is true below also. */ - if (redisplay_normalize_glyph_area (&cdb, &cdga)) - { - redisplay_normalize_display_box (&cdb, &cdga); - /* Since the display boxes will now be totally in the - window if they are visible at all we can now check this easily. */ - if (cdb.xpos < db->xpos || cdb.ypos < db->ypos - || cdb.xpos + cdb.width > db->xpos + db->width - || cdb.ypos + cdb.height > db->ypos + db->height) - continue; - /* We have to invert the offset here as normalization - will have made them positive which the output - routines will treat as a truly +ve offset. */ - cdga.xoffset = -cdga.xoffset; - cdga.yoffset = -cdga.yoffset; + int clear_y = dl->ypos - dl->ascent + pheight; + int clear_height = lheight - pheight; - switch (IMAGE_INSTANCE_TYPE (childii)) - { - case IMAGE_TEXT: - { - /* #### This is well hacked and could use some - generalisation.*/ - if (redisplay_normalize_glyph_area (&cdb, &cdga) - && - (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) || - IMAGE_INSTANCE_DIRTYP (childii))) - { - struct display_line dl; /* this is fake */ - Lisp_Object string = - IMAGE_INSTANCE_TEXT_STRING (childii); - unsigned char charsets[NUM_LEADING_BYTES]; - struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex); - - find_charsets_in_bufbyte_string (charsets, - XSTRING_DATA (string), - XSTRING_LENGTH (string)); - ensure_face_cachel_complete (cachel, window, charsets); - - convert_bufbyte_string_into_emchar_dynarr - (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); - - redisplay_normalize_display_box (&cdb, &cdga); - /* Offsets are now +ve again so be careful - when fixing up the display line. */ - xzero (dl); - /* Munge boxes into display lines. */ - dl.ypos = (cdb.ypos - cdga.yoffset) - + glyph_ascent (child, window); - dl.ascent = glyph_ascent (child, window); - dl.descent = glyph_descent (child, window); - dl.top_clip = cdga.yoffset; - dl.clip = (dl.ypos + dl.descent) - (cdb.ypos + cdb.height); - /* output_string doesn't understand offsets in - the same way as other routines - we have to - add the offset to the width so that we - output the full string. */ - MAYBE_DEVMETH (d, output_string, (w, &dl, buf, cdb.xpos, - cdga.xoffset, cdb.xpos, - cdga.width + cdga.xoffset, - findex, 0, 0, 0, 0)); - Dynarr_reset (buf); - } - } - break; - - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) - || IMAGE_INSTANCE_DIRTYP (childii)) - redisplay_output_pixmap (w, child, &cdb, &cdga, findex, - 0, 0, 0, 0); - break; - - case IMAGE_WIDGET: - if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (childii), Qlayout)) - { - redisplay_output_layout (w, child, &cdb, &cdga, findex, - 0, 0, 0); - break; - } - case IMAGE_SUBWINDOW: - if (!IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) || - IMAGE_INSTANCE_DIRTYP (childii)) - redisplay_output_subwindow (w, child, &cdb, &cdga, findex, - 0, 0, 0); - break; + if (start_pixpos >= 0 && start_pixpos > xpos) + { + clear_x = start_pixpos; + clear_width = xpos + width - start_pixpos; + } + else + { + clear_x = xpos; + clear_width = width; + } - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - case IMAGE_POINTER: - default: - abort (); - } - } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = 0; - } + redisplay_clear_region (window, findex, clear_x, clear_y, + clear_width, clear_height); } - - /* Update any display properties. I'm not sure whether this actually - does anything for layouts except clear the changed flags. */ - update_subwindow (image_instance); - - Dynarr_free (buf); -} - -/**************************************************************************** - redisplay_output_pixmap - - - output a pixmap. - ****************************************************************************/ -void -redisplay_output_pixmap (struct window *w, - Lisp_Object image_instance, - struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int offset_bitmap) -{ - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); - Lisp_Object window; - XSETWINDOW (window, w); - - dga->height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p); - dga->width = IMAGE_INSTANCE_PIXMAP_WIDTH (p); - - /* This makes the glyph area fit into the display area. */ - if (!redisplay_normalize_glyph_area (db, dga)) - return; - - /* Clear the area the pixmap is going into. The pixmap itself will - always take care of the full width. We don't want to clear where - it is going to go in order to avoid flicker. So, all we have to - take care of is any area above or below the pixmap. If the pixmap - has a mask in which case we have to clear the whole damn thing - since we can't yet clear just the area not included in the - mask. */ - if (!offset_bitmap) +#if 0 + redisplay_clear_region (window, findex, xpos - xoffset, dl->ypos - dl->ascent, + width, lheight); +#endif + /* if we can't view the whole window we can't view any of it */ + if (IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p) > lheight + || + IMAGE_INSTANCE_SUBWINDOW_WIDTH (p) > width) { - redisplay_clear_clipped_region (window, findex, - db, dga, - (int)IMAGE_INSTANCE_PIXMAP_MASK (p), - Qnil); - - /* This shrinks the display box to exactly enclose the glyph - area. */ - redisplay_normalize_display_box (db, dga); + redisplay_clear_region (window, findex, xpos - xoffset, dl->ypos - dl->ascent, + width, lheight); + unmap_subwindow (image_instance); } - assert (db->xpos >= 0 && db->ypos >= 0); - - MAYBE_DEVMETH (d, output_pixmap, (w, image_instance, - db, dga, - findex, cursor_start, - cursor_width, cursor_height, - offset_bitmap)); + else + map_subwindow (image_instance, xpos - xoffset, dl->ypos - dl->ascent); } /**************************************************************************** @@ -1611,11 +1149,14 @@ d = XDEVICE (f->device); /* if we have subwindows in the region we have to unmap them */ - redisplay_unmap_subwindows_maybe (f, x, y, width, height); + if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f))) + { + redisplay_unmap_subwindows (f, x, y, width, height); + } /* #### This isn't quite right for when this function is called from the toolbar code. */ - + /* Don't use a backing pixmap in the border area */ if (x >= FRAME_LEFT_BORDER_END (f) && x < FRAME_RIGHT_BORDER_START (f) @@ -1623,11 +1164,11 @@ && y < FRAME_BOTTOM_BORDER_START (f)) { Lisp_Object temp; - + if (w) { temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex); - + if (IMAGE_INSTANCEP (temp) && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp))) { @@ -1639,14 +1180,14 @@ else { temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale); - + if (IMAGE_INSTANCEP (temp) && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp))) { background_pixmap = temp; } } - } + } if (!UNBOUNDP (background_pixmap) && XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0) @@ -1667,234 +1208,16 @@ fcolor = (w ? WINDOW_FACE_CACHEL_BACKGROUND (w, findex) : FACE_BACKGROUND (Vdefault_face, locale)); - + } - + if (UNBOUNDP (background_pixmap)) background_pixmap = Qnil; - - DEVMETH (d, clear_region, + + DEVMETH (d, clear_region, (locale, d, f, findex, x, y, width, height, fcolor, bcolor, background_pixmap)); } -/**************************************************************************** - redisplay_clear_clipped_region - - Clear the area in the dest display_box not covered by the src - display_glyph_area using the given face. This is a common occurance - for images shorter than the display line. Clipping can be played - around with by altering these. glyphsrc should be normalized. - ****************************************************************************/ -static void -redisplay_clear_clipped_region (Lisp_Object window, face_index findex, - struct display_box* dest, struct display_glyph_area* glyphsrc, - int fullheight_p, Lisp_Object ignored_subwindow) -{ - /* assume dest->xpos >= 0 */ - int clear_x; - struct frame* f = XFRAME (XWINDOW (window)->frame); - - if (glyphsrc->xoffset > 0) - { - clear_x = dest->xpos + glyphsrc->xoffset; - } - else - { - clear_x = dest->xpos; - } - - /* If we need the whole height cleared then just do it. */ - if (fullheight_p) - { - redisplay_clear_region (window, findex, clear_x, dest->ypos, - glyphsrc->width, dest->height); - } - else - { - int yoffset = (glyphsrc->yoffset > 0 ? glyphsrc->yoffset : 0); - - /* We need to make sure that subwindows are unmapped from the - whole area. */ - redisplay_unmap_subwindows_except_us (f, clear_x, dest->ypos, - glyphsrc->width, dest->height, - ignored_subwindow); - /* first the top box */ - if (yoffset > 0) - { - redisplay_clear_region (window, findex, clear_x, dest->ypos, - glyphsrc->width, yoffset); - - } - /* Then the bottom box */ - if (yoffset + glyphsrc->height < dest->height) - { - redisplay_clear_region (window, findex, clear_x, - dest->ypos + yoffset + glyphsrc->height, - glyphsrc->width, - dest->height - (yoffset + glyphsrc->height)); - - } - } -} - -/***************************************************************************** - redisplay_normalize_glyph_area - redisplay_normalize_display_box - - Calculate the visible box for displaying src in dest. - ****************************************************************************/ -int -redisplay_normalize_glyph_area (struct display_box* dest, - struct display_glyph_area* glyphsrc) -{ - if (dest->xpos + glyphsrc->xoffset > dest->xpos + dest->width - || - dest->ypos + glyphsrc->yoffset > dest->ypos + dest->height - || - -glyphsrc->xoffset >= glyphsrc->width - || - -glyphsrc->yoffset >= glyphsrc->height) - { - /* It's all clipped out */ - return 0; - } - - /* Horizontal offsets. This works because xoffset can be -ve as well as +ve */ - if (dest->xpos + glyphsrc->xoffset + glyphsrc->width > dest->xpos + dest->width) - { - if (glyphsrc->xoffset > 0) - glyphsrc->width = dest->width - glyphsrc->xoffset; - else - glyphsrc->width = dest->width; - } - - if (glyphsrc->xoffset < 0) - glyphsrc->width += glyphsrc->xoffset; - - /* Vertical offsets. This works because yoffset can be -ve as well as +ve */ - if (dest->ypos + glyphsrc->yoffset + glyphsrc->height > dest->ypos + dest->height) - { - if (glyphsrc->yoffset > 0) - glyphsrc->height = dest->height - glyphsrc->yoffset; - else - glyphsrc->height = dest->height; - } - - if (glyphsrc->yoffset < 0) - glyphsrc->height += glyphsrc->yoffset; - - return 1; -} - -static void -redisplay_normalize_display_box (struct display_box* dest, - struct display_glyph_area* glyphsrc) -{ - /* Adjust the destination area. At the end of this the destination - area will exactly enclose the glyph area. The only remaining - adjustment will be offsets into the glyph area. */ - - /* Horizontal adjustment. */ - if (glyphsrc->xoffset > 0) - { - dest->xpos += glyphsrc->xoffset; - dest->width -= glyphsrc->xoffset; - glyphsrc->xoffset = 0; - } - else - glyphsrc->xoffset = -glyphsrc->xoffset; - - if (glyphsrc->width < dest->width) - dest->width = glyphsrc->width; - - /* Vertical adjustment. */ - if (glyphsrc->yoffset > 0) - { - dest->ypos += glyphsrc->yoffset; - dest->height -= glyphsrc->yoffset; - glyphsrc->yoffset = 0; - } - else - glyphsrc->yoffset = -glyphsrc->yoffset; - - if (glyphsrc->height < dest->height) - dest->height = glyphsrc->height; -} - -/***************************************************************************** - redisplay_display_boxes_in_window_p - - Determine whether the require display_glyph_area is completely inside - the window. 0 means the display_box is not in the window. 1 means the - display_box and the display_glyph_area are in the window. -1 means - the display_box is in the window but the display_glyph_area is not. - ****************************************************************************/ -static int -redisplay_display_boxes_in_window_p (struct window* w, - struct display_box* db, - struct display_glyph_area* dga) -{ - int left = WINDOW_TEXT_LEFT (w); - int right = WINDOW_TEXT_RIGHT (w); - int top = WINDOW_TEXT_TOP (w); - int bottom = WINDOW_TEXT_BOTTOM (w); - - if (db->xpos < left || db->ypos < top - || db->xpos + db->width > right - || db->ypos + db->height > bottom) - /* We are not displaying in a window at all */ - return 0; - - if (db->xpos + dga->xoffset >= left - && - db->ypos + dga->yoffset >= top - && - db->xpos + dga->xoffset + dga->width <= right - && - db->ypos + dga->yoffset + dga->height <= bottom) - return 1; - - return -1; -} - -/***************************************************************************** - redisplay_calculate_display_boxes - - Convert from rune/display_line co-ordinates to display_box - co-ordinates. - ****************************************************************************/ -int -redisplay_calculate_display_boxes (struct display_line *dl, int xpos, - int xoffset, int start_pixpos, int width, - struct display_box* dest, - struct display_glyph_area* src) -{ - dest->xpos = xpos; - dest->ypos = DISPLAY_LINE_YPOS (dl); - dest->width = width; - dest->height = DISPLAY_LINE_HEIGHT (dl); - - src->xoffset = -xoffset; - src->yoffset = -dl->top_clip; - src->width = 0; - src->height = 0; - - if (start_pixpos >=0 && start_pixpos > xpos) - { - /* Oops, we're asking for a start outside of the displayable - area. */ - if (start_pixpos > xpos + width) - return 0; - dest->xpos = start_pixpos; - dest->width -= (start_pixpos - xpos); - /* Offsets are -ve when we want to clip pixels off the displayed - glyph. */ - src->xoffset -= (start_pixpos - xpos); - } - - return 1; -} - /***************************************************************************** redisplay_clear_top_of_window @@ -1930,63 +1253,6 @@ } /***************************************************************************** - redisplay_clear_to_window_end - - Clear the area between ypos1 and ypos2. Each margin area and the - text area is handled separately since they may each have their own - background color. - ****************************************************************************/ -void -redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2) -{ - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - - if (HAS_DEVMETH_P (d, clear_to_window_end)) - DEVMETH (d, clear_to_window_end, (w, ypos1, ypos2)); - else - { - int height = ypos2 - ypos1; - - if (height) - { - Lisp_Object window; - int bflag = 0 ; /* (window_needs_vertical_divider (w) ? 0 : 1);*/ - layout_bounds bounds; - - bounds = calculate_display_line_boundaries (w, bflag); - XSETWINDOW (window, w); - - if (window_is_leftmost (w)) - redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), - ypos1, FRAME_BORDER_WIDTH (f), height); - - if (bounds.left_in - bounds.left_out > 0) - redisplay_clear_region (window, - get_builtin_face_cache_index (w, Vleft_margin_face), - bounds.left_out, ypos1, - bounds.left_in - bounds.left_out, height); - - if (bounds.right_in - bounds.left_in > 0) - redisplay_clear_region (window, - DEFAULT_INDEX, - bounds.left_in, ypos1, - bounds.right_in - bounds.left_in, height); - - if (bounds.right_out - bounds.right_in > 0) - redisplay_clear_region (window, - get_builtin_face_cache_index (w, Vright_margin_face), - bounds.right_in, ypos1, - bounds.right_out - bounds.right_in, height); - - if (window_is_rightmost (w)) - redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), - ypos1, FRAME_BORDER_WIDTH (f), height); - } - } -} - -/***************************************************************************** redisplay_clear_bottom_of_window Clear window from right below the last display line to right above @@ -1998,6 +1264,7 @@ int min_start, int max_end) { struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); int ypos1, ypos2; int ddla_len = Dynarr_length (ddla); @@ -2041,7 +1308,7 @@ if (ypos2 <= ypos1) return; - redisplay_clear_to_window_end (w, ypos1, ypos2); + DEVMETH (d, clear_to_window_end, (w, ypos1, ypos2)); } /***************************************************************************** @@ -2061,7 +1328,7 @@ display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP); display_line_dynarr *ddla = window_display_lines (w, DESIRED_DISP); - MAYBE_DEVMETH (d, window_output_begin, (w)); + DEVMETH (d, output_begin, (d)); while (first_line <= last_line) { @@ -2146,8 +1413,14 @@ } #endif - redisplay_redraw_cursor (f, 0); - MAYBE_DEVMETH (d, window_output_end, (w)); + /* This has to be done after we've updated the values. We don't + call output_end for tty frames. Redisplay will do this after all + tty windows have been updated. This cuts down on cursor + flicker. */ + if (FRAME_TTY_P (f)) + redisplay_redraw_cursor (f, 0); + else + DEVMETH (d, output_end, (d)); } /***************************************************************************** @@ -2261,7 +1534,7 @@ } /* Perform any output initialization. */ - MAYBE_DEVMETH (d, window_output_begin, (w)); + DEVMETH (d, output_begin, (d)); /* If the window's structure has changed clear the internal border above it if it is topmost (the function will check). */ @@ -2284,7 +1557,7 @@ if (window_needs_vertical_divider (w) && (f->windows_structure_changed || f->clear)) { - MAYBE_DEVMETH (d, output_vertical_divider, (w, f->windows_structure_changed)); + DEVMETH (d, output_vertical_divider, (w, f->windows_structure_changed)); } /* Clear the rest of the window, if necessary. */ @@ -2318,43 +1591,15 @@ get invalidated when it should be. */ INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (d); - redisplay_redraw_cursor (f, 0); - MAYBE_DEVMETH (d, window_output_end, (w)); + /* We don't call output_end for tty frames. Redisplay will do this + after all tty windows have been updated. This cuts down on + cursor flicker. */ + if (FRAME_TTY_P (f)) + redisplay_redraw_cursor (f, 0); + else + DEVMETH (d, output_end, (d)); #ifdef HAVE_SCROLLBARS update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0); #endif } - -/***************************************************************************** - bevel_modeline - - Draw a 3d border around the modeline on window W. - ****************************************************************************/ -void -bevel_modeline (struct window *w, struct display_line *dl) -{ - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - int x, y, width, height; - int shadow_thickness = MODELINE_SHADOW_THICKNESS (w); - enum edge_style style; - - x = WINDOW_MODELINE_LEFT (w); - width = WINDOW_MODELINE_RIGHT (w) - x; - y = dl->ypos - dl->ascent - shadow_thickness; - height = dl->ascent + dl->descent + 2 * shadow_thickness; - - if (XINT (w->modeline_shadow_thickness) < 0) - { - style = EDGE_BEVEL_IN; - } - else - { - style = EDGE_BEVEL_OUT; - } - - MAYBE_DEVMETH (d, bevel_area, - (w, MODELINE_INDEX, x, y, width, height, shadow_thickness, - EDGE_ALL, style)); -} diff -r 12e008d41344 -r 697ef44129c6 src/redisplay-tty.c --- a/src/redisplay-tty.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/redisplay-tty.c Mon Aug 13 11:20:41 2007 +0200 @@ -53,12 +53,17 @@ invoking them correctly. */ /* # include <curses.h> */ /* # include <term.h> */ -EXTERN_C int tgetent (const char *, const char *); -EXTERN_C int tgetflag (const char *); -EXTERN_C int tgetnum (const char *); -EXTERN_C char *tgetstr (const char *, char **); -EXTERN_C void tputs (const char *, int, void (*)(int)); - +#ifdef __cplusplus +extern "C" { +#endif +extern int tgetent (CONST char *, CONST char *); +extern int tgetflag (CONST char *); +extern int tgetnum (CONST char *); +extern char *tgetstr (CONST char *, char **); +extern void tputs (CONST char *, int, void (*)(int)); +#ifdef __cplusplus +} +#endif #define FORCE_CURSOR_UPDATE(c) send_string_to_tty_console (c, 0, 0) #define OUTPUTN(c, a, n) \ do { \ @@ -102,7 +107,7 @@ column, so we use emchar_string_displayed_columns(). ****************************************************************************/ static int -tty_text_width (struct frame *f, struct face_cachel *cachel, const Emchar *str, +tty_text_width (struct frame *f, struct face_cachel *cachel, CONST Emchar *str, Charcount len) { return emchar_string_displayed_columns (str, len); @@ -133,40 +138,39 @@ } /***************************************************************************** - tty_frame_output_begin + tty_output_begin Perform any necessary initialization prior to an update. ****************************************************************************/ #ifdef DEBUG_XEMACS -void tty_frame_output_begin (struct frame *f); +void tty_output_begin (struct device *d); void #else static void #endif -tty_frame_output_begin (struct frame *f) +tty_output_begin (struct device *d) { #ifndef HAVE_TERMIOS /* Termcap requires `ospeed' to be a global variable so we have to always set it for whatever tty console we are actually currently working with. */ - ospeed = DEVICE_TTY_DATA (XDEVICE (FRAME_DEVICE (f)))->ospeed; + ospeed = DEVICE_TTY_DATA (d)->ospeed; #endif } /***************************************************************************** - tty_frame_output_end + tty_output_end Perform any necessary flushing of queues when an update has completed. ****************************************************************************/ #ifdef DEBUG_XEMACS -void tty_frame_output_end (struct frame *f); +void tty_output_end (struct device *d); void #else static void #endif -tty_frame_output_end (struct frame *f) +tty_output_end (struct device *d) { - struct device *d = XDEVICE (FRAME_DEVICE (f)); struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); CONSOLE_TTY_CURSOR_X (c) = CONSOLE_TTY_FINAL_CURSOR_X (c); @@ -329,28 +333,78 @@ window, ERROR_ME_NOT, 1); if (IMAGE_INSTANCEP (instance)) - { - switch (XIMAGE_INSTANCE_TYPE (instance)) + switch (XIMAGE_INSTANCE_TYPE (instance)) + { + case IMAGE_TEXT: { - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - case IMAGE_SUBWINDOW: - case IMAGE_WIDGET: - /* just do nothing here */ - break; + Bufbyte *temptemp; + Lisp_Object string = + XIMAGE_INSTANCE_TEXT_STRING (instance); + Bytecount len = XSTRING_LENGTH (string); + + /* In the unlikely instance that a garbage-collect + occurs during encoding, we at least need to + copy the string. + */ + temptemp = (Bufbyte *) alloca (len); + memcpy (temptemp, XSTRING_DATA (string), len); + { + int i; + + /* Now truncate the first rb->object.dglyph.xoffset + columns. */ + for (i = 0; i < rb->object.dglyph.xoffset;) + { +#ifdef MULE + Emchar ch = charptr_emchar (temptemp); + i += XCHARSET_COLUMNS (CHAR_CHARSET (ch)); +#else + i++; /* telescope this */ +#endif + INC_CHARPTR (temptemp); + } - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; + /* If we truncated one column too many, then + add a space at the beginning. */ + if (i > rb->object.dglyph.xoffset) + { + assert (i > 0); + *--temptemp = ' '; + i--; + } + len -= i; + } + + tty_output_bufbyte_string (w, dl, temptemp, len, + xpos, findex, 0); - case IMAGE_TEXT: - case IMAGE_POINTER: - default: - abort (); + if (xpos >= cursor_start + && (cursor_start < + xpos + (bufbyte_string_displayed_columns + (temptemp, len)))) + { + cmgoto (f, dl->ypos - 1, cursor_start); + } } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT - (XIMAGE_INSTANCE (instance)) = 0; - } + break; + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + case IMAGE_SUBWINDOW: + case IMAGE_WIDGET: + /* just do nothing here */ + break; + + case IMAGE_POINTER: + abort (); + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); + } xpos += rb->width; elt++; @@ -410,7 +464,7 @@ static void tty_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, + int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, Lisp_Object background_pixmap) { struct console *c = XCONSOLE (FRAME_CONSOLE (f)); @@ -511,7 +565,7 @@ clear_to_end (f); #else /* #### Not implemented. */ - stderr_out ("Not yet.\n"); + fprintf (stderr, "Not yet.\n"); #endif } tty_turn_off_frame_face (f, Vdefault_face); @@ -882,7 +936,7 @@ OUTPUT1_IF (c, TTY_SD (c).keypad_off); OUTPUT1_IF (c, TTY_SD (c).cursor_normal); OUTPUT1_IF (c, TTY_SD (c).end_motion); - tty_frame_output_end (XFRAME (CONSOLE_SELECTED_FRAME (c))); + tty_output_end (XDEVICE (CONSOLE_SELECTED_DEVICE (c))); } /***************************************************************************** @@ -895,11 +949,11 @@ { Lisp_Object dev = CONSOLE_SELECTED_DEVICE (c); - if (!NILP (dev)) + if (!GC_NILP (dev)) { Lisp_Object frm = DEVICE_SELECTED_FRAME (XDEVICE (dev)); - if (!NILP (frm)) + if (!GC_NILP (frm)) { struct frame *f = XFRAME (frm); @@ -909,7 +963,7 @@ /* And then stick the cursor there. */ tty_set_final_cursor_coords (f, f->height, 0); - tty_frame_output_end (f); + tty_output_end (XDEVICE (dev)); } } } @@ -920,7 +974,7 @@ /* FLAGS - these don't need to be console local since only one console - can be being updated at a time. */ + can be being updated at a time. */ static int insert_mode_on; /* nonzero if in insert mode */ static int standout_mode_on; /* nonzero if in standout mode */ static int underline_mode_on; /* nonzero if in underline mode */ @@ -1054,12 +1108,12 @@ CONSOLE_TTY_DATA (c)->term_entry_buffer = (char *) xmalloc (2044); bufptr = CONSOLE_TTY_DATA (c)->term_entry_buffer; -#ifdef SIGTTOU +#if !defined(WIN32) /* SIGTT* don't exist under win32 */ EMACS_BLOCK_SIGNAL (SIGTTOU); #endif status = tgetent (entry_buffer, terminal_type); -#ifdef SIGTTOU +#if !defined(WIN32) EMACS_UNBLOCK_SIGNAL (SIGTTOU); #endif #if 0 @@ -1250,8 +1304,7 @@ struct fkey_table { - const char *cap; - const char *name; + CONST char *cap, *name; }; /* Termcap capability names that correspond directly to X keysyms. @@ -1383,7 +1436,7 @@ char *sequence = tgetstr (keys[i].cap, address); if (sequence) Fdefine_key (function_key_map, - build_ext_string (sequence, Qbinary), + build_ext_string (sequence, FORMAT_BINARY), vector1 (intern (keys[i].name))); } @@ -1391,18 +1444,22 @@ describes F10, whereas othertimes it describes F0 and "k;" describes F10. We will attempt to politely accommodate both systems by testing for "k;", and if it is present, assuming that "k0" denotes F0, otherwise F10. - */ + */ { - const char *k_semi = tgetstr ("k;", address); - const char *k0 = tgetstr ("k0", address); + char *k_semi = tgetstr ("k;", address); + char *k0 = tgetstr ("k0", address); + CONST char *k0_name = "f10"; if (k_semi) - Fdefine_key (function_key_map, build_ext_string (k_semi, Qbinary), - vector1 (intern ("f10"))); + { + Fdefine_key (function_key_map, build_ext_string (k_semi, FORMAT_BINARY), + vector1 (intern ("f10"))); + k0_name = "f0"; + } if (k0) - Fdefine_key (function_key_map, build_ext_string (k0, Qbinary), - vector1 (intern (k_semi ? "f0" : "f10"))); + Fdefine_key (function_key_map, build_ext_string (k0, FORMAT_BINARY), + vector1 (intern (k0_name))); } /* Set up cookies for numbered function keys above f10. */ @@ -1425,46 +1482,47 @@ { sprintf (fkey, "f%d", i); Fdefine_key (function_key_map, - build_ext_string (sequence, Qbinary), + build_ext_string (sequence, FORMAT_BINARY), vector1 (intern (fkey))); } } } - } + } /* * Various mappings to try and get a better fit. */ -#define CONDITIONAL_REASSIGN(cap1, cap2, keyname) do { \ - if (!tgetstr (cap1, address)) \ - { \ - char *sequence = tgetstr (cap2, address); \ - if (sequence) \ - Fdefine_key (function_key_map, \ - build_ext_string (sequence, Qbinary), \ - vector1 (intern (keyname))); \ - } \ - } while (0) + { +#define CONDITIONAL_REASSIGN(cap1, cap2, sym) \ + if (!tgetstr (cap1, address)) \ + { \ + char *sequence = tgetstr (cap2, address); \ + if (sequence) \ + Fdefine_key (function_key_map, \ + build_ext_string (sequence, FORMAT_BINARY), \ + vector1 (intern (sym))); \ + } - /* if there's no key_next keycap, map key_npage to `next' keysym */ - CONDITIONAL_REASSIGN ("%5", "kN", "next"); - /* if there's no key_prev keycap, map key_ppage to `previous' keysym */ - CONDITIONAL_REASSIGN ("%8", "kP", "prior"); - /* if there's no key_dc keycap, map key_ic to `insert' keysym */ - CONDITIONAL_REASSIGN ("kD", "kI", "insert"); + /* if there's no key_next keycap, map key_npage to `next' keysym */ + CONDITIONAL_REASSIGN ("%5", "kN", "next"); + /* if there's no key_prev keycap, map key_ppage to `previous' keysym */ + CONDITIONAL_REASSIGN ("%8", "kP", "prior"); + /* if there's no key_dc keycap, map key_ic to `insert' keysym */ + CONDITIONAL_REASSIGN ("kD", "kI", "insert"); - /* IBM has their own non-standard dialect of terminfo. - If the standard name isn't found, try the IBM name. */ - CONDITIONAL_REASSIGN ("kB", "KO", "backtab"); - CONDITIONAL_REASSIGN ("@4", "kJ", "execute"); /* actually "action" */ - CONDITIONAL_REASSIGN ("@4", "kc", "execute"); /* actually "command" */ - CONDITIONAL_REASSIGN ("%7", "ki", "menu"); - CONDITIONAL_REASSIGN ("@7", "kw", "end"); - CONDITIONAL_REASSIGN ("F1", "k<", "f11"); - CONDITIONAL_REASSIGN ("F2", "k>", "f12"); - CONDITIONAL_REASSIGN ("%1", "kq", "help"); - CONDITIONAL_REASSIGN ("*6", "kU", "select"); + /* IBM has their own non-standard dialect of terminfo. + If the standard name isn't found, try the IBM name. */ + CONDITIONAL_REASSIGN ("kB", "KO", "backtab"); + CONDITIONAL_REASSIGN ("@4", "kJ", "execute"); /* actually "action" */ + CONDITIONAL_REASSIGN ("@4", "kc", "execute"); /* actually "command" */ + CONDITIONAL_REASSIGN ("%7", "ki", "menu"); + CONDITIONAL_REASSIGN ("@7", "kw", "end"); + CONDITIONAL_REASSIGN ("F1", "k<", "f11"); + CONDITIONAL_REASSIGN ("F2", "k>", "f12"); + CONDITIONAL_REASSIGN ("%1", "kq", "help"); + CONDITIONAL_REASSIGN ("*6", "kU", "select"); #undef CONDITIONAL_REASSIGN + } return Qnil; } @@ -1486,8 +1544,8 @@ CONSOLE_HAS_METHOD (tty, clear_to_window_end); CONSOLE_HAS_METHOD (tty, clear_region); CONSOLE_HAS_METHOD (tty, clear_frame); - CONSOLE_HAS_METHOD (tty, frame_output_begin); - CONSOLE_HAS_METHOD (tty, frame_output_end); + CONSOLE_HAS_METHOD (tty, output_begin); + CONSOLE_HAS_METHOD (tty, output_end); CONSOLE_HAS_METHOD (tty, flash); CONSOLE_HAS_METHOD (tty, ring_bell); CONSOLE_HAS_METHOD (tty, set_final_cursor_coords); diff -r 12e008d41344 -r 697ef44129c6 src/redisplay-x.c --- a/src/redisplay-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/redisplay-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,7 +40,6 @@ #include "debug.h" #include "faces.h" #include "frame.h" -#include "gutter.h" #include "redisplay.h" #include "sysdep.h" #include "window.h" @@ -54,10 +53,17 @@ #endif /* Number of pixels below each line. */ -int x_interline_space; /* #### implement me */ +/* #### implement me */ +int x_interline_space; #define EOL_CURSOR_WIDTH 5 +static void x_output_pixmap (struct window *w, struct display_line *dl, + Lisp_Object image_instance, int xpos, + int xoffset, + int start_pixpos, int width, face_index findex, + int cursor_start, int cursor_width, + int cursor_height); static void x_output_vertical_divider (struct window *w, int clear); static void x_output_blank (struct window *w, struct display_line *dl, struct rune *rb, int start_pixpos, @@ -72,6 +78,7 @@ int xpos, face_index findex); static void x_clear_frame (struct frame *f); static void x_clear_frame_windows (Lisp_Object window); +static void x_bevel_modeline (struct window *w, struct display_line *dl); /* Note: We do not use the Xmb*() functions and XFontSets. @@ -123,7 +130,7 @@ static int separate_textual_runs (unsigned char *text_storage, struct textual_run *run_storage, - const Emchar *str, Charcount len) + CONST Emchar *str, Charcount len) { Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a possible valid charset when @@ -188,7 +195,7 @@ char_converter.reg[0] = XCHARSET_ID (charset); char_converter.reg[1] = byte1; char_converter.reg[2] = byte2; - ccl_driver (&char_converter, 0, 0, 0, 0, CCL_MODE_ENCODING); + ccl_driver (&char_converter, 0, 0, 0, 0); byte1 = char_converter.reg[1]; byte2 = char_converter.reg[2]; } @@ -219,7 +226,7 @@ x_text_width_single_run (struct face_cachel *cachel, struct textual_run *run) { Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset); - Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst); + struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst); if (!fi->proportional_p) return fi->width * run->len; else @@ -241,7 +248,7 @@ */ static int -x_text_width (struct frame *f, struct face_cachel *cachel, const Emchar *str, +x_text_width (struct frame *f, struct face_cachel *cachel, CONST Emchar *str, Charcount len) { int width_so_far = 0; @@ -286,24 +293,24 @@ } /***************************************************************************** - x_window_output_begin + x_output_begin Perform any necessary initialization prior to an update. ****************************************************************************/ static void -x_window_output_begin (struct window *w) +x_output_begin (struct device *d) { } /***************************************************************************** - x_window_output_end + x_output_end Perform any necessary flushing of queues when an update has completed. ****************************************************************************/ static void -x_window_output_end (struct window *w) +x_output_end (struct device *d) { - XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w))); + XFlush (DEVICE_X_DISPLAY (d)); } /***************************************************************************** @@ -327,7 +334,7 @@ int elt = start; face_index findex; - int xpos, width = 0; + int xpos, width; Lisp_Object charset = Qunbound; /* Qnil is a valid charset when MULE is not defined */ @@ -335,13 +342,18 @@ rb = Dynarr_atp (rba, start); if (!rb) - /* Nothing to do so don't do anything. */ - return; - - findex = rb->findex; - xpos = rb->xpos; - if (rb->type == RUNE_CHAR) - charset = CHAR_CHARSET (rb->object.chr.ch); + { + /* Nothing to do so don't do anything. */ + return; + } + else + { + findex = rb->findex; + xpos = rb->xpos; + width = 0; + if (rb->type == RUNE_CHAR) + charset = CHAR_CHARSET (rb->object.chr.ch); + } if (end < 0) end = Dynarr_length (rba); @@ -400,10 +412,10 @@ else if (rb->object.chr.ch == '\n') { /* Clear in case a cursor was formerly here. */ - redisplay_clear_region (window, findex, xpos, - DISPLAY_LINE_YPOS (dl), - rb->width, - DISPLAY_LINE_HEIGHT (dl)); + int height = dl->ascent + dl->descent - dl->clip; + + redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent, + rb->width, height); elt++; } } @@ -437,11 +449,6 @@ else if (rb->type == RUNE_DGLYPH) { Lisp_Object instance; - struct display_box dbox; - struct display_glyph_area dga; - redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset, - start_pixpos, rb->width, - &dbox, &dga); XSETWINDOW (window, w); instance = glyph_image_instance (rb->object.dglyph.glyph, @@ -449,43 +456,52 @@ findex = rb->findex; if (IMAGE_INSTANCEP (instance)) - { - switch (XIMAGE_INSTANCE_TYPE (instance)) + switch (XIMAGE_INSTANCE_TYPE (instance)) + { + case IMAGE_TEXT: { - case IMAGE_MONO_PIXMAP: - case IMAGE_COLOR_PIXMAP: - redisplay_output_pixmap (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height, 0); - break; - - case IMAGE_WIDGET: - if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance), - Qlayout)) - { - redisplay_output_layout (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - break; - } - case IMAGE_SUBWINDOW: - redisplay_output_subwindow (w, instance, &dbox, &dga, findex, - cursor_start, cursor_width, - cursor_height); - break; - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - case IMAGE_TEXT: - case IMAGE_POINTER: - default: - abort (); + /* #### This is way losing. See the comment in + add_glyph_rune(). */ + Lisp_Object string = + XIMAGE_INSTANCE_TEXT_STRING (instance); + convert_bufbyte_string_into_emchar_dynarr + (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); + + x_output_string (w, dl, buf, xpos, + rb->object.dglyph.xoffset, + start_pixpos, -1, findex, + (rb->cursor_type == CURSOR_ON), + cursor_start, cursor_width, + cursor_height); + Dynarr_reset (buf); } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT - (XIMAGE_INSTANCE (instance)) = 0; - } + break; + + case IMAGE_MONO_PIXMAP: + case IMAGE_COLOR_PIXMAP: + x_output_pixmap (w, dl, instance, xpos, + rb->object.dglyph.xoffset, start_pixpos, + rb->width, findex, cursor_start, + cursor_width, cursor_height); + break; + + case IMAGE_POINTER: + abort (); + + case IMAGE_WIDGET: + case IMAGE_SUBWINDOW: + redisplay_output_subwindow (w, dl, instance, xpos, + rb->object.dglyph.xoffset, start_pixpos, + rb->width, findex, cursor_start, + cursor_width, cursor_height); + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); + } xpos += rb->width; elt++; @@ -506,41 +522,38 @@ && (f->clear || f->windows_structure_changed || w->shadow_thickness_changed)) - bevel_modeline (w, dl); + x_bevel_modeline (w, dl); Dynarr_free (buf); } /***************************************************************************** - x_bevel_area + x_bevel_modeline - Draw a shadows for the given area in the given face. + Draw a 3d border around the modeline on window W. ****************************************************************************/ static void -x_bevel_area (struct window *w, face_index findex, - int x, int y, int width, int height, - int shadow_thickness, int edges, enum edge_style style) +x_bevel_modeline (struct window *w, struct display_line *dl) { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); - - EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); Display *dpy = DEVICE_X_DISPLAY (d); Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); + EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); + GC top_shadow_gc, bottom_shadow_gc, background_gc; Pixel top_shadow_pixel, bottom_shadow_pixel, background_pixel; - Lisp_Object tmp_pixel; XColor tmp_color; + Lisp_Object tmp_pixel; + int x, y, width, height; XGCValues gcv; - GC top_shadow_gc, bottom_shadow_gc, background_gc; - + unsigned long mask; int use_pixmap = 0; int flip_gcs = 0; - unsigned long mask; + int shadow_thickness; - assert (shadow_thickness >=0); memset (&gcv, ~0, sizeof (XGCValues)); - tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); + tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX); tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); /* First, get the GC's. */ @@ -551,14 +564,12 @@ x_generate_shadow_pixels (f, &top_shadow_pixel, &bottom_shadow_pixel, background_pixel, ef->core.background_pixel); - tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); + tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, MODELINE_INDEX); tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); gcv.background = tmp_color.pixel; gcv.graphics_exposures = False; mask = GCForeground | GCBackground | GCGraphicsExposures; - /* If we can't distinguish one of the shadows (the color is the same as the - background), it's better to use a pixmap to generate a dithered gray. */ if (top_shadow_pixel == background_pixel || bottom_shadow_pixel == background_pixel) use_pixmap = 1; @@ -572,16 +583,15 @@ gray_width, gray_height, 1, 0, 1); } - tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); + tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX); tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); gcv.foreground = tmp_color.pixel; - /* this is needed because the GC draws with a pixmap here */ gcv.fill_style = FillOpaqueStippled; gcv.stipple = DEVICE_X_GRAY_PIXMAP (d); top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, (mask | GCStipple | GCFillStyle)); - tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); + tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, MODELINE_INDEX); tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); bottom_shadow_pixel = tmp_color.pixel; @@ -607,9 +617,7 @@ gcv.foreground = background_pixel; background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); - /* possibly revert the GC's This will give a depressed look to the - divider */ - if (style == EDGE_ETCHED_IN || style == EDGE_BEVEL_IN) + if (XINT (w->modeline_shadow_thickness) < 0) { GC temp; @@ -618,22 +626,15 @@ bottom_shadow_gc = temp; } - if (style == EDGE_ETCHED_IN || style == EDGE_ETCHED_OUT) - shadow_thickness /= 2; - - /* Draw the shadows around the divider line */ - x_output_shadows (f, x, y, width, height, - top_shadow_gc, bottom_shadow_gc, - background_gc, shadow_thickness, edges); + shadow_thickness = MODELINE_SHADOW_THICKNESS (w); - if (style == EDGE_ETCHED_IN || style == EDGE_ETCHED_OUT) - { - /* Draw the shadows around the divider line */ - x_output_shadows (f, x + shadow_thickness, y + shadow_thickness, - width - 2*shadow_thickness, height - 2*shadow_thickness, - bottom_shadow_gc, top_shadow_gc, - background_gc, shadow_thickness, edges); - } + x = WINDOW_MODELINE_LEFT (w); + width = WINDOW_MODELINE_RIGHT (w) - x; + y = dl->ypos - dl->ascent - shadow_thickness; + height = dl->ascent + dl->descent + 2 * shadow_thickness; + + x_output_shadows (f, x, y, width, height, top_shadow_gc, bottom_shadow_gc, + background_gc, shadow_thickness); } /***************************************************************************** @@ -670,7 +671,7 @@ { /* #### I fixed once case where this was getting it. It was a bad macro expansion (compiler bug). */ - stderr_out ("Help! x_get_gc got a bogus fg value! fg = "); + fprintf (stderr, "Help! x_get_gc got a bogus fg value! fg = "); debug_print (fg); fg = Qnil; } @@ -801,7 +802,7 @@ if (width < 0) width = x_text_width (f, cachel, Dynarr_atp (buf, 0), Dynarr_length (buf)); - height = DISPLAY_LINE_HEIGHT (dl); + height = dl->ascent + dl->descent - dl->clip; /* Regularize the variables passed in. */ @@ -814,10 +815,6 @@ xpos -= xoffset; - /* make sure the area we are about to display is subwindow free. */ - redisplay_unmap_subwindows_maybe (f, clip_start, DISPLAY_LINE_YPOS (dl), - clip_end - clip_start, DISPLAY_LINE_HEIGHT (dl)); - nruns = separate_textual_runs (text_storage, runs, Dynarr_atp (buf, 0), Dynarr_length (buf)); @@ -862,13 +859,13 @@ if (bgc) XFillRectangle (dpy, x_win, bgc, clip_start, - DISPLAY_LINE_YPOS (dl), clip_end - clip_start, + dl->ypos - dl->ascent, clip_end - clip_start, height); for (i = 0; i < nruns; i++) { Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset); - Lisp_Font_Instance *fi = XFONT_INSTANCE (font); + struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font); int this_width; int need_clipping; @@ -883,7 +880,7 @@ the given font. It is possible that a font is being displayed on a line taller than it is, so this would cause us to fail to clear some areas. */ - if ((int) fi->height < (int) (height + dl->clip + dl->top_clip)) + if ((int) fi->height < (int) (height + dl->clip)) { int clear_start = max (xpos, clip_start); int clear_end = min (xpos + this_width, clip_end); @@ -894,8 +891,8 @@ ypos1_string = dl->ypos - fi->ascent; ypos2_string = dl->ypos + fi->descent; - ypos1_line = DISPLAY_LINE_YPOS (dl); - ypos2_line = ypos1_line + DISPLAY_LINE_HEIGHT (dl); + ypos1_line = dl->ypos - dl->ascent; + ypos2_line = dl->ypos + dl->descent - dl->clip; /* Make sure we don't clear below the real bottom of the line. */ @@ -921,7 +918,7 @@ else { redisplay_clear_region (window, findex, clear_start, - DISPLAY_LINE_YPOS (dl), clear_end - clear_start, + dl->ypos - dl->ascent, clear_end - clear_start, height); } } @@ -954,7 +951,7 @@ clip_box[0].width = clip_end - clip_start; clip_box[0].height = height; - XSetClipRectangles (dpy, gc, clip_start, DISPLAY_LINE_YPOS (dl), + XSetClipRectangles (dpy, gc, clip_start, dl->ypos - dl->ascent, clip_box, 1, Unsorted); } @@ -1054,7 +1051,7 @@ clip_box[0].width = cursor_width; clip_box[0].height = height; - XSetClipRectangles (dpy, cgc, cursor_start, DISPLAY_LINE_YPOS (dl), + XSetClipRectangles (dpy, cgc, cursor_start, dl->ypos - dl->ascent, clip_box, 1, Unsorted); if (runs[i].dimension == 1) @@ -1114,12 +1111,12 @@ tmp_y = dl->ypos - bogusly_obtained_ascent_value; tmp_height = cursor_height; - if (tmp_y + tmp_height > (int) (DISPLAY_LINE_YPOS(dl) + height)) + if (tmp_y + tmp_height > (int) (dl->ypos - dl->ascent + height)) { - tmp_y = DISPLAY_LINE_YPOS (dl) + height - tmp_height; - if (tmp_y < (int) DISPLAY_LINE_YPOS (dl)) - tmp_y = DISPLAY_LINE_YPOS (dl); - tmp_height = DISPLAY_LINE_YPOS (dl) + height - tmp_y; + tmp_y = dl->ypos - dl->ascent + height - tmp_height; + if (tmp_y < (int) (dl->ypos - dl->ascent)) + tmp_y = dl->ypos - dl->ascent; + tmp_height = dl->ypos - dl->ascent + height - tmp_y; } if (need_clipping) @@ -1154,10 +1151,10 @@ } void -x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x, - int y, int xoffset, int yoffset, - int width, int height, unsigned long fg, unsigned long bg, - GC override_gc) +x_output_x_pixmap (struct frame *f, struct Lisp_Image_Instance *p, int x, + int y, int clip_x, int clip_y, int clip_width, + int clip_height, int width, int height, int pixmap_offset, + unsigned long fg, unsigned long bg, GC override_gc) { struct device *d = XDEVICE (f->device); Display *dpy = DEVICE_X_DISPLAY (d); @@ -1166,6 +1163,7 @@ GC gc; XGCValues gcv; unsigned long pixmap_mask; + int need_clipping = (clip_x || clip_y); if (!override_gc) { @@ -1179,16 +1177,17 @@ { gcv.function = GXcopy; gcv.clip_mask = IMAGE_INSTANCE_X_MASK (p); - gcv.clip_x_origin = x - xoffset; - gcv.clip_y_origin = y - yoffset; + gcv.clip_x_origin = x; + gcv.clip_y_origin = y - pixmap_offset; pixmap_mask |= (GCFunction | GCClipMask | GCClipXOrigin | GCClipYOrigin); - /* Can't set a clip rectangle because we already have a mask. + /* Can't set a clip rectangle below because we already have a mask. + We could conceivably create a new clipmask by zeroing out + everything outside the clip region. Is it worth it? Is it possible to get an equivalent effect by changing the args to XCopyArea below rather than messing with a clip box? - - dkindred@cs.cmu.edu - Yes. We don't clip at all now - andy@xemacs.org - */ + - dkindred@cs.cmu.edu */ + need_clipping = 0; } gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, pixmap_mask); @@ -1199,6 +1198,19 @@ /* override_gc might have a mask already--we don't want to nuke it. Maybe we can insist that override_gc have no mask, or use one of the suggestions above. */ + need_clipping = 0; + } + + if (need_clipping) + { + XRectangle clip_box[1]; + + clip_box[0].x = clip_x; + clip_box[0].y = clip_y; + clip_box[0].width = clip_width; + clip_box[0].height = clip_height; + + XSetClipRectangles (dpy, gc, x, y, clip_box, 1, Unsorted); } /* depth of 0 means it's a bitmap, not a pixmap, and we should use @@ -1207,32 +1219,125 @@ pixel values, instead of symbolic of fg/bg. */ if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0) { - XCopyArea (dpy, - IMAGE_INSTANCE_X_PIXMAP_SLICE - (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset, - yoffset, width, + XCopyArea (dpy, IMAGE_INSTANCE_X_PIXMAP (p), x_win, gc, 0, + pixmap_offset, width, height, x, y); } else { - XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE - (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, - xoffset, yoffset, width, height, x, y, 1L); + XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP (p), x_win, gc, 0, + (pixmap_offset < 0 + ? 0 + : pixmap_offset), + width, height, x, + (pixmap_offset < 0 + ? y - pixmap_offset + : y), + 1L); + } + + if (need_clipping) + { + XSetClipMask (dpy, gc, None); + XSetClipOrigin (dpy, gc, 0, 0); } } static void -x_output_pixmap (struct window *w, Lisp_Object image_instance, - struct display_box *db, struct display_glyph_area *dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int bg_pixmap) +x_output_pixmap (struct window *w, struct display_line *dl, + Lisp_Object image_instance, int xpos, int xoffset, + int start_pixpos, int width, face_index findex, + int cursor_start, int cursor_width, int cursor_height) { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); - Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + Lisp_Object window; Display *dpy = DEVICE_X_DISPLAY (d); Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); + int lheight = dl->ascent + dl->descent - dl->clip; + int pheight = ((int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p) > lheight ? lheight : + IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); + int pwidth = min (width + xoffset, (int) IMAGE_INSTANCE_PIXMAP_WIDTH (p)); + int clip_x, clip_y, clip_width, clip_height; + + /* The pixmap_offset is used to center the pixmap on lines which are + shorter than it is. This results in odd effects when scrolling + pixmaps off of the bottom. Let's try not using it. */ +#if 0 + int pixmap_offset = (int) (IMAGE_INSTANCE_PIXMAP_HEIGHT (p) - lheight) / 2; +#else + int pixmap_offset = 0; +#endif + + XSETWINDOW (window, w); + + if ((start_pixpos >= 0 && start_pixpos > xpos) || xoffset) + { + if (start_pixpos > xpos && start_pixpos > xpos + width) + return; + + clip_x = xoffset; + clip_width = width; + if (start_pixpos > xpos) + { + clip_x += (start_pixpos - xpos); + clip_width -= (start_pixpos - xpos); + } + } + else + { + clip_x = 0; + clip_width = 0; + } + + /* Place markers for possible future functionality (clipping the top + half instead of the bottom half; think pixel scrolling). */ + clip_y = 0; + clip_height = pheight; + + /* Clear the area the pixmap is going into. The pixmap itself will + always take care of the full width. We don't want to clear where + it is going to go in order to avoid flicker. So, all we have to + take care of is any area above or below the pixmap. */ + /* #### We take a shortcut for now. We know that since we have + pixmap_offset hardwired to 0 that the pixmap is against the top + edge so all we have to worry about is below it. */ + /* #### Unless the pixmap has a mask in which case we have to clear + the whole damn thing since we can't yet clear just the area not + included in the mask. */ + if (((int) (dl->ypos - dl->ascent + pheight) < + (int) (dl->ypos + dl->descent - dl->clip)) + || IMAGE_INSTANCE_X_MASK (p)) + { + int clear_x, clear_y, clear_width, clear_height; + + if (IMAGE_INSTANCE_X_MASK (p)) + { + clear_y = dl->ypos - dl->ascent; + clear_height = lheight; + } + else + { + clear_y = dl->ypos - dl->ascent + pheight; + clear_height = lheight - pheight; + } + + if (start_pixpos >= 0 && start_pixpos > xpos) + { + clear_x = start_pixpos; + clear_width = xpos + width - start_pixpos; + } + else + { + clear_x = xpos; + clear_width = width; + } + + redisplay_clear_region (window, findex, clear_x, clear_y, + clear_width, clear_height); + } /* Output the pixmap. */ { @@ -1244,19 +1349,20 @@ tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); tmp_bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); - x_output_x_pixmap (f, p, db->xpos, db->ypos, - dga->xoffset, dga->yoffset, - dga->width, dga->height, + x_output_x_pixmap (f, p, xpos - xoffset, dl->ypos - dl->ascent, clip_x, + clip_y, clip_width, clip_height, + pwidth, pheight, pixmap_offset, tmp_fcolor.pixel, tmp_bcolor.pixel, 0); } /* Draw a cursor over top of the pixmap. */ - if (cursor_width && cursor_height && (cursor_start >= db->xpos) + if (cursor_width && cursor_height && (cursor_start >= xpos) && !NILP (w->text_cursor_visible_p) - && (cursor_start < db->xpos + dga->width)) + && (cursor_start < xpos + pwidth)) { GC gc; int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); + int y = dl->ypos - dl->ascent; struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, get_builtin_face_cache_index @@ -1264,17 +1370,17 @@ gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); - if (cursor_width > db->xpos + dga->width - cursor_start) - cursor_width = db->xpos + dga->width - cursor_start; + if (cursor_width > xpos + pwidth - cursor_start) + cursor_width = xpos + pwidth - cursor_start; if (focus) { - XFillRectangle (dpy, x_win, gc, cursor_start, db->ypos, cursor_width, + XFillRectangle (dpy, x_win, gc, cursor_start, y, cursor_width, cursor_height); } else { - XDrawRectangle (dpy, x_win, gc, cursor_start, db->ypos, cursor_width, + XDrawRectangle (dpy, x_win, gc, cursor_start, y, cursor_width, cursor_height); } } @@ -1291,14 +1397,17 @@ struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); + EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); Display *dpy = DEVICE_X_DISPLAY (d); Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); + Pixel top_shadow_pixel, bottom_shadow_pixel, background_pixel; Lisp_Object tmp_pixel; XColor tmp_color; XGCValues gcv; - GC background_gc; - enum edge_style style; + GC top_shadow_gc, bottom_shadow_gc, background_gc; + int use_pixmap = 0; + int flip_gcs = 0; unsigned long mask; int x, y1, y2, width, shadow_thickness, spacing, line_width; face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face); @@ -1317,12 +1426,83 @@ tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); /* First, get the GC's. */ + top_shadow_pixel = tmp_color.pixel; + bottom_shadow_pixel = tmp_color.pixel; + background_pixel = tmp_color.pixel; + + x_generate_shadow_pixels (f, &top_shadow_pixel, &bottom_shadow_pixel, + background_pixel, ef->core.background_pixel); + + tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, div_face); + tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); gcv.background = tmp_color.pixel; - gcv.foreground = tmp_color.pixel; gcv.graphics_exposures = False; mask = GCForeground | GCBackground | GCGraphicsExposures; + + /* If we can't distinguish one of the shadows (the color is the same as the + background), it's better to use a pixmap to generate a dithered gray. */ + if (top_shadow_pixel == background_pixel || + bottom_shadow_pixel == background_pixel) + use_pixmap = 1; + + if (use_pixmap) + { + if (DEVICE_X_GRAY_PIXMAP (d) == None) + { + DEVICE_X_GRAY_PIXMAP (d) = + XCreatePixmapFromBitmapData (dpy, x_win, (char *) gray_bits, + gray_width, gray_height, 1, 0, 1); + } + + tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); + tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); + gcv.foreground = tmp_color.pixel; + /* this is needed because the GC draws with a pixmap here */ + gcv.fill_style = FillOpaqueStippled; + gcv.stipple = DEVICE_X_GRAY_PIXMAP (d); + top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, + (mask | GCStipple | GCFillStyle)); + + tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, div_face); + tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); + bottom_shadow_pixel = tmp_color.pixel; + + flip_gcs = (bottom_shadow_pixel == + WhitePixelOfScreen (DefaultScreenOfDisplay (dpy))); + } + else + { + gcv.foreground = top_shadow_pixel; + top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); + } + + gcv.foreground = bottom_shadow_pixel; + bottom_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); + + if (use_pixmap && flip_gcs) + { + GC tmp_gc = bottom_shadow_gc; + bottom_shadow_gc = top_shadow_gc; + top_shadow_gc = tmp_gc; + } + + gcv.foreground = background_pixel; background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); + /* possibly revert the GC's in case the shadow thickness is < 0. + This will give a depressed look to the divider */ + if (shadow_thickness < 0) + { + GC temp; + + temp = top_shadow_gc; + top_shadow_gc = bottom_shadow_gc; + bottom_shadow_gc = temp; + + /* better avoid a Bad Address XLib error ;-) */ + shadow_thickness = - shadow_thickness; + } + /* Clear the divider area first. This needs to be done when a window split occurs. */ if (clear) @@ -1333,20 +1513,11 @@ x + spacing + shadow_thickness, y1, line_width, y2 - y1); - if (shadow_thickness < 0) - { - shadow_thickness = -shadow_thickness; - style = EDGE_BEVEL_IN; - } - else - { - style = EDGE_BEVEL_OUT; - } - /* Draw the shadows around the divider line */ - x_bevel_area (w, div_face, x + spacing, y1, - width - 2 * spacing, y2 - y1, - shadow_thickness, EDGE_ALL, style); + x_output_shadows (f, x + spacing, y1, + width - 2 * spacing, y2 - y1, + top_shadow_gc, bottom_shadow_gc, + background_gc, shadow_thickness); } /***************************************************************************** @@ -1375,12 +1546,9 @@ buffer); int x = rb->xpos; - int y = DISPLAY_LINE_YPOS (dl); + int y = dl->ypos - dl->ascent; int width = rb->width; - int height = DISPLAY_LINE_HEIGHT (dl); - - /* Unmap all subwindows in the area we are going to blank. */ - redisplay_unmap_subwindows_maybe (f, x, y, width, height); + int height = dl->ascent + dl->descent - dl->clip; if (start_pixpos > x) { @@ -1418,7 +1586,7 @@ { int cursor_height, cursor_y; int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); - Lisp_Font_Instance *fi; + struct Lisp_Font_Instance *fi; fi = XFONT_INSTANCE (FACE_CACHEL_FONT (WINDOW_FACE_CACHEL (w, rb->findex), @@ -1474,10 +1642,10 @@ int x = rb->xpos; int width = rb->width; - int height = DISPLAY_LINE_HEIGHT (dl); + int height = dl->ascent + dl->descent - dl->clip; int ypos1, ypos2, ypos3, ypos4; - ypos1 = DISPLAY_LINE_YPOS (dl); + ypos1 = dl->ypos - dl->ascent; ypos2 = ypos1 + rb->object.hline.yoffset; ypos3 = ypos2 + rb->object.hline.thickness; ypos4 = dl->ypos + dl->descent - dl->clip; @@ -1516,7 +1684,7 @@ void x_output_shadows (struct frame *f, int x, int y, int width, int height, GC top_shadow_gc, GC bottom_shadow_gc, GC background_gc, - int shadow_thickness, int edges) + int shadow_thickness) { struct device *d = XDEVICE (f->device); @@ -1538,41 +1706,28 @@ for (elt = 0; elt < shadow_thickness; elt++) { int seg1 = elt; - int seg2 = (edges & EDGE_TOP) ? elt + shadow_thickness : elt; - int bot_seg2 = (edges & EDGE_BOTTOM) ? elt + shadow_thickness : elt; + int seg2 = elt + shadow_thickness; + + top_shadow[seg1].x1 = x; + top_shadow[seg1].x2 = x + width - elt - 1; + top_shadow[seg1].y1 = top_shadow[seg1].y2 = y + elt; - if (edges & EDGE_TOP) - { - top_shadow[seg1].x1 = x + elt; - top_shadow[seg1].x2 = x + width - elt - 1; - top_shadow[seg1].y1 = top_shadow[seg1].y2 = y + elt; - } - if (edges & EDGE_LEFT) - { - top_shadow[seg2].x1 = top_shadow[seg2].x2 = x + elt; - top_shadow[seg2].y1 = y + elt; - top_shadow[seg2].y2 = y + height - elt - 1; - } - if (edges & EDGE_BOTTOM) - { - bottom_shadow[seg1].x1 = x + elt; - bottom_shadow[seg1].x2 = x + width - elt - 1; - bottom_shadow[seg1].y1 = bottom_shadow[seg1].y2 = y + height - elt - 1; - } - if (edges & EDGE_RIGHT) - { - bottom_shadow[bot_seg2].x1 = bottom_shadow[bot_seg2].x2 = x + width - elt - 1; - bottom_shadow[bot_seg2].y1 = y + elt; - bottom_shadow[bot_seg2].y2 = y + height - elt - 1; - } + top_shadow[seg2].x1 = top_shadow[seg2].x2 = x + elt; + top_shadow[seg2].y1 = y + shadow_thickness; + top_shadow[seg2].y2 = y + height - elt - 1; + + bottom_shadow[seg1].x1 = x + elt + 1; + bottom_shadow[seg1].x2 = x + width - 1; + bottom_shadow[seg1].y1 = bottom_shadow[seg1].y2 = y + height - elt - 1; + + bottom_shadow[seg2].x1 = bottom_shadow[seg2].x2 = x + width - elt - 1; + bottom_shadow[seg2].y1 = y + elt + 1; + bottom_shadow[seg2].y2 = y + height - shadow_thickness; } - XDrawSegments (dpy, x_win, top_shadow_gc, top_shadow, - ((edges & EDGE_TOP) ? shadow_thickness : 0) - + ((edges & EDGE_LEFT) ? shadow_thickness : 0)); + XDrawSegments (dpy, x_win, top_shadow_gc, top_shadow, shadow_thickness * 2); XDrawSegments (dpy, x_win, bottom_shadow_gc, bottom_shadow, - ((edges & EDGE_BOTTOM) ? shadow_thickness : 0) - + ((edges & EDGE_RIGHT) ? shadow_thickness : 0)); + shadow_thickness * 2); } /***************************************************************************** @@ -1660,6 +1815,54 @@ } /***************************************************************************** + x_clear_to_window_end + + Clear the area between ypos1 and ypos2. Each margin area and the + text area is handled separately since they may each have their own + background color. + ****************************************************************************/ +static void +x_clear_to_window_end (struct window *w, int ypos1, int ypos2) +{ + int height = ypos2 - ypos1; + + if (height) + { + struct frame *f = XFRAME (w->frame); + Lisp_Object window; + int bflag = (window_needs_vertical_divider (w) ? 0 : 1); + layout_bounds bounds; + + bounds = calculate_display_line_boundaries (w, bflag); + XSETWINDOW (window, w); + + if (window_is_leftmost (w)) + redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), + ypos1, FRAME_BORDER_WIDTH (f), height); + + if (bounds.left_in - bounds.left_out > 0) + redisplay_clear_region (window, + get_builtin_face_cache_index (w, Vleft_margin_face), + bounds.left_out, ypos1, + bounds.left_in - bounds.left_out, height); + + if (bounds.right_in - bounds.left_in > 0) + redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1, + bounds.right_in - bounds.left_in, height); + + if (bounds.right_out - bounds.right_in > 0) + redisplay_clear_region (window, + get_builtin_face_cache_index (w, Vright_margin_face), + bounds.right_in, ypos1, + bounds.right_out - bounds.right_in, height); + + if (window_is_rightmost (w)) + redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), + ypos1, FRAME_BORDER_WIDTH (f), height); + } +} + +/***************************************************************************** x_redraw_exposed_window Given a bounding box for an area that needs to be redrawn, determine @@ -1776,7 +1979,6 @@ redraw anyhow. */ MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); #endif - redraw_exposed_gutters (f, x, y, width, height); if (!f->window_face_cache_reset) { @@ -1843,9 +2045,9 @@ WINDOW_BUFFER (w)); int x = xpos; - int y = DISPLAY_LINE_YPOS (dl); + int y = dl->ypos - dl->ascent; int width = EOL_CURSOR_WIDTH; - int height = DISPLAY_LINE_HEIGHT (dl); + int height = dl->ascent + dl->descent - dl->clip; int cursor_height, cursor_y; int defheight, defascent; @@ -1908,8 +2110,7 @@ return; } - redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w), - WINDOW_TEXT_BOTTOM (w)); + x_clear_to_window_end (w, WINDOW_TEXT_TOP (w), WINDOW_TEXT_BOTTOM (w)); } static void @@ -1971,7 +2172,6 @@ struct frame *f = device_selected_frame (d); struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f)); Widget shell = FRAME_X_SHELL_WIDGET (f); - int flash_height; XSETFRAME (frame, f); @@ -1988,22 +2188,8 @@ gcv.graphics_exposures = False; gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv, (GCForeground | GCFunction | GCGraphicsExposures)); - default_face_height_and_width (frame, &flash_height, 0); - - /* If window is tall, flash top and bottom line. */ - if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height) - { - XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, - w->pixel_width, flash_height); - XFillRectangle (dpy, win, gc, w->pixel_left, - w->pixel_top + w->pixel_height - flash_height, - w->pixel_width, flash_height); - } - else - /* If it is short, flash it all. */ - XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, - w->pixel_width, w->pixel_height); - + XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, + w->pixel_width, w->pixel_height); XSync (dpy, False); #ifdef HAVE_SELECT @@ -2023,20 +2209,8 @@ #endif /* HAVE_POLL */ #endif /* HAVE_SELECT */ - /* If window is tall, flash top and bottom line. */ - if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height) - { - XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, - w->pixel_width, flash_height); - XFillRectangle (dpy, win, gc, w->pixel_left, - w->pixel_top + w->pixel_height - flash_height, - w->pixel_width, flash_height); - } - else - /* If it is short, flash it all. */ - XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, - w->pixel_width, w->pixel_height); - + XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, + w->pixel_width, w->pixel_height); XSync (dpy, False); return 1; @@ -2093,13 +2267,11 @@ CONSOLE_HAS_METHOD (x, divider_height); CONSOLE_HAS_METHOD (x, eol_cursor_width); CONSOLE_HAS_METHOD (x, output_vertical_divider); + CONSOLE_HAS_METHOD (x, clear_to_window_end); CONSOLE_HAS_METHOD (x, clear_region); CONSOLE_HAS_METHOD (x, clear_frame); - CONSOLE_HAS_METHOD (x, window_output_begin); - CONSOLE_HAS_METHOD (x, window_output_end); + CONSOLE_HAS_METHOD (x, output_begin); + CONSOLE_HAS_METHOD (x, output_end); CONSOLE_HAS_METHOD (x, flash); CONSOLE_HAS_METHOD (x, ring_bell); - CONSOLE_HAS_METHOD (x, bevel_area); - CONSOLE_HAS_METHOD (x, output_string); - CONSOLE_HAS_METHOD (x, output_pixmap); } diff -r 12e008d41344 -r 697ef44129c6 src/redisplay.c --- a/src/redisplay.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,6 +40,7 @@ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "commands.h" @@ -50,7 +51,6 @@ #include "faces.h" #include "frame.h" #include "glyphs.h" -#include "gutter.h" #include "insdel.h" #include "menubar.h" #include "objects.h" @@ -63,10 +63,11 @@ #include "file-coding.h" #endif -#include "sysfile.h" - #ifdef HAVE_TTY #include "console-tty.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> /* for isatty() */ +#endif #endif /* HAVE_TTY */ /* Note: We have to be careful throughout this code to properly handle @@ -85,10 +86,16 @@ #define LEFT_GLYPHS 2 #define RIGHT_GLYPHS 3 +/* Set the vertical clip to 0 if we are currently updating the line + start cache. Otherwise for buffers of line height 1 it may fail to + be able to work properly because regenerate_window will not layout + a single line. */ #define VERTICAL_CLIP(w, display) \ - ((WINDOW_TTY_P (w) | (!display && scroll_on_clipped_lines)) \ + (updating_line_start_cache \ + ? 0 \ + : ((WINDOW_TTY_P (w) | (!display && scroll_on_clipped_lines)) \ ? INT_MAX \ - : vertical_clip) + : vertical_clip)) /* The following structures are completely private to redisplay.c so we put them here instead of in a header file, for modularity. */ @@ -100,9 +107,6 @@ /* This information is normally filled in by the create_*_block routines and is used by the add_*_rune routines. */ Lisp_Object window; - /* if we are working with strings rather than buffers we need a - handle to the string */ - Lisp_Object string; struct device *d; struct display_block *db; struct display_line *dl; @@ -146,10 +150,6 @@ (those off the left side of the screen) need to be skipped before anything is displayed. */ Bytind bi_start_col_enabled; - int start_col_xoffset; /* Number of pixels that still need to - be skipped. This is used for - horizontal scrolling of glyphs, where we want - to be able to scroll over part of the glyph. */ int hscroll_glyph_width_adjust; /* how much the width of the hscroll glyph differs from space_width (w). @@ -238,19 +238,25 @@ } prop_block_dynarr; +static void generate_formatted_string_db (Lisp_Object format_str, + Lisp_Object result_str, + struct window *w, + struct display_line *dl, + struct display_block *db, + face_index findex, int min_pixpos, + int max_pixpos, int type); static Charcount generate_fstring_runes (struct window *w, pos_data *data, Charcount pos, Charcount min_pos, Charcount max_pos, Lisp_Object elt, int depth, int max_pixsize, - face_index findex, int type, - Charcount *offset, - Lisp_Object cur_ext); + face_index findex, int type); static prop_block_dynarr *add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, int allow_cursor, struct glyph_cachel *cachel); static Bytind create_text_block (struct window *w, struct display_line *dl, - Bytind bi_start_pos, prop_block_dynarr **prop, + Bytind bi_start_pos, int start_col, + prop_block_dynarr **prop, int type); static int create_overlay_glyph_block (struct window *w, struct display_line *dl); @@ -287,6 +293,10 @@ isn't any reason we need more than a single set. */ display_line_dynarr *cmotion_display_lines; +/* Used by generate_formatted_string. Global because they get used so + much that the dynamic allocation time adds up. */ +Emchar_dynarr *formatted_string_emchar_dynarr; +struct display_line formatted_string_display_line; /* We store the extents that we need to generate in a Dynarr and then frob them all on at the end of generating the string. We do it this way rather than adding them as we generate the string because @@ -294,9 +304,9 @@ (to avoid having to resize the string multiple times), and we don't want to go around adding extents to a string when the extents might stretch off the end of the string. */ -static EXTENT_dynarr *formatted_string_extent_dynarr; -static Bytecount_dynarr *formatted_string_extent_start_dynarr; -static Bytecount_dynarr *formatted_string_extent_end_dynarr; +EXTENT_dynarr *formatted_string_extent_dynarr; +Bytecount_dynarr *formatted_string_extent_start_dynarr; +Bytecount_dynarr *formatted_string_extent_end_dynarr; /* #### probably temporary */ @@ -320,6 +330,9 @@ /* Minimum visible pixel width of clipped glyphs at right margin. */ int horizontal_clip; +/* Set if currently inside update_line_start_cache. */ +int updating_line_start_cache; + /* Nonzero means reading single-character input with prompt so put cursor on minibuffer after the prompt. */ int cursor_in_echo_area; @@ -353,15 +366,11 @@ int glyphs_changed; int glyphs_changed_set; -/* non-zero if any subwindow has been deleted. */ +/* non-zero if any displayed subwindow is in need of updating + somewhere. */ int subwindows_changed; int subwindows_changed_set; -/* non-zero if any displayed subwindow is in need of updating - somewhere. */ -int subwindows_state_changed; -int subwindows_state_changed_set; - /* This variable is 1 if the icon has to be updated. It is set to 1 when `frame-icon-glyph' changes. */ int icon_changed; @@ -392,10 +401,6 @@ int toolbar_changed; int toolbar_changed_set; -/* non-nil if any gutter has changed */ -int gutter_changed; -int gutter_changed_set; - /* non-nil if any window has changed since the last time redisplay completed */ int windows_changed; @@ -407,9 +412,10 @@ Lisp_Object Vbar_cursor; Lisp_Object Qbar_cursor; -Lisp_Object Vvisible_bell; /* If true and the terminal will support it - then the frame will flash instead of - beeping when an error occurs */ + +int visible_bell; /* If true and the terminal will support it + then the frame will flash instead of + beeping when an error occurs */ /* Nonzero means no need to redraw the entire frame on resuming a suspended Emacs. This is useful on terminals with multiple pages, @@ -436,12 +442,9 @@ Lisp_Object Voverlay_arrow_string; Lisp_Object Vwindow_size_change_functions; -Lisp_Object Vwindow_scroll_functions; +Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions; -Lisp_Object Qbuffer_list_changed_hook, Vbuffer_list_changed_hook; - - #define INHIBIT_REDISPLAY_HOOKS /* #### Until we've thought about this more. */ #ifndef INHIBIT_REDISPLAY_HOOKS @@ -451,7 +454,7 @@ Lisp_Object Qpre_redisplay_hook, Qpost_redisplay_hook; #endif /* INHIBIT_REDISPLAY_HOOKS */ -static int last_display_warning_tick, display_warning_tick; +int last_display_warning_tick, display_warning_tick; Lisp_Object Qdisplay_warning_buffer; int inhibit_warning_display; @@ -461,12 +464,6 @@ Lisp_Object Vtext_cursor_visible_p; int column_number_start_at_one; - -Lisp_Object Qtop_bottom; - -#define WINDOW_SCROLLED(w) \ -(w->hscroll > 0 || w->left_xoffset) - /***************************************************************************/ /* */ @@ -636,8 +633,8 @@ int pix_tab_width = tab_pix_width (w); /* Adjust n_pos for any hscrolling which has happened. */ - if (WINDOW_SCROLLED (w)) - n_pos -= space_width (w) * (w->hscroll - 1) + w->left_xoffset; + if (w->hscroll > 1) + n_pos -= space_width (w) * (w->hscroll - 1); while (n_pos <= start_pixpos) n_pos += pix_tab_width; @@ -689,7 +686,8 @@ static Bufpos generate_display_line (struct window *w, struct display_line *dl, int bounds, - Bufpos start_pos, prop_block_dynarr **prop, + Bufpos start_pos, int start_col, + prop_block_dynarr **prop, int type) { Bufpos ret_bufpos; @@ -722,7 +720,7 @@ /* #### urk urk urk!!! Chuck fix this shit! */ Bytind hacked_up_bytind = create_text_block (w, dl, bufpos_to_bytind (b, start_pos), - prop, type); + start_col, prop, type); if (hacked_up_bytind > BI_BUF_ZV (b)) ret_bufpos = BUF_ZV (b) + 1; else @@ -796,7 +794,7 @@ gb.glyph = Vhscroll_glyph; { int oldpixpos = data->pixpos; - retval = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, + retval = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 1, GLYPH_CACHEL (XWINDOW (data->window), HSCROLL_GLYPH_INDEX)); data->hscroll_glyph_width_adjust = @@ -852,7 +850,7 @@ Lisp_Object font_instance = ensure_face_cachel_contains_charset (cachel, data->window, charset); - Lisp_Font_Instance *fi; + struct Lisp_Font_Instance *fi; if (EQ (font_instance, Vthe_null_font_instance)) { @@ -904,19 +902,15 @@ crb->xpos = data->pixpos; crb->width = width; if (data->bi_bufpos) - { - if (NILP (data->string)) - crb->bufpos = - bytind_to_bufpos (XBUFFER (WINDOW_BUFFER (XWINDOW (data->window))), - data->bi_bufpos); - else - crb->bufpos = - bytecount_to_charcount (XSTRING_DATA (data->string), data->bi_bufpos); - } + crb->bufpos = + bytind_to_bufpos (XBUFFER (WINDOW_BUFFER (XWINDOW (data->window))), + data->bi_bufpos); else if (data->is_modeline) crb->bufpos = data->modeline_charpos; else - /* Text but not in buffer */ + /* fuckme if this shouldn't be an abort. */ + /* abort (); fuckme harder, this abort gets tripped quite often, + in propagation and whatnot. #### fixme */ crb->bufpos = 0; crb->type = RUNE_CHAR; crb->object.chr.ch = data->font_is_bogus ? '~' : data->ch; @@ -1311,7 +1305,6 @@ case '%': dst += set_charptr_emchar (dst, '%'); break; - /* #### unimplemented */ } } } @@ -1333,7 +1326,7 @@ prop_block_dynarr *prop = NULL; if (VECTORP (entry)) { - Lisp_Vector *de = XVECTOR (entry); + struct Lisp_Vector *de = XVECTOR (entry); EMACS_INT len = vector_length (de); int elt; @@ -1516,25 +1509,12 @@ { struct window *w = XWINDOW (data->window); - /* If window faces changed, and glyph instance is text, then - glyph sizes might have changed too */ - invalidate_glyph_geometry_maybe (gb->glyph, w); - - /* This makes sure the glyph is in the cachels. - - #### We do this to make sure the glyph is in the glyph cachels, - so that the dirty flag can be reset after redisplay has - finished. We should do this some other way, maybe by iterating - over the window cache of subwindows. */ - get_glyph_cachel_index (w, gb->glyph); - /* A nil extent indicates a special glyph (ex. truncator). */ if (NILP (gb->extent) || (pos_type == BEGIN_GLYPHS && extent_begin_glyph_layout (XEXTENT (gb->extent)) == GL_TEXT) || (pos_type == END_GLYPHS && - extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_TEXT) - || pos_type == LEFT_GLYPHS || pos_type == RIGHT_GLYPHS) + extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_TEXT)) { struct rune rb; int width; @@ -1542,18 +1522,16 @@ int ascent, descent; Lisp_Object baseline; Lisp_Object face; - Lisp_Object instance; - face_index findex; if (cachel) width = cachel->width; else - width = glyph_width (gb->glyph, data->window); + width = glyph_width (gb->glyph, Qnil, data->findex, data->window); if (!width) return NULL; - if (data->start_col || data->start_col_xoffset) + if (data->start_col) { prop_block_dynarr *retval; int glyph_char_width = width / space_width (w); @@ -1611,8 +1589,9 @@ } else { - ascent = glyph_ascent (gb->glyph, data->window); - descent = glyph_descent (gb->glyph, data->window); + ascent = glyph_ascent (gb->glyph, Qnil, data->findex, data->window); + descent = glyph_descent (gb->glyph, Qnil, data->findex, + data->window); } baseline = glyph_baseline (gb->glyph, data->window); @@ -1655,32 +1634,10 @@ face = glyph_face (gb->glyph, data->window); if (NILP (face)) - findex = data->findex; + rb.findex = data->findex; else - findex = get_builtin_face_cache_index (w, face); - - instance = glyph_image_instance (gb->glyph, data->window, - ERROR_ME_NOT, 1); - if (TEXT_IMAGE_INSTANCEP (instance)) - { - Lisp_Object string = XIMAGE_INSTANCE_TEXT_STRING (instance); - face_index orig_findex = data->findex; - Bytind orig_bufpos = data->bi_bufpos; - Bytind orig_start_col_enabled = data->bi_start_col_enabled; - - data->findex = findex; - data->bi_start_col_enabled = 0; - if (!allow_cursor) - data->bi_bufpos = 0; - add_bufbyte_string_runes (data, XSTRING_DATA (string), - XSTRING_LENGTH (string), 0); - data->findex = orig_findex; - data->bi_bufpos = orig_bufpos; - data->bi_start_col_enabled = orig_start_col_enabled; - return NULL; - } - - rb.findex = findex; + rb.findex = get_builtin_face_cache_index (w, face); + rb.xpos = data->pixpos; rb.width = width; rb.bufpos = 0; /* glyphs are never "at" anywhere */ @@ -1691,6 +1648,13 @@ else rb.endpos = 0; rb.type = RUNE_DGLYPH; + /* #### Ben sez: this is way bogus if the glyph is a string. + You should not make the output routines have to cope with + this. The string could contain Mule characters, or non- + printable characters, or characters to be passed through + the display table, or non-character objects (when this gets + implemented), etc. Instead, this routine here should parse + the string into a series of runes. */ rb.object.dglyph.glyph = gb->glyph; rb.object.dglyph.extent = gb->extent; rb.object.dglyph.xoffset = xoffset; @@ -1801,7 +1765,8 @@ static Bytind create_text_block (struct window *w, struct display_line *dl, - Bytind bi_start_pos, prop_block_dynarr **prop, + Bytind bi_start_pos, int start_col, + prop_block_dynarr **prop, int type) { struct frame *f = XFRAME (w->frame); @@ -1826,7 +1791,7 @@ after a ^M is invisible. */ int selective = (INTP (b->selective_display) ? XINT (b->selective_display) - : (!NILP (b->selective_display) ? -1 : 0)); + : ((!NILP (b->selective_display) ? -1 : 0))); /* The variable ctl-arrow allows the user to specify what characters can actually be displayed and which octal should be used for. @@ -1893,7 +1858,6 @@ dl->used_prop_data = 0; dl->num_chars = 0; - dl->line_continuation = 0; xzero (data); data.ef = extent_fragment_new (w->buffer, f); @@ -1902,7 +1866,6 @@ them to this structure for ease of passing. */ data.d = d; XSETWINDOW (data.window, w); - data.string = Qnil; data.db = db; data.dl = dl; @@ -1946,7 +1909,6 @@ data.cursor_x = -1; data.start_col = w->hscroll; - data.start_col_xoffset = w->left_xoffset; data.bi_start_col_enabled = (w->hscroll ? bi_start_pos : 0); data.hscroll_glyph_width_adjust = 0; @@ -2266,7 +2228,6 @@ data.blank_width = DEVMETH (d, eol_cursor_width, ()); data.findex = DEFAULT_INDEX; data.start_col = 0; - data.start_col_xoffset = 0; data.bi_start_col_enabled = 0; add_emchar_rune (&data); @@ -2300,8 +2261,7 @@ int prop_width = 0; if (data.start_col > 1) - tab_start_pixpos -= (space_width (w) * (data.start_col - 1)) - + data.start_col_xoffset; + tab_start_pixpos -= (space_width (w) * (data.start_col - 1)); next_tab_start = next_tab_position (w, tab_start_pixpos, @@ -2484,12 +2444,11 @@ /* data.bi_bufpos is already at the start of the next line. */ - dl->line_continuation = 1; gb.glyph = Vcontinuation_glyph; cachel = GLYPH_CACHEL (w, CONT_GLYPH_INDEX); } - add_glyph_rune (&data, &gb, BEGIN_GLYPHS, 0, cachel); + add_glyph_rune (&data, &gb, BEGIN_GLYPHS, 1, cachel); if (truncate_win && data.bi_bufpos == BI_BUF_ZV (b) && BI_BUF_FETCH_CHAR (b, prev_bytind (b, BI_BUF_ZV (b))) != '\n') @@ -2509,7 +2468,6 @@ data.blank_width = DEVMETH (d, eol_cursor_width, ()); data.findex = DEFAULT_INDEX; data.start_col = 0; - data.start_col_xoffset = 0; data.bi_start_col_enabled = 0; data.max_pixpos += data.blank_width; @@ -2685,7 +2643,6 @@ data.last_charset = Qunbound; data.last_findex = DEFAULT_INDEX; data.result_str = Qnil; - data.string = Qnil; Dynarr_reset (data.db->runes); @@ -2737,26 +2694,8 @@ ? dl->left_glyphs : dl->right_glyphs); int elt, end; + int xpos = start; int reverse; - struct window *w = XWINDOW (window); - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - pos_data data; - - xzero (data); - data.d = d; - data.window = window; - data.db = db; - data.dl = dl; - data.pixpos = start; - data.cursor_type = NO_CURSOR; - data.cursor_x = -1; - data.last_charset = Qunbound; - data.last_findex = DEFAULT_INDEX; - data.result_str = Qnil; - data.string = Qnil; - data.new_ascent = dl->ascent; - data.new_descent = dl->descent; if ((layout == GL_WHITESPACE && side == LEFT_GLYPHS) || (layout == GL_INSIDE_MARGIN && side == RIGHT_GLYPHS)) @@ -2785,31 +2724,79 @@ || (side == RIGHT_GLYPHS && extent_end_glyph_layout (XEXTENT (gb->extent)) == layout))) { - data.findex = gb->findex; - data.max_pixpos = data.pixpos + gb->width; - add_glyph_rune (&data, gb, side, 0, NULL); + struct rune rb; + + rb.width = gb->width; + rb.findex = gb->findex; + rb.xpos = xpos; + rb.bufpos = -1; + rb.endpos = 0; + rb.type = RUNE_DGLYPH; + rb.object.dglyph.glyph = gb->glyph; + rb.object.dglyph.extent = gb->extent; + rb.object.dglyph.xoffset = 0; + rb.cursor_type = CURSOR_OFF; + + Dynarr_add (db->runes, rb); + xpos += rb.width; count--; gb->active = 0; + + if (glyph_contrib_p (gb->glyph, window)) + { + unsigned short ascent, descent; + Lisp_Object baseline = glyph_baseline (gb->glyph, window); + + ascent = glyph_ascent (gb->glyph, Qnil, gb->findex, window); + descent = glyph_descent (gb->glyph, Qnil, gb->findex, window); + + /* A pixmap that has not had a baseline explicitly set. + We use the existing ascent / descent ratio of the + line. */ + if (NILP (baseline)) + { + int gheight = ascent + descent; + int line_height = dl->ascent + dl->descent; + int pix_ascent, pix_descent; + + pix_descent = (int) (gheight * dl->descent) / line_height; + pix_ascent = gheight - pix_descent; + + dl->ascent = max ((int) dl->ascent, pix_ascent); + dl->descent = max ((int) dl->descent, pix_descent); + } + + /* A string so determine contribution normally. */ + else if (EQ (baseline, Qt)) + { + dl->ascent = max (dl->ascent, ascent); + dl->descent = max (dl->descent, descent); + } + + /* A pixmap with an explicitly set baseline. We determine the + contribution here. */ + else if (INTP (baseline)) + { + int height = ascent + descent; + int pix_ascent, pix_descent; + + pix_ascent = height * XINT (baseline) / 100; + pix_descent = height - pix_ascent; + + dl->ascent = max ((int) dl->ascent, pix_ascent); + dl->descent = max ((int) dl->descent, pix_descent); + } + + /* Otherwise something is screwed up. */ + else + abort (); + } } (reverse ? elt-- : elt++); } - if (data.max_pixmap_height) - { - int height = data.new_ascent + data.new_descent; - int pix_ascent, pix_descent; - - pix_descent = data.max_pixmap_height * data.new_descent / height; - pix_ascent = data.max_pixmap_height - pix_descent; - data.new_ascent = max (data.new_ascent, pix_ascent); - data.new_descent = max (data.new_descent, pix_descent); - } - - dl->ascent = data.new_ascent; - dl->descent = data.new_descent; - - return data.pixpos; + return xpos; } /* Add a blank to a margin display block. */ @@ -2875,7 +2862,7 @@ { int width; - width = glyph_width (gb->glyph, window); + width = glyph_width (gb->glyph, Qnil, gb->findex, window); if (white_in_start - width >= left_in_end) { @@ -2926,7 +2913,7 @@ if (extent_begin_glyph_layout (XEXTENT (gb->extent)) == GL_INSIDE_MARGIN) { - gb->width = glyph_width (gb->glyph, window); + gb->width = glyph_width (gb->glyph, Qnil, gb->findex, window); used_in += gb->width; Dynarr_add (ib, *gb); } @@ -2995,7 +2982,7 @@ if (extent_begin_glyph_layout (XEXTENT (gb->extent)) == GL_INSIDE_MARGIN) { - int width = glyph_width (gb->glyph, window); + int width = glyph_width (gb->glyph, Qnil, gb->findex, window); if (used_out) { @@ -3037,7 +3024,7 @@ if (extent_begin_glyph_layout (XEXTENT (gb->extent)) == GL_OUTSIDE_MARGIN) { - int width = glyph_width (gb->glyph, window); + int width = glyph_width (gb->glyph, Qnil, gb->findex, window); if (out_end + width <= in_out_start) { @@ -3194,7 +3181,7 @@ if (extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_WHITESPACE) { - int width = glyph_width (gb->glyph, window); + int width = glyph_width (gb->glyph, Qnil, gb->findex, window); if (white_in_end + width <= dl->bounds.right_in) { @@ -3244,7 +3231,7 @@ if (extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_INSIDE_MARGIN) { - gb->width = glyph_width (gb->glyph, window); + gb->width = glyph_width (gb->glyph, Qnil, gb->findex, window); used_in += gb->width; Dynarr_add (ib, *gb); } @@ -3308,7 +3295,7 @@ if (extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_INSIDE_MARGIN) { - int width = glyph_width (gb->glyph, window); + int width = glyph_width (gb->glyph, Qnil, gb->findex, window); if (used_out) { @@ -3349,7 +3336,7 @@ if (extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_OUTSIDE_MARGIN) { - int width = glyph_width (gb->glyph, window); + int width = glyph_width (gb->glyph, Qnil, gb->findex, window); if (out_start - width >= in_out_end) { @@ -3465,123 +3452,9 @@ /* */ /***************************************************************************/ -/* This function is also used in frame.c by `generate_title_string' */ -void -generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, - struct window *w, struct display_line *dl, - struct display_block *db, face_index findex, - int min_pixpos, int max_pixpos, int type) -{ - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - - pos_data data; - int c_pixpos; - Charcount offset = 0; - - xzero (data); - data.d = d; - data.db = db; - data.dl = dl; - data.findex = findex; - data.pixpos = min_pixpos; - data.max_pixpos = max_pixpos; - data.cursor_type = NO_CURSOR; - data.last_charset = Qunbound; - data.last_findex = DEFAULT_INDEX; - data.result_str = result_str; - data.is_modeline = 1; - data.string = Qnil; - XSETWINDOW (data.window, w); - - Dynarr_reset (formatted_string_extent_dynarr); - Dynarr_reset (formatted_string_extent_start_dynarr); - Dynarr_reset (formatted_string_extent_end_dynarr); - - /* result_str is nil when we're building a frame or icon title. Otherwise, - we're building a modeline, so the offset starts at the modeline - horizontal scrolling ammount */ - if (! NILP (result_str)) - offset = w->modeline_hscroll; - generate_fstring_runes (w, &data, 0, 0, -1, format_str, 0, - max_pixpos - min_pixpos, findex, type, &offset, - Qnil); - - if (Dynarr_length (db->runes)) - { - struct rune *rb = - Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1); - c_pixpos = rb->xpos + rb->width; - } - else - c_pixpos = min_pixpos; - - /* If we don't reach the right side of the window, add a blank rune - to make up the difference. This usually only occurs if the - modeline face is using a proportional width font or a fixed width - font of a different size from the default face font. */ - - if (c_pixpos < max_pixpos) - { - data.pixpos = c_pixpos; - data.blank_width = max_pixpos - data.pixpos; - - add_blank_rune (&data, NULL, 0); - } - - /* Now create the result string and frob the extents into it. */ - if (!NILP (result_str)) - { - int elt; - Bytecount len; - Bufbyte *strdata; - struct buffer *buf = XBUFFER (WINDOW_BUFFER (w)); - - in_modeline_generation = 1; - - detach_all_extents (result_str); - resize_string (XSTRING (result_str), -1, - data.bytepos - XSTRING_LENGTH (result_str)); - - strdata = XSTRING_DATA (result_str); - - for (elt = 0, len = 0; elt < Dynarr_length (db->runes); elt++) - { - if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) - { - len += (set_charptr_emchar - (strdata + len, Dynarr_atp (db->runes, - elt)->object.chr.ch)); - } - } - - for (elt = 0; elt < Dynarr_length (formatted_string_extent_dynarr); - elt++) - { - Lisp_Object extent = Qnil; - Lisp_Object child; - - XSETEXTENT (extent, Dynarr_at (formatted_string_extent_dynarr, elt)); - child = Fgethash (extent, buf->modeline_extent_table, Qnil); - if (NILP (child)) - { - child = Fmake_extent (Qnil, Qnil, result_str); - Fputhash (extent, child, buf->modeline_extent_table); - } - Fset_extent_parent (child, extent); - set_extent_endpoints - (XEXTENT (child), - Dynarr_at (formatted_string_extent_start_dynarr, elt), - Dynarr_at (formatted_string_extent_end_dynarr, elt), - result_str); - } - - in_modeline_generation = 0; - } -} - /* Ensure that the given display line DL accurately represents the modeline for the given window. */ + static void generate_modeline (struct window *w, struct display_line *dl, int type) { @@ -3675,13 +3548,116 @@ dl->ypos = WINDOW_BOTTOM (w) - dl->descent - ypos_adj; } +static void +generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, + struct window *w, struct display_line *dl, + struct display_block *db, face_index findex, + int min_pixpos, int max_pixpos, int type) +{ + struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); + + pos_data data; + int c_pixpos; + + xzero (data); + data.d = d; + data.db = db; + data.dl = dl; + data.findex = findex; + data.pixpos = min_pixpos; + data.max_pixpos = max_pixpos; + data.cursor_type = NO_CURSOR; + data.last_charset = Qunbound; + data.last_findex = DEFAULT_INDEX; + data.result_str = result_str; + data.is_modeline = 1; + XSETWINDOW (data.window, w); + + Dynarr_reset (formatted_string_extent_dynarr); + Dynarr_reset (formatted_string_extent_start_dynarr); + Dynarr_reset (formatted_string_extent_end_dynarr); + + /* This recursively builds up the modeline. */ + generate_fstring_runes (w, &data, 0, 0, -1, format_str, 0, + max_pixpos - min_pixpos, findex, type); + + if (Dynarr_length (db->runes)) + { + struct rune *rb = + Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1); + c_pixpos = rb->xpos + rb->width; + } + else + c_pixpos = min_pixpos; + + /* If we don't reach the right side of the window, add a blank rune + to make up the difference. This usually only occurs if the + modeline face is using a proportional width font or a fixed width + font of a different size from the default face font. */ + + if (c_pixpos < max_pixpos) + { + data.pixpos = c_pixpos; + data.blank_width = max_pixpos - data.pixpos; + + add_blank_rune (&data, NULL, 0); + } + + /* Now create the result string and frob the extents into it. */ + if (!NILP (result_str)) + { + int elt; + Bytecount len; + Bufbyte *strdata; + struct buffer *buf = XBUFFER (WINDOW_BUFFER (w)); + + detach_all_extents (result_str); + resize_string (XSTRING (result_str), -1, + data.bytepos - XSTRING_LENGTH (result_str)); + + strdata = XSTRING_DATA (result_str); + + for (elt = 0, len = 0; elt < Dynarr_length (db->runes); elt++) + { + if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) + { + len += (set_charptr_emchar + (strdata + len, Dynarr_atp (db->runes, + elt)->object.chr.ch)); + } + } + + for (elt = 0; elt < Dynarr_length (formatted_string_extent_dynarr); + elt++) + { + Lisp_Object extent = Qnil; + Lisp_Object child; + + XSETEXTENT (extent, Dynarr_at (formatted_string_extent_dynarr, elt)); + child = Fgethash (extent, buf->modeline_extent_table, Qnil); + if (NILP (child)) + { + child = Fmake_extent (Qnil, Qnil, result_str); + Fputhash (extent, child, buf->modeline_extent_table); + } + Fset_extent_parent (child, extent); + set_extent_endpoints + (XEXTENT (child), + Dynarr_at (formatted_string_extent_start_dynarr, elt), + Dynarr_at (formatted_string_extent_end_dynarr, elt), + result_str); + } + } +} + static Charcount -add_string_to_fstring_db_runes (pos_data *data, const Bufbyte *str, +add_string_to_fstring_db_runes (pos_data *data, CONST Bufbyte *str, Charcount pos, Charcount min_pos, Charcount max_pos) { /* This function has been Mule-ized. */ Charcount end; - const Bufbyte *cur_pos = str; + CONST Bufbyte *cur_pos = str; struct display_block *db = data->db; data->blank_width = space_width (XWINDOW (data->window)); @@ -3689,13 +3665,13 @@ add_blank_rune (data, NULL, 0); end = (Dynarr_length (db->runes) + - bytecount_to_charcount (str, strlen ((const char *) str))); + bytecount_to_charcount (str, strlen ((CONST char *) str))); if (max_pos != -1) end = min (max_pos, end); while (pos < end && *cur_pos) { - const Bufbyte *old_cur_pos = cur_pos; + CONST Bufbyte *old_cur_pos = cur_pos; int succeeded; data->ch = charptr_emchar (cur_pos); @@ -3720,8 +3696,7 @@ modeline extents. */ static Charcount add_glyph_to_fstring_db_runes (pos_data *data, Lisp_Object glyph, - Charcount pos, Charcount min_pos, - Charcount max_pos, Lisp_Object extent) + Charcount pos, Charcount min_pos, Charcount max_pos) { /* This function has been Mule-ized. */ Charcount end; @@ -3737,7 +3712,7 @@ end = min (max_pos, end); gb.glyph = glyph; - gb.extent = extent; + gb.extent = Qnil; add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0); pos++; @@ -3764,8 +3739,7 @@ generate_fstring_runes (struct window *w, pos_data *data, Charcount pos, Charcount min_pos, Charcount max_pos, Lisp_Object elt, int depth, int max_pixsize, - face_index findex, int type, Charcount *offset, - Lisp_Object cur_ext) + face_index findex, int type) { /* This function has been Mule-ized. */ /* #### The other losing things in this function are: @@ -3797,22 +3771,13 @@ if (this != last) { - /* No %-construct */ + /* The string is just a string. */ Charcount size = - bytecount_to_charcount (last, this - last); - - if (size <= *offset) - *offset -= size; - else - { - Charcount tmp_max = (max_pos == -1 ? pos + size - *offset : - min (pos + size - *offset, max_pos)); - const Bufbyte *tmp_last = charptr_n_addr (last, *offset); - - pos = add_string_to_fstring_db_runes (data, tmp_last, - pos, pos, tmp_max); - *offset = 0; - } + bytecount_to_charcount (last, this - last) + pos; + Charcount tmp_max = (max_pos == -1 ? size : min (size, max_pos)); + + pos = add_string_to_fstring_db_runes (data, last, pos, pos, + tmp_max); } else /* *this == '%' */ { @@ -3837,7 +3802,7 @@ pos = generate_fstring_runes (w, data, pos, spec_width, max_pos, Vglobal_mode_string, depth, max_pixsize, findex, - type, offset, cur_ext); + type); } else if (*this == '-') { @@ -3864,35 +3829,17 @@ while (num_to_add--) pos = add_string_to_fstring_db_runes - (data, (const Bufbyte *) "-", pos, pos, max_pos); + (data, (CONST Bufbyte *) "-", pos, pos, max_pos); } else if (*this != 0) { + Bufbyte *str; Emchar ch = charptr_emchar (this); - Bufbyte *str; - Charcount size; - decode_mode_spec (w, ch, type); str = Dynarr_atp (mode_spec_bufbyte_string, 0); - size = bytecount_to_charcount - /* Skip the null character added by `decode_mode_spec' */ - (str, Dynarr_length (mode_spec_bufbyte_string)) - 1; - - if (size <= *offset) - *offset -= size; - else - { - const Bufbyte *tmp_str = charptr_n_addr (str, *offset); - - /* #### NOTE: I don't understand why a tmp_max is not - computed and used here as in the plain string case - above. -- dv */ - pos = add_string_to_fstring_db_runes (data, tmp_str, - pos, pos, - max_pos); - *offset = 0; - } + pos = add_string_to_fstring_db_runes (data,str, pos, pos, + max_pos); } /* NOT this++. There could be any sort of character at @@ -3918,26 +3865,13 @@ if (!UNBOUNDP (tem)) { - /* If value is a string, output that string literally: + /* If value is a string, output that string literally: don't check for % within it. */ if (STRINGP (tem)) { - Bufbyte *str = XSTRING_DATA (tem); - Charcount size = XSTRING_CHAR_LENGTH (tem); - - if (size <= *offset) - *offset -= size; - else - { - const Bufbyte *tmp_str = charptr_n_addr (str, *offset); - - /* #### NOTE: I don't understand why a tmp_max is not - computed and used here as in the plain string case - above. -- dv */ - pos = add_string_to_fstring_db_runes (data, tmp_str, pos, - min_pos, max_pos); - *offset = 0; - } + pos = + add_string_to_fstring_db_runes + (data, XSTRING_DATA (tem), pos, min_pos, max_pos); } /* Give up right away for nil or t. */ else if (!EQ (tem, elt)) @@ -3962,53 +3896,50 @@ else if (CONSP (elt)) { /* A cons cell: four distinct cases. - * - If first element is a string or a cons, process all the elements - * and effectively concatenate them. - * - If first element is a negative number, truncate displaying cdr to - * at most that many characters. If positive, pad (with spaces) - * to at least that many characters. - * - If first element is another symbol, process the cadr or caddr - * recursively according to whether the symbol's value is non-nil or - * nil. - * - If first element is an extent, process the cdr recursively - * and handle the extent's face. + * If first element is a string or a cons, process all the elements + * and effectively concatenate them. + * If first element is a negative number, truncate displaying cdr to + * at most that many characters. If positive, pad (with spaces) + * to at least that many characters. + * If first element is a symbol, process the cadr or caddr recursively + * according to whether the symbol's value is non-nil or nil. + * If first element is a face, process the cdr recursively + * without altering the depth. */ - Lisp_Object car, tem; car = XCAR (elt); if (SYMBOLP (car)) - { - elt = XCDR (elt); - if (!CONSP (elt)) - goto invalid; - - tem = symbol_value_in_buffer (car, w->buffer); - /* elt is now the cdr, and we know it is a cons cell. - Use its car if CAR has a non-nil value. */ - if (!UNBOUNDP (tem)) - { - if (!NILP (tem)) - { - elt = XCAR (elt); - goto tail_recurse; - } - } - /* Symbol's value is nil (or symbol is unbound) - * Get the cddr of the original list - * and if possible find the caddr and use that. - */ - elt = XCDR (elt); - if (NILP (elt)) - ; - else if (!CONSP (elt)) - goto invalid; - else - { - elt = XCAR (elt); - goto tail_recurse; - } - } + { + elt = XCDR (elt); + if (!CONSP (elt)) + goto invalid; + tem = symbol_value_in_buffer (car, w->buffer); + /* elt is now the cdr, and we know it is a cons cell. + Use its car if CAR has a non-nil value. */ + if (!UNBOUNDP (tem)) + { + if (!NILP (tem)) + { + elt = XCAR (elt); + goto tail_recurse; + } + } + /* Symbol's value is nil (or symbol is unbound) + * Get the cddr of the original list + * and if possible find the caddr and use that. + */ + elt = XCDR (elt); + if (NILP (elt)) + ; + else if (!CONSP (elt)) + goto invalid; + else + { + elt = XCAR (elt); + goto tail_recurse; + } + } else if (INTP (car)) { Charcount lim = XINT (car); @@ -4047,14 +3978,13 @@ else if (STRINGP (car) || CONSP (car)) { int limit = 50; - /* LIMIT is to protect against circular lists. */ while (CONSP (elt) && --limit > 0 && (pos < max_pos || max_pos == -1)) { pos = generate_fstring_runes (w, data, pos, pos, max_pos, - XCAR (elt), depth, max_pixsize, - findex, type, offset, cur_ext); + XCAR (elt), depth, + max_pixsize, findex, type); elt = XCDR (elt); } } @@ -4093,8 +4023,7 @@ data->findex = new_findex; pos = generate_fstring_runes (w, data, pos, pos, max_pos, XCDR (elt), depth - 1, - max_pixsize, new_findex, type, - offset, car); + max_pixsize, new_findex, type); data->findex = old_findex; Dynarr_add (formatted_string_extent_dynarr, ext); Dynarr_add (formatted_string_extent_start_dynarr, start); @@ -4104,46 +4033,57 @@ } else if (GLYPHP (elt)) { - /* Glyphs are considered as one character with respect to the modeline - horizontal scrolling facility. -- dv */ - if (*offset > 0) - *offset -= 1; - else - pos = add_glyph_to_fstring_db_runes (data, elt, pos, pos, max_pos, - cur_ext); + pos = add_glyph_to_fstring_db_runes (data, elt, pos, pos, max_pos); } else { invalid: - { - char *str = GETTEXT ("*invalid*"); - Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */ - - if (size <= *offset) - *offset -= size; - else - { - const Bufbyte *tmp_str = - charptr_n_addr ((const Bufbyte *) str, *offset); - - /* #### NOTE: I don't understand why a tmp_max is not computed and - used here as in the plain string case above. -- dv */ - pos = add_string_to_fstring_db_runes (data, tmp_str, pos, - min_pos, max_pos); - *offset = 0; - } - } + pos = + add_string_to_fstring_db_runes + (data, (CONST Bufbyte *) GETTEXT ("*invalid*"), pos, min_pos, + max_pos); } if (min_pos > pos) { - add_string_to_fstring_db_runes (data, (const Bufbyte *) "", pos, - min_pos, -1); + add_string_to_fstring_db_runes (data, (CONST Bufbyte *) "", pos, min_pos, + -1); } return pos; } +/* The caller is responsible for freeing the returned string. */ +Bufbyte * +generate_formatted_string (struct window *w, Lisp_Object format_str, + Lisp_Object result_str, face_index findex, int type) +{ + struct display_line *dl; + struct display_block *db; + int elt = 0; + + dl = &formatted_string_display_line; + db = get_display_block_from_line (dl, TEXT); + Dynarr_reset (db->runes); + + generate_formatted_string_db (format_str, result_str, w, dl, db, findex, 0, + -1, type); + + Dynarr_reset (formatted_string_emchar_dynarr); + while (elt < Dynarr_length (db->runes)) + { + if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) + Dynarr_add (formatted_string_emchar_dynarr, + Dynarr_atp (db->runes, elt)->object.chr.ch); + elt++; + } + + return + convert_emchar_string_into_malloced_string + ( Dynarr_atp (formatted_string_emchar_dynarr, 0), + Dynarr_length (formatted_string_emchar_dynarr), 0); +} + /* Update just the modeline. Assumes the desired display structs. If they do not have a modeline block, it does nothing. */ static void @@ -4238,836 +4178,6 @@ /***************************************************************************/ -/* */ -/* displayable string routines */ -/* */ -/***************************************************************************/ - -/* Given a position for a string in a window, ensure that the given - display line DL accurately represents the text on a line starting - at the given position. - - Yes, this is duplicating the code of create_text_block, but it - looked just too hard to change create_text_block to handle strings - *and* buffers. We already make a distinction between the two - elsewhere in the code so I think unifying them would require a - complete MULE rewrite. Besides, the other distinction is that these - functions cover text that the user *cannot edit* so we can remove - everything to do with cursors, minibuffers etc. Eventually the - modeline routines should be modified to use this code as it copes - with many more types of display situation. */ - -static Bufpos -create_string_text_block (struct window *w, Lisp_Object disp_string, - struct display_line *dl, - Bufpos start_pos, - prop_block_dynarr **prop, - face_index default_face) -{ - struct frame *f = XFRAME (w->frame); - /* Note that a lot of the buffer controlled stuff has been left in - because you might well want to make use of it (selective display - etc), its just the buffer text that we do not use. However, it - seems to be possible for buffer to be nil sometimes so protect - against this case. */ - struct buffer *b = BUFFERP (w->buffer) ? XBUFFER (w->buffer) : 0; - struct device *d = XDEVICE (f->device); - Lisp_String* s = XSTRING (disp_string); - - /* we're working with these a lot so precalculate them */ - Bytecount slen = XSTRING_LENGTH (disp_string); - Bytecount bi_string_zv = slen; - Bytind bi_start_pos = charcount_to_bytecount (string_data (s), start_pos); - - pos_data data; - - int truncate_win = b ? window_truncation_on (w) : 0; - int end_glyph_width = 0; - - /* we're going to ditch selective display for static text, its an - FSF thing and invisble extents are the way to go - here. Implementing it also relies on a number of buffer-specific - functions that we don't have the luxury of being able to use - here. */ - - /* The variable ctl-arrow allows the user to specify what characters - can actually be displayed and which octal should be used for. - #### This variable should probably have some rethought done to - it. - - #### It would also be really nice if you could specify that - the characters come out in hex instead of in octal. Mule - does that by adding a ctl-hexa variable similar to ctl-arrow, - but that's bogus -- we need a more general solution. I - think you need to extend the concept of display tables - into a more general conversion mechanism. Ideally you - could specify a Lisp function that converts characters, - but this violates the Second Golden Rule and besides would - make things way way way way slow. - - So instead, we extend the display-table concept, which was - historically limited to 256-byte vectors, to one of the - following: - - a) A 256-entry vector, for backward compatibility; - b) char-table, mapping characters to values; - c) range-table, mapping ranges of characters to values; - d) a list of the above. - - The (d) option allows you to specify multiple display tables - instead of just one. Each display table can specify conversions - for some characters and leave others unchanged. The way the - character gets displayed is determined by the first display table - with a binding for that character. This way, you could call a - function `enable-hex-display' that adds a hex display-table to - the list of display tables for the current buffer. - - #### ...not yet implemented... Also, we extend the concept of - "mapping" to include a printf-like spec. Thus you can make all - extended characters show up as hex with a display table like - this: - - #s(range-table data ((256 524288) (format "%x"))) - - Since more than one display table is possible, you have - great flexibility in mapping ranges of characters. */ - Emchar printable_min = b ? (CHAR_OR_CHAR_INTP (b->ctl_arrow) - ? XCHAR_OR_CHAR_INT (b->ctl_arrow) - : ((EQ (b->ctl_arrow, Qt) || EQ (b->ctl_arrow, Qnil)) - ? 255 : 160)) : 255; - - Lisp_Object face_dt, window_dt; - - /* The text display block for this display line. */ - struct display_block *db = get_display_block_from_line (dl, TEXT); - - /* The first time through the main loop we need to force the glyph - data to be updated. */ - int initial = 1; - - /* Apparently the new extent_fragment_update returns an end position - equal to the position passed in if there are no more runs to be - displayed. */ - int no_more_frags = 0; - - dl->used_prop_data = 0; - dl->num_chars = 0; - dl->line_continuation = 0; - - /* set up faces to use for clearing areas, used by - output_display_line */ - dl->default_findex = default_face; - if (default_face) - { - dl->left_margin_findex = default_face; - dl->right_margin_findex = default_face; - } - else - { - dl->left_margin_findex = - get_builtin_face_cache_index (w, Vleft_margin_face); - dl->right_margin_findex = - get_builtin_face_cache_index (w, Vright_margin_face); - } - - xzero (data); - data.ef = extent_fragment_new (disp_string, f); - - /* These values are used by all of the rune addition routines. We add - them to this structure for ease of passing. */ - data.d = d; - XSETWINDOW (data.window, w); - data.db = db; - data.dl = dl; - - data.bi_bufpos = bi_start_pos; - data.pixpos = dl->bounds.left_in; - data.last_charset = Qunbound; - data.last_findex = default_face; - data.result_str = Qnil; - data.string = disp_string; - - /* Set the right boundary adjusting it to take into account any end - glyph. Save the width of the end glyph for later use. */ - data.max_pixpos = dl->bounds.right_in; -#if 0 - if (truncate_win) - end_glyph_width = GLYPH_CACHEL_WIDTH (w, TRUN_GLYPH_INDEX); - else - end_glyph_width = GLYPH_CACHEL_WIDTH (w, CONT_GLYPH_INDEX); -#endif - data.max_pixpos -= end_glyph_width; - - data.cursor_type = NO_CURSOR; - data.cursor_x = -1; - - data.start_col = 0; - /* I don't think we want this, string areas should not scroll with - the window - data.start_col = w->hscroll; - data.bi_start_col_enabled = (w->hscroll ? bi_start_pos : 0); - */ - data.bi_start_col_enabled = 0; - data.hscroll_glyph_width_adjust = 0; - - /* We regenerate the line from the very beginning. */ - Dynarr_reset (db->runes); - - /* Why is this less than or equal and not just less than? If the - starting position is already equal to the maximum we can't add - anything else, right? Wrong. We might still have a newline to - add. A newline can use the room allocated for an end glyph since - if we add it we know we aren't going to be adding any end - glyph. */ - - /* #### Chuck -- I think this condition should be while (1). - Otherwise if (e.g.) there is one begin-glyph and one end-glyph - and the begin-glyph ends exactly at the end of the window, the - end-glyph and text might not be displayed. while (1) ensures - that the loop terminates only when either (a) there is - propagation data or (b) the end-of-line or end-of-buffer is hit. - - #### Also I think you need to ensure that the operation - "add begin glyphs; add end glyphs; add text" is atomic and - can't get interrupted in the middle. If you run off the end - of the line during that operation, then you keep accumulating - propagation data until you're done. Otherwise, if the (e.g.) - there's a begin glyph at a particular position and attempting - to display that glyph results in window-end being hit and - propagation data being generated, then the character at that - position won't be displayed. - - #### See also the comment after the end of this loop, below. - */ - while (data.pixpos <= data.max_pixpos) - { - /* #### This check probably should not be necessary. */ - if (data.bi_bufpos > bi_string_zv) - { - /* #### urk! More of this lossage! */ - data.bi_bufpos--; - goto done; - } - - /* Check for face changes. */ - if (initial || (!no_more_frags && data.bi_bufpos == data.ef->end)) - { - /* Now compute the face and begin/end-glyph information. */ - data.findex = - /* Remember that the extent-fragment routines deal in Bytind's. */ - extent_fragment_update (w, data.ef, data.bi_bufpos); - /* This is somewhat cheesy but the alternative is to - propagate default_face into extent_fragment_update. */ - if (data.findex == DEFAULT_INDEX) - data.findex = default_face; - - get_display_tables (w, data.findex, &face_dt, &window_dt); - - if (data.bi_bufpos == data.ef->end) - no_more_frags = 1; - } - initial = 0; - - /* Determine what is next to be displayed. We first handle any - glyphs returned by glyphs_at_bufpos. If there are no glyphs to - display then we determine what to do based on the character at the - current buffer position. */ - - /* If the current position is covered by an invisible extent, do - nothing (except maybe add some ellipses). - - #### The behavior of begin and end-glyphs at the edge of an - invisible extent should be investigated further. This is - fairly low priority though. */ - if (data.ef->invisible) - { - /* #### Chuck, perhaps you could look at this code? I don't - really know what I'm doing. */ - if (*prop) - { - Dynarr_free (*prop); - *prop = 0; - } - - /* The extent fragment code only sets this when we should - really display the ellipses. It makes sure the ellipses - don't get displayed more than once in a row. */ - if (data.ef->invisible_ellipses) - { - struct glyph_block gb; - - data.ef->invisible_ellipses_already_displayed = 1; - data.ef->invisible_ellipses = 0; - gb.extent = Qnil; - gb.glyph = Vinvisible_text_glyph; - *prop = add_glyph_rune (&data, &gb, BEGIN_GLYPHS, 0, - GLYPH_CACHEL (w, INVIS_GLYPH_INDEX)); - /* Perhaps they shouldn't propagate if the very next thing - is to display a newline (for compatibility with - selective-display-ellipses)? Maybe that's too - abstruse. */ - if (*prop) - goto done; - } - - /* #### What if we we're dealing with a display table? */ - if (data.start_col) - data.start_col--; - - if (data.bi_bufpos == bi_string_zv) - goto done; - else - INC_CHARBYTIND (string_data (s), data.bi_bufpos); - } - - /* If there is propagation data, then it represents the current - buffer position being displayed. Add them and advance the - position counter. This might also add the minibuffer - prompt. */ - else if (*prop) - { - dl->used_prop_data = 1; - *prop = add_propagation_runes (prop, &data); - - if (*prop) - goto done; /* gee, a really narrow window */ - else if (data.bi_bufpos == bi_string_zv) - goto done; - else if (data.bi_bufpos < 0) - /* #### urk urk urk! Aborts are not very fun! Fix this please! */ - data.bi_bufpos = 0; - else - INC_CHARBYTIND (string_data (s), data.bi_bufpos); - } - - /* If there are end glyphs, add them to the line. These are - the end glyphs for the previous run of text. We add them - here rather than doing them at the end of handling the - previous run so that glyphs at the beginning and end of - a line are handled correctly. */ - else if (Dynarr_length (data.ef->end_glyphs) > 0) - { - *prop = add_glyph_runes (&data, END_GLYPHS); - if (*prop) - goto done; - } - - /* If there are begin glyphs, add them to the line. */ - else if (Dynarr_length (data.ef->begin_glyphs) > 0) - { - *prop = add_glyph_runes (&data, BEGIN_GLYPHS); - if (*prop) - goto done; - } - - /* If at end-of-buffer, we've already processed begin and - end-glyphs at this point and there's no text to process, - so we're done. */ - else if (data.bi_bufpos == bi_string_zv) - goto done; - - else - { - Lisp_Object entry = Qnil; - /* Get the character at the current buffer position. */ - data.ch = string_char (s, data.bi_bufpos); - if (!NILP (face_dt) || !NILP (window_dt)) - entry = display_table_entry (data.ch, face_dt, window_dt); - - /* If there is a display table entry for it, hand it off to - add_disp_table_entry_runes and let it worry about it. */ - if (!NILP (entry) && !EQ (entry, make_char (data.ch))) - { - *prop = add_disp_table_entry_runes (&data, entry); - - if (*prop) - goto done; - } - - /* Check if we have hit a newline character. If so, add a marker - to the line and end this loop. */ - else if (data.ch == '\n') - { - /* We aren't going to be adding an end glyph so give its - space back in order to make sure that the cursor can - fit. */ - data.max_pixpos += end_glyph_width; - goto done; - } - - /* If the current character is considered to be printable, then - just add it. */ - else if (data.ch >= printable_min) - { - *prop = add_emchar_rune (&data); - if (*prop) - goto done; - } - - /* If the current character is a tab, determine the next tab - starting position and add a blank rune which extends from the - current pixel position to that starting position. */ - else if (data.ch == '\t') - { - int tab_start_pixpos = data.pixpos; - int next_tab_start; - int char_tab_width; - int prop_width = 0; - - if (data.start_col > 1) - tab_start_pixpos -= (space_width (w) * (data.start_col - 1)); - - next_tab_start = - next_tab_position (w, tab_start_pixpos, - dl->bounds.left_in + - data.hscroll_glyph_width_adjust); - if (next_tab_start > data.max_pixpos) - { - prop_width = next_tab_start - data.max_pixpos; - next_tab_start = data.max_pixpos; - } - data.blank_width = next_tab_start - data.pixpos; - char_tab_width = - (next_tab_start - tab_start_pixpos) / space_width (w); - - *prop = add_blank_rune (&data, w, char_tab_width); - - /* add_blank_rune is only supposed to be called with - sizes guaranteed to fit in the available space. */ - assert (!(*prop)); - - if (prop_width) - { - struct prop_block pb; - *prop = Dynarr_new (prop_block); - - pb.type = PROP_BLANK; - pb.data.p_blank.width = prop_width; - pb.data.p_blank.findex = data.findex; - Dynarr_add (*prop, pb); - - goto done; - } - } - - /* If character is a control character, pass it off to - add_control_char_runes. - - The is_*() routines have undefined results on - arguments outside of the range [-1, 255]. (This - often bites people who carelessly use `char' instead - of `unsigned char'.) - */ - else if (data.ch < 0x100 && iscntrl ((Bufbyte) data.ch)) - { - *prop = add_control_char_runes (&data, b); - - if (*prop) - goto done; - } - - /* If the character is above the ASCII range and we have not - already handled it, then print it as an octal number. */ - else if (data.ch >= 0200) - { - *prop = add_octal_runes (&data); - - if (*prop) - goto done; - } - - /* Assume the current character is considered to be printable, - then just add it. */ - else - { - *prop = add_emchar_rune (&data); - if (*prop) - goto done; - } - - INC_CHARBYTIND (string_data (s), data.bi_bufpos); - } - } - -done: - - /* Determine the starting point of the next line if we did not hit the - end of the buffer. */ - if (data.bi_bufpos < bi_string_zv) - { - /* #### This check is not correct. If the line terminated - due to a begin-glyph or end-glyph hitting window-end, then - data.ch will not point to the character at data.bi_bufpos. If - you make the two changes mentioned at the top of this loop, - you should be able to say '(if (*prop))'. That should also - make it possible to eliminate the data.bi_bufpos < BI_BUF_ZV (b) - check. */ - - /* The common case is that the line ended because we hit a newline. - In that case, the next character is just the next buffer - position. */ - if (data.ch == '\n') - { - INC_CHARBYTIND (string_data (s), data.bi_bufpos); - } - - /* Otherwise we have a buffer line which cannot fit on one display - line. */ - else - { - struct glyph_block gb; - struct glyph_cachel *cachel; - - /* If the line is to be truncated then we actually have to look - for the next newline. We also add the end-of-line glyph which - we know will fit because we adjusted the right border before - we starting laying out the line. */ - data.max_pixpos += end_glyph_width; - data.findex = default_face; - gb.extent = Qnil; - - if (truncate_win) - { - Bytind bi_pos; - - /* Now find the start of the next line. */ - bi_pos = bi_find_next_emchar_in_string (s, '\n', data.bi_bufpos, 1); - - data.cursor_type = NO_CURSOR; - data.bi_bufpos = bi_pos; - gb.glyph = Vtruncation_glyph; - cachel = GLYPH_CACHEL (w, TRUN_GLYPH_INDEX); - } - else - { - /* The cursor can never be on the continuation glyph. */ - data.cursor_type = NO_CURSOR; - - /* data.bi_bufpos is already at the start of the next line. */ - - dl->line_continuation = 1; - gb.glyph = Vcontinuation_glyph; - cachel = GLYPH_CACHEL (w, CONT_GLYPH_INDEX); - } - - if (end_glyph_width) - add_glyph_rune (&data, &gb, BEGIN_GLYPHS, 0, cachel); - - if (truncate_win && data.bi_bufpos == bi_string_zv) - { - const Bufbyte* endb = charptr_n_addr (string_data (s), bi_string_zv); - DEC_CHARPTR (endb); - if (charptr_emchar (endb) != '\n') - { - /* #### Damn this losing shit. */ - data.bi_bufpos++; - } - } - } - } - else if (data.bi_bufpos == bi_string_zv) - { - /* create_text_block () adds a bogus \n marker here which screws - up subwindow display. Since we never have a cursor in the - gutter we can safely ignore it. */ - } - /* Calculate left whitespace boundary. */ - { - int elt = 0; - - /* Whitespace past a newline is considered right whitespace. */ - while (elt < Dynarr_length (db->runes)) - { - struct rune *rb = Dynarr_atp (db->runes, elt); - - if ((rb->type == RUNE_CHAR && rb->object.chr.ch == ' ') - || rb->type == RUNE_BLANK) - { - dl->bounds.left_white += rb->width; - elt++; - } - else - elt = Dynarr_length (db->runes); - } - } - - /* Calculate right whitespace boundary. */ - { - int elt = Dynarr_length (db->runes) - 1; - int done = 0; - - while (!done && elt >= 0) - { - struct rune *rb = Dynarr_atp (db->runes, elt); - - if (!(rb->type == RUNE_CHAR && rb->object.chr.ch < 0x100 - && isspace (rb->object.chr.ch)) - && !rb->type == RUNE_BLANK) - { - dl->bounds.right_white = rb->xpos + rb->width; - done = 1; - } - - elt--; - - } - - /* The line is blank so everything is considered to be right - whitespace. */ - if (!done) - dl->bounds.right_white = dl->bounds.left_in; - } - - /* Set the display blocks bounds. */ - db->start_pos = dl->bounds.left_in; - if (Dynarr_length (db->runes)) - { - struct rune *rb = Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1); - - db->end_pos = rb->xpos + rb->width; - } - else - db->end_pos = dl->bounds.right_white; - - /* update line height parameters */ - if (!data.new_ascent && !data.new_descent) - { - /* We've got a blank line so initialize these values from the default - face. */ - default_face_font_info (data.window, &data.new_ascent, - &data.new_descent, 0, 0, 0); - } - - if (data.max_pixmap_height) - { - int height = data.new_ascent + data.new_descent; - int pix_ascent, pix_descent; - - pix_descent = data.max_pixmap_height * data.new_descent / height; - pix_ascent = data.max_pixmap_height - pix_descent; - - data.new_ascent = max (data.new_ascent, pix_ascent); - data.new_descent = max (data.new_descent, pix_descent); - } - - dl->ascent = data.new_ascent; - dl->descent = data.new_descent; - - { - unsigned short ascent = (unsigned short) XINT (w->minimum_line_ascent); - - if (dl->ascent < ascent) - dl->ascent = ascent; - } - { - unsigned short descent = (unsigned short) XINT (w->minimum_line_descent); - - if (dl->descent < descent) - dl->descent = descent; - } - - dl->cursor_elt = data.cursor_x; - /* #### lossage lossage lossage! Fix this shit! */ - if (data.bi_bufpos > bi_string_zv) - dl->end_bufpos = buffer_or_string_bytind_to_bufpos (disp_string, bi_string_zv); - else - dl->end_bufpos = buffer_or_string_bytind_to_bufpos (disp_string, data.bi_bufpos) - 1; - if (truncate_win) - data.dl->num_chars = - string_column_at_point (s, dl->end_bufpos, b ? XINT (b->tab_width) : 8); - else - /* This doesn't correctly take into account tabs and control - characters but if the window isn't being truncated then this - value isn't going to end up being used anyhow. */ - data.dl->num_chars = dl->end_bufpos - dl->bufpos; - - /* #### handle horizontally scrolled line with text none of which - was actually laid out. */ - - /* #### handle any remainder of overlay arrow */ - - if (*prop == ADD_FAILED) - *prop = NULL; - - if (truncate_win && *prop) - { - Dynarr_free (*prop); - *prop = NULL; - } - - extent_fragment_delete (data.ef); - - /* #### If we started at EOB, then make sure we return a value past - it so that regenerate_window will exit properly. This is bogus. - The main loop should get fixed so that it isn't necessary to call - this function if we are already at EOB. */ - - if (data.bi_bufpos == bi_string_zv && bi_start_pos == bi_string_zv) - return bytecount_to_charcount (string_data (s), data.bi_bufpos) + 1; /* Yuck! */ - else - return bytecount_to_charcount (string_data (s), data.bi_bufpos); -} - -/* Given a display line and a starting position, ensure that the - contents of the display line accurately represent the visual - representation of the buffer contents starting from the given - position when displayed in the given window. The display line ends - when the contents of the line reach the right boundary of the given - window. - - This is very similar to generate_display_line but with the same - limitations as create_string_text_block. I have taken the liberty - of fixing the bytind stuff though.*/ - -static Bufpos -generate_string_display_line (struct window *w, Lisp_Object disp_string, - struct display_line *dl, - Bufpos start_pos, - prop_block_dynarr **prop, - face_index default_face) -{ - Bufpos ret_bufpos; - - /* you must set bounds before calling this. */ - - /* Reset what this line is using. */ - if (dl->display_blocks) - Dynarr_reset (dl->display_blocks); - if (dl->left_glyphs) - { - Dynarr_free (dl->left_glyphs); - dl->left_glyphs = 0; - } - if (dl->right_glyphs) - { - Dynarr_free (dl->right_glyphs); - dl->right_glyphs = 0; - } - - /* We aren't generating a modeline at the moment. */ - dl->modeline = 0; - - /* Create a display block for the text region of the line. */ - ret_bufpos = create_string_text_block (w, disp_string, dl, start_pos, - prop, default_face); - dl->bufpos = start_pos; - if (dl->end_bufpos < dl->bufpos) - dl->end_bufpos = dl->bufpos; - - /* If there are left glyphs associated with any character in the - text block, then create a display block to handle them. */ - if (dl->left_glyphs != NULL && Dynarr_length (dl->left_glyphs)) - create_left_glyph_block (w, dl, 0); - - /* If there are right glyphs associated with any character in the - text block, then create a display block to handle them. */ - if (dl->right_glyphs != NULL && Dynarr_length (dl->right_glyphs)) - create_right_glyph_block (w, dl); - - return ret_bufpos; -} - -/* This is ripped off from regenerate_window. All we want to do is - loop through elements in the string creating display lines until we - have covered the provided area. Simple really. */ -void -generate_displayable_area (struct window *w, Lisp_Object disp_string, - int xpos, int ypos, int width, int height, - display_line_dynarr* dla, - Bufpos start_pos, - face_index default_face) -{ - int yend = ypos + height; - Charcount s_zv; - - prop_block_dynarr *prop = 0; - layout_bounds bounds; - assert (dla); - - Dynarr_reset (dla); - /* if there's nothing to do then do nothing. code after this assumes - there is something to do. */ - if (NILP (disp_string)) - return; - - s_zv = XSTRING_CHAR_LENGTH (disp_string); - - bounds.left_out = xpos; - bounds.right_out = xpos + width; - /* The inner boundaries mark where the glyph margins are located. */ - bounds.left_in = bounds.left_out + window_left_margin_width (w); - bounds.right_in = bounds.right_out - window_right_margin_width (w); - /* We cannot fully calculate the whitespace boundaries as they - depend on the contents of the line being displayed. */ - bounds.left_white = bounds.left_in; - bounds.right_white = bounds.right_in; - - while (ypos < yend) - { - struct display_line dl; - struct display_line *dlp; - Bufpos next_pos; - int local; - - if (Dynarr_length (dla) < Dynarr_largest (dla)) - { - dlp = Dynarr_atp (dla, Dynarr_length (dla)); - local = 0; - } - else - { - - xzero (dl); - dlp = &dl; - local = 1; - } - - dlp->bounds = bounds; - dlp->offset = 0; - next_pos = generate_string_display_line (w, disp_string, dlp, start_pos, - &prop, default_face); - /* we need to make sure that we continue along the line if there - is more left to display otherwise we just end up redisplaying - the same chunk over and over again. */ - if (next_pos == start_pos && next_pos < s_zv) - start_pos++; - else - start_pos = next_pos; - - dlp->ypos = ypos + dlp->ascent; - ypos = dlp->ypos + dlp->descent; - - if (ypos > yend) - { - int visible_height = dlp->ascent + dlp->descent; - - dlp->clip = (ypos - yend); - visible_height -= dlp->clip; - - if (visible_height < VERTICAL_CLIP (w, 1)) - { - if (local) - free_display_line (dlp); - break; - } - } - else - dlp->clip = 0; - - Dynarr_add (dla, *dlp); - - /* #### This type of check needs to be done down in the - generate_display_line call. */ - if (start_pos >= s_zv) - break; - } - - if (prop) - Dynarr_free (prop); -} - - -/***************************************************************************/ /* */ /* window-regeneration routines */ /* */ @@ -5086,8 +4196,6 @@ struct buffer *b = XBUFFER (w->buffer); int ypos = WINDOW_TEXT_TOP (w); int yend; /* set farther down */ - int yclip = WINDOW_TEXT_TOP_CLIP (w); - int force; prop_block_dynarr *prop; layout_bounds bounds; @@ -5141,14 +4249,7 @@ else prop = 0; - /* When we are computing things for scrolling purposes, make - sure at least one line is always generated */ - force = (type == CMOTION_DISP); - - /* Make sure this is set always */ - /* Note the conversion at end */ - w->window_end_pos[type] = start_pos; - while (ypos < yend || force) + while (ypos < yend) { struct display_line dl; struct display_line *dlp; @@ -5161,7 +4262,6 @@ } else { - xzero (dl); dlp = &dl; local = 1; @@ -5169,39 +4269,19 @@ dlp->bounds = bounds; dlp->offset = 0; - start_pos = generate_display_line (w, dlp, 1, start_pos, &prop, type); - - if (yclip > dlp->ascent) - { - /* this should never happen, but if it does just display the - whole line */ - yclip = 0; - } - - dlp->ypos = (ypos + dlp->ascent) - yclip; + start_pos = generate_display_line (w, dlp, 1, start_pos, + w->hscroll, &prop, type); + dlp->ypos = ypos + dlp->ascent; ypos = dlp->ypos + dlp->descent; - /* See if we've been asked to start midway through a line, for - partial display line scrolling. */ - if (yclip) - { - dlp->top_clip = yclip; - yclip = 0; - } - else - dlp->top_clip = 0; - if (ypos > yend) { int visible_height = dlp->ascent + dlp->descent; dlp->clip = (ypos - yend); - /* Although this seems strange we could have a single very - tall line visible for which we need to account for both - the top clip and the bottom clip. */ - visible_height -= (dlp->clip + dlp->top_clip); - - if (visible_height < VERTICAL_CLIP (w, 1) && !force) + visible_height -= dlp->clip; + + if (visible_height < VERTICAL_CLIP (w, 1)) { if (local) free_display_line (dlp); @@ -5245,22 +4325,16 @@ generate_display_line call. */ if (start_pos > BUF_ZV (b)) break; - - force = 0; } if (prop) Dynarr_free (prop); /* #### More not quite right, but close enough. */ - /* Ben sez: apparently window_end_pos[] is measured + /* #### Ben sez: apparently window_end_pos[] is measured as the number of characters between the window end and the end of the buffer? This seems rather weirdo. What's - the justification for this? - - JV sez: Because BUF_Z (b) would be a good initial value, however - that can change. This representation allows initalizing with 0. - */ + the justification for this? */ w->window_end_pos[type] = BUF_Z (b) - w->window_end_pos[type]; if (need_modeline) @@ -5448,7 +4522,7 @@ return 0; new_start = generate_display_line (w, ddl, 0, ddl->bufpos + ddl->offset, - &prop, DESIRED_DISP); + w->hscroll, &prop, DESIRED_DISP); ddl->offset = 0; /* #### If there is propagated stuff the fail. We could @@ -5467,7 +4541,6 @@ if (cdl->ypos != ddl->ypos || cdl->ascent != ddl->ascent || cdl->descent != ddl->descent - || cdl->top_clip != ddl->top_clip || (cdl->cursor_elt != -1 && ddl->cursor_elt == -1) || (cdl->cursor_elt == -1 && ddl->cursor_elt != -1) || old_start != ddl->bufpos @@ -5591,16 +4664,27 @@ assert (cdl->end_bufpos == ddl->end_bufpos); assert (cdl->offset == ddl->offset); - /* If the line continues to next display line, fail. */ - if (ddl->line_continuation) - return 0; + /* If the last rune is already a continuation glyph, fail. + #### We should be able to handle this better. */ + { + struct display_block *db = get_display_block_from_line (ddl, TEXT); + if (Dynarr_length (db->runes)) + { + struct rune *rb = + Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1); + + if (rb->type == RUNE_DGLYPH + && EQ (rb->object.dglyph.glyph, Vcontinuation_glyph)) + return 0; + } + } /* If the line was generated using propagation data, fail. */ if (ddl->used_prop_data) return 0; new_start = generate_display_line (w, ddl, 0, ddl->bufpos + ddl->offset, - &prop, DESIRED_DISP); + w->hscroll, &prop, DESIRED_DISP); ddl->offset = 0; /* If there is propagated stuff then it is pretty much a @@ -5611,16 +4695,25 @@ return 0; } - /* If the line continues to next display line, fail. */ - if (ddl->line_continuation) - return 0; + /* If the last rune is now a continuation glyph, fail. */ + { + struct display_block *db = get_display_block_from_line (ddl, TEXT); + if (Dynarr_length (db->runes)) + { + struct rune *rb = + Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1); + + if (rb->type == RUNE_DGLYPH + && EQ (rb->object.dglyph.glyph, Vcontinuation_glyph)) + return 0; + } + } /* If any line position parameters have changed or a cursor has disappeared or disappeared, fail. */ if (cdl->ypos != ddl->ypos || cdl->ascent != ddl->ascent || cdl->descent != ddl->descent - || cdl->top_clip != ddl->top_clip || (cdl->cursor_elt != -1 && ddl->cursor_elt == -1) || (cdl->cursor_elt == -1 && ddl->cursor_elt != -1)) { @@ -5904,7 +4997,7 @@ } Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), the_buffer); - /* If the buffer has changed we have to invalidate all of our face + /* If the buffer has changed we have to invalid all of our face cache elements. */ if ((!echo_active && b != window_display_buffer (w)) || !Dynarr_length (w->face_cachels) @@ -5913,11 +5006,10 @@ else mark_face_cachels_as_not_updated (w); - /* Ditto the glyph cache elements, although we do *not* invalidate - the cache purely because glyphs have changed - this is now - handled by the dirty flag.*/ + /* Ditto the glyph cache elements. */ if ((!echo_active && b != window_display_buffer (w)) - || !Dynarr_length (w->glyph_cachels) || f->faces_changed) + || !Dynarr_length (w->glyph_cachels) + || f->glyphs_changed) reset_glyph_cachels (w); else mark_glyph_cachels_as_not_updated (w); @@ -6003,7 +5095,6 @@ && !f->faces_changed && !f->glyphs_changed && !f->subwindows_changed - /* && !f->subwindows_state_changed*/ && !f->point_changed && !f->windows_structure_changed) { @@ -6025,7 +5116,6 @@ && !f->faces_changed && !f->glyphs_changed && !f->subwindows_changed - /* && !f->subwindows_state_changed*/ && !f->windows_structure_changed) { if (point_visible (w, pointm, CURRENT_DISP) @@ -6084,7 +5174,6 @@ && !f->faces_changed && !f->glyphs_changed && !f->subwindows_changed - /* && !f->subwindows_state_changed*/ && !f->windows_structure_changed && !f->frame_changed && !truncation_changed @@ -6181,12 +5270,6 @@ somewhere else once tty updates occur on a per-frame basis. */ mark_face_cachels_as_clean (w); - /* The glyph cachels only get dirty if someone changed something. - Since redisplay has now effectively ended we can reset the dirty - flag since everything must be up-to-date. */ - if (glyphs_changed) - mark_glyph_cachels_as_clean (w); - w->windows_changed = 0; } @@ -6266,7 +5349,7 @@ /* Ensure that all windows on the given frame are correctly displayed. */ -int +static int redisplay_frame (struct frame *f, int preemption_check) { struct device *d = XDEVICE (f->device); @@ -6283,16 +5366,6 @@ return 1; } - if (!internal_equal (f->old_buffer_alist, f->buffer_alist, 0)) - { - Lisp_Object frame; - - f->old_buffer_alist = Freplace_list (f->old_buffer_alist, - f->buffer_alist); - XSETFRAME (frame, f); - va_run_hook_with_args (Qbuffer_list_changed_hook, 1, frame); - } - /* Before we put a hold on frame size changes, attempt to process any which are already pending. */ if (f->size_change_pending) @@ -6318,30 +5391,15 @@ being handled. */ update_frame_menubars (f); #endif /* HAVE_MENUBARS */ + /* widgets are similar to menus in that they can call lisp to + determine activation etc. Therefore update them before we get + into redisplay. This is primarily for connected widgets such as + radio buttons. */ + update_frame_subwindows (f); #ifdef HAVE_TOOLBARS /* Update the toolbars. */ update_frame_toolbars (f); #endif /* HAVE_TOOLBARS */ - /* Gutter update proper has to be done inside display when no frame - size changes can occur, thus we separately update the gutter - geometry here if it needs it. */ - update_frame_gutter_geometry (f); - - /* If we clear the frame we have to force its contents to be redrawn. */ - if (f->clear) - f->frame_changed = 1; - - /* Invalidate the subwindow cache. We use subwindows_changed here to - cause subwindows to get instantiated. This is because - subwindows_state_changed is less strict - dealing with things - like the clicked state of button. We have to do this before - redisplaying the gutters as subwindows get unmapped in the - process.*/ - if (f->frame_changed || f->subwindows_changed) - { - /* we have to do this so the gutter gets regenerated. */ - reset_gutter_display_lines (f); - } hold_frame_size_changes (); @@ -6369,23 +5427,26 @@ #### If a frame-size change does occur we should probably actually be preempting redisplay. */ - MAYBE_DEVMETH (d, frame_output_begin, (f)); - - /* We can now update the gutters, safe in the knowledge that our - efforts won't get undone. */ - - /* This can call lisp, but redisplay is protected by binding - inhibit_quit. More importantly the code involving display lines - *assumes* that GC will not happen and so does not GCPRO - anything. Since we use this code the whole time with the gutters - we cannot allow GC to happen when manipulating the gutters. */ - update_frame_gutters (f); + /* If we clear the frame we have to force its contents to be redrawn. */ + if (f->clear) + f->frame_changed = 1; /* Erase the frame before outputting its contents. */ if (f->clear) { - MAYBE_DEVMETH (d, clear_frame, (f)); - } + DEVMETH (d, clear_frame, (f)); + } + + /* invalidate the subwindow cache. we are going to reuse the glyphs + flag here to cause subwindows to get instantiated. This is + because subwindows changed is less strict - dealing with things + like the clicked state of button. */ + if (!Dynarr_length (f->subwindow_cachels) + || f->glyphs_changed + || f->frame_changed) + reset_subwindow_cachels (f); + else + mark_subwindow_cachels_as_not_updated (f); /* Do the selected window first. */ redisplay_window (FRAME_SELECTED_WINDOW (f), 0); @@ -6393,13 +5454,31 @@ /* Then do the rest. */ redisplay_windows (f->root_window, 1); - MAYBE_DEVMETH (d, frame_output_end, (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 (FRAME_TTY_P (f)) + DEVMETH (d, output_end, (d)); update_frame_title (f); - CLASS_RESET_CHANGED_FLAGS (f); + f->buffers_changed = 0; + f->clip_changed = 0; + f->extents_changed = 0; + f->faces_changed = 0; + f->frame_changed = 0; + f->glyphs_changed = 0; + f->subwindows_changed = 0; + f->icon_changed = 0; + f->menubar_changed = 0; + f->modeline_changed = 0; + f->point_changed = 0; + f->toolbar_changed = 0; + f->windows_changed = 0; + f->windows_structure_changed = 0; f->window_face_cache_reset = 0; f->echo_area_garbaged = 0; + f->clear = 0; if (!f->size_change_pending) @@ -6416,27 +5495,16 @@ return 0; } -/* Ensure that all frames on the given device are correctly displayed. - If AUTOMATIC is non-zero, and the device implementation indicates - no automatic redisplay, as printers do, then the device is not - redisplayed. AUTOMATIC is set to zero when called from lisp - functions (redraw-device) and (redisplay-device), and to non-zero - when called from "lazy" redisplay(); -*/ +/* Ensure that all frames on the given device are correctly displayed. */ static int -redisplay_device (struct device *d, int automatic) +redisplay_device (struct device *d) { Lisp_Object frame, frmcons; int preempted = 0; int size_change_failed = 0; struct frame *f; - if (automatic - && (MAYBE_INT_DEVMETH (d, device_implementation_flags, ()) - & XDEVIMPF_NO_AUTO_REDISPLAY)) - return 0; - if (DEVICE_STREAM_P (d)) /* nothing to do */ return 0; @@ -6460,7 +5528,11 @@ if (FRAME_REPAINT_P (f)) { - if (CLASS_REDISPLAY_FLAGS_CHANGEDP(f)) + if (f->buffers_changed || f->clip_changed || f->extents_changed || + f->faces_changed || f->frame_changed || f->menubar_changed || + f->modeline_changed || f->point_changed || f->size_changed || + f->toolbar_changed || f->windows_changed || f->size_slipped || + f->windows_structure_changed || f->glyphs_changed || f->subwindows_changed) { preempted = redisplay_frame (f, 0); } @@ -6490,7 +5562,12 @@ if (FRAME_REPAINT_P (f)) { - if (CLASS_REDISPLAY_FLAGS_CHANGEDP (f)) + if (f->buffers_changed || f->clip_changed || f->extents_changed || + f->faces_changed || f->frame_changed || f->menubar_changed || + f->modeline_changed || f->point_changed || f->size_changed || + f->toolbar_changed || f->windows_changed || + f->windows_structure_changed || + f->glyphs_changed || f->subwindows_changed) { preempted = redisplay_frame (f, 0); } @@ -6505,7 +5582,20 @@ /* If we get here then we redisplayed all of our frames without getting preempted so mark ourselves as clean. */ - CLASS_RESET_CHANGED_FLAGS (d); + d->buffers_changed = 0; + d->clip_changed = 0; + d->extents_changed = 0; + d->faces_changed = 0; + d->frame_changed = 0; + d->glyphs_changed = 0; + d->subwindows_changed = 0; + d->icon_changed = 0; + d->menubar_changed = 0; + d->modeline_changed = 0; + d->point_changed = 0; + d->toolbar_changed = 0; + d->windows_changed = 0; + d->windows_structure_changed = 0; if (!size_change_failed) d->size_changed = 0; @@ -6540,8 +5630,13 @@ if (asynch_device_change_pending) handle_asynch_device_change (); - if (!GLOBAL_REDISPLAY_FLAGS_CHANGEDP && - !disable_preemption && preemption_count < max_preempts) + if (!buffers_changed && !clip_changed && !extents_changed && + !faces_changed && !frame_changed && !icon_changed && + !menubar_changed && !modeline_changed && !point_changed && + !size_changed && !toolbar_changed && !windows_changed && + !glyphs_changed && !subwindows_changed && + !windows_structure_changed && !disable_preemption && + preemption_count < max_preempts) goto done; DEVICE_LOOP_NO_BREAK (devcons, concons) @@ -6549,9 +5644,14 @@ struct device *d = XDEVICE (XCAR (devcons)); int preempted; - if (CLASS_REDISPLAY_FLAGS_CHANGEDP (d)) - { - preempted = redisplay_device (d, 1); + if (d->buffers_changed || d->clip_changed || d->extents_changed || + d->faces_changed || d->frame_changed || d->icon_changed || + d->menubar_changed || d->modeline_changed || d->point_changed || + d->size_changed || d->toolbar_changed || d->windows_changed || + d->windows_structure_changed || + d->glyphs_changed || d->subwindows_changed) + { + preempted = redisplay_device (d); if (preempted) { @@ -6568,7 +5668,19 @@ preemption_count = 0; /* Mark redisplay as accurate */ - GLOBAL_RESET_CHANGED_FLAGS; + buffers_changed = 0; + clip_changed = 0; + extents_changed = 0; + frame_changed = 0; + glyphs_changed = 0; + subwindows_changed = 0; + icon_changed = 0; + menubar_changed = 0; + modeline_changed = 0; + point_changed = 0; + toolbar_changed = 0; + windows_changed = 0; + windows_structure_changed = 0; RESET_CHANGED_SET_FLAGS; if (faces_changed) @@ -6665,7 +5777,7 @@ decode_mode_spec (struct window *w, Emchar spec, int type) { Lisp_Object obj = Qnil; - const char *str = NULL; + CONST char *str = NULL; struct buffer *b = XBUFFER (w->buffer); Dynarr_reset (mode_spec_bufbyte_string); @@ -6694,7 +5806,7 @@ long_to_string (buf, col); Dynarr_add_many (mode_spec_bufbyte_string, - (const Bufbyte *) buf, strlen (buf)); + (CONST Bufbyte *) buf, strlen (buf)); goto decode_mode_spec_done; } @@ -6799,6 +5911,7 @@ case 'p': { Bufpos pos = marker_position (w->start[type]); + Charcount total = BUF_ZV (b) - BUF_BEGV (b); /* This had better be while the desired lines are being done. */ if (w->window_end_pos[type] <= BUF_Z (b) - BUF_ZV (b)) @@ -6815,20 +5928,15 @@ /* This hard limit is ok since the string it will hold has a fixed maximum length of 3. But just to be safe... */ char buf[10]; - Charcount chars = pos - BUF_BEGV (b); - Charcount total = BUF_ZV (b) - BUF_BEGV (b); - - /* Avoid overflow on big buffers */ - int percent = total > LONG_MAX/200 ? - (chars + total/200) / (total / 100) : - (chars * 100 + total/2) / total; + + total = ((pos - BUF_BEGV (b)) * 100 + total - 1) / total; /* We can't normally display a 3-digit number, so get us a 2-digit number that is close. */ - if (percent == 100) - percent = 99; - - sprintf (buf, "%d%%", percent); + if (total == 100) + total = 99; + + sprintf (buf, "%2d%%", total); Dynarr_add_many (mode_spec_bufbyte_string, (Bufbyte *) buf, strlen (buf)); @@ -6843,6 +5951,7 @@ { Bufpos toppos = marker_position (w->start[type]); Bufpos botpos = BUF_Z (b) - w->window_end_pos[type]; + Charcount total = BUF_ZV (b) - BUF_BEGV (b); /* botpos is only accurate as of the last redisplay, so we can only treat it as a hint. In particular, after erase-buffer, @@ -6862,23 +5971,18 @@ /* This hard limit is ok since the string it will hold has a fixed maximum length of around 6. But just to be safe... */ char buf[10]; - Charcount chars = botpos - BUF_BEGV (b); - Charcount total = BUF_ZV (b) - BUF_BEGV (b); - - /* Avoid overflow on big buffers */ - int percent = total > LONG_MAX/200 ? - (chars + total/200) / (total / 100) : - (chars * 100 + total/2) / max (total, 1); + + total = ((botpos - BUF_BEGV (b)) * 100 + total - 1) / total; /* We can't normally display a 3-digit number, so get us a 2-digit number that is close. */ - if (percent == 100) - percent = 99; + if (total == 100) + total = 99; if (toppos <= BUF_BEGV (b)) - sprintf (buf, "Top%d%%", percent); + sprintf (buf, "Top%2d%%", total); else - sprintf (buf, "%d%%", percent); + sprintf (buf, "%2d%%", total); Dynarr_add_many (mode_spec_bufbyte_string, (Bufbyte *) buf, strlen (buf)); @@ -6981,7 +6085,7 @@ /* Given an array of display lines, free them and all data structures contained within them. */ -void +static void free_display_lines (display_line_dynarr *dla) { int line; @@ -7014,7 +6118,7 @@ static void -mark_glyph_block_dynarr (glyph_block_dynarr *gba) +mark_glyph_block_dynarr (glyph_block_dynarr *gba, void (*markobj) (Lisp_Object)) { if (gba) { @@ -7024,17 +6128,15 @@ for (; gb < gb_last; gb++) { if (!NILP (gb->glyph)) - mark_object (gb->glyph); + markobj (gb->glyph); if (!NILP (gb->extent)) - mark_object (gb->extent); + markobj (gb->extent); } } } -/* See the comment in image_instantiate_cache_result as to why marking - the glyph will also mark the image_instance. */ -void -mark_redisplay_structs (display_line_dynarr *dla) +static void +mark_redisplay_structs (display_line_dynarr *dla, void (*markobj) (Lisp_Object)) { display_line *dl = Dynarr_atp (dla, 0); display_line *dl_last = Dynarr_atp (dla, Dynarr_length (dla)); @@ -7056,35 +6158,35 @@ if (r->type == RUNE_DGLYPH) { if (!NILP (r->object.dglyph.glyph)) - mark_object (r->object.dglyph.glyph); + markobj (r->object.dglyph.glyph); if (!NILP (r->object.dglyph.extent)) - mark_object (r->object.dglyph.extent); + markobj (r->object.dglyph.extent); } } } - mark_glyph_block_dynarr (dl->left_glyphs); - mark_glyph_block_dynarr (dl->right_glyphs); + mark_glyph_block_dynarr (dl->left_glyphs, markobj); + mark_glyph_block_dynarr (dl->right_glyphs, markobj); } } static void -mark_window_mirror (struct window_mirror *mir) +mark_window_mirror (struct window_mirror *mir, void (*markobj)(Lisp_Object)) { - mark_redisplay_structs (mir->current_display_lines); - mark_redisplay_structs (mir->desired_display_lines); + mark_redisplay_structs (mir->current_display_lines, markobj); + mark_redisplay_structs (mir->desired_display_lines, markobj); if (mir->next) - mark_window_mirror (mir->next); + mark_window_mirror (mir->next, markobj); if (mir->hchild) - mark_window_mirror (mir->hchild); + mark_window_mirror (mir->hchild, markobj); else if (mir->vchild) - mark_window_mirror (mir->vchild); + mark_window_mirror (mir->vchild, markobj); } void -mark_redisplay (void) +mark_redisplay (void (*markobj)(Lisp_Object)) { Lisp_Object frmcons, devcons, concons; @@ -7092,8 +6194,7 @@ { struct frame *f = XFRAME (XCAR (frmcons)); update_frame_window_mirror (f); - mark_window_mirror (f->root_mirror); - mark_gutters (f); + mark_window_mirror (f->root_mirror, markobj); } } @@ -7157,7 +6258,7 @@ /* This will get used quite a bit so we don't want to be constantly allocating and freeing it. */ -static line_start_cache_dynarr *internal_cache; +line_start_cache_dynarr *internal_cache; /* Makes internal_cache represent the TYPE display structs and only the TYPE display structs. */ @@ -7178,7 +6279,7 @@ else { struct line_start_cache lsc; - + lsc.start = dl->bufpos; lsc.end = dl->end_bufpos; lsc.height = dl->ascent + dl->descent; @@ -7451,7 +6552,7 @@ point_would_be_visible (struct window *w, Bufpos startp, Bufpos point) { struct buffer *b = XBUFFER (w->buffer); - int pixpos = -WINDOW_TEXT_TOP_CLIP(w); + int pixpos = 0; int bottom = WINDOW_TEXT_HEIGHT (w); int start_elt; @@ -7530,18 +6631,11 @@ displayed. The end of the last line is also know as the window end position. - WARNING: It is possible that rediplay failed to layout any lines for the - windows. Under normal circumstances this is rare. However it seems that it - does occur in the following situation: A mouse event has come in and we - need to compute its location in a window. That code (in - pixel_to_glyph_translation) already can handle 0 as an error return value. - #### With a little work this could probably be reworked as just a call to start_with_line_at_pixpos. */ static Bufpos -start_end_of_last_line (struct window *w, Bufpos startp, int end, - int may_error) +start_end_of_last_line (struct window *w, Bufpos startp, int end) { struct buffer *b = XBUFFER (w->buffer); line_start_cache_dynarr *cache = w->line_start_cache; @@ -7561,7 +6655,7 @@ start_elt = point_in_line_start_cache (w, cur_start, 0); if (start_elt == -1) - return may_error ? 0 : startp; + abort (); /* this had better never happen */ while (1) { @@ -7625,7 +6719,7 @@ Bufpos start_of_last_line (struct window *w, Bufpos startp) { - return start_end_of_last_line (w, startp, 0 , 0); + return start_end_of_last_line (w, startp, 0); } /* For the given window W, if display starts at STARTP, what will be @@ -7635,16 +6729,9 @@ Bufpos end_of_last_line (struct window *w, Bufpos startp) { - return start_end_of_last_line (w, startp, 1, 0); + return start_end_of_last_line (w, startp, 1); } -static Bufpos -end_of_last_line_may_error (struct window *w, Bufpos startp) -{ - return start_end_of_last_line (w, startp, 1, 1); -} - - /* For window W, what does the starting position have to be so that the line containing POINT will cover pixel position PIXPOS. */ @@ -7690,7 +6777,7 @@ } cur_elt--; - while (cur_elt < 0) + if (cur_elt < 0) { Bufpos from, to; int win_char_height; @@ -7710,20 +6797,7 @@ update_line_start_cache (w, from, to, point, 0); cur_elt = point_in_line_start_cache (w, cur_pos, 2) - 1; - assert (cur_elt >= -1); - /* This used to be cur_elt>=0 under the assumption that if - point is in the top line and not at BUF_BEGV, then - setting the window_start to a newline before the start of - the first line will always cause scrolling. - - However in my (jv) opinion this is wrong. That new line - can be hidden in various ways: invisible extents, an - explicit window-start not at a newline character etc. - The existence of those are indeed known to create crashes - on that assert. So we have no option but to continue the - search if we found point at the top of the line_start_cache - again. */ - cur_pos = Dynarr_atp (w->line_start_cache,0)->start; + assert (cur_elt >= 0); } prev_pos = cur_pos; } @@ -7828,6 +6902,7 @@ validate_line_start_cache (w); w->line_cache_validation_override++; + updating_line_start_cache = 1; if (from < BUF_BEGV (b)) from = BUF_BEGV (b); @@ -7836,6 +6911,7 @@ if (from > to) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7848,6 +6924,7 @@ /* Check to see if the desired range is already in the cache. */ if (from >= low_bound && to <= high_bound) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7876,6 +6953,7 @@ update_internal_cache_list (w, DESIRED_DISP); if (!Dynarr_length (internal_cache)) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7903,6 +6981,7 @@ { Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0), Dynarr_length (internal_cache)); + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7911,6 +6990,7 @@ the bounds of the DESIRED structs in the first place. */ if (start >= low_bound && end <= high_bound) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7933,6 +7013,7 @@ Dynarr_reset (cache); Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0), Dynarr_length (internal_cache)); + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7958,6 +7039,7 @@ Dynarr_reset (cache); Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0), Dynarr_length (internal_cache)); + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7966,6 +7048,7 @@ Dynarr_length (internal_cache) - ic_elt); } + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -7985,9 +7068,23 @@ update_internal_cache_list (w, CMOTION_DISP); /* If this assert is triggered then regenerate_window failed - to layout a single line. This is not possible since we - force at least a single line to be layout for CMOTION_DISP */ - assert (Dynarr_length (internal_cache)); + to layout a single line. That is not supposed to be + possible because we impose a minimum height on the buffer + and override vertical clip when we are in here. */ + /* #### Ah, but it is because the window may temporarily + exist but not have any lines at all if the minibuffer is + real big. Look into that situation better. */ + if (!Dynarr_length (internal_cache)) + { + if (old_lb == -1 && low_bound == -1) + { + updating_line_start_cache = 0; + w->line_cache_validation_override--; + return; + } + + assert (Dynarr_length (internal_cache)); + } assert (startp == Dynarr_atp (internal_cache, 0)->start); ic_elt = Dynarr_length (internal_cache) - 1; @@ -8033,6 +7130,7 @@ startp = new_startp; if (startp > BUF_ZV (b)) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -8066,6 +7164,7 @@ while (to > high_bound); } + updating_line_start_cache = 0; w->line_cache_validation_override--; assert (to <= high_bound); } @@ -8773,7 +7872,7 @@ if (!MARKERP ((*w)->start[CURRENT_DISP])) *closest = 0; else - *closest = end_of_last_line_may_error (*w, + *closest = end_of_last_line (*w, marker_position ((*w)->start[CURRENT_DISP])); *col = 0; UPDATE_CACHE_RETURN; @@ -8806,9 +7905,6 @@ if (FRAME_REPAINT_P (f) && FRAME_HAS_MINIBUF_P (f)) { Lisp_Object window = FRAME_MINIBUF_WINDOW (f); - - MAYBE_DEVMETH (d, frame_output_begin, (f)); - /* * If the frame size has changed, there may be random * chud on the screen left from previous messages @@ -8817,15 +7913,19 @@ */ if (f->echo_area_garbaged) { - MAYBE_DEVMETH (d, clear_frame, (f)); + DEVMETH (d, clear_frame, (f)); f->echo_area_garbaged = 0; } redisplay_window (window, 0); - MAYBE_DEVMETH (d, frame_output_end, (f)); - call_redisplay_end_triggers (XWINDOW (window), 0); } } + + /* 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)); } return Qnil; @@ -8860,9 +7960,6 @@ f->clear = 1; redisplay_frame (f, 1); - /* See the comment in Fredisplay_frame. */ - RESET_CHANGED_SET_FLAGS; - return unbind_to (count, Qnil); } @@ -8890,15 +7987,6 @@ redisplay_frame (f, 1); - /* If we don't reset the global redisplay flafs here, subsequent - changes to the display will not get registered by redisplay - because it thinks it already has registered changes. If you - really knew what you were doing you could confuse redisplay by - calling Fredisplay_frame while updating another frame. We assume - that if you know what you are doing you will not be that - stupid. */ - RESET_CHANGED_SET_FLAGS; - return unbind_to (count, Qnil); } @@ -8926,10 +8014,7 @@ { XFRAME (XCAR (frmcons))->clear = 1; } - redisplay_device (d, 0); - - /* See the comment in Fredisplay_frame. */ - RESET_CHANGED_SET_FLAGS; + redisplay_device (d); return unbind_to (count, Qnil); } @@ -8956,10 +8041,7 @@ disable_preemption++; } - redisplay_device (d, 0); - - /* See the comment in Fredisplay_frame. */ - RESET_CHANGED_SET_FLAGS; + redisplay_device (d); return unbind_to (count, Qnil); } @@ -9011,8 +8093,6 @@ return 0; } -/* This is called if the built-in glyphs have their properties - changed. */ void redisplay_glyph_changed (Lisp_Object glyph, Lisp_Object property, Lisp_Object locale) @@ -9135,22 +8215,16 @@ preemption_count = 0; max_preempts = INIT_MAX_PREEMPTS; -#ifndef PDUMP if (!initialized) -#endif - { - if (!cmotion_display_lines) - cmotion_display_lines = Dynarr_new (display_line); - if (!mode_spec_bufbyte_string) - mode_spec_bufbyte_string = Dynarr_new (Bufbyte); - if (!formatted_string_extent_dynarr) - formatted_string_extent_dynarr = Dynarr_new (EXTENT); - if (!formatted_string_extent_start_dynarr) - formatted_string_extent_start_dynarr = Dynarr_new (Bytecount); - if (!formatted_string_extent_end_dynarr) - formatted_string_extent_end_dynarr = Dynarr_new (Bytecount); - if (!internal_cache) - internal_cache = Dynarr_new (line_start_cache); + { + cmotion_display_lines = Dynarr_new (display_line); + mode_spec_bufbyte_string = Dynarr_new (Bufbyte); + formatted_string_emchar_dynarr = Dynarr_new (Emchar); + formatted_string_extent_dynarr = Dynarr_new (EXTENT); + formatted_string_extent_start_dynarr = Dynarr_new (Bytecount); + formatted_string_extent_end_dynarr = Dynarr_new (Bytecount); + internal_cache = Dynarr_new (line_start_cache); + xzero (formatted_string_display_line); } /* window system is nil when in -batch mode */ @@ -9221,10 +8295,9 @@ #endif /* INHIBIT_REDISPLAY_HOOKS */ defsymbol (&Qdisplay_warning_buffer, "display-warning-buffer"); defsymbol (&Qbar_cursor, "bar-cursor"); + defsymbol (&Qwindow_scroll_functions, "window-scroll-functions"); defsymbol (&Qredisplay_end_trigger_functions, "redisplay-end-trigger-functions"); - defsymbol (&Qtop_bottom, "top-bottom"); - defsymbol (&Qbuffer_list_changed_hook, "buffer-list-changed-hook"); DEFSUBR (Fredisplay_echo_area); DEFSUBR (Fredraw_frame); @@ -9238,7 +8311,6 @@ void vars_of_redisplay (void) { - #if 0 staticpro (&last_arrow_position); staticpro (&last_arrow_string); @@ -9246,6 +8318,8 @@ last_arrow_string = Qnil; #endif /* 0 */ + updating_line_start_cache = 0; + /* #### Probably temporary */ DEFVAR_INT ("redisplay-cache-adjustment", &cache_adjustment /* \(Temporary) Setting this will impact the performance of the internal @@ -9282,9 +8356,7 @@ Voverlay_arrow_position = Qnil; DEFVAR_LISP_MAGIC ("overlay-arrow-string", &Voverlay_arrow_string /* -String or glyph to display as an arrow. See also `overlay-arrow-position'. -(Note that despite the name of this variable, it can be set to a glyph as -well as a string.) +String to display as an arrow. See also `overlay-arrow-position'. */ , redisplay_variable_changed); Voverlay_arrow_string = Qnil; @@ -9308,19 +8380,10 @@ redisplay_variable_changed); truncate_partial_width_windows = 1; - DEFVAR_LISP ("visible-bell", &Vvisible_bell /* -*Non-nil substitutes a visual signal for the audible bell. - -Default behavior is to flash the whole screen. On some platforms, -special effects are available using the following values: - -'display Flash the whole screen (ie, the default behavior). -'top-bottom Flash only the top and bottom lines of the selected frame. - -When effects are unavailable on a platform, the visual bell is the -default, whole screen. (Currently only X supports any special effects.) + DEFVAR_BOOL ("visible-bell", &visible_bell /* +*Non-nil means try to flash the frame to represent a bell. */ ); - Vvisible_bell = Qnil; + visible_bell = 0; DEFVAR_BOOL ("no-redraw-on-reenter", &no_redraw_on_reenter /* *Non-nil means no need to redraw entire frame after suspending. @@ -9341,7 +8404,7 @@ Vwindow_system = Qnil; /* #### Temporary shit until window-system is eliminated. */ - DEFVAR_CONST_LISP ("initial-window-system", &Vinitial_window_system /* + DEFVAR_LISP ("initial-window-system", &Vinitial_window_system /* DON'T TOUCH */ ); Vinitial_window_system = Qnil; @@ -9371,22 +8434,17 @@ #ifndef INHIBIT_REDISPLAY_HOOKS xxDEFVAR_LISP ("pre-redisplay-hook", &Vpre_redisplay_hook /* Function or functions to run before every redisplay. +Functions on this hook must be careful to avoid signalling errors! */ ); Vpre_redisplay_hook = Qnil; xxDEFVAR_LISP ("post-redisplay-hook", &Vpost_redisplay_hook /* Function or functions to run after every redisplay. +Functions on this hook must be careful to avoid signalling errors! */ ); Vpost_redisplay_hook = Qnil; #endif /* INHIBIT_REDISPLAY_HOOKS */ - DEFVAR_LISP ("buffer-list-changed-hook", &Vbuffer_list_changed_hook /* -Function or functions to call when a frame's buffer list has changed. -This is called during redisplay, before redisplaying each frame. -Functions on this hook are called with one argument, the frame. -*/ ); - Vbuffer_list_changed_hook = Qnil; - DEFVAR_INT ("display-warning-tick", &display_warning_tick /* Bump this to tell the C code to call `display-warning-buffer' at next redisplay. You should not normally change this; the function @@ -9445,9 +8503,9 @@ Vleft_margin_width = Fmake_specifier (Qnatnum); set_specifier_fallback (Vleft_margin_width, list1 (Fcons (Qnil, Qzero))); set_specifier_caching (Vleft_margin_width, - offsetof (struct window, left_margin_width), + slot_offset (struct window, left_margin_width), some_window_value_changed, - offsetof (struct frame, left_margin_width), + slot_offset (struct frame, left_margin_width), margin_width_changed_in_frame); DEFVAR_SPECIFIER ("right-margin-width", &Vright_margin_width /* @@ -9457,9 +8515,9 @@ Vright_margin_width = Fmake_specifier (Qnatnum); set_specifier_fallback (Vright_margin_width, list1 (Fcons (Qnil, Qzero))); set_specifier_caching (Vright_margin_width, - offsetof (struct window, right_margin_width), + slot_offset (struct window, right_margin_width), some_window_value_changed, - offsetof (struct frame, right_margin_width), + slot_offset (struct frame, right_margin_width), margin_width_changed_in_frame); DEFVAR_SPECIFIER ("minimum-line-ascent", &Vminimum_line_ascent /* @@ -9469,7 +8527,7 @@ Vminimum_line_ascent = Fmake_specifier (Qnatnum); set_specifier_fallback (Vminimum_line_ascent, list1 (Fcons (Qnil, Qzero))); set_specifier_caching (Vminimum_line_ascent, - offsetof (struct window, minimum_line_ascent), + slot_offset (struct window, minimum_line_ascent), some_window_value_changed, 0, 0); @@ -9480,7 +8538,7 @@ Vminimum_line_descent = Fmake_specifier (Qnatnum); set_specifier_fallback (Vminimum_line_descent, list1 (Fcons (Qnil, Qzero))); set_specifier_caching (Vminimum_line_descent, - offsetof (struct window, minimum_line_descent), + slot_offset (struct window, minimum_line_descent), some_window_value_changed, 0, 0); @@ -9492,7 +8550,7 @@ Vuse_left_overflow = Fmake_specifier (Qboolean); set_specifier_fallback (Vuse_left_overflow, list1 (Fcons (Qnil, Qnil))); set_specifier_caching (Vuse_left_overflow, - offsetof (struct window, use_left_overflow), + slot_offset (struct window, use_left_overflow), some_window_value_changed, 0, 0); @@ -9504,7 +8562,7 @@ Vuse_right_overflow = Fmake_specifier (Qboolean); set_specifier_fallback (Vuse_right_overflow, list1 (Fcons (Qnil, Qnil))); set_specifier_caching (Vuse_right_overflow, - offsetof (struct window, use_right_overflow), + slot_offset (struct window, use_right_overflow), some_window_value_changed, 0, 0); @@ -9515,7 +8573,7 @@ Vtext_cursor_visible_p = Fmake_specifier (Qboolean); set_specifier_fallback (Vtext_cursor_visible_p, list1 (Fcons (Qnil, Qt))); set_specifier_caching (Vtext_cursor_visible_p, - offsetof (struct window, text_cursor_visible_p), + slot_offset (struct window, text_cursor_visible_p), text_cursor_visible_p_changed, 0, 0); diff -r 12e008d41344 -r 697ef44129c6 src/redisplay.h --- a/src/redisplay.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/redisplay.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_redisplay_h_ -#define INCLUDED_redisplay_h_ +#ifndef _XEMACS_REDISPLAY_H_ +#define _XEMACS_REDISPLAY_H_ /* Redisplay DASSERT types */ #define DB_DISP_POS 1 @@ -91,13 +91,6 @@ but control characters have two -- a ^ and a letter -- and other non-printing characters (those displayed in octal) have four. */ -/* WARNING! In compare_runes (one of the most heavily used functions) - two runes are compared. So please be careful with changes to this - structure. See comments in compare_runes. - - #### This should really be made smaller. -*/ - typedef struct rune rune; struct rune { @@ -112,6 +105,10 @@ each of the face properties in this particular window. */ + short xpos; /* horizontal starting position in pixels */ + short width; /* pixel width of rune */ + + Bufpos bufpos; /* buffer position this rune is displaying; for the modeline, the value here is a Charcount, but who's looking? */ @@ -119,26 +116,11 @@ /* #### Chuck, what does it mean for a rune to cover a range of pos? I don't get this. */ - /* #### This isn't used as an rvalue anywhere! - remove! */ - - - short xpos; /* horizontal starting position in pixels */ - short width; /* pixel width of rune */ - - - unsigned char cursor_type; /* is this rune covered by the cursor? */ - unsigned char type; /* type of rune object */ - /* We used to do bitfields here, but if I - (JV) count correctly that doesn't matter - for the size of the structure. All the bit - fiddling _does_ slow down redisplay by - about 10%. So don't do that */ + unsigned int cursor_type :3; /* is this rune covered by the cursor? */ + unsigned int type :3; /* type of rune object */ union /* Information specific to the type of rune */ { - /* #### GLyps are are. Is it really necessary to waste 8 bytes on every - rune for that?! */ /* DGLYPH */ struct { @@ -163,8 +145,8 @@ /* HLINE */ struct { - short thickness; /* how thick to make hline */ - short yoffset; /* how far down from top of line to put top */ + int thickness; /* how thick to make hline */ + int yoffset; /* how far down from top of line to put top */ } hline; } object; /* actual rune object */ }; @@ -251,32 +233,6 @@ Dynarr_declare (glyph_block); } glyph_block_dynarr; -/*************************************************************************/ -/* display lines */ -/*************************************************************************/ - -/* Modeline commentary: IMO the modeline is handled very badly, we - special case virtually *everything* in the redisplay routines for - the modeline. The fact that dl->bufpos can be either a buffer - position or a char count highlights this. There is no abstraction at - all that I can find and it means that the code is made very ugly as - a result. Either we should treat the modeline *entirely* separately, - or we should abstract to something that applies equally well to the - modeline and to buffer text, the things are not enormously different - after all and handling them identically at some level would - eliminate some bugs that still exist (mainly to do with modeline - handling). This problem doesn't help trying to implement gutters - which are somewhere in between buffer text and modeline text. - - Redisplay commentary: Everything in redisplay is tied very tightly - to the things that are being displayed, and the context, - e.g. buffers and windows. According to Chuck this is so that we can - get speed, which seems fine to me, however this usage is extended - too far down the redispay routines IMO. At some level there should - be functions that know how to display strings with extents and - faces, regardless of buffer etc. After all the window system does - not care. <andy@xemacs.org> */ - typedef struct display_line display_line; struct display_line { @@ -291,8 +247,6 @@ pixel-row itself, I think. */ unsigned short clip; /* amount of bottom of line to clip in pixels.*/ - unsigned short top_clip; /* amount of top of line to clip - in pixels.*/ Bufpos bufpos; /* first buffer position on line */ Bufpos end_bufpos; /* last buffer position on line */ Charcount offset; /* adjustment to bufpos vals */ @@ -308,61 +262,24 @@ char modeline; /* t if this line is a modeline */ - char line_continuation; /* t if this line continues to - next display line. */ - /* Dynamic array of display blocks */ display_block_dynarr *display_blocks; /* Dynamic arrays of left and right glyph blocks */ glyph_block_dynarr *left_glyphs; glyph_block_dynarr *right_glyphs; - - face_index left_margin_findex; - face_index right_margin_findex; - face_index default_findex; }; #define DISPLAY_LINE_HEIGHT(dl) \ -(dl->ascent + dl->descent - (dl->clip + dl->top_clip)) +(dl->ascent + dl->descent - dl->clip) #define DISPLAY_LINE_YPOS(dl) \ -(dl->ypos - (dl->ascent - dl->top_clip)) -#define DISPLAY_LINE_YEND(dl) \ -((dl->ypos + dl->descent) - dl->clip) +(dl->ypos - dl->ascent) typedef struct { Dynarr_declare (display_line); } display_line_dynarr; -/* The following two structures are used to represent an area to -displayed and where to display it. Using these two structures all -combinations of clipping and position can be accommodated. */ - -/* This represents an area to be displayed into. */ -typedef struct display_box display_box; -struct display_box -{ - int xpos; /* absolute horizontal position of area */ - int ypos; /* absolute vertical position of area */ - int width, height; -}; - -/* This represents the area from a glyph to be displayed. */ -typedef struct display_glyph_area display_glyph_area; -struct display_glyph_area -{ - int xoffset; /* horizontal offset of the glyph, +ve means - display the glyph with x offset by xoffset, - -ve means display starting xoffset into the - glyph. */ - int yoffset; /* vertical offset of the glyph, +ve means - display the glyph with y offset by yoffset, - -ve means display starting xoffset into the - glyph. */ - int width, height; /* width and height of glyph to display. */ -}; - /* It could be argued that the following two structs belong in extents.h, but they're only used by redisplay and it simplifies the header files to put them here. */ @@ -398,12 +315,6 @@ unsigned int invisible_ellipses_already_displayed:1; }; -#define EDGE_TOP 1 -#define EDGE_LEFT 2 -#define EDGE_BOTTOM 4 -#define EDGE_RIGHT 8 -#define EDGE_ALL (EDGE_TOP | EDGE_LEFT | EDGE_BOTTOM | EDGE_RIGHT) - /*************************************************************************/ /* change flags */ @@ -418,24 +329,24 @@ If any of these flags are set, redisplay will look more carefully to see if anything has really changed. */ -/* Nonzero if the contents of a buffer have changed since the last time - redisplay completed. */ +/* non-nil if the contents of a buffer have changed since the last time + redisplay completed */ extern int buffers_changed; extern int buffers_changed_set; /* Nonzero if head_clip or tail_clip of a buffer has changed - since last redisplay that finished. */ + since last redisplay that finished */ extern int clip_changed; extern int clip_changed_set; -/* Nonzero if any extent has changed since the last time redisplay completed. */ +/* non-nil if any extent has changed since the last time redisplay completed */ extern int extents_changed; extern int extents_changed_set; -/* Nonzero if any face has changed since the last time redisplay completed. */ +/* non-nil if any face has changed since the last time redisplay completed */ extern int faces_changed; -/* Nonzero means one or more frames have been marked as garbaged. */ +/* Nonzero means one or more frames have been marked as garbaged */ extern int frame_changed; /* True if any of the builtin display glyphs (continuation, @@ -449,11 +360,6 @@ extern int subwindows_changed; extern int subwindows_changed_set; -/* True if any displayed subwindow is in need of updating - somewhere. */ -extern int subwindows_state_changed; -extern int subwindows_state_changed_set; - /* True if an icon is in need of updating somewhere. */ extern int icon_changed; extern int icon_changed_set; @@ -462,34 +368,30 @@ extern int menubar_changed; extern int menubar_changed_set; -/* True iff we should redraw the modelines on the next redisplay. */ +/* true iff we should redraw the modelines on the next redisplay */ extern int modeline_changed; extern int modeline_changed_set; -/* Nonzero if point has changed in some buffer since the last time - redisplay completed. */ +/* non-nil if point has changed in some buffer since the last time + redisplay completed */ extern int point_changed; extern int point_changed_set; -/* Nonzero if some frame has changed its size. */ +/* non-nil if some frame has changed its size */ extern int size_changed; -/* Nonzero if some device has signaled that it wants to change size. */ +/* non-nil if some device has signaled that it wants to change size */ extern int asynch_device_change_pending; -/* Nonzero if any toolbar has changed. */ +/* non-nil if any toolbar has changed */ extern int toolbar_changed; extern int toolbar_changed_set; -/* Nonzero if any gutter has changed. */ -extern int gutter_changed; -extern int gutter_changed_set; - -/* Nonzero if any window has changed since the last time redisplay completed */ +/* non-nil if any window has changed since the last time redisplay completed */ extern int windows_changed; -/* Nonzero if any frame's window structure has changed since the last - time redisplay completed. */ +/* non-nil if any frame's window structure has changed since the last + time redisplay completed */ extern int windows_structure_changed; /* These macros can be relatively expensive. Since they are often @@ -524,104 +426,24 @@ #define MARK_MODELINE_CHANGED MARK_TYPE_CHANGED (modeline) #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point) #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar) -#define MARK_GUTTER_CHANGED MARK_TYPE_CHANGED (gutter) #define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs) #define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows) -#define MARK_SUBWINDOWS_STATE_CHANGED MARK_TYPE_CHANGED (subwindows_state) - - -#define CLASS_RESET_CHANGED_FLAGS(p) do { \ - (p)->buffers_changed = 0; \ - (p)->clip_changed = 0; \ - (p)->extents_changed = 0; \ - (p)->faces_changed = 0; \ - (p)->frame_changed = 0; \ - (p)->icon_changed = 0; \ - (p)->menubar_changed = 0; \ - (p)->modeline_changed = 0; \ - (p)->point_changed = 0; \ - (p)->toolbar_changed = 0; \ - (p)->gutter_changed = 0; \ - (p)->glyphs_changed = 0; \ - (p)->subwindows_changed = 0; \ - (p)->subwindows_state_changed = 0; \ - (p)->windows_changed = 0; \ - (p)->windows_structure_changed = 0; \ -} while (0) - -#define GLOBAL_RESET_CHANGED_FLAGS do { \ - buffers_changed = 0; \ - clip_changed = 0; \ - extents_changed = 0; \ - frame_changed = 0; \ - icon_changed = 0; \ - menubar_changed = 0; \ - modeline_changed = 0; \ - point_changed = 0; \ - toolbar_changed = 0; \ - gutter_changed = 0; \ - glyphs_changed = 0; \ - subwindows_changed = 0; \ - subwindows_state_changed = 0; \ - windows_changed = 0; \ - windows_structure_changed = 0; \ -} while (0) - -#define CLASS_REDISPLAY_FLAGS_CHANGEDP(p) \ - ( (p)->buffers_changed || \ - (p)->clip_changed || \ - (p)->extents_changed || \ - (p)->faces_changed || \ - (p)->frame_changed || \ - (p)->icon_changed || \ - (p)->menubar_changed || \ - (p)->modeline_changed || \ - (p)->point_changed || \ - (p)->toolbar_changed || \ - (p)->gutter_changed || \ - (p)->glyphs_changed || \ - (p)->size_changed || \ - (p)->subwindows_changed || \ - (p)->subwindows_state_changed || \ - (p)->windows_changed || \ - (p)->windows_structure_changed ) - -#define GLOBAL_REDISPLAY_FLAGS_CHANGEDP \ - ( buffers_changed || \ - clip_changed || \ - extents_changed || \ - faces_changed || \ - frame_changed || \ - icon_changed || \ - menubar_changed || \ - modeline_changed || \ - point_changed || \ - toolbar_changed || \ - gutter_changed || \ - glyphs_changed || \ - size_changed || \ - subwindows_changed || \ - subwindows_state_changed || \ - windows_changed || \ - windows_structure_changed ) - /* Anytime a console, device or frame is added or deleted we need to reset these flags. */ -#define RESET_CHANGED_SET_FLAGS do { \ - buffers_changed_set = 0; \ - clip_changed_set = 0; \ - extents_changed_set = 0; \ - icon_changed_set = 0; \ - menubar_changed_set = 0; \ - modeline_changed_set = 0; \ - point_changed_set = 0; \ - toolbar_changed_set = 0; \ - gutter_changed_set = 0; \ - glyphs_changed_set = 0; \ - subwindows_changed_set = 0; \ - subwindows_state_changed_set = 0; \ -} while (0) +#define RESET_CHANGED_SET_FLAGS \ + do { \ + buffers_changed_set = 0; \ + clip_changed_set = 0; \ + extents_changed_set = 0; \ + icon_changed_set = 0; \ + menubar_changed_set = 0; \ + modeline_changed_set = 0; \ + point_changed_set = 0; \ + toolbar_changed_set = 0; \ + glyphs_changed_set = 0; \ + subwindows_changed_set = 0; \ + } while (0) /*************************************************************************/ @@ -642,8 +464,8 @@ where one page is used for Emacs and another for all else. */ extern int no_redraw_on_reenter; -/* Non-nil means flash the frame instead of ringing the bell. */ -extern Lisp_Object Vvisible_bell; +/* Nonzero means flash the frame instead of ringing the bell. */ +extern int visible_bell; /* Thickness of shadow border around 3D modelines. */ extern Lisp_Object Vmodeline_shadow_thickness; @@ -663,7 +485,7 @@ extern int display_arg; /* Type of display specified. Defined in emacs.c. */ -extern const char *display_use; +extern CONST char *display_use; /* Nonzero means reading single-character input with prompt so put cursor on minibuffer after the prompt. */ @@ -672,8 +494,6 @@ extern Lisp_Object Qbar_cursor, Qcursor_in_echo_area, Vwindow_system; -extern Lisp_Object Qtop_bottom; - /*************************************************************************/ /* redisplay exported functions */ @@ -688,7 +508,6 @@ Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount len); -int redisplay_frame (struct frame *f, int preemption_check); void redisplay (void); struct display_block *get_display_block_from_line (struct display_line *dl, enum display_type type); @@ -700,20 +519,9 @@ int window_half_pixpos (struct window *w); void redisplay_echo_area (void); void free_display_structs (struct window_mirror *mir); -void free_display_lines (display_line_dynarr *dla); -void mark_redisplay_structs (display_line_dynarr *dla); -void generate_displayable_area (struct window *w, Lisp_Object disp_string, - int xpos, int ypos, int width, int height, - display_line_dynarr* dl, - Bufpos start_pos, face_index default_face); -/* `generate_title_string' in frame.c needs this */ -void generate_formatted_string_db (Lisp_Object format_str, - Lisp_Object result_str, - struct window *w, - struct display_line *dl, - struct display_block *db, - face_index findex, - int min_pixpos, int max_pixpos, int type); +Bufbyte *generate_formatted_string (struct window *w, Lisp_Object format_str, + Lisp_Object result_str, face_index findex, + int type); int real_current_modeline_height (struct window *w); int pixel_to_glyph_translation (struct frame *f, int x_coord, int y_coord, int *col, int *row, @@ -723,7 +531,7 @@ Lisp_Object *obj1, Lisp_Object *obj2); void glyph_to_pixel_translation (struct window *w, int char_x, int char_y, int *pix_x, int *pix_y); -void mark_redisplay (void); +void mark_redisplay (void (*) (Lisp_Object)); int point_in_line_start_cache (struct window *w, Bufpos point, int min_past); int point_would_be_visible (struct window *w, Bufpos startp, @@ -751,29 +559,12 @@ int get_next_display_block (layout_bounds bounds, display_block_dynarr *dba, int start_pos, int *next_start); -void redisplay_output_layout (struct window *w, - Lisp_Object image_instance, - struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height); -void redisplay_output_subwindow (struct window *w, - Lisp_Object image_instance, - struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height); +void redisplay_output_subwindow (struct window *w, struct display_line *dl, + Lisp_Object image_instance, int xpos, + int xoffset, int start_pixpos, int width, + face_index findex, int cursor_start, + int cursor_width, int cursor_height); void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height); -void redisplay_output_pixmap (struct window *w, - Lisp_Object image_instance, - struct display_box* db, struct display_glyph_area* dga, - face_index findex, int cursor_start, int cursor_width, - int cursor_height, int offset_bitmap); -int redisplay_calculate_display_boxes (struct display_line *dl, int xpos, - int xoffset, int start_pixpos, int width, - struct display_box* dest, - struct display_glyph_area* src); -int redisplay_normalize_glyph_area (struct display_box* dest, - struct display_glyph_area* glyphsrc); -void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2); void redisplay_clear_region (Lisp_Object window, face_index findex, int x, int y, int width, int height); void redisplay_clear_bottom_of_window (struct window *w, @@ -782,15 +573,11 @@ void redisplay_update_line (struct window *w, int first_line, int last_line, int update_values); void redisplay_output_window (struct window *w); -void bevel_modeline (struct window *w, struct display_line *dl); int redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end); void redisplay_redraw_cursor (struct frame *f, int run_begin_end_meths); void output_display_line (struct window *w, display_line_dynarr *cdla, display_line_dynarr *ddla, int line, int force_start, int force_end); -void sync_display_line_structs (struct window *w, int line, int do_blocks, - display_line_dynarr *cdla, - display_line_dynarr *ddla); -#endif /* INCLUDED_redisplay_h_ */ +#endif /* _XEMACS_REDISPLAY_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/regex.c --- a/src/regex.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/regex.c Mon Aug 13 11:20:41 2007 +0200 @@ -161,7 +161,7 @@ if (!done) { - const char *word_syntax_chars = + CONST char *word_syntax_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; memset (re_syntax_table, 0, sizeof (re_syntax_table)); @@ -352,7 +352,7 @@ #define BYTEWIDTH 8 /* In bits. */ -#define STREQ(s1, s2) (strcmp (s1, s2) == 0) +#define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) #undef MAX #undef MIN @@ -965,8 +965,8 @@ static void -print_double_string (const char *where, const char *string1, int size1, - const char *string2, int size2) +print_double_string (CONST char *where, CONST char *string1, int size1, + CONST char *string2, int size2) { if (where == NULL) printf ("(null)"); @@ -1031,7 +1031,7 @@ POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ -static const char *re_error_msgid[] = +static CONST char *re_error_msgid[] = { "Success", /* REG_NOERROR */ "No match", /* REG_NOMATCH */ @@ -1365,7 +1365,7 @@ { \ DEBUG_STATEMENT (fail_stack_elt_t ffailure_id;) \ int this_reg; \ - const unsigned char *string_temp; \ + CONST unsigned char *string_temp; \ \ assert (!FAIL_STACK_EMPTY ()); \ \ @@ -1385,7 +1385,7 @@ saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ - str = (const char *) string_temp; \ + str = (CONST char *) string_temp; \ \ DEBUG_PRINT2 (" Popping string 0x%lx: `", (long) str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ @@ -1410,10 +1410,10 @@ DEBUG_PRINT2 (" info: 0x%lx\n", \ * (long *) ®_info[this_reg]); \ \ - regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ + regend[this_reg] = (CONST char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: 0x%lx\n", (long) regend[this_reg]); \ \ - regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ + regstart[this_reg] = (CONST char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" start: 0x%lx\n", (long) regstart[this_reg]); \ } \ \ @@ -1509,7 +1509,7 @@ #define PATFETCH_EXTENDED(emch) \ do {if (p == pend) return REG_EEND; \ assert (p < pend); \ - emch = charptr_emchar ((const Bufbyte *) p); \ + emch = charptr_emchar ((CONST Bufbyte *) p); \ INC_CHARPTR (p); \ if (translate && emch < 0x80) \ emch = (Emchar) (unsigned char) translate[emch]; \ @@ -1518,7 +1518,7 @@ #define PATFETCH_RAW_EXTENDED(emch) \ do {if (p == pend) return REG_EEND; \ assert (p < pend); \ - emch = charptr_emchar ((const Bufbyte *) p); \ + emch = charptr_emchar ((CONST Bufbyte *) p); \ INC_CHARPTR (p); \ } while (0) @@ -1762,17 +1762,17 @@ unsigned char *end); static void insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end); -static boolean at_begline_loc_p (const char *pattern, const char *p, +static boolean at_begline_loc_p (CONST char *pattern, CONST char *p, reg_syntax_t syntax); -static boolean at_endline_loc_p (const char *p, const char *pend, int syntax); +static boolean at_endline_loc_p (CONST char *p, CONST char *pend, int syntax); static boolean group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum); -static reg_errcode_t compile_range (const char **p_ptr, const char *pend, +static reg_errcode_t compile_range (CONST char **p_ptr, CONST char *pend, char *translate, reg_syntax_t syntax, unsigned char *b); #ifdef MULE -static reg_errcode_t compile_extended_range (const char **p_ptr, - const char *pend, +static reg_errcode_t compile_extended_range (CONST char **p_ptr, + CONST char *pend, char *translate, reg_syntax_t syntax, Lisp_Object rtab); @@ -1785,11 +1785,11 @@ static boolean common_op_match_null_string_p (unsigned char **p, unsigned char *end, register_info_type *reg_info); -static int bcmp_translate (const unsigned char *s1, const unsigned char *s2, +static int bcmp_translate (CONST unsigned char *s1, CONST unsigned char *s2, REGISTER int len, char *translate); static int re_match_2_internal (struct re_pattern_buffer *bufp, - const char *string1, int size1, - const char *string2, int size2, int pos, + CONST char *string1, int size1, + CONST char *string2, int size2, int pos, struct re_registers *regs, int stop); #ifndef MATCH_MAY_ALLOCATE @@ -1808,11 +1808,11 @@ but never make them smaller. */ static int regs_allocated_size; -static const char ** regstart, ** regend; -static const char ** old_regstart, ** old_regend; -static const char **best_regstart, **best_regend; +static CONST char ** regstart, ** regend; +static CONST char ** old_regstart, ** old_regend; +static CONST char **best_regstart, **best_regend; static register_info_type *reg_info; -static const char **reg_dummy; +static CONST char **reg_dummy; static register_info_type *reg_info_dummy; /* Make the register vectors big enough for NUM_REGS registers, @@ -1823,14 +1823,14 @@ { if (num_regs > regs_allocated_size) { - RETALLOC_IF (regstart, num_regs, const char *); - RETALLOC_IF (regend, num_regs, const char *); - RETALLOC_IF (old_regstart, num_regs, const char *); - RETALLOC_IF (old_regend, num_regs, const char *); - RETALLOC_IF (best_regstart, num_regs, const char *); - RETALLOC_IF (best_regend, num_regs, const char *); + RETALLOC_IF (regstart, num_regs, CONST char *); + RETALLOC_IF (regend, num_regs, CONST char *); + RETALLOC_IF (old_regstart, num_regs, CONST char *); + RETALLOC_IF (old_regend, num_regs, CONST char *); + RETALLOC_IF (best_regstart, num_regs, CONST char *); + RETALLOC_IF (best_regend, num_regs, CONST char *); RETALLOC_IF (reg_info, num_regs, register_info_type); - RETALLOC_IF (reg_dummy, num_regs, const char *); + RETALLOC_IF (reg_dummy, num_regs, CONST char *); RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); regs_allocated_size = num_regs; @@ -1862,7 +1862,7 @@ return (free (compile_stack.stack), value) static reg_errcode_t -regex_compile (const char *pattern, int size, reg_syntax_t syntax, +regex_compile (CONST char *pattern, int size, reg_syntax_t syntax, struct re_pattern_buffer *bufp) { /* We fetch characters from PATTERN here. We declare these as int @@ -1874,7 +1874,7 @@ REGISTER EMACS_INT c, c1; /* A random temporary spot in PATTERN. */ - const char *p1; + CONST char *p1; /* Points to the end of the buffer, where we should append. */ REGISTER unsigned char *b; @@ -1883,8 +1883,8 @@ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ - const char *p = pattern; - const char *pend = pattern + size; + CONST char *p = pattern; + CONST char *pend = pattern + size; /* How to translate the characters in the pattern. */ char *translate = bufp->translate; @@ -1905,7 +1905,7 @@ /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ - const char *beg_interval; + CONST char *beg_interval; /* Address of the place where a forward jump should go to the end of the containing expression. Each alternative of an `or' -- except the @@ -2070,9 +2070,9 @@ /* If we get here, we found another repeat character. */ if (!(syntax & RE_NO_MINIMAL_MATCHING)) { - /* "*?" and "+?" and "??" are okay (and mean match - minimally), but other sequences (such as "*??" and - "+++") are rejected (reserved for future use). */ + /* `*?' and `+?' and `??' are okay (and mean match + minimally), but other sequences (such as `*??' and + `+++') are rejected (reserved for future use). */ if (minimal || c != '?') FREE_STACK_RETURN (REG_BADRPT); minimal = true; @@ -2388,7 +2388,7 @@ if (c == ':' || c == ']' || p == pend || c1 == CHAR_CLASS_MAX_LENGTH) break; - str[c1++] = (char) c; + str[c1++] = c; } str[c1] = '\0'; @@ -3008,7 +3008,7 @@ { /* XEmacs: modifications here for Mule. */ /* `q' points to the beginning of the next char. */ - const char *q = p - 1; + CONST char *q = p - 1; INC_CHARPTR (q); /* If no exactn currently being built. */ @@ -3184,9 +3184,9 @@ least one character before the ^. */ static boolean -at_begline_loc_p (const char *pattern, const char *p, reg_syntax_t syntax) +at_begline_loc_p (CONST char *pattern, CONST char *p, reg_syntax_t syntax) { - const char *prev = p - 2; + CONST char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return @@ -3201,11 +3201,11 @@ at least one character after the $, i.e., `P < PEND'. */ static boolean -at_endline_loc_p (const char *p, const char *pend, int syntax) +at_endline_loc_p (CONST char *p, CONST char *pend, int syntax) { - const char *next = p; + CONST char *next = p; boolean next_backslash = *next == '\\'; - const char *next_next = p + 1 < pend ? p + 1 : 0; + CONST char *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ @@ -3247,12 +3247,12 @@ `regex_compile' itself. */ static reg_errcode_t -compile_range (const char **p_ptr, const char *pend, char *translate, +compile_range (CONST char **p_ptr, CONST char *pend, char *translate, reg_syntax_t syntax, unsigned char *b) { unsigned this_char; - const char *p = *p_ptr; + CONST char *p = *p_ptr; int range_start, range_end; if (p == pend) @@ -3265,9 +3265,9 @@ We also want to fetch the endpoints without translating them; the appropriate translation is done in the bit-setting loop below. */ - /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */ - range_start = ((const unsigned char *) p)[-2]; - range_end = ((const unsigned char *) p)[0]; + /* The SVR4 compiler on the 3B2 had trouble with unsigned CONST char *. */ + range_start = ((CONST unsigned char *) p)[-2]; + range_end = ((CONST unsigned char *) p)[0]; /* Have to increment the pointer into the pattern string, so the caller isn't still at the ending character. */ @@ -3292,16 +3292,16 @@ #ifdef MULE static reg_errcode_t -compile_extended_range (const char **p_ptr, const char *pend, char *translate, +compile_extended_range (CONST char **p_ptr, CONST char *pend, char *translate, reg_syntax_t syntax, Lisp_Object rtab) { Emchar this_char, range_start, range_end; - const Bufbyte *p; + CONST Bufbyte *p; if (*p_ptr == pend) return REG_ERANGE; - p = (const Bufbyte *) *p_ptr; + p = (CONST Bufbyte *) *p_ptr; range_end = charptr_emchar (p); p--; /* back to '-' */ DEC_CHARPTR (p); /* back to start of range */ @@ -3858,7 +3858,7 @@ doesn't let you say where to stop matching. */ int -re_search (struct re_pattern_buffer *bufp, const char *string, int size, +re_search (struct re_pattern_buffer *bufp, CONST char *string, int size, int startpos, int range, struct re_registers *regs) { return re_search_2 (bufp, NULL, 0, string, size, startpos, range, @@ -3901,8 +3901,8 @@ stack overflow). */ int -re_search_2 (struct re_pattern_buffer *bufp, const char *string1, - int size1, const char *string2, int size2, int startpos, +re_search_2 (struct re_pattern_buffer *bufp, CONST char *string1, + int size1, CONST char *string2, int size2, int startpos, int range, struct re_registers *regs, int stop) { int val; @@ -3913,7 +3913,7 @@ #ifdef REGEX_BEGLINE_CHECK int anchored_at_begline = 0; #endif - const unsigned char *d; + CONST unsigned char *d; Charcount d_size; /* Check for out-of-range STARTPOS. */ @@ -3935,7 +3935,7 @@ return -1; else { - d = ((const unsigned char *) + d = ((CONST unsigned char *) (startpos >= size1 ? string2 - size1 : string1) + startpos); range = charcount_to_bytecount (d, 1); } @@ -3980,7 +3980,7 @@ if (startpos < size1 && startpos + range >= size1) lim = range - (size1 - startpos); - d = ((const unsigned char *) + d = ((CONST unsigned char *) (startpos >= size1 ? string2 - size1 : string1) + startpos); DEC_CHARPTR(d); /* Ok, since startpos != size1. */ d_size = charcount_to_bytecount (d, 1); @@ -4022,7 +4022,7 @@ if (startpos < size1 && startpos + range >= size1) lim = range - (size1 - startpos); - d = ((const unsigned char *) + d = ((CONST unsigned char *) (startpos >= size1 ? string2 - size1 : string1) + startpos); /* Written out as an if-else to avoid testing `translate' @@ -4090,7 +4090,7 @@ break; else if (range > 0) { - d = ((const unsigned char *) + d = ((CONST unsigned char *) (startpos >= size1 ? string2 - size1 : string1) + startpos); d_size = charcount_to_bytecount (d, 1); range -= d_size; @@ -4100,7 +4100,7 @@ { /* Note startpos > size1 not >=. If we are on the string1/string2 boundary, we want to backup into string1. */ - d = ((const unsigned char *) + d = ((CONST unsigned char *) (startpos > size1 ? string2 - size1 : string1) + startpos); DEC_CHARPTR(d); d_size = charcount_to_bytecount (d, 1); @@ -4191,7 +4191,7 @@ /* re_match is like re_match_2 except it takes only a single string. */ int -re_match (struct re_pattern_buffer *bufp, const char *string, int size, +re_match (struct re_pattern_buffer *bufp, CONST char *string, int size, int pos, struct re_registers *regs) { int result = re_match_2_internal (bufp, NULL, 0, string, size, @@ -4216,8 +4216,8 @@ matched substring. */ int -re_match_2 (struct re_pattern_buffer *bufp, const char *string1, - int size1, const char *string2, int size2, int pos, +re_match_2 (struct re_pattern_buffer *bufp, CONST char *string1, + int size1, CONST char *string2, int size2, int pos, struct re_registers *regs, int stop) { int result = re_match_2_internal (bufp, string1, size1, string2, size2, @@ -4229,8 +4229,8 @@ /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int -re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, - int size1, const char *string2, int size2, int pos, +re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, + int size1, CONST char *string2, int size2, int pos, struct re_registers *regs, int stop) { /* General temporaries. */ @@ -4239,14 +4239,14 @@ int should_succeed; /* XEmacs change */ /* Just past the end of the corresponding string. */ - const char *end1, *end2; + CONST char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ - const char *end_match_1, *end_match_2; + CONST char *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ - const char *d, *dend; + CONST char *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ unsigned char *p = bufp->buffer; @@ -4299,7 +4299,7 @@ stopped matching the regnum-th subexpression. (The zeroth register keeps track of what the whole pattern matches.) */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **regstart, **regend; + CONST char **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to @@ -4308,7 +4308,7 @@ are when we last see its open-group operator. Similarly for a register's end. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **old_regstart, **old_regend; + CONST char **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly @@ -4327,7 +4327,7 @@ turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **best_regstart, **best_regend; + CONST char **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to @@ -4338,14 +4338,14 @@ the end of the best match so far in a separate variable. We initialize this to NULL so that when we backtrack the first time and need to test it, it's not garbage. */ - const char *match_end = NULL; + CONST char *match_end = NULL; /* This helps SET_REGS_MATCHED avoid doing redundant work. */ int set_regs_matched_done = 0; /* Used when we pop values we don't care about. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **reg_dummy; + CONST char **reg_dummy; register_info_type *reg_info_dummy; #endif @@ -4373,14 +4373,14 @@ array indexing. We should fix this. */ if (bufp->re_nsub) { - regstart = REGEX_TALLOC (num_regs, const char *); - regend = REGEX_TALLOC (num_regs, const char *); - old_regstart = REGEX_TALLOC (num_regs, const char *); - old_regend = REGEX_TALLOC (num_regs, const char *); - best_regstart = REGEX_TALLOC (num_regs, const char *); - best_regend = REGEX_TALLOC (num_regs, const char *); + regstart = REGEX_TALLOC (num_regs, CONST char *); + regend = REGEX_TALLOC (num_regs, CONST char *); + old_regstart = REGEX_TALLOC (num_regs, CONST char *); + old_regend = REGEX_TALLOC (num_regs, CONST char *); + best_regstart = REGEX_TALLOC (num_regs, CONST char *); + best_regend = REGEX_TALLOC (num_regs, CONST char *); reg_info = REGEX_TALLOC (num_regs, register_info_type); - reg_dummy = REGEX_TALLOC (num_regs, const char *); + reg_dummy = REGEX_TALLOC (num_regs, CONST char *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); if (!(regstart && regend && old_regstart && old_regend && reg_info @@ -4735,7 +4735,7 @@ DEBUG_PRINT2 ("EXECUTING charset_mule%s.\n", not ? "_not" : ""); PREFETCH (); - c = charptr_emchar ((const Bufbyte *) d); + c = charptr_emchar ((CONST Bufbyte *) d); c = TRANSLATE_EXTENDED_UNSAFE (c); /* The character to match. */ if (EQ (Qt, unified_range_table_lookup (p, c, Qnil))) @@ -4950,7 +4950,7 @@ followed by the numeric value of <digit> as the register number. */ case duplicate: { - REGISTER const char *d2, *dend2; + REGISTER CONST char *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); @@ -5306,7 +5306,7 @@ `pop_failure_point'. */ unsigned dummy_low_reg, dummy_high_reg; unsigned char *pdummy; - const char *sdummy = NULL; + CONST char *sdummy = NULL; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, @@ -5422,10 +5422,10 @@ result = 1; else { - const unsigned char *d_before = - (const unsigned char *) POS_BEFORE_GAP_UNSAFE (d); - const unsigned char *d_after = - (const unsigned char *) POS_AFTER_GAP_UNSAFE (d); + CONST unsigned char *d_before = + (CONST unsigned char *) POS_BEFORE_GAP_UNSAFE (d); + CONST unsigned char *d_after = + (CONST unsigned char *) POS_AFTER_GAP_UNSAFE (d); Emchar emch1, emch2; DEC_CHARPTR (d_before); @@ -5453,14 +5453,14 @@ break; */ - const unsigned char *dtmp = - (const unsigned char *) POS_AFTER_GAP_UNSAFE (d); + CONST unsigned char *dtmp = + (CONST unsigned char *) POS_AFTER_GAP_UNSAFE (d); Emchar emch = charptr_emchar (dtmp); if (!WORDCHAR_P_UNSAFE (emch)) goto fail; if (AT_STRINGS_BEG (d)) break; - dtmp = (const unsigned char *) POS_BEFORE_GAP_UNSAFE (d); + dtmp = (CONST unsigned char *) POS_BEFORE_GAP_UNSAFE (d); DEC_CHARPTR (dtmp); emch = charptr_emchar (dtmp); if (!WORDCHAR_P_UNSAFE (emch)) @@ -5479,18 +5479,18 @@ The or condition is incorrect (reversed). */ - const unsigned char *dtmp; + CONST unsigned char *dtmp; Emchar emch; if (AT_STRINGS_BEG (d)) goto fail; - dtmp = (const unsigned char *) POS_BEFORE_GAP_UNSAFE (d); + dtmp = (CONST unsigned char *) POS_BEFORE_GAP_UNSAFE (d); DEC_CHARPTR (dtmp); emch = charptr_emchar (dtmp); if (!WORDCHAR_P_UNSAFE (emch)) goto fail; if (AT_STRINGS_END (d)) break; - dtmp = (const unsigned char *) POS_AFTER_GAP_UNSAFE (d); + dtmp = (CONST unsigned char *) POS_AFTER_GAP_UNSAFE (d); emch = charptr_emchar (dtmp); if (!WORDCHAR_P_UNSAFE (emch)) break; @@ -5543,7 +5543,7 @@ Emchar emch; PREFETCH (); - emch = charptr_emchar ((const Bufbyte *) d); + emch = charptr_emchar ((CONST Bufbyte *) d); matches = (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), emch) == (enum syntaxcode) mcnt); @@ -5576,7 +5576,7 @@ mcnt = *p++; PREFETCH (); - emch = charptr_emchar ((const Bufbyte *) d); + emch = charptr_emchar ((CONST Bufbyte *) d); INC_CHARPTR (d); if (check_category_char(emch, regex_emacs_buffer->category_table, mcnt, should_succeed)) @@ -5918,10 +5918,10 @@ bytes; nonzero otherwise. */ static int -bcmp_translate (const unsigned char *s1, const unsigned char *s2, +bcmp_translate (CONST unsigned char *s1, CONST unsigned char *s2, REGISTER int len, char *translate) { - REGISTER const unsigned char *p1 = s1, *p2 = s2; + REGISTER CONST unsigned char *p1 = s1, *p2 = s2; while (len) { if (translate[*p1++] != translate[*p2++]) return 1; @@ -5941,8 +5941,8 @@ We call regex_compile to do the actual compilation. */ -const char * -re_compile_pattern (const char *pattern, int length, +CONST char * +re_compile_pattern (CONST char *pattern, int length, struct re_pattern_buffer *bufp) { reg_errcode_t ret; @@ -5975,7 +5975,7 @@ static struct re_pattern_buffer re_comp_buf; char * -re_comp (const char *s) +re_comp (CONST char *s) { reg_errcode_t ret; @@ -6009,15 +6009,15 @@ if (!ret) return NULL; - /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ + /* Yes, we're discarding `CONST' here if !HAVE_LIBINTL. */ return (char *) gettext (re_error_msgid[(int) ret]); } int -re_exec (const char *s) +re_exec (CONST char *s) { - const int len = strlen (s); + CONST int len = strlen (s); return 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); } @@ -6062,7 +6062,7 @@ the return codes and their meanings.) */ int -regcomp (regex_t *preg, const char *pattern, int cflags) +regcomp (regex_t *preg, CONST char *pattern, int cflags) { reg_errcode_t ret; unsigned syntax @@ -6135,7 +6135,7 @@ We return 0 if we find a match and REG_NOMATCH if not. */ int -regexec (const regex_t *preg, const char *string, size_t nmatch, +regexec (CONST regex_t *preg, CONST char *string, size_t nmatch, regmatch_t pmatch[], int eflags) { int ret; @@ -6196,9 +6196,9 @@ from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) +regerror (int errcode, CONST regex_t *preg, char *errbuf, size_t errbuf_size) { - const char *msg; + CONST char *msg; size_t msg_size; if (errcode < 0 diff -r 12e008d41344 -r 697ef44129c6 src/regex.h --- a/src/regex.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/regex.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.29. */ -#ifndef INCLUDED_regex_h_ -#define INCLUDED_regex_h_ +#ifndef __REGEXP_LIBRARY_H__ +#define __REGEXP_LIBRARY_H__ /* POSIX says that <sys/types.h> must be included (by the caller) before <regex.h>. */ @@ -413,7 +413,7 @@ /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global `re_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. */ -const char *re_compile_pattern (const char *pattern, int length, +CONST char *re_compile_pattern (CONST char *pattern, int length, struct re_pattern_buffer *buffer); @@ -428,27 +428,27 @@ characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ -int re_search (struct re_pattern_buffer *buffer, const char *string, +int re_search (struct re_pattern_buffer *buffer, CONST char *string, int length, int start, int range, struct re_registers *regs); /* Like `re_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ -int re_search_2 (struct re_pattern_buffer *buffer, const char *string1, - int length1, const char *string2, int length2, int start, +int re_search_2 (struct re_pattern_buffer *buffer, CONST char *string1, + int length1, CONST char *string2, int length2, int start, int range, struct re_registers *regs, int stop); /* Like `re_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ -int re_match (struct re_pattern_buffer *buffer, const char *string, +int re_match (struct re_pattern_buffer *buffer, CONST char *string, int length, int start, struct re_registers *regs); /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ -int re_match_2 (struct re_pattern_buffer *buffer, const char *string1, - int length1, const char *string2, int length2, +int re_match_2 (struct re_pattern_buffer *buffer, CONST char *string1, + int length1, CONST char *string2, int length2, int start, struct re_registers *regs, int stop); @@ -470,16 +470,16 @@ #ifdef _REGEX_RE_COMP /* 4.2 bsd compatibility. */ -char *re_comp (const char *); -int re_exec (const char *); +char *re_comp (CONST char *); +int re_exec (CONST char *); #endif /* POSIX compatibility. */ -int regcomp (regex_t *preg, const char *pattern, int cflags); -int regexec (const regex_t *preg, const char *string, size_t nmatch, +int regcomp (regex_t *preg, CONST char *pattern, int cflags); +int regexec (CONST regex_t *preg, CONST char *string, size_t nmatch, regmatch_t pmatch[], int eflags); -size_t regerror (int errcode, const regex_t *preg, char *errbuf, +size_t regerror (int errcode, CONST regex_t *preg, char *errbuf, size_t errbuf_size); void regfree (regex_t *preg); -#endif /* INCLUDED_regex_h_ */ +#endif /* not __REGEXP_LIBRARY_H__ */ diff -r 12e008d41344 -r 697ef44129c6 src/s/aix3-2.h --- a/src/s/aix3-2.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/aix3-2.h Mon Aug 13 11:20:41 2007 +0200 @@ -32,6 +32,8 @@ #endif #endif +#define HAVE_FSYNC + /* With this defined, a gcc-compiled Emacs crashed in realloc under AIX 3.2, and a cc-compiled Emacs works with this undefined. --karl@cs.umb.edu. */ diff -r 12e008d41344 -r 697ef44129c6 src/s/aix4.h --- a/src/s/aix4.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/aix4.h Mon Aug 13 11:20:41 2007 +0200 @@ -7,26 +7,7 @@ #ifndef NOT_C_CODE #define _XFUNCS_H_ 1 - -/* AIX is happier when bzero and strcasecmp are declared */ -#include "strings.h" - -/* AIX 4.2's sys/mman.h doesn't seem to define MAP_FAILED, - although Unix98 claims it must. */ -#ifdef HAVE_MMAP -#include <sys/mman.h> -# ifndef MAP_FAILED -# define MAP_FAILED ((void *) -1) -# endif -#endif - /* Forward declarations for xlc warning suppressions */ struct ether_addr; struct sockaddr_dl; -#endif /* C code */ - -/* getaddrinfo is broken in AIX 4.3 as per IY04165. - At this time (2/21/2000), there's no PTF available. - -- Mike Sperber <mike@xemacs.org> */ - -#undef HAVE_GETADDRINFO +#endif diff -r 12e008d41344 -r 697ef44129c6 src/s/cygwin32.h --- a/src/s/cygwin32.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/cygwin32.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,14 +20,13 @@ /* Building under cygwin * - * The approach I have taken with this port is to use primarily the - * UNIX code base adding stuff that is MS-Windows specific. This works - * quite well, and is in keeping with my perception of the cygwin - * philosophy. Note that if you make changes to this file you do NOT - * want to define WIN32_NATIVE (formerly "WINDOWSNT"), I repeat - do - * not define this, it will break everything horribly. What does get - * defined is HAVE_MS_WINDOWS, but this is done by configure and only - * applies to the window system. + * The approach I have taken with this port is to use primarily the UNIX + * code base adding stuff that is MS-Windows specific. This works quite + * well, and is in keeping with my perception of the cygwin philosophy. + * Note that if you make changes to this file you do NOT want to define + * WINDOWSNT, I repeat - do not define this, it will break everything + * horribly. What does get defined is HAVE_MS_WINDOWS, but this is + * done by configure and only applies to the window system. * * When building make sure your HOME path is unix style - i.e. without * a drive letter. @@ -39,63 +38,78 @@ * YMMV. I build with NT4 SP3. * * Andy Piper <andy@xemacs.org> 8/1/98 - * http://www.xemacs.freeserve.co.uk/ */ - -/* Identify ourselves */ -#define CYGWIN + * http://www.parallax.co.uk/~andyp */ /* cheesy way to determine cygwin version */ #ifndef NOT_C_CODE -# include <signal.h> -# ifdef HAVE_CYGWIN_VERSION_H -# include <cygwin/version.h> -# else -# ifdef SIGIO -# define CYGWIN_VERSION_DLL_MAJOR 19 -# define CYGWIN_VERSION_DLL_MINOR 0 -# define CYGWIN_B19 -# else -# define CYGWIN_VERSION_DLL_MAJOR 18 -# define CYGWIN_VERSION_DLL_MINOR 0 -# define BROKEN_CYGWIN -# endif -# endif +#include <signal.h> +#ifdef HAVE_CYGWIN_VERSION_H +#include <cygwin/version.h> +#else +#ifdef SIGIO +#define CYGWIN_B19 +#else +#define BROKEN_CYGWIN +#endif +#endif -void cygwin32_win32_to_posix_path_list (const char*, char*); -int cygwin32_win32_to_posix_path_list_buf_size (const char*); -void cygwin32_posix_to_win32_path_list (const char*, char*); -int cygwin32_posix_to_win32_path_list_buf_size (const char*); -# if CYGWIN_VERSION_DLL_MAJOR < 20 +extern void cygwin32_win32_to_posix_path_list(const char*, char*); +extern int cygwin32_win32_to_posix_path_list_buf_size(const char*); +extern void cygwin32_posix_to_win32_path_list(const char*, char*); +extern int cygwin32_posix_to_win32_path_list_buf_size(const char*); +#ifndef CYGWIN_VERSION_DLL_MAJOR struct timeval; struct timezone; struct itimerval; struct stat; -int gettimeofday (struct timeval *tp, struct timezone *tzp); -int gethostname (char* name, int namelen); -char* mktemp (char *); -double logb (double); -void sync (void); -int ioctl (int, int, ...); - /* sys/stat.h */ -int lstat (const char *path, struct stat *buf); - /* unistd.h */ -int readlink (const char *path, void *buf, unsigned int bufsiz); -int symlink (const char *name1, const char *name2); - /* sys/time.h */ -int setitimer (int which, const struct itimerval *value, - struct itimerval *ovalue); -int utimes (char *file, struct timeval *tvp); +extern int gettimeofday(struct timeval *tp, struct timezone *tzp); +extern int gethostname (char* name, int namelen); +extern char* mktemp(char *); +extern double logb(double); +extern void sync(); +extern int ioctl(int, int, ...); + /* sys/stat.h */ +extern int lstat(const char *path, struct stat *buf); + /* unistd.h */ +extern int readlink(const char *path, void *buf, unsigned int bufsiz); +extern int symlink(const char *name1, const char *name2); + /* sys/time.h */ +extern int setitimer(int which, const struct itimerval *value, + struct itimerval *ovalue); +extern int utimes(char *file, struct timeval *tvp); + +extern int srandom( unsigned seed); +extern long random(); -int srandom (unsigned seed); -long random (void); - -# endif /* CYGWIN_VERSION_DLL_MAJOR < 20 */ +#define SND_ASYNC 1 +#define SND_NODEFAULT 2 +#define SND_MEMORY 4 +#define SND_FILENAME 0x2000L +#define VK_APPS 0x5D +#define SIF_TRACKPOS 0x0010 +#define ICC_BAR_CLASSES 4 +#define FW_BLACK FW_HEAVY +#define FW_ULTRABOLD FW_EXTRABOLD +#define FW_DEMIBOLD FW_SEMIBOLD +#define FW_ULTRALIGHT FW_EXTRALIGHT +#define APPCMD_FILTERINITS 0x20L +#define CBF_FAIL_SELFCONNECTIONS 0x1000 +#define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000 +#define CBF_FAIL_ADVISES 0x4000 +#define CBF_FAIL_POKES 0x10000 +#define CBF_FAIL_REQUESTS 0x20000 +#define SZDDESYS_TOPIC "System" +#define JOHAB_CHARSET 130 +#define MAC_CHARSET 77 -# if CYGWIN_VERSION_DLL_MAJOR <= 20 -char *getpass (const char *prompt); -double logb (double); -# endif /* CYGWIN_VERSION_DLL_MAJOR <= 20 */ +#endif +#endif +#define PBS_SMOOTH 0x01 + +#ifdef HAVE_MS_WINDOWS +#define HAVE_NTGUI +#define HAVE_FACES #endif #ifndef ORDINARY_LINK @@ -104,18 +118,17 @@ #define C_SWITCH_SYSTEM -Wno-sign-compare -fno-caller-saves #define LIBS_SYSTEM -lwinmm -#define WIN32_LEAN_AND_MEAN + #define TEXT_START -1 #define TEXT_END -1 #define DATA_END -1 #define HEAP_IN_DATA -#define NO_LIM_DATA #define UNEXEC "unexcw.o" #ifdef CYGWIN_VERSION_DLL_MAJOR #if 0 -/* #### FIXME: although defining BROKEN_SIGIO is correct for proper ^G +/* ### FIXME: although defining BROKEN_SIGIO is correct for proper ^G behavior, bugs in cygwin mean that xemacs locks up frequently if this is defined. */ #define BROKEN_SIGIO @@ -128,14 +141,29 @@ #define HAVE_SOCKETS #endif #define OBJECTS_SYSTEM ntplay.o +#define HAVE_NATIVE_SOUND #undef MAIL_USE_SYSTEM_LOCK +#define MAIL_USE_POP /* Define NO_ARG_ARRAY if you cannot take the address of the first of a * group of arguments and treat it as an array of the arguments. */ #define NO_ARG_ARRAY +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND + /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -154,6 +182,10 @@ /* Text does precede data space, but this is never a safe assumption. */ #define VIRT_ADDR_VARIES +/* set this if you have a new version of cygwin +#define DATA_SEG_BITS 0x10000000 +*/ + /* If you are compiling with a non-C calling convention but need to declare vararg routines differently, put it here */ #define _VARARGS_ __cdecl diff -r 12e008d41344 -r 697ef44129c6 src/s/decosf4-0.h --- a/src/s/decosf4-0.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/decosf4-0.h Mon Aug 13 11:20:41 2007 +0200 @@ -2,15 +2,9 @@ #include "decosf3-2.h" -/* etext and edata are only available when compiling in non-ANSI mode, - while _etext and _edata are always available, hence more portable. - This allows `configure --compiler=cc --cflags=-std1' to work. */ -#define etext _etext -#define edata _edata - #ifndef NOT_C_CODE -#include "sys/lc_core.h" -#include "reg_types.h" +#include "/usr/include/sys/lc_core.h" +#include "/usr/include/reg_types.h" #endif /* C code */ #define re_compile_pattern sys_re_compile_pattern @@ -30,12 +24,13 @@ #define regoff_t sys_regoff_t #define regmatch_t sys_regmatch_t +/* A perfectly ordinary link wins again - martin */ #undef C_SWITCH_SYSTEM #undef LIBS_SYSTEM #undef LIBS_DEBUG -/* #define ORDINARY_LINK */ +#define ORDINARY_LINK -#undef SYSTEM_MALLOC +#define SYSTEM_MALLOC #if 0 /* martin */ /* Some V4.0* versions before V4.0B don't detect rename properly. */ diff -r 12e008d41344 -r 697ef44129c6 src/s/freebsd.h --- a/src/s/freebsd.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/freebsd.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,6 @@ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) -#define INTERRUPTIBLE_OPEN - #define LIBS_DEBUG /* FreeBSD 2.2 or later */ #ifndef __FreeBSD_version diff -r 12e008d41344 -r 697ef44129c6 src/s/linux.h --- a/src/s/linux.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/linux.h Mon Aug 13 11:20:41 2007 +0200 @@ -26,12 +26,6 @@ #define USG #define LINUX -/* powerpc gcc 2.8.0 doesn't define __ELF__, but it is */ - -#if defined(__ELF__) || defined(powerpc) -#define LINUX_ELF -#endif - /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ @@ -87,7 +81,7 @@ /* Ask GCC where to find libgcc.a. */ #define LIB_GCC "`$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`" -#ifndef LINUX_ELF +#ifndef __ELF__ /* Linux has crt0.o in a non-standard place */ #define START_FILES "pre-crt0.o /usr/lib/crt0.o" #else @@ -112,7 +106,7 @@ /* Best not to include -lg, unless it is last on the command line */ #define LIBS_DEBUG #define LIBS_TERMCAP "-ltermcap -lcurses" /* save some space with shared libs*/ -#ifndef LINUX_ELF +#ifndef __ELF__ #define LIB_STANDARD "-lc" /* avoid -lPW */ #else /*#undef LIB_GCC @@ -130,7 +124,7 @@ #define LIBS_SYSTEM #endif -#ifdef LINUX_ELF +#ifdef __ELF__ #define UNEXEC "unexelf.o" #define UNEXEC_USE_MAP_PRIVATE #if 0 @@ -148,7 +142,7 @@ #undef START_FILES #undef LIB_GCC #endif -#endif /* LINUX_ELF */ +#endif /* __ELF__ */ #ifdef LINUX_QMAGIC diff -r 12e008d41344 -r 697ef44129c6 src/s/mingw32.h --- a/src/s/mingw32.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/mingw32.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,20 +20,27 @@ /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */ -/* Identify ourselves */ -#ifndef WIN32_NATIVE -#define WIN32_NATIVE +#ifndef WINDOWSNT +#define WINDOWSNT #endif -#define MINGW +#ifndef DOS_NT +#define DOS_NT /* MSDOS or WINDOWSNT */ +#endif + +#define PBS_SMOOTH 0x01 + +#ifdef HAVE_MS_WINDOWS +#define HAVE_NTGUI +#define HAVE_FACES +#endif #ifndef ORDINARY_LINK #define ORDINARY_LINK #endif -#define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -DWIN32_NATIVE" -#define LIBS_SYSTEM "-mno-cygwin -mwindows -lwinmm -lwsock32" -#define WIN32_LEAN_AND_MEAN +#define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT" +#define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32" #define TEXT_START -1 #define TEXT_END -1 @@ -44,11 +51,9 @@ #define TIME_ONESHOT 0 #define TIME_PERIODIC 1 #define LOCALE_USE_CP_ACP 0x40000000 +#define SHGFI_EXETYPE 0x2000 #define NSIG 23 -/* this is necessary to get the TCS_* definitions in <commctrl.h> */ -#define _WIN32_IE 0x0400 - /* translate NT world unexec stuff to our a.out definitions */ #define strnicmp strncasecmp @@ -56,8 +61,10 @@ #define HAVE_SOCKETS /* #endif */ #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o +#define HAVE_NATIVE_SOUND #undef MAIL_USE_SYSTEM_LOCK +#define MAIL_USE_POP #define HAVE_MSW_C_DIRED /* Define NO_ARG_ARRAY if you cannot take the address of the first of a @@ -65,13 +72,23 @@ #define NO_ARG_ARRAY +/* Define WORD_MACHINE if addresses and such have + * to be corrected before they can be used as byte counts. */ + +#define WORD_MACHINE + +/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend + the 24-bit bit field into an int. In other words, if bit fields + are always unsigned. + + If you use NO_UNION_TYPE, this flag does not matter. */ + +#define EXPLICIT_SIGN_EXTEND /* System calls that are encapsulated */ #define ENCAPSULATE_RENAME #define ENCAPSULATE_OPEN #define ENCAPSULATE_FOPEN #define ENCAPSULATE_MKDIR -#define ENCAPSULATE_STAT -#define ENCAPSULATE_FSTAT /* Data type of load average, as read out of kmem. */ @@ -91,6 +108,10 @@ /* Text does precede data space, but this is never a safe assumption. */ #define VIRT_ADDR_VARIES +/* set this if you have a new version of cygwin +#define DATA_SEG_BITS 0x10000000 +*/ + /* If you are compiling with a non-C calling convention but need to declare vararg routines differently, put it here */ #define _VARARGS_ __cdecl @@ -128,7 +149,7 @@ /* Define this to be the separator between devices and paths */ #define DEVICE_SEP ':' -#define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char)) +#define DIRECTORY_SEP '\\' /* The null device on Windows NT. */ #define NULL_DEVICE "NUL:" @@ -151,6 +172,12 @@ #include <cygwin/version.h> #endif +typedef unsigned int MMRESULT; +typedef struct timecaps_tag { + unsigned int wPeriodMin; + unsigned int wPeriodMax; +} TIMECAPS; + /* IO calls that are emulated or shadowed */ #define pipe sys_pipe int sys_pipe (int * phandles); @@ -162,8 +189,8 @@ /* subprocess calls that are emulated */ #define spawnve sys_spawnve -int spawnve (int mode, const char *cmdname, - const char * const *argv, const char *const *envp); +int spawnve (int mode, CONST char *cmdname, + CONST char * CONST *argv, CONST char *CONST *envp); #define wait sys_wait int wait (int *status); @@ -178,7 +205,7 @@ /* Encapsulation of system calls */ #ifndef DONT_ENCAPSULATE #define getpid sys_getpid -pid_t getpid (void); +int getpid (void); #endif #define DONT_USE_LITOUT @@ -195,46 +222,31 @@ void *sbrk (unsigned long increment); struct passwd; -struct passwd *getpwuid (uid_t uid); +struct passwd *getpwuid (int uid); struct passwd *getpwnam (const char *name); -uid_t getuid (void); -uid_t geteuid (void); -gid_t getgid (void); -gid_t getegid (void); - -#if CYGWIN_VERSION_DLL_MAJOR <= 21 -#define _ftime ftime +int getuid (); +int geteuid (); +int getgid (void); +int getegid (); #define _timeb timeb -#endif /* Stuff that gets set wrongly or otherwise */ #define HAVE_SETITIMER #define HAVE_GETTIMEOFDAY #define HAVE_SELECT -/* systime.h includes winsock.h which defines timeval */ -#define HAVE_TIMEVAL -#define HAVE_GETPAGESIZE -#define getpagesize() 4096 /*#define HAVE_STRUCT_UTIMBUF*/ -#ifndef HAVE_H_ERRNO -#define HAVE_H_ERRNO -#endif -#ifndef HAVE_TZNAME -#define HAVE_TZNAME -#endif #undef GETTIMEOFDAY_ONE_ARGUMENT #undef HAVE_SYS_WAIT_H #undef HAVE_TERMIOS #undef SYSV_SYSTEM_DIR -#undef CLASH_DETECTION /* We now have emulation for some signals */ #define HAVE_SIGHOLD -#define sigset(s,h) mswindows_sigset(s,h) -#define sighold(s) mswindows_sighold(s) -#define sigrelse(s) mswindows_sigrelse(s) -#define sigpause(s) mswindows_sigpause(s) +#define sigset(s,h) msw_sigset(s,h) +#define sighold(s) msw_sighold(s) +#define sigrelse(s) msw_sigrelse(s) +#define sigpause(s) msw_sigpause(s) #define signal sigset /* Defines that we need that aren't in the standard signal.h */ @@ -247,7 +259,11 @@ #ifndef MAXPATHLEN #define MAXPATHLEN _MAX_PATH #endif -#endif /* !NOT_C_CODE */ + +/* For integration with MSDOS support. */ +#define getdisk() (_getdrive () - 1) +#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN) +#endif /* Define for those source files that do not include enough NT system files. */ @@ -262,7 +278,5 @@ /* Define process implementation */ #define HAVE_WIN32_PROCESSES -#define CORRECT_DIR_SEPS(s) \ - do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ - else unixtodos_filename (s); \ - } while (0) +/* ============================================================ */ + diff -r 12e008d41344 -r 697ef44129c6 src/s/msdos.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/s/msdos.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,223 @@ +/* System description file for MS-DOS + + Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with 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.31. */ + +/* Note: lots of stuff here was taken from s-msdos.h in demacs. */ + + +/* + * Define symbols to identify the version of Unix this is. + * Define all the symbols that apply correctly. + */ + +/* #define UNIPLUS */ +/* #define USG5 */ +/* #define USG */ +/* #define HPUX */ +/* #define UMAX */ +/* #define BSD4_1 */ +/* #define BSD4_2 */ +/* #define BSD4_3 */ +/* #define BSD */ +#ifndef MSDOS +#define MSDOS +#endif + +#ifdef __GO32__ +#ifndef __DJGPP__ +#define __DJGPP__ 1 /* V2 defines __DJGPP__ == 2 */ +#endif +#else +You lose; /* Emacs for DOS must be compiled with DJGPP */ +#endif + +#define DOS_NT /* MSDOS or WINDOWSNT */ +#undef BSD + +/* SYSTEM_TYPE should indicate the kind of system you are using. + It sets the Lisp variable system-type. */ + +#define SYSTEM_TYPE "ms-dos" + +#define SYMS_SYSTEM syms_of_dosfns();syms_of_msdos() + +/* Letter to use in finding device name of first pty, + if system supports pty's. 'a' means it is /dev/ptya0 */ + +/* #define FIRST_PTY_LETTER 'a' */ + +/* + * Define HAVE_PTYS if the system supports pty devices. + */ + +/* #define HAVE_PTYS */ + +/* MSDOS has dirent.h but doesn't behave otherwise like the SYSV + directory functions. We have special tests for this in + sysdir.h. */ + +#undef SYSV_SYSTEM_DIR + +/* Define this is the compiler understands `volatile'. */ +#define HAVE_VOLATILE + +#define NO_SUBPROCESSES + +/* If your system uses COFF (Common Object File Format) then define the + preprocessor symbol "COFF". */ + +#define COFF + +/* define MAIL_USE_FLOCK if the mailer uses flock + to interlock access to /usr/spool/mail/$USER. + The alternative is that a lock file named + /usr/spool/mail/$USER.lock. */ + +/* #define MAIL_USE_FLOCK */ + +/* Here, on a separate page, add any special hacks needed + to make Emacs work on this system. For example, + you might define certain system call names that don't + exist on your system, or that do different things on + your system and must be used only through an encapsulation + (Which you should place, by convention, in sysdep.c). */ + +/* Avoid incompatibilities between gmalloc.c and system header files + in how to declare valloc. */ +#define GMALLOC_INHIBIT_VALLOC + +/* setjmp and longjmp can safely replace _setjmp and _longjmp, + but they will run slower. */ + +#define _setjmp setjmp +#define _longjmp longjmp + +#if __DJGPP__ < 2 + +#define NO_MODE_T + +/* New chdir () routine. + DJGPP v2.0 and later doesn't need it because its chdir() does + set the drive itself. */ +#ifdef chdir +#undef chdir +#endif +#define chdir sys_chdir + +#define LIBS_SYSTEM "-lpc" /* isn't required in DJGPP v2.0, either */ + +#endif /* __DJGPP__ < 2 */ + +#if __DJGPP__ > 1 + +#define DATA_START (&etext + 1) +#define TEXT_START &start +#define TEXT_END &etext + +#define _NAIVE_DOS_REGS + +#else /* not __DJGPP__ > 1 */ + +/* This somehow needs to be defined even though we use COFF. */ +#define TEXT_START -1 + +#endif /* not __DJGPP__ > 1 */ + +#define ORDINARY_LINK + +/* command.com does not understand `...` so we define this. */ +#define LIB_GCC "-Lgcc" +#define DONT_NEED_ENVIRON +#define SEPCHAR ';' + +#define NULL_DEVICE "nul" +#define EXEC_SUFFIXES ".exe:.com:.bat:" + +#if __DJGPP__ < 2 +#define O_RDONLY 0x0001 +#define O_WRONLY 0x0002 +#define O_RDWR 0x0004 +#define O_CREAT 0x0100 +#define O_TRUNC 0x0200 +#define O_EXCL 0x0400 +#define O_APPEND 0x0800 +#define O_TEXT 0x4000 +#define O_BINARY 0x8000 +#define NO_MATHERR +#endif + +#define HAVE_INVERSE_HYPERBOLIC +#define FLOAT_CHECK_DOMAIN + +/* When $TERM is "internal" then this is substituted: */ +#define INTERNAL_TERMINAL "pc|bios|IBM PC with color display:\ +:co#80:li#25:km:ms:cm=<CM>:cl=<CL>:ce=<CE>:" + +/* Define this to a function (Fdowncase, Fupcase) if your file system + likes that */ +#define FILE_SYSTEM_CASE Fmsdos_downcase_filename + +/* Define this to be the separator between devices and paths */ +#define DEVICE_SEP ':' + +/* We'll support either convention on MSDOG. */ +#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') +#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) + +/* Call init_gettimeofday when TZ changes. */ +#if __DJGPP__ < 2 +#define LOCALTIME_CACHE +#define tzset init_gettimeofday +#endif + +/* bcopy under djgpp is quite safe */ +#define GAP_USE_BCOPY +#define BCOPY_UPWARD_SAFE 1 +#define BCOPY_DOWNWARD_SAFE 1 + +/* Mode line description of a buffer's type. */ +#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") + +/* Do we have POSIX signals? */ +#if __DJGPP__ > 1 +#define POSIX_SIGNALS +#endif + +/* We have (the code to control) a mouse. */ +#define HAVE_MOUSE + +/* We canuse mouse menus. */ +#define HAVE_MENUS + +/* We have support for faces. */ +#define HAVE_FACES + +/* Define one of these for easier conditionals. */ +#ifdef HAVE_X_WINDOWS +/* We need a little extra space, see ../../lisp/loadup.el */ +#define SYSTEM_PURESIZE_EXTRA 15000 +#define HAVE_X11R5 +#define LIBX11_SYSTEM "-lxext -lsys" +#else +/* We need a little extra space, see ../../lisp/loadup.el */ +#define SYSTEM_PURESIZE_EXTRA 85000 +#endif diff -r 12e008d41344 -r 697ef44129c6 src/s/sco7.h --- a/src/s/sco7.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -/* Synched up with: FSF 19.31. */ - -/* s/ file for System V release 4.2. */ - -#include "usg5-4.h" - -/* Motif needs -lgen. */ -#undef LIBS_SYSTEM -#define LIBS_SYSTEM "-lsocket -lnsl -lelf -lgen" - -#define VFORK_RETURN_TYPE pid_t - -/* XEmacs change: communicate to m/intel386.h */ -#define USG5_4_2 diff -r 12e008d41344 -r 697ef44129c6 src/s/sol2.h --- a/src/s/sol2.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/sol2.h Mon Aug 13 11:20:41 2007 +0200 @@ -10,6 +10,20 @@ #define USG5_4 #endif +#undef _POSIX_C_SOURCE + +#if OS_RELEASE > 54 +/* There were some bugs with preprocessor symbol interaction, which + were not fixed until 2.5. */ +#define __EXTENSIONS__ 1 + +#undef _XOPEN_SOURCE +#define _XOPEN_SOURCE 1 + +#undef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED 1 +#endif /* > Solaris 2.4 */ + #if OS_RELEASE >= 57 #define HAVE_GETLOADAVG #endif diff -r 12e008d41344 -r 697ef44129c6 src/s/windows95.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/s/windows95.h Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,7 @@ +/* Synched up with: FSF 19.31. */ + +/* System description file for Windows 95. */ + +#include "windowsnt.h" + +#define WINDOWS95 diff -r 12e008d41344 -r 697ef44129c6 src/s/windowsnt.h --- a/src/s/windowsnt.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/s/windowsnt.h Mon Aug 13 11:20:41 2007 +0200 @@ -1,4 +1,4 @@ -/* System description file for Windows 9x and NT. +/* System description file for Windows NT. Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -20,73 +20,12 @@ /* Synched up with: FSF 19.31. */ -/* Capsule summary of different preprocessor flags: - -1. Keep in mind that there are two possible OS environments we are dealing - with -- Cygwin and Native Windows. Cygwin provides a POSIX emulation - layer on top of MS Windows -- in particular, providing the file-system, - process, tty, and signal semantics that are part of a modern, standard - Unix operating system. MS Windows also provides these services, but - through their own API, called Win32. When compiling in a Cygwin - environment, the Win32 API's are also available, and in fact are used - to do native GUI programming. - -2. There are two windowing environments we can target XEmacs for when - running under MS Windows -- Windows native, and X. (It may seem strange - to write an X application under Windows, but there are in fact many X - servers out there running on Windows, and as far as I know there is no - real (or at least, that works well) networking Window-system extension - under MS Windows. Furthermore, if you're porting a Unix application to - Windows and use Cygwin to assist you, it might seem natural to use an - X server to avoid having to port all the code to Windows.) For XEmacs, - there are various reasons people could come up with for why we would - want to keep maintaining X Windows under MS Windows support. - -That gives us four possible build environments. I (Ben) build -regularly on fully-native-everything, Andy builds on Cygwin + MS -Windows + X Windows for windowing. - -The build flags used for these divisions are: - -CYGWIN -- for Cygwin-only stuff. -WIN32_NATIVE -- Win32 native OS-level stuff (files, process, etc.). -HAVE_X_WINDOWS -- for X Windows (regardless of whether under MS Win) -HAVE_MS_WINDOWS -- MS Windows native windowing system (anything related to - the appearance of the graphical screen). +#ifndef WINDOWSNT +#define WINDOWSNT +#endif -Finally, there's also the MINGW build environment, which uses GCC -\(similar to Cygwin), but native MS Windows libraries rather than a -POSIX emulation layer (the Cygwin approach). This environment defines -WIN32_NATIVE, but also defines MINGW, which is used mostly because -uses its own include files (related to Cygwin), which have a few -things messed up. - - -Formerly, we had a whole host of flags. Here's the conversion, for porting -code from GNU Emacs and such: - - -WINDOWSNT -> WIN32_NATIVE -WIN32 -> WIN32_NATIVE -_WIN32 -> WIN32_NATIVE -HAVE_WIN32 -> WIN32_NATIVE -DOS_NT -> WIN32_NATIVE -HAVE_NTGUI -> WIN32_NATIVE, unless it ends up already bracketed by this -HAVE_FACES -> always true -MSDOS -> determine whether this code is really specific to MS-DOS (and not - Windows -- e.g. DJGPP code); if so, delete the code; otherwise, - convert to WIN32_NATIVE (we do not support MS-DOS w/DOS Extender - under XEmacs) - -__CYGWIN__ -> CYGWIN -__CYGWIN32__ -> CYGWIN -__MINGW32__ -> MINGW - -*/ - -/* Identify ourselves */ -#ifndef WIN32_NATIVE -#define WIN32_NATIVE +#ifndef DOS_NT +#define DOS_NT /* MSDOS or WINDOWSNT */ #endif /* In case non-Microsoft compiler is used, we fake _MSC_VER */ @@ -119,7 +58,7 @@ #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 0 +#define SIZEOF_LONG_LONG 8 #define SIZEOF_VOID_P 4 /* NOMULTIPLEJOBS should be defined if your system's shell @@ -166,9 +105,9 @@ The alternative is that a lock file named /usr/spool/mail/$USER.lock. */ +/* #define MAIL_USE_FLOCK */ #define MAIL_USE_POP -#define HAVE_LOCKING -#define MAIL_USE_LOCKING +#define MAIL_USE_SYSTEM_LOCK /* If the character used to separate elements of the executable path is not ':', #define this to be the appropriate character constant. */ @@ -186,7 +125,7 @@ /* XEmacs file I/O for DOS text files requires FILE_CODING */ #define FILE_CODING -#define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char)) +#define DIRECTORY_SEP '\\' /* Define this to be the separator between devices and paths */ #define DEVICE_SEP ':' @@ -228,6 +167,11 @@ #define HAVE_H_ERRNO #define HAVE_STRUCT_UTIMBUF +#ifdef HAVE_NTGUI +#define HAVE_WINDOW_SYSTEM +#define HAVE_FACES +#endif + #define HAVE_STRCASECMP /* Compatibility macros. Some used to be routines in nt.c */ @@ -238,15 +182,49 @@ #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B") +/* get some redefinitions in place */ + +#if 0 +/* IO calls that are emulated or shadowed */ +#define access sys_access +#define chdir sys_chdir +#define chmod sys_chmod +#define close sys_close +#define creat sys_creat +#define ctime sys_ctime +#define dup sys_dup +#define dup2 sys_dup2 +#define fopen sys_fopen +#define link sys_link +#define mktemp sys_mktemp +#define open sys_open +#define read sys_read +#define rename sys_rename +#define unlink sys_unlink +#define write sys_write +#define mkdir sys_mkdir +#define rmdir sys_rmdir + +#endif + +#if 0 +/* this is hacky, but is necessary to avoid warnings about macro + redefinitions using the SDK compilers */ +#ifndef __STDC__ +#define __STDC__ 1 +#define MUST_UNDEF__STDC__ +#endif +#include <direct.h> +#include <io.h> +#include <stdio.h> +#ifdef MUST_UNDEF__STDC__ +#undef __STDC__ +#undef MUST_UNDEF__STDC__ +#endif +#endif #include <stdio.h> -/* subprocess calls that are emulated */ -#ifndef DONT_ENCAPSULATE -#define spawnve sys_spawnve -int spawnve (int mode, const char *cmdname, - const char * const *argv, const char *const *envp); -#endif /* IO calls that are emulated or shadowed */ #define pipe sys_pipe @@ -257,6 +235,11 @@ void sleep (int seconds); #endif +/* subprocess calls that are emulated */ +#define spawnve sys_spawnve +int spawnve (int mode, CONST char *cmdname, + CONST char * CONST *argv, CONST char *CONST *envp); + #define wait sys_wait int wait (int *status); @@ -267,15 +250,41 @@ #define popen _popen #define pclose _pclose -typedef int uid_t; -typedef int gid_t; -typedef int pid_t; -typedef int ssize_t; +#if 0 +#define chdir _chdir +#define execlp _execlp +#define execvp _execvp +#define fcloseall _fcloseall +#define fdopen _fdopen +#define fgetchar _fgetchar +#define fileno _fileno +#define flushall _flushall +#define fputchar _fputchar +#define getw _getw +#define getpid _getpid +#define isatty _isatty +#define logb _logb +#define _longjmp longjmp +#define lseek _lseek +#define putw _putw +#define umask _umask +/* #define utime _utime */ +/* #define index strchr */ +/* #define rindex strrchr */ +#define read _read +#define write _write +#define getcwd _getcwd + +#ifdef HAVE_NTGUI +#define abort win32_abort +#endif + +#endif /* 0 */ /* Encapsulation of system calls */ #ifndef DONT_ENCAPSULATE #define getpid sys_getpid -pid_t getpid (void); +int getpid (void); #endif /* Random global functions called everywhere. Implemented in nt.c */ @@ -290,22 +299,23 @@ void *sbrk (unsigned long increment); struct passwd; -struct passwd *getpwuid (uid_t uid); +struct passwd *getpwuid (int uid); struct passwd *getpwnam (const char *name); -uid_t getuid (void); -uid_t geteuid (void); -gid_t getgid (void); -gid_t getegid (void); +int getuid (); +int geteuid (); +int getgid (void); +int getegid (); /* Setitimer is emulated */ #define HAVE_SETITIMER /* We now have emulation for some signals */ #define HAVE_SIGHOLD -#define sigset(s,h) mswindows_sigset(s,h) -#define sighold(s) mswindows_sighold(s) -#define sigrelse(s) mswindows_sigrelse(s) -#define sigpause(s) mswindows_sigpause(s) +#define sigset(s,h) msw_sigset(s,h) +#define sighold(s) msw_sighold(s) +#define sigrelse(s) msw_sigrelse(s) +#define sigpause(s) msw_sigpause(s) +#define signal sigset /* Defines that we need that aren't in the standard signal.h */ #define SIGHUP 1 /* Hang up */ @@ -314,6 +324,17 @@ #define SIGALRM 14 /* Alarm */ #define SIGPROF 29 /* Profiling timer exp */ +/* For integration with MSDOS support. */ +#define getdisk() (_getdrive () - 1) +#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN) + +#if 0 /* they do. -kkm */ +/* Define this so that winsock.h definitions don't get included when windows.h + is... I don't know if they do the right thing for emacs. For this to + have proper effect, config.h must always be included before windows.h. */ +#define _WINSOCKAPI_ 1 +#endif /* 0 */ + /* Defines size_t and alloca (). */ #include <malloc.h> @@ -349,23 +370,3 @@ #pragma data_seg("xdata") #pragma bss_seg("xdata") #endif - -#ifdef HAVE_SCROLLBARS -/* Ensure the NT 4 mouse definitions in winuser.h are available */ - #ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x0400 - #endif -#endif - -/* MSVC 6.0 has a mechanism to declare functions which never return */ -#if (_MSC_VER >= 1200) -#define DOESNT_RETURN __declspec(noreturn) void -#define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void decl -#define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ - __declspec(noreturn) extern void decl PRINTF_ARGS(str,idx) -#endif /* MSVC 6.0 */ - -#define CORRECT_DIR_SEPS(s) \ - do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ - else unixtodos_filename (s); \ - } while (0) diff -r 12e008d41344 -r 697ef44129c6 src/scrollbar-msw.c --- a/src/scrollbar-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/scrollbar-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -265,69 +265,6 @@ } } -static int -can_scroll(struct scrollbar_instance* scrollbar) -{ - return scrollbar != NULL - && IsWindowVisible (SCROLLBAR_MSW_HANDLE (scrollbar)) - && IsWindowEnabled (SCROLLBAR_MSW_HANDLE (scrollbar)); -} - -int -mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta) -{ - int hasVertBar, hasHorzBar; /* Indicates prescence of scroll bars */ - unsigned wheelScrollLines = 0; /* Number of lines per wheel notch */ - - /* Find the currently selected window */ - Lisp_Object win = FRAME_SELECTED_WINDOW (XFRAME (frame)); - struct window* w = XWINDOW (win); - struct window_mirror* mirror = find_window_mirror (w); - - /* Check that there is something to scroll */ - hasVertBar = can_scroll (mirror->scrollbar_vertical_instance); - hasHorzBar = can_scroll (mirror->scrollbar_horizontal_instance); - if (!hasVertBar && !hasHorzBar) - return FALSE; - - /* No support for panning and zooming, so ignore */ - if (keys & (MK_SHIFT | MK_CONTROL)) - return FALSE; - - /* Get the number of lines per wheel delta */ - SystemParametersInfo (SPI_GETWHEELSCROLLLINES, 0, &wheelScrollLines, 0); - - /* Calculate the amount to scroll */ - if (wheelScrollLines == WHEEL_PAGESCROLL) - { - /* Scroll by a page */ - Lisp_Object function; - if (hasVertBar) - function = delta > 0 ? Qscrollbar_page_up : Qscrollbar_page_down; - else - function = delta > 0 ? Qscrollbar_page_left : Qscrollbar_page_right; - mswindows_enqueue_misc_user_event (frame, function, Fcons (win, Qnil)); - } - else /* Scroll by a number of lines */ - { - /* Calc the number of lines to scroll */ - int toScroll = MulDiv (delta, wheelScrollLines, WHEEL_DELTA); - - /* Do the scroll */ - Lisp_Object function; - if (hasVertBar) - function = delta > 0 ? Qscrollbar_line_up : Qscrollbar_line_down; - else - function = delta > 0 ? Qscrollbar_char_left : Qscrollbar_char_right; - if (toScroll < 0) - toScroll = -toScroll; - while (toScroll--) - mswindows_enqueue_misc_user_event (frame, function, win); - } - - return TRUE; -} - #ifdef MEMORY_USAGE_STATS static int diff -r 12e008d41344 -r 697ef44129c6 src/scrollbar-msw.h --- a/src/scrollbar-msw.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/scrollbar-msw.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_scrollbar_msw_h_ -#define INCLUDED_scrollbar_msw_h_ +#ifndef _XEMACS_SCROLLBAR_MSW_H_ +#define _XEMACS_SCROLLBAR_MSW_H_ #if defined (HAVE_MS_WINDOWS) && defined (HAVE_SCROLLBARS) @@ -57,7 +57,6 @@ */ void mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos); -int mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta); #endif /* HAVE_MS_WINDOWS and HAVE_SCROLLBARS */ -#endif /* INCLUDED_scrollbar_msw_h_ */ +#endif /* _XEMACS_SCROLLBAR_MSW_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/scrollbar-x.c --- a/src/scrollbar-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/scrollbar-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,7 +27,6 @@ #include "lisp.h" #include "console-x.h" -#include "EmacsFrame.h" #include "glyphs-x.h" #include "gui-x.h" #include "scrollbar-x.h" @@ -215,7 +214,6 @@ wv->scrollbar_data = xnew (scrollbar_values); wv->name = SCROLLBAR_X_NAME (instance); - wv->name = xstrdup (wv->name); wv->value = 0; wv->key = 0; wv->enabled = instance->scrollbar_is_active; @@ -279,7 +277,9 @@ } if (!wv->scrollbar_data) abort (); - free_widget_value_tree (wv); + xfree (wv->scrollbar_data); + wv->scrollbar_data = 0; + free_widget_value (wv); } else if (managed) { @@ -406,9 +406,6 @@ return; mirror = find_scrollbar_window_mirror (f, id); - if (!mirror) - return; - win = real_window (mirror, 1); if (NILP (win)) @@ -612,9 +609,6 @@ return; mirror = find_scrollbar_window_mirror (f, id); - if (!mirror) - return; - win = real_window (mirror, 1); if (NILP (win)) @@ -678,6 +672,19 @@ 0, (Window) NULL); } +/* Called directly from x_any_window_to_frame in frame-x.c */ +EMACS_INT +x_window_is_scrollbar (struct frame *f, Window win) +{ + if (!FRAME_X_P (f)) + return 0; + + if (f->mirror_dirty) + update_frame_window_mirror (f); + return (EMACS_INT) x_scrollbar_loop (X_WINDOW_IS_SCROLLBAR, f->root_window, + f->root_mirror, 0, win); +} + /* Make sure that all scrollbars on frame are up-to-date. Called directly from x_set_frame_properties in frame-x.c*/ void @@ -738,16 +745,8 @@ } void -reinit_vars_of_scrollbar_x (void) -{ - stupid_vertical_scrollbar_drag_hack = 1; -} - -void vars_of_scrollbar_x (void) { - reinit_vars_of_scrollbar_x (); - #if defined (LWLIB_SCROLLBARS_LUCID) Fprovide (intern ("lucid-scrollbars")); #elif defined (LWLIB_SCROLLBARS_MOTIF) @@ -755,4 +754,5 @@ #elif defined (LWLIB_SCROLLBARS_ATHENA) Fprovide (intern ("athena-scrollbars")); #endif + stupid_vertical_scrollbar_drag_hack = 1; } diff -r 12e008d41344 -r 697ef44129c6 src/scrollbar-x.h --- a/src/scrollbar-x.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/scrollbar-x.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_scrollbar_x_h_ -#define INCLUDED_scrollbar_x_h_ +#ifndef _XEMACS_SCROLLBAR_X_H_ +#define _XEMACS_SCROLLBAR_X_H_ #if defined (HAVE_X_WINDOWS) && defined (HAVE_SCROLLBARS) @@ -69,7 +69,7 @@ void x_update_frame_scrollbars (struct frame *f); void x_set_scrollbar_pointer (struct frame *f, Lisp_Object cursor); +EMACS_INT x_window_is_scrollbar (struct frame *f, Window win); #endif /* HAVE_X_WINDOWS and HAVE_SCROLLBARS */ - -#endif /* INCLUDED_scrollbar_x_h_ */ +#endif /* _XEMACS_SCROLLBAR_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/scrollbar.c --- a/src/scrollbar.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/scrollbar.c Mon Aug 13 11:20:41 2007 +0200 @@ -34,7 +34,6 @@ #include "device.h" #include "frame.h" #include "glyphs.h" -#include "gutter.h" #include "window.h" Lisp_Object Qinit_scrollbar_from_resources; @@ -453,35 +452,23 @@ { int x_offset, y_offset; - /* Scrollbars are always the farthest from the text area, barring - gutters. */ + /* Scrollbars are always the farthest from the text area. */ if (vertical) { - if (!NILP (w->scrollbar_on_left_p)) - { - x_offset = WINDOW_LEFT (w); - } - else - { - x_offset = WINDOW_RIGHT (w) - scrollbar_width; - if (window_needs_vertical_divider (w)) - x_offset -= window_divider_width (w); - } + x_offset = (!NILP (w->scrollbar_on_left_p) + ? WINDOW_LEFT (w) + : (WINDOW_RIGHT (w) - scrollbar_width + - (window_needs_vertical_divider (w) + ? window_divider_width (w) : 0))); y_offset = WINDOW_TEXT_TOP (w) + f->scrollbar_y_offset; } else { x_offset = WINDOW_TEXT_LEFT (w); - y_offset = f->scrollbar_y_offset; - - if (!NILP (w->scrollbar_on_top_p)) - { - y_offset += WINDOW_TOP (w); - } - else - { - y_offset += WINDOW_TEXT_BOTTOM (w); - } + y_offset = f->scrollbar_y_offset + + (!NILP (w->scrollbar_on_top_p) + ? WINDOW_TOP (w) + : WINDOW_TEXT_BOTTOM (w) + window_bottom_toolbar_height (w)); } new_x = x_offset; @@ -735,26 +722,26 @@ with their standard behaviors. It is not possible to hide the differences down in lwlib because knowledge of XEmacs buffer and cursor motion routines is necessary. */ - - if (NILP (XCDR (object))) - window_scroll (window, Qnil, -1, ERROR_ME_NOT); - else - { - Bufpos bufpos; - Lisp_Object value = Fcdr (object); +#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ + defined (LWLIB_SCROLLBARS_ATHENA3D) || defined(HAVE_MS_WINDOWS) + window_scroll (window, Qnil, -1, ERROR_ME_NOT); +#else /* Athena */ + { + Bufpos bufpos; + Lisp_Object value = Fcdr (object); - CHECK_INT (value); - Fmove_to_window_line (Qzero, window); - /* can't use Fvertical_motion() because it moves the buffer point - rather than the window's point. + CHECK_INT (value); + Fmove_to_window_line (Qzero, window); + /* can't use Fvertical_motion() because it moves the buffer point + rather than the window's point. - #### It does? Why does it take a window argument then? */ - bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)), - XINT (value), 0); - Fset_window_point (window, make_int (bufpos)); - Fcenter_to_window_line (Qzero, window); - } - + #### It does? Why does it take a window argument then? */ + bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)), + XINT (value), 0); + Fset_window_point (window, make_int (bufpos)); + Fcenter_to_window_line (Qzero, window); + } +#endif /* Athena */ zmacs_region_stays = 1; return Qnil; } @@ -776,17 +763,17 @@ with their standard behaviors. It is not possible to hide the differences down in lwlib because knowledge of XEmacs buffer and cursor motion routines is necessary. */ - - if (NILP (XCDR (object))) - window_scroll (window, Qnil, 1, ERROR_ME_NOT); - else - { - Lisp_Object value = Fcdr (object); - CHECK_INT (value); - Fmove_to_window_line (value, window); - Fcenter_to_window_line (Qzero, window); - } - +#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ + defined (LWLIB_SCROLLBARS_ATHENA3D) || defined (HAVE_MS_WINDOWS) + window_scroll (window, Qnil, 1, ERROR_ME_NOT); +#else /* Athena */ + { + Lisp_Object value = Fcdr (object); + CHECK_INT (value); + Fmove_to_window_line (value, window); + Fcenter_to_window_line (Qzero, window); + } +#endif /* Athena */ zmacs_region_stays = 1; return Qnil; } @@ -863,7 +850,7 @@ w = XWINDOW (window); wcw = window_char_width (w, 0) - 1; - /* #### We should be able to scroll further right as long as there is + /* ### We should be able to scroll further right as long as there is a visible truncation glyph. This calculation for max is bogus. */ max_len = w->max_line_len + 2; @@ -950,9 +937,11 @@ (Vscrollbar_width, list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_WIDTH)))); set_specifier_caching (Vscrollbar_width, - offsetof (struct window, scrollbar_width), + slot_offset (struct window, + scrollbar_width), vertical_scrollbar_changed_in_window, - offsetof (struct frame, scrollbar_width), + slot_offset (struct frame, + scrollbar_width), frame_size_slipped); DEFVAR_SPECIFIER ("scrollbar-height", &Vscrollbar_height /* @@ -964,9 +953,11 @@ (Vscrollbar_height, list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_HEIGHT)))); set_specifier_caching (Vscrollbar_height, - offsetof (struct window, scrollbar_height), + slot_offset (struct window, + scrollbar_height), some_window_value_changed, - offsetof (struct frame, scrollbar_height), + slot_offset (struct frame, + scrollbar_height), frame_size_slipped); DEFVAR_SPECIFIER ("horizontal-scrollbar-visible-p", &Vhorizontal_scrollbar_visible_p /* @@ -977,11 +968,11 @@ set_specifier_fallback (Vhorizontal_scrollbar_visible_p, list1 (Fcons (Qnil, Qt))); set_specifier_caching (Vhorizontal_scrollbar_visible_p, - offsetof (struct window, - horizontal_scrollbar_visible_p), + slot_offset (struct window, + horizontal_scrollbar_visible_p), some_window_value_changed, - offsetof (struct frame, - horizontal_scrollbar_visible_p), + slot_offset (struct frame, + horizontal_scrollbar_visible_p), frame_size_slipped); DEFVAR_SPECIFIER ("vertical-scrollbar-visible-p", &Vvertical_scrollbar_visible_p /* @@ -992,11 +983,11 @@ set_specifier_fallback (Vvertical_scrollbar_visible_p, list1 (Fcons (Qnil, Qt))); set_specifier_caching (Vvertical_scrollbar_visible_p, - offsetof (struct window, - vertical_scrollbar_visible_p), + slot_offset (struct window, + vertical_scrollbar_visible_p), vertical_scrollbar_changed_in_window, - offsetof (struct frame, - vertical_scrollbar_visible_p), + slot_offset (struct frame, + vertical_scrollbar_visible_p), frame_size_slipped); DEFVAR_SPECIFIER ("scrollbar-on-left-p", &Vscrollbar_on_left_p /* @@ -1020,9 +1011,11 @@ } set_specifier_caching (Vscrollbar_on_left_p, - offsetof (struct window, scrollbar_on_left_p), + slot_offset (struct window, + scrollbar_on_left_p), vertical_scrollbar_changed_in_window, - offsetof (struct frame, scrollbar_on_left_p), + slot_offset (struct frame, + scrollbar_on_left_p), frame_size_slipped); DEFVAR_SPECIFIER ("scrollbar-on-top-p", &Vscrollbar_on_top_p /* @@ -1033,9 +1026,11 @@ set_specifier_fallback (Vscrollbar_on_top_p, list1 (Fcons (Qnil, Qnil))); set_specifier_caching (Vscrollbar_on_top_p, - offsetof (struct window, scrollbar_on_top_p), + slot_offset (struct window, + scrollbar_on_top_p), some_window_value_changed, - offsetof (struct frame, scrollbar_on_top_p), + slot_offset (struct frame, + scrollbar_on_top_p), frame_size_slipped); } @@ -1045,7 +1040,8 @@ Vscrollbar_pointer_glyph = Fmake_glyph_internal (Qpointer); set_specifier_caching (XGLYPH (Vscrollbar_pointer_glyph)->image, - offsetof (struct window, scrollbar_pointer), + slot_offset (struct window, + scrollbar_pointer), scrollbar_pointer_changed_in_window, 0, 0); } diff -r 12e008d41344 -r 697ef44129c6 src/scrollbar.h --- a/src/scrollbar.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/scrollbar.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_scrollbar_h_ -#define INCLUDED_scrollbar_h_ +#ifndef _XEMACS_SCROLLBAR_H_ +#define _XEMACS_SCROLLBAR_H_ #ifdef HAVE_SCROLLBARS @@ -81,4 +81,4 @@ #endif /* HAVE_SCROLLBARS */ -#endif /* INCLUDED_scrollbar_h_ */ +#endif /* _XEMACS_SCROLLBAR_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/search.c --- a/src/search.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/search.c Mon Aug 13 11:20:41 2007 +0200 @@ -54,10 +54,10 @@ }; /* The instances of that struct. */ -static struct regexp_cache searchbufs[REGEXP_CACHE_SIZE]; +struct regexp_cache searchbufs[REGEXP_CACHE_SIZE]; /* The head of the linked list; points to the most recently used buffer. */ -static struct regexp_cache *searchbuf_head; +struct regexp_cache *searchbuf_head; /* Every call to re_match, etc., must pass &search_regs as the regs @@ -131,7 +131,7 @@ char *translate, struct re_registers *regp, int posix, Error_behavior errb) { - const char *val; + CONST char *val; reg_syntax_t old; cp->regexp = Qnil; @@ -139,7 +139,7 @@ cp->posix = posix; old = re_set_syntax (RE_SYNTAX_EMACS | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); - val = (const char *) + val = (CONST char *) re_compile_pattern ((char *) XSTRING_DATA (pattern), XSTRING_LENGTH (pattern), &cp->buf); re_set_syntax (old); @@ -442,7 +442,7 @@ This does not clobber the match data. */ Bytecount -fast_string_match (Lisp_Object regexp, const Bufbyte *nonreloc, +fast_string_match (Lisp_Object regexp, CONST Bufbyte *nonreloc, Lisp_Object reloc, Bytecount offset, Bytecount length, int case_fold_search, Error_behavior errb, int no_quit) @@ -700,50 +700,6 @@ return scan_buffer (buf, '\n', from, 0, count, 0, 1); } -Bytind -bi_find_next_emchar_in_string (Lisp_String* str, Emchar target, Bytind st, - EMACS_INT count) -{ - /* This function has been Mule-ized. */ - Bytind lim = string_length (str) -1; - Bufbyte* s = string_data (str); - - assert (count >= 0); - -#ifdef MULE - /* Due to the Mule representation of characters in a buffer, - we can simply search for characters in the range 0 - 127 - directly. For other characters, we do it the "hard" way. - Note that this way works for all characters but the other - way is faster. */ - if (target >= 0200) - { - while (st < lim && count > 0) - { - if (string_char (str, st) == target) - count--; - INC_CHARBYTIND (s, st); - } - } - else -#endif - { - while (st < lim && count > 0) - { - Bufbyte *bufptr = (Bufbyte *) memchr (charptr_n_addr (s, st), - (int) target, lim - st); - if (bufptr) - { - count--; - st = (Bytind)(bufptr - s) + 1; - } - else - st = lim; - } - } - return st; -} - /* Like find_next_newline, but returns position before the newline, not after, and only search up to TO. This isn't just find_next_newline (...)-1, because you might hit TO. */ @@ -771,7 +727,8 @@ unsigned char fastmap[0400]; int negate = 0; REGISTER int i; - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *syntax_table = + XCHAR_TABLE (buf->mirror_syntax_table); Bufpos limit; if (NILP (lim)) @@ -1583,7 +1540,8 @@ Charcount i, len; EMACS_INT punct_count = 0, word_count = 0; struct buffer *buf = decode_buffer (buffer, 0); - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *syntax_table = + XCHAR_TABLE (buf->mirror_syntax_table); CHECK_STRING (string); len = XSTRING_CHAR_LENGTH (string); @@ -1843,7 +1801,7 @@ Emchar c, prevc; Charcount inslen; struct buffer *buf; - Lisp_Char_Table *syntax_table; + struct Lisp_Char_Table *syntax_table; int mc_count; Lisp_Object buffer; int_dynarr *ul_action_dynarr = 0; @@ -2572,12 +2530,9 @@ } void -reinit_vars_of_search (void) +vars_of_search (void) { - int i; - - last_thing_searched = Qnil; - staticpro_nodump (&last_thing_searched); + REGISTER int i; for (i = 0; i < REGEXP_CACHE_SIZE; ++i) { @@ -2585,16 +2540,13 @@ searchbufs[i].buf.buffer = (unsigned char *) xmalloc (100); searchbufs[i].buf.fastmap = searchbufs[i].fastmap; searchbufs[i].regexp = Qnil; - staticpro_nodump (&searchbufs[i].regexp); + staticpro (&searchbufs[i].regexp); searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]); } searchbuf_head = &searchbufs[0]; -} -void -vars_of_search (void) -{ - reinit_vars_of_search (); + last_thing_searched = Qnil; + staticpro (&last_thing_searched); DEFVAR_LISP ("forward-word-regexp", &Vforward_word_regexp /* *Regular expression to be used in `forward-word'. diff -r 12e008d41344 -r 697ef44129c6 src/select-msw.c --- a/src/select-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/select-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -24,541 +24,140 @@ Written by Kevin Gallo for FSF Emacs. Rewritten for mswindows by Jonathan Harris, December 1997 for 21.0. - Hacked by Alastair Houghton, July 2000 for enhanced clipboard support. -*/ + */ + #include <config.h> #include "lisp.h" -#include "frame.h" -#include "select.h" -#include "opaque.h" -#include "file-coding.h" -#include "buffer.h" #include "console-msw.h" -/* A list of handles that we must release. Not accessible from Lisp. */ -static Lisp_Object Vhandle_alist; - -/* Test if this is an X symbol that we understand */ -static int -x_sym_p (Lisp_Object value) -{ - if (NILP (value) || INTP (value)) - return 0; - - /* Check for some of the X symbols */ - if (EQ (value, QSTRING)) return 1; - if (EQ (value, QTEXT)) return 1; - if (EQ (value, QCOMPOUND_TEXT)) return 1; - - return 0; -} - -/* This converts a Lisp symbol to an MS-Windows clipboard format. - We have symbols for all predefined clipboard formats, but that - doesn't mean we support them all ;-) - The name of this function is actually a lie - it also knows about - integers and strings... */ -static UINT -symbol_to_ms_cf (Lisp_Object value) +DEFUN ("mswindows-set-clipboard", Fmswindows_set_clipboard, 1, 1, 0, /* +Copy STRING to the mswindows clipboard. +*/ + (string)) { - /* If it's NIL, we're in trouble. */ - if (NILP (value)) return 0; - - /* If it's an integer, assume it's a format ID */ - if (INTP (value)) return (UINT) (XINT (value)); + int rawsize, size, i; + unsigned char *src, *dst, *next; + HGLOBAL h = NULL; + + CHECK_STRING (string); - /* If it's a string, register the format(!) */ - if (STRINGP (value)) - return RegisterClipboardFormat (XSTRING_DATA (value)); - - /* Check for Windows clipboard format symbols */ - if (EQ (value, QCF_TEXT)) return CF_TEXT; - if (EQ (value, QCF_BITMAP)) return CF_BITMAP; - if (EQ (value, QCF_METAFILEPICT)) return CF_METAFILEPICT; - if (EQ (value, QCF_SYLK)) return CF_SYLK; - if (EQ (value, QCF_DIF)) return CF_DIF; - if (EQ (value, QCF_TIFF)) return CF_TIFF; - if (EQ (value, QCF_OEMTEXT)) return CF_OEMTEXT; - if (EQ (value, QCF_DIB)) return CF_DIB; - if (EQ (value, QCF_PALETTE)) return CF_PALETTE; - if (EQ (value, QCF_PENDATA)) return CF_PENDATA; - if (EQ (value, QCF_RIFF)) return CF_RIFF; - if (EQ (value, QCF_WAVE)) return CF_WAVE; - if (EQ (value, QCF_UNICODETEXT)) return CF_UNICODETEXT; - if (EQ (value, QCF_ENHMETAFILE)) return CF_ENHMETAFILE; - if (EQ (value, QCF_HDROP)) return CF_HDROP; - if (EQ (value, QCF_LOCALE)) return CF_LOCALE; - if (EQ (value, QCF_OWNERDISPLAY)) return CF_OWNERDISPLAY; - if (EQ (value, QCF_DSPTEXT)) return CF_DSPTEXT; - if (EQ (value, QCF_DSPBITMAP)) return CF_DSPBITMAP; - if (EQ (value, QCF_DSPMETAFILEPICT)) return CF_DSPMETAFILEPICT; - if (EQ (value, QCF_DSPENHMETAFILE)) return CF_DSPENHMETAFILE; + /* Calculate size with LFs converted to CRLFs because + * CF_TEXT format uses CRLF delimited ASCIIZ */ + src = XSTRING_DATA (string); + size = rawsize = XSTRING_LENGTH (string) + 1; + for (i=0; i<rawsize; i++) + if (src[i] == '\n') + size++; + + if (!OpenClipboard (NULL)) + return Qnil; - return 0; -} - -/* This converts an MS-Windows clipboard format to its corresponding - Lisp symbol, or a Lisp integer otherwise. */ -static Lisp_Object -ms_cf_to_symbol (UINT format) -{ - switch (format) + if (!EmptyClipboard () || + (h = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, size)) == NULL || + (dst = (unsigned char *) GlobalLock (h)) == NULL) + { + if (h != NULL) GlobalFree (h); + CloseClipboard (); + return Qnil; + } + + /* Convert LFs to CRLFs */ + do { - case CF_TEXT: return QCF_TEXT; - case CF_BITMAP: return QCF_BITMAP; - case CF_METAFILEPICT: return QCF_METAFILEPICT; - case CF_SYLK: return QCF_SYLK; - case CF_DIF: return QCF_DIF; - case CF_TIFF: return QCF_TIFF; - case CF_OEMTEXT: return QCF_OEMTEXT; - case CF_DIB: return QCF_DIB; - case CF_PALETTE: return QCF_PALETTE; - case CF_PENDATA: return QCF_PENDATA; - case CF_RIFF: return QCF_RIFF; - case CF_WAVE: return QCF_WAVE; - case CF_UNICODETEXT: return QCF_UNICODETEXT; - case CF_ENHMETAFILE: return QCF_ENHMETAFILE; - case CF_HDROP: return QCF_HDROP; - case CF_LOCALE: return QCF_LOCALE; - case CF_OWNERDISPLAY: return QCF_OWNERDISPLAY; - case CF_DSPTEXT: return QCF_DSPTEXT; - case CF_DSPBITMAP: return QCF_DSPBITMAP; - case CF_DSPMETAFILEPICT: return QCF_DSPMETAFILEPICT; - case CF_DSPENHMETAFILE: return QCF_DSPENHMETAFILE; - default: return make_int ((int) format); + /* copy next line or remaining bytes including '\0' */ + next = memccpy (dst, src, '\n', rawsize); + if (next) + { + /* copied one line ending with '\n' */ + int copied = next - dst; + rawsize -= copied; + src += copied; + /* insert '\r' before '\n' */ + next[-1] = '\r'; + next[0] = '\n'; + dst = next+1; + } } -} - -/* Test if the specified clipboard format is auto-released by the OS. If - not, we must remember the handle on Vhandle_alist, and free it if - the clipboard is emptied or if we set data with the same format. */ -static int -cf_is_autofreed (UINT format) -{ - switch (format) - { - /* This list comes from the SDK documentation */ - case CF_DSPENHMETAFILE: - case CF_DSPMETAFILEPICT: - case CF_ENHMETAFILE: - case CF_BITMAP: - case CF_DSPBITMAP: - case CF_PALETTE: - case CF_DIB: - case CF_DSPTEXT: - case CF_OEMTEXT: - case CF_TEXT: - case CF_UNICODETEXT: - return TRUE; - - default: - return FALSE; - } + while (next); + + GlobalUnlock (h); + + i = (SetClipboardData (CF_TEXT, h) != NULL); + + CloseClipboard (); + GlobalFree (h); + + return i ? Qt : Qnil; } -/* Do protocol to assert ourself as a selection owner. - - Under mswindows, we: - - * Only set the clipboard if (eq selection-name 'CLIPBOARD) - - * Check if an X atom name has been passed. If so, convert to CF_TEXT - (or CF_UNICODETEXT) remembering to perform LF -> CR-LF conversion. - - * Otherwise assume the data is formatted appropriately for the data type - that was passed. - - Then set the clipboard as necessary. +DEFUN ("mswindows-get-clipboard", Fmswindows_get_clipboard, 0, 0, 0, /* +Return the contents of the mswindows clipboard. */ -static Lisp_Object -mswindows_own_selection (Lisp_Object selection_name, - Lisp_Object selection_value, - Lisp_Object how_to_add, - Lisp_Object selection_type) + ()) { - HGLOBAL hValue = NULL; - UINT cfType; - int is_X_type = FALSE; - Lisp_Object cfObject; - Lisp_Object data = Qnil; - int size; - void *src, *dst; - struct frame *f = NULL; + HANDLE h; + unsigned char *src, *dst, *next; + Lisp_Object ret = Qnil; - /* Only continue if we're trying to set the clipboard - mswindows doesn't - use the same selection model as X */ - if (!EQ (selection_name, QCLIPBOARD)) - return Qnil; - - /* If this is one of the X-style atom name symbols, or NIL, convert it - as appropriate */ - if (NILP (selection_type) || x_sym_p (selection_type)) - { - /* Should COMPOUND_TEXT map to CF_UNICODETEXT? */ - cfType = CF_TEXT; - cfObject = QCF_TEXT; - is_X_type = TRUE; - } - else - { - cfType = symbol_to_ms_cf (selection_type); - - /* Only continue if we can figure out a clipboard type */ - if (!cfType) - return Qnil; - - cfObject = selection_type; - } - - /* Convert things appropriately */ - data = select_convert_out (selection_name, - cfObject, - selection_value); - - if (NILP (data)) + if (!OpenClipboard (NULL)) return Qnil; - if (CONSP (data)) - { - if (!EQ (XCAR (data), cfObject)) - cfType = symbol_to_ms_cf (XCAR (data)); - - if (!cfType) - return Qnil; - - data = XCDR (data); - } - - /* We support opaque or string values, but we only mention string - values for now... */ - if (!OPAQUEP (data) - && !STRINGP (data)) - return Qnil; - - /* Compute the data length */ - if (OPAQUEP (data)) - size = XOPAQUE_SIZE (data); - else - size = XSTRING_LENGTH (data) + 1; - - /* Find the frame */ - f = selected_frame (); - - /* Open the clipboard */ - if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f))) - return Qnil; - - /* Allocate memory */ - hValue = GlobalAlloc (GMEM_DDESHARE | GMEM_MOVEABLE, size); - - if (!hValue) + if ((h = GetClipboardData (CF_TEXT)) != NULL && + (src = (unsigned char *) GlobalLock (h)) != NULL) { - CloseClipboard (); + int i; + int size, rawsize; + size = rawsize = strlen (src); + + for (i=0; i<rawsize; i++) + if (src[i] == '\r' && src[i+1] == '\n') + size--; - return Qnil; - } - - /* Copy the data */ - if (OPAQUEP (data)) - src = XOPAQUE_DATA (data); - else - src = XSTRING_DATA (data); - - dst = GlobalLock (hValue); - - if (!dst) - { - GlobalFree (hValue); - CloseClipboard (); - - return Qnil; - } - - memcpy (dst, src, size); + /* Convert CRLFs to LFs */ + ret = make_uninit_string (size); + dst = XSTRING_DATA (ret); + do + { + /* copy next line or remaining bytes excluding '\0' */ + next = memccpy (dst, src, '\r', rawsize); + if (next) + { + /* copied one line ending with '\r' */ + int copied = next - dst; + rawsize -= copied; + src += copied; + if (*src == '\n') + dst += copied - 1; /* overwrite '\r' */ + else + dst += copied; + } + } + while (next); - GlobalUnlock (hValue); - - /* Empty the clipboard if we're replacing everything */ - if (NILP (how_to_add) || EQ (how_to_add, Qreplace_all)) - { - if (!EmptyClipboard ()) - { - CloseClipboard (); - GlobalFree (hValue); - - return Qnil; - } + GlobalUnlock (h); } - /* Append is currently handled in select.el; perhaps this should change, - but it only really makes sense for ordinary text in any case... */ - - SetClipboardData (cfType, hValue); - - if (!cf_is_autofreed (cfType)) - { - Lisp_Object alist_elt = Qnil, rest; - Lisp_Object cfType_int = make_int (cfType); - - /* First check if there's an element in the alist for this type - already. */ - alist_elt = assq_no_quit (cfType_int, Vhandle_alist); - - /* Add an element to the alist */ - Vhandle_alist = Fcons (Fcons (cfType_int, make_opaque_ptr (hValue)), - Vhandle_alist); - - if (!NILP (alist_elt)) - { - /* Free the original handle */ - GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (alist_elt))); - - /* Remove the original one (adding first makes life easier, because - we don't have to special case this being the first element) */ - for (rest = Vhandle_alist; !NILP (rest); rest = Fcdr (rest)) - if (EQ (cfType_int, Fcar (XCDR (rest)))) - { - XCDR (rest) = Fcdr (XCDR (rest)); - break; - } - } - } - CloseClipboard (); - /* #### Should really return a time, though this is because of the - X model (by the looks of things) */ - return Qnil; -} - -static Lisp_Object -mswindows_available_selection_types (Lisp_Object selection_name) -{ - Lisp_Object types = Qnil; - UINT format = 0; - struct frame *f = NULL; - - if (!EQ (selection_name, QCLIPBOARD)) - return Qnil; - - /* Find the frame */ - f = selected_frame (); - - /* Open the clipboard */ - if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f))) - return Qnil; - - /* #### ajh - Should there be an unwind-protect handler around this? - It could (well it probably won't, but it's always better to - be safe) run out of memory and leave the clipboard open... */ - - while ((format = EnumClipboardFormats (format))) - types = Fcons (ms_cf_to_symbol (format), types); - - /* Close it */ - CloseClipboard (); - - return types; -} - -static Lisp_Object -mswindows_register_selection_data_type (Lisp_Object type_name) -{ - /* Type already checked in select.c */ - const char *name = XSTRING_DATA (type_name); - UINT format; - - format = RegisterClipboardFormat (name); - - if (format) - return make_int ((int) format); - else - return Qnil; -} - -static Lisp_Object -mswindows_selection_data_type_name (Lisp_Object type_id) -{ - UINT format; - int numchars; - char name_buf[128]; - - /* If it's an integer, convert to a symbol if appropriate */ - if (INTP (type_id)) - type_id = ms_cf_to_symbol (XINT (type_id)); - - /* If this is a symbol, return it */ - if (SYMBOLP (type_id)) - return type_id; - - /* Find the format code */ - format = symbol_to_ms_cf (type_id); - - if (!format) - return Qnil; - - /* Microsoft, stupid Microsoft */ - numchars = GetClipboardFormatName (format, name_buf, 128); - - if (numchars) - { - Lisp_Object name; - - /* Do this properly - though we could support UNICODE (UCS-2) if - MULE could hack it. */ - name = make_ext_string (name_buf, numchars, - Fget_coding_system (Qraw_text)); - - return name; - } - - return Qnil; + return ret; } -static Lisp_Object -mswindows_get_foreign_selection (Lisp_Object selection_symbol, - Lisp_Object target_type) +DEFUN ("mswindows-selection-exists-p", Fmswindows_selection_exists_p, 0, 0, 0, /* +Whether there is an MS-Windows selection. +*/ + ()) { - HGLOBAL hValue = NULL; - UINT cfType; - Lisp_Object cfObject = Qnil, ret = Qnil, value = Qnil; - int is_X_type = FALSE; - int size; - void *data; - struct frame *f = NULL; - struct gcpro gcpro1; - - /* Only continue if we're trying to read the clipboard - mswindows doesn't - use the same selection model as X */ - if (!EQ (selection_symbol, QCLIPBOARD)) - return Qnil; - - /* If this is one fo the X-style atom name symbols, or NIL, convert it - as appropriate */ - if (NILP (target_type) || x_sym_p (target_type)) - { - /* Should COMPOUND_TEXT map to CF_UNICODETEXT? */ - cfType = CF_TEXT; - cfObject = QCF_TEXT; - is_X_type = TRUE; - } - else - { - cfType = symbol_to_ms_cf (target_type); - - /* Only continue if we can figure out a clipboard type */ - if (!cfType) - return Qnil; - - cfObject = ms_cf_to_symbol (cfType); - } - - /* Find the frame */ - f = selected_frame (); - - /* Open the clipboard */ - if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f))) - return Qnil; - - /* Read the clipboard */ - hValue = GetClipboardData (cfType); - - if (!hValue) - { - CloseClipboard (); - - return Qnil; - } - - /* Find the data */ - size = GlobalSize (hValue); - data = GlobalLock (hValue); - - if (!data) - { - CloseClipboard (); - - return Qnil; - } - - /* Place it in a Lisp string */ - TO_INTERNAL_FORMAT (DATA, (data, size), - LISP_STRING, ret, - Qbinary); - - GlobalUnlock (data); - CloseClipboard (); - - GCPRO1 (ret); - - /* Convert this to the appropriate type. If we can't find anything, - then we return a cons of the form (DATA-TYPE . STRING), where the - string contains the raw binary data. */ - value = select_convert_in (selection_symbol, - cfObject, - ret); - - UNGCPRO; - - if (NILP (value)) - return Fcons (cfObject, ret); - else - return value; + return IsClipboardFormatAvailable (CF_TEXT) ? Qt : Qnil; } -static void -mswindows_disown_selection (Lisp_Object selection, Lisp_Object timeval) -{ - if (EQ (selection, QCLIPBOARD)) - { - BOOL success = OpenClipboard (NULL); - if (success) - { - success = EmptyClipboard (); - /* Close it regardless of whether empty worked. */ - if (!CloseClipboard ()) - success = FALSE; - } - - /* #### return success ? Qt : Qnil; */ - } -} - -void -mswindows_destroy_selection (Lisp_Object selection) +DEFUN ("mswindows-delete-selection", Fmswindows_delete_selection, 0, 0, 0, /* +Remove the current MS-Windows selection from the clipboard. +*/ + ()) { - Lisp_Object alist_elt; - - /* Do nothing if this isn't for the clipboard. */ - if (!EQ (selection, QCLIPBOARD)) - return; - - /* Right. We need to delete everything in Vhandle_alist. */ - alist_elt = Vhandle_alist; - - for (alist_elt; !NILP (alist_elt); alist_elt = Fcdr (alist_elt)) - GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (alist_elt))); - - Vhandle_alist = Qnil; -} - -static Lisp_Object -mswindows_selection_exists_p (Lisp_Object selection, - Lisp_Object selection_type) -{ - /* We used to be picky about the format, but now we support anything. */ - if (EQ (selection, QCLIPBOARD)) - { - if (NILP (selection_type)) - return CountClipboardFormats () ? Qt : Qnil; - else - return IsClipboardFormatAvailable (symbol_to_ms_cf (selection_type)) - ? Qt : Qnil; - } - else - return Qnil; + return EmptyClipboard () ? Qt : Qnil; } @@ -567,26 +166,15 @@ /************************************************************************/ void -console_type_create_select_mswindows (void) -{ - CONSOLE_HAS_METHOD (mswindows, own_selection); - CONSOLE_HAS_METHOD (mswindows, disown_selection); - CONSOLE_HAS_METHOD (mswindows, selection_exists_p); - CONSOLE_HAS_METHOD (mswindows, get_foreign_selection); - CONSOLE_HAS_METHOD (mswindows, available_selection_types); - CONSOLE_HAS_METHOD (mswindows, register_selection_data_type); - CONSOLE_HAS_METHOD (mswindows, selection_data_type_name); -} - -void syms_of_select_mswindows (void) { + DEFSUBR (Fmswindows_set_clipboard); + DEFSUBR (Fmswindows_get_clipboard); + DEFSUBR (Fmswindows_selection_exists_p); + DEFSUBR (Fmswindows_delete_selection); } void vars_of_select_mswindows (void) { - /* Initialise Vhandle_alist */ - Vhandle_alist = Qnil; - staticpro (&Vhandle_alist); } diff -r 12e008d41344 -r 697ef44129c6 src/select-x.c --- a/src/select-x.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1798 +0,0 @@ -/* X Selection processing for XEmacs - Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not synched with FSF. */ - -/* Rewritten by jwz */ - -#include <config.h> -#include "lisp.h" - -#include "buffer.h" -#include "console-x.h" -#include "objects-x.h" - -#include "frame.h" -#include "opaque.h" -#include "systime.h" -#include "select.h" - -int lisp_to_time (Lisp_Object, time_t *); -Lisp_Object time_to_lisp (time_t); - -#ifdef LWLIB_USES_MOTIF -# define MOTIF_CLIPBOARDS -#endif - -#ifdef MOTIF_CLIPBOARDS -# include <Xm/CutPaste.h> -static void hack_motif_clipboard_selection (Atom selection_atom, - Lisp_Object selection_value, - Time thyme, Display *display, - Window selecting_window); -#endif - -#define CUT_BUFFER_SUPPORT - -#ifdef CUT_BUFFER_SUPPORT -Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, - QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; -#endif - -Lisp_Object Vx_sent_selection_hooks; - -/* If this is a smaller number than the max-request-size of the display, - emacs will use INCR selection transfer when the selection is larger - than this. The max-request-size is usually around 64k, so if you want - emacs to use incremental selection transfers when the selection is - smaller than that, set this. I added this mostly for debugging the - incremental transfer stuff, but it might improve server performance. - */ -#define MAX_SELECTION_QUANTUM 0xFFFFFF - -#define SELECTION_QUANTUM(dpy) ((XMaxRequestSize (dpy) << 2) - 100) - -/* If the selection owner takes too long to reply to a selection request, - we give up on it. This is in seconds (0 = no timeout). - */ -int x_selection_timeout; - - -/* Utility functions */ - -static void lisp_data_to_selection_data (struct device *, - Lisp_Object obj, - unsigned char **data_ret, - Atom *type_ret, - unsigned int *size_ret, - int *format_ret); -static Lisp_Object selection_data_to_lisp_data (struct device *, - unsigned char *data, - size_t size, - Atom type, - int format); -static Lisp_Object x_get_window_property_as_lisp_data (Display *, - Window, - Atom property, - Lisp_Object target_type, - Atom selection_atom); - -static int expect_property_change (Display *, Window, Atom prop, int state); -static void wait_for_property_change (long); -static void unexpect_property_change (int); -static int waiting_for_other_props_on_window (Display *, Window); - -/* This converts a Lisp symbol to a server Atom, avoiding a server - roundtrip whenever possible. - */ -static Atom -symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists) -{ - Display *display = DEVICE_X_DISPLAY (d); - - if (NILP (sym)) return XA_PRIMARY; - if (EQ (sym, Qt)) return XA_SECONDARY; - if (EQ (sym, QPRIMARY)) return XA_PRIMARY; - if (EQ (sym, QSECONDARY)) return XA_SECONDARY; - if (EQ (sym, QSTRING)) return XA_STRING; - if (EQ (sym, QINTEGER)) return XA_INTEGER; - if (EQ (sym, QATOM)) return XA_ATOM; - if (EQ (sym, QCLIPBOARD)) return DEVICE_XATOM_CLIPBOARD (d); - if (EQ (sym, QTIMESTAMP)) return DEVICE_XATOM_TIMESTAMP (d); - if (EQ (sym, QTEXT)) return DEVICE_XATOM_TEXT (d); - if (EQ (sym, QDELETE)) return DEVICE_XATOM_DELETE (d); - if (EQ (sym, QMULTIPLE)) return DEVICE_XATOM_MULTIPLE (d); - if (EQ (sym, QINCR)) return DEVICE_XATOM_INCR (d); - if (EQ (sym, QEMACS_TMP)) return DEVICE_XATOM_EMACS_TMP (d); - if (EQ (sym, QTARGETS)) return DEVICE_XATOM_TARGETS (d); - if (EQ (sym, QNULL)) return DEVICE_XATOM_NULL (d); - if (EQ (sym, QATOM_PAIR)) return DEVICE_XATOM_ATOM_PAIR (d); - if (EQ (sym, QCOMPOUND_TEXT)) return DEVICE_XATOM_COMPOUND_TEXT (d); - -#ifdef CUT_BUFFER_SUPPORT - if (EQ (sym, QCUT_BUFFER0)) return XA_CUT_BUFFER0; - if (EQ (sym, QCUT_BUFFER1)) return XA_CUT_BUFFER1; - if (EQ (sym, QCUT_BUFFER2)) return XA_CUT_BUFFER2; - if (EQ (sym, QCUT_BUFFER3)) return XA_CUT_BUFFER3; - if (EQ (sym, QCUT_BUFFER4)) return XA_CUT_BUFFER4; - if (EQ (sym, QCUT_BUFFER5)) return XA_CUT_BUFFER5; - if (EQ (sym, QCUT_BUFFER6)) return XA_CUT_BUFFER6; - if (EQ (sym, QCUT_BUFFER7)) return XA_CUT_BUFFER7; -#endif /* CUT_BUFFER_SUPPORT */ - - { - const char *nameext; - TO_EXTERNAL_FORMAT (LISP_STRING, Fsymbol_name (sym), - C_STRING_ALLOCA, nameext, - Qctext); - return XInternAtom (display, nameext, only_if_exists ? True : False); - } -} - - -/* This converts a server Atom to a Lisp symbol, avoiding server roundtrips - and calls to intern whenever possible. - */ -static Lisp_Object -x_atom_to_symbol (struct device *d, Atom atom) -{ - Display *display = DEVICE_X_DISPLAY (d); - - if (! atom) return Qnil; - if (atom == XA_PRIMARY) return QPRIMARY; - if (atom == XA_SECONDARY) return QSECONDARY; - if (atom == XA_STRING) return QSTRING; - if (atom == XA_INTEGER) return QINTEGER; - if (atom == XA_ATOM) return QATOM; - if (atom == DEVICE_XATOM_CLIPBOARD (d)) return QCLIPBOARD; - if (atom == DEVICE_XATOM_TIMESTAMP (d)) return QTIMESTAMP; - if (atom == DEVICE_XATOM_TEXT (d)) return QTEXT; - if (atom == DEVICE_XATOM_DELETE (d)) return QDELETE; - if (atom == DEVICE_XATOM_MULTIPLE (d)) return QMULTIPLE; - if (atom == DEVICE_XATOM_INCR (d)) return QINCR; - if (atom == DEVICE_XATOM_EMACS_TMP (d)) return QEMACS_TMP; - if (atom == DEVICE_XATOM_TARGETS (d)) return QTARGETS; - if (atom == DEVICE_XATOM_NULL (d)) return QNULL; - if (atom == DEVICE_XATOM_ATOM_PAIR (d)) return QATOM_PAIR; - if (atom == DEVICE_XATOM_COMPOUND_TEXT (d)) return QCOMPOUND_TEXT; - -#ifdef CUT_BUFFER_SUPPORT - if (atom == XA_CUT_BUFFER0) return QCUT_BUFFER0; - if (atom == XA_CUT_BUFFER1) return QCUT_BUFFER1; - if (atom == XA_CUT_BUFFER2) return QCUT_BUFFER2; - if (atom == XA_CUT_BUFFER3) return QCUT_BUFFER3; - if (atom == XA_CUT_BUFFER4) return QCUT_BUFFER4; - if (atom == XA_CUT_BUFFER5) return QCUT_BUFFER5; - if (atom == XA_CUT_BUFFER6) return QCUT_BUFFER6; - if (atom == XA_CUT_BUFFER7) return QCUT_BUFFER7; -#endif - - { - char *intstr; - char *str = XGetAtomName (display, atom); - - if (! str) return Qnil; - - TO_INTERNAL_FORMAT (C_STRING, str, - C_STRING_ALLOCA, intstr, - Qctext); - XFree (str); - return intern (intstr); - } -} - - -/* Do protocol to assert ourself as a selection owner. - */ -static Lisp_Object -x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, - Lisp_Object how_to_add, Lisp_Object selection_type) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - struct frame *sel_frame = selected_frame (); - Window selecting_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame)); - Lisp_Object selection_time; - /* Use the time of the last-read mouse or keyboard event. - For selection purposes, we use this as a sleazy way of knowing what the - current time is in server-time. This assumes that the most recently read - mouse or keyboard event has something to do with the assertion of the - selection, which is probably true. - */ - Time thyme = DEVICE_X_MOUSE_TIMESTAMP (d); - Atom selection_atom; - - CHECK_SYMBOL (selection_name); - selection_atom = symbol_to_x_atom (d, selection_name, 0); - - XSetSelectionOwner (display, selection_atom, selecting_window, thyme); - - /* We do NOT use time_to_lisp() here any more, like we used to. - That assumed equivalence of time_t and Time, which is not - necessarily the case (e.g. under OSF on the Alphas, where - Time is a 64-bit quantity and time_t is a 32-bit quantity). - - Opaque pointers are the clean way to go here. - */ - selection_time = make_opaque (&thyme, sizeof (thyme)); - -#ifdef MOTIF_CLIPBOARDS - hack_motif_clipboard_selection (selection_atom, selection_value, - thyme, display, selecting_window); -#endif - return selection_time; -} - -#ifdef MOTIF_CLIPBOARDS /* Bend over baby. Take it and like it. */ - -# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK -static void motif_clipboard_cb (); -# endif - -static void -hack_motif_clipboard_selection (Atom selection_atom, - Lisp_Object selection_value, - Time thyme, - Display *display, - Window selecting_window) - /* Bool owned_p)*/ -{ - struct device *d = get_device_from_display (display); - /* Those Motif wankers can't be bothered to follow the ICCCM, and do - their own non-Xlib non-Xt clipboard processing. So we have to do - this so that linked-in Motif widgets don't get themselves wedged. - */ - if (selection_atom == DEVICE_XATOM_CLIPBOARD (d) - && STRINGP (selection_value) - - /* If we already own the clipboard, don't own it again in the Motif - way. This might lose in some subtle way, since the timestamp won't - be current, but owning the selection on the Motif way does a - SHITLOAD of X protocol, and it makes killing text be incredibly - slow when using an X terminal. ARRRRGGGHHH!!!! - */ - /* No, this is no good, because then Motif text fields don't bother - to look up the new value, and you can't Copy from a buffer, Paste - into a text field, then Copy something else from the buffer and - paste it into the text field -- it pastes the first thing again. */ -/* && !owned_p */ - ) - { -#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK - Widget widget = FRAME_X_TEXT_WIDGET (selected_frame()); -#endif - long itemid; -#if XmVersion >= 1002 - long dataid; -#else - int dataid; /* 1.2 wants long, but 1.1.5 wants int... */ -#endif - XmString fmh; - String encoding = "STRING"; - const Extbyte *data = XSTRING_DATA (selection_value); - Extcount bytes = XSTRING_LENGTH (selection_value); - -#ifdef MULE - { - enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; - const Bufbyte *ptr = data, *end = ptr + bytes; - /* Optimize for the common ASCII case */ - while (ptr <= end) - { - if (BYTE_ASCII_P (*ptr)) - { - ptr++; - continue; - } - - if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 || - (*ptr) == LEADING_BYTE_CONTROL_1) - { - chartypes = LATIN_1; - ptr += 2; - continue; - } - - chartypes = WORLD; - break; - } - - if (chartypes == LATIN_1) - TO_EXTERNAL_FORMAT (LISP_STRING, selection_value, - ALLOCA, (data, bytes), - Qbinary); - else if (chartypes == WORLD) - { - TO_EXTERNAL_FORMAT (LISP_STRING, selection_value, - ALLOCA, (data, bytes), - Qctext); - encoding = "COMPOUND_TEXT"; - } - } -#endif /* MULE */ - - fmh = XmStringCreateLtoR ("Clipboard", XmSTRING_DEFAULT_CHARSET); - while (ClipboardSuccess != - XmClipboardStartCopy (display, selecting_window, fmh, thyme, -#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK - widget, motif_clipboard_cb, -#else - 0, NULL, -#endif - &itemid)) - ; - XmStringFree (fmh); - while (ClipboardSuccess != - XmClipboardCopy (display, selecting_window, itemid, encoding, -#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK - /* O'Reilly examples say size can be 0, - but this clearly is not the case. */ - 0, bytes, (int) selecting_window, /* private id */ -#else /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ - (XtPointer) data, bytes, 0, -#endif /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ - &dataid)) - ; - while (ClipboardSuccess != - XmClipboardEndCopy (display, selecting_window, itemid)) - ; - } -} - -# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK -/* I tried to treat the clipboard like a real selection, and not send - the data until it was requested, but it looks like that just doesn't - work at all unless the selection owner and requestor are in different - processes. From reading the Motif source, it looks like they never - even considered having two widgets in the same application transfer - data between each other using "by-name" clipboard values. What a - bunch of fuckups. - */ -static void -motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason) -{ - switch (*reason) - { - case XmCR_CLIPBOARD_DATA_REQUEST: - { - Display *dpy = XtDisplay (widget); - Window window = (Window) *private_id; - Lisp_Object selection = select_convert_out (QCLIPBOARD, Qnil, Qnil); - - /* Whichever lazy git wrote this originally just called abort() - when anything didn't go their way... */ - - /* Try some other text types */ - if (NILP (selection)) - selection = select_convert_out (QCLIPBOARD, QSTRING, Qnil); - if (NILP (selection)) - selection = select_convert_out (QCLIPBOARD, QTEXT, Qnil); - if (NILP (selection)) - selection = select_convert_out (QCLIPBOARD, QCOMPOUND_TEXT, Qnil); - - if (CONSP (selection) && SYMBOLP (XCAR (selection)) - && (EQ (XCAR (selection), QSTRING) - || EQ (XCAR (selection), QTEXT) - || EQ (XCAR (selection), QCOMPOUND_TEXT))) - selection = XCDR (selection); - - if (NILP (selection)) - signal_error (Qselection_conversion_error, - build_string ("no selection")); - - if (!STRINGP (selection)) - signal_error (Qselection_conversion_error, - build_string ("couldn't convert selection to string")); - - - XmClipboardCopyByName (dpy, window, *data_id, - (char *) XSTRING_DATA (selection), - XSTRING_LENGTH (selection) + 1, - 0); - } - break; - case XmCR_CLIPBOARD_DATA_DELETE: - default: - /* don't need to free anything */ - break; - } -} -# endif /* MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ -#endif /* MOTIF_CLIPBOARDS */ - - - - -/* Send a SelectionNotify event to the requestor with property=None, meaning - we were unable to do what they wanted. - */ -static void -x_decline_selection_request (XSelectionRequestEvent *event) -{ - XSelectionEvent reply; - reply.type = SelectionNotify; - reply.display = event->display; - reply.requestor = event->requestor; - reply.selection = event->selection; - reply.time = event->time; - reply.target = event->target; - reply.property = None; - - XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply); - XFlush (reply.display); -} - - -/* Used as an unwind-protect clause so that, if a selection-converter signals - an error, we tell the requestor that we were unable to do what they wanted - before we throw to top-level or go into the debugger or whatever. - */ -static Lisp_Object -x_selection_request_lisp_error (Lisp_Object closure) -{ - XSelectionRequestEvent *event = (XSelectionRequestEvent *) - get_opaque_ptr (closure); - - free_opaque_ptr (closure); - if (event->type == 0) /* we set this to mean "completed normally" */ - return Qnil; - x_decline_selection_request (event); - return Qnil; -} - - -/* Convert our selection to the requested type, and put that data where the - requestor wants it. Then tell them whether we've succeeded. - */ -static void -x_reply_selection_request (XSelectionRequestEvent *event, int format, - unsigned char *data, int size, Atom type) -{ - /* This function can GC */ - XSelectionEvent reply; - Display *display = event->display; - struct device *d = get_device_from_display (display); - Window window = event->requestor; - int bytes_remaining; - int format_bytes = format/8; - int max_bytes = SELECTION_QUANTUM (display); - if (max_bytes > MAX_SELECTION_QUANTUM) max_bytes = MAX_SELECTION_QUANTUM; - - reply.type = SelectionNotify; - reply.display = display; - reply.requestor = window; - reply.selection = event->selection; - reply.time = event->time; - reply.target = event->target; - reply.property = (event->property == None ? event->target : event->property); - - /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ - - /* Store the data on the requested property. - If the selection is large, only store the first N bytes of it. - */ - bytes_remaining = size * format_bytes; - if (bytes_remaining <= max_bytes) - { - /* Send all the data at once, with minimal handshaking. */ -#if 0 - stderr_out ("\nStoring all %d\n", bytes_remaining); -#endif - XChangeProperty (display, window, reply.property, type, format, - PropModeReplace, data, size); - /* At this point, the selection was successfully stored; ack it. */ - XSendEvent (display, window, False, 0L, (XEvent *) &reply); - XFlush (display); - } - else - { - /* Send an INCR selection. */ - int prop_id; - - if (x_window_to_frame (d, window)) /* #### debug */ - error ("attempt to transfer an INCR to ourself!"); -#if 0 - stderr_out ("\nINCR %d\n", bytes_remaining); -#endif - prop_id = expect_property_change (display, window, reply.property, - PropertyDelete); - - XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d), - 32, PropModeReplace, (unsigned char *) - &bytes_remaining, 1); - XSelectInput (display, window, PropertyChangeMask); - /* Tell 'em the INCR data is there... */ - XSendEvent (display, window, False, 0L, (XEvent *) &reply); - XFlush (display); - - /* First, wait for the requestor to ack by deleting the property. - This can run random lisp code (process handlers) or signal. - */ - wait_for_property_change (prop_id); - - while (bytes_remaining) - { - int i = ((bytes_remaining < max_bytes) - ? bytes_remaining - : max_bytes); - prop_id = expect_property_change (display, window, reply.property, - PropertyDelete); -#if 0 - stderr_out (" INCR adding %d\n", i); -#endif - /* Append the next chunk of data to the property. */ - XChangeProperty (display, window, reply.property, type, format, - PropModeAppend, data, i / format_bytes); - bytes_remaining -= i; - data += i; - - /* Now wait for the requestor to ack this chunk by deleting the - property. This can run random lisp code or signal. - */ - wait_for_property_change (prop_id); - } - /* Now write a zero-length chunk to the property to tell the requestor - that we're done. */ -#if 0 - stderr_out (" INCR done\n"); -#endif - if (! waiting_for_other_props_on_window (display, window)) - XSelectInput (display, window, 0L); - - XChangeProperty (display, window, reply.property, type, format, - PropModeReplace, data, 0); - } -} - - - -/* Called from the event-loop in response to a SelectionRequest event. - */ -void -x_handle_selection_request (XSelectionRequestEvent *event) -{ - /* This function can GC */ - struct gcpro gcpro1, gcpro2; - Lisp_Object temp_obj; - Lisp_Object selection_symbol; - Lisp_Object target_symbol = Qnil; - Lisp_Object converted_selection = Qnil; - Time local_selection_time; - Lisp_Object successful_p = Qnil; - int count; - struct device *d = get_device_from_display (event->display); - - GCPRO2 (converted_selection, target_symbol); - - selection_symbol = x_atom_to_symbol (d, event->selection); - target_symbol = x_atom_to_symbol (d, event->target); - -#if 0 /* #### MULTIPLE doesn't work yet */ - if (EQ (target_symbol, QMULTIPLE)) - target_symbol = fetch_multiple_target (event); -#endif - - temp_obj = Fget_selection_timestamp (selection_symbol); - - if (NILP (temp_obj)) - { - /* We don't appear to have the selection. */ - x_decline_selection_request (event); - - goto DONE_LABEL; - } - - local_selection_time = * (Time *) XOPAQUE_DATA (temp_obj); - - if (event->time != CurrentTime && - local_selection_time > event->time) - { - /* Someone asked for the selection, and we have one, but not the one - they're looking for. */ - x_decline_selection_request (event); - goto DONE_LABEL; - } - - converted_selection = select_convert_out (selection_symbol, - target_symbol, Qnil); - - /* #### Is this the right thing to do? I'm no X expert. -- ajh */ - if (NILP (converted_selection)) - { - /* We don't appear to have a selection in that data type. */ - x_decline_selection_request (event); - goto DONE_LABEL; - } - - count = specpdl_depth (); - record_unwind_protect (x_selection_request_lisp_error, - make_opaque_ptr (event)); - - { - unsigned char *data; - unsigned int size; - int format; - Atom type; - lisp_data_to_selection_data (d, converted_selection, - &data, &type, &size, &format); - - x_reply_selection_request (event, format, data, size, type); - successful_p = Qt; - /* Tell x_selection_request_lisp_error() it's cool. */ - event->type = 0; - xfree (data); - } - - unbind_to (count, Qnil); - - DONE_LABEL: - - UNGCPRO; - - /* Let random lisp code notice that the selection has been asked for. */ - { - Lisp_Object val = Vx_sent_selection_hooks; - if (!UNBOUNDP (val) && !NILP (val)) - { - Lisp_Object rest; - if (CONSP (val) && !EQ (XCAR (val), Qlambda)) - for (rest = val; !NILP (rest); rest = Fcdr (rest)) - call3 (Fcar (rest), selection_symbol, target_symbol, successful_p); - else - call3 (val, selection_symbol, target_symbol, successful_p); - } - } -} - - -/* Called from the event-loop in response to a SelectionClear event. - */ -void -x_handle_selection_clear (XSelectionClearEvent *event) -{ - Display *display = event->display; - struct device *d = get_device_from_display (display); - Atom selection = event->selection; - Time changed_owner_time = event->time; - - Lisp_Object selection_symbol, local_selection_time_lisp; - Time local_selection_time; - - selection_symbol = x_atom_to_symbol (d, selection); - - local_selection_time_lisp = Fget_selection_timestamp (selection_symbol); - - /* We don't own the selection, so that's fine. */ - if (NILP (local_selection_time_lisp)) - return; - - local_selection_time = * (Time *) XOPAQUE_DATA (local_selection_time_lisp); - - /* This SelectionClear is for a selection that we no longer own, so we can - disregard it. (That is, we have reasserted the selection since this - request was generated.) - */ - if (changed_owner_time != CurrentTime && - local_selection_time > changed_owner_time) - return; - - handle_selection_clear (selection_symbol); -} - - -/* This stuff is so that INCR selections are reentrant (that is, so we can - be servicing multiple INCR selection requests simultaneously). I haven't - actually tested that yet. - */ - -static int prop_location_tick; - -static struct prop_location { - int tick; - Display *display; - Window window; - Atom property; - int desired_state; - struct prop_location *next; -} *for_whom_the_bell_tolls; - - -static int -property_deleted_p (void *tick) -{ - struct prop_location *rest = for_whom_the_bell_tolls; - while (rest) - if (rest->tick == (long) tick) - return 0; - else - rest = rest->next; - return 1; -} - -static int -waiting_for_other_props_on_window (Display *display, Window window) -{ - struct prop_location *rest = for_whom_the_bell_tolls; - while (rest) - if (rest->display == display && rest->window == window) - return 1; - else - rest = rest->next; - return 0; -} - - -static int -expect_property_change (Display *display, Window window, - Atom property, int state) -{ - struct prop_location *pl = xnew (struct prop_location); - pl->tick = ++prop_location_tick; - pl->display = display; - pl->window = window; - pl->property = property; - pl->desired_state = state; - pl->next = for_whom_the_bell_tolls; - for_whom_the_bell_tolls = pl; - return pl->tick; -} - -static void -unexpect_property_change (int tick) -{ - struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls; - while (rest) - { - if (rest->tick == tick) - { - if (prev) - prev->next = rest->next; - else - for_whom_the_bell_tolls = rest->next; - xfree (rest); - return; - } - prev = rest; - rest = rest->next; - } -} - -static void -wait_for_property_change (long tick) -{ - /* This function can GC */ - wait_delaying_user_input (property_deleted_p, (void *) tick); -} - - -/* Called from the event-loop in response to a PropertyNotify event. - */ -void -x_handle_property_notify (XPropertyEvent *event) -{ - struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls; - while (rest) - { - if (rest->property == event->atom && - rest->window == event->window && - rest->display == event->display && - rest->desired_state == event->state) - { -#if 0 - stderr_out ("Saw expected prop-%s on %s\n", - (event->state == PropertyDelete ? "delete" : "change"), - (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name); -#endif - if (prev) - prev->next = rest->next; - else - for_whom_the_bell_tolls = rest->next; - xfree (rest); - return; - } - prev = rest; - rest = rest->next; - } -#if 0 - stderr_out ("Saw UNexpected prop-%s on %s\n", - (event->state == PropertyDelete ? "delete" : "change"), - (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name)); -#endif -} - - - -#if 0 /* #### MULTIPLE doesn't work yet */ - -static Lisp_Object -fetch_multiple_target (XSelectionRequestEvent *event) -{ - /* This function can GC */ - Display *display = event->display; - Window window = event->requestor; - Atom target = event->target; - Atom selection_atom = event->selection; - int result; - - return - Fcons (QMULTIPLE, - x_get_window_property_as_lisp_data (display, window, target, - QMULTIPLE, - selection_atom)); -} - -static Lisp_Object -copy_multiple_data (Lisp_Object obj) -{ - Lisp_Object vec; - int i; - int len; - if (CONSP (obj)) - return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj))); - - CHECK_VECTOR (obj); - len = XVECTOR_LENGTH (obj); - vec = make_vector (len, Qnil); - for (i = 0; i < len; i++) - { - Lisp_Object vec2 = XVECTOR_DATA (obj) [i]; - CHECK_VECTOR (vec2); - if (XVECTOR_LENGTH (vec2) != 2) - signal_error (Qerror, list2 (build_string - ("vectors must be of length 2"), - vec2)); - XVECTOR_DATA (vec) [i] = make_vector (2, Qnil); - XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [0] = XVECTOR_DATA (vec2) [0]; - XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [1] = XVECTOR_DATA (vec2) [1]; - } - return vec; -} - -#endif /* 0 */ - - -static Window reading_selection_reply; -static Atom reading_which_selection; -static int selection_reply_timed_out; - -static int -selection_reply_done (void *ignore) -{ - return !reading_selection_reply; -} - -static Lisp_Object Qx_selection_reply_timeout_internal; - -DEFUN ("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal, - 1, 1, 0, /* -*/ - (arg)) -{ - selection_reply_timed_out = 1; - reading_selection_reply = 0; - return Qnil; -} - - -/* Do protocol to read selection-data from the server. - Converts this to lisp data and returns it. - */ -static Lisp_Object -x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type) -{ - /* This function can GC */ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - struct frame *sel_frame = selected_frame (); - Window requestor_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame)); - Time requestor_time = DEVICE_X_MOUSE_TIMESTAMP (d); - Atom target_property = DEVICE_XATOM_EMACS_TMP (d); - Atom selection_atom = symbol_to_x_atom (d, selection_symbol, 0); - int speccount; - Atom type_atom = symbol_to_x_atom (d, (CONSP (target_type) ? - XCAR (target_type) : target_type), 0); - - XConvertSelection (display, selection_atom, type_atom, target_property, - requestor_window, requestor_time); - - /* Block until the reply has been read. */ - reading_selection_reply = requestor_window; - reading_which_selection = selection_atom; - selection_reply_timed_out = 0; - - speccount = specpdl_depth (); - - /* add a timeout handler */ - if (x_selection_timeout > 0) - { - Lisp_Object id = Fadd_timeout (make_int (x_selection_timeout), - Qx_selection_reply_timeout_internal, - Qnil, Qnil); - record_unwind_protect (Fdisable_timeout, id); - } - - /* This is ^Gable */ - wait_delaying_user_input (selection_reply_done, 0); - - if (selection_reply_timed_out) - error ("timed out waiting for reply from selection owner"); - - unbind_to (speccount, Qnil); - - /* otherwise, the selection is waiting for us on the requested property. */ - - return select_convert_in (selection_symbol, - target_type, - x_get_window_property_as_lisp_data(display, - requestor_window, - target_property, - target_type, - selection_atom)); -} - - -static void -x_get_window_property (Display *display, Window window, Atom property, - unsigned char **data_ret, int *bytes_ret, - Atom *actual_type_ret, int *actual_format_ret, - unsigned long *actual_size_ret, int delete_p) -{ - int total_size; - unsigned long bytes_remaining; - int offset = 0; - unsigned char *tmp_data = 0; - int result; - int buffer_size = SELECTION_QUANTUM (display); - if (buffer_size > MAX_SELECTION_QUANTUM) buffer_size = MAX_SELECTION_QUANTUM; - - /* First probe the thing to find out how big it is. */ - result = XGetWindowProperty (display, window, property, - 0, 0, False, AnyPropertyType, - actual_type_ret, actual_format_ret, - actual_size_ret, - &bytes_remaining, &tmp_data); - if (result != Success) - { - *data_ret = 0; - *bytes_ret = 0; - return; - } - XFree ((char *) tmp_data); - - if (*actual_type_ret == None || *actual_format_ret == 0) - { - if (delete_p) XDeleteProperty (display, window, property); - *data_ret = 0; - *bytes_ret = 0; - return; - } - - total_size = bytes_remaining + 1; - *data_ret = (unsigned char *) xmalloc (total_size); - - /* Now read, until we've gotten it all. */ - while (bytes_remaining) - { -#if 0 - int last = bytes_remaining; -#endif - result = - XGetWindowProperty (display, window, property, - offset/4, buffer_size/4, - (delete_p ? True : False), - AnyPropertyType, - actual_type_ret, actual_format_ret, - actual_size_ret, &bytes_remaining, &tmp_data); -#if 0 - stderr_out ("<< read %d\n", last-bytes_remaining); -#endif - /* If this doesn't return Success at this point, it means that - some clod deleted the selection while we were in the midst of - reading it. Deal with that, I guess.... - */ - if (result != Success) break; - *actual_size_ret *= *actual_format_ret / 8; - memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret); - offset += *actual_size_ret; - XFree ((char *) tmp_data); - } - *bytes_ret = offset; -} - - -static void -receive_incremental_selection (Display *display, Window window, Atom property, - /* this one is for error messages only */ - Lisp_Object target_type, - unsigned int min_size_bytes, - unsigned char **data_ret, int *size_bytes_ret, - Atom *type_ret, int *format_ret, - unsigned long *size_ret) -{ - /* This function can GC */ - int offset = 0; - int prop_id; - *size_bytes_ret = min_size_bytes; - *data_ret = (unsigned char *) xmalloc (*size_bytes_ret); -#if 0 - stderr_out ("\nread INCR %d\n", min_size_bytes); -#endif - /* At this point, we have read an INCR property, and deleted it (which - is how we ack its receipt: the sending window will be selecting - PropertyNotify events on our window to notice this). - - Now, we must loop, waiting for the sending window to put a value on - that property, then reading the property, then deleting it to ack. - We are done when the sender places a property of length 0. - */ - prop_id = expect_property_change (display, window, property, - PropertyNewValue); - while (1) - { - unsigned char *tmp_data; - int tmp_size_bytes; - wait_for_property_change (prop_id); - /* expect it again immediately, because x_get_window_property may - .. no it won't, I don't get it. - .. Ok, I get it now, the Xt code that implements INCR is broken. - */ - prop_id = expect_property_change (display, window, property, - PropertyNewValue); - x_get_window_property (display, window, property, - &tmp_data, &tmp_size_bytes, - type_ret, format_ret, size_ret, 1); - - if (tmp_size_bytes == 0) /* we're done */ - { -#if 0 - stderr_out (" read INCR done\n"); -#endif - unexpect_property_change (prop_id); - if (tmp_data) xfree (tmp_data); - break; - } -#if 0 - stderr_out (" read INCR %d\n", tmp_size_bytes); -#endif - if (*size_bytes_ret < offset + tmp_size_bytes) - { -#if 0 - stderr_out (" read INCR realloc %d -> %d\n", - *size_bytes_ret, offset + tmp_size_bytes); -#endif - *size_bytes_ret = offset + tmp_size_bytes; - *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret); - } - memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); - offset += tmp_size_bytes; - xfree (tmp_data); - } -} - - -static Lisp_Object -x_get_window_property_as_lisp_data (Display *display, - Window window, - Atom property, - /* next two for error messages only */ - Lisp_Object target_type, - Atom selection_atom) -{ - /* This function can GC */ - Atom actual_type; - int actual_format; - unsigned long actual_size; - unsigned char *data = NULL; - int bytes = 0; - Lisp_Object val; - struct device *d = get_device_from_display (display); - - x_get_window_property (display, window, property, &data, &bytes, - &actual_type, &actual_format, &actual_size, 1); - if (! data) - { - if (XGetSelectionOwner (display, selection_atom)) - /* there is a selection owner */ - signal_error - (Qselection_conversion_error, - Fcons (build_string ("selection owner couldn't convert"), - Fcons (x_atom_to_symbol (d, selection_atom), - actual_type ? - list2 (target_type, x_atom_to_symbol (d, actual_type)) : - list1 (target_type)))); - else - signal_error (Qerror, - list2 (build_string ("no selection"), - x_atom_to_symbol (d, selection_atom))); - } - - if (actual_type == DEVICE_XATOM_INCR (d)) - { - /* Ok, that data wasn't *the* data, it was just the beginning. */ - - unsigned int min_size_bytes = * ((unsigned int *) data); - xfree (data); - receive_incremental_selection (display, window, property, target_type, - min_size_bytes, &data, &bytes, - &actual_type, &actual_format, - &actual_size); - } - - /* It's been read. Now convert it to a lisp object in some semi-rational - manner. */ - val = selection_data_to_lisp_data (d, data, bytes, - actual_type, actual_format); - - xfree (data); - return val; -} - -/* #### These are going to move into Lisp code(!) with the aid of - some new functions I'm working on - ajh */ - -/* These functions convert from the selection data read from the server into - something that we can use from elisp, and vice versa. - - Type: Format: Size: Elisp Type: - ----- ------- ----- ----------- - * 8 * String - ATOM 32 1 Symbol - ATOM 32 > 1 Vector of Symbols - * 16 1 Integer - * 16 > 1 Vector of Integers - * 32 1 if <=16 bits: Integer - if > 16 bits: Cons of top16, bot16 - * 32 > 1 Vector of the above - - When converting a Lisp number to C, it is assumed to be of format 16 if - it is an integer, and of format 32 if it is a cons of two integers. - - When converting a vector of numbers from Elisp to C, it is assumed to be - of format 16 if every element in the vector is an integer, and is assumed - to be of format 32 if any element is a cons of two integers. - - When converting an object to C, it may be of the form (SYMBOL . <data>) - where SYMBOL is what we should claim that the type is. Format and - representation are as above. - - NOTE: Under Mule, when someone shoves us a string without a type, we - set the type to 'COMPOUND_TEXT and automatically convert to Compound - Text. If the string has a type, we assume that the user wants the - data sent as-is so we just do "binary" conversion. - */ - - -static Lisp_Object -selection_data_to_lisp_data (struct device *d, - unsigned char *data, - size_t size, - Atom type, - int format) -{ - if (type == DEVICE_XATOM_NULL (d)) - return QNULL; - - /* Convert any 8-bit data to a string, for compactness. */ - else if (format == 8) - return make_ext_string (data, size, - type == DEVICE_XATOM_TEXT (d) || - type == DEVICE_XATOM_COMPOUND_TEXT (d) - ? Qctext : Qbinary); - - /* Convert a single atom to a Lisp Symbol. - Convert a set of atoms to a vector of symbols. */ - else if (type == XA_ATOM) - { - if (size == sizeof (Atom)) - return x_atom_to_symbol (d, *((Atom *) data)); - else - { - int i; - int len = size / sizeof (Atom); - Lisp_Object v = Fmake_vector (make_int (len), Qzero); - for (i = 0; i < len; i++) - Faset (v, make_int (i), x_atom_to_symbol (d, ((Atom *) data) [i])); - return v; - } - } - - /* Convert a single 16 or small 32 bit number to a Lisp Int. - If the number is > 16 bits, convert it to a cons of integers, - 16 bits in each half. - */ - else if (format == 32 && size == sizeof (long)) - return word_to_lisp (((unsigned long *) data) [0]); - else if (format == 16 && size == sizeof (short)) - return make_int ((int) (((unsigned short *) data) [0])); - - /* Convert any other kind of data to a vector of numbers, represented - as above (as an integer, or a cons of two 16 bit integers). - - #### Perhaps we should return the actual type to lisp as well. - - (x-get-selection-internal 'PRIMARY 'LINE_NUMBER) - ==> [4 4] - - and perhaps it should be - - (x-get-selection-internal 'PRIMARY 'LINE_NUMBER) - ==> (SPAN . [4 4]) - - Right now the fact that the return type was SPAN is discarded before - lisp code gets to see it. - */ - else if (format == 16) - { - int i; - Lisp_Object v = make_vector (size / 4, Qzero); - for (i = 0; i < (int) size / 4; i++) - { - int j = (int) ((unsigned short *) data) [i]; - Faset (v, make_int (i), make_int (j)); - } - return v; - } - else - { - int i; - Lisp_Object v = make_vector (size / 4, Qzero); - for (i = 0; i < (int) size / 4; i++) - { - unsigned long j = ((unsigned long *) data) [i]; - Faset (v, make_int (i), word_to_lisp (j)); - } - return v; - } -} - - -static void -lisp_data_to_selection_data (struct device *d, - Lisp_Object obj, - unsigned char **data_ret, - Atom *type_ret, - unsigned int *size_ret, - int *format_ret) -{ - Lisp_Object type = Qnil; - - if (CONSP (obj) && SYMBOLP (XCAR (obj))) - { - type = XCAR (obj); - obj = XCDR (obj); - if (CONSP (obj) && NILP (XCDR (obj))) - obj = XCAR (obj); - } - - if (EQ (obj, QNULL) || (EQ (type, QNULL))) - { /* This is not the same as declining */ - *format_ret = 32; - *size_ret = 0; - *data_ret = 0; - type = QNULL; - } - else if (STRINGP (obj)) - { - const Extbyte *extval; - Extcount extvallen; - - TO_EXTERNAL_FORMAT (LISP_STRING, obj, - ALLOCA, (extval, extvallen), - (NILP (type) ? Qctext : Qbinary)); - *format_ret = 8; - *size_ret = extvallen; - *data_ret = (unsigned char *) xmalloc (*size_ret); - memcpy (*data_ret, extval, *size_ret); -#ifdef MULE - if (NILP (type)) type = QCOMPOUND_TEXT; -#else - if (NILP (type)) type = QSTRING; -#endif - } - else if (CHARP (obj)) - { - Bufbyte buf[MAX_EMCHAR_LEN]; - Bytecount len; - const Extbyte *extval; - Extcount extvallen; - - *format_ret = 8; - len = set_charptr_emchar (buf, XCHAR (obj)); - TO_EXTERNAL_FORMAT (DATA, (buf, len), - ALLOCA, (extval, extvallen), - Qctext); - *size_ret = extvallen; - *data_ret = (unsigned char *) xmalloc (*size_ret); - memcpy (*data_ret, extval, *size_ret); -#ifdef MULE - if (NILP (type)) type = QCOMPOUND_TEXT; -#else - if (NILP (type)) type = QSTRING; -#endif - } - else if (SYMBOLP (obj)) - { - *format_ret = 32; - *size_ret = 1; - *data_ret = (unsigned char *) xmalloc (sizeof (Atom) + 1); - (*data_ret) [sizeof (Atom)] = 0; - (*(Atom **) data_ret) [0] = symbol_to_x_atom (d, obj, 0); - if (NILP (type)) type = QATOM; - } - else if (INTP (obj) && - XINT (obj) <= 0x7FFF && - XINT (obj) >= -0x8000) - { - *format_ret = 16; - *size_ret = 1; - *data_ret = (unsigned char *) xmalloc (sizeof (short) + 1); - (*data_ret) [sizeof (short)] = 0; - (*(short **) data_ret) [0] = (short) XINT (obj); - if (NILP (type)) type = QINTEGER; - } - else if (INTP (obj) || CONSP (obj)) - { - *format_ret = 32; - *size_ret = 1; - *data_ret = (unsigned char *) xmalloc (sizeof (long) + 1); - (*data_ret) [sizeof (long)] = 0; - (*(unsigned long **) data_ret) [0] = lisp_to_word (obj); - if (NILP (type)) type = QINTEGER; - } - else if (VECTORP (obj)) - { - /* Lisp Vectors may represent a set of ATOMs; - a set of 16 or 32 bit INTEGERs; - or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...] - */ - int i; - - if (SYMBOLP (XVECTOR_DATA (obj) [0])) - /* This vector is an ATOM set */ - { - if (NILP (type)) type = QATOM; - *size_ret = XVECTOR_LENGTH (obj); - *format_ret = 32; - *data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom)); - for (i = 0; i < (int) (*size_ret); i++) - if (SYMBOLP (XVECTOR_DATA (obj) [i])) - (*(Atom **) data_ret) [i] = - symbol_to_x_atom (d, XVECTOR_DATA (obj) [i], 0); - else - signal_error (Qerror, /* Qselection_error */ - list2 (build_string - ("all elements of the vector must be of the same type"), - obj)); - } -#if 0 /* #### MULTIPLE doesn't work yet */ - else if (VECTORP (XVECTOR_DATA (obj) [0])) - /* This vector is an ATOM_PAIR set */ - { - if (NILP (type)) type = QATOM_PAIR; - *size_ret = XVECTOR_LENGTH (obj); - *format_ret = 32; - *data_ret = (unsigned char *) - xmalloc ((*size_ret) * sizeof (Atom) * 2); - for (i = 0; i < *size_ret; i++) - if (VECTORP (XVECTOR_DATA (obj) [i])) - { - Lisp_Object pair = XVECTOR_DATA (obj) [i]; - if (XVECTOR_LENGTH (pair) != 2) - signal_error (Qerror, - list2 (build_string - ("elements of the vector must be vectors of exactly two elements"), - pair)); - - (*(Atom **) data_ret) [i * 2] = - symbol_to_x_atom (d, XVECTOR_DATA (pair) [0], 0); - (*(Atom **) data_ret) [(i * 2) + 1] = - symbol_to_x_atom (d, XVECTOR_DATA (pair) [1], 0); - } - else - signal_error (Qerror, - list2 (build_string - ("all elements of the vector must be of the same type"), - obj)); - } -#endif - else - /* This vector is an INTEGER set, or something like it */ - { - *size_ret = XVECTOR_LENGTH (obj); - if (NILP (type)) type = QINTEGER; - *format_ret = 16; - for (i = 0; i < (int) (*size_ret); i++) - if (CONSP (XVECTOR_DATA (obj) [i])) - *format_ret = 32; - else if (!INTP (XVECTOR_DATA (obj) [i])) - signal_error (Qerror, /* Qselection_error */ - list2 (build_string - ("all elements of the vector must be integers or conses of integers"), - obj)); - - *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8)); - for (i = 0; i < (int) (*size_ret); i++) - if (*format_ret == 32) - (*((unsigned long **) data_ret)) [i] = - lisp_to_word (XVECTOR_DATA (obj) [i]); - else - (*((unsigned short **) data_ret)) [i] = - (unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]); - } - } - else - signal_error (Qerror, /* Qselection_error */ - list2 (build_string ("unrecognized selection data"), - obj)); - - *type_ret = symbol_to_x_atom (d, type, 0); -} - - - -/* Called from the event loop to handle SelectionNotify events. - I don't think this needs to be reentrant. - */ -void -x_handle_selection_notify (XSelectionEvent *event) -{ - if (! reading_selection_reply) - message ("received an unexpected SelectionNotify event"); - else if (event->requestor != reading_selection_reply) - message ("received a SelectionNotify event for the wrong window"); - else if (event->selection != reading_which_selection) - message ("received the wrong selection type in SelectionNotify!"); - else - reading_selection_reply = 0; /* we're done now. */ -} - -static void -x_disown_selection (Lisp_Object selection, Lisp_Object timeval) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Time timestamp; - Atom selection_atom; - - CHECK_SYMBOL (selection); - if (NILP (timeval)) - timestamp = DEVICE_X_MOUSE_TIMESTAMP (d); - else - { - /* #### This is bogus. See the comment above about problems - on OSF/1 and DEC Alphas. Yet another reason why it sucks - to have the implementation (i.e. cons of two 16-bit - integers) exposed. */ - time_t the_time; - lisp_to_time (timeval, &the_time); - timestamp = (Time) the_time; - } - - selection_atom = symbol_to_x_atom (d, selection, 0); - - XSetSelectionOwner (display, selection_atom, None, timestamp); -} - -static Lisp_Object -x_selection_exists_p (Lisp_Object selection, - Lisp_Object selection_type) -{ - struct device *d = decode_x_device (Qnil); - Display *dpy = DEVICE_X_DISPLAY (d); - return XGetSelectionOwner (dpy, symbol_to_x_atom (d, selection, 0)) != None ? - Qt : Qnil; -} - - -#ifdef CUT_BUFFER_SUPPORT - -static int cut_buffers_initialized; /* Whether we're sure they all exist */ - -/* Ensure that all 8 cut buffers exist. ICCCM says we gotta... */ -static void -initialize_cut_buffers (Display *display, Window window) -{ - static unsigned const char * const data = (unsigned const char *) ""; -#define FROB(atom) XChangeProperty (display, window, atom, XA_STRING, 8, \ - PropModeAppend, data, 0) - FROB (XA_CUT_BUFFER0); - FROB (XA_CUT_BUFFER1); - FROB (XA_CUT_BUFFER2); - FROB (XA_CUT_BUFFER3); - FROB (XA_CUT_BUFFER4); - FROB (XA_CUT_BUFFER5); - FROB (XA_CUT_BUFFER6); - FROB (XA_CUT_BUFFER7); -#undef FROB - cut_buffers_initialized = 1; -} - -#define CHECK_CUTBUFFER(symbol) do { \ - CHECK_SYMBOL (symbol); \ - if (! (EQ (symbol, QCUT_BUFFER0) || \ - EQ (symbol, QCUT_BUFFER1) || \ - EQ (symbol, QCUT_BUFFER2) || \ - EQ (symbol, QCUT_BUFFER3) || \ - EQ (symbol, QCUT_BUFFER4) || \ - EQ (symbol, QCUT_BUFFER5) || \ - EQ (symbol, QCUT_BUFFER6) || \ - EQ (symbol, QCUT_BUFFER7))) \ - signal_simple_error ("Doesn't name a cutbuffer", symbol); \ -} while (0) - -DEFUN ("x-get-cutbuffer-internal", Fx_get_cutbuffer_internal, 1, 1, 0, /* -Return the value of the named CUTBUFFER (typically CUT_BUFFER0). -*/ - (cutbuffer)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ - Atom cut_buffer_atom; - unsigned char *data; - int bytes; - Atom type; - int format; - unsigned long size; - Lisp_Object ret; - - CHECK_CUTBUFFER (cutbuffer); - cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0); - - x_get_window_property (display, window, cut_buffer_atom, &data, &bytes, - &type, &format, &size, 0); - if (!data) return Qnil; - - if (format != 8 || type != XA_STRING) - signal_simple_error_2 ("Cut buffer doesn't contain 8-bit STRING data", - x_atom_to_symbol (d, type), - make_int (format)); - - /* We cheat - if the string contains an ESC character, that's - technically not allowed in a STRING, so we assume it's - COMPOUND_TEXT that we stored there ourselves earlier, - in x-store-cutbuffer-internal */ - ret = (bytes ? - make_ext_string (data, bytes, - memchr (data, 0x1b, bytes) ? - Qctext : Qbinary) - : Qnil); - xfree (data); - return ret; -} - - -DEFUN ("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0, /* -Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING. -*/ - (cutbuffer, string)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ - Atom cut_buffer_atom; - const Extbyte *data = XSTRING_DATA (string); - Extcount bytes = XSTRING_LENGTH (string); - Extcount bytes_remaining; - int max_bytes = SELECTION_QUANTUM (display); -#ifdef MULE - const Bufbyte *ptr, *end; - enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; -#endif - - if (max_bytes > MAX_SELECTION_QUANTUM) - max_bytes = MAX_SELECTION_QUANTUM; - - CHECK_CUTBUFFER (cutbuffer); - CHECK_STRING (string); - cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0); - - if (! cut_buffers_initialized) - initialize_cut_buffers (display, window); - - /* We use the STRING encoding (Latin-1 only) if we can, else COMPOUND_TEXT. - We cheat and use type = `STRING' even when using COMPOUND_TEXT. - The ICCCM requires that this be so, and other clients assume it, - as we do ourselves in initialize_cut_buffers. */ - -#ifdef MULE - /* Optimize for the common ASCII case */ - for (ptr = data, end = ptr + bytes; ptr <= end; ) - { - if (BYTE_ASCII_P (*ptr)) - { - ptr++; - continue; - } - - if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 || - (*ptr) == LEADING_BYTE_CONTROL_1) - { - chartypes = LATIN_1; - ptr += 2; - continue; - } - - chartypes = WORLD; - break; - } - - if (chartypes == LATIN_1) - TO_EXTERNAL_FORMAT (LISP_STRING, string, - ALLOCA, (data, bytes), - Qbinary); - else if (chartypes == WORLD) - TO_EXTERNAL_FORMAT (LISP_STRING, string, - ALLOCA, (data, bytes), - Qctext); -#endif /* MULE */ - - bytes_remaining = bytes; - - while (bytes_remaining) - { - int chunk = bytes_remaining < max_bytes ? bytes_remaining : max_bytes; - XChangeProperty (display, window, cut_buffer_atom, XA_STRING, 8, - (bytes_remaining == bytes - ? PropModeReplace : PropModeAppend), - data, chunk); - data += chunk; - bytes_remaining -= chunk; - } - return string; -} - - -DEFUN ("x-rotate-cutbuffers-internal", Fx_rotate_cutbuffers_internal, 1, 1, 0, /* -Rotate the values of the cutbuffers by the given number of steps; -positive means move values forward, negative means backward. -*/ - (n)) -{ - struct device *d = decode_x_device (Qnil); - Display *display = DEVICE_X_DISPLAY (d); - Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ - Atom props [8]; - - CHECK_INT (n); - if (XINT (n) == 0) - return n; - if (! cut_buffers_initialized) - initialize_cut_buffers (display, window); - props[0] = XA_CUT_BUFFER0; - props[1] = XA_CUT_BUFFER1; - props[2] = XA_CUT_BUFFER2; - props[3] = XA_CUT_BUFFER3; - props[4] = XA_CUT_BUFFER4; - props[5] = XA_CUT_BUFFER5; - props[6] = XA_CUT_BUFFER6; - props[7] = XA_CUT_BUFFER7; - XRotateWindowProperties (display, window, props, 8, XINT (n)); - return n; -} - -#endif /* CUT_BUFFER_SUPPORT */ - - - -/************************************************************************/ -/* initialization */ -/************************************************************************/ - -void -syms_of_select_x (void) -{ - -#ifdef CUT_BUFFER_SUPPORT - DEFSUBR (Fx_get_cutbuffer_internal); - DEFSUBR (Fx_store_cutbuffer_internal); - DEFSUBR (Fx_rotate_cutbuffers_internal); -#endif /* CUT_BUFFER_SUPPORT */ - - /* Unfortunately, timeout handlers must be lisp functions. */ - defsymbol (&Qx_selection_reply_timeout_internal, - "x-selection-reply-timeout-internal"); - DEFSUBR (Fx_selection_reply_timeout_internal); - -#ifdef CUT_BUFFER_SUPPORT - defsymbol (&QCUT_BUFFER0, "CUT_BUFFER0"); - defsymbol (&QCUT_BUFFER1, "CUT_BUFFER1"); - defsymbol (&QCUT_BUFFER2, "CUT_BUFFER2"); - defsymbol (&QCUT_BUFFER3, "CUT_BUFFER3"); - defsymbol (&QCUT_BUFFER4, "CUT_BUFFER4"); - defsymbol (&QCUT_BUFFER5, "CUT_BUFFER5"); - defsymbol (&QCUT_BUFFER6, "CUT_BUFFER6"); - defsymbol (&QCUT_BUFFER7, "CUT_BUFFER7"); -#endif /* CUT_BUFFER_SUPPORT */ -} - -void -console_type_create_select_x (void) -{ - CONSOLE_HAS_METHOD (x, own_selection); - CONSOLE_HAS_METHOD (x, disown_selection); - CONSOLE_HAS_METHOD (x, get_foreign_selection); - CONSOLE_HAS_METHOD (x, selection_exists_p); -} - -void -reinit_vars_of_select_x (void) -{ - reading_selection_reply = 0; - reading_which_selection = 0; - selection_reply_timed_out = 0; - for_whom_the_bell_tolls = 0; - prop_location_tick = 0; -} - -void -vars_of_select_x (void) -{ - reinit_vars_of_select_x (); - -#ifdef CUT_BUFFER_SUPPORT - cut_buffers_initialized = 0; - Fprovide (intern ("cut-buffer")); -#endif - - DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks /* -A function or functions to be called after we have responded to some -other client's request for the value of a selection that we own. The -function(s) will be called with four arguments: - - the name of the selection (typically PRIMARY, SECONDARY, or CLIPBOARD); - - the name of the selection-type which we were requested to convert the - selection into before sending (for example, STRING or LENGTH); - - and whether we successfully transmitted the selection. -We might have failed (and declined the request) for any number of reasons, -including being asked for a selection that we no longer own, or being asked -to convert into a type that we don't know about or that is inappropriate. -This hook doesn't let you change the behavior of emacs's selection replies, -it merely informs you that they have happened. -*/ ); - Vx_sent_selection_hooks = Qunbound; - - DEFVAR_INT ("x-selection-timeout", &x_selection_timeout /* -If the selection owner doesn't reply in this many seconds, we give up. -A value of 0 means wait as long as necessary. This is initialized from the -\"*selectionTimeout\" resource (which is expressed in milliseconds). -*/ ); - x_selection_timeout = 0; -} - -void -Xatoms_of_select_x (struct device *d) -{ - Display *D = DEVICE_X_DISPLAY (d); - - /* Non-predefined atoms that we might end up using a lot */ - DEVICE_XATOM_CLIPBOARD (d) = XInternAtom (D, "CLIPBOARD", False); - DEVICE_XATOM_TIMESTAMP (d) = XInternAtom (D, "TIMESTAMP", False); - DEVICE_XATOM_TEXT (d) = XInternAtom (D, "TEXT", False); - DEVICE_XATOM_DELETE (d) = XInternAtom (D, "DELETE", False); - DEVICE_XATOM_MULTIPLE (d) = XInternAtom (D, "MULTIPLE", False); - DEVICE_XATOM_INCR (d) = XInternAtom (D, "INCR", False); - DEVICE_XATOM_TARGETS (d) = XInternAtom (D, "TARGETS", False); - DEVICE_XATOM_NULL (d) = XInternAtom (D, "NULL", False); - DEVICE_XATOM_ATOM_PAIR (d) = XInternAtom (D, "ATOM_PAIR", False); - DEVICE_XATOM_COMPOUND_TEXT (d) = XInternAtom (D, "COMPOUND_TEXT", False); - - /* #### I don't like the looks of this... what is it for? - ajh */ - DEVICE_XATOM_EMACS_TMP (d) = XInternAtom (D, "_EMACS_TMP_", False); -} diff -r 12e008d41344 -r 697ef44129c6 src/select.c --- a/src/select.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,905 +0,0 @@ -/* Generic selection processing for XEmacs - Copyright (C) 1999 Free Software Foundation, Inc. - Copyright (C) 1999 Andy Piper. - -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 synched with FSF. */ - -#include <config.h> -#include "lisp.h" - -#include "buffer.h" -#include "device.h" -#include "extents.h" -#include "console.h" -#include "objects.h" - -#include "frame.h" -#include "opaque.h" -#include "select.h" - -/* X Atoms */ -Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, - QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, - QATOM_PAIR, QCOMPOUND_TEXT; - -/* Windows clipboard formats */ -Lisp_Object QCF_TEXT, QCF_BITMAP, QCF_METAFILEPICT, QCF_SYLK, QCF_DIF, - QCF_TIFF, QCF_OEMTEXT, QCF_DIB, QCF_PALETTE, QCF_PENDATA, QCF_RIFF, - QCF_WAVE, QCF_UNICODETEXT, QCF_ENHMETAFILE, QCF_HDROP, QCF_LOCALE, - QCF_OWNERDISPLAY, QCF_DSPTEXT, QCF_DSPBITMAP, QCF_DSPMETAFILEPICT, - QCF_DSPENHMETAFILE; - -/* Selection strategy symbols */ -Lisp_Object Qreplace_all, Qreplace_existing; - -/* "Selection owner couldn't convert selection" */ -Lisp_Object Qselection_conversion_error; - -/* A couple of Lisp functions */ -Lisp_Object Qselect_convert_in, Qselect_convert_out; - -/* These are alists whose CARs are selection-types (whose names are the same - as the names of X Atoms or Windows clipboard formats) and whose CDRs are - the names of Lisp functions to call to convert the given Emacs selection - value to a string representing the given selection type. This is for - elisp-level extension of the emacs selection handling. - */ -Lisp_Object Vselection_converter_out_alist; -Lisp_Object Vselection_converter_in_alist; -Lisp_Object Vselection_appender_alist; -Lisp_Object Vselection_buffer_killed_alist; -Lisp_Object Vselection_coercible_types; - -Lisp_Object Vlost_selection_hooks; - -/* This is an association list whose elements are of the form - ( selection-name selection-value selection-timestamp ) - selection-name is a lisp symbol, whose name is the name of an X Atom. - selection-value is a list of cons pairs that emacs owns for that selection. - Each pair consists of (type . value), where type is nil or a - selection data type, and value is any type of Lisp object. - selection-timestamp is the time at which emacs began owning this selection, - as a cons of two 16-bit numbers (making a 32 bit time). - If there is an entry in this alist, then it can be assumed that emacs owns - that selection. - The only (eq) parts of this list that are visible from elisp are the - selection-values. - */ -Lisp_Object Vselection_alist; - -/* Given a selection-name and desired type, this looks up our local copy of - the selection value and converts it to the type. */ -static Lisp_Object -get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type) -{ - Lisp_Object local_value = assq_no_quit (selection_symbol, Vselection_alist); - - if (!NILP (local_value)) - { - Lisp_Object value_list = XCAR (XCDR (local_value)); - Lisp_Object value; - - /* First try to find an entry of the appropriate type */ - value = assq_no_quit (target_type, value_list); - - if (!NILP (value)) - return XCDR (value); - } - - return Qnil; -} - -/* #### Should perhaps handle 'MULTIPLE. The code below is now completely - broken due to a re-organization of get_local_selection, but I've left - it here should anyone show an interest - ajh */ -#if 0 - else if (CONSP (target_type) && - XCAR (target_type) == QMULTIPLE) - { - Lisp_Object pairs = XCDR (target_type); - int len = XVECTOR_LENGTH (pairs); - int i; - /* If the target is MULTIPLE, then target_type looks like - (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ]) - We modify the second element of each pair in the vector and - return it as [[SELECTION1 <value1>] [SELECTION2 <value2>] ... ] - */ - for (i = 0; i < len; i++) - { - Lisp_Object pair = XVECTOR_DATA (pairs) [i]; - XVECTOR_DATA (pair) [1] = - x_get_local_selection (XVECTOR_DATA (pair) [0], - XVECTOR_DATA (pair) [1]); - } - return pairs; - } -#endif - -DEFUN ("own-selection-internal", Fown_selection_internal, 2, 5, 0, /* -Assert a selection of the given NAME with the given VALUE, and -optional window-system DATA-TYPE. HOW-TO-ADD specifies how the -selection will be combined with any existing selection(s) - see -`own-selection' for more information. -NAME is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. -VALUE is typically a string, or a cons of two markers, but may be -anything that the functions on selection-converter-out-alist know about. -*/ - (selection_name, selection_value, how_to_add, data_type, device)) -{ - Lisp_Object selection_time, selection_data, prev_value = Qnil, - value_list = Qnil; - Lisp_Object prev_real_value = Qnil; - struct gcpro gcpro1; - - CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("selection-value may not be nil."); - - if (NILP (device)) - device = Fselected_device (Qnil); - - if (!EQ (how_to_add, Qappend) && !EQ (how_to_add, Qt) - && !EQ (how_to_add, Qreplace_existing) - && !EQ (how_to_add, Qreplace_all) && !NILP (how_to_add)) - error ("how-to-add must be nil, append, replace_all, " - "replace_existing or t."); - -#ifdef MULE - if (NILP (data_type)) - data_type = QCOMPOUND_TEXT; -#else - if (NILP (data_type)) - data_type = QSTRING; -#endif - - /* Examine the how-to-add argument */ - if (EQ (how_to_add, Qreplace_all) || NILP (how_to_add)) - { - Lisp_Object local_selection_data = assq_no_quit (selection_name, - Vselection_alist); - - if (!NILP (local_selection_data)) - { - /* Don't use Fdelq() as that may QUIT;. */ - if (EQ (local_selection_data, Fcar (Vselection_alist))) - Vselection_alist = Fcdr (Vselection_alist); - else - { - Lisp_Object rest; - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) - if (EQ (local_selection_data, Fcar (XCDR (rest)))) - { - XCDR (rest) = Fcdr (XCDR (rest)); - break; - } - } - } - } - else - { - /* Look for a previous value */ - prev_value = assq_no_quit (selection_name, Vselection_alist); - - if (!NILP (prev_value)) - value_list = XCAR (XCDR (prev_value)); - - if (!NILP (value_list)) - prev_real_value = assq_no_quit (data_type, value_list); - } - - /* Append values if necessary */ - if (!NILP (value_list) && (EQ (how_to_add, Qappend) || EQ (how_to_add, Qt))) - { - /* Did we have anything of this type previously? */ - if (!NILP (prev_real_value)) - { - if ((NILP (data_type) && STRINGP (selection_value) - && STRINGP (XCDR (prev_real_value))) - || !NILP (data_type)) - { - Lisp_Object function = assq_no_quit (data_type, - Vselection_appender_alist); - - if (NILP (function)) - error ("cannot append selections of supplied types."); - - function = XCDR (function); - - selection_value = call4 (function, - selection_name, - data_type, - XCDR (prev_real_value), - selection_value); - - if (NILP (selection_value)) - error ("cannot append selections of supplied types."); - } - else - error ("cannot append selections of supplied types."); - } - - selection_data = Fcons (data_type, selection_value); - value_list = Fcons (selection_data, value_list); - } - - if (!NILP (prev_real_value)) - { - Lisp_Object rest; /* We know it isn't the CAR, so it's easy. */ - - /* Delete the old type entry from the list */ - for (rest = value_list; !NILP (rest); rest = Fcdr (rest)) - if (EQ (prev_real_value, Fcar (XCDR (rest)))) - { - XCDR (rest) = Fcdr (XCDR (rest)); - break; - } - } - else - { - value_list = Fcons (Fcons (data_type, selection_value), - value_list); - } - - /* Complete the local cache update; note that we destructively - modify the current list entry if there is one */ - if (NILP (prev_value)) - { - selection_data = list3 (selection_name, value_list, Qnil); - Vselection_alist = Fcons (selection_data, Vselection_alist); - } - else - { - selection_data = prev_value; - Fsetcar (XCDR (selection_data), value_list); - } - - GCPRO1 (selection_data); - - /* have to do device specific stuff last so that methods can access the - selection_alist */ - if (HAS_DEVMETH_P (XDEVICE (device), own_selection)) - selection_time = DEVMETH (XDEVICE (device), own_selection, - (selection_name, selection_value, - how_to_add, data_type)); - else - selection_time = Qnil; - - Fsetcar (XCDR (XCDR (selection_data)), selection_time); - - UNGCPRO; - - return selection_value; -} - -DEFUN ("register-selection-data-type", Fregister_selection_data_type, 1,2,0, /* -Register a new selection data type DATA-TYPE, optionally on the specified -DEVICE. Returns the device-specific data type identifier, or nil if the -device does not support this feature or the registration fails. */ - (data_type, device)) -{ - /* Check arguments */ - CHECK_STRING (data_type); - - if (NILP (device)) - device = Fselected_device (Qnil); - - if (HAS_DEVMETH_P (XDEVICE (device), register_selection_data_type)) - return DEVMETH (XDEVICE (device), register_selection_data_type, - (data_type)); - else - return Qnil; -} - -DEFUN ("selection-data-type-name", Fselection_data_type_name, 1, 2, 0, /* -Retrieve the name of the specified selection data type DATA-TYPE, optionally -on the specified DEVICE. Returns either a string or a symbol on success, and -nil if the device does not support this feature or the type is not known. */ - (data_type, device)) -{ - if (NILP (device)) - device = Fselected_device (Qnil); - - if (HAS_DEVMETH_P (XDEVICE (device), selection_data_type_name)) - return DEVMETH (XDEVICE (device), selection_data_type_name, (data_type)); - else - return Qnil; -} - -DEFUN ("available-selection-types", Favailable_selection_types, 1, 2, 0, /* -Retrieve a list of currently available types of selection associated with -the given SELECTION-NAME, optionally on the specified DEVICE. This list -does not take into account any possible conversions that might take place, -so it should be taken as a minimal estimate of what is available. -*/ - (selection_name, device)) -{ - Lisp_Object types = Qnil, rest; - struct gcpro gcpro1; - - CHECK_SYMBOL (selection_name); - - if (NILP (device)) - device = Fselected_device (Qnil); - - GCPRO1 (types); - - /* First check the device */ - if (HAS_DEVMETH_P (XDEVICE (device), available_selection_types)) - types = DEVMETH (XDEVICE (device), available_selection_types, - (selection_name)); - - /* Now look in the list */ - rest = assq_no_quit (selection_name, Vselection_alist); - - if (NILP (rest)) - { - UNGCPRO; - - return types; - } - - /* Examine the types and cons them onto the front of the list */ - for (rest = XCAR (XCDR (rest)); !NILP (rest); rest = XCDR (rest)) - { - Lisp_Object value = XCDR (XCAR (rest)); - Lisp_Object type = XCAR (XCAR (rest)); - - types = Fcons (type, types); - - if ((STRINGP (value) || EXTENTP (value)) - && (NILP (type) || EQ (type, QSTRING) - || EQ (type, QTEXT) || EQ (type, QCOMPOUND_TEXT))) - types = Fcons (QTEXT, Fcons (QCOMPOUND_TEXT, Fcons (QSTRING, types))); - else if (INTP (value) && NILP (type)) - types = Fcons (QINTEGER, types); - else if (SYMBOLP (value) && NILP (type)) - types = Fcons (QATOM, types); - } - - UNGCPRO; - - return types; -} - -/* remove a selection from our local copy - */ -void -handle_selection_clear (Lisp_Object selection_symbol) -{ - Lisp_Object local_selection_data = assq_no_quit (selection_symbol, - Vselection_alist); - - /* Well, we already believe that we don't own it, so that's just fine. */ - if (NILP (local_selection_data)) return; - - /* Otherwise, we're really honest and truly being told to drop it. - Don't use Fdelq() as that may QUIT;. - */ - if (EQ (local_selection_data, Fcar (Vselection_alist))) - Vselection_alist = Fcdr (Vselection_alist); - else - { - Lisp_Object rest; - for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) - if (EQ (local_selection_data, Fcar (XCDR (rest)))) - { - XCDR (rest) = Fcdr (XCDR (rest)); - break; - } - } - - /* Let random lisp code notice that the selection has been stolen. - */ - { - Lisp_Object rest; - Lisp_Object val = Vlost_selection_hooks; - if (!UNBOUNDP (val) && !NILP (val)) - { - if (CONSP (val) && !EQ (XCAR (val), Qlambda)) - for (rest = val; !NILP (rest); rest = Fcdr (rest)) - call1 (Fcar (rest), selection_symbol); - else - call1 (val, selection_symbol); - } - } -} - -DEFUN ("disown-selection-internal", Fdisown_selection_internal, 1, 3, 0, /* -If we own the named selection, then disown it (make there be no selection). -*/ - (selection_name, selection_time, device)) -{ - if (NILP (assq_no_quit (selection_name, Vselection_alist))) - return Qnil; /* Don't disown the selection when we're not the owner. */ - - if (NILP (device)) - device = Fselected_device (Qnil); - - MAYBE_DEVMETH (XDEVICE (device), disown_selection, - (selection_name, selection_time)); - - handle_selection_clear (selection_name); - - return Qt; -} - -DEFUN ("selection-owner-p", Fselection_owner_p, 0, 1, 0, /* -Return t if current emacs process owns the given Selection. -The arg should be the name of the selection in question, typically one of -the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol -nil is the same as PRIMARY, and t is the same as SECONDARY.) -*/ - (selection)) -{ - CHECK_SYMBOL (selection); - if (EQ (selection, Qnil)) selection = QPRIMARY; - else if (EQ (selection, Qt)) selection = QSECONDARY; - - return NILP (Fassq (selection, Vselection_alist)) ? Qnil : Qt; -} - -DEFUN ("selection-exists-p", Fselection_exists_p, 0, 3, 0, /* -Whether there is an owner for the given Selection. -The arg should be the name of the selection in question, typically one of -the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol -nil is the same as PRIMARY, and t is the same as SECONDARY.) -Optionally the DEVICE and the window-system DATA-TYPE may be specified. -*/ - (selection, data_type, device)) -{ - CHECK_SYMBOL (selection); - if (NILP (data_type) - && !NILP (Fselection_owner_p (selection))) - return Qt; - - if (NILP (device)) - device = Fselected_device (Qnil); - - return HAS_DEVMETH_P (XDEVICE (device), selection_exists_p) ? - DEVMETH (XDEVICE (device), selection_exists_p, (selection, data_type)) - : Qnil; -} - -/* Get the timestamp of the given selection */ -DEFUN ("get-selection-timestamp", Fget_selection_timestamp, 1, 1, 0, /* -Return the timestamp associated with the specified SELECTION, if it exists. -Note that the timestamp is a device-specific object, and may not actually be -visible from Lisp. -*/ - (selection)) -{ - Lisp_Object local_value = assq_no_quit (selection, Vselection_alist); - - if (!NILP (local_value)) - return XCAR (XCDR (XCDR (local_value))); - - return Qnil; -} - -/* Request the selection value from the owner. If we are the owner, - simply return our selection value. If we are not the owner, this - will block until all of the data has arrived. - */ -DEFUN ("get-selection-internal", Fget_selection_internal, 2, 3, 0, /* -Return text selected from some window-system window. -SELECTION_SYMBOL is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. -TARGET_TYPE is the type of data desired, typically STRING or COMPOUND_TEXT. -Under Mule, if the resultant data comes back as 8-bit data in type -TEXT or COMPOUND_TEXT, it will be decoded as Compound Text. -*/ - (selection_symbol, target_type, device)) -{ - /* This function can GC */ - Lisp_Object val = Qnil, element = Qnil; - struct gcpro gcpro1, gcpro2, gcpro3; - GCPRO3 (target_type, val, element); - CHECK_SYMBOL (selection_symbol); - - if (NILP (device)) - device = Fselected_device (Qnil); - -#ifdef MULE - if (NILP (target_type)) - target_type = QCOMPOUND_TEXT; -#else - if (NILP (target_type)) - target_type = QSTRING; -#endif - -#if 0 /* #### MULTIPLE doesn't work yet and probably never will */ - if (CONSP (target_type) && - XCAR (target_type) == QMULTIPLE) - { - CHECK_VECTOR (XCDR (target_type)); - /* So we don't destructively modify this... */ - target_type = copy_multiple_data (target_type); - } -#endif - - /* Used to check that target_type was a symbol. This is no longer - necessarily the case, because the type might be registered with - the device (in which case target_type would be a device-specific - identifier - probably an integer) - ajh */ - - val = get_local_selection (selection_symbol, target_type); - - if (NILP (val) && (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection))) - { - val = DEVMETH (XDEVICE (device), get_foreign_selection, - (selection_symbol, target_type)); - } - - if (NILP (val)) - { - /* Still nothing. Try coercion. */ - - /* Try looking in selection-coercible-types to see if any of - them are present for this selection. We try them *in order*; - the first for which a conversion succeeds gets returned. */ - EXTERNAL_LIST_LOOP_2 (element, Vselection_coercible_types) - { - val = get_local_selection (selection_symbol, element); - - if (NILP (val)) - continue; - - /* #### Probably should have a Qselection_coercion_alist and a - select-coerce function. */ - val = call3 (Qselect_convert_out, - selection_symbol, target_type, val); - - if (!NILP (val)) - break; - } - } - - if (NILP (val)) - { - UNGCPRO; - - return Qnil; - } - - /* Used to call clean_local_selection here... but that really belonged - in Lisp (so the equivalent is now built-in to the INTEGER conversion - function select-convert-from-integer) - ajh */ - - UNGCPRO; - return val; -} - -/* These two are convenient interfaces to the lisp code in select.el; - this way we can rename them easily rather than having to hunt everywhere. - Also, this gives us access to get_local_selection so that convert_out - can retrieve the internal selection value automatically if passed a - value of Qnil. */ -Lisp_Object -select_convert_in (Lisp_Object selection, - Lisp_Object type, - Lisp_Object value) -{ - return call3 (Qselect_convert_in, selection, type, value); -} - -Lisp_Object -select_convert_out (Lisp_Object selection, - Lisp_Object type, - Lisp_Object value) -{ - if (NILP (value)) - value = get_local_selection (selection, type); - - if (NILP (value)) - { - Lisp_Object element = Qnil, ret; - struct gcpro gcpro1; - GCPRO1 (element); - - { - /* Try looking in selection-coercible-types to see if any of - them are present for this selection. We try them *in order*; - the first for which a conversion succeeds gets returned. */ - EXTERNAL_LIST_LOOP_2 (element, Vselection_coercible_types) - { - value = get_local_selection (selection, element); - - if (NILP (value)) - continue; - - ret = call3 (Qselect_convert_out, selection, type, value); - - if (!NILP (ret)) - { - UNGCPRO; - - return ret; - } - } - } - - UNGCPRO; - - return Qnil; - } - - return call3 (Qselect_convert_out, selection, type, value); -} - - -/* Gets called from kill-buffer; this lets us dispose of buffer-dependent - selections (or alternatively make them independent of the buffer) when - it gets vaped. */ -void -select_notify_buffer_kill (Lisp_Object buffer) -{ - Lisp_Object rest; - struct gcpro gcpro1, gcpro2, gcpro3; - - /* For each element of Vselection_alist */ - for (rest = Vselection_alist; - !NILP (rest);) - { - Lisp_Object selection, values, prev = Qnil; - - selection = XCAR (rest); - - for (values = XCAR (XCDR (selection)); - !NILP (values); - values = XCDR (values)) - { - Lisp_Object value, handler_fn; - - /* Extract the (type . value) pair. */ - value = XCAR (values); - - /* Find the handler function (if any). */ - handler_fn = Fcdr (Fassq (XCAR (value), - Vselection_buffer_killed_alist)); - - if (!NILP (handler_fn)) - { - Lisp_Object newval; - - /* Protect ourselves, just in case some tomfool calls - own-selection from with the buffer-killed handler, then - causes a GC. Just as a note, *don't do this*. */ - GCPRO3 (rest, values, value); - - newval = call4 (handler_fn, XCAR (selection), XCAR (value), - XCDR (value), buffer); - - UNGCPRO; - - /* Set or delete the value (by destructively modifying - the list). */ - if (!NILP (newval)) - { - Fsetcdr (value, newval); - - prev = values; - } - else - { - if (NILP (prev)) - Fsetcar (XCDR (selection), XCDR (values)); - else - Fsetcdr (prev, XCDR (values)); - } - } - else - prev = values; - } - - /* If we have no values for this selection */ - if (NILP (XCAR (XCDR (selection)))) - { - /* Move on to the next element *first* */ - rest = XCDR (rest); - - /* Protect it and disown this selection */ - GCPRO1 (rest); - - Fdisown_selection_internal (XCAR (selection), Qnil, Qnil); - - UNGCPRO; - } - else - rest = XCDR (rest); - } -} - - -void -syms_of_select (void) -{ - DEFSUBR (Fown_selection_internal); - DEFSUBR (Fget_selection_internal); - DEFSUBR (Fselection_exists_p); - DEFSUBR (Fget_selection_timestamp); - DEFSUBR (Fdisown_selection_internal); - DEFSUBR (Fselection_owner_p); - DEFSUBR (Favailable_selection_types); - DEFSUBR (Fregister_selection_data_type); - DEFSUBR (Fselection_data_type_name); - - /* Lisp Functions */ - defsymbol (&Qselect_convert_in, "select-convert-in"); - defsymbol (&Qselect_convert_out, "select-convert-out"); - - /* X Atoms */ - defsymbol (&QPRIMARY, "PRIMARY"); - defsymbol (&QSECONDARY, "SECONDARY"); - defsymbol (&QSTRING, "STRING"); - defsymbol (&QINTEGER, "INTEGER"); - defsymbol (&QCLIPBOARD, "CLIPBOARD"); - defsymbol (&QTIMESTAMP, "TIMESTAMP"); - defsymbol (&QTEXT, "TEXT"); - defsymbol (&QDELETE, "DELETE"); - defsymbol (&QMULTIPLE, "MULTIPLE"); - defsymbol (&QINCR, "INCR"); - defsymbol (&QEMACS_TMP, "_EMACS_TMP_"); - defsymbol (&QTARGETS, "TARGETS"); - defsymbol (&QATOM, "ATOM"); - defsymbol (&QATOM_PAIR, "ATOM_PAIR"); - defsymbol (&QCOMPOUND_TEXT, "COMPOUND_TEXT"); - defsymbol (&QNULL, "NULL"); - - /* Windows formats - these all start with CF_ */ - defsymbol (&QCF_TEXT, "CF_TEXT"); - defsymbol (&QCF_BITMAP, "CF_BITMAP"); - defsymbol (&QCF_METAFILEPICT, "CF_METAFILEPICT"); - defsymbol (&QCF_SYLK, "CF_SYLK"); - defsymbol (&QCF_DIF, "CF_DIF"); - defsymbol (&QCF_TIFF, "CF_TIFF"); - defsymbol (&QCF_OEMTEXT, "CF_OEMTEXT"); - defsymbol (&QCF_DIB, "CF_DIB"); - defsymbol (&QCF_PALETTE, "CF_PALETTE"); - defsymbol (&QCF_PENDATA, "CF_PENDATA"); - defsymbol (&QCF_RIFF, "CF_RIFF"); - defsymbol (&QCF_WAVE, "CF_WAVE"); - defsymbol (&QCF_UNICODETEXT, "CF_UNICODETEXT"); - defsymbol (&QCF_ENHMETAFILE, "CF_ENHMETAFILE"); - defsymbol (&QCF_HDROP, "CF_HDROP"); - defsymbol (&QCF_LOCALE, "CF_LOCALE"); - defsymbol (&QCF_OWNERDISPLAY, "CF_OWNERDISPLAY"); - defsymbol (&QCF_DSPTEXT, "CF_DSPTEXT"); - defsymbol (&QCF_DSPBITMAP, "CF_DSPBITMAP"); - defsymbol (&QCF_DSPMETAFILEPICT, "CF_DSPMETAFILEPICT"); - defsymbol (&QCF_DSPENHMETAFILE, "CF_DSPENHMETAFILE"); - - /* Selection strategies */ - defsymbol (&Qreplace_all, "replace-all"); - defsymbol (&Qreplace_existing, "replace-existing"); - - deferror (&Qselection_conversion_error, - "selection-conversion-error", - "selection-conversion error", Qio_error); -} - -void -vars_of_select (void) -{ - Vselection_alist = Qnil; - staticpro (&Vselection_alist); - - DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_out_alist /* -An alist associating selection-types (such as STRING and TIMESTAMP) with -functions. This is an alias for `selection-converter-out-alist', and should -be considered obsolete. Use the new name instead. */ ); - - DEFVAR_LISP ("selection-converter-out-alist", - &Vselection_converter_out_alist /* -An alist associating selection-types (such as STRING and TIMESTAMP) with -functions. These functions will be called with three args: the name -of the selection (typically PRIMARY, SECONDARY, or CLIPBOARD); a -desired type to which the selection should be converted; and the local -selection value (whatever had been passed to `own-selection'). - -The return type of these functions depends upon the device in question; -for mswindows, a string should be returned containing data in the requested -format, or nil to indicate that the conversion could not be done. Additionally, -it is permissible to return a cons of the form (DATA-TYPE . STRING) suggesting -a new data type to use instead. - -For X, the return value should be one of: - --- nil (the conversion could not be done) --- a cons of a symbol and any of the following values; the symbol - explicitly specifies the type that will be sent. --- a string (If the type is not specified, then if Mule support exists, - the string will be converted to Compound Text and sent in - the 'COMPOUND_TEXT format; otherwise (no Mule support), - the string will be left as-is and sent in the 'STRING - format. If the type is specified, the string will be - left as-is (or converted to binary format under Mule). - In all cases, 8-bit data it sent.) --- a character (With Mule support, will be converted to Compound Text - whether or not a type is specified. If a type is not - specified, a type of 'STRING or 'COMPOUND_TEXT will be - sent, as for strings.) --- the symbol 'NULL (Indicates that there is no meaningful return value. - Empty 32-bit data with a type of 'NULL will be sent.) --- a symbol (Will be converted into an atom. If the type is not specified, - a type of 'ATOM will be sent.) --- an integer (Will be converted into a 16-bit or 32-bit integer depending - on the value. If the type is not specified, a type of - 'INTEGER will be sent.) --- a cons (HIGH . LOW) of integers (Will be converted into a 32-bit integer. - If the type is not specified, a type of - 'INTEGER will be sent.) --- a vector of symbols (Will be converted into a list of atoms. If the type - is not specified, a type of 'ATOM will be sent.) --- a vector of integers (Will be converted into a list of 16-bit integers. - If the type is not specified, a type of 'INTEGER - will be sent.) --- a vector of integers and/or conses (HIGH . LOW) of integers - (Will be converted into a list of 16-bit integers. - If the type is not specified, a type of 'INTEGER - will be sent.) -*/ ); - Vselection_converter_out_alist = Qnil; - - DEFVAR_LISP ("selection-converter-in-alist", - &Vselection_converter_in_alist /* -An alist associating selection-types (such as STRING and TIMESTAMP) with -functions. These functions will be called with three args: the name -of the selection (typically PRIMARY, SECONDARY or CLIPBOARD); the -type from which the selection should be converted; and the selection -value. These functions should return a suitable representation of the -value, or nil to indicate that the conversion was not possible. - -See also `selection-converter-out-alist'. */ ); - Vselection_converter_in_alist = Qnil; - - DEFVAR_LISP ("selection-appender-alist", - &Vselection_appender_alist /* -An alist associating selection-types (such as STRING and TIMESTAMP) with -functions. These functions will be called with four args; the name -of the selection (typically PRIMARY, SECONDARY or CLIPBOARD); the type -of the selection; and two selection values. The functions are expected to -return a value representing the catenation of the two values, or nil to -indicate that this was not possible. */ ); - Vselection_appender_alist = Qnil; - - DEFVAR_LISP ("selection-buffer-killed-alist", - &Vselection_buffer_killed_alist /* -An alist associating selection-types (such as STRING and TIMESTAMP) with -functions. These functions will be called whenever a buffer is killed, -with four args: the name of the selection (typically PRIMARY, SECONDARY -or CLIPBOARD); the type of the selection; the value of the selection; and -the buffer that has just been killed. These functions should return a new -selection value, or nil to indicate that the selection value should be -deleted. */ ); - Vselection_buffer_killed_alist = Qnil; - - DEFVAR_LISP ("selection-coercible-types", - &Vselection_coercible_types /* -A list of selection types that are coercible---that is, types that may be -automatically converted to another type. Selection values with types in this -list may be subject to conversion attempts to other types. */ ); - Vselection_coercible_types = Qnil; - - DEFVAR_LISP ("lost-selection-hooks", &Vlost_selection_hooks /* -A function or functions to be called after we have been notified -that we have lost the selection. The function(s) will be called with one -argument, a symbol naming the selection (typically PRIMARY, SECONDARY, or -CLIPBOARD). -*/ ); - Vlost_selection_hooks = Qunbound; -} diff -r 12e008d41344 -r 697ef44129c6 src/select.h --- a/src/select.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* Generic select data structures functions - Copyright (C) 1999 Andy Piper - -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_select_h_ -#define INCLUDED_select_h_ - -/* X Atoms */ -extern Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, - QTIMESTAMP, QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, - QNULL, QATOM_PAIR, QCOMPOUND_TEXT; - -/* Windows clipboard formats */ -extern Lisp_Object QCF_TEXT, QCF_BITMAP, QCF_METAFILEPICT, QCF_SYLK, QCF_DIF, - QCF_TIFF, QCF_OEMTEXT, QCF_DIB, QCF_PALETTE, QCF_PENDATA, QCF_RIFF, - QCF_WAVE, QCF_UNICODETEXT, QCF_ENHMETAFILE, QCF_HDROP, QCF_LOCALE, - QCF_OWNERDISPLAY, QCF_DSPTEXT, QCF_DSPBITMAP, QCF_DSPMETAFILEPICT, - QCF_DSPENHMETAFILE; - -/* Selection strategies */ -extern Lisp_Object Qreplace_all, Qreplace_existing, Qappend; - -/* "Selection owner couldn't convert selection" */ -extern Lisp_Object Qselection_conversion_error; - -/* Selection input & output */ -Lisp_Object select_convert_in (Lisp_Object selection, - Lisp_Object type, - Lisp_Object value); -Lisp_Object select_convert_out (Lisp_Object selection, - Lisp_Object type, - Lisp_Object value); - -/* Notifications */ -void handle_selection_clear (Lisp_Object selection_symbol); - -void select_notify_buffer_kill (Lisp_Object buffer); - -/* Lisp functions we export for other files' use */ -EXFUN (Fregister_selection_data_type, 2); -EXFUN (Fselection_data_type_name, 2); -EXFUN (Favailable_selection_types, 2); -EXFUN (Fselection_owner_p, 1); -EXFUN (Fselection_exists_p, 3); -EXFUN (Fget_selection_timestamp, 1); - -#endif /* INCLUDED_select_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/sgiplay.c --- a/src/sgiplay.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sgiplay.c Mon Aug 13 11:20:41 2007 +0200 @@ -363,7 +363,7 @@ static int st_ulaw_to_linear (int u) { - static const short table[] = {0,132,396,924,1980,4092,8316,16764}; + static CONST short table[] = {0,132,396,924,1980,4092,8316,16764}; int u1 = ~u; short exponent = (u1 >> 4) & 0x07; int mantissa = u1 & 0x0f; diff -r 12e008d41344 -r 697ef44129c6 src/sheap.c --- a/src/sheap.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sheap.c Mon Aug 13 11:20:41 2007 +0200 @@ -19,12 +19,13 @@ 02111-1307, USA.*/ #include <config.h> +#include <stdio.h> #include "lisp.h" - +#include <stddef.h> #include <unistd.h> #include <sheap-adjust.h> -#define STATIC_HEAP_BASE 0x800000 +#define STATIC_HEAP_BASE 0x600000 #define STATIC_HEAP_SLOP 0x40000 #define STATIC_HEAP_SIZE \ (STATIC_HEAP_BASE + SHEAP_ADJUSTMENT + STATIC_HEAP_SLOP) @@ -40,7 +41,6 @@ int static_heap_initialized=0; int static_heap_dumped=0; -void* more_static_core ( ptrdiff_t increment ); void* more_static_core ( ptrdiff_t increment ) { int size = (int) increment; @@ -59,7 +59,7 @@ static_heap_ptr=static_heap_base; static_heap_size=STATIC_HEAP_SIZE - (static_heap_base-static_heap_buffer); -#ifdef CYGWIN +#ifdef __CYGWIN32__ sbrk(BLOCKSIZE); /* force space for fork to work */ #endif static_heap_initialized=1; @@ -103,7 +103,7 @@ return result; } -static void +void sheap_adjust_h () { FILE *stream = fopen ("sheap-adjust.h", "w"); @@ -120,32 +120,3 @@ fclose (stream); } -void report_sheap_usage (int die_if_pure_storage_exceeded); -void -report_sheap_usage (int die_if_pure_storage_exceeded) -{ - int rc = 0; - - size_t lost = (STATIC_HEAP_BASE + STATIC_HEAP_SLOP + SHEAP_ADJUSTMENT) - - (static_heap_ptr - static_heap_buffer); - char buf[200]; - sprintf (buf, "Static heap usage: %ld of %ld", - (long) (static_heap_ptr - static_heap_buffer), - (long) (STATIC_HEAP_BASE + STATIC_HEAP_SLOP + SHEAP_ADJUSTMENT)); - - if (lost > STATIC_HEAP_SLOP) { - sprintf (buf + strlen (buf), " -- %ldk wasted", (long)(lost/1024)); - if (die_if_pure_storage_exceeded) { - sheap_adjust_h(); - rc = -1; - } - message ("%s", buf); - } - - if (rc < 0) { - unlink("SATISFIED"); - fatal ("Static heap size adjusted, Don't Panic! I will restart the `make'"); - } -} - - diff -r 12e008d41344 -r 697ef44129c6 src/signal.c --- a/src/signal.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/signal.c Mon Aug 13 11:20:41 2007 +0200 @@ -31,7 +31,10 @@ #include "syssignal.h" #include "systime.h" -#include "sysfile.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <errno.h> /* Set to 1 when a quit-check signal (either a SIGIO interrupt or the asynch. timeout for poll-for-quit) occurs. The QUITP @@ -177,7 +180,7 @@ it needs to stay the way it is. */ quit_check_signal_happened = 1; -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT can_break_system_calls = 0; #else /* can_break_system_calls is set when we want to break out of @@ -417,16 +420,19 @@ stdout_out ("you can continue or abort.\n"); #endif /* not SIGTSTP */ stdout_out ("Auto-save? (y or n) "); + fflush (stdout); if (((c = getc (stdin)) & ~040) == 'Y') Fdo_auto_save (Qnil, Qnil); while (c != '\n') c = getc (stdin); stdout_out ("Abort (and dump core)? (y or n) "); + fflush (stdout); if (((c = getc (stdin)) & ~040) == 'Y') abort (); while (c != '\n') c = getc (stdin); stdout_out ("Continuing...\n"); + fflush (stdout); reinit_initial_console (); MARK_FRAME_CHANGED (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (CONSOLE_SELECTED_DEVICE diff -r 12e008d41344 -r 697ef44129c6 src/sound.c --- a/src/sound.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sound.c Mon Aug 13 11:20:41 2007 +0200 @@ -25,7 +25,6 @@ Hacked on quite a bit by various others. */ #include <config.h> -#include <time.h> #include "lisp.h" #include "buffer.h" @@ -37,26 +36,25 @@ #include "redisplay.h" #include "sysdep.h" -#include "sysfile.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #ifdef HAVE_NATIVE_SOUND -# include "sysproc.h" -# include "nativesound.h" -#endif - -#ifdef HAVE_ESD_SOUND -extern int esd_play_sound_file (char *file, int vol); -extern int esd_play_sound_data (unsigned char *data, size_t length, int vol); -# define DEVICE_CONNECTED_TO_ESD_P(x) 1 /* FIXME: better check */ +# include <netdb.h> #endif int bell_volume; -int bell_inhibit_time; Lisp_Object Vsound_alist; Lisp_Object Vsynchronous_sounds; Lisp_Object Vnative_sound_only_on_console; Lisp_Object Q_volume, Q_pitch, Q_duration, Q_sound; +/* These are defined in the appropriate file (sunplay.c, sgiplay.c, + or hpplay.c). */ + +extern void play_sound_file (char *name, int volume); +extern void play_sound_data (unsigned char *data, int length, int volume); #ifdef HAVE_NAS_SOUND extern int nas_play_sound_file (char *name, int volume); @@ -79,8 +77,7 @@ { /* This function can call lisp */ int vol; -#if defined (HAVE_NATIVE_SOUND) || defined (HAVE_NAS_SOUND) \ - || defined (HAVE_ESD_SOUND) +#if defined (HAVE_NATIVE_SOUND) || defined (HAVE_NAS_SOUND) struct device *d = decode_device (device); #endif struct gcpro gcpro1; @@ -120,42 +117,19 @@ { char *fileext; - TO_EXTERNAL_FORMAT (LISP_STRING, file, - C_STRING_ALLOCA, fileext, - Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext); /* #### NAS code should allow specification of a device. */ if (nas_play_sound_file (fileext, vol)) return Qnil; } #endif /* HAVE_NAS_SOUND */ -#ifdef HAVE_ESD_SOUND - if (DEVICE_CONNECTED_TO_ESD_P (d)) - { - char *fileext; - int result; - - TO_EXTERNAL_FORMAT (LISP_STRING, file, - C_STRING_ALLOCA, fileext, - Qfile_name); - - /* #### ESD uses alarm(). But why should we also stop SIGIO? */ - stop_interrupts (); - result = esd_play_sound_file (fileext, vol); - start_interrupts (); - if (result) - return Qnil; - } -#endif /* HAVE_ESD_SOUND */ - #ifdef HAVE_NATIVE_SOUND if (NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d)) { - const char *fileext; + CONST char *fileext; - TO_EXTERNAL_FORMAT (LISP_STRING, file, - C_STRING_ALLOCA, fileext, - Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext); /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */ stop_interrupts (); @@ -317,55 +291,29 @@ #ifdef HAVE_NAS_SOUND if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) { - const Extbyte *soundext; + CONST Extbyte *soundext; Extcount soundextlen; - TO_EXTERNAL_FORMAT (LISP_STRING, sound, - ALLOCA, (soundext, soundextlen), - Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); if (nas_play_sound_data ((unsigned char*)soundext, soundextlen, vol)) return Qnil; } #endif /* HAVE_NAS_SOUND */ -#ifdef HAVE_ESD_SOUND - if (DEVICE_CONNECTED_TO_ESD_P (d) && STRINGP (sound)) - { - Extbyte *soundext; - Extcount soundextlen; - int succes; - - TO_EXTERNAL_FORMAT (LISP_STRING, sound, ALLOCA, (soundext, soundextlen), - Qbinary); - - /* #### ESD uses alarm(). But why should we also stop SIGIO? */ - stop_interrupts (); - succes = esd_play_sound_data (soundext, soundextlen, vol); - start_interrupts (); - QUIT; - if(succes) - return Qnil; - } -#endif /* HAVE_ESD_SOUND */ - #ifdef HAVE_NATIVE_SOUND if ((NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d)) && STRINGP (sound)) { - const Extbyte *soundext; + CONST Extbyte *soundext; Extcount soundextlen; - int succes; - TO_EXTERNAL_FORMAT (LISP_STRING, sound, - ALLOCA, (soundext, soundextlen), - Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */ stop_interrupts (); - succes = play_sound_data ((unsigned char*)soundext, soundextlen, vol); + play_sound_data ((unsigned char*)soundext, soundextlen, vol); start_interrupts (); QUIT; - if (succes) - return Qnil; + return Qnil; } #endif /* HAVE_NATIVE_SOUND */ @@ -399,28 +347,25 @@ */ (arg, sound, device)) { - static time_t last_bell_time; - static struct device *last_bell_device; - time_t now; - struct device *d = decode_device (device); + struct device *d = decode_device (device); XSETDEVICE (device, d); - now = time (0); + /* #### This is utterly disgusting, and is probably a remnant from + legacy code that used `ding'+`message' to signal error instead + calling `error'. As a result, there is no way to beep from Lisp + directly, without also invoking this aspect. Maybe we should + define a `ring-bell' function that simply beeps on the console, + which `ding' should invoke? --hniksic */ if (NILP (arg) && !NILP (Vexecuting_macro)) /* Stop executing a keyboard macro. */ error ("Keyboard macro terminated by a command ringing the bell"); - - if (d == last_bell_device && now-last_bell_time < bell_inhibit_time) - return Qnil; - else if (!NILP (Vvisible_bell) && DEVMETH (d, flash, (d))) + else if (visible_bell && DEVMETH (d, flash, (d))) ; else Fplay_sound (sound, Qnil, device); - - last_bell_time = now; - last_bell_device = d; - return Qnil; + + return Qnil; } DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /* @@ -456,11 +401,13 @@ static void init_nas_sound (struct device *d) { + char *error; + #ifdef HAVE_X_WINDOWS if (DEVICE_X_P (d)) { - char *err_message = nas_init_play (DEVICE_X_DISPLAY (d)); - DEVICE_CONNECTED_TO_NAS_P (d) = !err_message; + error = nas_init_play (DEVICE_X_DISPLAY (d)); + DEVICE_CONNECTED_TO_NAS_P (d) = !error; /* Print out the message? */ } #endif /* HAVE_X_WINDOWS */ @@ -580,19 +527,11 @@ #ifdef HAVE_NAS_SOUND Fprovide (intern ("nas-sound")); #endif -#ifdef HAVE_ESD_SOUND - Fprovide (intern ("esd-sound")); -#endif DEFVAR_INT ("bell-volume", &bell_volume /* *How loud to be, from 0 to 100. */ ); bell_volume = 50; - - DEFVAR_INT ("bell-inhibit-time", &bell_inhibit_time /* -*Don't ring the bell on the same device more than once within this many seconds. -*/ ); - bell_inhibit_time = 0; DEFVAR_LISP ("sound-alist", &Vsound_alist /* An alist associating names with sounds. @@ -620,8 +559,8 @@ load-sound-file. Caveats: - - XEmacs must be built with sound support for your system. Not all - systems support sound. + - You can only play audio data if running on the console screen of a + Sun SparcStation, SGI, or HP9000s700. - The pitch, duration, and volume options are available everywhere, but many X servers ignore the `pitch' option. diff -r 12e008d41344 -r 697ef44129c6 src/specifier.c --- a/src/specifier.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/specifier.c Mon Aug 13 11:20:41 2007 +0200 @@ -41,7 +41,7 @@ #include "rangetab.h" Lisp_Object Qspecifierp; -Lisp_Object Qprepend, Qremove_tag_set_prepend, Qremove_tag_set_append; +Lisp_Object Qprepend, Qappend, Qremove_tag_set_prepend, Qremove_tag_set_append; Lisp_Object Qremove_locale, Qremove_locale_type, Qremove_all; Lisp_Object Qfallback; @@ -64,28 +64,7 @@ Dynarr_declare (specifier_type_entry); } specifier_type_entry_dynarr; -static specifier_type_entry_dynarr *the_specifier_type_entry_dynarr; - -static const struct lrecord_description ste_description_1[] = { - { XD_LISP_OBJECT, offsetof (specifier_type_entry, symbol) }, - { XD_STRUCT_PTR, offsetof (specifier_type_entry, meths), 1, &specifier_methods_description }, - { XD_END } -}; - -static const struct struct_description ste_description = { - sizeof (specifier_type_entry), - ste_description_1 -}; - -static const struct lrecord_description sted_description_1[] = { - XD_DYNARR_DESC (specifier_type_entry_dynarr, &ste_description), - { XD_END } -}; - -static const struct struct_description sted_description = { - sizeof (specifier_type_entry_dynarr), - sted_description_1 -}; +specifier_type_entry_dynarr *the_specifier_type_entry_dynarr; static Lisp_Object Vspecifier_type_list; @@ -162,7 +141,7 @@ !NILP (rest); rest = XSPECIFIER (rest)->next_specifier) { - Lisp_Specifier *sp = XSPECIFIER (rest); + struct Lisp_Specifier *sp = XSPECIFIER (rest); /* This effectively changes the specifier specs. However, there's no need to call recompute_cached_specifier_everywhere() or the @@ -189,7 +168,7 @@ !NILP (rest); rest = XSPECIFIER (rest)->next_specifier) { - Lisp_Specifier *sp = XSPECIFIER (rest); + struct Lisp_Specifier *sp = XSPECIFIER (rest); /* Make sure we're actually going to be changing something. Fremove_specifier() always calls @@ -201,19 +180,19 @@ } static Lisp_Object -mark_specifier (Lisp_Object obj) +mark_specifier (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Specifier *specifier = XSPECIFIER (obj); - - mark_object (specifier->global_specs); - mark_object (specifier->device_specs); - mark_object (specifier->frame_specs); - mark_object (specifier->window_specs); - mark_object (specifier->buffer_specs); - mark_object (specifier->magic_parent); - mark_object (specifier->fallback); + struct Lisp_Specifier *specifier = XSPECIFIER (obj); + + markobj (specifier->global_specs); + markobj (specifier->device_specs); + markobj (specifier->frame_specs); + markobj (specifier->window_specs); + markobj (specifier->buffer_specs); + markobj (specifier->magic_parent); + markobj (specifier->fallback); if (!GHOST_SPECIFIER_P (XSPECIFIER (obj))) - MAYBE_SPECMETH (specifier, mark, (obj)); + MAYBE_SPECMETH (specifier, mark, (obj, markobj)); return Qnil; } @@ -237,24 +216,24 @@ */ void -prune_specifiers (void) +prune_specifiers (int (*obj_marked_p) (Lisp_Object)) { Lisp_Object rest, prev = Qnil; for (rest = Vall_specifiers; - !NILP (rest); + !GC_NILP (rest); rest = XSPECIFIER (rest)->next_specifier) { - if (! marked_p (rest)) + if (! obj_marked_p (rest)) { - Lisp_Specifier* sp = XSPECIFIER (rest); + struct Lisp_Specifier* sp = XSPECIFIER (rest); /* A bit of assertion that we're removing both parts of the magic one altogether */ - assert (!MAGIC_SPECIFIER_P(sp) - || (BODILY_SPECIFIER_P(sp) && marked_p (sp->fallback)) - || (GHOST_SPECIFIER_P(sp) && marked_p (sp->magic_parent))); + assert (!GC_MAGIC_SPECIFIER_P(sp) + || (GC_BODILY_SPECIFIER_P(sp) && obj_marked_p (sp->fallback)) + || (GC_GHOST_SPECIFIER_P(sp) && obj_marked_p (sp->magic_parent))); /* This specifier is garbage. Remove it from the list. */ - if (NILP (prev)) + if (GC_NILP (prev)) Vall_specifiers = sp->next_specifier; else XSPECIFIER (prev)->next_specifier = sp->next_specifier; @@ -267,7 +246,7 @@ static void print_specifier (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Specifier *sp = XSPECIFIER (obj); + struct Lisp_Specifier *sp = XSPECIFIER (obj); char buf[100]; int count = specpdl_depth (); Lisp_Object the_specs; @@ -299,9 +278,9 @@ static void finalize_specifier (void *header, int for_disksave) { - Lisp_Specifier *sp = (Lisp_Specifier *) header; + struct Lisp_Specifier *sp = (struct Lisp_Specifier *) header; /* don't be snafued by the disksave finalization. */ - if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching) + if (!for_disksave && !GC_GHOST_SPECIFIER_P(sp) && sp->caching) { xfree (sp->caching); sp->caching = 0; @@ -311,8 +290,8 @@ static int specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { - Lisp_Specifier *s1 = XSPECIFIER (obj1); - Lisp_Specifier *s2 = XSPECIFIER (obj2); + struct Lisp_Specifier *s1 = XSPECIFIER (obj1); + struct Lisp_Specifier *s2 = XSPECIFIER (obj2); int retval; Lisp_Object old_inhibit_quit = Vinhibit_quit; @@ -340,7 +319,7 @@ static unsigned long specifier_hash (Lisp_Object obj, int depth) { - Lisp_Specifier *s = XSPECIFIER (obj); + struct Lisp_Specifier *s = XSPECIFIER (obj); /* specifier hashing is a bit problematic because there are so many places where data can be stored. We pick what are perhaps @@ -354,61 +333,23 @@ } static size_t -sizeof_specifier (const void *header) +sizeof_specifier (CONST void *header) { - if (GHOST_SPECIFIER_P ((Lisp_Specifier *) header)) - return offsetof (Lisp_Specifier, data); + if (GHOST_SPECIFIER_P ((struct Lisp_Specifier *) header)) + return sizeof (struct Lisp_Specifier); else { - const Lisp_Specifier *p = (const Lisp_Specifier *) header; - return offsetof (Lisp_Specifier, data) + p->methods->extra_data_size; + CONST struct Lisp_Specifier *p = (CONST struct Lisp_Specifier *) header; + return sizeof (*p) + p->methods->extra_data_size - 1; } } -static const struct lrecord_description specifier_methods_description_1[] = { - { XD_LISP_OBJECT, offsetof (struct specifier_methods, predicate_symbol) }, - { XD_END } -}; - -const struct struct_description specifier_methods_description = { - sizeof (struct specifier_methods), - specifier_methods_description_1 -}; - -static const struct lrecord_description specifier_caching_description_1[] = { - { XD_END } -}; - -static const struct struct_description specifier_caching_description = { - sizeof (struct specifier_caching), - specifier_caching_description_1 -}; - -static const struct lrecord_description specifier_description[] = { - { XD_STRUCT_PTR, offsetof (Lisp_Specifier, methods), 1, &specifier_methods_description }, - { XD_LO_LINK, offsetof (Lisp_Specifier, next_specifier) }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, global_specs) }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, device_specs) }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, frame_specs) }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, window_specs) }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, buffer_specs) }, - { XD_STRUCT_PTR, offsetof (Lisp_Specifier, caching), 1, &specifier_caching_description }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) }, - { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) }, - { XD_SPECIFIER_END } -}; - -const struct lrecord_description specifier_empty_extra_description[] = { - { XD_END } -}; - DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, mark_specifier, print_specifier, finalize_specifier, specifier_equal, specifier_hash, - specifier_description, sizeof_specifier, - Lisp_Specifier); + struct Lisp_Specifier); /************************************************************************/ /* Creating specifiers */ @@ -472,9 +413,9 @@ size_t data_size, int call_create_meth) { Lisp_Object specifier; - Lisp_Specifier *sp = (Lisp_Specifier *) - alloc_lcrecord (offsetof (Lisp_Specifier, data) + data_size, - &lrecord_specifier); + struct Lisp_Specifier *sp = (struct Lisp_Specifier *) + alloc_lcrecord (sizeof (struct Lisp_Specifier) + + data_size - 1, &lrecord_specifier); sp->methods = spec_meths; sp->global_specs = Qnil; @@ -532,52 +473,29 @@ A specifier is an object that can be used to keep track of a property whose value can be per-buffer, per-window, per-frame, or per-device, -and can further be restricted to a particular console-type or -device-class. Specifiers are used, for example, for the various -built-in properties of a face; this allows a face to have different -values in different frames, buffers, etc. - -When speaking of the value of a specifier, it is important to -distinguish between the *setting* of a specifier, called an -\"instantiator\", and the *actual value*, called an \"instance\". You -put various possible instantiators (i.e. settings) into a specifier -and associate them with particular locales (buffer, window, frame, -device, global), and then the instance (i.e. actual value) is -retrieved in a specific domain (window, frame, device) by looking -through the possible instantiators (i.e. settings). This process is -called \"instantiation\". - -To put settings into a specifier, use `set-specifier', or the -lower-level functions `add-spec-to-specifier' and -`add-spec-list-to-specifier'. You can also temporarily bind a setting -to a specifier using `let-specifier'. To retrieve settings, use -`specifier-specs', or its lower-level counterpart -`specifier-spec-list'. To determine the actual value, use -`specifier-instance'. - -For more information, see `set-specifier', `specifier-instance', +and can further be restricted to a particular console-type or device-class. +Specifiers are used, for example, for the various built-in properties of a +face; this allows a face to have different values in different frames, +buffers, etc. For more information, see `specifier-instance', `specifier-specs', and `add-spec-to-specifier'; or, for a detailed -description of specifiers, including how exactly the instantiation -process works, see the chapter on specifiers in the XEmacs Lisp -Reference Manual. +description of specifiers, including how they are instantiated over a +particular domain (i.e. how their value in that domain is determined), +see the chapter on specifiers in the XEmacs Lisp Reference Manual. TYPE specifies the particular type of specifier, and should be one of -the symbols 'generic, 'integer, 'natnum, 'boolean, 'color, 'font, -'image, 'face-boolean, 'display-table, 'gutter, 'gutter-size, -'gutter-visible or 'toolbar. - -For more information on particular types of specifiers, see the -functions `make-generic-specifier', `make-integer-specifier', -`make-natnum-specifier', `make-boolean-specifier', -`make-color-specifier', `make-font-specifier', `make-image-specifier', -`make-face-boolean-specifier', `make-gutter-size-specifier', -`make-gutter-visible-specifier', `default-toolbar', `default-gutter', -and `current-display-table'. +the symbols 'generic, 'integer, 'boolean, 'color, 'font, 'image, +'face-boolean, or 'toolbar. + +For more information on particular types of specifiers, see the functions +`generic-specifier-p', `integer-specifier-p', `boolean-specifier-p', +`color-specifier-p', `font-specifier-p', `image-specifier-p', +`face-boolean-specifier-p', and `toolbar-specifier-p'. */ (type)) { /* This function can GC */ - struct specifier_methods *meths = decode_specifier_type (type, ERROR_ME); + struct specifier_methods *meths = decode_specifier_type (type, + ERROR_ME); return make_specifier (meths); } @@ -630,19 +548,15 @@ DEFUN ("valid-specifier-domain-p", Fvalid_specifier_domain_p, 1, 1, 0, /* Return t if DOMAIN is a valid specifier domain. A domain is used to instance a specifier (i.e. determine the specifier's -value in that domain). Valid domains are image instances, windows, frames, -and devices. \(nil is not valid.) image instances are pseudo-domains since -instantiation will actually occur in the window the image instance itself is -instantiated in. +value in that domain). Valid domains are windows, frames, and devices. +\(nil is not valid.) */ (domain)) { /* This cannot GC. */ return ((DEVICEP (domain) && DEVICE_LIVE_P (XDEVICE (domain))) || (FRAMEP (domain) && FRAME_LIVE_P (XFRAME (domain))) || - (WINDOWP (domain) && WINDOW_LIVE_P (XWINDOW (domain))) || - /* #### get image instances out of domains! */ - IMAGE_INSTANCEP (domain)) + (WINDOWP (domain) && WINDOW_LIVE_P (XWINDOW (domain)))) ? Qt : Qnil; } @@ -754,7 +668,7 @@ signal_simple_error ("Invalid specifier domain", domain); } -Lisp_Object +static Lisp_Object decode_domain (Lisp_Object domain) { if (NILP (domain)) @@ -1673,23 +1587,17 @@ { /* The return value of this function must be GCPRO'd. */ Lisp_Object rest, list_to_build_up = Qnil; - Lisp_Specifier *sp = XSPECIFIER (specifier); + struct Lisp_Specifier *sp = XSPECIFIER (specifier); struct gcpro gcpro1; GCPRO1 (list_to_build_up); LIST_LOOP (rest, inst_list) { Lisp_Object tag_set = XCAR (XCAR (rest)); + Lisp_Object instantiator = Fcopy_tree (XCDR (XCAR (rest)), Qt); Lisp_Object sub_inst_list = Qnil; - Lisp_Object instantiator; struct gcpro ngcpro1, ngcpro2; - if (HAS_SPECMETH_P (sp, copy_instantiator)) - instantiator = SPECMETH (sp, copy_instantiator, - (XCDR (XCAR (rest)))); - else - instantiator = Fcopy_tree (XCDR (XCAR (rest)), Qt); - NGCPRO2 (instantiator, sub_inst_list); /* call the will-add method; it may GC */ sub_inst_list = HAS_SPECMETH_P (sp, going_to_add) ? @@ -1730,7 +1638,7 @@ specifier_add_spec (Lisp_Object specifier, Lisp_Object locale, Lisp_Object inst_list, enum spec_add_meth add_meth) { - Lisp_Specifier *sp = XSPECIFIER (specifier); + struct Lisp_Specifier *sp = XSPECIFIER (specifier); enum spec_locale_type type = locale_type_from_locale (locale); Lisp_Object *orig_inst_list, tem; Lisp_Object list_to_build_up = Qnil; @@ -2401,7 +2309,7 @@ void set_specifier_fallback (Lisp_Object specifier, Lisp_Object fallback) { - Lisp_Specifier *sp = XSPECIFIER (specifier); + struct Lisp_Specifier *sp = XSPECIFIER (specifier); assert (SPECIFIERP (fallback) || !NILP (Fvalid_inst_list_p (fallback, Fspecifier_type (specifier)))); if (SPECIFIERP (fallback)) @@ -2451,7 +2359,7 @@ Lisp_Object depth) { /* This function can GC */ - Lisp_Specifier *sp; + struct Lisp_Specifier *sp; Lisp_Object device; Lisp_Object rest; int count = specpdl_depth (); @@ -2460,7 +2368,7 @@ GCPRO2 (specifier, inst_list); sp = XSPECIFIER (specifier); - device = DOMAIN_DEVICE (domain); + device = DFW_DEVICE (domain); if (no_quit) /* The instantiate method is allowed to call eval. Since it @@ -2534,26 +2442,22 @@ Lisp_Object device = Qnil; Lisp_Object tag = Qnil; struct device *d; - Lisp_Specifier *sp; + struct Lisp_Specifier *sp; sp = XSPECIFIER (specifier); /* Attempt to determine buffer, window, frame, and device from the domain. */ - /* #### get image instances out of domains! */ - if (IMAGE_INSTANCEP (domain)) - window = DOMAIN_WINDOW (domain); - else if (WINDOWP (domain)) + if (WINDOWP (domain)) window = domain; else if (FRAMEP (domain)) frame = domain; else if (DEVICEP (domain)) device = domain; else - /* dmoore writes: [dammit, this should just signal an error or something - shouldn't it?] - - No. Errors are handled in Lisp primitives implementation. + /* #### dmoore - dammit, this should just signal an error or something + shouldn't it? + #### No. Errors are handled in Lisp primitives implementation. Invalid domain is a design error here - kkm. */ abort (); @@ -2581,7 +2485,7 @@ goto do_fallback; } - retry: +retry: /* First see if we can generate one from the window specifiers. */ if (!NILP (window)) CHECK_INSTANCE_ENTRY (window, matchspec, LOCALE_WINDOW); @@ -2600,7 +2504,7 @@ /* Last and least try the global specifiers. */ CHECK_INSTANCE_ENTRY (Qglobal, matchspec, LOCALE_GLOBAL); - do_fallback: +do_fallback: /* We're out of specifiers and we still haven't generated an instance. At least try the fallback ... If this fails, then we just return Qunbound. */ @@ -2741,7 +2645,7 @@ (specifier, domain, inst_list, default_)) { Lisp_Object val = Qunbound; - Lisp_Specifier *sp = XSPECIFIER (specifier); + struct Lisp_Specifier *sp = XSPECIFIER (specifier); struct gcpro gcpro1; Lisp_Object built_up_list = Qnil; @@ -2773,7 +2677,7 @@ (specifier, matchspec, domain, inst_list, default_)) { Lisp_Object val = Qunbound; - Lisp_Specifier *sp = XSPECIFIER (specifier); + struct Lisp_Specifier *sp = XSPECIFIER (specifier); struct gcpro gcpro1; Lisp_Object built_up_list = Qnil; @@ -2813,7 +2717,7 @@ (Lisp_Object specifier, struct frame *f, Lisp_Object oldval)) { - Lisp_Specifier *sp = XSPECIFIER (specifier); + struct Lisp_Specifier *sp = XSPECIFIER (specifier); assert (!GHOST_SPECIFIER_P (sp)); if (!sp->caching) @@ -2847,13 +2751,6 @@ method. */ location = (Lisp_Object *) ((char *) w + XSPECIFIER (specifier)->caching->offset_into_struct_window); - /* #### What's the point of this check, other than to optimize image - instance instantiation? Unless you specify a caching instantiate - method the instantiation that specifier_instance will do will - always create a new copy. Thus EQ will always fail. Unfortunately - calling equal is no good either as this doesn't take into account - things attached to the specifier - for instance strings on - extents. --andyp */ if (!EQ (newval, *location)) { Lisp_Object oldval = *location; @@ -2988,9 +2885,8 @@ What really needs to be done is to write a function `make-specifier-type' that creates new specifier types. - - #### [I'll look into this for 19.14.] Well, sometime. (Currently - May 2000, 21.2 is in development. 19.14 was released in June 1996.) */ + #### I'll look into this for 19.14. + */ "A generic specifier is a generalized kind of specifier with user-defined\n" "semantics. The instantiator can be any kind of Lisp object, and the\n" @@ -3027,8 +2923,8 @@ DEFUN ("generic-specifier-p", Fgeneric_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a generic specifier. -See `make-generic-specifier' for a description of possible generic -instantiators. +A generic specifier allows any kind of Lisp object as an instantiator, +and returns back the Lisp object unchanged when it is instantiated. */ (object)) { @@ -3050,9 +2946,6 @@ DEFUN ("integer-specifier-p", Finteger_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is an integer specifier. - -See `make-integer-specifier' for a description of possible integer -instantiators. */ (object)) { @@ -3073,9 +2966,6 @@ DEFUN ("natnum-specifier-p", Fnatnum_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a natnum (non-negative-integer) specifier. - -See `make-natnum-specifier' for a description of possible natnum -instantiators. */ (object)) { @@ -3097,9 +2987,6 @@ DEFUN ("boolean-specifier-p", Fboolean_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a boolean specifier. - -See `make-boolean-specifier' for a description of possible boolean -instantiators. */ (object)) { @@ -3112,11 +2999,11 @@ DEFINE_SPECIFIER_TYPE (display_table); -#define VALID_SINGLE_DISPTABLE_INSTANTIATOR_P(instantiator) \ - (VECTORP (instantiator) \ - || (CHAR_TABLEP (instantiator) \ - && (XCHAR_TABLE_TYPE (instantiator) == CHAR_TABLE_TYPE_CHAR \ - || XCHAR_TABLE_TYPE (instantiator) == CHAR_TABLE_TYPE_GENERIC)) \ +#define VALID_SINGLE_DISPTABLE_INSTANTIATOR_P(instantiator) \ + (VECTORP (instantiator) \ + || (CHAR_TABLEP (instantiator) \ + && (XCHAR_TABLE_TYPE (instantiator) == CHAR_TABLE_TYPE_CHAR \ + || XCHAR_TABLE_TYPE (instantiator) == CHAR_TABLE_TYPE_GENERIC)) \ || RANGE_TABLEP (instantiator)) static void @@ -3148,9 +3035,6 @@ DEFUN ("display-table-specifier-p", Fdisplay_table_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a display-table specifier. - -See `current-display-table' for a description of possible display-table -instantiators. */ (object)) { @@ -3165,8 +3049,6 @@ void syms_of_specifier (void) { - INIT_LRECORD_IMPLEMENTATION (specifier); - defsymbol (&Qspecifierp, "specifierp"); defsymbol (&Qconsole_type, "console-type"); @@ -3229,6 +3111,7 @@ /* locales are defined in general.c. */ defsymbol (&Qprepend, "prepend"); + defsymbol (&Qappend, "append"); defsymbol (&Qremove_tag_set_prepend, "remove-tag-set-prepend"); defsymbol (&Qremove_tag_set_append, "remove-tag-set-append"); defsymbol (&Qremove_locale, "remove-locale"); @@ -3242,7 +3125,6 @@ specifier_type_create (void) { the_specifier_type_entry_dynarr = Dynarr_new (specifier_type_entry); - dumpstruct (&the_specifier_type_entry_dynarr, &sted_description); Vspecifier_type_list = Qnil; staticpro (&Vspecifier_type_list); @@ -3267,16 +3149,6 @@ } void -reinit_specifier_type_create (void) -{ - REINITIALIZE_SPECIFIER_TYPE (generic); - REINITIALIZE_SPECIFIER_TYPE (integer); - REINITIALIZE_SPECIFIER_TYPE (natnum); - REINITIALIZE_SPECIFIER_TYPE (boolean); - REINITIALIZE_SPECIFIER_TYPE (display_table); -} - -void vars_of_specifier (void) { Vcached_specifiers = Qnil; @@ -3285,7 +3157,6 @@ /* Do NOT mark through this, or specifiers will never be GC'd. This is the same deal as for weak hash tables. */ Vall_specifiers = Qnil; - pdump_wire_list (&Vall_specifiers); Vuser_defined_tags = Qnil; staticpro (&Vuser_defined_tags); diff -r 12e008d41344 -r 697ef44129c6 src/specifier.h --- a/src/specifier.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/specifier.h Mon Aug 13 11:20:41 2007 +0200 @@ -21,8 +21,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_specifier_h_ -#define INCLUDED_specifier_h_ +#ifndef _XEMACS_SPECIFIER_H_ +#define _XEMACS_SPECIFIER_H_ /* MAGIC SPECIFIERS @@ -83,11 +83,9 @@ same time. */ -extern const struct struct_description specifier_methods_description; - struct specifier_methods { - const char *name; + CONST char *name; Lisp_Object predicate_symbol; /* Implementation specific methods: */ @@ -97,7 +95,7 @@ /* Mark method: Mark any lisp object within specifier data structure. Not required if no specifier data are Lisp_Objects. */ - void (*mark_method) (Lisp_Object specifier); + void (*mark_method) (Lisp_Object specifier, void (*markobj) (Lisp_Object)); /* Equal method: Compare two specifiers. This is called after ensuring that the two specifiers are of the same type, and have @@ -124,13 +122,6 @@ valid. */ void (*validate_method) (Lisp_Object instantiator); - - /* Copy method: Given an instantiator, copy the bits that we need to - for this specifier type. - - If this function is not present, then Fcopy_tree is used. */ - Lisp_Object (*copy_instantiator_method) (Lisp_Object instantiator); - /* Validate-matchspec method: Given a matchspec, verify that it's valid for this specifier type. If not, signal an error. @@ -194,7 +185,6 @@ void (*after_change_method) (Lisp_Object specifier, Lisp_Object locale); - const struct lrecord_description *extra_description; int extra_data_size; }; @@ -237,12 +227,12 @@ /* type-specific extra data attached to a specifier */ char data[1]; }; -typedef struct Lisp_Specifier Lisp_Specifier; -DECLARE_LRECORD (specifier, Lisp_Specifier); -#define XSPECIFIER(x) XRECORD (x, specifier, Lisp_Specifier) +DECLARE_LRECORD (specifier, struct Lisp_Specifier); +#define XSPECIFIER(x) XRECORD (x, specifier, struct Lisp_Specifier) #define XSETSPECIFIER(x, p) XSETRECORD (x, p, specifier) #define SPECIFIERP(x) RECORDP (x, specifier) +#define GC_SPECIFIERP(x) GC_RECORDP (x, specifier) #define CHECK_SPECIFIER(x) CHECK_RECORD (x, specifier) #define CONCHECK_SPECIFIER(x) CONCHECK_RECORD (x, specifier) @@ -253,24 +243,21 @@ #define SPECMETH(sp, m, args) (((sp)->methods->m##_method) args) /* Call a void-returning specifier method, if it exists. */ -#define MAYBE_SPECMETH(sp, m, args) do { \ - Lisp_Specifier *maybe_specmeth_sp = (sp); \ - if (HAS_SPECMETH_P (maybe_specmeth_sp, m)) \ - SPECMETH (maybe_specmeth_sp, m, args); \ +#define MAYBE_SPECMETH(sp, m, args) do { \ + struct Lisp_Specifier *maybe_specmeth_sp = (sp); \ + if (HAS_SPECMETH_P (maybe_specmeth_sp, m)) \ + SPECMETH (maybe_specmeth_sp, m, args); \ } while (0) /***** Defining new specifier types *****/ -#define specifier_data_offset (offsetof (Lisp_Specifier, data)) -extern const struct lrecord_description specifier_empty_extra_description[]; - #ifdef ERROR_CHECK_TYPECHECK #define DECLARE_SPECIFIER_TYPE(type) \ extern struct specifier_methods * type##_specifier_methods; \ -INLINE_HEADER struct type##_specifier * \ -error_check_##type##_specifier_data (Lisp_Specifier *sp); \ -INLINE_HEADER struct type##_specifier * \ -error_check_##type##_specifier_data (Lisp_Specifier *sp) \ +INLINE struct type##_specifier * \ +error_check_##type##_specifier_data (struct Lisp_Specifier *sp); \ +INLINE struct type##_specifier * \ +error_check_##type##_specifier_data (struct Lisp_Specifier *sp) \ { \ if (SPECIFIERP (sp->magic_parent)) \ { \ @@ -282,36 +269,20 @@ assert (SPECIFIER_TYPE_P (sp, type)); \ return (struct type##_specifier *) sp->data; \ } \ -INLINE_HEADER Lisp_Specifier * \ -error_check_##type##_specifier_type (Lisp_Object obj); \ -INLINE_HEADER Lisp_Specifier * \ -error_check_##type##_specifier_type (Lisp_Object obj) \ -{ \ - Lisp_Specifier *sp = XSPECIFIER (obj); \ - assert (SPECIFIER_TYPE_P (sp, type)); \ - return sp; \ -} \ DECLARE_NOTHING #else -#define DECLARE_SPECIFIER_TYPE(type) \ +#define DECLARE_SPECIFIER_TYPE(type) \ extern struct specifier_methods * type##_specifier_methods #endif /* ERROR_CHECK_TYPECHECK */ -#define DEFINE_SPECIFIER_TYPE(type) \ +#define DEFINE_SPECIFIER_TYPE(type) \ struct specifier_methods * type##_specifier_methods #define INITIALIZE_SPECIFIER_TYPE(type, obj_name, pred_sym) do { \ - type##_specifier_methods = xnew_and_zero (struct specifier_methods); \ - type##_specifier_methods->name = obj_name; \ - type##_specifier_methods->extra_description = \ - specifier_empty_extra_description; \ - defsymbol_nodump (&type##_specifier_methods->predicate_symbol, pred_sym); \ - add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ - dumpstruct (&type##_specifier_methods, &specifier_methods_description); \ -} while (0) - -#define REINITIALIZE_SPECIFIER_TYPE(type) do { \ - staticpro_nodump (&type##_specifier_methods->predicate_symbol); \ + type##_specifier_methods = xnew_and_zero (struct specifier_methods); \ + type##_specifier_methods->name = obj_name; \ + defsymbol (&type##_specifier_methods->predicate_symbol, pred_sym); \ + add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ } while (0) #define INITIALIZE_SPECIFIER_TYPE_WITH_DATA(type, obj_name, pred_sym) \ @@ -319,8 +290,6 @@ INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \ type##_specifier_methods->extra_data_size = \ sizeof (struct type##_specifier); \ - type##_specifier_methods->extra_description = \ - type##_specifier_description; \ } while (0) /* Declare that specifier-type TYPE has method METH; used in @@ -334,13 +303,24 @@ ((sp)->methods == type##_specifier_methods) /* Any of the two of the magic spec */ -#define MAGIC_SPECIFIER_P(sp) (!NILP((sp)->magic_parent)) +#define MAGIC_SPECIFIER_P(sp) \ + (!NILP((sp)->magic_parent)) /* Normal part of the magic specifier */ -#define BODILY_SPECIFIER_P(sp) EQ ((sp)->magic_parent, Qt) +#define BODILY_SPECIFIER_P(sp) \ + (EQ ((sp)->magic_parent, Qt)) /* Ghost part of the magic specifier */ -#define GHOST_SPECIFIER_P(sp) SPECIFIERP((sp)->magic_parent) +#define GHOST_SPECIFIER_P(sp) \ + (SPECIFIERP((sp)->magic_parent)) +/* The same three, when used in GC */ +#define GC_MAGIC_SPECIFIER_P(sp) \ + (!GC_NILP((sp)->magic_parent)) +#define GC_BODILY_SPECIFIER_P(sp) \ + (GC_EQ ((sp)->magic_parent, Qt)) +#define GC_GHOST_SPECIFIER_P(sp) \ + (GC_SPECIFIERP((sp)->magic_parent)) -#define GHOST_SPECIFIER(sp) XSPECIFIER ((sp)->fallback) +#define GHOST_SPECIFIER(sp) \ + (XSPECIFIER ((sp)->fallback)) #ifdef ERROR_CHECK_TYPECHECK # define SPECIFIER_TYPE_DATA(sp, type) \ @@ -353,20 +333,11 @@ : (sp)->data)) #endif -#ifdef ERROR_CHECK_TYPECHECK -# define XSPECIFIER_TYPE(x, type) \ - error_check_##type##_specifier_type (x) -# define XSETSPECIFIER_TYPE(x, p, type) do \ -{ \ - XSETSPECIFIER (x, p); \ - assert (SPECIFIER_TYPEP (XSPECIFIER(x), type)); \ -} while (0) -#else -# define XSPECIFIER_TYPE(x, type) XSPECIFIER (x) -# define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p) -#endif /* ERROR_CHECK_TYPE_CHECK */ +/* #### Need to create ERROR_CHECKING versions of these. */ -#define SPECIFIER_TYPEP(x, type) \ +#define XSPECIFIER_TYPE(x, type) XSPECIFIER (x) +#define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p) +#define SPECIFIER_TYPEP(x, type) \ (SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), type)) #define CHECK_SPECIFIER_TYPE(x, type) do { \ CHECK_SPECIFIER (x); \ @@ -413,48 +384,6 @@ Lisp_Object oldval); }; -/* #### get image instances out of domains! */ - -/* #### I think the following should abort() rather than return nil - when an invalid domain is given; much more likely we'll catch design - errors early. --ben */ - -/* 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 - first. */ -#define DOMAIN_DEVICE(obj) \ - (WINDOWP (obj) ? WINDOW_DEVICE (XWINDOW (obj)) \ - : (FRAMEP (obj) ? FRAME_DEVICE (XFRAME (obj)) \ - : (DEVICEP (obj) ? obj \ - : (IMAGE_INSTANCEP (obj) ? image_instance_device (obj) \ - : Qnil)))) - -#define DOMAIN_FRAME(obj) \ - (WINDOWP (obj) ? WINDOW_FRAME (XWINDOW (obj)) \ - : (FRAMEP (obj) ? obj \ - : (IMAGE_INSTANCEP (obj) ? image_instance_frame (obj) \ - : Qnil))) - -#define DOMAIN_WINDOW(obj) \ - (WINDOWP (obj) ? obj \ - : (IMAGE_INSTANCEP (obj) ? image_instance_window (obj) \ - : Qnil)) - -#define DOMAIN_LIVE_P(obj) \ - (WINDOWP (obj) ? WINDOW_LIVE_P (XWINDOW (obj)) \ - : (FRAMEP (obj) ? FRAME_LIVE_P (XFRAME (obj)) \ - : (DEVICEP (obj) ? DEVICE_LIVE_P (XDEVICE (obj)) \ - : (IMAGE_INSTANCEP (obj) ? image_instance_live_p (obj) \ - : 0)))) - -#define DOMAIN_XDEVICE(obj) \ - (XDEVICE (DOMAIN_DEVICE (obj))) -#define DOMAIN_XFRAME(obj) \ - (XFRAME (DOMAIN_FRAME (obj))) -#define DOMAIN_XWINDOW(obj) \ - (XWINDOW (DOMAIN_WINDOW (obj))) - EXFUN (Fcopy_specifier, 6); EXFUN (Fmake_specifier, 1); EXFUN (Fset_specifier_dirty_flag, 1); @@ -468,7 +397,6 @@ extern enum spec_add_meth decode_how_to_add_specification (Lisp_Object how_to_add); Lisp_Object decode_specifier_tag_set (Lisp_Object tag_set); -Lisp_Object decode_domain (Lisp_Object domain); void add_entry_to_specifier_type_list (Lisp_Object symbol, struct specifier_methods *meths); @@ -497,7 +425,7 @@ int unlock_ghost_specifiers_protected (void); void cleanup_specifiers (void); -void prune_specifiers (void); +void prune_specifiers (int (*obj_marked_p) (Lisp_Object)); void setup_device_initial_specifier_tags (struct device *d); void kill_specifier_buffer_locals (Lisp_Object buffer); @@ -536,4 +464,4 @@ #define CHECK_DISPLAYTABLE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, display_table) #define CONCHECK_DISPLAYTABLE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, display_table) -#endif /* INCLUDED_specifier_h_ */ +#endif /* _XEMACS_SPECIFIER_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/src-headers --- a/src/src-headers Mon Aug 13 11:19:22 2007 +0200 +++ b/src/src-headers Mon Aug 13 11:20:41 2007 +0200 @@ -28,8 +28,8 @@ ($myName = $0) =~ s@.*/@@; my $usage =" Usage: $myName -Generates header file fragments from the Emacs sources -and writes them to stdout.\n"; +Generates header file fragments from the Emacs sources. +"; die $usage if @ARGV; diff -r 12e008d41344 -r 697ef44129c6 src/strcat.c --- a/src/strcat.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/strcat.c Mon Aug 13 11:20:41 2007 +0200 @@ -27,17 +27,18 @@ the string! This will core dump if the memory following the last byte is not mapped. - Here is a correct version from, glibc 1.09. + Here is a correct version from glibc 1.09. */ char *strcat (char *dest, const char *src); /* Append SRC on the end of DEST. */ +/* CONST IS LOSING, but const is part of the interface of strcat */ char * strcat (char *dest, const char *src) { REGISTER char *s1 = dest; - REGISTER const char *s2 = src; + REGISTER CONST char *s2 = src; char c; /* Find the end of the string. */ diff -r 12e008d41344 -r 697ef44129c6 src/strcmp.c --- a/src/strcmp.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/strcmp.c Mon Aug 13 11:20:41 2007 +0200 @@ -36,6 +36,7 @@ #define HIGH_BIT_P(c) ((c) & hi_bit) #define HAS_ZERO(c) (((((c) + magic) ^ (c)) & not_magic) != not_magic) +/* CONST IS LOSING, but const is part of the interface of strcmp */ int strcmp (const char *x, const char *y) { @@ -43,8 +44,8 @@ return 0; else if (ALIGNED (x) && ALIGNED (y)) { - const unsigned long *x1 = (const unsigned long *) x; - const unsigned long *y1 = (const unsigned long *) y; + CONST unsigned long *x1 = (CONST unsigned long *) x; + CONST unsigned long *y1 = (CONST unsigned long *) y; unsigned long c; unsigned long magic = MAGIC; unsigned long not_magic = ~magic; @@ -58,8 +59,8 @@ return 0; else { - x = (const char *) x1; - y = (const char *) y1; + x = (CONST char *) x1; + y = (CONST char *) y1; goto slow_loop; } } @@ -68,8 +69,8 @@ y1++; } - x = (const char *) x1; - y = (const char *) y1; + x = (CONST char *) x1; + y = (CONST char *) y1; goto slow_loop; } else @@ -90,14 +91,14 @@ int -strncmp (const char *x, const char *y, size_t n) +strncmp (CONST char *x, CONST char *y, size_t n) { if ((x == y) || (n <= 0)) return 0; else if (ALIGNED (x) && ALIGNED (y)) { - const unsigned long *x1 = (const unsigned long *) x; - const unsigned long *y1 = (const unsigned long *) y; + CONST unsigned long *x1 = (CONST unsigned long *) x; + CONST unsigned long *y1 = (CONST unsigned long *) y; unsigned long c; unsigned long magic = MAGIC; unsigned long not_magic = ~magic; @@ -115,8 +116,8 @@ return 0; else { - x = (const char *) x1; - y = (const char *) y1; + x = (CONST char *) x1; + y = (CONST char *) y1; goto slow_loop; } } @@ -125,8 +126,8 @@ y1++; } - x = (const char *) x1; - y = (const char *) y1; + x = (CONST char *) x1; + y = (CONST char *) y1; goto slow_loop; } else diff -r 12e008d41344 -r 697ef44129c6 src/strcpy.c --- a/src/strcpy.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/strcpy.c Mon Aug 13 11:20:41 2007 +0200 @@ -35,6 +35,7 @@ #define HIGH_BIT_P(c) ((c) & hi_bit) #define HAS_ZERO(c) (((((c) + magic) ^ (c)) & not_magic) != not_magic) +/* CONST IS LOSING, but const is part of the interface of strcpy */ char * strcpy (char *to, const char *from) { @@ -55,7 +56,7 @@ if (HAS_ZERO(c)) { to = (char *) to1; - from = (const char *) from1; + from = (CONST char *) from1; goto slow_loop; } else diff -r 12e008d41344 -r 697ef44129c6 src/strftime.c --- a/src/strftime.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/strftime.c Mon Aug 13 11:20:41 2007 +0200 @@ -94,13 +94,13 @@ time_t mktime (); #endif -#if defined(WIN32_NATIVE) || defined(CYGWIN) +#if defined(WINDOWSNT) || defined(__CYGWIN32__) #include <time.h> #else #if defined(HAVE_TZNAME) extern char *tzname[2]; #endif -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ #ifdef emacs #define strftime emacs_strftime @@ -112,12 +112,12 @@ none, blank, zero }; -static char const* const days[] = +static char CONST* CONST days[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; -static char const * const months[] = +static char CONST * CONST months[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" @@ -174,7 +174,7 @@ /* Like strncpy except return the number of characters copied. */ static int -add_str (char *to, const char *from, int max) +add_str (char *to, CONST char *from, int max) { int i; @@ -203,7 +203,7 @@ starting on Sundays. */ static int -sun_week (const struct tm *tm) +sun_week (CONST struct tm *tm) { int dl; @@ -220,7 +220,7 @@ starting on Mondays. */ static int -mon_week (const struct tm *tm) +mon_week (CONST struct tm *tm) { int dl, wday; @@ -233,9 +233,8 @@ } #if !defined(HAVE_TM_ZONE) && !defined(HAVE_TZNAME) -char *zone_name (const struct tm *tp); char * -zone_name (const struct tm *tp) +zone_name (CONST struct tm *tp) { char *timezone (); struct timeval tv; @@ -252,11 +251,11 @@ that were put into STRING, or 0 if the length would have exceeded MAX. */ -size_t strftime (char *string, size_t max, const char *format, - const struct tm *tm); +size_t strftime (char *string, size_t max, CONST char *format, + CONST struct tm *tm); size_t -strftime (char *string, size_t max, const char *format, const struct tm *tm) +strftime (char *string, size_t max, CONST char *format, CONST struct tm *tm) { enum padding pad; /* Type of padding to apply. */ size_t length = 0; /* Characters put in STRING so far. */ diff -r 12e008d41344 -r 697ef44129c6 src/sunOS-fix.c --- a/src/sunOS-fix.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sunOS-fix.c Mon Aug 13 11:20:41 2007 +0200 @@ -36,13 +36,13 @@ #include <stdlib.h> -size_t mbstowcs (wchar_t *foo, const char *bar, size_t baz) +size_t mbstowcs (wchar_t *foo, CONST char *bar, size_t baz) { abort (); return 0; } -size_t wcstombs (char *foo, const wchar_t *bar, size_t baz) +size_t wcstombs (char *foo, CONST wchar_t *bar, size_t baz) { abort (); return 0; diff -r 12e008d41344 -r 697ef44129c6 src/sunplay.c --- a/src/sunplay.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sunplay.c Mon Aug 13 11:20:41 2007 +0200 @@ -33,15 +33,20 @@ #include <sys/fcntl.h> #include <sys/file.h> +/* libaudio.h includes a header which defines CONST. We temporarily + undefine it in order to eliminate a compiler warning. Yes, this is + a gross hack. */ +#undef CONST #include <multimedia/libaudio.h> #include <multimedia/audio_device.h> +#undef CONST +#define CONST const #ifdef emacs # include <config.h> # include "lisp.h" # include "sysdep.h" # include <errno.h> -# include "nativesound.h" #include "syssignal.h" # define perror(string) \ message("audio: %s, %s ", string, strerror (errno)) @@ -58,11 +63,13 @@ #define audio_open() open ("/dev/audio", (O_WRONLY | O_NONBLOCK), 0) -static int initialized_device_p; static int reset_volume_p, reset_device_p; static double old_volume; static Audio_hdr dev_hdr; +void play_sound_file (char *name, int volume); +void play_sound_data (unsigned char *data, int length, int volume); + static int init_device (int volume, unsigned char *data, int fd, unsigned int *header_length) @@ -97,12 +104,11 @@ audio_flush_play (audio_fd); - if (!initialized_device_p || (0 != audio_cmp_hdr (&dev_hdr, &file_hdr))) + if (0 != audio_cmp_hdr (&dev_hdr, &file_hdr)) { Audio_hdr new_hdr; new_hdr = file_hdr; reset_device_p = 1; - initialized_device_p = 1; if (AUDIO_SUCCESS != audio_set_play_config (audio_fd, &new_hdr)) { char buf1 [100], buf2 [100], buf3 [250]; @@ -227,16 +233,15 @@ } -int +void play_sound_data (unsigned char *data, int length, int volume) { int wrtn, start = 0; unsigned int ilen; - int result = 0; audio_fd = -1; - if (length == 0) return 0; + if (length == 0) return; /* this is just to get a better error message */ if (strncmp (".snd\0", (char *) data, 4)) @@ -252,7 +257,10 @@ audio_fd = audio_open (); if (audio_fd < 0) - return 0; + { + perror ("open /dev/audio"); + return; + } /* where to find the proto for signal()... */ sighup_handler = (SIGTYPE (*) (int)) signal (SIGHUP, sighandler); @@ -290,8 +298,6 @@ goto END_OF_PLAY; } - result = 1; - END_OF_PLAY: if (audio_fd > 0) @@ -302,13 +308,11 @@ signal (SIGHUP, sighup_handler); signal (SIGINT, sigint_handler); - - return result; } /* #### sigcontext doesn't exist in Solaris. This should be updated to be correct for Solaris. */ -static SIGTYPE +static void sighandler (int sig) { if (audio_fd > 0) diff -r 12e008d41344 -r 697ef44129c6 src/symbols.c --- a/src/symbols.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/symbols.c Mon Aug 13 11:20:41 2007 +0200 @@ -63,7 +63,7 @@ Lisp_Object Qget_value, Qset_value, Qbound_predicate, Qmake_unbound; Lisp_Object Qlocal_predicate, Qmake_local; -Lisp_Object Qboundp, Qglobally_boundp, Qmakunbound; +Lisp_Object Qboundp, Qfboundp, Qglobally_boundp, Qmakunbound; Lisp_Object Qsymbol_value, Qset, Qdefault_boundp, Qdefault_value; Lisp_Object Qset_default, Qsetq_default; Lisp_Object Qmake_variable_buffer_local, Qmake_local_variable; @@ -87,20 +87,20 @@ static Lisp_Object -mark_symbol (Lisp_Object obj) +mark_symbol (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Symbol *sym = XSYMBOL (obj); + struct Lisp_Symbol *sym = XSYMBOL (obj); Lisp_Object pname; - mark_object (sym->value); - mark_object (sym->function); + markobj (sym->value); + markobj (sym->function); XSETSTRING (pname, sym->name); - mark_object (pname); + markobj (pname); if (!symbol_next (sym)) return sym->plist; else { - mark_object (sym->plist); + markobj (sym->plist); /* Mark the rest of the symbols in the obarray hash-chain */ sym = symbol_next (sym); XSETSYMBOL (obj, sym); @@ -108,45 +108,9 @@ } } -static const struct lrecord_description symbol_description[] = { - { XD_LISP_OBJECT, offsetof (Lisp_Symbol, next) }, - { XD_LISP_OBJECT, offsetof (Lisp_Symbol, name) }, - { XD_LISP_OBJECT, offsetof (Lisp_Symbol, value) }, - { XD_LISP_OBJECT, offsetof (Lisp_Symbol, function) }, - { XD_LISP_OBJECT, offsetof (Lisp_Symbol, plist) }, - { XD_END } -}; - -/* Symbol plists are directly accessible, so we need to protect against - invalid property list structure */ - -static Lisp_Object -symbol_getprop (Lisp_Object symbol, Lisp_Object property) -{ - return external_plist_get (&XSYMBOL (symbol)->plist, property, 0, ERROR_ME); -} - -static int -symbol_putprop (Lisp_Object symbol, Lisp_Object property, Lisp_Object value) -{ - external_plist_put (&XSYMBOL (symbol)->plist, property, value, 0, ERROR_ME); - return 1; -} - -static int -symbol_remprop (Lisp_Object symbol, Lisp_Object property) -{ - return external_remprop (&XSYMBOL (symbol)->plist, property, 0, ERROR_ME); -} - -DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("symbol", symbol, - mark_symbol, print_symbol, - 0, 0, 0, symbol_description, - symbol_getprop, - symbol_putprop, - symbol_remprop, - Fsymbol_plist, - Lisp_Symbol); +DEFINE_BASIC_LRECORD_IMPLEMENTATION ("symbol", symbol, + mark_symbol, print_symbol, 0, 0, 0, + struct Lisp_Symbol); /**********************************************************************/ @@ -177,10 +141,10 @@ } Lisp_Object -intern (const char *str) +intern (CONST char *str) { Bytecount len = strlen (str); - const Bufbyte *buf = (const Bufbyte *) str; + CONST Bufbyte *buf = (CONST Bufbyte *) str; Lisp_Object obarray = Vobarray; if (!VECTORP (obarray) || XVECTOR_LENGTH (obarray) == 0) @@ -204,7 +168,7 @@ (string, obarray)) { Lisp_Object object, *ptr; - Lisp_Symbol *symbol; + struct Lisp_Symbol *symbol; Bytecount len; if (NILP (obarray)) obarray = Vobarray; @@ -253,7 +217,7 @@ /* #### Bug! (intern-soft "nil") returns nil. Perhaps we should add a DEFAULT-IF-NOT-FOUND arg, like in get. */ Lisp_Object tem; - Lisp_String *string; + struct Lisp_String *string; if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray); @@ -283,7 +247,7 @@ (name, obarray)) { Lisp_Object tem; - Lisp_String *string; + struct Lisp_String *string; int hash; if (NILP (obarray)) obarray = Vobarray; @@ -339,10 +303,10 @@ Also store the bucket number in oblookup_last_bucket_number. */ Lisp_Object -oblookup (Lisp_Object obarray, const Bufbyte *ptr, Bytecount size) +oblookup (Lisp_Object obarray, CONST Bufbyte *ptr, Bytecount size) { int hash, obsize; - Lisp_Symbol *tail; + struct Lisp_Symbol *tail; Lisp_Object bucket; if (!VECTORP (obarray) || @@ -376,10 +340,10 @@ #if 0 /* Emacs 19.34 */ int -hash_string (const Bufbyte *ptr, Bytecount len) +hash_string (CONST Bufbyte *ptr, Bytecount len) { - const Bufbyte *p = ptr; - const Bufbyte *end = p + len; + CONST Bufbyte *p = ptr; + CONST Bufbyte *end = p + len; Bufbyte c; int hash = 0; @@ -395,7 +359,7 @@ /* derived from hashpjw, Dragon Book P436. */ int -hash_string (const Bufbyte *ptr, Bytecount len) +hash_string (CONST Bufbyte *ptr, Bytecount len) { int hash = 0; @@ -425,7 +389,7 @@ if (SYMBOLP (tail)) while (1) { - Lisp_Symbol *next; + struct Lisp_Symbol *next; if ((*fn) (tail, arg)) return; next = symbol_next (XSYMBOL (tail)); @@ -801,8 +765,8 @@ SYMVAL_CONST_SPECIFIER_FORWARD: (declare with DEFVAR_SPECIFIER) - Exactly like SYMVAL_CONST_OBJECT_FORWARD except that the error - message you get when attempting to set the value says to use + Exactly like SYMVAL_CONST_OBJECT_FORWARD except that error message + you get when attempting to set the value says to use `set-specifier' instead. SYMVAL_CURRENT_BUFFER_FORWARD: @@ -927,7 +891,8 @@ symbol to operate on. */ static Lisp_Object -mark_symbol_value_buffer_local (Lisp_Object obj) +mark_symbol_value_buffer_local (Lisp_Object obj, + void (*markobj) (Lisp_Object)) { struct symbol_value_buffer_local *bfwd; @@ -937,14 +902,15 @@ #endif bfwd = XSYMBOL_VALUE_BUFFER_LOCAL (obj); - mark_object (bfwd->default_value); - mark_object (bfwd->current_value); - mark_object (bfwd->current_buffer); + markobj (bfwd->default_value); + markobj (bfwd->current_value); + markobj (bfwd->current_buffer); return bfwd->current_alist_element; } static Lisp_Object -mark_symbol_value_lisp_magic (Lisp_Object obj) +mark_symbol_value_lisp_magic (Lisp_Object obj, + void (*markobj) (Lisp_Object)) { struct symbol_value_lisp_magic *bfwd; int i; @@ -954,21 +920,22 @@ bfwd = XSYMBOL_VALUE_LISP_MAGIC (obj); for (i = 0; i < MAGIC_HANDLER_MAX; i++) { - mark_object (bfwd->handler[i]); - mark_object (bfwd->harg[i]); + markobj (bfwd->handler[i]); + markobj (bfwd->harg[i]); } return bfwd->shadowed; } static Lisp_Object -mark_symbol_value_varalias (Lisp_Object obj) +mark_symbol_value_varalias (Lisp_Object obj, + void (*markobj) (Lisp_Object)) { struct symbol_value_varalias *bfwd; assert (XSYMBOL_VALUE_MAGIC_TYPE (obj) == SYMVAL_VARALIAS); bfwd = XSYMBOL_VALUE_VARALIAS (obj); - mark_object (bfwd->shadowed); + markobj (bfwd->shadowed); return bfwd->aliasee; } @@ -985,53 +952,28 @@ write_c_string (buf, printcharfun); } -static const struct lrecord_description symbol_value_forward_description[] = { - { XD_END } -}; - -static const struct lrecord_description symbol_value_buffer_local_description[] = { - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, default_value) }, - { XD_LO_RESET_NIL, offsetof (struct symbol_value_buffer_local, current_value), 3 }, - { XD_END } -}; - -static const struct lrecord_description symbol_value_lisp_magic_description[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (struct symbol_value_lisp_magic, handler), 2*MAGIC_HANDLER_MAX+1 }, - { XD_END } -}; - -static const struct lrecord_description symbol_value_varalias_description[] = { - { XD_LISP_OBJECT, offsetof (struct symbol_value_varalias, aliasee) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_varalias, shadowed) }, - { XD_END } -}; - DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-forward", symbol_value_forward, - 0, + this_one_is_unmarkable, print_symbol_value_magic, 0, 0, 0, - symbol_value_forward_description, struct symbol_value_forward); DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-buffer-local", symbol_value_buffer_local, mark_symbol_value_buffer_local, print_symbol_value_magic, 0, 0, 0, - symbol_value_buffer_local_description, struct symbol_value_buffer_local); DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-lisp-magic", symbol_value_lisp_magic, mark_symbol_value_lisp_magic, print_symbol_value_magic, 0, 0, 0, - symbol_value_lisp_magic_description, struct symbol_value_lisp_magic); DEFINE_LRECORD_IMPLEMENTATION ("symbol-value-varalias", symbol_value_varalias, mark_symbol_value_varalias, print_symbol_value_magic, 0, 0, 0, - symbol_value_varalias_description, struct symbol_value_varalias); @@ -1056,7 +998,7 @@ do_symval_forwarding (Lisp_Object valcontents, struct buffer *buffer, struct console *console) { - const struct symbol_value_forward *fwd; + CONST struct symbol_value_forward *fwd; if (!SYMBOL_VALUE_MAGIC_P (valcontents)) return valcontents; @@ -1124,7 +1066,7 @@ or symbol-value-buffer-local, and if there's a handler, we should have already called it. */ Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int offset = ((char *) symbol_value_forward_forward (fwd) - (char *) &buffer_local_flags); @@ -1166,7 +1108,7 @@ or symbol-value-buffer-local, and if there's a handler, we should have already called it. */ Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int offset = ((char *) symbol_value_forward_forward (fwd) - (char *) &console_local_flags); @@ -1232,7 +1174,7 @@ } else { - const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (ovalue); + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (ovalue); int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, int flags) = symbol_value_forward_magicfun (fwd); @@ -1250,7 +1192,7 @@ if (magicfun) magicfun (sym, &newval, Qnil, 0); *((int *) symbol_value_forward_forward (fwd)) - = !NILP (newval); + = ((NILP (newval)) ? 0 : 1); return; case SYMVAL_OBJECT_FORWARD: @@ -1583,9 +1525,7 @@ /* This can also get called while we're preparing to shutdown. #### What should really happen in that case? Should we actually fix things so we can't get here in that case? */ -#ifndef PDUMP assert (!initialized || preparing_for_armageddon); -#endif con = 0; } @@ -1621,9 +1561,7 @@ /* This can also get called while we're preparing to shutdown. #### What should really happen in that case? Should we actually fix things so we can't get here in that case? */ -#ifndef PDUMP assert (!initialized || preparing_for_armageddon); -#endif con = 0; } @@ -1651,7 +1589,7 @@ (symbol, newval)) { REGISTER Lisp_Object valcontents; - Lisp_Symbol *sym; + struct Lisp_Symbol *sym; /* remember, we're called by Fmakunbound() as well */ CHECK_SYMBOL (symbol); @@ -1675,20 +1613,23 @@ reject_constant_symbols (symbol, newval, 0, UNBOUNDP (newval) ? Qmakunbound : Qset); + retry_2: + switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents)) { case SYMVAL_LISP_MAGIC: { + Lisp_Object retval; + if (UNBOUNDP (newval)) - { - maybe_call_magic_handler (symbol, Qmakunbound, 0); - return XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed = Qunbound; - } + retval = maybe_call_magic_handler (symbol, Qmakunbound, 0); else - { - maybe_call_magic_handler (symbol, Qset, 1, newval); - return XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed = newval; - } + retval = maybe_call_magic_handler (symbol, Qset, 1, newval); + if (!UNBOUNDP (retval)) + return newval; + valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed; + /* semi-change-o */ + goto retry_2; } case SYMVAL_VARALIAS: @@ -1712,7 +1653,7 @@ case SYMVAL_CURRENT_BUFFER_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); @@ -1724,7 +1665,7 @@ case SYMVAL_SELECTED_CONSOLE_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); @@ -1862,7 +1803,7 @@ case SYMVAL_CURRENT_BUFFER_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults) + ((char *)symbol_value_forward_forward (fwd) @@ -1871,7 +1812,7 @@ case SYMVAL_SELECTED_CONSOLE_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults) + ((char *)symbol_value_forward_forward (fwd) @@ -2311,7 +2252,7 @@ case SYMVAL_CURRENT_BUFFER_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int offset = ((char *) symbol_value_forward_forward (fwd) - (char *) &buffer_local_flags); @@ -2405,7 +2346,7 @@ case SYMVAL_SELECTED_CONSOLE_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int offset = ((char *) symbol_value_forward_forward (fwd) - (char *) &console_local_flags); @@ -2464,7 +2405,7 @@ case SYMVAL_CURRENT_BUFFER_FORWARD: { - const struct symbol_value_forward *fwd + CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); @@ -2874,7 +2815,7 @@ Lisp_Object legerdemain; struct symbol_value_lisp_magic *bfwd; - assert (nargs >= 0 && nargs < countof (args)); + assert (nargs >= 0 && nargs < 20); legerdemain = XSYMBOL (sym)->value; assert (SYMBOL_VALUE_LISP_MAGIC_P (legerdemain)); bfwd = XSYMBOL_VALUE_LISP_MAGIC (legerdemain); @@ -3133,37 +3074,26 @@ #endif /* some losing systems can't have static vars at function scope... */ -static const struct symbol_value_magic guts_of_unbound_marker = -{ /* 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 */ - }, - 0, /* value */ - SYMVAL_UNBOUND_MARKER -}; +static struct symbol_value_magic guts_of_unbound_marker = + { { symbol_value_forward_lheader_initializer, 0, 69}, + SYMVAL_UNBOUND_MARKER }; void init_symbols_once_early (void) { - INIT_LRECORD_IMPLEMENTATION (symbol); - INIT_LRECORD_IMPLEMENTATION (symbol_value_forward); - INIT_LRECORD_IMPLEMENTATION (symbol_value_buffer_local); - INIT_LRECORD_IMPLEMENTATION (symbol_value_lisp_magic); - INIT_LRECORD_IMPLEMENTATION (symbol_value_varalias); - - reinit_symbols_once_early (); +#ifndef Qzero + Qzero = make_int (0); /* Only used if Lisp_Object is a union type */ +#endif + +#ifndef Qnull_pointer + /* C guarantees that Qnull_pointer will be initialized to all 0 bits, + so the following is actually a no-op. */ + XSETOBJ (Qnull_pointer, (enum Lisp_Type) 0, 0); +#endif /* Bootstrapping problem: Qnil isn't set when make_string_nocopy is called the first time. */ - Qnil = Fmake_symbol (make_string_nocopy ((const Bufbyte *) "nil", 3)); + Qnil = Fmake_symbol (make_string_nocopy ((CONST Bufbyte *) "nil", 3)); XSYMBOL (Qnil)->name->plist = Qnil; XSYMBOL (Qnil)->value = Qnil; /* Nihil ex nihil */ XSYMBOL (Qnil)->plist = Qnil; @@ -3180,56 +3110,40 @@ { /* Required to get around a GCC syntax error on certain architectures */ - const struct symbol_value_magic *tem = &guts_of_unbound_marker; + struct symbol_value_magic *tem = &guts_of_unbound_marker; XSETSYMBOL_VALUE_MAGIC (Qunbound, tem); } + if ((CONST void *) XPNTR (Qunbound) != + (CONST void *)&guts_of_unbound_marker) + { + /* This might happen on DATA_SEG_BITS machines. */ + /* abort (); */ + /* Can't represent a pointer to constant C data using a Lisp_Object. + So heap-allocate it. */ + struct symbol_value_magic *urk = xnew (struct symbol_value_magic); + memcpy (urk, &guts_of_unbound_marker, sizeof (*urk)); + XSETSYMBOL_VALUE_MAGIC (Qunbound, urk); + } XSYMBOL (Qnil)->function = Qunbound; defsymbol (&Qt, "t"); XSYMBOL (Qt)->value = Qt; /* Veritas aetera */ Vquit_flag = Qnil; - - pdump_wire (&Qnil); - pdump_wire (&Qunbound); - pdump_wire (&Vquit_flag); } void -reinit_symbols_once_early (void) +defsymbol (Lisp_Object *location, CONST char *name) { -#ifndef Qzero - Qzero = make_int (0); /* Only used if Lisp_Object is a union type */ -#endif - -#ifndef Qnull_pointer - /* C guarantees that Qnull_pointer will be initialized to all 0 bits, - so the following is actually a no-op. */ - XSETOBJ (Qnull_pointer, (enum Lisp_Type) 0, 0); -#endif -} - -void -defsymbol_nodump (Lisp_Object *location, const char *name) -{ - *location = Fintern (make_string_nocopy ((const Bufbyte *) name, - strlen (name)), - Qnil); - staticpro_nodump (location); -} - -void -defsymbol (Lisp_Object *location, const char *name) -{ - *location = Fintern (make_string_nocopy ((const Bufbyte *) name, + *location = Fintern (make_string_nocopy ((CONST Bufbyte *) name, strlen (name)), Qnil); staticpro (location); } void -defkeyword (Lisp_Object *location, const char *name) +defkeyword (Lisp_Object *location, CONST char *name) { defsymbol (location, name); Fset (*location, *location); @@ -3282,14 +3196,15 @@ * FIXME: Should newsubr be staticpro()'ed? I dont think so but I need * a guru to check. */ -#define check_module_subr() \ -do { \ - if (initialized) { \ - Lisp_Subr *newsubr = (Lisp_Subr *) xmalloc (sizeof (Lisp_Subr)); \ - memcpy (newsubr, subr, sizeof (Lisp_Subr)); \ - subr->doc = (const char *)newsubr; \ - subr = newsubr; \ - } \ +#define check_module_subr() \ +do { \ + if (initialized) { \ + struct Lisp_Subr *newsubr; \ + newsubr = (Lisp_Subr *)xmalloc(sizeof(struct Lisp_Subr)); \ + memcpy (newsubr, subr, sizeof(struct Lisp_Subr)); \ + subr->doc = (CONST char *)newsubr; \ + subr = newsubr; \ + } \ } while (0) #else /* ! HAVE_SHLIB */ #define check_module_subr() @@ -3323,7 +3238,7 @@ } void -deferror (Lisp_Object *symbol, const char *name, const char *messuhhj, +deferror (Lisp_Object *symbol, CONST char *name, CONST char *messuhhj, Lisp_Object inherits_from) { Lisp_Object conds; @@ -3331,11 +3246,11 @@ assert (SYMBOLP (inherits_from)); conds = Fget (inherits_from, Qerror_conditions, Qnil); - Fput (*symbol, Qerror_conditions, Fcons (*symbol, conds)); + pure_put (*symbol, Qerror_conditions, Fcons (*symbol, conds)); /* NOT build_translated_string (). This function is called at load time and the string needs to get translated at run time. (This happens in the function (display-error) in cmdloop.el.) */ - Fput (*symbol, Qerror_message, build_string (messuhhj)); + pure_put (*symbol, Qerror_message, build_string (messuhhj)); } void @@ -3354,6 +3269,7 @@ defsymbol (&Qmake_local, "make-local"); defsymbol (&Qboundp, "boundp"); + defsymbol (&Qfboundp, "fboundp"); defsymbol (&Qglobally_boundp, "globally-boundp"); defsymbol (&Qmakunbound, "makunbound"); defsymbol (&Qsymbol_value, "symbol-value"); @@ -3421,9 +3337,21 @@ /* Create and initialize a Lisp variable whose value is forwarded to C data */ void -defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic) +defvar_magic (CONST char *symbol_name, CONST struct symbol_value_forward *magic) { - Lisp_Object sym; + Lisp_Object sym, kludge; + + /* Check that `magic' points somewhere we can represent as a Lisp pointer */ + XSETOBJ (kludge, Lisp_Type_Record, magic); + if ((void *)magic != (void*) XPNTR (kludge)) + { + /* This might happen on DATA_SEG_BITS machines. */ + /* abort (); */ + /* Copy it to somewhere which is representable. */ + struct symbol_value_forward *p = xnew (struct symbol_value_forward); + memcpy (p, magic, sizeof *magic); + magic = p; + } #if defined(HAVE_SHLIB) /* @@ -3435,7 +3363,7 @@ sym = Fintern (build_string (symbol_name), Qnil); else #endif - sym = Fintern (make_string_nocopy ((const Bufbyte *) symbol_name, + sym = Fintern (make_string_nocopy ((CONST Bufbyte *) symbol_name, strlen (symbol_name)), Qnil); XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, magic); diff -r 12e008d41344 -r 697ef44129c6 src/symeval.h --- a/src/symeval.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/symeval.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,8 +23,8 @@ /* Fsymbol_value checks whether XSYMBOL (sym)->value is one of these, * and does weird magic stuff if so */ -#ifndef INCLUDED_symeval_h_ -#define INCLUDED_symeval_h_ +#ifndef _XEMACS_SYMEVAL_H_ +#define _XEMACS_SYMEVAL_H_ enum symbol_value_type { @@ -72,12 +72,12 @@ struct symbol_value_magic { struct lcrecord_header lcheader; - void *value; enum symbol_value_type type; }; -#define SYMBOL_VALUE_MAGIC_P(x) \ -(LRECORDP (x) && \ - XRECORD_LHEADER (x)->type <= lrecord_type_max_symbol_value_magic) +#define SYMBOL_VALUE_MAGIC_P(x) \ + (LRECORDP (x) \ + && (XRECORD_LHEADER_IMPLEMENTATION (x)->printer \ + == print_symbol_value_magic)) #define XSYMBOL_VALUE_MAGIC_TYPE(v) \ (((struct symbol_value_magic *) XPNTR (v))->type) #define XSETSYMBOL_VALUE_MAGIC(s, p) XSETOBJ (s, Lisp_Type_Record, p) @@ -138,7 +138,7 @@ DECLARE_LRECORD (symbol_value_forward, struct symbol_value_forward); #define XSYMBOL_VALUE_FORWARD(x) \ XRECORD (x, symbol_value_forward, struct symbol_value_forward) -#define symbol_value_forward_forward(m) ((void *)((m)->magic.value)) +#define symbol_value_forward_forward(m) ((void *)((m)->magic.lcheader.next)) #define symbol_value_forward_magicfun(m) ((m)->magicfun) /* 2. symbol-value-buffer-local */ @@ -281,47 +281,28 @@ void defsubr_macro (Lisp_Subr *); #define DEFSUBR_MACRO(Fname) defsubr_macro (&S##Fname) -void defsymbol (Lisp_Object *location, const char *name); -void defsymbol_nodump (Lisp_Object *location, const char *name); +void defsymbol (Lisp_Object *location, CONST char *name); -void defkeyword (Lisp_Object *location, const char *name); +void defkeyword (Lisp_Object *location, CONST char *name); -void deferror (Lisp_Object *symbol, const char *name, - const char *message, Lisp_Object inherits_from); +void deferror (Lisp_Object *symbol, CONST char *name, + CONST char *message, Lisp_Object inherits_from); /* Macros we use to define forwarded Lisp variables. These are used in the syms_of_FILENAME functions. */ -void defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic); +void defvar_magic (CONST char *symbol_name, CONST struct symbol_value_forward *magic); + +#define symbol_value_forward_lheader_initializer { 1, { 0, 0, 0 } } #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magicfun) do { \ - 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 */ \ - }, \ - c_location, \ - forward_type \ - }, \ - magicfun \ - }; \ + static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) (c_location), 69 }, \ + forward_type }, magicfun }; \ defvar_magic ((lname), &I_hate_C); \ } while (0) -#define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) do{ \ - DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ - dumpopaque (c_location, sizeof(int)); \ -} while (0) - #define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \ DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ staticpro (c_location); \ @@ -335,18 +316,18 @@ #define DEFVAR_SPECIFIER(lname, c_location) \ DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_SPECIFIER_FORWARD, 0) #define DEFVAR_INT(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) + DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) #define DEFVAR_CONST_INT(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) + DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) #define DEFVAR_BOOL(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0) + DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0) #define DEFVAR_CONST_BOOL(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0) + DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0) #define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \ - DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun) + DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun); #define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun) + DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun); #define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun) + DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun); -#endif /* INCLUDED_symeval_h_ */ +#endif /* _XEMACS_SYMEVAL_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/symsinit.h --- a/src/symsinit.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/symsinit.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_symsinit_h_ -#define INCLUDED_symsinit_h_ +#ifndef _XEMACS_SYMSINIT_H_ +#define _XEMACS_SYMSINIT_H_ /* Earliest environment initializations (dump-time and run-time). */ @@ -33,14 +33,11 @@ void init_ralloc (void); void init_signals_very_early (void); -/* Early Lisp-engine initialization (dump-time for init, run-time for reinit). */ +/* Early Lisp-engine initialization (dump-time only). */ void init_alloc_once_early (void); -void reinit_alloc_once_early (void); void init_symbols_once_early (void); -void reinit_symbols_once_early (void); void init_errors_once_early (void); -void reinit_opaque_once_early (void); void init_opaque_once_early (void); /* Declare the built-in symbols and primitives (dump-time only). */ @@ -98,12 +95,9 @@ void syms_of_glyphs_widget (void); void syms_of_glyphs_mswindows (void); void syms_of_glyphs (void); -void syms_of_gui_mswindows (void); void syms_of_gui_x (void); void syms_of_gui (void); -void syms_of_gutter (void); void syms_of_indent (void); -void syms_of_input_method_xlib (void); void syms_of_intl (void); void syms_of_keymap (void); void syms_of_lread (void); @@ -119,7 +113,7 @@ void syms_of_mule_canna (void); void syms_of_mule_ccl (void); void syms_of_mule_charset (void); -void syms_of_file_coding (void); +void syms_of_mule_coding (void); void syms_of_mule_wnn (void); void syms_of_ntproc (void); void syms_of_objects_tty (void); @@ -136,7 +130,6 @@ void syms_of_scrollbar (void); void syms_of_scrollbar_mswindows(void); void syms_of_search (void); -void syms_of_select (void); void syms_of_select_mswindows (void); void syms_of_signal (void); void syms_of_sound (void); @@ -144,43 +137,34 @@ void syms_of_sunpro (void); void syms_of_symbols (void); void syms_of_syntax (void); -void syms_of_tests (void); void syms_of_toolbar (void); void syms_of_tooltalk (void); void syms_of_undo (void); void syms_of_widget (void); void syms_of_window (void); -void syms_of_select_x (void); +void syms_of_xselect (void); void syms_of_eldap (void); -void syms_of_postgresql (void); -void syms_of_gpmevent (void); -/* Initialize the console types (dump-time but for reinit_). */ +/* Initialize the console types (dump-time only). */ void console_type_create (void); void console_type_create_stream (void); -void reinit_console_type_create_stream (void); void console_type_create_tty (void); -void reinit_console_type_create_tty (void); void console_type_create_device_tty (void); void console_type_create_frame_tty (void); void console_type_create_objects_tty (void); void console_type_create_redisplay_tty (void); void console_type_create_x (void); -void reinit_console_type_create_x (void); void console_type_create_device_x (void); -void reinit_console_type_create_device_x (void); void console_type_create_frame_x (void); void console_type_create_glyphs_x (void); void console_type_create_menubar_x (void); void console_type_create_objects_x (void); void console_type_create_redisplay_x (void); void console_type_create_scrollbar_x (void); -void console_type_create_select_x (void); void console_type_create_toolbar_x (void); void console_type_create_dialog_x (void); void console_type_create_mswindows (void); -void reinit_console_type_create_mswindows (void); void console_type_create_device_mswindows (void); void console_type_create_frame_mswindows (void); void console_type_create_menubar_mswindows (void); @@ -190,20 +174,13 @@ void console_type_create_toolbar_mswindows (void); void console_type_create_glyphs_mswindows (void); void console_type_create_dialog_mswindows (void); -void console_type_create_select_mswindows (void); /* Initialize the specifier types (dump-time only). */ void specifier_type_create (void); -void reinit_specifier_type_create (void); void specifier_type_create_image (void); -void reinit_specifier_type_create_image (void); -void specifier_type_create_gutter (void); -void reinit_specifier_type_create_gutter (void); void specifier_type_create_objects (void); -void reinit_specifier_type_create_objects (void); void specifier_type_create_toolbar (void); -void reinit_specifier_type_create_toolbar (void); /* Initialize the structure types (dump-time only). */ @@ -220,12 +197,11 @@ void image_instantiator_format_create_glyphs_widget (void); void image_instantiator_format_create_glyphs_x (void); void image_instantiator_format_create_glyphs_mswindows (void); -void image_instantiator_format_create_glyphs_tty (void); /* Initialize the lstream types (dump-time only). */ void lstream_type_create (void); -void lstream_type_create_file_coding (void); +void lstream_type_create_mule_coding (void); void lstream_type_create_print (void); void lstream_type_create_mswindows_selectable (void); @@ -238,33 +214,27 @@ void init_provide_once (void); -/* Initialize most variables (dump-time for vars_, run-time for reinit_vars). */ +/* Initialize most variables (dump-time only). */ void vars_of_abbrev (void); void vars_of_alloc (void); void vars_of_balloon_x (void); void vars_of_buffer (void); -void reinit_vars_of_buffer (void); void vars_of_bytecode (void); void vars_of_callint (void); void vars_of_callproc (void); -void vars_of_chartab (void); void vars_of_cmdloop (void); void vars_of_cmds (void); void vars_of_console (void); -void reinit_vars_of_console (void); void vars_of_console_stream (void); void vars_of_console_mswindows (void); void vars_of_console_tty (void); void vars_of_data (void); void vars_of_database (void); void vars_of_debug (void); -void reinit_vars_of_debug (void); void vars_of_device (void); -void reinit_vars_of_device (void); void vars_of_device_mswindows (void); void vars_of_device_x (void); -void reinit_vars_of_device_x (void); void vars_of_dialog (void); void vars_of_dialog_x (void); void vars_of_dialog_mswindows (void); @@ -276,116 +246,79 @@ void vars_of_elhash (void); void vars_of_emacs (void); void vars_of_eval (void); -void reinit_vars_of_eval (void); void vars_of_event_stream (void); -void reinit_vars_of_event_stream (void); void vars_of_event_tty (void); -void reinit_vars_of_event_tty (void); void vars_of_event_mswindows (void); -void reinit_vars_of_event_mswindows (void); void vars_of_event_Xt (void); -void reinit_vars_of_event_Xt (void); void vars_of_events (void); -void reinit_vars_of_events (void); void vars_of_extents (void); -void reinit_vars_of_extents (void); void vars_of_faces (void); void vars_of_fileio (void); -void reinit_vars_of_fileio (void); void vars_of_filelock (void); void vars_of_floatfns (void); void vars_of_font_lock (void); -void reinit_vars_of_font_lock (void); void vars_of_frame_tty (void); void vars_of_frame_mswindows (void); -void reinit_vars_of_frame_mswindows (void); void vars_of_frame_x (void); void vars_of_frame (void); void vars_of_glyphs_x (void); void vars_of_glyphs_eimage (void); void vars_of_glyphs_widget (void); -void reinit_vars_of_glyphs_widget (void); void vars_of_glyphs_mswindows (void); void vars_of_glyphs (void); -void reinit_vars_of_glyphs (void); void vars_of_gui_x (void); -void reinit_vars_of_gui_x (void); void vars_of_gui (void); -void vars_of_gutter (void); void vars_of_input_method_motif (void); void vars_of_input_method_xlib (void); void vars_of_indent (void); void vars_of_insdel (void); -void reinit_vars_of_insdel (void); void vars_of_intl (void); void vars_of_keymap (void); void vars_of_lread (void); -void reinit_vars_of_lread (void); void vars_of_lstream (void); -void reinit_vars_of_lstream (void); void vars_of_macros (void); void vars_of_md5 (void); void vars_of_menubar_x (void); -void reinit_vars_of_menubar_x (void); void vars_of_menubar (void); void vars_of_menubar_mswindows (void); void vars_of_minibuf (void); -void reinit_vars_of_minibuf (void); void vars_of_module (void); -void reinit_vars_of_module (void); void vars_of_mule (void); void vars_of_mule_canna (void); -void vars_of_mule_ccl(void); void vars_of_mule_charset (void); -void vars_of_file_coding (void); +void vars_of_mule_coding (void); void vars_of_mule_wnn (void); -void reinit_vars_of_mule_wnn (void); -void vars_of_nt (void); -void vars_of_ntproc (void); void vars_of_objects (void); -void reinit_vars_of_objects (void); void vars_of_objects_tty (void); void vars_of_objects_mswindows (void); void vars_of_objects_x (void); void vars_of_print (void); -void reinit_vars_of_print (void); void vars_of_process (void); void vars_of_process_nt (void); void vars_of_process_unix (void); void vars_of_profile (void); void vars_of_ralloc (void); void vars_of_redisplay (void); -void reinit_vars_of_redisplay (void); void vars_of_scrollbar_x (void); -void reinit_vars_of_scrollbar_x (void); void vars_of_scrollbar (void); void vars_of_scrollbar_mswindows (void); void vars_of_search (void); -void reinit_vars_of_search (void); -void vars_of_select (void); void vars_of_select_mswindows (void); void vars_of_sound (void); void vars_of_specifier (void); void vars_of_sunpro (void); void vars_of_symbols (void); void vars_of_syntax (void); -void vars_of_tests (void); void vars_of_toolbar (void); void vars_of_tooltalk (void); void vars_of_undo (void); -void reinit_vars_of_undo (void); void vars_of_window (void); -void reinit_vars_of_window (void); -void vars_of_select_x (void); -void reinit_vars_of_select_x (void); +void vars_of_xselect (void); void vars_of_eldap (void); -void vars_of_postgresql (void); -void vars_of_gpmevent (void); /* Initialize specifier variables (dump-time only). */ void specifier_vars_of_glyphs (void); -void specifier_vars_of_gutter (void); void specifier_vars_of_menubar (void); void specifier_vars_of_redisplay (void); void specifier_vars_of_scrollbar (void); @@ -393,7 +326,7 @@ void specifier_vars_of_window (void); /* Initialize variables with complex dependencies - on other variables (dump-time for complex_vars_, run-time for reinit_). */ + on other variables (dump-time only). */ void complex_vars_of_regex (void); void complex_vars_of_search (void); @@ -401,7 +334,7 @@ void complex_vars_of_extents (void); void complex_vars_of_faces (void); void complex_vars_of_mule_charset (void); -void complex_vars_of_file_coding (void); +void complex_vars_of_mule_coding (void); void complex_vars_of_glyphs (void); void complex_vars_of_glyphs_x (void); void complex_vars_of_glyphs_mswindows (void); @@ -413,13 +346,11 @@ void complex_vars_of_syntax (void); void complex_vars_of_chartab (void); void complex_vars_of_buffer (void); -void reinit_complex_vars_of_buffer (void); void complex_vars_of_console (void); -void reinit_complex_vars_of_console (void); void complex_vars_of_emacs (void); void complex_vars_of_minibuf (void); -void reinit_complex_vars_of_minibuf (void); void complex_vars_of_callproc (void); +void complex_vars_of_filelock (void); void complex_vars_of_keymap (void); /* Reset the Lisp engine (run-time only). */ @@ -432,8 +363,9 @@ void init_buffer (void); void init_callproc (void); -void init_console_stream (int reinit); +void init_console_stream (void); void init_device_tty (void); +void init_dosfns (void); void init_editfns (void); void init_environment (void); void init_event_Xt_late (void); @@ -450,4 +382,4 @@ void init_redisplay (void); void init_sunpro (void); -#endif /* INCLUDED_symsinit_h_ */ +#endif /* _XEMACS_SYMSINIT_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/syntax.c --- a/src/syntax.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/syntax.c Mon Aug 13 11:20:41 2007 +0200 @@ -53,7 +53,6 @@ two such characters. */ /* Mule 2.4 doesn't seem to have Sextword - I'm removing it -- mrb */ -/* Recovered by tomo */ Lisp_Object Qsyntax_table_p; @@ -117,7 +116,7 @@ find_defun_start (struct buffer *buf, Bufpos pos) { Bufpos tem; - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); /* Use previous finding, if it's valid and applies to this inquiry. */ if (buf == find_start_buffer @@ -224,7 +223,7 @@ into the code it signifies. This is used by modify-syntax-entry, and other things. */ -const unsigned char syntax_spec_code[0400] = +CONST unsigned char syntax_spec_code[0400] = { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, @@ -246,7 +245,7 @@ 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377 }; -const unsigned char syntax_code_spec[] = " .w_()'\"$\\/<>@"; +CONST unsigned char syntax_code_spec[] = " .w_()'\"$\\/<>@"; DEFUN ("syntax-designator-chars", Fsyntax_designator_chars, 0, 0, 0, /* Return a string of the recognized syntax designator chars. @@ -268,7 +267,7 @@ */ (ch, table)) { - Lisp_Char_Table *mirrortab; + struct Lisp_Char_Table *mirrortab; if (NILP(ch)) { @@ -295,13 +294,14 @@ Lisp_Object syntax_match (Lisp_Object table, Emchar ch) { - Lisp_Object code = XCHAR_TABLE_VALUE_UNSAFE (table, ch); + Lisp_Object code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (table), ch); Lisp_Object code2 = code; if (CONSP (code)) code2 = XCAR (code); if (SYNTAX_FROM_CODE (XINT (code2)) == Sinherit) - code = XCHAR_TABLE_VALUE_UNSAFE (Vstandard_syntax_table, ch); + code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (Vstandard_syntax_table), + ch); return CONSP (code) ? XCDR (code) : Qnil; } @@ -313,7 +313,7 @@ */ (ch, table)) { - Lisp_Char_Table *mirrortab; + struct Lisp_Char_Table *mirrortab; int code; CHECK_CHAR_COERCE_INT (ch); @@ -327,17 +327,15 @@ -#ifdef MULE -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. - There is no word boundary between two word-constituent ASCII - characters. */ -#define WORD_BOUNDARY_P(c1, c2) \ - (!(CHAR_ASCII_P (c1) && CHAR_ASCII_P (c2)) \ - && word_boundary_p (c1, c2)) - -extern int word_boundary_p (Emchar c1, Emchar c2); -#endif +static int +word_constituent_p (struct buffer *buf, Bufpos pos, + struct Lisp_Char_Table *tab) +{ + enum syntaxcode code = SYNTAX_UNSAFE (tab, BUF_FETCH_CHAR (buf, pos)); + return ((words_include_escapes && + (code == Sescape || code == Scharquote)) + || (code == Sword)); +} /* Return the position across COUNT words from FROM. If that many words cannot be found before the end of the buffer, return 0. @@ -347,11 +345,7 @@ scan_words (struct buffer *buf, Bufpos from, int count) { Bufpos limit = count > 0 ? BUF_ZV (buf) : BUF_BEGV (buf); - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); - Emchar ch0, ch1; - enum syntaxcode code; - - /* #### is it really worth it to hand expand both cases? JV */ + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); while (count > 0) { QUIT; @@ -360,35 +354,15 @@ { if (from == limit) return 0; - - ch0 = BUF_FETCH_CHAR (buf, from); - code = SYNTAX_UNSAFE (mirrortab, ch0); - + if (word_constituent_p (buf, from, mirrortab)) + break; from++; - if (words_include_escapes - && (code == Sescape || code == Scharquote)) - break; - if (code == Sword) - break; } QUIT; - while (from != limit) + while ((from != limit) && word_constituent_p (buf, from, mirrortab)) { - ch1 = BUF_FETCH_CHAR (buf, from); - code = SYNTAX_UNSAFE (mirrortab, ch1); - if (!(words_include_escapes - && (code == Sescape || code == Scharquote))) - if (code != Sword -#ifdef MULE - || WORD_BOUNDARY_P (ch0, ch1) -#endif - ) - break; -#ifdef MULE - ch0 = ch1; -#endif from++; } count--; @@ -402,35 +376,15 @@ { if (from == limit) return 0; - - ch1 = BUF_FETCH_CHAR (buf, from - 1); - code = SYNTAX_UNSAFE (mirrortab, ch1); - + if (word_constituent_p (buf, from - 1, mirrortab)) + break; from--; - if (words_include_escapes - && (code == Sescape || code == Scharquote)) - break; - if (code == Sword) - break; } QUIT; - while (from != limit) + while ((from != limit) && word_constituent_p (buf, from - 1, mirrortab)) { - ch0 = BUF_FETCH_CHAR (buf, from - 1); - code = SYNTAX_UNSAFE (mirrortab, ch0); - if (!(words_include_escapes - && (code == Sescape || code == Scharquote))) - if (code != Sword -#ifdef MULE - || WORD_BOUNDARY_P (ch0, ch1) -#endif - ) - break; -#ifdef MULE - ch1 = ch0; -#endif from--; } count++; @@ -474,7 +428,7 @@ { Emchar c; enum syntaxcode code; - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); /* Look back, counting the parity of string-quotes, and recording the comment-starters seen. @@ -608,7 +562,7 @@ find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) { int c; - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); while (1) { @@ -659,9 +613,9 @@ Bufpos stop; Emchar c; enum syntaxcode code; - EMACS_INT count; + int count; struct buffer *buf = decode_buffer (buffer, 0); - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); CHECK_INT (n); count = XINT (n); @@ -815,7 +769,7 @@ enum syntaxcode code; int min_depth = depth; /* Err out if depth gets less than this. */ Lisp_Object syntaxtab = buf->syntax_table; - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); if (depth > 0) min_depth = 0; @@ -1025,7 +979,7 @@ if (SYNTAX_PREFIX_UNSAFE (mirrortab, c)) continue; - switch (quoted ? Sword : code) + switch (((quoted) ? Sword : code)) { case Sword: case Ssymbol: @@ -1134,7 +1088,7 @@ enum syntaxcode code; Bufpos beg = BUF_BEGV (buf); int quoted = 0; - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); while (pos > beg && ((code = SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1))) @@ -1216,7 +1170,7 @@ struct buffer *buf = decode_buffer (buffer, 0); Bufpos beg = BUF_BEGV (buf); Bufpos pos = BUF_PT (buf); - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); while (pos > beg && !char_quoted (buf, pos - 1) && (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)) == Squote @@ -1256,7 +1210,7 @@ Lisp_Object tem; int mask; /* comment mask */ Lisp_Object syntaxtab = buf->syntax_table; - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); if (NILP (oldstate)) { @@ -1609,7 +1563,7 @@ } static void -update_just_this_syntax_table (Lisp_Char_Table *ct) +update_just_this_syntax_table (struct Lisp_Char_Table *ct) { struct chartab_range range; struct cmst_arg arg; @@ -1627,7 +1581,7 @@ one. */ void -update_syntax_table (Lisp_Char_Table *ct) +update_syntax_table (struct Lisp_Char_Table *ct) { /* Don't be stymied at startup. */ if (CHAR_TABLEP (Vstandard_syntax_table) @@ -1679,28 +1633,18 @@ DEFVAR_BOOL ("parse-sexp-ignore-comments", &parse_sexp_ignore_comments /* Non-nil means `forward-sexp', etc., should treat comments as whitespace. */ ); - parse_sexp_ignore_comments = 0; + words_include_escapes = 0; DEFVAR_BOOL ("words-include-escapes", &words_include_escapes /* Non-nil means `forward-word', etc., should treat escape chars part of words. */ ); - words_include_escapes = 0; no_quit_in_re_search = 0; } -static void -define_standard_syntax (const char *p, enum syntaxcode syn) -{ - for (; *p; p++) - Fput_char_table (make_char (*p), make_int (syn), Vstandard_syntax_table); -} - void complex_vars_of_syntax (void) { - Emchar i; - const char *p; /* Set this now, so first buffer creation can refer to it. */ /* Make it nil before calling copy-syntax-table so that copy-syntax-table will know not to try to copy from garbage */ @@ -1712,31 +1656,68 @@ Smax); staticpro (&Vsyntax_designator_chars_string); - fill_char_table (XCHAR_TABLE (Vstandard_syntax_table), make_int (Spunct)); + fill_char_table (XCHAR_TABLE (Vstandard_syntax_table), + make_int (Spunct)); + + { + Emchar i; + + for (i = 0; i <= 32; i++) + Fput_char_table (make_char (i), make_int ((int) Swhitespace), + Vstandard_syntax_table); + for (i = 127; i <= 159; i++) + Fput_char_table (make_char (i), make_int ((int) Swhitespace), + Vstandard_syntax_table); - for (i = 0; i <= 32; i++) /* Control 0 plus SPACE */ - Fput_char_table (make_char (i), make_int (Swhitespace), + for (i = 'a'; i <= 'z'; i++) + Fput_char_table (make_char (i), make_int ((int) Sword), + Vstandard_syntax_table); + for (i = 'A'; i <= 'Z'; i++) + Fput_char_table (make_char (i), make_int ((int) Sword), + Vstandard_syntax_table); + for (i = '0'; i <= '9'; i++) + Fput_char_table (make_char (i), make_int ((int) Sword), + Vstandard_syntax_table); + Fput_char_table (make_char ('$'), make_int ((int) Sword), Vstandard_syntax_table); - for (i = 127; i <= 159; i++) /* DEL plus Control 1 */ - Fput_char_table (make_char (i), make_int (Swhitespace), + Fput_char_table (make_char ('%'), make_int ((int) Sword), Vstandard_syntax_table); - define_standard_syntax ("abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "0123456789" - "$%", Sword); - define_standard_syntax ("\"", Sstring); - define_standard_syntax ("\\", Sescape); - define_standard_syntax ("_-+*/&|<>=", Ssymbol); - define_standard_syntax (".,;:?!#@~^'`", Spunct); - - for (p = "()[]{}"; *p; p+=2) { - Fput_char_table (make_char (p[0]), - Fcons (make_int (Sopen), make_char (p[1])), + Fput_char_table (make_char ('('), Fcons (make_int ((int) Sopen), + make_char (')')), + Vstandard_syntax_table); + Fput_char_table (make_char (')'), Fcons (make_int ((int) Sclose), + make_char ('(')), + Vstandard_syntax_table); + Fput_char_table (make_char ('['), Fcons (make_int ((int) Sopen), + make_char (']')), Vstandard_syntax_table); - Fput_char_table (make_char (p[1]), - Fcons (make_int (Sclose), make_char (p[0])), + Fput_char_table (make_char (']'), Fcons (make_int ((int) Sclose), + make_char ('[')), + Vstandard_syntax_table); + Fput_char_table (make_char ('{'), Fcons (make_int ((int) Sopen), + make_char ('}')), + Vstandard_syntax_table); + Fput_char_table (make_char ('}'), Fcons (make_int ((int) Sclose), + make_char ('{')), Vstandard_syntax_table); } + + Fput_char_table (make_char ('"'), make_int ((int) Sstring), + Vstandard_syntax_table); + Fput_char_table (make_char ('\\'), make_int ((int) Sescape), + Vstandard_syntax_table); + + { + CONST char *p; + for (p = "_-+*/&|<>="; *p; p++) + Fput_char_table (make_char (*p), make_int ((int) Ssymbol), + Vstandard_syntax_table); + + for (p = ".,;:?!#@~^'`"; *p; p++) + Fput_char_table (make_char (*p), make_int ((int) Spunct), + Vstandard_syntax_table); + } + } } diff -r 12e008d41344 -r 697ef44129c6 src/syntax.h --- a/src/syntax.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/syntax.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.28. */ -#ifndef INCLUDED_syntax_h_ -#define INCLUDED_syntax_h_ +#ifndef _XEMACS_SYNTAX_H_ +#define _XEMACS_SYNTAX_H_ #include "chartab.h" @@ -72,9 +72,9 @@ #define SYNTAX_CODE_UNSAFE(table, c) \ XINT (CHAR_TABLE_VALUE_UNSAFE (table, c)) -INLINE_HEADER int SYNTAX_CODE (Lisp_Char_Table *table, Emchar c); -INLINE_HEADER int -SYNTAX_CODE (Lisp_Char_Table *table, Emchar c) +INLINE int SYNTAX_CODE (struct Lisp_Char_Table *table, Emchar c); +INLINE int +SYNTAX_CODE (struct Lisp_Char_Table *table, Emchar c) { return SYNTAX_CODE_UNSAFE (table, c); } @@ -85,9 +85,9 @@ #define SYNTAX_FROM_CODE(code) ((enum syntaxcode) ((code) & 0177)) #define SYNTAX(table, c) SYNTAX_FROM_CODE (SYNTAX_CODE (table, c)) -INLINE_HEADER int WORD_SYNTAX_P (Lisp_Char_Table *table, Emchar c); -INLINE_HEADER int -WORD_SYNTAX_P (Lisp_Char_Table *table, Emchar c) +INLINE int WORD_SYNTAX_P (struct Lisp_Char_Table *table, Emchar c); +INLINE int +WORD_SYNTAX_P (struct Lisp_Char_Table *table, Emchar c) { return SYNTAX (table, c) == Sword; } @@ -170,19 +170,13 @@ #define SYNTAX_SECOND_CHAR_END 0x03 #define SYNTAX_SECOND_CHAR 0x33 +#define SYNTAX_START_P(table, a, b) \ + ((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_START) \ + && (SYNTAX_COMMENT_BITS (table, b) & SYNTAX_SECOND_CHAR_START)) -/* #### These are now more or less equivalent to - SYNTAX_COMMENT_MATCH_START ...*/ -/* a and b must be first and second start chars for a common type */ -#define SYNTAX_START_P(table, a, b) \ - (((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_START) >> 2) \ - & (SYNTAX_COMMENT_BITS (table, b) & SYNTAX_SECOND_CHAR_START)) - -/* ... and SYNTAX_COMMENT_MATCH_END */ -/* a and b must be first and second end chars for a common type */ -#define SYNTAX_END_P(table, a, b) \ - (((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_END) >> 2) \ - & (SYNTAX_COMMENT_BITS (table, b) & SYNTAX_SECOND_CHAR_END)) +#define SYNTAX_END_P(table, a, b) \ + ((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_END) \ + && (SYNTAX_COMMENT_BITS (table, b) & SYNTAX_SECOND_CHAR_END)) #define SYNTAX_STYLES_MATCH_START_P(table, a, b, mask) \ ((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_START & (mask)) \ @@ -238,15 +232,15 @@ that character signifies (as a char). For example, (enum syntaxcode) syntax_spec_code['w'] is Sword. */ -extern const unsigned char syntax_spec_code[0400]; +extern CONST unsigned char syntax_spec_code[0400]; /* Indexed by syntax code, give the letter that describes it. */ -extern const unsigned char syntax_code_spec[]; +extern CONST unsigned char syntax_code_spec[]; -Lisp_Object scan_lists (struct buffer *buf, Bufpos from, int count, +Lisp_Object scan_lists (struct buffer *buf, int from, int count, int depth, int sexpflag, int no_error); -int char_quoted (struct buffer *buf, Bufpos pos); +int char_quoted (struct buffer *buf, int pos); /* NOTE: This does not refer to the mirror table, but to the syntax table itself. */ @@ -255,6 +249,6 @@ extern int no_quit_in_re_search; extern struct buffer *regex_emacs_buffer; -void update_syntax_table (Lisp_Char_Table *ct); +void update_syntax_table (struct Lisp_Char_Table *ct); -#endif /* INCLUDED_syntax_h_ */ +#endif /* _XEMACS_SYNTAX_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/syscommctrl.h --- a/src/syscommctrl.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* Authorship: - - Created May 2000 by Andy Piper. - Windows-Mule stuff added by Ben Wing. -*/ - -#ifndef INCLUDED_syscommctrl_h_ -#define INCLUDED_syscommctrl_h_ - -#if !defined (CYGWIN_VERSION_DLL_MAJOR) || CYGWIN_VERSION_DLL_MAJOR > 20 -/* Appears to be missing in Cygwin b20.1; requisite includes are in - Windows32/Messages.h and get included automatically with windows.h */ -#include <commctrl.h> -#endif - -#ifndef TB_SETIMAGELIST -#define TB_SETIMAGELIST (WM_USER + 48) -#endif -#ifndef TB_GETIMAGELIST -#define TB_GETIMAGELIST (WM_USER + 49) -#endif -#ifndef TB_SETDISABLEDIMAGELIST -#define TB_SETDISABLEDIMAGELIST (WM_USER + 54) -#endif -#ifndef TB_GETDISABLEDIMAGELIST -#define TB_GETDISABLEDIMAGELIST (WM_USER + 55) -#endif -#ifndef TB_SETPADDING -#define TB_SETPADDING (WM_USER + 87) -#endif -#ifndef TBSTYLE_FLAT -#define TBSTYLE_FLAT 0x800 -#endif -#ifndef TCS_BOTTOM -#define TCS_BOTTOM 0x0002 -#endif -#ifndef TCS_VERTICAL -#define TCS_VERTICAL 0x0080 -#endif -#ifndef PBS_SMOOTH -#define PBS_SMOOTH 0x01 -#endif - -#ifndef ICC_BAR_CLASSES -#define ICC_BAR_CLASSES 4 -#endif - -#endif /* INCLUDED_syscommctrl_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/sysdep.c --- a/src/sysdep.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysdep.c Mon Aug 13 11:20:41 2007 +0200 @@ -31,24 +31,28 @@ #include <config.h> -#ifdef WIN32_NATIVE -#ifdef MINGW -#include <mingw32/process.h> -#else +#ifdef WINDOWSNT +#include <direct.h> +#ifndef __MINGW32__ /* <process.h> should not conflict with "process.h", as per ANSI definition. - This is not true with visual c though. The trick below works with - VC4.2b, 5.0 and 6.0. It assumes that VC is installed in a kind of - standard way, so include path ends with /include. + This is not true though with visual c though. The trick below works with + VC4.2b and with VC5.0. It assumes that VC is installed in a kind of + standard way, so include files get to what/ever/path/include. Unfortunately, this must go before lisp.h, since process.h defines abort() which will conflict with the macro defined in lisp.h */ #include <../include/process.h> -#endif /* MINGW */ -#endif /* WIN32_NATIVE */ +#else +#include <mingw32/process.h> +#endif +#endif /* WINDOWSNT */ #include "lisp.h" +#include <stddef.h> +#include <stdlib.h> + /* ------------------------------- */ /* basic includes */ /* ------------------------------- */ @@ -78,20 +82,17 @@ #include "syswait.h" #include "sysdir.h" #include "systime.h" -#if defined(WIN32_NATIVE) || defined(CYGWIN) +#if defined(WINDOWSNT) || defined(__CYGWIN32__) #include "syssignal.h" #endif - -#include "sysproc.h" - -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #include <sys/times.h> #endif -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #include <sys/utime.h> +#include <windows.h> #include "ntheap.h" -#include "nt.h" #endif /* ------------------------------- */ @@ -234,11 +235,8 @@ #endif /* NO_SUBPROCESSES */ -#ifdef WIN32_NATIVE -void wait_for_termination (HANDLE pHandle) -#else -void wait_for_termination (int pid) -#endif +void +wait_for_termination (int pid) { /* #### With the new improved SIGCHLD handling stuff, there is much less danger of race conditions and some of the comments below @@ -348,49 +346,6 @@ Since implementations may add their own error indicators on top, we ignore it by default. */ -#elif defined (WIN32_NATIVE) - int ret = 0, status = 0; - if (pHandle == NULL) - { - warn_when_safe (Qprocess, Qwarning, "Cannot wait for unknown process to terminate"); - return; - } - do - { - QUIT; - ret = WaitForSingleObject(pHandle, 100); - } - while (ret == WAIT_TIMEOUT); - if (ret == WAIT_FAILED) - { - warn_when_safe (Qprocess, Qwarning, "waiting for process failed"); - } - if (ret == WAIT_ABANDONED) - { - warn_when_safe (Qprocess, Qwarning, - "process to wait for has been abandoned"); - } - if (ret == WAIT_OBJECT_0) - { - ret = GetExitCodeProcess(pHandle, &status); - if (ret) - { - synch_process_alive = 0; - synch_process_retcode = status; - } - else - { - /* GetExitCodeProcess() didn't return a valid exit status, - nothing to do. APA */ - warn_when_safe (Qprocess, Qwarning, - "failure to obtain process exit value"); - } - } - if (pHandle != NULL && !CloseHandle(pHandle)) - { - warn_when_safe (Qprocess, Qwarning, - "failure to close unknown process"); - } #elif defined (EMACS_BLOCK_SIGNAL) && !defined (BROKEN_WAIT_FOR_SIGNAL) && defined (SIGCHLD) while (1) { @@ -422,7 +377,7 @@ Try defining BROKEN_WAIT_FOR_SIGNAL. */ EMACS_WAIT_FOR_SIGNAL (SIGCHLD); } -#else /* not HAVE_WAITPID and not WIN32_NATIVE and (not EMACS_BLOCK_SIGNAL or BROKEN_WAIT_FOR_SIGNAL) */ +#else /* not HAVE_WAITPID and (not EMACS_BLOCK_SIGNAL or BROKEN_WAIT_FOR_SIGNAL) */ /* This approach is kind of cheesy but is guaranteed(?!) to work for all systems. */ while (1) @@ -460,7 +415,7 @@ #endif } -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT /* Set up the terminal at the other end of a pseudo-terminal that we will be controlling an inferior through. It should not echo or do line-editing, since that is done @@ -470,7 +425,7 @@ child_setup_tty (int out) { struct emacs_tty s; - emacs_get_tty (out, &s); + EMACS_GET_TTY (out, &s); #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) assert (isatty(out)); @@ -539,7 +494,7 @@ #endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ s.main.c_cc[VEOL] = _POSIX_VDISABLE; #if defined (CBAUD) - /* <mdiers> #### This is not portable. ### + /* <mdiers> ### This is not portable. ### POSIX does not specify CBAUD, and 4.4BSD does not have it. Instead, POSIX suggests to use cfset{i,o}speed(). [cf. D. Lewine, POSIX Programmer's Guide, Chapter 8: Terminal @@ -562,7 +517,7 @@ s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ #endif /* not HAVE_TERMIO */ - emacs_set_tty (out, &s, 0); + EMACS_SET_TTY (out, &s, 0); #ifdef RTU { @@ -571,7 +526,7 @@ } #endif /* RTU */ } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ #endif /* not NO_SUBPROCESSES */ @@ -612,23 +567,19 @@ } } -#ifdef WIN32_NATIVE - -pid_t +#ifdef WINDOWSNT +int sys_getpid (void) { return abs (getpid ()); } - -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* Fork a subshell. */ static void sys_subshell (void) { -#ifndef WIN32_NATIVE int pid; -#endif struct save_signal saved_handlers[5]; Lisp_Object dir; unsigned char *str = 0; @@ -661,18 +612,22 @@ str = (unsigned char *) alloca (XSTRING_LENGTH (dir) + 2); len = XSTRING_LENGTH (dir); memcpy (str, XSTRING_DATA (dir), len); - if (!IS_ANY_SEP (str[len - 1])) - str[len++] = DIRECTORY_SEP; + /* #### Unix specific */ + if (str[len - 1] != '/') str[len++] = '/'; str[len] = 0; xyzzy: -#ifndef WIN32_NATIVE +#ifdef WINDOWSNT + pid = -1; +#else /* not WINDOWSNT */ + pid = fork (); if (pid == -1) error ("Can't spawn subshell"); if (pid == 0) -#endif /* not WIN32_NATIVE */ + +#endif /* not WINDOWSNT */ { char *sh = 0; @@ -685,18 +640,7 @@ if (str) sys_chdir (str); -#ifdef WIN32_NATIVE - - /* Waits for process completion */ - if (_spawnlp (_P_WAIT, sh, sh, NULL) != 0) - error ("Can't spawn subshell"); - else - return; /* we're done, no need to wait for termination */ - } - -#else - -#if !defined (NO_SUBPROCESSES) +#if !defined (NO_SUBPROCESSES) && !defined (WINDOWSNT) close_process_descs (); /* Close Emacs's pipes/ptys */ #endif @@ -705,18 +649,23 @@ nice (-emacs_priority); /* Give the new shell the default priority */ #endif +#ifdef WINDOWSNT + /* Waits for process completion */ + pid = _spawnlp (_P_WAIT, sh, sh, NULL); + if (pid == -1) + write (1, "Can't execute subshell", 22); + +#else /* not WINDOWSNT */ execlp (sh, sh, 0); write (1, "Can't execute subshell", 22); _exit (1); +#endif /* not WINDOWSNT */ } save_signal_handlers (saved_handlers); synch_process_alive = 1; wait_for_termination (pid); restore_signal_handlers (saved_handlers); - -#endif /* not WIN32_NATIVE */ - } #endif /* !defined (SIGTSTP) && !defined (USG_JOBCTRL) */ @@ -763,31 +712,23 @@ /* Given FD, obtain pty buffer size. When no luck, a good guess is made, - so that the function works even when fd is not a pty. */ + so that the function works even fd is not a pty. */ int get_pty_max_bytes (int fd) { - /* DEC OSF 4.0 fpathconf returns 255, but xemacs hangs on long shell - input lines if we return 253. 252 is OK!. So let's leave a bit - of slack for the newline that xemacs will insert, and for those - inevitable vendor off-by-one-or-two-or-three bugs. */ -#define MAX_CANON_SLACK 10 -#define SAFE_MAX_CANON (127 - MAX_CANON_SLACK) + int pty_max_bytes; + #if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON) - { - int max_canon = fpathconf (fd, _PC_MAX_CANON); - return (max_canon < 0 ? SAFE_MAX_CANON : - max_canon > SAFE_MAX_CANON ? max_canon - MAX_CANON_SLACK : - max_canon); - } -#elif defined (_POSIX_MAX_CANON) - return (_POSIX_MAX_CANON > SAFE_MAX_CANON ? - _POSIX_MAX_CANON - MAX_CANON_SLACK : - _POSIX_MAX_CANON); -#else - return SAFE_MAX_CANON; + pty_max_bytes = fpathconf (fd, _PC_MAX_CANON); + if (pty_max_bytes < 0) #endif + pty_max_bytes = 250; + + /* Deduct one, to leave space for the eof. */ + pty_max_bytes--; + + return pty_max_bytes; } /* Figure out the eof character for the FD. */ @@ -795,7 +736,7 @@ Bufbyte get_eof_char (int fd) { - const Bufbyte ctrl_d = (Bufbyte) '\004'; + CONST Bufbyte ctrl_d = (Bufbyte) '\004'; if (!isatty (fd)) return ctrl_d; @@ -805,7 +746,7 @@ tcgetattr (fd, &t); #if 0 /* What is the following line designed to do??? -mrb */ - if (strlen ((const char *) t.c_cc) < (unsigned int) (VEOF + 1)) + if (strlen ((CONST char *) t.c_cc) < (unsigned int) (VEOF + 1)) return ctrl_d; else return (Bufbyte) t.c_cc[VEOF]; @@ -828,7 +769,7 @@ { struct termio t; ioctl (fd, TCGETA, &t); - if (strlen ((const char *) t.c_cc) < (unsigned int) (VINTR + 1)) + if (strlen ((CONST char *) t.c_cc) < (unsigned int) (VINTR + 1)) return ctrl_d; else return (Bufbyte) t.c_cc[VINTR]; @@ -962,7 +903,7 @@ assert (DEVICE_TTY_P (d)); { int input_fd = CONSOLE_TTY_DATA (con)->infd; -#if defined (WIN32_NATIVE) +#if defined (WINDOWSNT) DEVICE_TTY_DATA (d)->ospeed = 15; #elif defined (HAVE_TERMIOS) struct termios sg; @@ -1078,7 +1019,7 @@ { int filedesc = DEVICE_INFD (d); -#if defined (I_SETSIG) && !defined(HPUX10) && !defined(LINUX) +#if defined (I_SETSIG) && !defined(HPUX10) { int events=0; ioctl (filedesc, I_GETSIG, &events); @@ -1388,7 +1329,7 @@ /* It's wrong to encase these into #ifdef HAVE_TTY because we need them for child TTY processes. */ /* However, this does break NT support while we don't do child TTY processes */ -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT /* Set *TC to the parameters associated with the terminal FD. Return zero if all's well, or -1 if we ran into an error we @@ -1407,7 +1348,7 @@ if (ioctl (fd, TCGETA, &settings->main) < 0) return -1; -#elif !defined (WIN32_NATIVE) +#elif !defined (WINDOWSNT) /* I give up - I hope you have the BSD ioctls. */ if (ioctl (fd, TIOCGETP, &settings->main) < 0) return -1; @@ -1432,8 +1373,7 @@ /* Set the parameters of the tty on FD according to the contents of *SETTINGS. If FLUSHP is non-zero, we discard input. - Return 0 if all went well, and -1 if anything failed. - #### All current callers use FLUSHP == 0. */ + Return 0 if all went well, and -1 if anything failed. */ int emacs_set_tty (int fd, struct emacs_tty *settings, int flushp) @@ -1481,7 +1421,7 @@ if (ioctl (fd, flushp ? TCSETAF : TCSETAW, &settings->main) < 0) return -1; -#elif !defined (WIN32_NATIVE) +#elif !defined (WINDOWSNT) /* I give up - I hope you have the BSD ioctls. */ if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0) return -1; @@ -1504,7 +1444,7 @@ return 0; } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /* ------------------------------------------------------ */ /* Initializing a device */ @@ -1543,7 +1483,7 @@ input_fd = CONSOLE_TTY_DATA (con)->infd; output_fd = CONSOLE_TTY_DATA (con)->outfd; - emacs_get_tty (input_fd, &CONSOLE_TTY_DATA (con)->old_tty); + EMACS_GET_TTY (input_fd, &CONSOLE_TTY_DATA (con)->old_tty); tty = CONSOLE_TTY_DATA (con)->old_tty; con->tty_erase_char = Qnil; @@ -1664,14 +1604,14 @@ tty.main.c_iflag &= ~BRKINT; #endif /* AIX */ #else /* if not HAVE_TERMIO */ -#if !defined (WIN32_NATIVE) +#if !defined (WINDOWSNT) con->tty_erase_char = make_char (tty.main.sg_erase); tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS); if (TTY_FLAGS (con).meta_key) tty.main.sg_flags |= ANYP; /* #### should we be using RAW mode here? */ tty.main.sg_flags |= /* interrupt_input ? RAW : */ CBREAK; -#endif /* not WIN32_NATIVE */ +#endif /* not WINDOWSNT */ #endif /* not HAVE_TERMIO */ /* If going to use CBREAK mode, we must request C-g to interrupt @@ -1710,7 +1650,7 @@ tty.ltchars = new_ltchars; #endif /* HAVE_LTCHARS */ - emacs_set_tty (input_fd, &tty, 0); + EMACS_SET_TTY (input_fd, &tty, 0); /* This code added to insure that, if flow-control is not to be used, we have an unlocked terminal at the start. */ @@ -1718,9 +1658,11 @@ #ifdef TCXONC if (!TTY_FLAGS (con).flow_control) ioctl (input_fd, TCXONC, 1); #endif +#ifndef APOLLO #ifdef TIOCSTART if (!TTY_FLAGS (con).flow_control) ioctl (input_fd, TIOCSTART, 0); #endif +#endif #if defined (HAVE_TERMIOS) || defined (HPUX9) #ifdef TCOON @@ -1815,7 +1757,7 @@ { struct emacs_tty tty; - emacs_get_tty (DEVICE_INFD (d), &tty); + EMACS_GET_TTY (DEVICE_INFD (d), &tty); return EMACS_TTY_TABS_OK (&tty); } #endif @@ -1888,7 +1830,7 @@ assert (DEVICE_TTY_P (d)); input_fd = DEVICE_INFD (d); - emacs_get_tty (input_fd, &s); + EMACS_GET_TTY (input_fd, &s); #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) eight_bit = (s.main.c_cflag & CSIZE) == CS8; @@ -1938,7 +1880,7 @@ fsync (output_fd); #endif - while (emacs_set_tty (input_fd, &CONSOLE_TTY_DATA (con)->old_tty, 0) + while (EMACS_SET_TTY (input_fd, &CONSOLE_TTY_DATA (con)->old_tty, 0) < 0 && errno == EINTR) ; @@ -2132,7 +2074,7 @@ /* limits of text/data segments */ /************************************************************************/ -#if !defined(CANNOT_DUMP) && !defined(PDUMP) +#ifndef CANNOT_DUMP #define NEED_STARTS #endif @@ -2152,20 +2094,28 @@ * */ -#if !defined(HAVE_TEXT_START) && !defined(PDUMP) - -EXTERN_C int _start (void); - +#ifdef __cplusplus + extern "C" int _start (); +#else + extern int _start (); +#endif + +#ifndef HAVE_TEXT_START char * start_of_text (void) { #ifdef TEXT_START - return (char *) TEXT_START; + return ((char *) TEXT_START); #else - return (char *) _start; +#ifdef GOULD + extern csrt (); + return ((char *) csrt); +#else /* not GOULD */ + return ((char *) _start); +#endif /* GOULD */ #endif /* TEXT_START */ } -#endif /* !defined(HAVE_TEXT_START) && !defined(PDUMP) */ +#endif /* not HAVE_TEXT_START */ /* * Return the address of the start of the data segment prior to @@ -2193,7 +2143,7 @@ * */ -#if defined(ORDINARY_LINK) && !defined(MINGW) +#ifdef ORDINARY_LINK extern char **environ; #endif @@ -2210,7 +2160,7 @@ * is known to live at or near the start of the system crt0.c, and * we don't sweat the handful of bytes that might lose. */ -#if defined (HEAP_IN_DATA) && !defined(PDUMP) +#ifdef HEAP_IN_DATA extern char* static_heap_base; if (!initialized) return static_heap_base; @@ -2224,7 +2174,7 @@ } #endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ -#if !defined(CANNOT_DUMP) && !defined(PDUMP) +#ifndef CANNOT_DUMP /* Some systems that cannot dump also cannot implement these. */ /* @@ -2259,7 +2209,7 @@ #endif } -#endif /* !defined(CANNOT_DUMP) && !defined(PDUMP) */ +#endif /* not CANNOT_DUMP */ /************************************************************************/ @@ -2271,12 +2221,17 @@ extern Lisp_Object Vsystem_name; +#ifdef HAVE_SOCKETS +# include <sys/socket.h> +# include <netdb.h> +#endif /* HAVE_SOCKETS */ + void init_system_name (void) { -#if defined (WIN32_NATIVE) +#if defined (WINDOWSNT) char hostname [MAX_COMPUTERNAME_LENGTH + 1]; - size_t size = sizeof (hostname); + size_t size = sizeof(hostname); GetComputerName (hostname, &size); Vsystem_name = build_string (hostname); #elif !defined (HAVE_GETHOSTNAME) @@ -2312,27 +2267,26 @@ # endif /* not CANNOT_DUMP */ if (!strchr (hostname, '.')) { -# if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)) struct hostent *hp = NULL; int count; -# ifdef TRY_AGAIN +# ifdef TRY_AGAIN for (count = 0; count < 10; count++) { h_errno = 0; -# endif +# endif /* Some systems can't handle SIGALARM/SIGIO in gethostbyname(). */ stop_interrupts (); hp = gethostbyname (hostname); start_interrupts (); -# ifdef TRY_AGAIN +# ifdef TRY_AGAIN if (! (hp == 0 && h_errno == TRY_AGAIN)) break; Fsleep_for (make_int (1)); } -# endif +# endif if (hp) { - const char *fqdn = (const char *) hp->h_name; + CONST char *fqdn = (CONST char *) hp->h_name; if (!strchr (fqdn, '.')) { @@ -2347,22 +2301,6 @@ hostname = (char *) alloca (strlen (fqdn) + 1); strcpy (hostname, fqdn); } -# else /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */ - struct addrinfo hints, *res; - - xzero (hints); - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = 0; - if (!getaddrinfo (hostname, NULL, &hints, &res)) - { - hostname = (char *) alloca (strlen (res->ai_canonname) + 1); - strcpy (hostname, res->ai_canonname); - - freeaddrinfo (res); - } -# endif /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */ } # endif /* HAVE_SOCKETS */ Vsystem_name = build_string (hostname); @@ -2492,7 +2430,7 @@ /* Linux added here by Raymond L. Toy <toy@alydar.crd.ge.com> for XEmacs. */ /* Irix added here by gparker@sni-usa.com for XEmacs. */ /* NetBSD added here by James R Grinter <jrg@doc.ic.ac.uk> for XEmacs */ -extern const char *sys_errlist[]; +extern CONST char *sys_errlist[]; extern int sys_nerr; #endif @@ -2502,17 +2440,17 @@ #endif -const char * +CONST char * strerror (int errnum) { if (errnum >= 0 && errnum < sys_nerr) return sys_errlist[errnum]; - return ((const char *) GETTEXT ("Unknown error")); + return ((CONST char *) GETTEXT ("Unknown error")); } #endif /* ! HAVE_STRERROR */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT struct errentry { unsigned long oscode; /* Win32 error */ @@ -2583,7 +2521,7 @@ int i; /* check the table for the OS error code */ - for (i = 0; i < countof (errtable); ++i) + for (i = 0; i < sizeof(errtable)/sizeof(errtable[0]); ++i) { if (win32_error == errtable[i].oscode) { @@ -2609,7 +2547,7 @@ mswindows_set_errno (GetLastError ()); } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ /************************************************************************/ @@ -2617,7 +2555,7 @@ /************************************************************************/ #define PATHNAME_CONVERT_OUT(path) \ - TO_EXTERNAL_FORMAT (C_STRING, (path), C_STRING_ALLOCA, (path), Qfile_name); + GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA ((CONST Bufbyte *) path, path) /***************** low-level calls ****************/ @@ -2636,12 +2574,12 @@ /* Ben sez: read Dick Gabriel's essay about the Worse Is Better approach to programming and its connection to the silly - interruptible-system-call business. To find it, look on - Jamie's home page (http://www.jwz.org/worse-is-better.html). */ + interruptible-system-call business. To find it, look at + Jamie's home page (http://www.netscape.com/people/jwz). */ #ifdef ENCAPSULATE_OPEN int -sys_open (const char *path, int oflag, ...) +sys_open (CONST char *path, int oflag, ...) { int mode; va_list ap; @@ -2651,13 +2589,10 @@ va_end (ap); PATHNAME_CONVERT_OUT (path); - -#ifdef WIN32_NATIVE +#if defined (WINDOWSNT) /* Make all handles non-inheritable */ - oflag |= _O_NOINHERIT; -#endif - -#ifdef INTERRUPTIBLE_OPEN + return open (path, oflag | _O_NOINHERIT, mode); +#elif defined (INTERRUPTIBLE_OPEN) { int rtnval; while ((rtnval = open (path, oflag, mode)) == -1 @@ -2680,7 +2615,7 @@ is not interrupted by C-g. However, the worst that can happen is the fallback to simple open(). */ int -interruptible_open (const char *path, int oflag, int mode) +interruptible_open (CONST char *path, int oflag, int mode) { /* This function can GC */ size_t len = strlen (path); @@ -2692,11 +2627,6 @@ PATHNAME_CONVERT_OUT (nonreloc); -#ifdef WIN32_NATIVE - /* Make all handles non-inheritable */ - oflag |= _O_NOINHERIT; -#endif - for (;;) { int rtnval = open (nonreloc, oflag, mode); @@ -2709,13 +2639,13 @@ #ifdef ENCAPSULATE_CLOSE int -sys_close (int filedes) +sys_close (int fd) { #ifdef INTERRUPTIBLE_CLOSE int did_retry = 0; REGISTER int rtnval; - while ((rtnval = close (filedes)) == -1 + while ((rtnval = close (fd)) == -1 && (errno == EINTR)) did_retry = 1; @@ -2727,15 +2657,15 @@ return rtnval; #else - return close (filedes); + return close (fd); #endif } #endif /* ENCAPSULATE_CLOSE */ -ssize_t +int sys_read_1 (int fildes, void *buf, size_t nbyte, int allow_quit) { - ssize_t rtnval; + int rtnval; /* No harm in looping regardless of the INTERRUPTIBLE_IO setting. */ while ((rtnval = read (fildes, buf, nbyte)) == -1 @@ -2748,23 +2678,24 @@ } #ifdef ENCAPSULATE_READ -ssize_t +int sys_read (int fildes, void *buf, size_t nbyte) { return sys_read_1 (fildes, buf, nbyte, 0); } #endif /* ENCAPSULATE_READ */ -ssize_t -sys_write_1 (int fildes, const void *buf, size_t nbyte, int allow_quit) +int +sys_write_1 (int fildes, CONST void *buf, size_t nbyte, int allow_quit) { - ssize_t bytes_written = 0; - const char *b = (const char *) buf; + int rtnval; + int bytes_written = 0; + CONST char *b = (CONST char *) buf; /* No harm in looping regardless of the INTERRUPTIBLE_IO setting. */ while (nbyte > 0) { - ssize_t rtnval = write (fildes, b, nbyte); + rtnval = write (fildes, b, nbyte); if (allow_quit) REALLY_QUIT; @@ -2774,18 +2705,18 @@ if (errno == EINTR) continue; else - return bytes_written ? bytes_written : -1; + return (bytes_written ? bytes_written : -1); } b += rtnval; nbyte -= rtnval; bytes_written += rtnval; } - return bytes_written; + return (bytes_written); } #ifdef ENCAPSULATE_WRITE -ssize_t -sys_write (int fildes, const void *buf, size_t nbyte) +int +sys_write (int fildes, CONST void *buf, size_t nbyte) { return sys_write_1 (fildes, buf, nbyte, 0); } @@ -2803,10 +2734,10 @@ #ifdef ENCAPSULATE_FOPEN FILE * -sys_fopen (const char *path, const char *type) +sys_fopen (CONST char *path, CONST char *type) { PATHNAME_CONVERT_OUT (path); -#if defined (WIN32_NATIVE) +#if defined (WINDOWSNT) { int fd; int oflag; @@ -2913,12 +2844,12 @@ #ifdef ENCAPSULATE_FWRITE size_t -sys_fwrite (const void *ptr, size_t size, size_t nitem, FILE *stream) +sys_fwrite (CONST void *ptr, size_t size, size_t nitem, FILE *stream) { #ifdef INTERRUPTIBLE_IO size_t rtnval; size_t items_written = 0; - const char *b = (const char *) ptr; + CONST char *b = (CONST char *) ptr; while (nitem > 0) { @@ -2946,7 +2877,7 @@ #ifdef ENCAPSULATE_CHDIR int -sys_chdir (const char *path) +sys_chdir (CONST char *path) { PATHNAME_CONVERT_OUT (path); return chdir (path); @@ -2956,10 +2887,10 @@ #ifdef ENCAPSULATE_MKDIR int -sys_mkdir (const char *path, mode_t mode) +sys_mkdir (CONST char *path, mode_t mode) { PATHNAME_CONVERT_OUT (path); -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT return mkdir (path); #else return mkdir (path, mode); @@ -2970,7 +2901,7 @@ #ifdef ENCAPSULATE_OPENDIR DIR * -sys_opendir (const char *filename) +sys_opendir (CONST char *filename) { DIR *rtnval; PATHNAME_CONVERT_OUT (filename); @@ -3002,7 +2933,7 @@ { Extcount external_len; int ascii_filename_p = 1; - const Extbyte * const external_name = (const Extbyte *) rtnval->d_name; + CONST Extbyte * CONST external_name = (CONST Extbyte *) rtnval->d_name; /* Optimize for the common all-ASCII case, computing len en passant */ for (external_len = 0; external_name[external_len] ; external_len++) @@ -3015,7 +2946,7 @@ { /* Non-ASCII filename */ static Bufbyte_dynarr *internal_DIRENTRY; - const Bufbyte *internal_name; + CONST Bufbyte *internal_name; Bytecount internal_len; if (!internal_DIRENTRY) internal_DIRENTRY = Dynarr_new (Bufbyte); @@ -3025,9 +2956,9 @@ Dynarr_add_many (internal_DIRENTRY, (Bufbyte *) rtnval, offsetof (DIRENTRY, d_name)); - TO_INTERNAL_FORMAT (DATA, (external_name, external_len), - ALLOCA, (internal_name, internal_len), - Qfile_name); + internal_name = + convert_from_external_format (external_name, external_len, + &internal_len, FORMAT_FILENAME); Dynarr_add_many (internal_DIRENTRY, internal_name, internal_len); Dynarr_add (internal_DIRENTRY, 0); /* zero-terminate */ @@ -3055,7 +2986,7 @@ #ifdef ENCAPSULATE_RMDIR int -sys_rmdir (const char *path) +sys_rmdir (CONST char *path) { PATHNAME_CONVERT_OUT (path); return rmdir (path); @@ -3067,7 +2998,7 @@ #ifdef ENCAPSULATE_ACCESS int -sys_access (const char *path, int mode) +sys_access (CONST char *path, int mode) { PATHNAME_CONVERT_OUT (path); return access (path, mode); @@ -3078,7 +3009,7 @@ #ifdef HAVE_EACCESS #ifdef ENCAPSULATE_EACCESS int -sys_eaccess (const char *path, int mode) +sys_eaccess (CONST char *path, int mode) { PATHNAME_CONVERT_OUT (path); return eaccess (path, mode); @@ -3089,7 +3020,7 @@ #ifdef ENCAPSULATE_LSTAT int -sys_lstat (const char *path, struct stat *buf) +sys_lstat (CONST char *path, struct stat *buf) { PATHNAME_CONVERT_OUT (path); return lstat (path, buf); @@ -3099,7 +3030,7 @@ #ifdef ENCAPSULATE_READLINK int -sys_readlink (const char *path, char *buf, size_t bufsiz) +sys_readlink (CONST char *path, char *buf, size_t bufsiz) { PATHNAME_CONVERT_OUT (path); /* #### currently we don't do conversions on the incoming data */ @@ -3107,36 +3038,22 @@ } #endif /* ENCAPSULATE_READLINK */ -#ifdef ENCAPSULATE_FSTAT -int -sys_fstat (int fd, struct stat *buf) -{ -#ifdef WIN32_NATIVE - return mswindows_fstat (fd, buf); -#else - return fstat (fd, buf); -#endif -} -#endif /* ENCAPSULATE_FSTAT */ #ifdef ENCAPSULATE_STAT int -sys_stat (const char *path, struct stat *buf) +sys_stat (CONST char *path, struct stat *buf) { PATHNAME_CONVERT_OUT (path); -#ifdef WIN32_NATIVE - return mswindows_stat (path, buf); -#else return stat (path, buf); -#endif } #endif /* ENCAPSULATE_STAT */ + /****************** file-manipulation calls *****************/ #ifdef ENCAPSULATE_CHMOD int -sys_chmod (const char *path, mode_t mode) +sys_chmod (CONST char *path, mode_t mode) { PATHNAME_CONVERT_OUT (path); return chmod (path, mode); @@ -3146,7 +3063,7 @@ #ifdef ENCAPSULATE_CREAT int -sys_creat (const char *path, mode_t mode) +sys_creat (CONST char *path, mode_t mode) { PATHNAME_CONVERT_OUT (path); return creat (path, mode); @@ -3156,7 +3073,7 @@ #ifdef ENCAPSULATE_LINK int -sys_link (const char *existing, const char *new) +sys_link (CONST char *existing, CONST char *new) { PATHNAME_CONVERT_OUT (existing); PATHNAME_CONVERT_OUT (new); @@ -3167,18 +3084,18 @@ #ifdef ENCAPSULATE_RENAME int -sys_rename (const char *old, const char *new) +sys_rename (CONST char *old, CONST char *new) { PATHNAME_CONVERT_OUT (old); PATHNAME_CONVERT_OUT (new); -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* Windows rename fails if NEW exists */ if (rename (old, new) == 0) return 0; if (errno != EEXIST) return -1; unlink (new); -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ return rename (old, new); } #endif /* ENCAPSULATE_RENAME */ @@ -3186,7 +3103,7 @@ #ifdef ENCAPSULATE_SYMLINK int -sys_symlink (const char *name1, const char *name2) +sys_symlink (CONST char *name1, CONST char *name2) { PATHNAME_CONVERT_OUT (name1); PATHNAME_CONVERT_OUT (name2); @@ -3197,7 +3114,7 @@ #ifdef ENCAPSULATE_UNLINK int -sys_unlink (const char *path) +sys_unlink (CONST char *path) { PATHNAME_CONVERT_OUT (path); return unlink (path); @@ -3207,7 +3124,7 @@ #ifdef ENCAPSULATE_EXECVP int -sys_execvp (const char *path, char * const * argv) +sys_execvp (CONST char *path, char * CONST * argv) { int i, argc; char ** new_argv; @@ -3235,7 +3152,7 @@ #ifndef HAVE_GETCWD char * -getcwd (char *pathname, size_t size) +getcwd (char *pathname, int size) { return getwd (pathname); } @@ -3279,7 +3196,7 @@ #ifndef HAVE_RENAME int -rename (const char *from, const char *to) +rename (CONST char *from, CONST char *to) { if (access (from, 0) == 0) { @@ -3393,7 +3310,7 @@ static int get_process_times_1 (long *user_ticks, long *system_ticks) { -#if defined (_SC_CLK_TCK) || defined (CLK_TCK) && !defined(WIN32_NATIVE) +#if defined (_SC_CLK_TCK) || defined (CLK_TCK) && !defined(WINDOWSNT) /* We have the POSIX times() function available. */ struct tms tttt; times (&tttt); @@ -3535,8 +3452,8 @@ #if !defined (SYS_SIGLIST_DECLARED) && !defined (HAVE_SYS_SIGLIST) -#if defined(WIN32_NATIVE) || defined(CYGWIN) -const char *sys_siglist[] = +#if defined(WINDOWSNT) || defined(__CYGWIN32__) +CONST char *sys_siglist[] = { "bum signal!!", "hangup", @@ -3569,7 +3486,7 @@ #ifdef USG #ifdef AIX -const char *sys_siglist[NSIG + 1] = +CONST char *sys_siglist[NSIG + 1] = { /* AIX has changed the signals a bit */ DEFER_GETTEXT ("bogus signal"), /* 0 */ @@ -3609,7 +3526,7 @@ 0 }; #else /* USG, not AIX */ -const char *sys_siglist[NSIG + 1] = +CONST char *sys_siglist[NSIG + 1] = { DEFER_GETTEXT ("bogus signal"), /* 0 */ DEFER_GETTEXT ("hangup"), /* 1 SIGHUP */ @@ -3658,7 +3575,7 @@ #endif /* not AIX */ #endif /* USG */ #ifdef DGUX -const char *sys_siglist[NSIG + 1] = +CONST char *sys_siglist[NSIG + 1] = { DEFER_GETTEXT ("null signal"), /* 0 SIGNULL */ DEFER_GETTEXT ("hangup"), /* 1 SIGHUP */ @@ -3763,7 +3680,7 @@ #ifdef NONSYSTEM_DIR_LIBRARY DIR * -opendir (const char *filename) /* name of directory */ +opendir (CONST char *filename) /* name of directory */ { DIR *dirp; /* -> malloc'ed storage */ int fd; /* file descriptor for read */ @@ -3865,7 +3782,7 @@ MKDIR_PROTOTYPE #else int -mkdir (const char *dpath, int dmode) +mkdir (CONST char *dpath, int dmode) #endif { int cpid, status, fd; @@ -3925,7 +3842,7 @@ #ifndef HAVE_RMDIR int -rmdir (const char *dpath) +rmdir (CONST char *dpath) { int cpid, status, fd; struct stat statbuf; diff -r 12e008d41344 -r 697ef44129c6 src/sysdep.h --- a/src/sysdep.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysdep.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,18 +20,16 @@ /* Synched up with: FSF 19.30. Split out of sysdep.c/emacs.c. */ -#ifndef INCLUDED_sysdep_h_ -#define INCLUDED_sysdep_h_ +#ifndef _XEMACS_SYSDEP_H_ +#define _XEMACS_SYSDEP_H_ #include <setjmp.h> -#ifndef WIN32_NATIVE extern char **environ; -#endif -#ifdef PDUMP -int pdump_read_file (char **pdump_start_pos, size_t *pdump_length); -#endif +struct emacs_tty; +int emacs_get_tty (int fd, struct emacs_tty *settings); +int emacs_set_tty (int fd, struct emacs_tty *settings, int waitp); int eight_bit_tty (struct device *d); @@ -50,9 +48,7 @@ /* Wait for subprocess with process id `pid' to terminate and make sure it will get eliminated (not remain forever as a zombie) */ -#ifndef WIN32_NATIVE void wait_for_termination (int pid); -#endif /* flush any pending output * (may flush input as well; it does not matter the way we use it) @@ -82,10 +78,10 @@ extern JMP_BUF break_system_call_jump; extern volatile int can_break_system_calls; -ssize_t sys_write_1 (int fildes, const void *buf, size_t nbyte, - int allow_quit); -ssize_t sys_read_1 (int fildes, void *buf, size_t nbyte, - int allow_quit); +int sys_write_1 (int fildes, CONST void *buf, size_t nbyte, + int allow_quit); +int sys_read_1 (int fildes, void *buf, size_t nbyte, + int allow_quit); /* Call these functions if you want to change some terminal parameter -- reset the console, change the parameter, and init it again. */ @@ -146,11 +142,11 @@ void init_system_name (void); #ifndef HAVE_GETCWD -char *getcwd (char *pathname, size_t size); +char *getcwd (char *pathname, int size); #endif #ifndef HAVE_RENAME -int rename (const char *from, const char *to); +int rename (CONST char *from, CONST char *to); #endif #ifndef HAVE_DUP2 @@ -162,10 +158,15 @@ # ifdef strerror # undef strerror # endif -const char *strerror (int); +CONST char *strerror (int); #endif -int interruptible_open (const char *path, int oflag, int mode); +#ifdef WINDOWSNT +void mswindows_set_errno (unsigned long win32_error); +void mswindows_set_last_errno (void); +#endif + +int interruptible_open (CONST char *path, int oflag, int mode); #ifndef HAVE_H_ERRNO extern int h_errno; @@ -174,7 +175,7 @@ #ifdef HAVE_REALPATH #define xrealpath realpath #else -char *xrealpath(const char *path, char resolved_path []); +char *xrealpath(CONST char *path, char resolved_path []); #endif -#endif /* INCLUDED_sysdep_h_ */ +#endif /* _XEMACS_SYSDEP_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/sysdir.h --- a/src/sysdir.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysdir.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,20 +20,16 @@ /* Synched up with: Not really in FSF. */ -#ifndef INCLUDED_sysdir_h_ -#define INCLUDED_sysdir_h_ - #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef SYSV_SYSTEM_DIR # include <dirent.h> -#elif defined (WIN32_NATIVE) -# include <direct.h> +#elif defined (NONSYSTEM_DIR_LIBRARY) # include "ndir.h" -#elif defined (NONSYSTEM_DIR_LIBRARY) -# include "ndir.h" +#elif defined (MSDOS) +# include <dirent.h> #else # include <sys/dir.h> #endif /* not NONSYSTEM_DIR_LIBRARY */ @@ -59,12 +55,16 @@ Since applying strlen to the name always works, we'll just do that. */ #define NAMLEN(p) strlen (p->d_name) +#ifdef MSDOS +#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) +#else #define DIRENTRY_NONEMPTY(p) ((p)->d_ino) +#endif /* encapsulation: directory calls */ #ifdef ENCAPSULATE_CHDIR -int sys_chdir (const char *path); +int sys_chdir (CONST char *path); #endif #if defined (ENCAPSULATE_CHDIR) && !defined (DONT_ENCAPSULATE) # undef chdir @@ -75,7 +75,7 @@ #endif #ifdef ENCAPSULATE_MKDIR -int sys_mkdir (const char *path, mode_t mode); +int sys_mkdir (CONST char *path, mode_t mode); #endif #if defined (ENCAPSULATE_MKDIR) && !defined (DONT_ENCAPSULATE) # undef mkdir @@ -86,7 +86,7 @@ #endif #ifdef ENCAPSULATE_OPENDIR -DIR *sys_opendir (const char *filename); +DIR *sys_opendir (CONST char *filename); #endif #if defined (ENCAPSULATE_OPENDIR) && !defined (DONT_ENCAPSULATE) # undef opendir @@ -119,7 +119,7 @@ #endif #ifdef ENCAPSULATE_RMDIR -int sys_rmdir (const char *path); +int sys_rmdir (CONST char *path); #endif #if defined (ENCAPSULATE_RMDIR) && !defined (DONT_ENCAPSULATE) # undef rmdir @@ -129,4 +129,3 @@ # define sys_rmdir rmdir #endif -#endif /* INCLUDED_sysdir_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/sysdll.c --- a/src/sysdll.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysdll.c Mon Aug 13 11:20:41 2007 +0200 @@ -23,7 +23,6 @@ #include <config.h> #endif -#include <stdlib.h> #include "sysdll.h" /* This whole file is conditional upon HAVE_SHLIB */ @@ -49,13 +48,13 @@ #endif int -dll_init (const char *arg) +dll_init (CONST char *arg) { return 0; } dll_handle -dll_open (const char *fname) +dll_open (CONST char *fname) { return (dll_handle)dlopen (fname, RTLD_LAZY | RTLD_GLOBAL); } @@ -67,7 +66,7 @@ } dll_func -dll_function (dll_handle h, const char *n) +dll_function (dll_handle h, CONST char *n) { #ifdef DLSYM_NEEDS_UNDERSCORE char *buf = alloca_array (char, strlen (n) + 2); @@ -79,7 +78,7 @@ } dll_var -dll_variable (dll_handle h, const char *n) +dll_variable (dll_handle h, CONST char *n) { #ifdef DLSYM_NEEDS_UNDERSCORE char *buf = alloca_array (char, strlen (n) + 2); @@ -90,11 +89,11 @@ return (dll_var)dlsym ((void *)h, n); } -const char * +CONST char * dll_error (dll_handle h) { #if defined(HAVE_DLERROR) || defined(dlerror) - return (const char *)dlerror (); + return (CONST char *)dlerror (); #elif defined(HAVE__DLERROR) return (const char *)_dlerror(); #else @@ -106,13 +105,13 @@ /* This is the HP/UX version */ #include <dl.h> int -dll_init (const char *arg) +dll_init (CONST char *arg) { return 0; } dll_handle -dll_open (const char *fname) +dll_open (CONST char *fname) { shl_t h = shl_load (fname, BIND_DEFERRED,0L); shl_t *hp = NULL; @@ -137,7 +136,7 @@ } dll_func -dll_function (dll_handle h, const char *n) +dll_function (dll_handle h, CONST char *n) { long handle = 0L; @@ -148,7 +147,7 @@ } dll_var -dll_variable (dll_handle h, const char *n) +dll_variable (dll_handle h, CONST char *n) { long handle = 0L; @@ -158,7 +157,7 @@ return (dll_var)handle; } -const char * +CONST char * dll_error (dll_handle h) { /* #### WTF?! Shouldn't this at least attempt to get strerror or @@ -169,7 +168,7 @@ #elif defined(HAVE_INIT_DLD) #include <dld.h> int -dll_init (const char *arg) +dll_init (CONST char *arg) { char *real_exe = dld_find_executable (arg); int rc; @@ -184,7 +183,7 @@ } dll_handle -dll_open (const char *fname) +dll_open (CONST char *fname) { rc = dld_link (fname); if (rc) @@ -206,30 +205,25 @@ } DLL_FUNC -dll_function (dll_handle h, const char *n) +dll_function (dll_handle h, CONST char *n) { return dld_get_func(n); } DLL_FUNC -dll_variable (dll_handle h, const char *n) +dll_variable (dll_handle h, CONST char *n) { return dld_get_symbol(n); } -#elif defined (WIN32_NATIVE) - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#undef WIN32_LEAN_AND_MEAN - +#elif defined(_WINDOWS) || defined(WIN32) int -dll_init (const char *arg) +dll_init (CONST char *arg) { return 0; } dll_handle -dll_open (const char *fname) +dll_open (CONST char *fname) { return (dll_handle)LoadLibrary (fname); } @@ -241,18 +235,18 @@ } dll_func -dll_function (dll_handle h, const char *n) +dll_function (dll_handle h, CONST char *n) { return (dll_func)GetProcAddress (h,n); } dll_func -dll_variable (dll_handle h, const char *n) +dll_variable (dll_handle h, CONST char *n) { return (dll_func)GetProcAddress (h,n); } -const char * +CONST char * dll_error (dll_handle h) { return "Windows DLL Error"; @@ -260,13 +254,13 @@ #else /* Catchall if we don't know about this systems method of dynamic loading */ int -dll_init (const char *arg) +dll_init (CONST char *arg) { return -1; } dll_handle -dll_open (const char *fname) +dll_open (CONST char *fname) { return NULL; } @@ -278,18 +272,18 @@ } dll_func -dll_function (dll_handle h, const char *n) +dll_function (dll_handle h, CONST char *n) { return NULL; } dll_func -dll_variable (dll_handle h, const char *n) +dll_variable (dll_handle h, CONST char *n) { return NULL; } -const char * +CONST char * dll_error (dll_handle h) { return "Shared libraries not implemented on this system"; diff -r 12e008d41344 -r 697ef44129c6 src/sysdll.h --- a/src/sysdll.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysdll.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,16 +19,16 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef INCLUDED_sysdll_h_ -#define INCLUDED_sysdll_h_ +#ifndef _SYSDLL_H +#define _SYSDLL_H #ifdef __cplusplus extern "C" { #endif -#if defined(WIN32_NATIVE) +#if defined(WIN32) #define DLLEXPORT __declspec(dllexport) -#elif defined(WIN16) +#elif defined(_WINDOWS) #define DLLEXPORT FAR PASCAL _EXPORT #else #define DLLEXPORT @@ -38,16 +38,16 @@ typedef void * dll_func; typedef void * dll_var; -int dll_init(const char *); +int dll_init(CONST char *); int dll_shutdown(void); -dll_handle dll_open(const char *); +dll_handle dll_open(CONST char *); int dll_close(dll_handle); -dll_func dll_function(dll_handle,const char *); -dll_var dll_variable(dll_handle,const char *); -const char *dll_error(dll_handle); +dll_func dll_function(dll_handle,CONST char *); +dll_var dll_variable(dll_handle,CONST char *); +CONST char *dll_error(dll_handle); #ifdef __cplusplus } #endif -#endif /* INCLUDED_sysdll_h_ */ +#endif /* _SYSDLL_H */ diff -r 12e008d41344 -r 697ef44129c6 src/sysfile.h --- a/src/sysfile.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysfile.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,12 +20,9 @@ /* Synched up with: Not really in FSF. */ -#ifndef INCLUDED_sysfile_h_ -#define INCLUDED_sysfile_h_ - #include <errno.h> -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #include <sys/errno.h> /* <errno.h> does not always imply this */ #endif @@ -43,24 +40,17 @@ #ifndef makedev #include <sys/types.h> /* some typedefs are used in sys/file.h */ #endif - -#ifndef WIN32_NATIVE #include <sys/file.h> -#endif - #include <sys/stat.h> +#include <sys/param.h> -#ifndef WIN32_NATIVE -#include <sys/param.h> -#endif - -#if defined (NeXT) || defined(CYGWIN) +#if defined (NeXT) || defined(__CYGWIN32__) /* what is needed from here? Do others need it too? O_BINARY is in here under cygwin. */ # include <sys/fcntl.h> #endif /* NeXT */ -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #include <io.h> #include <direct.h> #endif @@ -101,7 +91,7 @@ #endif #ifndef CREAT_MODE -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT #define CREAT_MODE (S_IREAD | S_IWRITE) #else #define CREAT_MODE (0666) @@ -124,30 +114,6 @@ #endif #endif -#ifndef READ_PLUS_TEXT -#ifdef O_TEXT -#define READ_PLUS_TEXT "r+t" -#else -#define READ_PLUS_TEXT "r+" -#endif -#endif - -#ifndef READ_PLUS_BINARY -#ifdef O_BINARY -#define READ_PLUS_BINARY "r+b" -#else -#define READ_PLUS_BINARY "r+" -#endif -#endif - -#ifndef WRITE_TEXT -#ifdef O_TEXT -#define WRITE_TEXT "wt" -#else -#define WRITE_TEXT "w" -#endif -#endif - #ifndef WRITE_BINARY #ifdef O_BINARY #define WRITE_BINARY "wb" @@ -237,37 +203,17 @@ #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) #endif -/* Client .c files should simply use `PATH_MAX'. */ -#ifndef PATH_MAX -# if defined (_POSIX_PATH_MAX) -# define PATH_MAX _POSIX_PATH_MAX -# elif defined (MAXPATHLEN) -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 1024 -# endif -#endif - -/* MAXPATHLEN is deprecated, but, as of this writing, still used. */ -#ifndef MAXPATHLEN -# define MAXPATHLEN 1024 +#if !defined (USG) && !defined (WINDOWSNT) +# define HAVE_FSYNC #endif -/* The following definitions are needed under Windows, at least */ -#ifndef X_OK -# define X_OK 1 -#endif +#ifndef MAXPATHLEN +/* in 4.1, param.h fails to define this. */ +#define MAXPATHLEN 1024 +#endif /* not MAXPATHLEN */ -#ifndef R_OK -# define R_OK 4 -#endif - -#ifndef W_OK -# define W_OK 2 -#endif - -#ifndef F_OK -# define F_OK 0 +#ifndef X_OK +# define X_OK 01 #endif #ifndef FD_CLOEXEC @@ -298,7 +244,7 @@ Other encapsulations are declared in the appropriate sys*.h file. */ #ifdef ENCAPSULATE_READ -ssize_t sys_read (int, void *, size_t); +int sys_read (int, void *, size_t); #endif #if defined (ENCAPSULATE_READ) && !defined (DONT_ENCAPSULATE) # undef read @@ -309,7 +255,7 @@ #endif #ifdef ENCAPSULATE_WRITE -ssize_t sys_write (int, const void *, size_t); +int sys_write (int, CONST void *, size_t); #endif #if defined (ENCAPSULATE_WRITE) && !defined (DONT_ENCAPSULATE) # undef write @@ -320,7 +266,7 @@ #endif #ifdef ENCAPSULATE_OPEN -int sys_open (const char *, int, ...); +int sys_open (CONST char *, int, ...); #endif #if defined (ENCAPSULATE_OPEN) && !defined (DONT_ENCAPSULATE) # undef open @@ -355,7 +301,7 @@ #endif #ifdef ENCAPSULATE_FWRITE -size_t sys_fwrite (const void *, size_t, size_t, FILE *); +size_t sys_fwrite (CONST void *, size_t, size_t, FILE *); #endif #if defined (ENCAPSULATE_FWRITE) && !defined (DONT_ENCAPSULATE) # undef fwrite @@ -366,7 +312,7 @@ #endif #ifdef ENCAPSULATE_FOPEN -FILE *sys_fopen (const char *, const char *); +FILE *sys_fopen (CONST char *, CONST char *); #endif #if defined (ENCAPSULATE_FOPEN) && !defined (DONT_ENCAPSULATE) # undef fopen @@ -391,7 +337,7 @@ /* encapsulations: file-information calls */ #ifdef ENCAPSULATE_ACCESS -int sys_access (const char *path, int mode); +int sys_access (CONST char *path, int mode); #endif #if defined (ENCAPSULATE_ACCESS) && !defined (DONT_ENCAPSULATE) # undef access @@ -402,7 +348,7 @@ #endif #ifdef ENCAPSULATE_EACCESS -int sys_eaccess (const char *path, int mode); +int sys_eaccess (CONST char *path, int mode); #endif #if defined (ENCAPSULATE_EACCESS) && !defined (DONT_ENCAPSULATE) # undef eaccess @@ -413,7 +359,7 @@ #endif #ifdef ENCAPSULATE_LSTAT -int sys_lstat (const char *path, struct stat *buf); +int sys_lstat (CONST char *path, struct stat *buf); #endif #if defined (ENCAPSULATE_LSTAT) && !defined (DONT_ENCAPSULATE) # undef lstat @@ -424,7 +370,7 @@ #endif #ifdef ENCAPSULATE_READLINK -int sys_readlink (const char *path, char *buf, size_t bufsiz); +int sys_readlink (CONST char *path, char *buf, size_t bufsiz); #endif #if defined (ENCAPSULATE_READLINK) && !defined (DONT_ENCAPSULATE) # undef readlink @@ -434,20 +380,8 @@ # define sys_readlink readlink #endif -#ifdef ENCAPSULATE_FSTAT -int sys_fstat (int fd, struct stat *buf); -#endif -#if defined (ENCAPSULATE_FSTAT) && !defined (DONT_ENCAPSULATE) -# undef fstat -/* Need to use arguments to avoid messing with struct stat */ -# define fstat(fd, buf) sys_fstat (fd, buf) -#endif -#if !defined (ENCAPSULATE_FSTAT) && defined (DONT_ENCAPSULATE) -# define sys_fstat fstat -#endif - #ifdef ENCAPSULATE_STAT -int sys_stat (const char *path, struct stat *buf); +int sys_stat (CONST char *path, struct stat *buf); #endif #if defined (ENCAPSULATE_STAT) && !defined (DONT_ENCAPSULATE) # undef stat @@ -461,7 +395,7 @@ /* encapsulations: file-manipulation calls */ #ifdef ENCAPSULATE_CHMOD -int sys_chmod (const char *path, mode_t mode); +int sys_chmod (CONST char *path, mode_t mode); #endif #if defined (ENCAPSULATE_CHMOD) && !defined (DONT_ENCAPSULATE) # undef chmod @@ -472,7 +406,7 @@ #endif #ifdef ENCAPSULATE_CREAT -int sys_creat (const char *path, mode_t mode); +int sys_creat (CONST char *path, mode_t mode); #endif #if defined (ENCAPSULATE_CREAT) && !defined (DONT_ENCAPSULATE) # undef creat @@ -483,7 +417,7 @@ #endif #ifdef ENCAPSULATE_LINK -int sys_link (const char *existing, const char *new); +int sys_link (CONST char *existing, CONST char *new); #endif #if defined (ENCAPSULATE_LINK) && !defined (DONT_ENCAPSULATE) # undef link @@ -494,7 +428,7 @@ #endif #ifdef ENCAPSULATE_RENAME -int sys_rename (const char *old, const char *new); +int sys_rename (CONST char *old, CONST char *new); #endif #if defined (ENCAPSULATE_RENAME) && !defined (DONT_ENCAPSULATE) # undef rename @@ -505,7 +439,7 @@ #endif #ifdef ENCAPSULATE_SYMLINK -int sys_symlink (const char *name1, const char *name2); +int sys_symlink (CONST char *name1, CONST char *name2); #endif #if defined (ENCAPSULATE_SYMLINK) && !defined (DONT_ENCAPSULATE) # undef symlink @@ -516,7 +450,7 @@ #endif #ifdef ENCAPSULATE_UNLINK -int sys_unlink (const char *path); +int sys_unlink (CONST char *path); #endif #if defined (ENCAPSULATE_UNLINK) && !defined (DONT_ENCAPSULATE) # undef unlink @@ -527,7 +461,7 @@ #endif #ifdef ENCAPSULATE_EXECVP -int sys_execvp (const char *, char * const *); +int sys_execvp (CONST char *, char * CONST *); #endif #if defined (ENCAPSULATE_EXECVP) && !defined (DONT_ENCAPSULATE) # undef execvp @@ -536,5 +470,3 @@ #if !defined (ENCAPSULATE_EXECVP) && defined (DONT_ENCAPSULATE) # define sys_execvp execvp #endif - -#endif /* INCLUDED_sysfile_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/sysfloat.h --- a/src/sysfloat.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysfloat.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,9 +20,6 @@ /* Synched up with: Not really in FSF. */ -#ifndef INCLUDED_sysfloat_h_ -#define INCLUDED_sysfloat_h_ - /* Work around a problem that happens because math.h on hpux 7 defines two static variables--which, in Emacs, are not really static, because `static' is defined as nothing. The problem is that they are @@ -37,7 +34,8 @@ # define _NMAXLDBL THIS_FILENAME ## _nmaxldbl # endif -#if defined(LINUX) && !(defined (__GLIBC__) && (__GLIBC__ >= 2)) +#if defined(MSDOS) || (defined(LINUX) && \ + !(defined (__GLIBC__) && (__GLIBC__ >= 2))) /* These are redefined (correctly, but differently) in values.h. */ #undef INTBITS #undef LONGBITS @@ -46,7 +44,7 @@ #include <math.h> -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT /* A quirky way to obtain logb prototype */ #include <float.h> #define logb _logb @@ -88,4 +86,3 @@ # define isnan(x) ((x) != (x)) #endif -#endif /* INCLUDED_sysfloat_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/sysproc.h --- a/src/sysproc.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/sysproc.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,16 +20,13 @@ /* Synched up with: Not really in FSF. */ -#ifndef INCLUDED_sysproc_h_ -#define INCLUDED_sysproc_h_ - #ifdef HAVE_VFORK_H # include <vfork.h> #endif #include "systime.h" /* necessary for sys/resource.h; also gets the FD_* defines on some systems. */ -#ifndef WIN32_NATIVE +#ifndef WINDOWSNT #include <sys/resource.h> #endif @@ -37,61 +34,17 @@ #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */ # include <sys/types.h> /* AJK */ -# ifndef WIN32_NATIVE -# include <sys/socket.h> -# include <netdb.h> -# include <netinet/in.h> -# include <arpa/inet.h> -# endif -# ifdef NEED_NET_ERRNO_H -# include <net/errno.h> -# endif /* NEED_NET_ERRNO_H */ +# include <sys/socket.h> +# include <netdb.h> +# include <netinet/in.h> +# include <arpa/inet.h> +#ifdef NEED_NET_ERRNO_H +#include <net/errno.h> +#endif /* NEED_NET_ERRNO_H */ #elif defined (SKTPAIR) # include <sys/socket.h> #endif /* HAVE_SOCKETS */ -#ifdef WIN32_NATIVE -/* Note: winsock.h already included in systime.h above */ -/* 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 /* WIN32_NATIVE */ - /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */ #ifdef HAVE_BROKEN_INET_ADDR # define IN_ADDR struct in_addr @@ -145,4 +98,8 @@ int poll_fds_for_input (SELECT_TYPE mask); -#endif /* INCLUDED_sysproc_h_ */ +#ifdef MSDOS +/* #include <process.h> */ +/* Damn that local process.h! Instead we can define P_WAIT ourselves. */ +#define P_WAIT 1 +#endif diff -r 12e008d41344 -r 697ef44129c6 src/syspwd.h --- a/src/syspwd.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/syspwd.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,21 +19,5 @@ /* Synched up with: Not really in FSF. */ -#ifndef WIN32_NATIVE - -# include <pwd.h> - -#else /* WIN32_NATIVE */ +#include <pwd.h> -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 /* WIN32_NATIVE */ diff -r 12e008d41344 -r 697ef44129c6 src/syssignal.h --- a/src/syssignal.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/syssignal.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_syssignal_h_ -#define INCLUDED_syssignal_h_ +#ifndef _XEMACS_SYSSIGNAL_H_ +#define _XEMACS_SYSSIGNAL_H_ /* In the old world, one could not #include <signal.h> here. The party line was that that header should always be #included before <config.h>, because @@ -212,8 +212,8 @@ #ifdef BSD #define EMACS_KILLPG(gid, signo) killpg (gid, signo) #else -#ifdef WIN32_NATIVE -#define EMACS_KILLPG(gid, signo) kill (gid, signo) +#ifdef WINDOWSNT +#define EMACS_KILLPG(gid, signo) (kill (gid, signo)) #else #define EMACS_KILLPG(gid, signo) kill (-(gid), signo) #endif @@ -227,21 +227,21 @@ configure incorrectly fails to find it, so s/linux.h defines HAVE_SYS_SIGLIST. */ #if !defined (SYS_SIGLIST_DECLARED) && !defined (HAVE_SYS_SIGLIST) -extern const char *sys_siglist[]; +extern CONST char *sys_siglist[]; #endif #ifdef SIGDANGER SIGTYPE memory_warning_signal (int sig); #endif -#ifdef WIN32_NATIVE +#ifdef _WIN32 /* Prototypes for signal functions, see nt.c */ -typedef void (__cdecl *mswindows_sighandler) (int); -mswindows_sighandler mswindows_sigset (int sig, mswindows_sighandler handler); -int mswindows_sighold (int nsig); -int mswindows_sigrelse (int nsig); -int mswindows_sigpause (int nsig); -int mswindows_raise (int nsig); -#endif /* WIN32_NATIVE */ +typedef void (__cdecl *msw_sighandler) (int); +msw_sighandler msw_sigset (int sig, msw_sighandler handler); +int msw_sighold (int nsig); +int msw_sigrelse (int nsig); +int msw_sigpause (int nsig); +int msw_raise (int nsig); +#endif /* _WIN32 */ -#endif /* INCLUDED_syssignal_h_ */ +#endif /* _XEMACS_SYSSIGNAL_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/systime.h --- a/src/systime.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/systime.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,18 +20,18 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_systime_h_ -#define INCLUDED_systime_h_ +#ifndef _XEMACS_SYSTIME_H_ +#define _XEMACS_SYSTIME_H_ #ifdef TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> +#include <sys/time.h> +#include <time.h> #else -# ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif #endif /* select() is supposed to be (Unix98) defined in sys/time.h, @@ -41,33 +41,17 @@ #include <unistd.h> #endif -#ifdef WIN32_NATIVE - -/* This defines struct timeval */ -#include <winsock.h> - -struct timezone - { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ - }; - -#ifdef HAVE_X_WINDOWS +#if defined(WINDOWSNT) && defined(HAVE_X_WINDOWS) /* Provides gettimeofday etc */ #include <X11/Xw32defs.h> #include <X11/Xos.h> -#else -/* X11R6 on NT provides the single parameter version of this command */ -void gettimeofday (struct timeval *, struct timezone *); -#endif /* HAVE_X_WINDOWS */ - -#endif /* WIN32_NATIVE */ +#endif #ifdef HAVE_UTIME_H # include <utime.h> #endif -#if defined(HAVE_TZNAME) && !defined(WIN32_NATIVE) && !defined(CYGWIN) +#ifdef HAVE_TZNAME #ifndef tzname /* For SGI. */ extern char *tzname[]; /* RS6000 and others want it this way. */ #endif @@ -163,23 +147,37 @@ #define EMACS_SET_USECS(time, microseconds) ((time).tv_usec = (microseconds)) #if !defined (HAVE_GETTIMEOFDAY) -int gettimeofday (struct timeval *, void *); +struct timezone; +int gettimeofday (struct timeval *, struct timezone *); #endif /* On SVR4, the compiler may complain if given this extra BSD arg. */ #ifdef GETTIMEOFDAY_ONE_ARGUMENT -#define EMACS_GETTIMEOFDAY(time) gettimeofday(time) -#else -#define EMACS_GETTIMEOFDAY(time) gettimeofday(time,0) -#endif - +# ifdef SOLARIS2 +/* Solaris (at least) omits this prototype. IRIX5 has it and chokes if we + declare it here. */ +int gettimeofday (struct timeval *); +# endif /* According to the Xt sources, some NTP daemons on some systems may return non-normalized values. */ #define EMACS_GET_TIME(time) \ do { \ - EMACS_GETTIMEOFDAY (&(time)); \ + gettimeofday (&(time)); \ EMACS_NORMALIZE_TIME (time); \ } while (0) +#else /* not GETTIMEOFDAY_ONE_ARGUMENT */ +# ifdef SOLARIS2 +/* Solaris doesn't provide any prototype of this unless a bunch of + crap we don't define are defined. */ +int gettimeofday (struct timeval *, void *dummy); +# endif +#define EMACS_GET_TIME(time) \ +do { \ + struct timezone dummy; \ + gettimeofday (&(time), &dummy); \ + EMACS_NORMALIZE_TIME (time); \ +} while (0) +#endif /* not GETTIMEOFDAY_ONE_ARGUMENT */ #define EMACS_NORMALIZE_TIME(time) \ do { \ @@ -233,7 +231,7 @@ void get_process_times (double *user_time, double *system_time, double *real_time); -#if defined(WIN32_NATIVE) || defined(BROKEN_CYGWIN) +#if defined(WINDOWSNT) || defined(BROKEN_CYGWIN) || defined(__MINGW32__) /* setitimer emulation for Win32 (see nt.c) */ @@ -249,6 +247,6 @@ #define ITIMER_REAL 1 #define ITIMER_PROF 2 -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ -#endif /* INCLUDED_systime_h_ */ +#endif /* _XEMACS_SYSTIME_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/systty.h --- a/src/systty.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/systty.h Mon Aug 13 11:20:41 2007 +0200 @@ -20,8 +20,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_systty_h_ -#define INCLUDED_systty_h_ +#ifndef _XEMACS_SYSTTY_H_ +#define _XEMACS_SYSTTY_H_ #ifdef HAVE_TERMIOS # define HAVE_TCATTR @@ -94,9 +94,9 @@ # include <fcntl.h> # endif -#elif defined (WIN32_NATIVE) +#elif defined (DOS_NT) -/***** (3) The WIN32_NATIVE way *****/ +/***** (3) The MSDOS/NT way *****/ /* Nothing doing */ @@ -124,7 +124,7 @@ /* Generally useful to include this file: */ /* But Sun OS has broken include files and doesn't want it included */ -#if !defined (WIN32_NATIVE) && !defined (SUNOS4) +#if !defined (DOS_NT) && !defined (WIN32) && !defined (SUNOS4) # include <sys/ioctl.h> #endif /* UNIPLUS systems may have FIONREAD. */ @@ -181,6 +181,10 @@ /* ----------------------------------------------------- */ +#ifdef APOLLO +#undef TIOCSTART +#endif + #if defined (XENIX) || defined (BROKEN_TIOCGETC) #undef TIOCGETC /* Avoid confusing some conditionals that test this. */ #endif @@ -333,8 +337,8 @@ No big loss -- it just means that ^Z won't work right if we're run from sh. */ # define EMACS_SET_PROCESS_GROUP(pg) -#elif defined(MINGW) -# define EMACS_SEPARATE_PROCESS_GROUP() +#elif defined(__MINGW32__) +# define EMACS_SEPARATE_PROCESS_GROUP() #else /* Under NeXTstep, a process group of 0 is not the same as specifying your own process ID, so we go ahead and specify it explicitly. */ @@ -354,11 +358,11 @@ emacs_tty should contain an element for each parameter struct that Emacs may change. - emacs_get_tty (int FD, struct emacs_tty *P) stores the parameters + EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters of the tty on FD in *P. Return zero if all's well, or -1 if we ran into an error we couldn't deal with. - emacs_set_tty (int FD, struct emacs_tty *P, int flushp) + EMACS_SET_TTY (int FD, struct emacs_tty *P, int flushp) sets the parameters of the tty on FD according to the contents of *P. If flushp is non-zero, we discard queued input to be written before making the change. @@ -384,11 +388,11 @@ #ifdef HAVE_TERMIO struct termio main; #else /* !HAVE_TERMIO */ -#ifdef WIN32_NATIVE +#ifdef DOS_NT int main; -#else /* not WIN32_NATIVE */ +#else /* not DOS_NT */ struct sgttyb main; -#endif /* not WIN32_NATIVE */ +#endif /* not DOS_NT */ #endif /* !HAVE_TERMIO */ #endif /* !HAVE_TCATTR */ @@ -405,9 +409,15 @@ #endif /* HAVE_TCHARS */ #endif /* HAVE_TERMIOS */ }; + +/* Define EMACS_GET_TTY and EMACS_SET_TTY, + the macros for reading and setting parts of `struct emacs_tty'. -int emacs_get_tty (int fd, struct emacs_tty *settings); -int emacs_set_tty (int fd, struct emacs_tty *settings, int flushp); + These got pretty unmanageable (huge macros are hard to debug), and + finally needed some code which couldn't be done as part of an + expression, so we moved them out to their own functions in sysdep.c. */ +#define EMACS_GET_TTY(fd, p) emacs_get_tty (fd, p) +#define EMACS_SET_TTY(fd, p, waitp) emacs_set_tty (fd, p, waitp) /* --------------------------------------------------------- */ @@ -428,13 +438,13 @@ #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3) #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */ -#ifdef WIN32_NATIVE +#ifdef DOS_NT #define EMACS_TTY_TABS_OK(p) 0 -#else /* not WIN32_NATIVE */ +#else /* not DOS_NT */ #define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS) -#endif /* not WIN32_NATIVE */ +#endif /* not DOS_NT */ #endif /* not def HAVE_TERMIO */ #endif /* not def HAVE_TERMIOS */ -#endif /* INCLUDED_systty_h_ */ +#endif /* _XEMACS_SYSTTY_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/syswait.h --- a/src/syswait.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/syswait.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,8 +19,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef INCLUDED_syswait_h_ -#define INCLUDED_syswait_h_ +/* Cleanup by Martin Buchholz for Autoconf 2 (see the Autoconf Manual) */ #include <sys/types.h> @@ -53,4 +52,3 @@ #define WRETCODE(s) ((s) >> 8) #endif -#endif /* INCLUDED_syswait_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/syswindows.h --- a/src/syswindows.h Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - Copyright (C) 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. */ - -/* Authorship: - - Created May 2000 by Andy Piper. - Windows-Mule stuff added by Ben Wing. -*/ - -#ifndef INCLUDED_syswindows_h_ -#define INCLUDED_syswindows_h_ - -/* Note that there are currently FOUR different general - Windows-related include files in src! - - Uses are approximately: - - syswindows.h: Mostly a wrapper around <windows.h>, including missing - defines as necessary. Also includes stuff needed on both Cygwin and - native Windows, regardless of window system chosen. - - console-msw.h: Used on both Cygwin and native Windows, but only when - native window system (as opposed to X) chosen. - - nt.h: [will be renamed to win32.h] Used only on native Windows, and - regardless of window system chosen -- but used on both purely native - Windows (s/windowsnt.h) and MinGW (s/mingw32.h). - - ntheap.h: Used only on native Windows and only when standard dumping - mechanism (unexnt.c) used. - - All of the last three files include the first. -*/ - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include <windows.h> - -#if (defined (CYGWIN) || defined(MINGW)) && \ - CYGWIN_VERSION_DLL_MAJOR < 21 -extern BOOL WINAPI DdeFreeStringHandle(DWORD,HSZ); -extern BOOL WINAPI PlaySound(LPCSTR,HMODULE,DWORD); -#define stricmp strcasecmp -#define FONTENUMPROC FONTENUMEXPROC -#define ntmTm ntmentm -#elif defined (WIN32_LEAN_AND_MEAN) -#include <winspool.h> -#include <mmsystem.h> -#include <shellapi.h> -#include <ddeml.h> -#endif - -/* mmsystem.h defines. */ -#ifndef SND_ASYNC -#define SND_ASYNC 1 -#endif -#ifndef SND_NODEFAULT -#define SND_NODEFAULT 2 -#endif -#ifndef SND_MEMORY -#define SND_MEMORY 4 -#endif -#ifndef SND_FILENAME -#define SND_FILENAME 0x2000L -#endif - -/* winspool.h defines. */ -#ifndef PHYSICALWIDTH -#define PHYSICALWIDTH 110 -#endif -#ifndef PHYSICALHEIGHT -#define PHYSICALHEIGHT 111 -#endif -#ifndef PHYSICALOFFSETX -#define PHYSICALOFFSETX 112 -#endif -#ifndef PHYSICALOFFSETY -#define PHYSICALOFFSETY 113 -#endif - -/* windows.h defines. */ -#if defined (CYGWIN) && (CYGWIN_VERSION_DLL_MAJOR < 20) -typedef NMHDR *LPNMHDR; -#endif - -#ifndef SPI_GETWHEELSCROLLLINES -#define SPI_GETWHEELSCROLLLINES 104 -#endif -#ifndef WHEEL_PAGESCROLL -#define WHEEL_PAGESCROLL (UINT_MAX) -#endif -#ifndef WHEEL_DELTA -#define WHEEL_DELTA 120 -#endif -#ifndef WM_MOUSEWHEEL -#define WM_MOUSEWHEEL 0x20A -#endif -#ifndef VK_APPS -#define VK_APPS 0x5D -#endif -#ifndef SIF_TRACKPOS -#define SIF_TRACKPOS 0x0010 -#endif -#ifndef FW_BLACK -#define FW_BLACK FW_HEAVY -#endif -#ifndef FW_ULTRABOLD -#define FW_ULTRABOLD FW_EXTRABOLD -#endif -#ifndef FW_DEMIBOLD -#define FW_DEMIBOLD FW_SEMIBOLD -#endif -#ifndef FW_ULTRALIGHT -#define FW_ULTRALIGHT FW_EXTRALIGHT -#endif -#ifndef APPCMD_FILTERINITS -#define APPCMD_FILTERINITS 0x20L -#endif -#ifndef CBF_FAIL_SELFCONNECTIONS -#define CBF_FAIL_SELFCONNECTIONS 0x1000 -#endif -#ifndef CBF_SKIP_ALLNOTIFICATIONS -#define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000 -#endif -#ifndef CBF_FAIL_ADVISES -#define CBF_FAIL_ADVISES 0x4000 -#endif -#ifndef CBF_FAIL_POKES -#define CBF_FAIL_POKES 0x10000 -#endif -#ifndef CBF_FAIL_REQUESTS -#define CBF_FAIL_REQUESTS 0x20000 -#endif -#ifndef SZDDESYS_TOPIC -#define SZDDESYS_TOPIC "System" -#endif -#ifndef JOHAB_CHARSET -#define JOHAB_CHARSET 130 -#endif -#ifndef MAC_CHARSET -#define MAC_CHARSET 77 -#endif - -/***************************************************************/ - -/* Definitions for Mule under MS Windows */ - -/* extern int mswindows_windows9x_p; */ -/* #define EIUNICODE_P (!mswindows_windows9x_p) */ -#define EIUNICODE_P 0 - -#define EITCHAR_SIZE (EIUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR)) -#define EITEXT(arg) (EIUNICODE_P ? L##arg : (arg)) -#define EICOPY_TCHAR(ptr, ch) \ - (EIUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch))) - -#endif /* INCLUDED_syswindows_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/termcap.c --- a/src/termcap.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/termcap.c Mon Aug 13 11:20:41 2007 +0200 @@ -26,9 +26,18 @@ #include "lisp.h" /* For encapsulated open, close, read */ #include "device.h" /* For DEVICE_BAUD_RATE */ #else /* not emacs */ +#if defined(USG) || defined(STDC_HEADERS) +#define memcpy(d, s, n) memcpy ((d), (s), (n)) +#endif +#ifdef STDC_HEADERS #include <stdlib.h> #include <string.h> +#else +char *getenv (); +char *malloc (); +char *realloc (); +#endif #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -94,16 +103,16 @@ for tgetnum, tgetflag and tgetstr to find. */ static char *term_entry; -static const char *tgetst1 (const char *ptr, char **area); +static CONST char *tgetst1 (CONST char *ptr, char **area); /* Search entry BP for capability CAP. Return a pointer to the capability (in BP) if found, 0 if not found. */ -static const char * +static CONST char * find_capability (bp, cap) - const char *bp; - const char *cap; + CONST char *bp; + CONST char *cap; { for (; *bp; bp++) if (bp[0] == ':' @@ -115,9 +124,9 @@ int tgetnum (cap) - const char *cap; + CONST char *cap; { - const char *ptr = find_capability (term_entry, cap); + CONST char *ptr = find_capability (term_entry, cap); if (!ptr || ptr[-1] != '#') return -1; return atoi (ptr); @@ -125,9 +134,9 @@ int tgetflag (cap) - const char *cap; + CONST char *cap; { - const char *ptr = find_capability (term_entry, cap); + CONST char *ptr = find_capability (term_entry, cap); return 0 != ptr && ptr[-1] == ':'; } @@ -136,12 +145,12 @@ to store the string. That pointer is advanced over the space used. If AREA is zero, space is allocated with `malloc'. */ -const char * +CONST char * tgetstr (cap, area) - const char *cap; + CONST char *cap; char **area; { - const char *ptr = find_capability (term_entry, cap); + CONST char *ptr = find_capability (term_entry, cap); if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) return 0; return tgetst1 (ptr, area); @@ -162,12 +171,12 @@ into the block that *AREA points to, or to newly allocated storage if AREA is 0. */ -static const char * +static CONST char * tgetst1 (ptr, area) - const char *ptr; + CONST char *ptr; char **area; { - const char *p; + CONST char *p; char *r; int c; int size; @@ -250,7 +259,7 @@ void tputs (string, nlines, outfun) - const char *string; + CONST char *string; int nlines; void (*outfun) (int); { @@ -269,7 +278,7 @@ if (string == (char *) 0) return; - while (isdigit (* (const unsigned char *) string)) + while (isdigit (* (CONST unsigned char *) string)) { padcount += *string++ - '0'; padcount *= 10; @@ -328,21 +337,23 @@ If BP is zero, space is dynamically allocated. */ +extern char *getenv (); + int tgetent (bp, name) char *bp; - const char *name; + CONST char *name; { char *tem; int fd; struct buffer buf; char *bp1; char *bp2; - const char *term; + CONST char *term; int malloc_size = 0; int c; char *tcenv; /* TERMCAP value, if it contais :tc=. */ - const char *indirect = 0; /* Terminal type in :tc= in TERMCAP value. */ + CONST char *indirect = 0; /* Terminal type in :tc= in TERMCAP value. */ tem = getenv ("TERMCAP"); if (tem && *tem == 0) tem = 0; @@ -354,7 +365,7 @@ it is the entry itself, but only if the name the caller requested matches the TERM variable. */ - if (tem && !IS_DIRECTORY_SEP (*tem) && !strcmp (name, getenv ("TERM"))) + if (tem && !IS_DIRECTORY_SEP (*tem) && !strcmp (name, (char *) getenv ("TERM"))) { indirect = tgetst1 (find_capability (tem, "tc"), 0); if (!indirect) @@ -637,7 +648,7 @@ } tprint (cap) - const char *cap; + CONST char *cap; { char *x = tgetstr (cap, 0); char *y; diff -r 12e008d41344 -r 697ef44129c6 src/terminfo.c --- a/src/terminfo.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/terminfo.c Mon Aug 13 11:20:41 2007 +0200 @@ -48,7 +48,7 @@ format is different too. */ -#include CURSES_H_FILE +#include CURSES_H_PATH /* Sun, in their infinite lameness, supplies (possibly) broken headers even under Solaris. GCC feels it necessary to correct things by supplying its own headers. Unfortunately, if you build GCC under @@ -59,20 +59,20 @@ but not term.h.) However, it seems to work to just not include term.h under Solaris, so we try that. KLUDGE! */ #if !(defined (__GNUC__) && defined (SOLARIS2)) -#include TERM_H_FILE +#include TERM_H_PATH #endif extern void *xmalloc (int size); #if 0 /* If this isn't declared somewhere, too bad */ -extern char * tparm (const char *string, int arg1, int arg2, int arg3, +extern char * tparm (CONST char *string, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9); #endif /* XEmacs: renamed this function because just tparam() conflicts with ncurses (We don't use this function anyway!) */ char * -emacs_tparam (const char *string, char *outstring, int len, int arg1, +emacs_tparam (CONST char *string, char *outstring, int len, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) { @@ -81,7 +81,7 @@ temp = (char *) tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); if (outstring == 0) - outstring = (char *) xmalloc (strlen (temp) + 1); + outstring = ((char *) (xmalloc ((strlen (temp)) + 1))); strcpy (outstring, temp); return outstring; } diff -r 12e008d41344 -r 697ef44129c6 src/tests.c --- a/src/tests.c Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,436 +0,0 @@ -/* C support for testing XEmacs - see tests/automated/c-tests.el - Copyright (C) 2000 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. */ - -/* Author: Martin Buchholz - - This file provides support for running tests for XEmacs that cannot - be written entirely in Lisp. These tests are run automatically via - tests/automated/c-tests.el, or can be run by hand using M-x */ - - -#include <config.h> -#include "lisp.h" -#include "buffer.h" -#include "lstream.h" -#include "opaque.h" - -static Lisp_Object Vtest_function_list; - - -DEFUN ("test-data-format-conversion", Ftest_data_format_conversion, 0, 0, "", /* -Test TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT() -*/ - ()) -{ - void *ptr; size_t len; - Lisp_Object string, opaque; - - Bufbyte int_foo[] = "\n\nfoo\nbar"; - Extbyte ext_unix[]= "\n\nfoo\nbar"; - - Extbyte ext_dos[] = "\r\n\r\nfoo\r\nbar"; - Extbyte ext_mac[] = "\r\rfoo\rbar"; - Lisp_Object opaque_dos = make_opaque (ext_dos, sizeof (ext_dos) - 1); - Lisp_Object string_foo = make_string (int_foo, sizeof (int_foo) - 1); - - Extbyte ext_latin[] = "f\372b\343\340"; - Bufbyte int_latin1[] = "f\201\372b\201\343\201\340"; - Bufbyte int_latin2[] = "f\202\372b\202\343\202\340"; -#ifdef MULE - Extbyte ext_latin12[]= "f\033-A\372b\343\340\033-B"; - Extbyte ext_tilde[] = "f~b~~"; - Lisp_Object string_latin2 = make_string (int_latin2, sizeof (int_latin2) - 1); -#endif - Lisp_Object opaque_latin = make_opaque (ext_latin, sizeof (ext_latin) - 1); - Lisp_Object opaque0_latin = make_opaque (ext_latin, sizeof (ext_latin)); - Lisp_Object string_latin1 = make_string (int_latin1, sizeof (int_latin1) - 1); - - /* Check for expected strings before and after conversion. - Conversions depend on whether MULE is defined, - and on whether FILE_CODING is defined. */ -#ifdef MULE -#define DFC_CHECK_DATA_COND_MULE(ptr,len, \ - constant_string_mule, \ - constant_string_non_mule) \ - DFC_CHECK_DATA (ptr, len, constant_string_mule) -#define DFC_CHECK_DATA_COND_MULE_NUL(ptr,len, \ - constant_string_mule, \ - constant_string_non_mule) \ - DFC_CHECK_DATA_NUL (ptr, len, constant_string_mule) -#else -#define DFC_CHECK_DATA_COND_MULE(ptr,len, \ - constant_string_mule, \ - constant_string_non_mule) \ - DFC_CHECK_DATA (ptr, len, constant_string_non_mule) -#define DFC_CHECK_DATA_COND_MULE_NUL(ptr,len, \ - constant_string_mule, \ - constant_string_non_mule) \ - DFC_CHECK_DATA_NUL (ptr, len, constant_string_non_mule) -#endif - -#ifdef FILE_CODING -#define DFC_CHECK_DATA_COND_EOL(ptr,len, \ - constant_string_eol, \ - constant_string_non_eol) \ - DFC_CHECK_DATA (ptr, len, constant_string_eol) -#define DFC_CHECK_DATA_COND_EOL_NUL(ptr,len, \ - constant_string_eol, \ - constant_string_non_eol) \ - DFC_CHECK_DATA_NUL (ptr, len, constant_string_eol) -#else -#define DFC_CHECK_DATA_COND_EOL(ptr,len, \ - constant_string_eol, \ - constant_string_non_eol) \ - DFC_CHECK_DATA (ptr, len, constant_string_non_eol) -#define DFC_CHECK_DATA_COND_EOL_NUL(ptr,len, \ - constant_string_eol, \ - constant_string_non_eol) \ - DFC_CHECK_DATA_NUL (ptr, len, constant_string_non_eol) -#endif - - /* Check for expected strings before and after conversion. */ -#define DFC_CHECK_DATA(ptr,len, constant_string) do { \ - assert ((len) == sizeof (constant_string) - 1); \ - assert (!memcmp (ptr, constant_string, len)); \ - } while (0) - - /* Macro version that includes the trailing NULL byte. */ -#define DFC_CHECK_DATA_NUL(ptr,len,constant_string) do {\ - assert ((len) == sizeof (constant_string)); \ - assert (!memcmp (ptr, constant_string, len)); \ - } while (0) - -#ifdef MULE - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)), - ALLOCA, (ptr, len), - Fget_coding_system (intern ("iso-8859-2"))); - DFC_CHECK_DATA_NUL (ptr, len, ext_latin); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_latin2, - ALLOCA, (ptr, len), - Fget_coding_system (intern ("iso-8859-2"))); - DFC_CHECK_DATA (ptr, len, ext_latin); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1, - ALLOCA, (ptr, len), - Fget_coding_system (intern ("iso-8859-2"))); - DFC_CHECK_DATA (ptr, len, ext_latin12); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1), - MALLOC, (ptr, len), - Fget_coding_system (intern ("iso-8859-2"))); - DFC_CHECK_DATA (ptr, len, ext_latin); - xfree (ptr); - - TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1), - LISP_OPAQUE, opaque, - Fget_coding_system (intern ("iso-8859-2"))); - DFC_CHECK_DATA (XOPAQUE_DATA (opaque), XOPAQUE_SIZE (opaque), ext_latin); - - ptr = NULL, len = rand(); - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1), - ALLOCA, (ptr, len), - intern ("iso-8859-2")); - DFC_CHECK_DATA (ptr, len, int_latin2); - - ptr = NULL, len = rand(); - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1), - MALLOC, (ptr, len), - intern ("iso-8859-2")); - DFC_CHECK_DATA (ptr, len, int_latin2); - xfree (ptr); - - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1), - LISP_STRING, string, - intern ("iso-8859-2")); - DFC_CHECK_DATA (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2); - - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin, - LISP_STRING, string, - intern ("iso-8859-2")); - DFC_CHECK_DATA (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2); - - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin, - LISP_STRING, string, - intern ("iso-8859-2")); - DFC_CHECK_DATA_NUL (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2); - - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin, - LISP_BUFFER, Fcurrent_buffer(), - intern ("iso-8859-2")); - DFC_CHECK_DATA_NUL (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)), - sizeof (int_latin2), int_latin2); - - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin, - LISP_BUFFER, Fcurrent_buffer(), - intern ("iso-8859-1")); - DFC_CHECK_DATA (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)), - sizeof (int_latin1) - 1, int_latin1); - - TO_INTERNAL_FORMAT (DATA, (ext_latin12, sizeof (ext_latin12) - 1), - ALLOCA, (ptr, len), - intern ("iso-8859-2")); - DFC_CHECK_DATA (ptr, len, int_latin1); - -#endif /* MULE */ - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1), - ALLOCA, (ptr, len), - Qbinary); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1)), - ALLOCA, (ptr, len), - Qbinary); - DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_latin, int_latin1); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1), - ALLOCA, (ptr, len), - Fget_coding_system (Qbinary)); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_tilde, int_latin2); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1), - ALLOCA, (ptr, len), - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1, - ALLOCA, (ptr, len), - Qbinary); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1, - ALLOCA, (ptr, len), - Fget_coding_system (Qbinary)); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1, - ALLOCA, (ptr, len), - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1), - MALLOC, (ptr, len), - Qbinary); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - xfree (ptr); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)), - MALLOC, (ptr, len), - Fget_coding_system (Qbinary)); - DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_tilde, int_latin2); - xfree (ptr); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1), - MALLOC, (ptr, len), - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1); - xfree (ptr); - - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1), - LISP_OPAQUE, opaque, - Qbinary); - DFC_CHECK_DATA_COND_MULE (XOPAQUE_DATA (opaque), - XOPAQUE_SIZE (opaque), ext_latin, int_latin1); - - TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)), - LISP_OPAQUE, opaque, - Fget_coding_system (Qbinary)); - DFC_CHECK_DATA_COND_MULE_NUL (XOPAQUE_DATA (opaque), - XOPAQUE_SIZE (opaque), ext_tilde, int_latin2); - - TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1), - LISP_OPAQUE, opaque, - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE (XOPAQUE_DATA (opaque), - XOPAQUE_SIZE (opaque), ext_latin, int_latin1); - - ptr = NULL, len = rand(); - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1), - ALLOCA, (ptr, len), - Qbinary); - DFC_CHECK_DATA_COND_MULE (ptr, len, int_latin1, ext_latin); - - ptr = NULL, len = rand(); - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)), - ALLOCA, (ptr, len), - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin); - - ptr = NULL, len = rand(); - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)), - MALLOC, (ptr, len), - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin); - xfree (ptr); - - ptr = NULL, len = rand(); - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)), - MALLOC, (ptr, len), - Qnil); - DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin); - xfree (ptr); - - TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1), - LISP_STRING, string, - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE (XSTRING_DATA (string), - XSTRING_LENGTH (string), int_latin1, ext_latin); - - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin, - LISP_STRING, string, - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE (XSTRING_DATA (string), - XSTRING_LENGTH (string), int_latin1, ext_latin); - - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin, - LISP_STRING, string, - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_MULE_NUL (XSTRING_DATA (string), - XSTRING_LENGTH (string), int_latin1, ext_latin); - - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo)), - MALLOC, (ptr, len), - Fget_coding_system (Qbinary)); - DFC_CHECK_DATA_COND_EOL_NUL (ptr, len, ext_unix, int_foo); - xfree (ptr); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1), - LISP_OPAQUE, opaque, - intern ("raw-text-mac")); - DFC_CHECK_DATA_COND_EOL (XOPAQUE_DATA (opaque), - XOPAQUE_SIZE (opaque), ext_mac, int_foo); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_foo, - ALLOCA, (ptr, len), - intern ("raw-text-dos")); - DFC_CHECK_DATA_COND_EOL (ptr, len, ext_dos, int_foo); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1), - ALLOCA, (ptr, len), - intern ("raw-text-unix")); - DFC_CHECK_DATA_COND_EOL (ptr, len, ext_unix, int_foo); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_STRING, string_foo, - MALLOC, (ptr, len), - intern ("no-conversion-mac")); - DFC_CHECK_DATA_COND_EOL (ptr, len, ext_mac, int_foo); - xfree (ptr); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1), - ALLOCA, (ptr, len), - Fget_coding_system (intern ("no-conversion-dos"))); - DFC_CHECK_DATA_COND_EOL (ptr, len, ext_dos, int_foo); - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo)), - ALLOCA, (ptr, len), - intern ("no-conversion-unix")); - DFC_CHECK_DATA_COND_EOL_NUL (ptr, len, ext_unix, int_foo); - -#ifdef FILE_CODING - TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_dos, - LISP_BUFFER, Fcurrent_buffer(), - intern ("undecided")); - DFC_CHECK_DATA (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)), - sizeof (int_foo) - 1, int_foo); - -#endif /* FILE_CODING */ - - TO_INTERNAL_FORMAT (DATA, (ext_mac, sizeof (ext_mac) - 1), - LISP_STRING, string, - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string), - XSTRING_LENGTH (string), int_foo, ext_mac); - - { - Lisp_Object stream = - make_fixed_buffer_input_stream (ext_dos, sizeof (ext_dos) - 1); - TO_INTERNAL_FORMAT (LISP_LSTREAM, stream, - LISP_STRING, string, - intern ("iso-8859-1")); - DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string), - XSTRING_LENGTH (string), int_foo, ext_dos); - } - - TO_INTERNAL_FORMAT (DATA, (ext_unix, sizeof (ext_unix) - 1), - LISP_STRING, string, - intern ("no-conversion")); - DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string), - XSTRING_LENGTH (string), int_foo, ext_unix); - - - ptr = NULL, len = rand(); - TO_EXTERNAL_FORMAT (LISP_OPAQUE, opaque_dos, - ALLOCA, (ptr, len), - Qbinary); - DFC_CHECK_DATA (ptr, len, ext_dos); - - return intern ("PASS"); -} - - - -#define TESTS_DEFSUBR(Fname) do { \ - DEFSUBR (Fname); \ - Vtest_function_list = \ - Fcons (intern (subr_name (&S##Fname)), \ - Vtest_function_list); \ -} while (0) - -void -syms_of_tests (void) -{ - Vtest_function_list = Qnil; - - TESTS_DEFSUBR (Ftest_data_format_conversion); - /* Add other test functions here with TESTS_DEFSUBR */ -} - -void -vars_of_tests (void) -{ - DEFVAR_LISP ("test-function-list", &Vtest_function_list /* -List of all test functions defined in tests.c. -For use by the automated test suite. See tests/automated/c-tests. -*/ ); -} diff -r 12e008d41344 -r 697ef44129c6 src/toolbar-msw.c --- a/src/toolbar-msw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/toolbar-msw.c Mon Aug 13 11:20:41 2007 +0200 @@ -46,14 +46,19 @@ #define TOOLBAR_ID_BIAS 16 #define TOOLBAR_HANDLE(f,p) \ GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + p) - +#ifndef TB_SETIMAGELIST +#define TB_SETIMAGELIST (WM_USER + 48) +#define TB_GETIMAGELIST (WM_USER + 49) +#define TB_SETDISABLEDIMAGELIST (WM_USER + 54) +#define TB_GETDISABLEDIMAGELIST (WM_USER + 55) +#endif +#ifndef TB_SETPADDING +#define TB_SETPADDING (WM_USER + 87) +#endif #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2 #define MSWINDOWS_BLANK_SIZE 5 #define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8 -static void -mswindows_move_toolbar (struct frame *f, enum toolbar_pos pos); - #define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \ do { \ switch (pos) \ @@ -123,7 +128,7 @@ ShowWindow(toolbarwnd, SW_HIDE); } - FRAME_MSWINDOWS_TOOLBAR_CHECKSUM (f, pos) = 0; + FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)=0; SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0); } @@ -204,7 +209,7 @@ internal_hash (get_toolbar_button_glyph(w, tb), 0), internal_hash (tb->callback, 0), width, - LISP_HASH (w->toolbar_buttons_captioned_p)); + w->toolbar_buttons_captioned_p); button = tb->next; nbuttons++; } @@ -215,7 +220,7 @@ /* remove the old one */ mswindows_clear_toolbar (f, pos, 0); - FRAME_MSWINDOWS_TOOLBAR_CHECKSUM (f, pos)=checksum; + FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)=checksum; /* build up the data required by win32 fns. */ button_tbl = xnew_array_and_zero (TBBUTTON, nbuttons); @@ -254,7 +259,7 @@ if (IMAGE_INSTANCEP (instance)) { - Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance); + struct Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance); if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p)) { @@ -376,12 +381,10 @@ CreateWindowEx ( WS_EX_WINDOWEDGE, TOOLBARCLASSNAME, NULL, - WS_CHILD + WS_CHILD | WS_VISIBLE | (style_3d ? WS_DLGFRAME : 0) - | TBSTYLE_TOOLTIPS - | CCS_NORESIZE - | CCS_NOPARENTALIGN | CCS_NODIVIDER - | CCS_ADJUSTABLE, + | TBSTYLE_TOOLTIPS | CCS_NORESIZE + | CCS_NOPARENTALIGN | CCS_NODIVIDER, x, y, bar_width, bar_height, FRAME_MSWINDOWS_HANDLE (f), (HMENU)(TOOLBAR_ID_BIAS + pos), @@ -457,9 +460,6 @@ /* now display the window */ ShowWindow (toolbarwnd, SW_SHOW); - /* no idea why this is necessary but initial display will not - happen otherwise. */ - mswindows_move_toolbar (f, pos); if (button_tbl) xfree (button_tbl); @@ -525,13 +525,6 @@ } static void -mswindows_redraw_frame_toolbars (struct frame *f) -{ - mswindows_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f), - FRAME_PIXHEIGHT (f)); -} - -static void mswindows_initialize_frame_toolbars (struct frame *f) { @@ -567,10 +560,9 @@ mswindows_free_frame_toolbars (struct frame *f) { HWND twnd=NULL; -#define DELETE_TOOLBAR(pos) \ - mswindows_clear_toolbar(f, pos, 0); \ - if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), \ - TOOLBAR_ID_BIAS + pos))) \ +#define DELETE_TOOLBAR(pos) \ + mswindows_clear_toolbar(f, 0, pos); \ + if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + pos))) \ DestroyWindow(twnd) DELETE_TOOLBAR(TOP_TOOLBAR); @@ -581,7 +573,7 @@ } /* map toolbar hwnd to pos*/ -static int mswindows_find_toolbar_pos(struct frame* f, HWND ctrl) +int mswindows_find_toolbar_pos(struct frame* f, HWND ctrl) { int id = GetDlgCtrlID(ctrl); return id ? id - TOOLBAR_ID_BIAS : -1; @@ -644,6 +636,5 @@ CONSOLE_HAS_METHOD (mswindows, initialize_frame_toolbars); CONSOLE_HAS_METHOD (mswindows, free_frame_toolbars); CONSOLE_HAS_METHOD (mswindows, redraw_exposed_toolbars); - CONSOLE_HAS_METHOD (mswindows, redraw_frame_toolbars); } diff -r 12e008d41344 -r 697ef44129c6 src/toolbar-x.c --- a/src/toolbar-x.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/toolbar-x.c Mon Aug 13 11:20:41 2007 +0200 @@ -77,8 +77,7 @@ /* Draw the outline. */ x_output_shadows (f, sx, sy, swidth, sheight, top_shadow_gc, - bottom_shadow_gc, background_gc, shadow_thickness, - EDGE_ALL); + bottom_shadow_gc, background_gc, shadow_thickness); /* Blank the middle. */ XFillRectangle (dpy, x_win, background_gc, sx + shadow_thickness, @@ -109,7 +108,7 @@ GC top_shadow_gc, bottom_shadow_gc, background_gc; Lisp_Object instance, frame, window, glyph; struct toolbar_button *tb = XTOOLBAR_BUTTON (button); - Lisp_Image_Instance *p; + struct Lisp_Image_Instance *p; struct window *w; int vertical = tb->vertical; int border_width = tb->border_width; @@ -159,8 +158,7 @@ x_output_shadows (f, tb->x + x_adj, tb->y + y_adj, tb->width + width_adj, tb->height + height_adj, top_shadow_gc, - bottom_shadow_gc, background_gc, shadow_thickness, - EDGE_ALL); + bottom_shadow_gc, background_gc, shadow_thickness); /* Clear the pixmap area. */ XFillRectangle (dpy, x_win, background_gc, tb->x + x_adj + shadow_thickness, @@ -213,8 +211,8 @@ } x_output_x_pixmap (f, XIMAGE_INSTANCE (instance), tb->x + x_offset, - tb->y + y_offset, 0, 0, width, height, - 0, 0, background_gc); + tb->y + y_offset, 0, 0, 0, 0, width, height, + 0, 0, 0, background_gc); } else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT) { @@ -296,9 +294,9 @@ return XINT (f->toolbar_size[pos]); if (vert) - size = glyph_height (glyph, window); + size = glyph_height (glyph, Vdefault_face, 0, window); else - size = glyph_width (glyph, window); + size = glyph_width (glyph, Vdefault_face, 0, window); } if (!size) diff -r 12e008d41344 -r 697ef44129c6 src/toolbar.c --- a/src/toolbar.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/toolbar.c Mon Aug 13 11:20:41 2007 +0200 @@ -57,19 +57,19 @@ static Lisp_Object -mark_toolbar_button (Lisp_Object obj) +mark_toolbar_button (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct toolbar_button *data = XTOOLBAR_BUTTON (obj); - mark_object (data->next); - mark_object (data->frame); - mark_object (data->up_glyph); - mark_object (data->down_glyph); - mark_object (data->disabled_glyph); - mark_object (data->cap_up_glyph); - mark_object (data->cap_down_glyph); - mark_object (data->cap_disabled_glyph); - mark_object (data->callback); - mark_object (data->enabled_p); + markobj (data->next); + markobj (data->frame); + markobj (data->up_glyph); + markobj (data->down_glyph); + markobj (data->disabled_glyph); + markobj (data->cap_up_glyph); + markobj (data->cap_down_glyph); + markobj (data->cap_disabled_glyph); + markobj (data->callback); + markobj (data->enabled_p); return data->help_string; } @@ -90,7 +90,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button, mark_toolbar_button, print_toolbar_button, - 0, 0, 0, 0, + 0, 0, 0, struct toolbar_button); DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /* @@ -722,10 +722,10 @@ static void compute_frame_toolbars_data (struct frame *f) { - set_frame_toolbar (f, TOP_TOOLBAR); - set_frame_toolbar (f, BOTTOM_TOOLBAR); - set_frame_toolbar (f, LEFT_TOOLBAR); - set_frame_toolbar (f, RIGHT_TOOLBAR); + set_frame_toolbar (f, TOP_TOOLBAR); + set_frame_toolbar (f, BOTTOM_TOOLBAR); + set_frame_toolbar (f, LEFT_TOOLBAR); + set_frame_toolbar (f, RIGHT_TOOLBAR); } void @@ -737,7 +737,7 @@ && (f->toolbar_changed || f->frame_changed || f->clear)) { int pos; - + /* We're not officially "in redisplay", so we still have a chance to re-layout toolbars and windows. This is done here, because toolbar is the only thing which currently might @@ -1037,10 +1037,10 @@ if (!CONSP (elt[0])) { /* We can't check the buffer-local here because we don't know - which buffer to check in. #### I think this is a bad thing. - See if we can't get enough information to this function so - that it can check. - + which buffer to check in. #### I think this is a bad thing. + See if we can't get enough information to this function so + that it can check. + #### Wrong. We shouldn't be checking the value at all here. The user might set or change the value at any time. */ value = Fsymbol_value (elt[0]); @@ -1160,9 +1160,14 @@ DEFUN ("toolbar-specifier-p", Ftoolbar_specifier_p, 1, 1, 0, /* Return non-nil if OBJECT is a toolbar specifier. +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. -See `make-toolbar-specifier' for a description of possible toolbar -instantiators. +Valid toolbar instantiators are called "toolbar descriptors" +and are lists of vectors. See `default-toolbar' for a description +of the exact format. */ (object)) { @@ -1267,8 +1272,6 @@ void syms_of_toolbar (void) { - INIT_LRECORD_IMPLEMENTATION (toolbar_button); - defsymbol (&Qtoolbar_buttonp, "toolbar-button-p"); defsymbol (&Q2D, "2D"); defsymbol (&Q3D, "3D"); @@ -1309,12 +1312,6 @@ } void -reinit_specifier_type_create_toolbar (void) -{ - REINITIALIZE_SPECIFIER_TYPE (toolbar); -} - -void specifier_vars_of_toolbar (void) { Lisp_Object fb; @@ -1431,7 +1428,8 @@ automatically knew about specifier fallbacks, so we didn't have to do it ourselves. */ set_specifier_caching (Vdefault_toolbar, - offsetof (struct window, default_toolbar), + slot_offset (struct window, + default_toolbar), default_toolbar_specs_changed, 0, 0); @@ -1443,7 +1441,8 @@ */ ); Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar); set_specifier_caching (Vtoolbar[TOP_TOOLBAR], - offsetof (struct window, toolbar[TOP_TOOLBAR]), + slot_offset (struct window, + toolbar[TOP_TOOLBAR]), toolbar_specs_changed, 0, 0); @@ -1460,7 +1459,8 @@ */ ); Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar); set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR], - offsetof (struct window, toolbar[BOTTOM_TOOLBAR]), + slot_offset (struct window, + toolbar[BOTTOM_TOOLBAR]), toolbar_specs_changed, 0, 0); @@ -1477,7 +1477,8 @@ */ ); Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar); set_specifier_caching (Vtoolbar[LEFT_TOOLBAR], - offsetof (struct window, toolbar[LEFT_TOOLBAR]), + slot_offset (struct window, + toolbar[LEFT_TOOLBAR]), toolbar_specs_changed, 0, 0); @@ -1494,7 +1495,8 @@ */ ); Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar); set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR], - offsetof (struct window, toolbar[RIGHT_TOOLBAR]), + slot_offset (struct window, + toolbar[RIGHT_TOOLBAR]), toolbar_specs_changed, 0, 0); @@ -1548,9 +1550,11 @@ */ ); Vdefault_toolbar_height = Fmake_specifier (Qnatnum); set_specifier_caching (Vdefault_toolbar_height, - offsetof (struct window, default_toolbar_height), + slot_offset (struct window, + default_toolbar_height), default_toolbar_size_changed_in_window, - offsetof (struct frame, default_toolbar_height), + slot_offset (struct frame, + default_toolbar_height), default_toolbar_size_changed_in_frame); DEFVAR_SPECIFIER ("default-toolbar-width", &Vdefault_toolbar_width /* @@ -1561,9 +1565,11 @@ */ ); Vdefault_toolbar_width = Fmake_specifier (Qnatnum); set_specifier_caching (Vdefault_toolbar_width, - offsetof (struct window, default_toolbar_width), + slot_offset (struct window, + default_toolbar_width), default_toolbar_size_changed_in_window, - offsetof (struct frame, default_toolbar_width), + slot_offset (struct frame, + default_toolbar_width), default_toolbar_size_changed_in_frame); DEFVAR_SPECIFIER ("top-toolbar-height", @@ -1575,9 +1581,11 @@ */ ); Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR], - offsetof (struct window, toolbar_size[TOP_TOOLBAR]), + slot_offset (struct window, + toolbar_size[TOP_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[TOP_TOOLBAR]), + slot_offset (struct frame, + toolbar_size[TOP_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("bottom-toolbar-height", @@ -1589,9 +1597,11 @@ */ ); Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR], - offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]), + slot_offset (struct window, + toolbar_size[BOTTOM_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]), + slot_offset (struct frame, + toolbar_size[BOTTOM_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("left-toolbar-width", @@ -1603,9 +1613,11 @@ */ ); Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR], - offsetof (struct window, toolbar_size[LEFT_TOOLBAR]), + slot_offset (struct window, + toolbar_size[LEFT_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]), + slot_offset (struct frame, + toolbar_size[LEFT_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("right-toolbar-width", @@ -1617,9 +1629,11 @@ */ ); Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR], - offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]), + slot_offset (struct window, + toolbar_size[RIGHT_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]), + slot_offset (struct frame, + toolbar_size[RIGHT_TOOLBAR]), frame_size_slipped); fb = Qnil; @@ -1630,7 +1644,7 @@ fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb); #endif #ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmswindows), + fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_HEIGHT)), fb); #endif if (!NILP (fb)) @@ -1644,7 +1658,7 @@ fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH)), fb); #endif #ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmswindows), + fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb); #endif if (!NILP (fb)) @@ -1680,9 +1694,11 @@ */ ); Vdefault_toolbar_border_width = Fmake_specifier (Qnatnum); set_specifier_caching (Vdefault_toolbar_border_width, - offsetof (struct window, default_toolbar_border_width), + slot_offset (struct window, + default_toolbar_border_width), default_toolbar_border_width_changed_in_window, - offsetof (struct frame, default_toolbar_border_width), + slot_offset (struct frame, + default_toolbar_border_width), default_toolbar_border_width_changed_in_frame); DEFVAR_SPECIFIER ("top-toolbar-border-width", @@ -1694,11 +1710,11 @@ */ ); Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR], - offsetof (struct window, - toolbar_border_width[TOP_TOOLBAR]), + slot_offset (struct window, + toolbar_border_width[TOP_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_border_width[TOP_TOOLBAR]), + slot_offset (struct frame, + toolbar_border_width[TOP_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("bottom-toolbar-border-width", @@ -1710,11 +1726,11 @@ */ ); Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR], - offsetof (struct window, - toolbar_border_width[BOTTOM_TOOLBAR]), + slot_offset (struct window, + toolbar_border_width[BOTTOM_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_border_width[BOTTOM_TOOLBAR]), + slot_offset (struct frame, + toolbar_border_width[BOTTOM_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("left-toolbar-border-width", @@ -1726,11 +1742,11 @@ */ ); Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR], - offsetof (struct window, - toolbar_border_width[LEFT_TOOLBAR]), + slot_offset (struct window, + toolbar_border_width[LEFT_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_border_width[LEFT_TOOLBAR]), + slot_offset (struct frame, + toolbar_border_width[LEFT_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("right-toolbar-border-width", @@ -1742,11 +1758,11 @@ */ ); Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR], - offsetof (struct window, - toolbar_border_width[RIGHT_TOOLBAR]), + slot_offset (struct window, + toolbar_border_width[RIGHT_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_border_width[RIGHT_TOOLBAR]), + slot_offset (struct frame, + toolbar_border_width[RIGHT_TOOLBAR]), frame_size_slipped); fb = Qnil; @@ -1790,9 +1806,11 @@ */ ); Vdefault_toolbar_visible_p = Fmake_specifier (Qboolean); set_specifier_caching (Vdefault_toolbar_visible_p, - offsetof (struct window, default_toolbar_visible_p), + slot_offset (struct window, + default_toolbar_visible_p), default_toolbar_visible_p_changed_in_window, - offsetof (struct frame, default_toolbar_visible_p), + slot_offset (struct frame, + default_toolbar_visible_p), default_toolbar_visible_p_changed_in_frame); DEFVAR_SPECIFIER ("top-toolbar-visible-p", @@ -1804,11 +1822,11 @@ */ ); Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean); set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR], - offsetof (struct window, - toolbar_visible_p[TOP_TOOLBAR]), + slot_offset (struct window, + toolbar_visible_p[TOP_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_visible_p[TOP_TOOLBAR]), + slot_offset (struct frame, + toolbar_visible_p[TOP_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", @@ -1820,11 +1838,11 @@ */ ); Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean); set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR], - offsetof (struct window, - toolbar_visible_p[BOTTOM_TOOLBAR]), + slot_offset (struct window, + toolbar_visible_p[BOTTOM_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_visible_p[BOTTOM_TOOLBAR]), + slot_offset (struct frame, + toolbar_visible_p[BOTTOM_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("left-toolbar-visible-p", @@ -1836,11 +1854,11 @@ */ ); Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean); set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR], - offsetof (struct window, - toolbar_visible_p[LEFT_TOOLBAR]), + slot_offset (struct window, + toolbar_visible_p[LEFT_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_visible_p[LEFT_TOOLBAR]), + slot_offset (struct frame, + toolbar_visible_p[LEFT_TOOLBAR]), frame_size_slipped); DEFVAR_SPECIFIER ("right-toolbar-visible-p", @@ -1852,11 +1870,11 @@ */ ); Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean); set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR], - offsetof (struct window, - toolbar_visible_p[RIGHT_TOOLBAR]), + slot_offset (struct window, + toolbar_visible_p[RIGHT_TOOLBAR]), toolbar_geometry_changed_in_window, - offsetof (struct frame, - toolbar_visible_p[RIGHT_TOOLBAR]), + slot_offset (struct frame, + toolbar_visible_p[RIGHT_TOOLBAR]), frame_size_slipped); /* initially, top inherits from default; this can be @@ -1878,7 +1896,8 @@ */ ); Vtoolbar_buttons_captioned_p = Fmake_specifier (Qboolean); set_specifier_caching (Vtoolbar_buttons_captioned_p, - offsetof (struct window, toolbar_buttons_captioned_p), + slot_offset (struct window, + toolbar_buttons_captioned_p), toolbar_buttons_captioned_p_changed, 0, 0); set_specifier_fallback (Vtoolbar_buttons_captioned_p, diff -r 12e008d41344 -r 697ef44129c6 src/toolbar.h --- a/src/toolbar.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/toolbar.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,8 +22,8 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_toolbar_h_ -#define INCLUDED_toolbar_h_ +#ifndef _XEMACS_TOOLBAR_H_ +#define _XEMACS_TOOLBAR_H_ #ifdef HAVE_TOOLBARS @@ -34,7 +34,7 @@ #define FRAME_CURRENT_TOOLBAR_SIZE(frame, pos) \ ((frame)->current_toolbar_size[pos]) #define DEVICE_SUPPORTS_TOOLBARS_P(d) \ - HAS_DEVMETH_P (d, output_frame_toolbars) + (HAS_DEVMETH_P ((d), output_frame_toolbars)) struct toolbar_button { @@ -73,6 +73,7 @@ #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button) #define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button) #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button) +#define GC_TOOLBAR_BUTTONP(x) GC_RECORDP (x, toolbar_button) #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button) #define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button) @@ -110,4 +111,4 @@ #endif /* HAVE_TOOLBARS */ -#endif /* INCLUDED_toolbar_h_ */ +#endif /* _XEMACS_TOOLBAR_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/tooltalk.c --- a/src/tooltalk.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/tooltalk.c Mon Aug 13 11:20:41 2007 +0200 @@ -22,7 +22,7 @@ /* Synched up with: Not in FSF. */ /* Written by John Rose <john.rose@eng.sun.com>. - Heavily modified and cleaned up by Ben Wing <ben@xemacs.org>. */ + Heavily modified and cleaned up by Ben Wing <ben.wing@eng.sun.com>. */ #include <config.h> #include "lisp.h" @@ -151,9 +151,9 @@ }; static Lisp_Object -mark_tooltalk_message (Lisp_Object obj) +mark_tooltalk_message (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - mark_object (XTOOLTALK_MESSAGE (obj)->callback); + markobj (XTOOLTALK_MESSAGE (obj)->callback); return XTOOLTALK_MESSAGE (obj)->plist_sym; } @@ -161,7 +161,7 @@ print_tooltalk_message (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Tooltalk_Message *p = XTOOLTALK_MESSAGE (obj); + struct Lisp_Tooltalk_Message *p = XTOOLTALK_MESSAGE (obj); char buf[200]; @@ -175,15 +175,16 @@ DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message, mark_tooltalk_message, print_tooltalk_message, - 0, 0, 0, 0, - Lisp_Tooltalk_Message); + 0, 0, 0, + struct Lisp_Tooltalk_Message); static Lisp_Object make_tooltalk_message (Tt_message m) { Lisp_Object val; - Lisp_Tooltalk_Message *msg = - alloc_lcrecord_type (Lisp_Tooltalk_Message, &lrecord_tooltalk_message); + struct Lisp_Tooltalk_Message *msg = + alloc_lcrecord_type (struct Lisp_Tooltalk_Message, + &lrecord_tooltalk_message); msg->m = m; msg->callback = Qnil; @@ -224,9 +225,9 @@ }; static Lisp_Object -mark_tooltalk_pattern (Lisp_Object obj) +mark_tooltalk_pattern (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - mark_object (XTOOLTALK_PATTERN (obj)->callback); + markobj (XTOOLTALK_PATTERN (obj)->callback); return XTOOLTALK_PATTERN (obj)->plist_sym; } @@ -234,7 +235,7 @@ print_tooltalk_pattern (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Tooltalk_Pattern *p = XTOOLTALK_PATTERN (obj); + struct Lisp_Tooltalk_Pattern *p = XTOOLTALK_PATTERN (obj); char buf[200]; @@ -248,14 +249,15 @@ DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern, mark_tooltalk_pattern, print_tooltalk_pattern, - 0, 0, 0, 0, - Lisp_Tooltalk_Pattern); + 0, 0, 0, + struct Lisp_Tooltalk_Pattern); static Lisp_Object make_tooltalk_pattern (Tt_pattern p) { - Lisp_Tooltalk_Pattern *pat = - alloc_lcrecord_type (Lisp_Tooltalk_Pattern, &lrecord_tooltalk_pattern); + struct Lisp_Tooltalk_Pattern *pat = + alloc_lcrecord_type (struct Lisp_Tooltalk_Pattern, + &lrecord_tooltalk_pattern); Lisp_Object val; pat->p = p; @@ -500,7 +502,7 @@ static Lisp_Object tt_build_string (char *s) { - return build_string (s ? s : ""); + return build_string ((s) ? s : ""); } static Lisp_Object @@ -700,10 +702,8 @@ { Tt_message m = unbox_tooltalk_message (message_); int n = 0; - Tt_status (*fun_str) (Tt_message, const char *) = 0; CHECK_SYMBOL (attribute); - if (EQ (attribute, (Qtt_arg_bval)) || EQ (attribute, (Qtt_arg_ival)) || EQ (attribute, (Qtt_arg_val))) @@ -715,7 +715,7 @@ if (!VALID_TOOLTALK_MESSAGEP (m)) return Qnil; - if (EQ (attribute, Qtt_address)) + else if (EQ (attribute, Qtt_address)) { CHECK_TOOLTALK_CONSTANT (value); tt_message_address_set (m, (Tt_address) tooltalk_constant_value (value)); @@ -731,37 +731,73 @@ tt_message_disposition_set (m, ((Tt_disposition) tooltalk_constant_value (value))); } + else if (EQ (attribute, Qtt_file)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_file_set (m, value_ext); + } + else if (EQ (attribute, Qtt_handler_ptype)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_handler_ptype_set (m, value_ext); + } + else if (EQ (attribute, Qtt_handler)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_handler_set (m, value_ext); + } + else if (EQ (attribute, Qtt_object)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_object_set (m, value_ext); + } + else if (EQ (attribute, Qtt_op)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_op_set (m, value_ext); + } + else if (EQ (attribute, Qtt_otype)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_otype_set (m, value_ext); + } else if (EQ (attribute, Qtt_scope)) { CHECK_TOOLTALK_CONSTANT (value); tt_message_scope_set (m, (Tt_scope) tooltalk_constant_value (value)); } - else if (EQ (attribute, Qtt_file)) - fun_str = tt_message_file_set; - else if (EQ (attribute, Qtt_handler_ptype)) - fun_str = tt_message_handler_ptype_set; - else if (EQ (attribute, Qtt_handler)) - fun_str = tt_message_handler_set; - else if (EQ (attribute, Qtt_object)) - fun_str = tt_message_object_set; - else if (EQ (attribute, Qtt_op)) - fun_str = tt_message_op_set; - else if (EQ (attribute, Qtt_otype)) - fun_str = tt_message_otype_set; else if (EQ (attribute, Qtt_sender_ptype)) - fun_str = tt_message_sender_ptype_set; + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_sender_ptype_set (m, value_ext); + } else if (EQ (attribute, Qtt_session)) - fun_str = tt_message_session_set; - else if (EQ (attribute, Qtt_status_string)) - fun_str = tt_message_status_string_set; + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_session_set (m, value_ext); + } else if (EQ (attribute, Qtt_arg_bval)) { Extbyte *value_ext; Extcount value_ext_len; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, - ALLOCA, (value_ext, value_ext_len), - Qnative); + GET_STRING_OS_DATA_ALLOCA (value, value_ext, value_ext_len); tt_message_arg_bval_set (m, n, value_ext, value_ext_len); } else if (EQ (attribute, Qtt_arg_ival)) @@ -771,9 +807,9 @@ } else if (EQ (attribute, Qtt_arg_val)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_message_arg_val_set (m, n, value_ext); } else if (EQ (attribute, Qtt_status)) @@ -781,6 +817,13 @@ CHECK_INT (value); tt_message_status_set (m, XINT (value)); } + else if (EQ (attribute, Qtt_status_string)) + { + CONST char *value_ext; + CHECK_STRING (value); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); + tt_message_status_string_set (m, value_ext); + } else if (EQ (attribute, Qtt_callback)) { CHECK_SYMBOL (value); @@ -793,15 +836,6 @@ else signal_simple_error ("Invalid value for `set-tooltalk-message-attribute'", attribute); - - if (fun_str) - { - const char *value_ext; - CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); - (*fun_str) (m, value_ext); - } - return Qnil; } @@ -912,15 +946,15 @@ if (!VALID_TOOLTALK_MESSAGEP (m)) return Qnil; { - const char *vtype_ext; + CONST char *vtype_ext; - TO_EXTERNAL_FORMAT (LISP_STRING, vtype, C_STRING_ALLOCA, vtype_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (vtype, vtype_ext); if (NILP (value)) tt_message_arg_add (m, n, vtype_ext, NULL); else if (STRINGP (value)) { - const char *value_ext; - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + CONST char *value_ext; + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_message_arg_add (m, n, vtype_ext, value_ext); } else if (INTP (value)) @@ -1023,30 +1057,30 @@ } else if (EQ (attribute, Qtt_file)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_file_add (p, value_ext); } else if (EQ (attribute, Qtt_object)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_object_add (p, value_ext); } else if (EQ (attribute, Qtt_op)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_op_add (p, value_ext); } else if (EQ (attribute, Qtt_otype)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_otype_add (p, value_ext); } else if (EQ (attribute, Qtt_scope)) @@ -1056,23 +1090,23 @@ } else if (EQ (attribute, Qtt_sender)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_sender_add (p, value_ext); } else if (EQ (attribute, Qtt_sender_ptype)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_sender_ptype_add (p, value_ext); } else if (EQ (attribute, Qtt_session)) { - const char *value_ext; + CONST char *value_ext; CHECK_STRING (value); - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_session_add (p, value_ext); } else if (EQ (attribute, Qtt_state)) @@ -1111,15 +1145,15 @@ return Qnil; { - const char *vtype_ext; + CONST char *vtype_ext; - TO_EXTERNAL_FORMAT (LISP_STRING, vtype, C_STRING_ALLOCA, vtype_ext, Qnative); + GET_C_STRING_OS_DATA_ALLOCA (vtype, vtype_ext); if (NILP (value)) tt_pattern_arg_add (p, n, vtype_ext, NULL); else if (STRINGP (value)) { - const char *value_ext; - TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative); + CONST char *value_ext; + GET_C_STRING_OS_DATA_ALLOCA (value, value_ext); tt_pattern_arg_add (p, n, vtype_ext, value_ext); } else if (INTP (value)) @@ -1222,28 +1256,7 @@ Lisp_Object lp; Lisp_Object fil; - - /* tt_open() messes with our signal handler flags (at least when no - ttsessions is running on the machine), therefore we save the - actions and restore them after the call */ -#ifdef HAVE_SIGPROCMASK - { - struct sigaction ActSIGQUIT; - struct sigaction ActSIGINT; - struct sigaction ActSIGCHLD; - sigaction (SIGQUIT, NULL, &ActSIGQUIT); - sigaction (SIGINT, NULL, &ActSIGINT); - sigaction (SIGCHLD, NULL, &ActSIGCHLD); -#endif retval = tt_open (); -#ifdef HAVE_SIGPROCMASK - sigaction (SIGQUIT, &ActSIGQUIT, NULL); - sigaction (SIGINT, &ActSIGINT, NULL); - sigaction (SIGCHLD, &ActSIGCHLD, NULL); - } -#endif - - if (tt_ptr_error (retval) != TT_OK) return; @@ -1301,9 +1314,6 @@ void syms_of_tooltalk (void) { - INIT_LRECORD_IMPLEMENTATION (tooltalk_message); - INIT_LRECORD_IMPLEMENTATION (tooltalk_pattern); - defsymbol (&Qtooltalk_messagep, "tooltalk-message-p"); DEFSUBR (Ftooltalk_message_p); defsymbol (&Qtooltalk_patternp, "tooltalk-pattern-p"); diff -r 12e008d41344 -r 697ef44129c6 src/tooltalk.h --- a/src/tooltalk.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/tooltalk.h Mon Aug 13 11:20:41 2007 +0200 @@ -22,22 +22,24 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_tooltalk_h_ -#define INCLUDED_tooltalk_h_ -#include TT_C_H_FILE +#ifndef _XEMACS_TOOLTALK_H_ +#define _XEMACS_TOOLTALK_H_ +#include TT_C_H_PATH -typedef struct Lisp_Tooltalk_Message Lisp_Tooltalk_Message; -DECLARE_LRECORD (tooltalk_message, Lisp_Tooltalk_Message); -#define XTOOLTALK_MESSAGE(x) XRECORD (x, tooltalk_message, Lisp_Tooltalk_Message) +struct Lisp_Tooltalk_Message; +DECLARE_LRECORD (tooltalk_message, struct Lisp_Tooltalk_Message); +#define XTOOLTALK_MESSAGE(x) XRECORD (x, tooltalk_message, struct Lisp_Tooltalk_Message) #define XSETTOOLTALK_MESSAGE(x, p) XSETRECORD (x, p, tooltalk_message) #define TOOLTALK_MESSAGEP(x) RECORDP (x, tooltalk_message) +#define GC_TOOLTALK_MESSAGEP(x) GC_RECORDP (x, tooltalk_message) #define CHECK_TOOLTALK_MESSAGE(x) CHECK_RECORD (x, tooltalk_message) -typedef struct Lisp_Tooltalk_Pattern Lisp_Tooltalk_Pattern; -DECLARE_LRECORD (tooltalk_pattern, Lisp_Tooltalk_Pattern); -#define XTOOLTALK_PATTERN(x) XRECORD (x, tooltalk_pattern, Lisp_Tooltalk_Pattern) +struct Lisp_Tooltalk_Pattern; +DECLARE_LRECORD (tooltalk_pattern, struct Lisp_Tooltalk_Pattern); +#define XTOOLTALK_PATTERN(x) XRECORD (x, tooltalk_pattern, struct Lisp_Tooltalk_Pattern) #define XSETTOOLTALK_PATTERN(x, p) XSETRECORD (x, p, tooltalk_pattern) #define TOOLTALK_PATTERNP(x) RECORDP (x, tooltalk_pattern) +#define GC_TOOLTALK_PATTERNP(x) GC_RECORDP (x, tooltalk_pattern) #define CHECK_TOOLTALK_PATTERN(x) CHECK_RECORD (x, tooltalk_pattern) #define TOOLTALK_MESSAGE_KEY 100 @@ -59,4 +61,4 @@ extern Lisp_Object Qtooltalk_error; -#endif /* INCLUDED_tooltalk_h_ */ +#endif /* _XEMACS_TOOLTALK_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/tparam.c --- a/src/tparam.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/tparam.c Mon Aug 13 11:20:41 2007 +0200 @@ -57,16 +57,16 @@ The fourth and following args to tparam serve as the parameter values. */ -static char *tparam1 (const char *string, char *outstring, int len, - const char *up, const char *left, +static char *tparam1 (CONST char *string, char *outstring, int len, + CONST char *up, CONST char *left, int *argp); /* XEmacs: renamed this function because just tparam() conflicts with ncurses */ -char *emacs_tparam (const char *string, char *outstring, int len, int arg0, +char *emacs_tparam (CONST char *string, char *outstring, int len, int arg0, int arg1, int arg2, int arg3); char * -emacs_tparam (const char *string, char *outstring, int len, int arg0, +emacs_tparam (CONST char *string, char *outstring, int len, int arg0, int arg1, int arg2, int arg3) { int arg[4]; @@ -77,14 +77,14 @@ return tparam1 (string, outstring, len, 0, 0, arg); } -const char *BC; -const char *UP; +CONST char *BC; +CONST char *UP; static char tgoto_buf[50]; -char *tgoto (const char *cm, int hpos, int vpos); +char *tgoto (CONST char *cm, int hpos, int vpos); char * -tgoto (const char *cm, int hpos, int vpos) +tgoto (CONST char *cm, int hpos, int vpos) { int args[2]; if (!cm) @@ -95,11 +95,11 @@ } static char * -tparam1 (const char *string, char *outstring, int len, const char *up, - const char *left, int *argp) +tparam1 (CONST char *string, char *outstring, int len, CONST char *up, + CONST char *left, int *argp) { int c; - const char *p = string; + CONST char *p = string; char *op = outstring; char *outend; int outlen = 0; diff -r 12e008d41344 -r 697ef44129c6 src/undo.c --- a/src/undo.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/undo.c Mon Aug 13 11:20:41 2007 +0200 @@ -46,7 +46,7 @@ which will be added to the list at the end of the command. This ensures we can't run out of space while trying to make an undo-boundary. */ -static Lisp_Object pending_boundary; +Lisp_Object pending_boundary; static void undo_boundary (struct buffer *b) @@ -281,7 +281,7 @@ && NILP (XCAR (next))) { /* Add in the space occupied by this element and its chain link. */ - size_so_far += sizeof (Lisp_Cons); + size_so_far += sizeof (struct Lisp_Cons); /* Advance to next element. */ prev = next; @@ -294,12 +294,12 @@ elt = XCAR (next); /* Add in the space occupied by this element and its chain link. */ - size_so_far += sizeof (Lisp_Cons); + size_so_far += sizeof (struct Lisp_Cons); if (CONSP (elt)) { - size_so_far += sizeof (Lisp_Cons); + size_so_far += sizeof (struct Lisp_Cons); if (STRINGP (XCAR (elt))) - size_so_far += (sizeof (Lisp_String) - 1 + size_so_far += (sizeof (struct Lisp_String) - 1 + XSTRING_LENGTH (XCAR (elt))); } @@ -329,12 +329,12 @@ } /* Add in the space occupied by this element and its chain link. */ - size_so_far += sizeof (Lisp_Cons); + size_so_far += sizeof (struct Lisp_Cons); if (CONSP (elt)) { - size_so_far += sizeof (Lisp_Cons); + size_so_far += sizeof (struct Lisp_Cons); if (STRINGP (XCAR (elt))) - size_so_far += (sizeof (Lisp_String) - 1 + size_so_far += (sizeof (struct Lisp_String) - 1 + XSTRING_LENGTH (XCAR (elt))); } @@ -547,16 +547,9 @@ } void -reinit_vars_of_undo (void) +vars_of_undo (void) { inside_undo = 0; -} - -void -vars_of_undo (void) -{ - reinit_vars_of_undo (); - pending_boundary = Qnil; staticpro (&pending_boundary); last_undo_buffer = Qnil; diff -r 12e008d41344 -r 697ef44129c6 src/unexaix.c --- a/src/unexaix.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexaix.c Mon Aug 13 11:20:41 2007 +0200 @@ -439,6 +439,7 @@ { int i, nwrite, ret; char buf[80]; + extern int errno; char zeros[UnexBlockSz]; for (i = 0; ptr < end;) diff -r 12e008d41344 -r 697ef44129c6 src/unexalpha.c --- a/src/unexalpha.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexalpha.c Mon Aug 13 11:20:41 2007 +0200 @@ -31,7 +31,6 @@ #include <sys/stat.h> #include <sys/mman.h> #include <stdio.h> -#include <errno.h> #include <varargs.h> #include <filehdr.h> #include <aouthdr.h> @@ -55,6 +54,11 @@ if (lseek (_fd, _position, L_SET) != _position) \ fatal_unexec (_error_message, _error_arg); +extern int errno; +extern char *strerror (); + +void *sbrk(); + #define EEOF -1 static struct scnhdr *text_section; @@ -81,13 +85,12 @@ }; + /* Define name of label for entry point for the dumped executable. */ #ifndef DEFAULT_ENTRY_ADDRESS #define DEFAULT_ENTRY_ADDRESS __start #endif -EXTERN_C int DEFAULT_ENTRY_ADDRESS (void); - int unexec (char *new_name, char *a_name, @@ -207,6 +210,7 @@ nhdr.aout.bsize = 0; if (entry_address == 0) { + extern int DEFAULT_ENTRY_ADDRESS (void); nhdr.aout.entry = (unsigned long)DEFAULT_ENTRY_ADDRESS; } else diff -r 12e008d41344 -r 697ef44129c6 src/unexcw.c --- a/src/unexcw.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexcw.c Mon Aug 13 11:20:41 2007 +0200 @@ -39,9 +39,8 @@ } #else -#ifndef MAX_PATH -#define MAX_PATH 260 -#endif +#undef CONST +#include <windows.h> #include <a.out.h> #define ALLOC_UNIT 0xFFFF @@ -82,9 +81,6 @@ exit(-1); \ } -void -unexec (char *out_name, char *in_name, void *start_data, - void * d1, void * d2); /* Dump out .data and .bss sections into a new executable. */ void unexec (char *out_name, char *in_name, void *start_data, void * d1, void * d2) diff -r 12e008d41344 -r 697ef44129c6 src/unexec.c --- a/src/unexec.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexec.c Mon Aug 13 11:20:41 2007 +0200 @@ -136,7 +136,7 @@ program text). HDR's standard fields are already correct, except that this adjustment to the `a_text' field has not yet been made; thus, the amount of offset can depend on the data in the file. - + * A_TEXT_SEEK(HDR) If defined, this macro specifies the number of bytes to seek into the @@ -186,12 +186,19 @@ # undef _POSIX_SOURCE # endif +# if defined(__lucid) && !defined(__STDC_EXTENDED__) +# define __STDC_EXTENDED__ 1 +# endif + # include <stddef.h> # include <stdlib.h> # include <unistd.h> # include <string.h> # include <stddef.h> -# include <errno.h> + +# ifdef __lucid +# include <sysent.h> +# endif #endif @@ -209,7 +216,33 @@ int need_coff_header = 1; #include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */ #else +#ifdef MSDOS +#if __DJGPP__ > 1 +#include <fcntl.h> /* for O_RDONLY, O_RDWR */ +#endif +#include <coff.h> +#define filehdr external_filehdr +#define scnhdr external_scnhdr +#define syment external_syment +#define auxent external_auxent +#define n_numaux e_numaux +#define n_type e_type +struct aouthdr +{ + unsigned short magic; /* type of file */ + unsigned short vstamp; /* version stamp */ + unsigned long tsize; /* text size in bytes, padded to FW bdry*/ + unsigned long dsize; /* initialized data " " */ + unsigned long bsize; /* uninitialized data " " */ + unsigned long entry; /* entry pt. */ + unsigned long text_start;/* base of text used for this file */ + unsigned long data_start;/* base of data used for this file */ +}; + + +#else /* not MSDOS */ #include <a.out.h> +#endif /* not MSDOS */ #endif /* not COFF_ENCAPSULATE */ /* Define getpagesize if the system does not. @@ -340,12 +373,14 @@ #include "lisp.h" static void -report_error (const char *file, int fd) +report_error (file, fd) + CONST char *file; + int fd; { if (fd) close (fd); report_file_error ("Cannot unexec", - Fcons (build_ext_string (file, Qfile_name), Qnil)); + Fcons (build_ext_string (file, FORMAT_FILENAME), Qnil)); } #endif /* emacs */ @@ -356,7 +391,7 @@ static void report_error_1 (fd, msg, a1, a2) int fd; - const char *msg; + CONST char *msg; int a1, a2; { close (fd); @@ -408,7 +443,7 @@ { close (new); /* unlink (new_name); / * Failed, unlink new a.out */ - return -1; + return -1; } close (new); @@ -885,6 +920,14 @@ #else /* COFF, but not USG_SHARED_LIBRARIES */ +#ifdef MSDOS +#if __DJGPP__ >= 2 + /* Dump the original table of exception handlers, not the one + where our exception hooks are registered. */ + __djgpp_exception_toggle (); +#endif +#endif + lseek (new, (long) text_scnptr, 0); ptr = (char *) f_ohdr.text_start; #ifdef HEADER_INCL_IN_TEXT @@ -899,6 +942,13 @@ end = ptr + f_ohdr.dsize; write_segment (new, ptr, end); +#ifdef MSDOS +#if __DJGPP__ >= 2 + /* Restore our exception hooks. */ + __djgpp_exception_toggle (); +#endif +#endif + #endif /* USG_SHARED_LIBRARIES */ #else /* if not COFF */ @@ -948,7 +998,7 @@ char c; int mcount_address, mcount_offset, count; extern char *_execname; - + /* The use of _execname is incompatible with RISCiX 1.1 */ sprintf (command, "nm %s | fgrep mcount", _execname); @@ -968,7 +1018,7 @@ { sprintf (errbuf, "Failed to execute the command '%s'\n", command); PERROR (errbuf); - } + } sscanf(address_text, "%x", &mcount_address); ptr = (char *) unexec_text_start; @@ -1026,6 +1076,7 @@ #if 0 char buf[80]; #endif + extern int errno; /* This is the normal amount to write at once. It is the size of block that NFS uses. */ int writesize = 1 << 13; @@ -1180,7 +1231,11 @@ if (!lnnoptr || !f_hdr.f_symptr) return 0; +#ifdef MSDOS + if ((new = writedesc) < 0) +#else if ((new = open (new_name, O_RDWR)) < 0) +#endif { PERROR (new_name); return -1; @@ -1202,7 +1257,9 @@ } } } +#ifndef MSDOS close (new); +#endif return 0; } diff -r 12e008d41344 -r 697ef44129c6 src/unexelf.c --- a/src/unexelf.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexelf.c Mon Aug 13 11:20:41 2007 +0200 @@ -18,7 +18,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF 20.4. */ +/* Synched up with: FSF 20.2. */ /* * unexec.c - Convert a running program into an a.out file. @@ -413,7 +413,7 @@ #define fatal(a, b, c) fprintf (stderr, a, b, c), exit (1) #else #include <config.h> -extern void fatal (const char *, ...); +extern void fatal (CONST char *, ...); #endif #include <sys/types.h> @@ -424,88 +424,10 @@ #include <errno.h> #include <unistd.h> #include <fcntl.h> -#if !defined (__NetBSD__) && !defined (__OpenBSD__) #include <elf.h> -#endif #include <sys/mman.h> -#if defined (__sony_news) && defined (_SYSTYPE_SYSV) -#include <sys/elf_mips.h> -#include <sym.h> -#endif /* __sony_news && _SYSTYPE_SYSV */ -#ifdef __sgi -#include <sym.h> /* for HDRR declaration */ -#endif /* __sgi */ -#if defined (__alpha__) && !defined (__NetBSD__) && !defined (__OpenBSD__) -/* Declare COFF debugging symbol table. This used to be in - /usr/include/sym.h, but this file is no longer included in Red Hat - 5.0 and presumably in any other glibc 2.x based distribution. */ -typedef struct { - short magic; - short vstamp; - int ilineMax; - int idnMax; - int ipdMax; - int isymMax; - int ioptMax; - int iauxMax; - int issMax; - int issExtMax; - int ifdMax; - int crfd; - int iextMax; - long cbLine; - long cbLineOffset; - long cbDnOffset; - long cbPdOffset; - long cbSymOffset; - long cbOptOffset; - long cbAuxOffset; - long cbSsOffset; - long cbSsExtOffset; - long cbFdOffset; - long cbRfdOffset; - long cbExtOffset; -} HDRR, *pHDRR; -#define cbHDRR sizeof(HDRR) -#define hdrNil ((pHDRR)0) -#endif - -#ifdef __NetBSD__ -/* - * NetBSD does not have normal-looking user-land ELF support. - */ -# ifdef __alpha__ -# define ELFSIZE 64 -# else -# define ELFSIZE 32 -# endif -# include <sys/exec_elf.h> - -# define PT_LOAD Elf_pt_load -# define SHT_SYMTAB Elf_sht_symtab -# define SHT_DYNSYM Elf_sht_dynsym -# define SHT_NULL Elf_sht_null -# define SHT_NOBITS Elf_sht_nobits -# define SHT_REL Elf_sht_rel -# define SHT_RELA Elf_sht_rela - -# define SHN_UNDEF Elf_eshn_undefined -# define SHN_ABS Elf_eshn_absolute -# define SHN_COMMON Elf_eshn_common - -# ifdef __alpha__ -# include <sys/exec_ecoff.h> -# define HDRR struct ecoff_symhdr -# define pHDRR HDRR * -# endif -#endif /* __NetBSD__ */ - -#ifdef __OpenBSD__ -# include <sys/exec_elf.h> -#endif - -#if __GNU_LIBRARY__ - 0 >= 6 +#if __GLIBC__ - 0 >= 2 # include <link.h> /* get ElfW etc */ #endif @@ -565,8 +487,8 @@ /* Round X up to a multiple of Y. */ -static ElfW(Addr) -round_up (ElfW(Addr) x, ElfW(Addr) y) +static int +round_up (int x, int y) { int rem = x % y; if (rem == 0) @@ -609,8 +531,7 @@ ElfW(Off) new_data2_offset; ElfW(Addr) new_data2_addr; - int n, nn, old_bss_index, old_data_index, new_data2_index; - int old_sbss_index, old_mdebug_index; + int n, nn, old_bss_index, old_data_index; struct stat stat_buf; /* Open the old file & map it into the address space. */ @@ -623,7 +544,7 @@ if (fstat (old_file, &stat_buf) == -1) fatal ("Can't fstat (%s): errno %d\n", old_name, errno); - old_base = (caddr_t) mmap (0, stat_buf.st_size, PROT_READ, MAP_SHARED, old_file, 0); + old_base = mmap (0, stat_buf.st_size, PROT_READ, MAP_SHARED, old_file, 0); if (old_base == (caddr_t) -1) fatal ("Can't mmap (%s): errno %d\n", old_name, errno); @@ -659,60 +580,8 @@ if (old_bss_index == old_file_h->e_shnum) fatal ("Can't find .bss in %s.\n", old_name, 0); - for (old_sbss_index = 1; old_sbss_index < (int) old_file_h->e_shnum; - old_sbss_index++) - { -#ifdef DEBUG - fprintf (stderr, "Looking for .sbss - found %s\n", - old_section_names + OLD_SECTION_H (old_sbss_index).sh_name); -#endif - if (!strcmp (old_section_names + OLD_SECTION_H (old_sbss_index).sh_name, - ".sbss")) - break; - } - if (old_sbss_index == old_file_h->e_shnum) - { - old_sbss_index = -1; - old_bss_addr = OLD_SECTION_H(old_bss_index).sh_addr; - old_bss_size = OLD_SECTION_H(old_bss_index).sh_size; - new_data2_index = old_bss_index; - } - else - { - old_bss_addr = OLD_SECTION_H(old_sbss_index).sh_addr; - old_bss_size = OLD_SECTION_H(old_bss_index).sh_size - + OLD_SECTION_H(old_sbss_index).sh_size; - new_data2_index = old_sbss_index; - } - - for (old_mdebug_index = 1; old_mdebug_index < (int) old_file_h->e_shnum; - old_mdebug_index++) - { -#ifdef DEBUG - fprintf (stderr, "Looking for .mdebug - found %s\n", - old_section_names + OLD_SECTION_H (old_mdebug_index).sh_name); -#endif - if (!strcmp (old_section_names + OLD_SECTION_H (old_mdebug_index).sh_name, - ".mdebug")) - break; - } - if (old_mdebug_index == old_file_h->e_shnum) - old_mdebug_index = 0; - - for (old_data_index = 1; old_data_index < (int) old_file_h->e_shnum; - old_data_index++) - { -#ifdef DEBUG - fprintf (stderr, "Looking for .data - found %s\n", - old_section_names + OLD_SECTION_H (old_data_index).sh_name); -#endif - if (!strcmp (old_section_names + OLD_SECTION_H (old_data_index).sh_name, - ".data")) - break; - } - if (old_data_index == old_file_h->e_shnum) - old_data_index = 0; - + old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr; + old_bss_size = OLD_SECTION_H (old_bss_index).sh_size; #if defined (emacs) || !defined (DEBUG) new_bss_addr = (ElfW(Addr)) sbrk (0); #else @@ -720,8 +589,7 @@ #endif new_data2_addr = old_bss_addr; new_data2_size = new_bss_addr - old_bss_addr; - new_data2_offset = OLD_SECTION_H (old_data_index).sh_offset + - (new_data2_addr - OLD_SECTION_H (old_data_index).sh_addr); + new_data2_offset = OLD_SECTION_H (old_bss_index).sh_offset; #ifdef DEBUG fprintf (stderr, "old_bss_index %d\n", old_bss_index); @@ -750,13 +618,13 @@ if (ftruncate (new_file, new_file_size)) fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); - new_base = (caddr_t) mmap (0, new_file_size, PROT_READ | PROT_WRITE, #ifdef UNEXEC_USE_MAP_PRIVATE - MAP_PRIVATE, + new_base = mmap (0, new_file_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, + new_file, 0); #else - MAP_SHARED, + new_base = mmap (0, new_file_size, PROT_READ | PROT_WRITE, MAP_SHARED, + new_file, 0); #endif - new_file, 0); if (new_base == (caddr_t) -1) fatal ("Can't mmap (%s): errno %d\n", new_name, errno); @@ -806,31 +674,24 @@ if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment) alignment = OLD_SECTION_H (old_bss_index).sh_addralign; -#ifdef __mips - /* According to r02kar@x4u2.desy.de (Karsten Kuenne) - and oliva@gnu.org (Alexandre Oliva), on IRIX 5.2, we - always get "Program segment above .bss" when dumping - when the executable doesn't have an sbss section. */ - if (old_sbss_index != -1) -#endif /* __mips */ - if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz - > (old_sbss_index == -1 - ? old_bss_addr - : round_up (old_bss_addr, alignment))) - fatal ("Program segment above .bss in %s\n", old_name, 0); +#ifndef __mips /* ifndef added by jwz at suggestion of + r02kar@x4u2.desy.de (Karsten Kuenne) to avoid + "Program segment above .bss" when dumping. + */ + if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz > old_bss_addr) + fatal ("Program segment above .bss in %s\n", old_name, 0); +#endif /* __mips */ if (NEW_PROGRAM_H (n).p_type == PT_LOAD - && (round_up ((NEW_PROGRAM_H (n)).p_vaddr - + (NEW_PROGRAM_H (n)).p_filesz, + && (round_up ((int) ((NEW_PROGRAM_H (n)).p_vaddr + + (NEW_PROGRAM_H (n)).p_filesz), alignment) - == round_up (old_bss_addr, alignment))) + == round_up ((int) old_bss_addr, alignment))) break; } if (n < 0) fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0); - /* Make sure that the size includes any padding before the old .bss - section. */ NEW_PROGRAM_H (n).p_filesz = new_bss_addr - NEW_PROGRAM_H (n).p_vaddr; NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz; @@ -865,10 +726,8 @@ for (n = 1, nn = 1; n < (int) old_file_h->e_shnum; n++, nn++) { caddr_t src; - /* If it is (s)bss section, insert the new data2 section before it. */ - /* new_data2_index is the index of either old_sbss or old_bss, that was - chosen as a section for new_data2. */ - if (n == new_data2_index) + /* If it is bss section, insert the new data2 section before it. */ + if (n == old_bss_index) { /* Steal the data section header for this data2 section. */ memcpy (&NEW_SECTION_H (nn), &OLD_SECTION_H (old_data_index), @@ -885,24 +744,21 @@ /* Now copy over what we have in the memory now. */ memcpy (NEW_SECTION_H (nn).sh_offset + new_base, (caddr_t) OLD_SECTION_H (n).sh_addr, + /* #### mrb: should be old_bss_size instead? */ new_data2_size); nn++; } memcpy (&NEW_SECTION_H (nn), &OLD_SECTION_H (n), old_file_h->e_shentsize); - - if (n == old_bss_index - /* The new bss and sbss section's size is zero, and its file offset - and virtual address should be off by NEW_DATA2_SIZE. */ - || n == old_sbss_index - ) + + /* The new bss section's size is zero, and its file offset and virtual + address should be off by NEW_DATA2_SIZE. */ + if (n == old_bss_index) { - /* NN should be `old_s?bss_index + 1' at this point. */ - NEW_SECTION_H (nn).sh_offset = - NEW_SECTION_H (new_data2_index).sh_offset + new_data2_size; - NEW_SECTION_H (nn).sh_addr = - NEW_SECTION_H (new_data2_index).sh_addr + new_data2_size; + /* NN should be `old_bss_index + 1' at this point. */ + NEW_SECTION_H (nn).sh_offset += new_data2_size; + NEW_SECTION_H (nn).sh_addr += new_data2_size; /* Let the new bss section address alignment be the same as the section address alignment followed the old bss section, so this section will be placed in exactly the same place. */ @@ -926,9 +782,7 @@ >= OLD_SECTION_H (old_bss_index-1).sh_offset) NEW_SECTION_H (nn).sh_offset += new_data2_size; #else - if (round_up (NEW_SECTION_H (nn).sh_offset, - OLD_SECTION_H (old_bss_index).sh_addralign) - >= new_data2_offset) + if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset) NEW_SECTION_H (nn).sh_offset += new_data2_size; #endif /* Any section that was originally placed after the section @@ -957,24 +811,17 @@ /* Write out the sections. .data and .data1 (and data2, called ".data" in the strings table) get copied from the current process instead of the old file. */ +#ifdef __powerpc__ + /* The PowerPC has additional 'data' segments which need to be saved */ + if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") || + !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1") || + !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata") || + !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata1")) +#else if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".sdata") - /* Taking these sections from the current process, breaks - Linux in a subtle way. Binaries only run on the - architecture (e.g. i586 vs i686) of the dumping machine */ -#ifdef __sgi - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".lit4") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".lit8") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".got") + ".data1")) #endif - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".sdata1") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".data1")) src = (caddr_t) OLD_SECTION_H (n).sh_addr; else src = old_base + OLD_SECTION_H (n).sh_offset; @@ -982,106 +829,6 @@ memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src, NEW_SECTION_H (nn).sh_size); -#ifdef __alpha__ - /* Update Alpha COFF symbol table: */ - if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug") - == 0) - { - pHDRR symhdr = (pHDRR) (NEW_SECTION_H (nn).sh_offset + new_base); - - symhdr->cbLineOffset += new_data2_size; - symhdr->cbDnOffset += new_data2_size; - symhdr->cbPdOffset += new_data2_size; - symhdr->cbSymOffset += new_data2_size; - symhdr->cbOptOffset += new_data2_size; - symhdr->cbAuxOffset += new_data2_size; - symhdr->cbSsOffset += new_data2_size; - symhdr->cbSsExtOffset += new_data2_size; - symhdr->cbFdOffset += new_data2_size; - symhdr->cbRfdOffset += new_data2_size; - symhdr->cbExtOffset += new_data2_size; - } -#endif /* __alpha__ */ - -#if defined (__sony_news) && defined (_SYSTYPE_SYSV) - if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG && old_mdebug_index) - { - int diff = NEW_SECTION_H(nn).sh_offset - - OLD_SECTION_H(old_mdebug_index).sh_offset; - HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base); - - if (diff) - { - phdr->cbLineOffset += diff; - phdr->cbDnOffset += diff; - phdr->cbPdOffset += diff; - phdr->cbSymOffset += diff; - phdr->cbOptOffset += diff; - phdr->cbAuxOffset += diff; - phdr->cbSsOffset += diff; - phdr->cbSsExtOffset += diff; - phdr->cbFdOffset += diff; - phdr->cbRfdOffset += diff; - phdr->cbExtOffset += diff; - } - } -#endif /* __sony_news && _SYSTYPE_SYSV */ - -#ifdef __sgi - /* Adjust the HDRR offsets in .mdebug and copy the - line data if it's in its usual 'hole' in the object. - Makes the new file debuggable with dbx. - patches up two problems: the absolute file offsets - in the HDRR record of .mdebug (see /usr/include/syms.h), and - the ld bug that gets the line table in a hole in the - elf file rather than in the .mdebug section proper. - David Anderson. davea@sgi.com Jan 16,1994. */ - if (n == old_mdebug_index) - { -#define MDEBUGADJUST(__ct,__fileaddr) \ - if (n_phdrr->__ct > 0) \ - { \ - n_phdrr->__fileaddr += movement; \ - } - - HDRR * o_phdrr = (HDRR *)((byte *)old_base + OLD_SECTION_H (n).sh_offset); - HDRR * n_phdrr = (HDRR *)((byte *)new_base + NEW_SECTION_H (nn).sh_offset); - unsigned movement = new_data2_size; - - MDEBUGADJUST (idnMax, cbDnOffset); - MDEBUGADJUST (ipdMax, cbPdOffset); - MDEBUGADJUST (isymMax, cbSymOffset); - MDEBUGADJUST (ioptMax, cbOptOffset); - MDEBUGADJUST (iauxMax, cbAuxOffset); - MDEBUGADJUST (issMax, cbSsOffset); - MDEBUGADJUST (issExtMax, cbSsExtOffset); - MDEBUGADJUST (ifdMax, cbFdOffset); - MDEBUGADJUST (crfd, cbRfdOffset); - MDEBUGADJUST (iextMax, cbExtOffset); - /* The Line Section, being possible off in a hole of the object, - requires special handling. */ - if (n_phdrr->cbLine > 0) - { - if (o_phdrr->cbLineOffset > (OLD_SECTION_H (n).sh_offset - + OLD_SECTION_H (n).sh_size)) - { - /* line data is in a hole in elf. do special copy and adjust - for this ld mistake. - */ - n_phdrr->cbLineOffset += movement; - - memcpy (n_phdrr->cbLineOffset + new_base, - o_phdrr->cbLineOffset + old_base, n_phdrr->cbLine); - } - else - { - /* somehow line data is in .mdebug as it is supposed to be. */ - MDEBUGADJUST (cbLine, cbLineOffset); - } - } - } -#endif /* __sgi */ - /* If it is the symbol table, its st_shndx field needs to be patched. */ if (NEW_SECTION_H (nn).sh_type == SHT_SYMTAB || NEW_SECTION_H (nn).sh_type == SHT_DYNSYM) @@ -1139,21 +886,17 @@ be no harm in that provided that r_offset is always the first member. */ nn = section.sh_info; +#ifdef __powerpc__ + /* The PowerPC has additional 'data' segments which need to be saved */ + if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") || + !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1") || + !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata") || + !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata1")) +#else if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data") || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".sdata") -#ifdef __sgi - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".lit4") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".lit8") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".got") + ".data1")) #endif - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".sdata1") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".data1")) { ElfW(Addr) offset = NEW_SECTION_H (nn).sh_addr - NEW_SECTION_H (nn).sh_offset; @@ -1162,13 +905,6 @@ reloc += section.sh_entsize) { ElfW(Addr) addr = ((ElfW(Rel) *) reloc)->r_offset - offset; -#ifdef __alpha__ - /* The Alpha ELF binutils currently have a bug that - sometimes results in relocs that contain all - zeroes. Work around this for now... */ - if (((ElfW(Rel) *) reloc)->r_offset == 0) - continue; -#endif memcpy (new_base + addr, old_base + addr, sizeof(ElfW(Addr))); } } diff -r 12e008d41344 -r 697ef44129c6 src/unexelfsgi.c --- a/src/unexelfsgi.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexelfsgi.c Mon Aug 13 11:20:41 2007 +0200 @@ -615,7 +615,6 @@ l_Elf_Ehdr *old_file_h, *new_file_h; l_Elf_Phdr *old_program_h, *new_program_h; l_Elf_Shdr *old_section_h, *new_section_h; - l_Elf_Shdr *oldbss; /* Point to the section name table in the old file. */ char *old_section_names; @@ -698,8 +697,8 @@ (new_data2_addr - OLD_SECTION_H (old_data_index).sh_addr); new_base_offset = OLD_SECTION_H (old_data_index).sh_offset + (old_base_addr - OLD_SECTION_H (old_data_index).sh_addr); - new_offsets_shift = new_bss_addr - (old_base_addr & ~0xfff) + - ((old_base_addr & 0xfff) ? 0x1000 : 0); + new_offsets_shift = new_bss_addr - + ((old_base_addr & ~0xfff) + ((old_base_addr & 0xfff) ? 0x1000 : 0)); #ifdef DEBUG fprintf (stderr, "old_bss_index %d\n", old_bss_index); @@ -769,41 +768,37 @@ /* Fix up a new program header. Extend the writable data segment so that the bss area is covered too. Find that segment by looking - for one that starts before and ends after the .bss and it PT_LOADable. - Put a loop at the end to adjust the offset and address of any segment - that is above data2, just in case we decide to allow this later. */ + for a segment that ends just before the .bss area. Make sure + that no segments are above the new .data2. Put a loop at the end + to adjust the offset and address of any segment that is above + data2, just in case we decide to allow this later. */ - oldbss = &OLD_SECTION_H(old_bss_index); for (n = new_file_h->e_phnum - 1; n >= 0; n--) { /* Compute maximum of all requirements for alignment of section. */ - l_Elf_Phdr * ph = (l_Elf_Phdr *)((byte *) new_program_h + - new_file_h->e_phentsize*(n)); -#ifdef DEBUG - printf ("%d @ %0x + %0x against %0x + %0x", - n, ph->p_vaddr, ph->p_memsz, - oldbss->sh_addr, oldbss->sh_size); + int alignment = (NEW_PROGRAM_H (n)).p_align; + if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment) + alignment = OLD_SECTION_H (old_bss_index).sh_addralign; + + /* Supposedly this condition is okay for the SGI. */ +#if 0 + if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz > old_base_addr) + fatal ("Program segment above .bss in %s\n", old_name); #endif - if ((ph->p_type == PT_LOAD) && - (ph->p_vaddr <= oldbss->sh_addr) && - ((ph->p_vaddr + ph->p_memsz)>=(oldbss->sh_addr + oldbss->sh_size))) { - ph->p_filesz += new_offsets_shift; - ph->p_memsz = ph->p_filesz; -#ifdef DEBUG - puts (" That's the one!"); - fflush (stdout); -#endif - break; - } -#ifdef DEBUG - putchar ('\n'); - fflush (stdout); -#endif + + if (NEW_PROGRAM_H (n).p_type == PT_LOAD + && (round_up ((NEW_PROGRAM_H (n)).p_vaddr + + (NEW_PROGRAM_H (n)).p_filesz, + alignment) + == round_up (old_base_addr, alignment))) + break; } if (n < 0) fatal ("Couldn't find segment next to %s in %s\n", old_sbss_index == -1 ? ".sbss" : ".bss", old_name); + NEW_PROGRAM_H (n).p_filesz += new_offsets_shift; + NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz; #if 1 /* Maybe allow section after data2 - does this ever happen? */ for (n = new_file_h->e_phnum - 1; n >= 0; n--) diff -r 12e008d41344 -r 697ef44129c6 src/unexfreebsd.c --- a/src/unexfreebsd.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexfreebsd.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,7 +40,6 @@ #include <sys/types.h> #include <string.h> #include <stdio.h> -#include <errno.h> #include <a.out.h> #include <unistd.h> #include <ctype.h> @@ -71,7 +70,7 @@ /********************** Function Prototypes/Declarations ***********/ -static void unexec_error (const char *m, int use_errno, ...); +static void unexec_error (CONST char *m, int use_errno, ...); static int unexec_open (char *filename, int flag, int mode); static caddr_t unexec_mmap (int fd, size_t len, int prot, int flags); static long unexec_seek (int fd, long position); @@ -96,6 +95,7 @@ /********************** Variables **********************************/ /* for reporting error messages from system calls */ +extern int errno; extern int _DYNAMIC; extern char **environ; @@ -104,9 +104,9 @@ /*******************************************************************/ static void -unexec_error (const char *fmt, int use_errno, ...) +unexec_error (CONST char *fmt, int use_errno, ...) { - const char *err_msg = SYS_ERR; + CONST char *err_msg = SYS_ERR; va_list args; fprintf (stderr, "unexec - "); diff -r 12e008d41344 -r 697ef44129c6 src/unexhp9k3.c --- a/src/unexhp9k3.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexhp9k3.c Mon Aug 13 11:20:41 2007 +0200 @@ -40,7 +40,6 @@ #include <sys/types.h> #include <string.h> #include <stdio.h> -#include <errno.h> #include <signal.h> #ifdef __hp9000s300 # include </usr/include/debug.h> @@ -72,7 +71,7 @@ /********************** Function Prototypes/Declarations ***********/ -static void unexec_error (const char *fmt, int use_errno, ...); +static void unexec_error (CONST char *fmt, int use_errno, ...); static int unexec_open (char *filename, int flag, int mode); static long unexec_seek (int fd, long position); static void unexec_read (int fd, long position, char *buf, int bytes); @@ -88,6 +87,7 @@ /* for reporting error messages from system calls */ extern int sys_nerr; +extern int errno; extern int _DYNAMIC; extern char **environ; @@ -96,9 +96,9 @@ /*******************************************************************/ static void -unexec_error (const char *fmt, int use_errno, ...) +unexec_error (CONST char *fmt, int use_errno, ...) { - const char *err_msg = SYS_ERR; + CONST char *err_msg = SYS_ERR; va_list args; fprintf (stderr, "unexec - "); diff -r 12e008d41344 -r 697ef44129c6 src/unexhp9k800.c --- a/src/unexhp9k800.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexhp9k800.c Mon Aug 13 11:20:41 2007 +0200 @@ -52,7 +52,6 @@ #include <config.h> -#include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> @@ -81,7 +80,7 @@ #ifdef HPUX_USE_SHLIBS #include <dl.h> /* User-space dynamic loader entry points */ -void Save_Shared_Data(void); +void Save_Shared_Data(); int run_time_remap(); #endif diff -r 12e008d41344 -r 697ef44129c6 src/unexmips.c --- a/src/unexmips.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexmips.c Mon Aug 13 11:20:41 2007 +0200 @@ -26,7 +26,6 @@ #include <sys/file.h> #include <sys/stat.h> #include <stdio.h> -#include <errno.h> #include <varargs.h> #ifdef MACH @@ -96,6 +95,7 @@ if (lseek (_fd, _position, L_SET) != _position) \ fatal_unexec (_error_message, _error_arg); +extern int errno; extern char *strerror (); #define EEOF -1 diff -r 12e008d41344 -r 697ef44129c6 src/unexnt.c --- a/src/unexnt.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexnt.c Mon Aug 13 11:20:41 2007 +0200 @@ -61,22 +61,19 @@ #include <fcntl.h> #include <windows.h> -#include "nt.h" -#include "ntheap.h" - /* From IMAGEHLP.H which is not installed by default by MSVC < 5 */ /* The IMAGEHLP.DLL library is not distributed by default with Windows95 */ -typedef PIMAGE_NT_HEADERS -(__stdcall * pfnCheckSumMappedFile_t) (LPVOID BaseAddress, DWORD FileLength, - LPDWORD HeaderSum, LPDWORD CheckSum); - +PIMAGE_NT_HEADERS +(__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress, DWORD FileLength, + LPDWORD HeaderSum, LPDWORD CheckSum); #if 0 extern BOOL ctrl_c_handler (unsigned long type); #endif -/* Sync with FSF Emacs 19.34.6 - note: struct file_data is now defined in nt.h */ +#include "ntheap.h" + +/* Sync with FSF Emacs 19.34.6 note: struct file_data is now defined in ntheap.h */ enum { HEAP_UNINITIALIZED = 1, @@ -103,20 +100,21 @@ PUCHAR bss_start = UNINIT_PTR; DWORD bss_size = UNINIT_LONG; +#ifdef HAVE_NTGUI +HINSTANCE hinst = NULL; +HINSTANCE hprevinst = NULL; +LPSTR lpCmdLine = ""; +int nCmdShow = 0; +#endif /* HAVE_NTGUI */ + /* Startup code for running on NT. When we are running as the dumped version, we need to bootstrap our heap and .bss section into our address space before we can actually hand off control to the startup code supplied by NT (primarily because that code relies upon malloc ()). */ - -/* ********************** - Hackers please remember, this _start() thingy is *not* called neither - when dumping portably, nor when running from temacs! Do not put - significant XEmacs initialization here! - ********************** */ - void _start (void) { + char * p; extern void mainCRTStartup (void); /* Cache system info, e.g., the NT page size. */ @@ -136,29 +134,18 @@ exit (1); } - /* #### This is super-bogus. When I rename xemacs.exe, - the renamed file still loads its heap from xemacs.exe --kkm */ -#if 0 - { - /* To allow profiling, make sure executable_path names the .exe - file, not the file created by the profiler */ - char *p = strrchr (executable_path, '\\'); - strcpy (p+1, PATH_PROGNAME ".exe"); - } -#endif + /* To allow profiling, make sure executable_path names the .exe + file, not the file created by the profiler */ + p = strrchr (executable_path, '\\'); + strcpy (p+1, PATH_PROGNAME ".exe"); recreate_heap (executable_path); heap_state = HEAP_LOADED; } - /* #### This is bogus, too. _fmode is set to different values - when we run `xemacs' and `temacs run-emacs'. The sooner we - hit and fix all the weirdities this causes us, the better --kkm */ -#if 0 /* The default behavior is to treat files as binary and patch up - text files appropriately. */ + text files appropriately, in accordance with the MSDOS code. */ _fmode = O_BINARY; -#endif #if 0 /* This prevents ctrl-c's in shells running while we're suspended from @@ -166,6 +153,14 @@ SetConsoleCtrlHandler ((PHANDLER_ROUTINE) ctrl_c_handler, TRUE); #endif + /* Invoke the NT CRT startup routine now that our housecleaning + is finished. */ +#ifdef HAVE_NTGUI + /* determine WinMain args like crt0.c does */ + hinst = GetModuleHandle(NULL); + lpCmdLine = GetCommandLine(); + nCmdShow = SW_SHOWDEFAULT; +#endif mainCRTStartup (); } @@ -178,7 +173,7 @@ char out_filename[MAX_PATH], in_filename[MAX_PATH]; unsigned long size; char *ptr; - HINSTANCE hImagehelp; + HANDLE hImagehelp; /* Make sure that the input and output filenames have the ".exe" extension...patch them up if they don't. */ @@ -233,29 +228,21 @@ { PIMAGE_DOS_HEADER dos_header; PIMAGE_NT_HEADERS nt_header; - DWORD headersum; DWORD checksum; - pfnCheckSumMappedFile_t pfnCheckSumMappedFile; dos_header = (PIMAGE_DOS_HEADER) out_file.file_base; nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); nt_header->OptionalHeader.CheckSum = 0; -#if 0 - nt_header->FileHeader.TimeDateStamp = time (NULL); - dos_header->e_cp = size / 512; - nt_header->OptionalHeader.SizeOfImage = size; -#endif +// nt_header->FileHeader.TimeDateStamp = time (NULL); +// dos_header->e_cp = size / 512; +// nt_header->OptionalHeader.SizeOfImage = size; - pfnCheckSumMappedFile = - (pfnCheckSumMappedFile_t) GetProcAddress (hImagehelp, - "CheckSumMappedFile"); + pfnCheckSumMappedFile = (void *) GetProcAddress (hImagehelp, "CheckSumMappedFile"); if (pfnCheckSumMappedFile) { -#if 0 - nt_header->FileHeader.TimeDateStamp = time (NULL); -#endif +// nt_header->FileHeader.TimeDateStamp = time (NULL); pfnCheckSumMappedFile (out_file.file_base, out_file.size, &headersum, @@ -269,6 +256,40 @@ close_file_data (&out_file); } + +/* File handling. */ + + +int +open_output_file (file_data *p_file, char *filename, unsigned long size) +{ + HANDLE file; + HANDLE file_mapping; + void *file_base; + + file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + if (file == INVALID_HANDLE_VALUE) + return FALSE; + + file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE, + 0, size, NULL); + if (!file_mapping) + return FALSE; + + file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size); + if (file_base == 0) + return FALSE; + + p_file->name = filename; + p_file->size = size; + p_file->file = file; + p_file->file_mapping = file_mapping; + p_file->file_base = file_base; + + return TRUE; +} + /* Routines to manipulate NT executable file sections. */ #ifndef DUMP_SEPARATE_SECTION @@ -448,7 +469,7 @@ DUMP_MSG (("Dumping data section...\n")); DUMP_MSG (("\t0x%08x Address in process.\n", data_va)); DUMP_MSG (("\t0x%08x Offset in output file.\n", - (char*)data_file - p_outfile->file_base)); + data_file - p_outfile->file_base)); DUMP_MSG (("\t0x%08x Size in bytes.\n", size)); memcpy (data_file, data_va, size); diff -r 12e008d41344 -r 697ef44129c6 src/unexsunos4.c --- a/src/unexsunos4.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/unexsunos4.c Mon Aug 13 11:20:41 2007 +0200 @@ -80,7 +80,7 @@ /********************** Function Prototypes/Declarations ***********/ -static void unexec_error (const char *m, int use_errno, ...); +static void unexec_error (CONST char *m, int use_errno, ...); static int unexec_open (char *filename, int flag, int mode); static caddr_t unexec_mmap (int fd, size_t len, int prot, int flags); static long unexec_seek (int fd, long position); @@ -116,9 +116,9 @@ /*******************************************************************/ static void -unexec_error (const char *fmt, int use_errno, ...) +unexec_error (CONST char *fmt, int use_errno, ...) { - const char *err_msg = SYS_ERR; + CONST char *err_msg = SYS_ERR; va_list args; fprintf (stderr, "unexec - "); diff -r 12e008d41344 -r 697ef44129c6 src/vm-limit.c --- a/src/vm-limit.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/vm-limit.c Mon Aug 13 11:20:41 2007 +0200 @@ -45,7 +45,7 @@ /* Function to call to issue a warning; 0 means don't issue them. */ -static void (*warn_function) (const char *); +static void (*warn_function) (CONST char *); /* Get more memory space, complaining if we're near the end. */ @@ -57,7 +57,6 @@ POINTER cp; unsigned long five_percent; unsigned long data_size; - void (*save_warn_fun) (const char *); if (lim_data == 0) get_lim_data (); @@ -68,43 +67,36 @@ data_size = (char *) cp - (char *) data_space_start; if (warn_function) - { - /* temporarily reset the warn_function to 0 or we will get infinite - looping. */ - save_warn_fun = warn_function; - warn_function = 0; - switch (warnlevel) - { - case 0: - if (data_size > five_percent * 15) - { - warnlevel++; - (*warn_function) ("Warning: past 75% of memory limit"); - } - break; + switch (warnlevel) + { + case 0: + if (data_size > five_percent * 15) + { + warnlevel++; + (*warn_function) ("Warning: past 75% of memory limit"); + } + break; - case 1: - if (data_size > five_percent * 17) - { - warnlevel++; - (*warn_function) ("Warning: past 85% of memory limit"); - } - break; + case 1: + if (data_size > five_percent * 17) + { + warnlevel++; + (*warn_function) ("Warning: past 85% of memory limit"); + } + break; - case 2: - if (data_size > five_percent * 19) - { - warnlevel++; - (*warn_function) ("Warning: past 95% of memory limit"); - } - break; + case 2: + if (data_size > five_percent * 19) + { + warnlevel++; + (*warn_function) ("Warning: past 95% of memory limit"); + } + break; - default: - (*warn_function) ("Warning: past acceptable memory limits"); - break; - } - warn_function = save_warn_fun; - } + default: + (*warn_function) ("Warning: past acceptable memory limits"); + break; + } /* If we go down below 70% full, issue another 75% warning when we go up again. */ @@ -127,12 +119,12 @@ also declare where the end of pure storage is. */ void -memory_warnings (void *start, void (*warnfun) (const char *)) +memory_warnings (void *start, void (*warnfun) (CONST char *)) { extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ if (start) - data_space_start = (char*) start; + data_space_start = start; else data_space_start = start_of_data (); diff -r 12e008d41344 -r 697ef44129c6 src/widget.c --- a/src/widget.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/widget.c Mon Aug 13 11:20:41 2007 +0200 @@ -101,7 +101,7 @@ newargs[0] = Fwidget_get (args[0], args[1]); newargs[1] = args[0]; newargs[2] = Flist (nargs - 2, args + 2); - GCPRO1 (newargs[2]); + GCPRO1 ((newargs[2])); RETURN_UNGCPRO (Fapply (3, newargs)); } diff -r 12e008d41344 -r 697ef44129c6 src/window.c --- a/src/window.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/window.c Mon Aug 13 11:20:41 2007 +0200 @@ -38,10 +38,9 @@ #include "window.h" #include "elhash.h" #include "commands.h" -#include "gutter.h" Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp; -Lisp_Object Qdisplay_buffer; +Lisp_Object Qscroll_up, Qscroll_down, Qdisplay_buffer; #ifdef MEMORY_USAGE_STATS Lisp_Object Qface_cache, Qglyph_cache, Qline_start_cache, Qother_redisplay; @@ -85,9 +84,6 @@ /* Spacing between outer egde of divider border and window edge */ Lisp_Object Vvertical_divider_spacing; -/* How much to scroll by per-line. */ -Lisp_Object Vwindow_pixel_scroll_increment; - /* Scroll if point lands on the bottom line and that line is partially clipped. */ int scroll_on_clipped_lines; @@ -121,7 +117,7 @@ int next_screen_context_lines; /* List of freed window configurations with 1 - 10 windows. */ -static Lisp_Object Vwindow_configuration_free_list[10]; +Lisp_Object Vwindow_configuration_free_list[10]; #define SET_LAST_MODIFIED(w, cache_too) \ do { \ @@ -141,38 +137,38 @@ #define MARK_DISP_VARIABLE(field) \ - mark_object (window->field[CURRENT_DISP]); \ - mark_object (window->field[DESIRED_DISP]); \ - mark_object (window->field[CMOTION_DISP]); + markobj (window->field[CURRENT_DISP]); \ + markobj (window->field[DESIRED_DISP]); \ + markobj (window->field[CMOTION_DISP]); static Lisp_Object -mark_window (Lisp_Object obj) +mark_window (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct window *window = XWINDOW (obj); - mark_object (window->frame); - mark_object (window->mini_p); - mark_object (window->next); - mark_object (window->prev); - mark_object (window->hchild); - mark_object (window->vchild); - mark_object (window->parent); - mark_object (window->buffer); + markobj (window->frame); + markobj (window->mini_p); + markobj (window->next); + markobj (window->prev); + markobj (window->hchild); + markobj (window->vchild); + markobj (window->parent); + markobj (window->buffer); MARK_DISP_VARIABLE (start); MARK_DISP_VARIABLE (pointm); - mark_object (window->sb_point); /* #### move to scrollbar.c? */ - mark_object (window->use_time); + markobj (window->sb_point); /* #### move to scrollbar.c? */ + markobj (window->use_time); MARK_DISP_VARIABLE (last_modified); MARK_DISP_VARIABLE (last_point); MARK_DISP_VARIABLE (last_start); MARK_DISP_VARIABLE (last_facechange); - mark_object (window->line_cache_last_updated); - mark_object (window->redisplay_end_trigger); - mark_object (window->subwindow_instance_cache); - - mark_face_cachels (window->face_cachels); - mark_glyph_cachels (window->glyph_cachels); - -#define WINDOW_SLOT(slot, compare) mark_object (window->slot) + markobj (window->line_cache_last_updated); + markobj (window->redisplay_end_trigger); + markobj (window->subwindow_instance_cache); + + mark_face_cachels (window->face_cachels, markobj); + mark_glyph_cachels (window->glyph_cachels, markobj); + +#define WINDOW_SLOT(slot, compare) ((void) (markobj (window->slot))) #include "winslots.h" return Qnil; @@ -235,7 +231,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("window", window, mark_window, print_window, finalize_window, - 0, 0, 0, struct window); + 0, 0, struct window); #define INIT_DISP_VARIABLE(field, initialization) \ @@ -281,20 +277,15 @@ p->face_cachels = Dynarr_new (face_cachel); p->glyph_cachels = Dynarr_new (glyph_cachel); p->line_start_cache = Dynarr_new (line_start_cache); - p->subwindow_instance_cache = make_lisp_hash_table (30, - HASH_TABLE_KEY_VALUE_WEAK, - HASH_TABLE_EQUAL); + p->subwindow_instance_cache = make_lisp_hash_table (10, + HASH_TABLE_KEY_WEAK, + HASH_TABLE_EQ); p->line_cache_last_updated = Qzero; INIT_DISP_VARIABLE (last_point_x, 0); INIT_DISP_VARIABLE (last_point_y, 0); INIT_DISP_VARIABLE (window_end_pos, 0); p->redisplay_end_trigger = Qnil; - p->gutter_extent_modiff[0] = 0; - p->gutter_extent_modiff[1] = 0; - p->gutter_extent_modiff[2] = 0; - p->gutter_extent_modiff[3] = 0; - #define WINDOW_SLOT(slot, compare) p->slot = Qnil #include "winslots.h" @@ -650,7 +641,7 @@ return window_is_leftmost (w) && window_is_rightmost (w); } -int +static int window_is_highest (struct window *w) { Lisp_Object parent, current_ancestor, window; @@ -678,7 +669,7 @@ return 0; } -int +static int window_is_lowest (struct window *w) { Lisp_Object parent, current_ancestor, window; @@ -714,11 +705,6 @@ int window_truncation_on (struct window *w) { - /* Minibuffer windows are never truncated. - #### is this the right way ? */ - if (MINI_WINDOW_P (w)) - return 0; - /* Horizontally scrolled windows are truncated. */ if (w->hscroll) return 1; @@ -737,17 +723,6 @@ return 0; } -DEFUN ("window-truncated-p", Fwindow_truncated_p, 0, 1, 0, /* -Returns non-nil if text in the window is truncated. -*/ - (window)) -{ - struct window *w = decode_window (window); - - return window_truncation_on (w) ? Qt : Qnil; -} - - static int have_undivided_common_edge (struct window *w_right, void *closure) { @@ -997,6 +972,32 @@ return margin_width_internal (w, 0); } +static int +window_top_toolbar_height (struct window *w) +{ + /* #### implement this shit. */ + return 0; +} + +/* #### Currently used in scrollbar.c. Does it actually need to be? */ +int +window_bottom_toolbar_height (struct window *w) +{ + return 0; +} + +static int +window_left_toolbar_width (struct window *w) +{ + return 0; +} + +static int +window_right_toolbar_width (struct window *w) +{ + return 0; +} + /***************************************************************************** Window Gutters @@ -1015,74 +1016,62 @@ relative to the frame, not the window. ****************************************************************************/ -static int -window_top_window_gutter_height (struct window *w) -{ - if (!NILP (w->hchild) || !NILP (w->vchild)) - return 0; - -#ifdef HAVE_SCROLLBARS - if (!NILP (w->scrollbar_on_top_p)) - return window_scrollbar_height (w); - else -#endif - return 0; -} - int window_top_gutter_height (struct window *w) { - return window_top_window_gutter_height (w); -} - -static int -window_bottom_window_gutter_height (struct window *w) -{ - int gutter; + int toolbar_height = window_top_toolbar_height (w); if (!NILP (w->hchild) || !NILP (w->vchild)) return 0; - gutter = window_modeline_height (w); - #ifdef HAVE_SCROLLBARS - if (NILP (w->scrollbar_on_top_p)) - return window_scrollbar_height (w) + gutter; + if (!NILP (w->scrollbar_on_top_p)) + return window_scrollbar_height (w) + toolbar_height; else #endif - return gutter; + return toolbar_height; } int window_bottom_gutter_height (struct window *w) { - return window_bottom_window_gutter_height (w); -} - -static int -window_left_window_gutter_width (struct window *w, int modeline) -{ + int other_height; + if (!NILP (w->hchild) || !NILP (w->vchild)) return 0; + else + other_height = + window_modeline_height (w) + window_bottom_toolbar_height (w); #ifdef HAVE_SCROLLBARS - if (!modeline && !NILP (w->scrollbar_on_left_p)) - return window_scrollbar_width (w); + if (NILP (w->scrollbar_on_top_p)) + return window_scrollbar_height (w) + other_height; + else #endif - - return 0; + return other_height; } int window_left_gutter_width (struct window *w, int modeline) { - return window_left_window_gutter_width (w, modeline); + int gutter = window_left_toolbar_width (w); + + if (!NILP (w->hchild) || !NILP (w->vchild)) + return 0; + + +#ifdef HAVE_SCROLLBARS + if (!modeline && !NILP (w->scrollbar_on_left_p)) + gutter += window_scrollbar_width (w); +#endif + + return gutter; } -static int -window_right_window_gutter_width (struct window *w, int modeline) +int +window_right_gutter_width (struct window *w, int modeline) { - int gutter = 0; + int gutter = window_right_toolbar_width (w); if (!NILP (w->hchild) || !NILP (w->vchild)) return 0; @@ -1098,18 +1087,6 @@ return gutter; } -int -window_right_gutter_width (struct window *w, int modeline) -{ - return window_right_window_gutter_width (w, modeline); -} - -static int -window_pixel_height (struct window* w) -{ - return WINDOW_HEIGHT (w); -} - DEFUN ("windowp", Fwindowp, 1, 1, 0, /* Return t if OBJ is a window. @@ -1146,26 +1123,6 @@ } } -DEFUN ("last-nonminibuf-window", Flast_nonminibuf_window, 0, 1, 0, /* -Return the last selected window that is not a minibuffer window. -If the optional argument CON-DEV-OR-FRAME is specified and is a frame, -return the last non-minibuffer window used by that frame. If -CON-DEV-OR-FRAME is a device, then the selected frame on that device -will be used. If CON-DEV-OR-FRAME is a console, the selected frame on -that console's selected device will be used. Otherwise, the selected -frame is used. -*/ - (con_dev_or_frame)) -{ - if (NILP (con_dev_or_frame) && NILP (Fselected_device (Qnil))) - return Qnil; /* happens at startup */ - - { - struct frame *f = decode_frame_or_selected (con_dev_or_frame); - return FRAME_LAST_NONMINIBUF_WINDOW (f); - } -} - DEFUN ("minibuffer-window", Fminibuffer_window, 0, 1, 0, /* Return the window used now for minibuffers. If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return @@ -1179,7 +1136,7 @@ return FRAME_MINIBUF_WINDOW (decode_frame_or_selected (con_dev_or_frame)); } -DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 0, 1, 0, /* +DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /* Return non-nil if WINDOW is a minibuffer window. */ (window)) @@ -1325,22 +1282,6 @@ Use `window-height' to get consistent results in geometry calculations. Use `window-displayed-height' to get the actual number of lines currently displayed in a window. - -The names are somewhat confusing; here's a table to help out: - - width height -------------------------------------------------------------------------- -w/o gutters - (rows/columns) window-width window-text-area-height - (pixels) window-text-area-pixel-width window-text-area-pixel-height - -with gutters - (rows/columns) window-full-width window-height - (pixels) window-pixel-width window-pixel-height - -actually displayed - (rows/columns) ---- window-displayed-height - (pixels) ---- window-displayed-text-pixel-height */ (window)) { @@ -1367,20 +1308,7 @@ */ (window)) { - return make_int (window_pixel_height (decode_window (window))); -} - -DEFUN ("window-text-area-height", Fwindow_text_area_height, 0, 1, 0, /* -Return the number of default lines in the text area of WINDOW. -This actually works by dividing the window's text area pixel height (i.e. -excluding the modeline and horizontal scrollbar, if any) by the height of the -default font; therefore, the number of displayed lines will probably -be different. -See also `window-height' and `window-displayed-height'. -*/ - (window)) -{ - return make_int (window_char_height (decode_window (window), 0)); + return make_int (decode_window (window)->pixel_height); } DEFUN ("window-text-area-pixel-height", @@ -1417,7 +1345,7 @@ if (NILP (window)) window = Fselected_window (Qnil); - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); w = XWINDOW (window); start = marker_position (w->start[CURRENT_DISP]); @@ -1461,25 +1389,13 @@ DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* Return the number of display columns in WINDOW. -This is the width that is usable columns available for text in WINDOW, -and does not include vertical scrollbars, dividers, or the like. See also -`window-full-width' and `window-height'. +This is the width that is usable columns available for text in WINDOW. */ (window)) { return make_int (window_char_width (decode_window (window), 0)); } -DEFUN ("window-full-width", Fwindow_full_width, 0, 1, 0, /* -Return the total number of columns in WINDOW. -This is like `window-width' but includes vertical scrollbars, dividers, -etc. -*/ - (window)) -{ - return make_int (window_char_width (decode_window (window), 1)); -} - DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* Return the width of WINDOW in pixels. Defaults to current window. */ @@ -1509,23 +1425,22 @@ return make_int (decode_window (window)->hscroll); } +#ifdef MODELINE_IS_SCROLLABLE DEFUN ("modeline-hscroll", Fmodeline_hscroll, 0, 1, 0, /* -Return the horizontal scrolling ammount of WINDOW's modeline. -If the window has no modeline, return nil. +Return the number of columns by which WINDOW's modeline is scrolled from +left margin. If the window has no modeline, return nil. */ (window)) { struct window *w = decode_window (window); - return (WINDOW_HAS_MODELINE_P (w)) ? make_int ((int) w->modeline_hscroll) : - Qnil; + return (WINDOW_HAS_MODELINE_P (w)) ? make_int (w->modeline_hscroll) : Qnil; } DEFUN ("set-modeline-hscroll", Fset_modeline_hscroll, 2, 2, 0, /* -Set the horizontal scrolling ammount of WINDOW's modeline to NCOL. -If NCOL is negative, it will silently be forced to 0. -If the window has no modeline, return nil. Otherwise, return the actual -value that was set. +Set number of columns WINDOW's modeline is scrolled from left margin to NCOL. +NCOL should be zero or positive. If NCOL is negative, it will be forced to 0. +If the window has no modeline, do nothing and return nil. */ (window, ncol)) { @@ -1533,20 +1448,18 @@ if (WINDOW_HAS_MODELINE_P (w)) { - Charcount ncols; - + int ncols; CHECK_INT (ncol); - ncols = (XINT (ncol) <= 0) ? 0 : (Charcount) XINT (ncol); - if (ncols != w->modeline_hscroll) - { - MARK_MODELINE_CHANGED; - w->modeline_hscroll = ncols; - } - return make_int ((int) ncols); + ncols = XINT (ncol); + if (ncols < 0) ncols = 0; + if (w->modeline_hscroll != ncols) + MARK_MODELINE_CHANGED; + w->modeline_hscroll = ncols; + return ncol; } - return Qnil; } +#endif /* MODELINE_IS_SCROLLABLE */ DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /* Set number of columns WINDOW is scrolled from left margin to NCOL. @@ -1598,14 +1511,15 @@ DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* Return a list of the pixel edge coordinates of WINDOW. \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. -The frame toolbars, menubars and gutters are considered to be outside of this area. +The frame toolbars and menubars are considered to be outside of this area. */ (window)) { struct window *w = decode_window (window); - - int left = w->pixel_left; - int top = w->pixel_top; + struct frame *f = XFRAME (w->frame); + + int left = w->pixel_left - FRAME_LEFT_BORDER_END (f); + int top = w->pixel_top - FRAME_TOP_BORDER_END (f); return list4 (make_int (left), make_int (top), @@ -1694,28 +1608,6 @@ } } -DEFUN ("window-last-line-visible-height", Fwindow_last_line_visible_height, 0, 1, 0, /* -Return pixel height of visible part of last window line if it is clipped. -If the last line is not clipped, return nil. -*/ - (window)) -{ - struct window *w = decode_window (window); - display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP); - int num_lines = Dynarr_length (dla); - struct display_line *dl; - - /* No lines - no clipped lines */ - if (num_lines == 0 || (num_lines == 1 && Dynarr_atp (dla, 0)->modeline)) - return Qnil; - - dl = Dynarr_atp (dla, num_lines - 1); - if (dl->clip == 0) - return Qnil; - - return make_int (dl->ascent + dl->descent - dl->clip); -} - DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /* Make point value in WINDOW be at position POS in WINDOW's buffer. */ @@ -1867,34 +1759,6 @@ /* #### Here, if replacement is a vertical combination and so is its new parent, we should make replacement's children be children of that parent instead. */ - - ERROR_CHECK_SUBWINDOW_CACHE (p); -} - -static int -window_unmap_subwindows_cache_mapper (Lisp_Object key, Lisp_Object value, - void *flag_closure) -{ - /* 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); - /* 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))); - } - return 0; -} - -static void -window_unmap_subwindows (struct window* w) -{ - assert (!NILP (w->subwindow_instance_cache)); - elisp_maphash (window_unmap_subwindows_cache_mapper, - w->subwindow_instance_cache, 0); } /* we're deleting W; set the structure of W to indicate this. */ @@ -1902,20 +1766,6 @@ static void mark_window_as_deleted (struct window *w) { - /* The window instance cache is going away now, so need to get the - cachels reset by redisplay. */ - MARK_FRAME_SUBWINDOWS_CHANGED (XFRAME (WINDOW_FRAME (w))); - - /* The cache is going away. If we leave unmapping to - reset_subwindow_cachels then we get in a situation where the - domain (the window) has been deleted but we still need access to - its attributes in order to unmap windows properly. Since the - subwindows are going to get GC'd anyway as a result of the domain - going away, it is safer to just unmap them all while we know the - domain is still valid. */ - ERROR_CHECK_SUBWINDOW_CACHE (w); - window_unmap_subwindows (w); - /* In the loop (while t (split-window) (delete-window)) we end up with a tree of deleted windows which are all connected @@ -1927,13 +1777,13 @@ Since the window-configuration code doesn't need any of the pointers to other windows (they are all recreated from the window-config data), we set them all to nil so that we - are able to collect more actual garbage. */ + are able to collect more actual garbage. + */ w->next = Qnil; w->prev = Qnil; w->hchild = Qnil; w->vchild = Qnil; w->parent = Qnil; - w->subwindow_instance_cache = Qnil; w->dead = 1; @@ -1970,7 +1820,6 @@ window = Fselected_window (Qnil); else CHECK_WINDOW (window); - w = XWINDOW (window); /* It's okay to delete an already-deleted window. */ @@ -2004,12 +1853,6 @@ par = XWINDOW (parent); MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); - /* It's quite likely that deleting a window will result in - subwindows needing to be deleted also (since they are cached - per-window). So we mark them as changed, so that the cachels will - get reset by redisplay and thus deleted subwindows can get - GC'd. */ - MARK_FRAME_SUBWINDOWS_CHANGED (f); /* Are we trying to delete any frame's selected window? Note that we could be dealing with a non-leaf window @@ -2741,7 +2584,7 @@ new_buffer = Fother_buffer (obj, Qnil, Qnil); if (NILP (new_buffer)) new_buffer = Fget_buffer_create (QSscratch); - Fset_window_buffer (w, new_buffer, Qnil); + Fset_window_buffer (w, new_buffer); if (EQ (w, Fselected_window (Qnil))) Fset_buffer (p->buffer); } @@ -2813,7 +2656,7 @@ /* Otherwise show a different buffer in the window. */ p->dedicated = Qnil; - Fset_window_buffer (w, another_buffer, Qnil); + Fset_window_buffer (w, another_buffer); if (EQ (w, Fselected_window (Qnil))) Fset_buffer (p->buffer); } @@ -3114,41 +2957,17 @@ window_min_height = MIN_SAFE_WINDOW_HEIGHT; } -static int -frame_min_height (struct frame *frame) -{ - /* For height, we have to see whether the frame has a minibuffer, and - whether it wants a modeline. */ - return (FRAME_MINIBUF_ONLY_P (frame) ? MIN_SAFE_WINDOW_HEIGHT - 1 - : (! FRAME_HAS_MINIBUF_P (frame)) ? MIN_SAFE_WINDOW_HEIGHT - : 2 * MIN_SAFE_WINDOW_HEIGHT - 1); -} - -/* Return non-zero if both frame sizes are less than or equal to - minimal allowed values. ROWS and COLS are in characters */ -int -frame_size_valid_p (struct frame *frame, int rows, int cols) -{ - return (rows >= frame_min_height (frame) - && cols >= MIN_SAFE_WINDOW_WIDTH); -} - -/* Return non-zero if both frame sizes are less than or equal to - minimal allowed values. WIDTH and HEIGHT are in pixels */ -int -frame_pixsize_valid_p (struct frame *frame, int width, int height) -{ - int rows, cols; - pixel_to_real_char_size (frame, width, height, &cols, &rows); - return frame_size_valid_p (frame, rows, cols); -} - /* If *ROWS or *COLS are too small a size for FRAME, set them to the minimum allowable size. */ void check_frame_size (struct frame *frame, int *rows, int *cols) { - int min_height = frame_min_height (frame); + /* For height, we have to see whether the frame has a minibuffer, and + whether it wants a modeline. */ + int min_height = + (FRAME_MINIBUF_ONLY_P (frame) ? MIN_SAFE_WINDOW_HEIGHT - 1 + : (! FRAME_HAS_MINIBUF_P (frame)) ? MIN_SAFE_WINDOW_HEIGHT + : 2 * MIN_SAFE_WINDOW_HEIGHT - 1); if (*rows < min_height) *rows = min_height; @@ -3298,14 +3117,11 @@ static int window_select_count; -DEFUN ("set-window-buffer", Fset_window_buffer, 2, 3, 0, /* +DEFUN ("set-window-buffer", Fset_window_buffer, 2, 2, 0, /* Make WINDOW display BUFFER as its contents. BUFFER can be a buffer or buffer name. - -With non-nil optional argument `norecord', do not modify the -global or per-frame buffer ordering. */ - (window, buffer, norecord)) + (window, buffer)) { Lisp_Object tem; struct window *w = decode_window (window); @@ -3364,9 +3180,6 @@ recompute_all_cached_specifiers_in_window (w); if (EQ (window, Fselected_window (Qnil))) { - if (NILP (norecord)) - Frecord_buffer (buffer); - Fset_buffer (buffer); } return Qnil; @@ -3391,9 +3204,8 @@ /* we have already caught dead-window errors */ if (!NILP (w->hchild) || !NILP (w->vchild)) error ("Trying to select non-leaf window"); - + w->use_time = make_int (++window_select_count); - if (EQ (window, old_selected_window)) return window; @@ -3517,10 +3329,6 @@ p->line_start_cache = Dynarr_new (line_start_cache); p->face_cachels = Dynarr_new (face_cachel); p->glyph_cachels = Dynarr_new (glyph_cachel); - p->subwindow_instance_cache = - make_lisp_hash_table (30, - HASH_TABLE_KEY_VALUE_WEAK, - HASH_TABLE_EQUAL); /* Put new into window structure in place of window */ replace_window (window, new); @@ -3558,7 +3366,7 @@ if (NILP (window)) window = Fselected_window (Qnil); else - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); o = XWINDOW (window); f = XFRAME (WINDOW_FRAME (o)); @@ -3674,7 +3482,7 @@ /* do this last (after the window is completely initialized and the mirror-dirty flag is set) so that specifier recomputation caused as a result of this will work properly and not abort. */ - Fset_window_buffer (new, o->buffer, Qt); + Fset_window_buffer (new, o->buffer); return new; } @@ -3736,6 +3544,12 @@ } static int +window_pixel_height (Lisp_Object window) +{ + return WINDOW_HEIGHT (XWINDOW (window)); +} + +static int window_pixel_height_to_char_height (struct window *w, int pixel_height, int include_gutters_p) { @@ -3748,8 +3562,8 @@ avail_height = (pixel_height - (include_gutters_p ? 0 : - window_top_window_gutter_height (w) + - window_bottom_window_gutter_height (w))); + window_top_gutter_height (w) + + window_bottom_gutter_height (w))); default_face_height_and_width (window, &defheight, &defwidth); @@ -3780,8 +3594,8 @@ avail_height = char_height * defheight; pixel_height = (avail_height + (include_gutters_p ? 0 : - window_top_window_gutter_height (w) + - window_bottom_window_gutter_height (w))); + window_top_gutter_height (w) + + window_bottom_gutter_height (w))); /* It's the calling function's responsibility to check these values and make sure they're not out of range. @@ -3794,12 +3608,11 @@ /* Return number of default lines of text can fit in the window W. If INCLUDE_GUTTERS_P is 1, include "gutter" space (modeline plus horizontal scrollbar) in the space that is used for the calculation. - This doesn't include space used by the frame gutters. */ int window_char_height (struct window *w, int include_gutters_p) { - return window_pixel_height_to_char_height (w, window_pixel_height (w), + return window_pixel_height_to_char_height (w, WINDOW_HEIGHT (w), include_gutters_p); } @@ -3879,8 +3692,6 @@ return WINDOW_WIDTH (XWINDOW (window)); } -/* Calculate the pixel of a window, optionally including margin space - but no vertical gutters. */ static int window_pixel_width_to_char_width (struct window *w, int pixel_width, int include_margins_p) @@ -3925,8 +3736,8 @@ avail_width = char_width * defwidth; pixel_width = (avail_width + - window_left_window_gutter_width (w, 0) + - window_right_window_gutter_width (w, 0) + + window_left_gutter_width (w, 0) + + window_right_gutter_width (w, 0) + (include_margins_p ? 0 : window_left_margin_width (w)) + (include_margins_p ? 0 : window_right_margin_width (w))); @@ -3965,12 +3776,6 @@ (widthflag ? window_min_width : MINI_WINDOW_P (XWINDOW (window)) \ ? 1 : window_min_height) -static int -window_pixheight (Lisp_Object w) -{ - return window_pixel_height (XWINDOW (w)); -} - /* Unlike set_window_pixheight, this function also changes the heights of the siblings so as to keep everything consistent. */ @@ -3986,7 +3791,7 @@ int *sizep; int (*sizefun) (Lisp_Object) = (widthflag ? window_pixel_width - : window_pixheight); + : window_pixel_height); void (*setsizefun) (Lisp_Object, int, int) = (widthflag ? set_window_pixwidth : set_window_pixheight); @@ -4121,8 +3926,6 @@ SET_LAST_MODIFIED (w, 0); SET_LAST_FACECHANGE (w); MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); - /* overkill maybe, but better to be correct */ - MARK_FRAME_GUTTERS_CHANGED (f); } #undef MINSIZE #undef CURBEG @@ -4132,8 +3935,7 @@ -/* Scroll contents of window WINDOW up N lines. If N < (top line height / - average line height) then we just adjust the top clip. */ +/* Scroll contents of window WINDOW up N lines. */ void window_scroll (Lisp_Object window, Lisp_Object n, int direction, Error_behavior errb) @@ -4143,9 +3945,6 @@ int selected = EQ (window, Fselected_window (Qnil)); int value = 0; Lisp_Object point, tem; - display_line_dynarr *dla; - int fheight, fwidth, modeline = 0; - struct display_line* dl; if (selected) point = make_int (BUF_PT (b)); @@ -4175,7 +3974,6 @@ window, Qnil); Fset_marker (w->start[CURRENT_DISP], point, w->buffer); w->start_at_line_beg = beginning_of_line_p (b, XINT (point)); - WINDOW_TEXT_TOP_CLIP (w) = 0; MARK_WINDOWS_CHANGED (w); } @@ -4219,164 +4017,82 @@ { return; } - - /* Determine parameters to test for partial line scrolling with. */ - dla = window_display_lines (w, CURRENT_DISP); - - if (INTP (Vwindow_pixel_scroll_increment)) - fheight = XINT (Vwindow_pixel_scroll_increment); - else if (!NILP (Vwindow_pixel_scroll_increment)) - default_face_height_and_width (window, &fheight, &fwidth); - - if (Dynarr_length (dla) >= 1) - modeline = Dynarr_atp (dla, 0)->modeline; - - dl = Dynarr_atp (dla, modeline); - - if (value > 0) + else if (value > 0) { - /* Go for partial display line scrolling. This just means bumping - the clip by a reasonable amount and redisplaying, everything else - remains unchanged. */ - if (!NILP (Vwindow_pixel_scroll_increment) - && - Dynarr_length (dla) >= (1 + modeline) - && - (dl->ascent - dl->top_clip) - fheight * value > 0) + int vtarget; + Bufpos startp, old_start; + + old_start = marker_position (w->start[CURRENT_DISP]); + startp = vmotion (w, old_start, value, &vtarget); + + if (vtarget < value && + (w->window_end_pos[CURRENT_DISP] == -1 + || (BUF_Z (b) - w->window_end_pos[CURRENT_DISP] > BUF_ZV (b)))) { - WINDOW_TEXT_TOP_CLIP (w) += value * fheight; - MARK_WINDOWS_CHANGED (w); + maybe_signal_error (Qend_of_buffer, Qnil, Qwindow, errb); + return; } else { - int vtarget; - Bufpos startp, old_start; - - if (WINDOW_TEXT_TOP_CLIP (w)) - { - WINDOW_TEXT_TOP_CLIP (w) = 0; - MARK_WINDOWS_CHANGED (w); - } - - old_start = marker_position (w->start[CURRENT_DISP]); - startp = vmotion (w, old_start, value, &vtarget); - - if (vtarget < value && - (w->window_end_pos[CURRENT_DISP] == -1 - || (BUF_Z (b) - w->window_end_pos[CURRENT_DISP] > BUF_ZV (b)))) + set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), + w->buffer); + w->force_start = 1; + w->start_at_line_beg = beginning_of_line_p (b, startp); + MARK_WINDOWS_CHANGED (w); + + if (!point_would_be_visible (w, startp, XINT (point))) { - maybe_signal_error (Qend_of_buffer, Qnil, Qwindow, errb); - return; - } - else - { - set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), - w->buffer); - w->force_start = 1; - w->start_at_line_beg = beginning_of_line_p (b, startp); - MARK_WINDOWS_CHANGED (w); - - if (!point_would_be_visible (w, startp, XINT (point))) - { - if (selected) - BUF_SET_PT (b, startp); - else - set_marker_restricted (w->pointm[CURRENT_DISP], - make_int (startp), - w->buffer); - } + if (selected) + BUF_SET_PT (b, startp); + else + set_marker_restricted (w->pointm[CURRENT_DISP], + make_int (startp), + w->buffer); } } } else if (value < 0) { - /* Go for partial display line scrolling. This just means bumping - the clip by a reasonable amount and redisplaying, everything else - remains unchanged. */ - if (!NILP (Vwindow_pixel_scroll_increment) - && - Dynarr_length (dla) >= (1 + modeline) - && - (dl->ascent - dl->top_clip) - fheight * value < - (dl->ascent + dl->descent - dl->clip) - && - WINDOW_TEXT_TOP_CLIP (w) + value * fheight > 0) + int vtarget; + Bufpos startp, old_start; + + old_start = marker_position (w->start[CURRENT_DISP]); + startp = vmotion (w, old_start, value, &vtarget); + + if (vtarget > value + && marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b)) { - WINDOW_TEXT_TOP_CLIP (w) += value * fheight; - MARK_WINDOWS_CHANGED (w); + maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb); + return; } else { - int vtarget; - Bufpos startp, old_start; - - if (WINDOW_TEXT_TOP_CLIP (w)) - { - WINDOW_TEXT_TOP_CLIP (w) = 0; - MARK_WINDOWS_CHANGED (w); - } - - old_start = marker_position (w->start[CURRENT_DISP]); - startp = vmotion (w, old_start, value, &vtarget); - - if (vtarget > value - && marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b)) - { - maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb); - return; - } - else + set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), + w->buffer); + w->force_start = 1; + w->start_at_line_beg = beginning_of_line_p (b, startp); + MARK_WINDOWS_CHANGED (w); + + if (!point_would_be_visible (w, startp, XINT (point))) { - set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), - w->buffer); - w->force_start = 1; - w->start_at_line_beg = beginning_of_line_p (b, startp); - MARK_WINDOWS_CHANGED (w); - - /* #### Scroll back by less than a line. This code was - originally for scrolling over large pixmaps and it - loses when a line being *exposed* at the top of the - window is bigger than the current one. However, for - pixel based scrolling in general we can guess that - the line we are going to display is probably the same - size as the one we are on. In that instance we can - have a reasonable stab at a suitable top clip. Fixing - this properly is hard (and probably slow) as we would - have to call redisplay to figure out the exposed line - size. */ - if (!NILP (Vwindow_pixel_scroll_increment) - && Dynarr_length (dla) >= (1 + modeline) - && dl->ascent + fheight * value > 0) - { - WINDOW_TEXT_TOP_CLIP (w) = (dl->ascent + fheight * value); - } - - if (!point_would_be_visible (w, startp, XINT (point))) - { - Bufpos new_point; - - if (MINI_WINDOW_P (w)) - new_point = startp; - else - new_point = start_of_last_line (w, startp); - - if (selected) - BUF_SET_PT (b, new_point); - else - set_marker_restricted (w->pointm[CURRENT_DISP], - make_int (new_point), - w->buffer); - } + Bufpos new_point; + + if (MINI_WINDOW_P (w)) + new_point = startp; + else + new_point = start_of_last_line (w, startp); + + if (selected) + BUF_SET_PT (b, new_point); + else + set_marker_restricted (w->pointm[CURRENT_DISP], + make_int (new_point), + w->buffer); } } } else /* value == 0 && direction == -1 */ { - if (WINDOW_TEXT_TOP_CLIP (w)) - { - WINDOW_TEXT_TOP_CLIP (w) = 0; - MARK_WINDOWS_CHANGED (w); - } if (marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b)) { maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb); @@ -4414,6 +4130,7 @@ } } } + } DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* @@ -4587,7 +4304,7 @@ if (NILP (window)) window = Fselected_window (Qnil); else - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); w = XWINDOW (window); b = XBUFFER (w->buffer); @@ -4889,7 +4606,7 @@ int pixel_width; int pixel_height; int hscroll; - Charcount modeline_hscroll; + int modeline_hscroll; int parent_index; /* index into saved_windows */ int prev_index; /* index into saved_windows */ char start_at_line_beg; /* boolean */ @@ -4926,35 +4643,36 @@ #define XWINDOW_CONFIGURATION(x) XRECORD (x, window_configuration, struct window_config) #define XSETWINDOW_CONFIGURATION(x, p) XSETRECORD (x, p, window_configuration) #define WINDOW_CONFIGURATIONP(x) RECORDP (x, window_configuration) +#define GC_WINDOW_CONFIGURATIONP(x) GC_RECORDP (x, window_configuration) #define CHECK_WINDOW_CONFIGURATION(x) CHECK_RECORD (x, window_configuration) static Lisp_Object -mark_window_config (Lisp_Object obj) +mark_window_config (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct window_config *config = XWINDOW_CONFIGURATION (obj); int i; - mark_object (config->current_window); - mark_object (config->current_buffer); - mark_object (config->minibuffer_scroll_window); - mark_object (config->root_window); + markobj (config->current_window); + markobj (config->current_buffer); + markobj (config->minibuffer_scroll_window); + markobj (config->root_window); for (i = 0; i < config->saved_windows_count; i++) { struct saved_window *s = SAVED_WINDOW_N (config, i); - mark_object (s->window); - mark_object (s->buffer); - mark_object (s->start); - mark_object (s->pointm); - mark_object (s->sb_point); - mark_object (s->mark); + markobj (s->window); + markobj (s->buffer); + markobj (s->start); + markobj (s->pointm); + markobj (s->sb_point); + markobj (s->mark); #if 0 /* #### This looked like this. I do not see why specifier cached values should not be marked, as such specifiers as toolbars might have GC-able instances. Freed configs are not marked, aren't they? -- kkm */ - mark_object (s->dedicated); + markobj (s->dedicated); #else -#define WINDOW_SLOT(slot, compare) mark_object (s->slot) +#define WINDOW_SLOT(slot, compare) ((void) (markobj (s->slot))) #include "winslots.h" #endif } @@ -4970,9 +4688,9 @@ } static size_t -sizeof_window_config (const void *h) +sizeof_window_config (CONST void *h) { - const struct window_config *c = (const struct window_config *) h; + CONST struct window_config *c = (CONST struct window_config *) h; return sizeof_window_config_for_n_windows (c->saved_windows_count); } @@ -4993,7 +4711,7 @@ window_configuration, mark_window_config, print_window_config, - 0, 0, 0, 0, sizeof_window_config, + 0, 0, 0, sizeof_window_config, struct window_config); @@ -5151,7 +4869,7 @@ int previous_pixel_width; int previous_minibuf_height, previous_minibuf_top,previous_minibuf_width; int real_font_height; - int converted_minibuf_height,target_minibuf_height; + int converted_minibuf_height,target_minibuf_height; int specpdl_count = specpdl_depth (); GCPRO1 (configuration); @@ -5216,20 +4934,15 @@ mark_windows_in_use (f, 1); - /* Force subwindows to be reinstantiated. They are all going - anyway and if we don't do this GC may not happen between now - and the next time we check their integrity. */ - reset_frame_subwindow_instance_cache (f); - #if 0 /* JV: This is bogus, First of all, the units are inconsistent. The frame sizes are measured - in characters but the window sizes are stored in pixels. So if a + in characters but the window sizes are stored in pixels. So if a font size change happened between saving and restoring, the frame "sizes" maybe equal but the windows still should be resized. This is tickled alot by the new "character size stays constant" policy in 21.0. It leads to very wierd - glitches (and possibly crashes when asserts are tickled). + glitches (and possibly craches when asserts are tickled). Just changing the units doens't help because changing the toolbar configuration can also change the pixel positions. @@ -5245,7 +4958,7 @@ || config->frame_width != FRAME_WIDTH (f)) change_frame_size (f, config->frame_height, config->frame_width, 0); #endif - + previous_pixel_top = XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top; previous_pixel_height = XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_height; previous_pixel_left = XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left; @@ -5255,7 +4968,7 @@ default_face_height_and_width (frame, &real_font_height, 0); assert(real_font_height > 0); - + if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) { previous_minibuf_height @@ -5268,14 +4981,13 @@ else { previous_minibuf_height = 0; - previous_minibuf_top = 0; previous_minibuf_width = 0; } converted_minibuf_height = (previous_minibuf_height % real_font_height) == 0 ? - (previous_minibuf_height / real_font_height ) : /* lines */ previous_minibuf_height; /* pixels */ - + /* Temporarily avoid any problems with windows that are smaller than they are supposed to be. */ window_min_height = 1; @@ -5302,10 +5014,6 @@ w->glyph_cachels = Dynarr_new (glyph_cachel); if (!w->line_start_cache) w->line_start_cache = Dynarr_new (line_start_cache); - w->gutter_extent_modiff[0] = 0; - w->gutter_extent_modiff[1] = 0; - w->gutter_extent_modiff[2] = 0; - w->gutter_extent_modiff[3] = 0; w->dead = 0; if (p->parent_index >= 0) @@ -5363,19 +5071,11 @@ w->hscroll = p->hscroll; w->modeline_hscroll = p->modeline_hscroll; w->line_cache_last_updated = Qzero; - /* The subwindow instance cache isn't preserved across - window configurations, and in fact doing so would be - wrong. We just reset to zero and then redisplay will fill - it up as needed. */ - w->subwindow_instance_cache = - make_lisp_hash_table (30, - HASH_TABLE_KEY_VALUE_WEAK, - HASH_TABLE_EQUAL); SET_LAST_MODIFIED (w, 1); SET_LAST_FACECHANGE (w); w->config_mark = 0; -#define WINDOW_SLOT(slot, compare) w->slot = p->slot +#define WINDOW_SLOT(slot, compare) w->slot = p->slot; #include "winslots.h" /* Reinstall the saved buffer and pointers into it. */ @@ -5469,7 +5169,7 @@ #### Now we get more cases correct then ever before, but are we treating all? For instance what if the frames minibuf window - is no longer the same one? + is no longer the same one? */ target_minibuf_height = previous_minibuf_height; if (converted_minibuf_height && @@ -5492,7 +5192,7 @@ set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), previous_minibuf_width, 0); } - + /* This is a better way to deal with frame resizing, etc. What we _actually_ want is for the old (just restored) root window to fit @@ -5507,13 +5207,12 @@ /* Note that this function also updates the subwindow "pixel_left"s */ set_window_pixwidth (FRAME_ROOT_WINDOW (f), previous_pixel_width, 0); - + /* If restoring in the current frame make the window current, otherwise just update the frame selected_window slot to be the restored current_window. */ if (f == selected_frame ()) { -#if 0 /* When using `pop-window-configuration', often the minibuffer ends up as the selected window even though it's not active ... I really don't know the cause of this, but it should never @@ -5522,25 +5221,15 @@ #### Find out why this is really going wrong. */ if (!minibuf_level && MINI_WINDOW_P (XWINDOW (config->current_window))) - window_to_select = Fnext_window (config->current_window, - Qnil, Qnil, Qnil); + Fselect_window (Fnext_window (config->current_window, + Qnil, Qnil, Qnil), + Qnil); else - window_to_select = config->current_window; -#endif - /* Do this last so that buffer stacking is calculated - correctly. */ - Fselect_window (config->current_window, Qnil); - + Fselect_window (config->current_window, Qnil); if (!NILP (new_current_buffer)) - { - Fset_buffer (new_current_buffer); - Frecord_buffer (new_current_buffer); - } + Fset_buffer (new_current_buffer); else - { - Fset_buffer (XWINDOW (config->current_window)->buffer); - Frecord_buffer (XWINDOW (config->current_window)->buffer); - } + Fset_buffer (XWINDOW (Fselected_window (Qnil))->buffer); } else set_frame_selected_window (f, config->current_window); @@ -5660,7 +5349,7 @@ p->hscroll = w->hscroll; p->modeline_hscroll = w->modeline_hscroll; -#define WINDOW_SLOT(slot, compare) p->slot = w->slot +#define WINDOW_SLOT(slot, compare) p->slot = w->slot; #include "winslots.h" if (!NILP (w->buffer)) @@ -5749,14 +5438,7 @@ /* config->frame_width = FRAME_WIDTH (f); config->frame_height = FRAME_HEIGHT (f); */ - /* When using `push-window-configuration', often the minibuffer ends - up as the selected window because functions run as the result of - user interaction e.g. hyper-apropros. It seems to me the sensible - thing to do is not record the minibuffer here. */ - if (FRAME_MINIBUF_ONLY_P (f) || minibuf_level) - config->current_window = FRAME_SELECTED_WINDOW (f); - else - config->current_window = FRAME_LAST_NONMINIBUF_WINDOW (f); + config->current_window = FRAME_SELECTED_WINDOW (f); XSETBUFFER (config->current_buffer, current_buffer); config->minibuffer_scroll_window = Vminibuffer_scroll_window; config->root_window = FRAME_ROOT_WINDOW (f); @@ -5767,11 +5449,11 @@ /* save the minibuffer height using the heuristics from change_frame_size_1 */ - + XSETFRAME (frame, f); /* frame could have been nil ! */ default_face_height_and_width (frame, &real_font_height, 0); assert(real_font_height > 0); - + if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) minibuf_height = XWINDOW(FRAME_MINIBUF_WINDOW(f))->pixel_height; else @@ -5809,78 +5491,6 @@ return unbind_to (speccount, val); } -DEFUN ("current-pixel-column", Fcurrent_pixel_column, 0, 2, 0, /* -Return the horizontal pixel position of POS in window. -Beginning of line is column 0. This is calculated using the redisplay -display tables. If WINDOW is nil, the current window is assumed. -If POS is nil, point is assumed. Note that POS must be visible for -a non-nil result to be returned. -*/ - (window, pos)) -{ - struct window* w = decode_window (window); - display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP); - - struct display_line *dl = 0; - struct display_block *db = 0; - struct rune* rb = 0; - int y = w->last_point_y[CURRENT_DISP]; - int x = w->last_point_x[CURRENT_DISP]; - - if (MINI_WINDOW_P (w)) - return Qnil; - - if (y<0 || x<0 || y >= Dynarr_length (dla) || !NILP (pos)) - { - int first_line, i; - Bufpos point; - - if (NILP (pos)) - pos = Fwindow_point (window); - - CHECK_INT (pos); - point = XINT (pos); - - if (Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline) - first_line = 1; - else - first_line = 0; - - for (i = first_line; i < Dynarr_length (dla); i++) - { - dl = Dynarr_atp (dla, i); - /* find the vertical location first */ - if (point >= dl->bufpos && point <= dl->end_bufpos) - { - db = get_display_block_from_line (dl, TEXT); - for (i = 0; i < Dynarr_length (db->runes); i++) - { - rb = Dynarr_atp (db->runes, i); - if (point <= rb->bufpos) - goto found_bufpos; - } - return Qnil; - } - } - return Qnil; - found_bufpos: - ; - } - else - { - /* optimised case */ - dl = Dynarr_atp (dla, y); - db = get_display_block_from_line (dl, TEXT); - - if (x >= Dynarr_length (db->runes)) - return Qnil; - - rb = Dynarr_atp (db->runes, x); - } - - return make_int (rb->xpos - WINDOW_LEFT (w)); -} - #ifdef DEBUG_XEMACS /* This is short and simple in elisp, but... it was written to debug @@ -5896,15 +5506,15 @@ child = Fwindow_first_hchild (window); for (i = level; i > 0; i--) - stderr_out ("\t"); - - stderr_out ("#<window"); + putc ('\t', stderr); + + fputs ("#<window", stderr); { Lisp_Object buffer = XWINDOW (window)->buffer; if (!NILP (buffer) && BUFFERP (buffer)) - stderr_out (" on %s", XSTRING_DATA (XBUFFER (buffer)->name)); + fprintf (stderr, " on %s", XSTRING_DATA (XBUFFER (buffer)->name)); } - stderr_out (" 0x%x>", XWINDOW (window)->header.uid); + fprintf (stderr, " 0x%x>", XWINDOW (window)->header.uid); while (!NILP (child)) { @@ -5930,12 +5540,11 @@ void syms_of_window (void) { - INIT_LRECORD_IMPLEMENTATION (window); - INIT_LRECORD_IMPLEMENTATION (window_configuration); - defsymbol (&Qwindowp, "windowp"); defsymbol (&Qwindow_live_p, "window-live-p"); defsymbol (&Qwindow_configurationp, "window-configuration-p"); + defsymbol (&Qscroll_up, "scroll-up"); + defsymbol (&Qscroll_down, "scroll-down"); defsymbol (&Qtemp_buffer_show_hook, "temp-buffer-show-hook"); defsymbol (&Qdisplay_buffer, "display-buffer"); @@ -5951,7 +5560,6 @@ #endif DEFSUBR (Fselected_window); - DEFSUBR (Flast_nonminibuf_window); DEFSUBR (Fminibuffer_window); DEFSUBR (Fwindow_minibuffer_p); DEFSUBR (Fwindowp); @@ -5962,7 +5570,6 @@ DEFSUBR (Fwindow_previous_child); DEFSUBR (Fwindow_parent); DEFSUBR (Fwindow_lowest_p); - DEFSUBR (Fwindow_truncated_p); DEFSUBR (Fwindow_highest_p); DEFSUBR (Fwindow_leftmost_p); DEFSUBR (Fwindow_rightmost_p); @@ -5972,27 +5579,26 @@ DEFSUBR (Fwindow_height); DEFSUBR (Fwindow_displayed_height); DEFSUBR (Fwindow_width); - DEFSUBR (Fwindow_full_width); DEFSUBR (Fwindow_pixel_height); DEFSUBR (Fwindow_pixel_width); - DEFSUBR (Fwindow_text_area_height); DEFSUBR (Fwindow_text_area_pixel_height); DEFSUBR (Fwindow_displayed_text_pixel_height); DEFSUBR (Fwindow_text_area_pixel_width); DEFSUBR (Fwindow_hscroll); - DEFSUBR (Fset_window_hscroll); +#ifdef MODELINE_IS_SCROLLABLE DEFSUBR (Fmodeline_hscroll); DEFSUBR (Fset_modeline_hscroll); +#endif /* MODELINE_IS_SCROLLABLE */ #if 0 /* bogus FSF crock */ DEFSUBR (Fwindow_redisplay_end_trigger); DEFSUBR (Fset_window_redisplay_end_trigger); #endif + DEFSUBR (Fset_window_hscroll); DEFSUBR (Fwindow_pixel_edges); DEFSUBR (Fwindow_text_area_pixel_edges); DEFSUBR (Fwindow_point); DEFSUBR (Fwindow_start); DEFSUBR (Fwindow_end); - DEFSUBR (Fwindow_last_line_visible_height); DEFSUBR (Fset_window_point); DEFSUBR (Fset_window_start); DEFSUBR (Fwindow_dedicated_p); @@ -6032,30 +5638,14 @@ DEFSUBR (Fset_window_configuration); DEFSUBR (Fcurrent_window_configuration); DEFSUBR (Fsave_window_excursion); - DEFSUBR (Fcurrent_pixel_column); -} - -void -reinit_vars_of_window (void) -{ - int i; - /* Make sure all windows get marked */ - minibuf_window = Qnil; - staticpro_nodump (&minibuf_window); - - for (i = 0; i < countof (Vwindow_configuration_free_list); i++) - { - Vwindow_configuration_free_list[i] = - make_lcrecord_list (sizeof_window_config_for_n_windows (i + 1), - &lrecord_window_configuration); - staticpro_nodump (&Vwindow_configuration_free_list[i]); - } } void vars_of_window (void) { - reinit_vars_of_window (); + /* Make sure all windows get marked */ + minibuf_window = Qnil; + staticpro (&minibuf_window); DEFVAR_BOOL ("scroll-on-clipped-lines", &scroll_on_clipped_lines /* *Non-nil means to scroll if point lands on a line which is clipped. @@ -6086,13 +5676,6 @@ */ ); Vother_window_scroll_buffer = Qnil; - DEFVAR_LISP ("window-pixel-scroll-increment", &Vwindow_pixel_scroll_increment /* -*Number of pixels to scroll by per requested line. -If nil then normal line scrolling occurs regardless of line height. -If t then scrolling is done in increments equal to the height of the default face. -*/ ); - Vwindow_pixel_scroll_increment = Qt; - DEFVAR_INT ("next-screen-context-lines", &next_screen_context_lines /* *Number of lines of continuity when scrolling by screenfuls. */ ); @@ -6107,6 +5690,18 @@ *Delete any window less than this wide. */ ); window_min_width = 10; + + { + int i; + + for (i = 0; i < countof (Vwindow_configuration_free_list); i++) + { + Vwindow_configuration_free_list[i] = + make_lcrecord_list (sizeof_window_config_for_n_windows (i + 1), + &lrecord_window_configuration); + staticpro (&Vwindow_configuration_free_list[i]); + } + } } void @@ -6127,7 +5722,8 @@ Fadd_spec_to_specifier (Vmodeline_shadow_thickness, make_int (2), Qnil, Qnil, Qnil); set_specifier_caching (Vmodeline_shadow_thickness, - offsetof (struct window, modeline_shadow_thickness), + slot_offset (struct window, + modeline_shadow_thickness), modeline_shadow_thickness_changed, 0, 0); @@ -6139,7 +5735,8 @@ set_specifier_fallback (Vhas_modeline_p, list1 (Fcons (Qnil, Qt))); set_specifier_caching (Vhas_modeline_p, - offsetof (struct window, has_modeline_p), + slot_offset (struct window, + has_modeline_p), /* #### It's strange that we need a special flag to indicate that the shadow-thickness has changed, but not one to indicate that @@ -6161,8 +5758,8 @@ set_specifier_fallback (Vvertical_divider_always_visible_p, list1 (Fcons (Qnil, Qt))); set_specifier_caching (Vvertical_divider_always_visible_p, - offsetof (struct window, - vertical_divider_always_visible_p), + slot_offset (struct window, + vertical_divider_always_visible_p), vertical_divider_changed_in_window, 0, 0); @@ -6176,8 +5773,8 @@ Fadd_spec_to_specifier (Vvertical_divider_shadow_thickness, make_int (2), Qnil, Qnil, Qnil); set_specifier_caching (Vvertical_divider_shadow_thickness, - offsetof (struct window, - vertical_divider_shadow_thickness), + slot_offset (struct window, + vertical_divider_shadow_thickness), vertical_divider_changed_in_window, 0, 0); DEFVAR_SPECIFIER ("vertical-divider-line-width", &Vvertical_divider_line_width /* @@ -6207,8 +5804,8 @@ set_specifier_fallback (Vvertical_divider_line_width, fb); } set_specifier_caching (Vvertical_divider_line_width, - offsetof (struct window, - vertical_divider_line_width), + slot_offset (struct window, + vertical_divider_line_width), vertical_divider_changed_in_window, 0, 0); @@ -6237,7 +5834,8 @@ set_specifier_fallback (Vvertical_divider_spacing, fb); } set_specifier_caching (Vvertical_divider_spacing, - offsetof (struct window, vertical_divider_spacing), + slot_offset (struct window, + vertical_divider_spacing), vertical_divider_changed_in_window, 0, 0); } diff -r 12e008d41344 -r 697ef44129c6 src/window.h --- a/src/window.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/window.h Mon Aug 13 11:20:41 2007 +0200 @@ -24,8 +24,8 @@ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_window_h_ -#define INCLUDED_window_h_ +#ifndef _XEMACS_WINDOW_H_ +#define _XEMACS_WINDOW_H_ #include "redisplay.h" #ifdef HAVE_SCROLLBARS @@ -129,15 +129,7 @@ /* Number of columns display within the window is scrolled to the left. */ int hscroll; /* Idem for the window's modeline */ - Charcount modeline_hscroll; - /* Amount to clip off the top line for pixel-based scrolling. Point - will remain constant but this will be incremented to - incrementally shift lines up. */ - int top_yoffset; - /* Amount to clip off the left of the lines for pixel-based - scrolling. Hscroll will remain constant but this will be - incremented to incrementally shift lines left.*/ - int left_xoffset; + int modeline_hscroll; /* Number saying how recently window was selected */ Lisp_Object use_time; /* text.modified of displayed buffer as of last time display completed */ @@ -184,9 +176,6 @@ must run the redisplay-end-trigger-functions. */ Lisp_Object redisplay_end_trigger; - /* Set by the extent code when extents in the gutter are changed. */ - int gutter_extent_modiff[4]; - /* Set by redisplay to the last position seen. This is used to implement the redisplay-end-trigger-functions. */ Bufpos last_redisplay_pos; @@ -265,6 +254,7 @@ #define XWINDOW(x) XRECORD (x, window, struct window) #define XSETWINDOW(x, p) XSETRECORD (x, p, window) #define WINDOWP(x) RECORDP (x, window) +#define GC_WINDOWP(x) GC_RECORDP (x, window) #define CHECK_WINDOW(x) CHECK_RECORD (x, window) #define CONCHECK_WINDOW(x) CONCHECK_RECORD (x, window) @@ -313,7 +303,7 @@ EXFUN (Freplace_buffer_in_windows, 1); EXFUN (Fselect_window, 2); EXFUN (Fselected_window, 1); -EXFUN (Fset_window_buffer, 3); +EXFUN (Fset_window_buffer, 2); EXFUN (Fset_window_hscroll, 2); EXFUN (Fset_window_point, 2); EXFUN (Fset_window_start, 3); @@ -339,8 +329,6 @@ int window_displayed_height (struct window *); int window_is_leftmost (struct window *w); int window_is_rightmost (struct window *w); -int window_is_lowest (struct window *w); -int window_is_highest (struct window *w); int window_truncation_on (struct window *w); int window_needs_vertical_divider (struct window *); int window_scrollbar_width (struct window *w); @@ -352,6 +340,7 @@ int window_bottom_gutter_height (struct window *w); int window_left_gutter_width (struct window *w, int modeline); int window_right_gutter_width (struct window *w, int modeline); +int window_bottom_toolbar_height (struct window *w); void delete_all_subwindows (struct window *w); void set_window_pixheight (Lisp_Object window, int pixheight, @@ -363,8 +352,6 @@ int buffer_window_count (struct buffer *b, struct frame *f); int buffer_window_mru (struct window *w); void check_frame_size (struct frame *frame, int *rows, int *cols); -int frame_pixsize_valid_p (struct frame *frame, int width, int height); -int frame_size_valid_p (struct frame *frame, int rows, int cols); struct window *decode_window (Lisp_Object window); struct window *find_window_by_pixel_pos (int pix_x, int pix_y, Lisp_Object win); @@ -387,18 +374,13 @@ int window_divider_width (struct window *w); #define WINDOW_FRAME(w) ((w)->frame) -#define WINDOW_XFRAME(w) XFRAME (WINDOW_FRAME (w)) #define WINDOW_BUFFER(w) ((w)->buffer) -#define WINDOW_XBUFFER(w) XBUFFER (WINDOW_BUFFER (w)) #define WINDOW_DEVICE(w) FRAME_DEVICE (XFRAME (WINDOW_FRAME (w))) -#define WINDOW_XDEVICE(w) XDEVICE (WINDOW_DEVICE (w)) #define WINDOW_CONSOLE(w) DEVICE_CONSOLE (XDEVICE (WINDOW_DEVICE (w))) -#define WINDOW_XCONSOLE(w) XCONSOLE (WINDOW_CONSOLE (w)) /* XEmacs window size and positioning macros. */ #define WINDOW_TOP(w) ((w)->pixel_top) #define WINDOW_TEXT_TOP(w) (WINDOW_TOP (w) + window_top_gutter_height (w)) -#define WINDOW_TEXT_TOP_CLIP(w) ((w)->top_yoffset) #define WINDOW_BOTTOM(w) ((w)->pixel_top + (w)->pixel_height) #define WINDOW_TEXT_BOTTOM(w) (WINDOW_BOTTOM (w) - window_bottom_gutter_height (w)) #define WINDOW_LEFT(w) ((w)->pixel_left) @@ -434,4 +416,4 @@ #endif /* emacs */ -#endif /* INCLUDED_window_h_ */ +#endif /* _XEMACS_WINDOW_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/winslots.h --- a/src/winslots.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/winslots.h Mon Aug 13 11:20:41 2007 +0200 @@ -97,33 +97,6 @@ WINDOW_SLOT (default_toolbar_visible_p, EQ); WINDOW_SLOT (default_toolbar_border_width, EQ); #endif /* HAVE_TOOLBARS */ - - /* Gutter specification for each of the four positions. - This is not a size hog because the value here is not copied, - and will be shared with the specs in the specifier. */ - WINDOW_SLOT_ARRAY (gutter, 4, EQUAL_WRAPPED); - /* Real (pre-calculated) gutter specification for each of the four positions. - This is not a specifier, it is calculated by the specifier change - functions. */ - WINDOW_SLOT_ARRAY (real_gutter, 4, EQUAL_WRAPPED); - /* Gutter size for each of the four positions. */ - WINDOW_SLOT_ARRAY (gutter_size, 4, EQUAL_WRAPPED); - /* Real (pre-calculated) gutter size for each of the four positions. - This is not a specifier, it is calculated by the specifier change - functions. */ - WINDOW_SLOT_ARRAY (real_gutter_size, 4, EQUAL_WRAPPED); - /* Gutter border width for each of the four positions. */ - WINDOW_SLOT_ARRAY (gutter_border_width, 4, EQUAL_WRAPPED); - /* Gutter visibility status for each of the four positions. */ - WINDOW_SLOT_ARRAY (gutter_visible_p, 4, EQUAL_WRAPPED); - /* The following five don't really need to be cached except - that we need to know when they've changed. */ - WINDOW_SLOT (default_gutter, EQUAL_WRAPPED); - WINDOW_SLOT (default_gutter_width, EQ); - WINDOW_SLOT (default_gutter_height, EQ); - WINDOW_SLOT (default_gutter_visible_p, EQ); - WINDOW_SLOT (default_gutter_border_width, EQ); -/* margins */ WINDOW_SLOT (left_margin_width, EQ); WINDOW_SLOT (right_margin_width, EQ); WINDOW_SLOT (minimum_line_ascent, EQ); diff -r 12e008d41344 -r 697ef44129c6 src/xgccache.c --- a/src/xgccache.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xgccache.c Mon Aug 13 11:20:41 2007 +0200 @@ -93,9 +93,9 @@ #ifdef GCCACHE_HASH static unsigned long -gc_cache_hash (const void *arg) +gc_cache_hash (CONST void *arg) { - const struct gcv_and_mask *gcvm = (const struct gcv_and_mask *) arg; + CONST struct gcv_and_mask *gcvm = (CONST struct gcv_and_mask *) arg; unsigned long *longs = (unsigned long *) &gcvm->gcv; unsigned long hash = gcvm->mask; int i; @@ -112,7 +112,7 @@ #endif /* GCCACHE_HASH */ static int -gc_cache_eql (const void *arg1, const void *arg2) +gc_cache_eql (CONST void *arg1, CONST void *arg2) { /* See comment in gc_cache_hash */ return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask)); @@ -166,7 +166,7 @@ #ifdef GCCACHE_HASH - if (gethash (&gcvm, cache->table, (const void **) &cell)) + if (gethash (&gcvm, cache->table, (CONST void **) &cell)) #else /* !GCCACHE_HASH */ diff -r 12e008d41344 -r 697ef44129c6 src/xgccache.h --- a/src/xgccache.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xgccache.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,12 +23,12 @@ /* Written by jwz, 14 jun 93 */ -#ifndef INCLUDED_xgccache_h_ -#define INCLUDED_xgccache_h_ +#ifndef _XGCCACHE_H_ +#define _XGCCACHE_H_ struct gc_cache; struct gc_cache *make_gc_cache (Display *, Window); void free_gc_cache (struct gc_cache *cache); GC gc_cache_lookup (struct gc_cache *, XGCValues *, unsigned long mask); -#endif /* INCLUDED_xgccache_h_ */ +#endif /* _XGCCACHE_H_ */ diff -r 12e008d41344 -r 697ef44129c6 src/xintrinsic.h --- a/src/xintrinsic.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xintrinsic.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,9 +19,12 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_xintrinsic_h_ -#define INCLUDED_xintrinsic_h_ +#undef CONST /* X11R4 header thinks it can define CONST */ #include <X11/Intrinsic.h> -#endif /* INCLUDED_xintrinsic_h_ */ +#ifdef CONST_IS_LOSING +# define CONST +#else +# define CONST const +#endif diff -r 12e008d41344 -r 697ef44129c6 src/xintrinsicp.h --- a/src/xintrinsicp.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xintrinsicp.h Mon Aug 13 11:20:41 2007 +0200 @@ -19,11 +19,14 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_xintrinsicp_h_ -#define INCLUDED_xintrinsicp_h_ +#undef CONST /* X11R4 header thinks it can define CONST */ #include <X11/Intrinsic.h> #include <X11/IntrinsicP.h> #include <X11/ObjectP.h> /* apparently some IntrinsicP.h don't have this */ -#endif /* INCLUDED_xintrinsicp_h_ */ +#ifdef CONST_IS_LOSING +# define CONST +#else +# define CONST const +#endif diff -r 12e008d41344 -r 697ef44129c6 src/xmmanagerp.h --- a/src/xmmanagerp.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xmmanagerp.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,14 +23,9 @@ /* ManagerP.h doesn't exist in old versions of Motif; the stuff is in XmP.h instead */ -#ifndef INCLUDED_xmmanagerp_h_ -#define INCLUDED_xmmanagerp_h_ - #include <Xm/Xm.h> /* to get XmVersion */ #if (XmVersion >= 1002) # include <Xm/ManagerP.h> #else # include <Xm/XmP.h> #endif - -#endif /* INCLUDED_xmmanagerp_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/xmprimitivep.h --- a/src/xmprimitivep.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xmprimitivep.h Mon Aug 13 11:20:41 2007 +0200 @@ -23,14 +23,9 @@ /* PrimitiveP.h doesn't exist in old versions of Motif; the stuff is in XmP.h instead */ -#ifndef INCLUDED_xmprimitivep_h_ -#define INCLUDED_xmprimitivep_h_ - #include <Xm/Xm.h> /* to get XmVersion */ #if (XmVersion >= 1002) # include <Xm/PrimitiveP.h> #else # include <Xm/XmP.h> #endif - -#endif /* INCLUDED_xmprimitivep_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/xmu.c --- a/src/xmu.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xmu.c Mon Aug 13 11:20:41 2007 +0200 @@ -53,10 +53,10 @@ #include <ctype.h> -int XmuCursorNameToIndex (const char *name) +int XmuCursorNameToIndex (CONST char *name) { - static const struct _CursorName { - const char *name; + static CONST struct _CursorName { + CONST char *name; unsigned int shape; } cursor_names[] = { {"x_cursor", XC_X_cursor}, @@ -137,7 +137,7 @@ {"watch", XC_watch}, {"xterm", XC_xterm}, }; - const struct _CursorName *table; + CONST struct _CursorName *table; int i; char tmp[40]; @@ -368,7 +368,7 @@ } -int XmuReadBitmapDataFromFile (const char *filename, +int XmuReadBitmapDataFromFile (CONST char *filename, /* Remaining args are RETURNED */ unsigned int *width, unsigned int *height, @@ -530,7 +530,7 @@ return XmuPrintDefaultErrorMessage (dpy, errorp, stderr); } -void XmuCopyISOLatin1Lowered(char *dst, const char *src) +void XmuCopyISOLatin1Lowered(char *dst, CONST char *src) { unsigned char *dest = (unsigned char *) dst; unsigned char *source = (unsigned char *) src; diff -r 12e008d41344 -r 697ef44129c6 src/xmu.h --- a/src/xmu.h Mon Aug 13 11:19:22 2007 +0200 +++ b/src/xmu.h Mon Aug 13 11:20:41 2007 +0200 @@ -2,9 +2,6 @@ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_xmu_h_ -#define INCLUDED_xmu_h_ - #ifdef HAVE_XMU # include <X11/Xmu/CharSet.h> @@ -12,7 +9,6 @@ # include <X11/Xmu/CurUtil.h> # include <X11/Xmu/Drawing.h> # include <X11/Xmu/Error.h> -# include <X11/Xmu/Misc.h> /* Do the EDITRES protocol if running X11R5 (or later) version */ #if (XtSpecificationRelease >= 5) @@ -24,19 +20,12 @@ #else -int XmuCursorNameToIndex (const char *name); -int XmuReadBitmapDataFromFile (const char *filename, unsigned int *width, +int XmuCursorNameToIndex (CONST char *name); +int XmuReadBitmapDataFromFile (CONST char *filename, unsigned int *width, unsigned int *height, unsigned char **datap, int *x_hot, int *y_hot); int XmuPrintDefaultErrorMessage (Display *dpy, XErrorEvent *event, FILE *fp); -void XmuCopyISOLatin1Lowered (char *, const char *); +void XmuCopyISOLatin1Lowered (char *, CONST char *); -#define Max(x, y) (((x) > (y)) ? (x) : (y)) -#define Min(x, y) (((x) < (y)) ? (x) : (y)) -#define AssignMax(x, y) {if ((y) > (x)) x = (y);} -#define AssignMin(x, y) {if ((y) < (x)) x = (y);} -typedef enum {XtorientHorizontal, XtorientVertical} XtOrientation; +#endif -#endif /* HAVE_XMU */ - -#endif /* INCLUDED_xmu_h_ */ diff -r 12e008d41344 -r 697ef44129c6 src/xselect.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/xselect.c Mon Aug 13 11:20:41 2007 +0200 @@ -0,0 +1,2144 @@ +/* X Selection processing for XEmacs + Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not synched with FSF. */ + +/* Rewritten by jwz */ + +#include <config.h> +#include "lisp.h" + +#include "buffer.h" +#include "console-x.h" +#include "objects-x.h" + +#include "frame.h" +#include "opaque.h" +#include "systime.h" + +int lisp_to_time (Lisp_Object, time_t *); +Lisp_Object time_to_lisp (time_t); + +#ifdef LWLIB_USES_MOTIF +# define MOTIF_CLIPBOARDS +#endif + +#ifdef MOTIF_CLIPBOARDS +# include <Xm/CutPaste.h> +static void hack_motif_clipboard_selection (Atom selection_atom, + Lisp_Object selection_value, + Time thyme, Display *display, + Window selecting_window, + Bool owned_p); +#endif + +#define CUT_BUFFER_SUPPORT + +Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, + QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, + QATOM_PAIR, QCOMPOUND_TEXT; + +#ifdef CUT_BUFFER_SUPPORT +Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, + QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; +#endif + +Lisp_Object Vx_lost_selection_hooks; +Lisp_Object Vx_sent_selection_hooks; + +/* If this is a smaller number than the max-request-size of the display, + emacs will use INCR selection transfer when the selection is larger + than this. The max-request-size is usually around 64k, so if you want + emacs to use incremental selection transfers when the selection is + smaller than that, set this. I added this mostly for debugging the + incremental transfer stuff, but it might improve server performance. + */ +#define MAX_SELECTION_QUANTUM 0xFFFFFF + +#define SELECTION_QUANTUM(dpy) ((XMaxRequestSize (dpy) << 2) - 100) + +/* This is an association list whose elements are of the form + ( selection-name selection-value selection-timestamp ) + selection-name is a lisp symbol, whose name is the name of an X Atom. + selection-value is the value that emacs owns for that selection. + It may be any kind of Lisp object. + selection-timestamp is the time at which emacs began owning this selection, + as a cons of two 16-bit numbers (making a 32 bit time). + If there is an entry in this alist, then it can be assumed that emacs owns + that selection. + The only (eq) parts of this list that are visible from elisp are the + selection-values. + */ +Lisp_Object Vselection_alist; + +/* This is an alist whose CARs are selection-types (whose names are the same + as the names of X Atoms) and whose CDRs are the names of Lisp functions to + call to convert the given Emacs selection value to a string representing + the given selection type. This is for elisp-level extension of the emacs + selection handling. + */ +Lisp_Object Vselection_converter_alist; + +/* "Selection owner couldn't convert selection" */ +Lisp_Object Qselection_conversion_error; + +/* If the selection owner takes too long to reply to a selection request, + we give up on it. This is in seconds (0 = no timeout). + */ +int x_selection_timeout; + + +/* Utility functions */ + +static void lisp_data_to_selection_data (struct device *, + Lisp_Object obj, + unsigned char **data_ret, + Atom *type_ret, + unsigned int *size_ret, + int *format_ret); +static Lisp_Object selection_data_to_lisp_data (struct device *, + unsigned char *data, + size_t size, + Atom type, + int format); +static Lisp_Object x_get_window_property_as_lisp_data (Display *, + Window, + Atom property, + Lisp_Object target_type, + Atom selection_atom); + +static int expect_property_change (Display *, Window, Atom prop, int state); +static void wait_for_property_change (long); +static void unexpect_property_change (int); +static int waiting_for_other_props_on_window (Display *, Window); + +/* This converts a Lisp symbol to a server Atom, avoiding a server + roundtrip whenever possible. + */ +static Atom +symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists) +{ + Display *display = DEVICE_X_DISPLAY (d); + + if (NILP (sym)) return XA_PRIMARY; + if (EQ (sym, Qt)) return XA_SECONDARY; + if (EQ (sym, QPRIMARY)) return XA_PRIMARY; + if (EQ (sym, QSECONDARY)) return XA_SECONDARY; + if (EQ (sym, QSTRING)) return XA_STRING; + if (EQ (sym, QINTEGER)) return XA_INTEGER; + if (EQ (sym, QATOM)) return XA_ATOM; + if (EQ (sym, QCLIPBOARD)) return DEVICE_XATOM_CLIPBOARD (d); + if (EQ (sym, QTIMESTAMP)) return DEVICE_XATOM_TIMESTAMP (d); + if (EQ (sym, QTEXT)) return DEVICE_XATOM_TEXT (d); + if (EQ (sym, QDELETE)) return DEVICE_XATOM_DELETE (d); + if (EQ (sym, QMULTIPLE)) return DEVICE_XATOM_MULTIPLE (d); + if (EQ (sym, QINCR)) return DEVICE_XATOM_INCR (d); + if (EQ (sym, QEMACS_TMP)) return DEVICE_XATOM_EMACS_TMP (d); + if (EQ (sym, QTARGETS)) return DEVICE_XATOM_TARGETS (d); + if (EQ (sym, QNULL)) return DEVICE_XATOM_NULL (d); + if (EQ (sym, QATOM_PAIR)) return DEVICE_XATOM_ATOM_PAIR (d); + if (EQ (sym, QCOMPOUND_TEXT)) return DEVICE_XATOM_COMPOUND_TEXT (d); + +#ifdef CUT_BUFFER_SUPPORT + if (EQ (sym, QCUT_BUFFER0)) return XA_CUT_BUFFER0; + if (EQ (sym, QCUT_BUFFER1)) return XA_CUT_BUFFER1; + if (EQ (sym, QCUT_BUFFER2)) return XA_CUT_BUFFER2; + if (EQ (sym, QCUT_BUFFER3)) return XA_CUT_BUFFER3; + if (EQ (sym, QCUT_BUFFER4)) return XA_CUT_BUFFER4; + if (EQ (sym, QCUT_BUFFER5)) return XA_CUT_BUFFER5; + if (EQ (sym, QCUT_BUFFER6)) return XA_CUT_BUFFER6; + if (EQ (sym, QCUT_BUFFER7)) return XA_CUT_BUFFER7; +#endif /* CUT_BUFFER_SUPPORT */ + + { + CONST char *nameext; + GET_C_STRING_CTEXT_DATA_ALLOCA (Fsymbol_name (sym), nameext); + return XInternAtom (display, nameext, only_if_exists ? True : False); + } +} + + +/* This converts a server Atom to a Lisp symbol, avoiding server roundtrips + and calls to intern whenever possible. + */ +static Lisp_Object +x_atom_to_symbol (struct device *d, Atom atom) +{ + Display *display = DEVICE_X_DISPLAY (d); + + if (! atom) return Qnil; + if (atom == XA_PRIMARY) return QPRIMARY; + if (atom == XA_SECONDARY) return QSECONDARY; + if (atom == XA_STRING) return QSTRING; + if (atom == XA_INTEGER) return QINTEGER; + if (atom == XA_ATOM) return QATOM; + if (atom == DEVICE_XATOM_CLIPBOARD (d)) return QCLIPBOARD; + if (atom == DEVICE_XATOM_TIMESTAMP (d)) return QTIMESTAMP; + if (atom == DEVICE_XATOM_TEXT (d)) return QTEXT; + if (atom == DEVICE_XATOM_DELETE (d)) return QDELETE; + if (atom == DEVICE_XATOM_MULTIPLE (d)) return QMULTIPLE; + if (atom == DEVICE_XATOM_INCR (d)) return QINCR; + if (atom == DEVICE_XATOM_EMACS_TMP (d)) return QEMACS_TMP; + if (atom == DEVICE_XATOM_TARGETS (d)) return QTARGETS; + if (atom == DEVICE_XATOM_NULL (d)) return QNULL; + if (atom == DEVICE_XATOM_ATOM_PAIR (d)) return QATOM_PAIR; + if (atom == DEVICE_XATOM_COMPOUND_TEXT (d)) return QCOMPOUND_TEXT; + +#ifdef CUT_BUFFER_SUPPORT + if (atom == XA_CUT_BUFFER0) return QCUT_BUFFER0; + if (atom == XA_CUT_BUFFER1) return QCUT_BUFFER1; + if (atom == XA_CUT_BUFFER2) return QCUT_BUFFER2; + if (atom == XA_CUT_BUFFER3) return QCUT_BUFFER3; + if (atom == XA_CUT_BUFFER4) return QCUT_BUFFER4; + if (atom == XA_CUT_BUFFER5) return QCUT_BUFFER5; + if (atom == XA_CUT_BUFFER6) return QCUT_BUFFER6; + if (atom == XA_CUT_BUFFER7) return QCUT_BUFFER7; +#endif + + { + Lisp_Object newsym; + CONST Bufbyte *intstr; + char *str = XGetAtomName (display, atom); + + if (! str) return Qnil; + + GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA (str, intstr); + newsym = intern ((char *) intstr); + XFree (str); + return newsym; + } +} + + +/* Do protocol to assert ourself as a selection owner. + Update the Vselection_alist so that we can reply to later requests for + our selection. + */ +static void +x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value) +{ + struct device *d = decode_x_device (Qnil); + Display *display = DEVICE_X_DISPLAY (d); + struct frame *sel_frame = selected_frame (); + Window selecting_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame)); + /* Use the time of the last-read mouse or keyboard event. + For selection purposes, we use this as a sleazy way of knowing what the + current time is in server-time. This assumes that the most recently read + mouse or keyboard event has something to do with the assertion of the + selection, which is probably true. + */ + Time thyme = DEVICE_X_MOUSE_TIMESTAMP (d); + Atom selection_atom; + + CHECK_SYMBOL (selection_name); + selection_atom = symbol_to_x_atom (d, selection_name, 0); + + XSetSelectionOwner (display, selection_atom, selecting_window, thyme); + + /* Now update the local cache */ + { + /* We do NOT use time_to_lisp() here any more, like we used to. + That assumed equivalence of time_t and Time, which is not + necessarily the case (e.g. under OSF on the Alphas, where + Time is a 64-bit quantity and time_t is a 32-bit quantity). + + Opaque pointers are the clean way to go here. + */ + Lisp_Object selection_time = make_opaque (sizeof (thyme), (void *) &thyme); + Lisp_Object selection_data = list3 (selection_name, + selection_value, + selection_time); + Lisp_Object prev_value = assq_no_quit (selection_name, Vselection_alist); + Vselection_alist = Fcons (selection_data, Vselection_alist); + + /* If we already owned the selection, remove the old selection data. + Perhaps we should destructively modify it instead. + Don't use Fdelq() as that may QUIT;. + */ + if (!NILP (prev_value)) + { + Lisp_Object rest; /* we know it's not the CAR, so it's easy. */ + for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + if (EQ (prev_value, Fcar (XCDR (rest)))) + { + XCDR (rest) = Fcdr (XCDR (rest)); + break; + } + } +#ifdef MOTIF_CLIPBOARDS + hack_motif_clipboard_selection (selection_atom, selection_value, + thyme, display, selecting_window, + !NILP (prev_value)); +#endif + } +} + + +#ifdef MOTIF_CLIPBOARDS /* Bend over baby. Take it and like it. */ + +# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK +static void motif_clipboard_cb (); +# endif + +static void +hack_motif_clipboard_selection (Atom selection_atom, + Lisp_Object selection_value, + Time thyme, + Display *display, + Window selecting_window, + Bool owned_p) +{ + struct device *d = get_device_from_display (display); + /* Those Motif wankers can't be bothered to follow the ICCCM, and do + their own non-Xlib non-Xt clipboard processing. So we have to do + this so that linked-in Motif widgets don't get themselves wedged. + */ + if (selection_atom == DEVICE_XATOM_CLIPBOARD (d) + && STRINGP (selection_value) + + /* If we already own the clipboard, don't own it again in the Motif + way. This might lose in some subtle way, since the timestamp won't + be current, but owning the selection on the Motif way does a + SHITLOAD of X protocol, and it makes killing text be incredibly + slow when using an X terminal. ARRRRGGGHHH!!!! + */ + /* No, this is no good, because then Motif text fields don't bother + to look up the new value, and you can't Copy from a buffer, Paste + into a text field, then Copy something else from the buffer and + paste it into the text field -- it pastes the first thing again. */ +/* && !owned_p */ + ) + { +#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK + Widget widget = FRAME_X_TEXT_WIDGET (selected_frame()); +#endif + long itemid; +#if XmVersion >= 1002 + long dataid; +#else + int dataid; /* 1.2 wants long, but 1.1.5 wants int... */ +#endif + XmString fmh; + String encoding = "STRING"; + CONST Extbyte *data = XSTRING_DATA (selection_value); + Extcount bytes = XSTRING_LENGTH (selection_value); + +#ifdef MULE + { + enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; + CONST Bufbyte *ptr = data, *end = ptr + bytes; + /* Optimize for the common ASCII case */ + while (ptr <= end) + { + if (BYTE_ASCII_P (*ptr)) + { + ptr++; + continue; + } + + if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 || + (*ptr) == LEADING_BYTE_CONTROL_1) + { + chartypes = LATIN_1; + ptr += 2; + continue; + } + + chartypes = WORLD; + break; + } + + if (chartypes == LATIN_1) + GET_STRING_BINARY_DATA_ALLOCA (selection_value, data, bytes); + else if (chartypes == WORLD) + { + GET_STRING_CTEXT_DATA_ALLOCA (selection_value, data, bytes); + encoding = "COMPOUND_TEXT"; + } + } +#endif /* MULE */ + + fmh = XmStringCreateLtoR ("Clipboard", XmSTRING_DEFAULT_CHARSET); + while (ClipboardSuccess != + XmClipboardStartCopy (display, selecting_window, fmh, thyme, +#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK + widget, motif_clipboard_cb, +#else + 0, NULL, +#endif + &itemid)) + ; + XmStringFree (fmh); + while (ClipboardSuccess != + XmClipboardCopy (display, selecting_window, itemid, encoding, +#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK + /* O'Reilly examples say size can be 0, + but this clearly is not the case. */ + 0, bytes, (int) selecting_window, /* private id */ +#else /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ + (XtPointer) data, bytes, 0, +#endif /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ + &dataid)) + ; + while (ClipboardSuccess != + XmClipboardEndCopy (display, selecting_window, itemid)) + ; + } +} + +# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK +/* I tried to treat the clipboard like a real selection, and not send + the data until it was requested, but it looks like that just doesn't + work at all unless the selection owner and requestor are in different + processes. From reading the Motif source, it looks like they never + even considered having two widgets in the same application transfer + data between each other using "by-name" clipboard values. What a + bunch of fuckups. + */ +static void +motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason) +{ + switch (*reason) + { + case XmCR_CLIPBOARD_DATA_REQUEST: + { + Display *dpy = XtDisplay (widget); + Window window = (Window) *private_id; + Lisp_Object selection = assq_no_quit (QCLIPBOARD, Vselection_alist); + if (NILP (selection)) abort (); + selection = XCDR (selection); + if (!STRINGP (selection)) abort (); + XmClipboardCopyByName (dpy, window, *data_id, + (char *) XSTRING_DATA (selection), + XSTRING_LENGTH (selection) + 1, + 0); + } + break; + case XmCR_CLIPBOARD_DATA_DELETE: + default: + /* don't need to free anything */ + break; + } +} +# endif /* MOTIF_INCREMENTAL_CLIPBOARDS_WORK */ +#endif /* MOTIF_CLIPBOARDS */ + + +/* Given a selection-name and desired type, this looks up our local copy of + the selection value and converts it to the type. It returns nil or a + string. This calls random elisp code, and may signal or gc. + */ +static Lisp_Object +x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type) +{ + /* This function can GC */ + Lisp_Object local_value = assq_no_quit (selection_symbol, Vselection_alist); + Lisp_Object handler_fn, value, check; + + if (NILP (local_value)) return Qnil; + + /* TIMESTAMP and MULTIPLE are special cases 'cause that's easiest. */ + if (EQ (target_type, QTIMESTAMP)) + { + handler_fn = Qnil; + value = XCAR (XCDR (XCDR (local_value))); + } + +#if 0 /* #### MULTIPLE doesn't work yet */ + else if (CONSP (target_type) && + XCAR (target_type) == QMULTIPLE) + { + Lisp_Object pairs = XCDR (target_type); + int len = XVECTOR_LENGTH (pairs); + int i; + /* If the target is MULTIPLE, then target_type looks like + (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ]) + We modify the second element of each pair in the vector and + return it as [[SELECTION1 <value1>] [SELECTION2 <value2>] ... ] + */ + for (i = 0; i < len; i++) + { + Lisp_Object pair = XVECTOR_DATA (pairs) [i]; + XVECTOR_DATA (pair) [1] = + x_get_local_selection (XVECTOR_DATA (pair) [0], + XVECTOR_DATA (pair) [1]); + } + return pairs; + } +#endif + else + { + CHECK_SYMBOL (target_type); + handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); + if (NILP (handler_fn)) return Qnil; + value = call3 (handler_fn, + selection_symbol, target_type, + XCAR (XCDR (local_value))); + } + + /* This lets the selection function to return (TYPE . VALUE). For example, + when the selected type is LINE_NUMBER, the returned type is SPAN, not + INTEGER. + */ + check = value; + if (CONSP (value) && SYMBOLP (XCAR (value))) + check = XCDR (value); + + /* Strings, vectors, and symbols are converted to selection data format in + the obvious way. Integers are converted to 16 bit quantities if they're + small enough, otherwise 32 bits are used. + */ + if (STRINGP (check) || + VECTORP (check) || + SYMBOLP (check) || + INTP (check) || + CHARP (check) || + NILP (value)) + return value; + + /* (N . M) or (N M) get turned into a 32 bit quantity. So if you want to + always return a small quantity as 32 bits, your converter routine needs + to return a cons. + */ + else if (CONSP (check) && + INTP (XCAR (check)) && + (INTP (XCDR (check)) || + (CONSP (XCDR (check)) && + INTP (XCAR (XCDR (check))) && + NILP (XCDR (XCDR (check)))))) + return value; + /* Otherwise the lisp converter function returned something unrecognized. + */ + else + signal_error (Qerror, + list3 (build_string + ("unrecognized selection-conversion type"), + handler_fn, + value)); + + return Qnil; /* suppress compiler warning */ +} + + + +/* Send a SelectionNotify event to the requestor with property=None, meaning + we were unable to do what they wanted. + */ +static void +x_decline_selection_request (XSelectionRequestEvent *event) +{ + XSelectionEvent reply; + reply.type = SelectionNotify; + reply.display = event->display; + reply.requestor = event->requestor; + reply.selection = event->selection; + reply.time = event->time; + reply.target = event->target; + reply.property = None; + + XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply); + XFlush (reply.display); +} + + +/* Used as an unwind-protect clause so that, if a selection-converter signals + an error, we tell the requestor that we were unable to do what they wanted + before we throw to top-level or go into the debugger or whatever. + */ +static Lisp_Object +x_selection_request_lisp_error (Lisp_Object closure) +{ + XSelectionRequestEvent *event = (XSelectionRequestEvent *) + get_opaque_ptr (closure); + + free_opaque_ptr (closure); + if (event->type == 0) /* we set this to mean "completed normally" */ + return Qnil; + x_decline_selection_request (event); + return Qnil; +} + + +/* Convert our selection to the requested type, and put that data where the + requestor wants it. Then tell them whether we've succeeded. + */ +static void +x_reply_selection_request (XSelectionRequestEvent *event, int format, + unsigned char *data, int size, Atom type) +{ + /* This function can GC */ + XSelectionEvent reply; + Display *display = event->display; + struct device *d = get_device_from_display (display); + Window window = event->requestor; + int bytes_remaining; + int format_bytes = format/8; + int max_bytes = SELECTION_QUANTUM (display); + if (max_bytes > MAX_SELECTION_QUANTUM) max_bytes = MAX_SELECTION_QUANTUM; + + reply.type = SelectionNotify; + reply.display = display; + reply.requestor = window; + reply.selection = event->selection; + reply.time = event->time; + reply.target = event->target; + reply.property = (event->property == None ? event->target : event->property); + + /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ + + /* Store the data on the requested property. + If the selection is large, only store the first N bytes of it. + */ + bytes_remaining = size * format_bytes; + if (bytes_remaining <= max_bytes) + { + /* Send all the data at once, with minimal handshaking. */ +#if 0 + stderr_out ("\nStoring all %d\n", bytes_remaining); +#endif + XChangeProperty (display, window, reply.property, type, format, + PropModeReplace, data, size); + /* At this point, the selection was successfully stored; ack it. */ + XSendEvent (display, window, False, 0L, (XEvent *) &reply); + XFlush (display); + } + else + { + /* Send an INCR selection. */ + int prop_id; + + if (x_window_to_frame (d, window)) /* #### debug */ + error ("attempt to transfer an INCR to ourself!"); +#if 0 + stderr_out ("\nINCR %d\n", bytes_remaining); +#endif + prop_id = expect_property_change (display, window, reply.property, + PropertyDelete); + + XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d), + 32, PropModeReplace, (unsigned char *) + &bytes_remaining, 1); + XSelectInput (display, window, PropertyChangeMask); + /* Tell 'em the INCR data is there... */ + XSendEvent (display, window, False, 0L, (XEvent *) &reply); + XFlush (display); + + /* First, wait for the requestor to ack by deleting the property. + This can run random lisp code (process handlers) or signal. + */ + wait_for_property_change (prop_id); + + while (bytes_remaining) + { + int i = ((bytes_remaining < max_bytes) + ? bytes_remaining + : max_bytes); + prop_id = expect_property_change (display, window, reply.property, + PropertyDelete); +#if 0 + stderr_out (" INCR adding %d\n", i); +#endif + /* Append the next chunk of data to the property. */ + XChangeProperty (display, window, reply.property, type, format, + PropModeAppend, data, i / format_bytes); + bytes_remaining -= i; + data += i; + + /* Now wait for the requestor to ack this chunk by deleting the + property. This can run random lisp code or signal. + */ + wait_for_property_change (prop_id); + } + /* Now write a zero-length chunk to the property to tell the requestor + that we're done. */ +#if 0 + stderr_out (" INCR done\n"); +#endif + if (! waiting_for_other_props_on_window (display, window)) + XSelectInput (display, window, 0L); + + XChangeProperty (display, window, reply.property, type, format, + PropModeReplace, data, 0); + } +} + + + +/* Called from the event-loop in response to a SelectionRequest event. + */ +void +x_handle_selection_request (XSelectionRequestEvent *event) +{ + /* This function can GC */ + struct gcpro gcpro1, gcpro2, gcpro3; + Lisp_Object local_selection_data = Qnil; + Lisp_Object selection_symbol; + Lisp_Object target_symbol = Qnil; + Lisp_Object converted_selection = Qnil; + Time local_selection_time; + Lisp_Object successful_p = Qnil; + int count; + struct device *d = get_device_from_display (event->display); + + GCPRO3 (local_selection_data, converted_selection, target_symbol); + + selection_symbol = x_atom_to_symbol (d, event->selection); + + local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); + +#if 0 + /* This list isn't user-visible, so it can't "go bad." */ + assert (CONSP (local_selection_data)); + assert (CONSP (XCDR (local_selection_data))); + assert (CONSP (XCDR (XCDR (local_selection_data)))); + assert (NILP (XCDR (XCDR (XCDR (local_selection_data))))); + assert (CONSP (XCAR (XCDR (XCDR (local_selection_data))))); + assert (INTP (XCAR (XCAR (XCDR (XCDR (local_selection_data)))))); + assert (INTP (XCDR (XCAR (XCDR (XCDR (local_selection_data)))))); +#endif + + if (NILP (local_selection_data)) + { + /* Someone asked for the selection, but we don't have it any more. */ + x_decline_selection_request (event); + goto DONE_LABEL; + } + + local_selection_time = + * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data)))); + + if (event->time != CurrentTime && + local_selection_time > event->time) + { + /* Someone asked for the selection, and we have one, but not the one + they're looking for. */ + x_decline_selection_request (event); + goto DONE_LABEL; + } + + count = specpdl_depth (); + record_unwind_protect (x_selection_request_lisp_error, + make_opaque_ptr (event)); + target_symbol = x_atom_to_symbol (d, event->target); + +#if 0 /* #### MULTIPLE doesn't work yet */ + if (EQ (target_symbol, QMULTIPLE)) + target_symbol = fetch_multiple_target (event); +#endif + + /* Convert lisp objects back into binary data */ + + converted_selection = + x_get_local_selection (selection_symbol, target_symbol); + + if (! NILP (converted_selection)) + { + unsigned char *data; + unsigned int size; + int format; + Atom type; + lisp_data_to_selection_data (d, converted_selection, + &data, &type, &size, &format); + + x_reply_selection_request (event, format, data, size, type); + successful_p = Qt; + /* Tell x_selection_request_lisp_error() it's cool. */ + event->type = 0; + xfree (data); + } + unbind_to (count, Qnil); + + DONE_LABEL: + + UNGCPRO; + + /* Let random lisp code notice that the selection has been asked for. */ + { + Lisp_Object rest; + Lisp_Object val = Vx_sent_selection_hooks; + if (!UNBOUNDP (val) && !NILP (val)) + { + if (CONSP (val) && !EQ (XCAR (val), Qlambda)) + for (rest = val; !NILP (rest); rest = Fcdr (rest)) + call3 (Fcar(rest), selection_symbol, target_symbol, + successful_p); + else + call3 (val, selection_symbol, target_symbol, + successful_p); + } + } +} + + +/* Called from the event-loop in response to a SelectionClear event. + */ +void +x_handle_selection_clear (XSelectionClearEvent *event) +{ + Display *display = event->display; + struct device *d = get_device_from_display (display); + Atom selection = event->selection; + Time changed_owner_time = event->time; + + Lisp_Object selection_symbol, local_selection_data; + Time local_selection_time; + + selection_symbol = x_atom_to_symbol (d, selection); + + local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); + + /* Well, we already believe that we don't own it, so that's just fine. */ + if (NILP (local_selection_data)) return; + + local_selection_time = + * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data)))); + + /* This SelectionClear is for a selection that we no longer own, so we can + disregard it. (That is, we have reasserted the selection since this + request was generated.) + */ + if (changed_owner_time != CurrentTime && + local_selection_time > changed_owner_time) + return; + + /* Otherwise, we're really honest and truly being told to drop it. + Don't use Fdelq() as that may QUIT;. + */ + if (EQ (local_selection_data, Fcar (Vselection_alist))) + Vselection_alist = Fcdr (Vselection_alist); + else + { + Lisp_Object rest; + for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) + if (EQ (local_selection_data, Fcar (XCDR (rest)))) + { + XCDR (rest) = Fcdr (XCDR (rest)); + break; + } + } + + /* Let random lisp code notice that the selection has been stolen. + */ + { + Lisp_Object rest; + Lisp_Object val = Vx_lost_selection_hooks; + if (!UNBOUNDP (val) && !NILP (val)) + { + if (CONSP (val) && !EQ (XCAR (val), Qlambda)) + for (rest = val; !NILP (rest); rest = Fcdr (rest)) + call1 (Fcar (rest), selection_symbol); + else + call1 (val, selection_symbol); + } + } +} + + +/* This stuff is so that INCR selections are reentrant (that is, so we can + be servicing multiple INCR selection requests simultaneously). I haven't + actually tested that yet. + */ + +static int prop_location_tick; + +static struct prop_location { + int tick; + Display *display; + Window window; + Atom property; + int desired_state; + struct prop_location *next; +} *for_whom_the_bell_tolls; + + +static int +property_deleted_p (void *tick) +{ + struct prop_location *rest = for_whom_the_bell_tolls; + while (rest) + if (rest->tick == (long) tick) + return 0; + else + rest = rest->next; + return 1; +} + +static int +waiting_for_other_props_on_window (Display *display, Window window) +{ + struct prop_location *rest = for_whom_the_bell_tolls; + while (rest) + if (rest->display == display && rest->window == window) + return 1; + else + rest = rest->next; + return 0; +} + + +static int +expect_property_change (Display *display, Window window, + Atom property, int state) +{ + struct prop_location *pl = xnew (struct prop_location); + pl->tick = ++prop_location_tick; + pl->display = display; + pl->window = window; + pl->property = property; + pl->desired_state = state; + pl->next = for_whom_the_bell_tolls; + for_whom_the_bell_tolls = pl; + return pl->tick; +} + +static void +unexpect_property_change (int tick) +{ + struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls; + while (rest) + { + if (rest->tick == tick) + { + if (prev) + prev->next = rest->next; + else + for_whom_the_bell_tolls = rest->next; + xfree (rest); + return; + } + prev = rest; + rest = rest->next; + } +} + +static void +wait_for_property_change (long tick) +{ + /* This function can GC */ + wait_delaying_user_input (property_deleted_p, (void *) tick); +} + + +/* Called from the event-loop in response to a PropertyNotify event. + */ +void +x_handle_property_notify (XPropertyEvent *event) +{ + struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls; + while (rest) + { + if (rest->property == event->atom && + rest->window == event->window && + rest->display == event->display && + rest->desired_state == event->state) + { +#if 0 + stderr_out ("Saw expected prop-%s on %s\n", + (event->state == PropertyDelete ? "delete" : "change"), + (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name); +#endif + if (prev) + prev->next = rest->next; + else + for_whom_the_bell_tolls = rest->next; + xfree (rest); + return; + } + prev = rest; + rest = rest->next; + } +#if 0 + stderr_out ("Saw UNexpected prop-%s on %s\n", + (event->state == PropertyDelete ? "delete" : "change"), + (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name)); +#endif +} + + + +#if 0 /* #### MULTIPLE doesn't work yet */ + +static Lisp_Object +fetch_multiple_target (XSelectionRequestEvent *event) +{ + /* This function can GC */ + Display *display = event->display; + Window window = event->requestor; + Atom target = event->target; + Atom selection_atom = event->selection; + int result; + + return + Fcons (QMULTIPLE, + x_get_window_property_as_lisp_data (display, window, target, + QMULTIPLE, + selection_atom)); +} + +static Lisp_Object +copy_multiple_data (Lisp_Object obj) +{ + Lisp_Object vec; + int i; + int len; + if (CONSP (obj)) + return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj))); + + CHECK_VECTOR (obj); + len = XVECTOR_LENGTH (obj); + vec = make_vector (len, Qnil); + for (i = 0; i < len; i++) + { + Lisp_Object vec2 = XVECTOR_DATA (obj) [i]; + CHECK_VECTOR (vec2); + if (XVECTOR_LENGTH (vec2) != 2) + signal_error (Qerror, list2 (build_string + ("vectors must be of length 2"), + vec2)); + XVECTOR_DATA (vec) [i] = make_vector (2, Qnil); + XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [0] = XVECTOR_DATA (vec2) [0]; + XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [1] = XVECTOR_DATA (vec2) [1]; + } + return vec; +} + +#endif /* 0 */ + + +static Window reading_selection_reply; +static Atom reading_which_selection; +static int selection_reply_timed_out; + +static int +selection_reply_done (void *ignore) +{ + return !reading_selection_reply; +} + +static Lisp_Object Qx_selection_reply_timeout_internal; + +DEFUN ("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal, + 1, 1, 0, /* +*/ + (arg)) +{ + selection_reply_timed_out = 1; + reading_selection_reply = 0; + return Qnil; +} + + +/* Do protocol to read selection-data from the server. + Converts this to lisp data and returns it. + */ +static Lisp_Object +x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type) +{ + /* This function can GC */ + struct device *d = decode_x_device (Qnil); + Display *display = DEVICE_X_DISPLAY (d); + struct frame *sel_frame = selected_frame (); + Window requestor_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame)); + Time requestor_time = DEVICE_X_MOUSE_TIMESTAMP (d); + Atom target_property = DEVICE_XATOM_EMACS_TMP (d); + Atom selection_atom = symbol_to_x_atom (d, selection_symbol, 0); + int speccount; + Atom type_atom = symbol_to_x_atom (d, (CONSP (target_type) ? + XCAR (target_type) : target_type), 0); + + XConvertSelection (display, selection_atom, type_atom, target_property, + requestor_window, requestor_time); + + /* Block until the reply has been read. */ + reading_selection_reply = requestor_window; + reading_which_selection = selection_atom; + selection_reply_timed_out = 0; + + speccount = specpdl_depth (); + + /* add a timeout handler */ + if (x_selection_timeout > 0) + { + Lisp_Object id = Fadd_timeout (make_int (x_selection_timeout), + Qx_selection_reply_timeout_internal, + Qnil, Qnil); + record_unwind_protect (Fdisable_timeout, id); + } + + /* This is ^Gable */ + wait_delaying_user_input (selection_reply_done, 0); + + if (selection_reply_timed_out) + error ("timed out waiting for reply from selection owner"); + + unbind_to (speccount, Qnil); + + /* otherwise, the selection is waiting for us on the requested property. */ + return + x_get_window_property_as_lisp_data (display, requestor_window, + target_property, target_type, + selection_atom); +} + + +static void +x_get_window_property (Display *display, Window window, Atom property, + unsigned char **data_ret, int *bytes_ret, + Atom *actual_type_ret, int *actual_format_ret, + unsigned long *actual_size_ret, int delete_p) +{ + int total_size; + unsigned long bytes_remaining; + int offset = 0; + unsigned char *tmp_data = 0; + int result; + int buffer_size = SELECTION_QUANTUM (display); + if (buffer_size > MAX_SELECTION_QUANTUM) buffer_size = MAX_SELECTION_QUANTUM; + + /* First probe the thing to find out how big it is. */ + result = XGetWindowProperty (display, window, property, + 0, 0, False, AnyPropertyType, + actual_type_ret, actual_format_ret, + actual_size_ret, + &bytes_remaining, &tmp_data); + if (result != Success) + { + *data_ret = 0; + *bytes_ret = 0; + return; + } + XFree ((char *) tmp_data); + + if (*actual_type_ret == None || *actual_format_ret == 0) + { + if (delete_p) XDeleteProperty (display, window, property); + *data_ret = 0; + *bytes_ret = 0; + return; + } + + total_size = bytes_remaining + 1; + *data_ret = (unsigned char *) xmalloc (total_size); + + /* Now read, until we've gotten it all. */ + while (bytes_remaining) + { +#if 0 + int last = bytes_remaining; +#endif + result = + XGetWindowProperty (display, window, property, + offset/4, buffer_size/4, + (delete_p ? True : False), + AnyPropertyType, + actual_type_ret, actual_format_ret, + actual_size_ret, &bytes_remaining, &tmp_data); +#if 0 + stderr_out ("<< read %d\n", last-bytes_remaining); +#endif + /* If this doesn't return Success at this point, it means that + some clod deleted the selection while we were in the midst of + reading it. Deal with that, I guess.... + */ + if (result != Success) break; + *actual_size_ret *= *actual_format_ret / 8; + memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret); + offset += *actual_size_ret; + XFree ((char *) tmp_data); + } + *bytes_ret = offset; +} + + +static void +receive_incremental_selection (Display *display, Window window, Atom property, + /* this one is for error messages only */ + Lisp_Object target_type, + unsigned int min_size_bytes, + unsigned char **data_ret, int *size_bytes_ret, + Atom *type_ret, int *format_ret, + unsigned long *size_ret) +{ + /* This function can GC */ + int offset = 0; + int prop_id; + *size_bytes_ret = min_size_bytes; + *data_ret = (unsigned char *) xmalloc (*size_bytes_ret); +#if 0 + stderr_out ("\nread INCR %d\n", min_size_bytes); +#endif + /* At this point, we have read an INCR property, and deleted it (which + is how we ack its receipt: the sending window will be selecting + PropertyNotify events on our window to notice this). + + Now, we must loop, waiting for the sending window to put a value on + that property, then reading the property, then deleting it to ack. + We are done when the sender places a property of length 0. + */ + prop_id = expect_property_change (display, window, property, + PropertyNewValue); + while (1) + { + unsigned char *tmp_data; + int tmp_size_bytes; + wait_for_property_change (prop_id); + /* expect it again immediately, because x_get_window_property may + .. no it won't, I don't get it. + .. Ok, I get it now, the Xt code that implements INCR is broken. + */ + prop_id = expect_property_change (display, window, property, + PropertyNewValue); + x_get_window_property (display, window, property, + &tmp_data, &tmp_size_bytes, + type_ret, format_ret, size_ret, 1); + + if (tmp_size_bytes == 0) /* we're done */ + { +#if 0 + stderr_out (" read INCR done\n"); +#endif + unexpect_property_change (prop_id); + if (tmp_data) xfree (tmp_data); + break; + } +#if 0 + stderr_out (" read INCR %d\n", tmp_size_bytes); +#endif + if (*size_bytes_ret < offset + tmp_size_bytes) + { +#if 0 + stderr_out (" read INCR realloc %d -> %d\n", + *size_bytes_ret, offset + tmp_size_bytes); +#endif + *size_bytes_ret = offset + tmp_size_bytes; + *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret); + } + memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); + offset += tmp_size_bytes; + xfree (tmp_data); + } +} + + +static Lisp_Object +x_get_window_property_as_lisp_data (Display *display, + Window window, + Atom property, + /* next two for error messages only */ + Lisp_Object target_type, + Atom selection_atom) +{ + /* This function can GC */ + Atom actual_type; + int actual_format; + unsigned long actual_size; + unsigned char *data = NULL; + int bytes = 0; + Lisp_Object val; + struct device *d = get_device_from_display (display); + + x_get_window_property (display, window, property, &data, &bytes, + &actual_type, &actual_format, &actual_size, 1); + if (! data) + { + if (XGetSelectionOwner (display, selection_atom)) + /* there is a selection owner */ + signal_error + (Qselection_conversion_error, + Fcons (build_string ("selection owner couldn't convert"), + Fcons (x_atom_to_symbol (d, selection_atom), + actual_type ? + list2 (target_type, x_atom_to_symbol (d, actual_type)) : + list1 (target_type)))); + else + signal_error (Qerror, + list2 (build_string ("no selection"), + x_atom_to_symbol (d, selection_atom))); + } + + if (actual_type == DEVICE_XATOM_INCR (d)) + { + /* Ok, that data wasn't *the* data, it was just the beginning. */ + + unsigned int min_size_bytes = * ((unsigned int *) data); + xfree (data); + receive_incremental_selection (display, window, property, target_type, + min_size_bytes, &data, &bytes, + &actual_type, &actual_format, + &actual_size); + } + + /* It's been read. Now convert it to a lisp object in some semi-rational + manner. */ + val = selection_data_to_lisp_data (d, data, bytes, + actual_type, actual_format); + + xfree (data); + return val; +} + +/* These functions convert from the selection data read from the server into + something that we can use from elisp, and vice versa. + + Type: Format: Size: Elisp Type: + ----- ------- ----- ----------- + * 8 * String + ATOM 32 1 Symbol + ATOM 32 > 1 Vector of Symbols + * 16 1 Integer + * 16 > 1 Vector of Integers + * 32 1 if <=16 bits: Integer + if > 16 bits: Cons of top16, bot16 + * 32 > 1 Vector of the above + + When converting a Lisp number to C, it is assumed to be of format 16 if + it is an integer, and of format 32 if it is a cons of two integers. + + When converting a vector of numbers from Elisp to C, it is assumed to be + of format 16 if every element in the vector is an integer, and is assumed + to be of format 32 if any element is a cons of two integers. + + When converting an object to C, it may be of the form (SYMBOL . <data>) + where SYMBOL is what we should claim that the type is. Format and + representation are as above. + + NOTE: Under Mule, when someone shoves us a string without a type, we + set the type to 'COMPOUND_TEXT and automatically convert to Compound + Text. If the string has a type, we assume that the user wants the + data sent as-is so we just do "binary" conversion. + */ + + +static Lisp_Object +selection_data_to_lisp_data (struct device *d, + unsigned char *data, + size_t size, + Atom type, + int format) +{ + if (type == DEVICE_XATOM_NULL (d)) + return QNULL; + + /* Convert any 8-bit data to a string, for compactness. */ + else if (format == 8) + return make_ext_string (data, size, + type == DEVICE_XATOM_TEXT (d) || + type == DEVICE_XATOM_COMPOUND_TEXT (d) + ? FORMAT_CTEXT : FORMAT_BINARY); + + /* Convert a single atom to a Lisp Symbol. + Convert a set of atoms to a vector of symbols. */ + else if (type == XA_ATOM) + { + if (size == sizeof (Atom)) + return x_atom_to_symbol (d, *((Atom *) data)); + else + { + int i; + int len = size / sizeof (Atom); + Lisp_Object v = Fmake_vector (make_int (len), Qzero); + for (i = 0; i < len; i++) + Faset (v, make_int (i), x_atom_to_symbol (d, ((Atom *) data) [i])); + return v; + } + } + + /* Convert a single 16 or small 32 bit number to a Lisp Int. + If the number is > 16 bits, convert it to a cons of integers, + 16 bits in each half. + */ + else if (format == 32 && size == sizeof (long)) + return word_to_lisp (((unsigned long *) data) [0]); + else if (format == 16 && size == sizeof (short)) + return make_int ((int) (((unsigned short *) data) [0])); + + /* Convert any other kind of data to a vector of numbers, represented + as above (as an integer, or a cons of two 16 bit integers). + + #### Perhaps we should return the actual type to lisp as well. + + (x-get-selection-internal 'PRIMARY 'LINE_NUMBER) + ==> [4 4] + + and perhaps it should be + + (x-get-selection-internal 'PRIMARY 'LINE_NUMBER) + ==> (SPAN . [4 4]) + + Right now the fact that the return type was SPAN is discarded before + lisp code gets to see it. + */ + else if (format == 16) + { + int i; + Lisp_Object v = make_vector (size / 4, Qzero); + for (i = 0; i < (int) size / 4; i++) + { + int j = (int) ((unsigned short *) data) [i]; + Faset (v, make_int (i), make_int (j)); + } + return v; + } + else + { + int i; + Lisp_Object v = make_vector (size / 4, Qzero); + for (i = 0; i < (int) size / 4; i++) + { + unsigned long j = ((unsigned long *) data) [i]; + Faset (v, make_int (i), word_to_lisp (j)); + } + return v; + } +} + + +static void +lisp_data_to_selection_data (struct device *d, + Lisp_Object obj, + unsigned char **data_ret, + Atom *type_ret, + unsigned int *size_ret, + int *format_ret) +{ + Lisp_Object type = Qnil; + + if (CONSP (obj) && SYMBOLP (XCAR (obj))) + { + type = XCAR (obj); + obj = XCDR (obj); + if (CONSP (obj) && NILP (XCDR (obj))) + obj = XCAR (obj); + } + + if (EQ (obj, QNULL) || (EQ (type, QNULL))) + { /* This is not the same as declining */ + *format_ret = 32; + *size_ret = 0; + *data_ret = 0; + type = QNULL; + } + else if (STRINGP (obj)) + { + CONST Extbyte *extval; + Extcount extvallen; + + if (NILP (type)) + GET_STRING_CTEXT_DATA_ALLOCA (obj, extval, extvallen); + else + GET_STRING_BINARY_DATA_ALLOCA (obj, extval, extvallen); + *format_ret = 8; + *size_ret = extvallen; + *data_ret = (unsigned char *) xmalloc (*size_ret); + memcpy (*data_ret, extval, *size_ret); +#ifdef MULE + if (NILP (type)) type = QCOMPOUND_TEXT; +#else + if (NILP (type)) type = QSTRING; +#endif + } + else if (CHARP (obj)) + { + Bufbyte buf[MAX_EMCHAR_LEN]; + Bytecount len; + CONST Extbyte *extval; + Extcount extvallen; + + *format_ret = 8; + len = set_charptr_emchar (buf, XCHAR (obj)); + GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA (buf, len, extval, extvallen); + *size_ret = extvallen; + *data_ret = (unsigned char *) xmalloc (*size_ret); + memcpy (*data_ret, extval, *size_ret); +#ifdef MULE + if (NILP (type)) type = QCOMPOUND_TEXT; +#else + if (NILP (type)) type = QSTRING; +#endif + } + else if (SYMBOLP (obj)) + { + *format_ret = 32; + *size_ret = 1; + *data_ret = (unsigned char *) xmalloc (sizeof (Atom) + 1); + (*data_ret) [sizeof (Atom)] = 0; + (*(Atom **) data_ret) [0] = symbol_to_x_atom (d, obj, 0); + if (NILP (type)) type = QATOM; + } + else if (INTP (obj) && + XINT (obj) <= 0x7FFF && + XINT (obj) >= -0x8000) + { + *format_ret = 16; + *size_ret = 1; + *data_ret = (unsigned char *) xmalloc (sizeof (short) + 1); + (*data_ret) [sizeof (short)] = 0; + (*(short **) data_ret) [0] = (short) XINT (obj); + if (NILP (type)) type = QINTEGER; + } + else if (INTP (obj) || CONSP (obj)) + { + *format_ret = 32; + *size_ret = 1; + *data_ret = (unsigned char *) xmalloc (sizeof (long) + 1); + (*data_ret) [sizeof (long)] = 0; + (*(unsigned long **) data_ret) [0] = lisp_to_word (obj); + if (NILP (type)) type = QINTEGER; + } + else if (VECTORP (obj)) + { + /* Lisp Vectors may represent a set of ATOMs; + a set of 16 or 32 bit INTEGERs; + or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...] + */ + int i; + + if (SYMBOLP (XVECTOR_DATA (obj) [0])) + /* This vector is an ATOM set */ + { + if (NILP (type)) type = QATOM; + *size_ret = XVECTOR_LENGTH (obj); + *format_ret = 32; + *data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom)); + for (i = 0; i < (int) (*size_ret); i++) + if (SYMBOLP (XVECTOR_DATA (obj) [i])) + (*(Atom **) data_ret) [i] = + symbol_to_x_atom (d, XVECTOR_DATA (obj) [i], 0); + else + signal_error (Qerror, /* Qselection_error */ + list2 (build_string + ("all elements of the vector must be of the same type"), + obj)); + } +#if 0 /* #### MULTIPLE doesn't work yet */ + else if (VECTORP (XVECTOR_DATA (obj) [0])) + /* This vector is an ATOM_PAIR set */ + { + if (NILP (type)) type = QATOM_PAIR; + *size_ret = XVECTOR_LENGTH (obj); + *format_ret = 32; + *data_ret = (unsigned char *) + xmalloc ((*size_ret) * sizeof (Atom) * 2); + for (i = 0; i < *size_ret; i++) + if (VECTORP (XVECTOR_DATA (obj) [i])) + { + Lisp_Object pair = XVECTOR_DATA (obj) [i]; + if (XVECTOR_LENGTH (pair) != 2) + signal_error (Qerror, + list2 (build_string + ("elements of the vector must be vectors of exactly two elements"), + pair)); + + (*(Atom **) data_ret) [i * 2] = + symbol_to_x_atom (d, XVECTOR_DATA (pair) [0], 0); + (*(Atom **) data_ret) [(i * 2) + 1] = + symbol_to_x_atom (d, XVECTOR_DATA (pair) [1], 0); + } + else + signal_error (Qerror, + list2 (build_string + ("all elements of the vector must be of the same type"), + obj)); + } +#endif + else + /* This vector is an INTEGER set, or something like it */ + { + *size_ret = XVECTOR_LENGTH (obj); + if (NILP (type)) type = QINTEGER; + *format_ret = 16; + for (i = 0; i < (int) (*size_ret); i++) + if (CONSP (XVECTOR_DATA (obj) [i])) + *format_ret = 32; + else if (!INTP (XVECTOR_DATA (obj) [i])) + signal_error (Qerror, /* Qselection_error */ + list2 (build_string + ("all elements of the vector must be integers or conses of integers"), + obj)); + + *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8)); + for (i = 0; i < (int) (*size_ret); i++) + if (*format_ret == 32) + (*((unsigned long **) data_ret)) [i] = + lisp_to_word (XVECTOR_DATA (obj) [i]); + else + (*((unsigned short **) data_ret)) [i] = + (unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]); + } + } + else + signal_error (Qerror, /* Qselection_error */ + list2 (build_string ("unrecognized selection data"), + obj)); + + *type_ret = symbol_to_x_atom (d, type, 0); +} + +static Lisp_Object +clean_local_selection_data (Lisp_Object obj) +{ + if (CONSP (obj) && + INTP (XCAR (obj)) && + CONSP (XCDR (obj)) && + INTP (XCAR (XCDR (obj))) && + NILP (XCDR (XCDR (obj)))) + obj = Fcons (XCAR (obj), XCDR (obj)); + + if (CONSP (obj) && + INTP (XCAR (obj)) && + INTP (XCDR (obj))) + { + if (XINT (XCAR (obj)) == 0) + return XCDR (obj); + if (XINT (XCAR (obj)) == -1) + return make_int (- XINT (XCDR (obj))); + } + if (VECTORP (obj)) + { + int i; + int len = XVECTOR_LENGTH (obj); + Lisp_Object copy; + if (len == 1) + return clean_local_selection_data (XVECTOR_DATA (obj) [0]); + copy = make_vector (len, Qnil); + for (i = 0; i < len; i++) + XVECTOR_DATA (copy) [i] = + clean_local_selection_data (XVECTOR_DATA (obj) [i]); + return copy; + } + return obj; +} + + +/* Called from the event loop to handle SelectionNotify events. + I don't think this needs to be reentrant. + */ +void +x_handle_selection_notify (XSelectionEvent *event) +{ + if (! reading_selection_reply) + message ("received an unexpected SelectionNotify event"); + else if (event->requestor != reading_selection_reply) + message ("received a SelectionNotify event for the wrong window"); + else if (event->selection != reading_which_selection) + message ("received the wrong selection type in SelectionNotify!"); + else + reading_selection_reply = 0; /* we're done now. */ +} + + +DEFUN ("x-own-selection-internal", Fx_own_selection_internal, 2, 2, 0, /* +Assert an X selection of the given TYPE with the given VALUE. +TYPE is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. +VALUE is typically a string, or a cons of two markers, but may be +anything that the functions on selection-converter-alist know about. +*/ + (selection_name, selection_value)) +{ + CHECK_SYMBOL (selection_name); + if (NILP (selection_value)) error ("selection-value may not be nil."); + x_own_selection (selection_name, selection_value); + return selection_value; +} + + +/* Request the selection value from the owner. If we are the owner, + simply return our selection value. If we are not the owner, this + will block until all of the data has arrived. + */ +DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 2, 2, 0, /* +Return text selected from some X window. +SELECTION_SYMBOL is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. +TARGET_TYPE is the type of data desired, typically STRING or COMPOUND_TEXT. +Under Mule, if the resultant data comes back as 8-bit data in type +TEXT or COMPOUND_TEXT, it will be decoded as Compound Text. +*/ + (selection_symbol, target_type)) +{ + /* This function can GC */ + Lisp_Object val = Qnil; + struct gcpro gcpro1, gcpro2; + GCPRO2 (target_type, val); /* we store newly consed data into these */ + CHECK_SYMBOL (selection_symbol); + +#if 0 /* #### MULTIPLE doesn't work yet */ + if (CONSP (target_type) && + XCAR (target_type) == QMULTIPLE) + { + CHECK_VECTOR (XCDR (target_type)); + /* So we don't destructively modify this... */ + target_type = copy_multiple_data (target_type); + } + else +#endif + CHECK_SYMBOL (target_type); + + val = x_get_local_selection (selection_symbol, target_type); + + if (NILP (val)) + { + val = x_get_foreign_selection (selection_symbol, target_type); + } + else + { + if (CONSP (val) && SYMBOLP (XCAR (val))) + { + val = XCDR (val); + if (CONSP (val) && NILP (XCDR (val))) + val = XCAR (val); + } + val = clean_local_selection_data (val); + } + UNGCPRO; + return val; +} + +DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, 1, 2, 0, /* +If we own the named selection, then disown it (make there be no selection). +*/ + (selection, timeval)) +{ + struct device *d = decode_x_device (Qnil); + Display *display = DEVICE_X_DISPLAY (d); + Time timestamp; + Atom selection_atom; + XSelectionClearEvent event; + + CHECK_SYMBOL (selection); + if (NILP (timeval)) + timestamp = DEVICE_X_MOUSE_TIMESTAMP (d); + else + { + /* #### This is bogus. See the comment above about problems + on OSF/1 and DEC Alphas. Yet another reason why it sucks + to have the implementation (i.e. cons of two 16-bit + integers) exposed. */ + time_t the_time; + lisp_to_time (timeval, &the_time); + timestamp = (Time) the_time; + } + + if (NILP (assq_no_quit (selection, Vselection_alist))) + return Qnil; /* Don't disown the selection when we're not the owner. */ + + selection_atom = symbol_to_x_atom (d, selection, 0); + + XSetSelectionOwner (display, selection_atom, None, timestamp); + + /* It doesn't seem to be guaranteed that a SelectionClear event will be + generated for a window which owns the selection when that window sets + the selection owner to None. The NCD server does, the MIT Sun4 server + doesn't. So we synthesize one; this means we might get two, but + that's ok, because the second one won't have any effect. + */ + event.display = display; + event.selection = selection_atom; + event.time = timestamp; + x_handle_selection_clear (&event); + + return Qt; +} + + +DEFUN ("x-selection-owner-p", Fx_selection_owner_p, 0, 1, 0, /* +Return t if current emacs process owns the given X Selection. +The arg should be the name of the selection in question, typically one of +the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol +nil is the same as PRIMARY, and t is the same as SECONDARY.) +*/ + (selection)) +{ + CHECK_SYMBOL (selection); + if (EQ (selection, Qnil)) selection = QPRIMARY; + else if (EQ (selection, Qt)) selection = QSECONDARY; + + return NILP (Fassq (selection, Vselection_alist)) ? Qnil : Qt; +} + +DEFUN ("x-selection-exists-p", Fx_selection_exists_p, 0, 1, 0, /* +Whether there is an owner for the given X Selection. +The arg should be the name of the selection in question, typically one of +the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience, the symbol +nil is the same as PRIMARY, and t is the same as SECONDARY.) +*/ + (selection)) +{ + struct device *d = decode_x_device (Qnil); + Display *dpy = DEVICE_X_DISPLAY (d); + CHECK_SYMBOL (selection); + if (!NILP (Fx_selection_owner_p (selection))) + return Qt; + return XGetSelectionOwner (dpy, symbol_to_x_atom (d, selection, 0)) != None ? + Qt : Qnil; +} + + +#ifdef CUT_BUFFER_SUPPORT + +static int cut_buffers_initialized; /* Whether we're sure they all exist */ + +/* Ensure that all 8 cut buffers exist. ICCCM says we gotta... */ +static void +initialize_cut_buffers (Display *display, Window window) +{ + static unsigned CONST char * CONST data = (unsigned CONST char *) ""; +#define FROB(atom) XChangeProperty (display, window, atom, XA_STRING, 8, \ + PropModeAppend, data, 0) + FROB (XA_CUT_BUFFER0); + FROB (XA_CUT_BUFFER1); + FROB (XA_CUT_BUFFER2); + FROB (XA_CUT_BUFFER3); + FROB (XA_CUT_BUFFER4); + FROB (XA_CUT_BUFFER5); + FROB (XA_CUT_BUFFER6); + FROB (XA_CUT_BUFFER7); +#undef FROB + cut_buffers_initialized = 1; +} + +#define CHECK_CUTBUFFER(symbol) \ + { CHECK_SYMBOL (symbol); \ + if (!EQ((symbol),QCUT_BUFFER0) && !EQ((symbol),QCUT_BUFFER1) && \ + !EQ((symbol),QCUT_BUFFER2) && !EQ((symbol),QCUT_BUFFER3) && \ + !EQ((symbol),QCUT_BUFFER4) && !EQ((symbol),QCUT_BUFFER5) && \ + !EQ((symbol),QCUT_BUFFER6) && !EQ((symbol),QCUT_BUFFER7)) \ + signal_error (Qerror, list2 (build_string ("Doesn't name a cutbuffer"), \ + (symbol))); \ + } + +DEFUN ("x-get-cutbuffer-internal", Fx_get_cutbuffer_internal, 1, 1, 0, /* +Return the value of the named CUTBUFFER (typically CUT_BUFFER0). +*/ + (cutbuffer)) +{ + struct device *d = decode_x_device (Qnil); + Display *display = DEVICE_X_DISPLAY (d); + Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ + Atom cut_buffer_atom; + unsigned char *data; + int bytes; + Atom type; + int format; + unsigned long size; + Lisp_Object ret; + + CHECK_CUTBUFFER (cutbuffer); + cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0); + + x_get_window_property (display, window, cut_buffer_atom, &data, &bytes, + &type, &format, &size, 0); + if (!data) return Qnil; + + if (format != 8 || type != XA_STRING) + signal_simple_error_2 ("Cut buffer doesn't contain 8-bit STRING data", + x_atom_to_symbol (d, type), + make_int (format)); + + /* We cheat - if the string contains an ESC character, that's + technically not allowed in a STRING, so we assume it's + COMPOUND_TEXT that we stored there ourselves earlier, + in x-store-cutbuffer-internal */ + ret = (bytes ? + make_ext_string (data, bytes, + memchr (data, 0x1b, bytes) ? + FORMAT_CTEXT : FORMAT_BINARY) + : Qnil); + xfree (data); + return ret; +} + + +DEFUN ("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0, /* +Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING. +*/ + (cutbuffer, string)) +{ + struct device *d = decode_x_device (Qnil); + Display *display = DEVICE_X_DISPLAY (d); + Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ + Atom cut_buffer_atom; + CONST Extbyte *data = XSTRING_DATA (string); + Extcount bytes = XSTRING_LENGTH (string); + Extcount bytes_remaining; + int max_bytes = SELECTION_QUANTUM (display); +#ifdef MULE + CONST Bufbyte *ptr, *end; + enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; +#endif + + if (max_bytes > MAX_SELECTION_QUANTUM) + max_bytes = MAX_SELECTION_QUANTUM; + + CHECK_CUTBUFFER (cutbuffer); + CHECK_STRING (string); + cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0); + + if (! cut_buffers_initialized) + initialize_cut_buffers (display, window); + + /* We use the STRING encoding (Latin-1 only) if we can, else COMPOUND_TEXT. + We cheat and use type = `STRING' even when using COMPOUND_TEXT. + The ICCCM requires that this be so, and other clients assume it, + as we do ourselves in initialize_cut_buffers. */ + +#ifdef MULE + /* Optimize for the common ASCII case */ + for (ptr = data, end = ptr + bytes; ptr <= end; ) + { + if (BYTE_ASCII_P (*ptr)) + { + ptr++; + continue; + } + + if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 || + (*ptr) == LEADING_BYTE_CONTROL_1) + { + chartypes = LATIN_1; + ptr += 2; + continue; + } + + chartypes = WORLD; + break; + } + + if (chartypes == LATIN_1) + GET_STRING_BINARY_DATA_ALLOCA (string, data, bytes); + else if (chartypes == WORLD) + GET_STRING_CTEXT_DATA_ALLOCA (string, data, bytes); +#endif /* MULE */ + + bytes_remaining = bytes; + + while (bytes_remaining) + { + int chunk = bytes_remaining < max_bytes ? bytes_remaining : max_bytes; + XChangeProperty (display, window, cut_buffer_atom, XA_STRING, 8, + (bytes_remaining == bytes + ? PropModeReplace : PropModeAppend), + data, chunk); + data += chunk; + bytes_remaining -= chunk; + } + return string; +} + + +DEFUN ("x-rotate-cutbuffers-internal", Fx_rotate_cutbuffers_internal, 1, 1, 0, /* +Rotate the values of the cutbuffers by the given number of steps; +positive means move values forward, negative means backward. +*/ + (n)) +{ + struct device *d = decode_x_device (Qnil); + Display *display = DEVICE_X_DISPLAY (d); + Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ + Atom props [8]; + + CHECK_INT (n); + if (XINT (n) == 0) + return n; + if (! cut_buffers_initialized) + initialize_cut_buffers (display, window); + props[0] = XA_CUT_BUFFER0; + props[1] = XA_CUT_BUFFER1; + props[2] = XA_CUT_BUFFER2; + props[3] = XA_CUT_BUFFER3; + props[4] = XA_CUT_BUFFER4; + props[5] = XA_CUT_BUFFER5; + props[6] = XA_CUT_BUFFER6; + props[7] = XA_CUT_BUFFER7; + XRotateWindowProperties (display, window, props, 8, XINT (n)); + return n; +} + +#endif /* CUT_BUFFER_SUPPORT */ + + + +/************************************************************************/ +/* initialization */ +/************************************************************************/ + +void +syms_of_xselect (void) +{ + DEFSUBR (Fx_get_selection_internal); + DEFSUBR (Fx_own_selection_internal); + DEFSUBR (Fx_disown_selection_internal); + DEFSUBR (Fx_selection_owner_p); + DEFSUBR (Fx_selection_exists_p); + +#ifdef CUT_BUFFER_SUPPORT + DEFSUBR (Fx_get_cutbuffer_internal); + DEFSUBR (Fx_store_cutbuffer_internal); + DEFSUBR (Fx_rotate_cutbuffers_internal); +#endif /* CUT_BUFFER_SUPPORT */ + + /* Unfortunately, timeout handlers must be lisp functions. */ + defsymbol (&Qx_selection_reply_timeout_internal, + "x-selection-reply-timeout-internal"); + DEFSUBR (Fx_selection_reply_timeout_internal); + + defsymbol (&QPRIMARY, "PRIMARY"); + defsymbol (&QSECONDARY, "SECONDARY"); + defsymbol (&QSTRING, "STRING"); + defsymbol (&QINTEGER, "INTEGER"); + defsymbol (&QCLIPBOARD, "CLIPBOARD"); + defsymbol (&QTIMESTAMP, "TIMESTAMP"); + defsymbol (&QTEXT, "TEXT"); + defsymbol (&QDELETE, "DELETE"); + defsymbol (&QMULTIPLE, "MULTIPLE"); + defsymbol (&QINCR, "INCR"); + defsymbol (&QEMACS_TMP, "_EMACS_TMP_"); + defsymbol (&QTARGETS, "TARGETS"); + defsymbol (&QATOM, "ATOM"); + defsymbol (&QATOM_PAIR, "ATOM_PAIR"); + defsymbol (&QCOMPOUND_TEXT, "COMPOUND_TEXT"); + defsymbol (&QNULL, "NULL"); + +#ifdef CUT_BUFFER_SUPPORT + defsymbol (&QCUT_BUFFER0, "CUT_BUFFER0"); + defsymbol (&QCUT_BUFFER1, "CUT_BUFFER1"); + defsymbol (&QCUT_BUFFER2, "CUT_BUFFER2"); + defsymbol (&QCUT_BUFFER3, "CUT_BUFFER3"); + defsymbol (&QCUT_BUFFER4, "CUT_BUFFER4"); + defsymbol (&QCUT_BUFFER5, "CUT_BUFFER5"); + defsymbol (&QCUT_BUFFER6, "CUT_BUFFER6"); + defsymbol (&QCUT_BUFFER7, "CUT_BUFFER7"); +#endif /* CUT_BUFFER_SUPPORT */ + + deferror (&Qselection_conversion_error, + "selection-conversion-error", + "selection-conversion error", Qio_error); +} + +void +vars_of_xselect (void) +{ +#ifdef CUT_BUFFER_SUPPORT + cut_buffers_initialized = 0; + Fprovide (intern ("cut-buffer")); +#endif + + reading_selection_reply = 0; + reading_which_selection = 0; + selection_reply_timed_out = 0; + for_whom_the_bell_tolls = 0; + prop_location_tick = 0; + + Vselection_alist = Qnil; + staticpro (&Vselection_alist); + + DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist /* +An alist associating selection-types (such as STRING and TIMESTAMP) with +functions. These functions will be called with three args: the name of the +selection (typically PRIMARY, SECONDARY, or CLIPBOARD); a desired type to +which the selection should be converted; and the local selection value + (whatever had been passed to `x-own-selection'). These functions should +return the value to send to the X server, which should be one of: + +-- nil (the conversion could not be done) +-- a cons of a symbol and any of the following values; the symbol + explicitly specifies the type that will be sent. +-- a string (If the type is not specified, then if Mule support exists, + the string will be converted to Compound Text and sent in + the 'COMPOUND_TEXT format; otherwise (no Mule support), + the string will be left as-is and sent in the 'STRING + format. If the type is specified, the string will be + left as-is (or converted to binary format under Mule). + In all cases, 8-bit data it sent.) +-- a character (With Mule support, will be converted to Compound Text + whether or not a type is specified. If a type is not + specified, a type of 'STRING or 'COMPOUND_TEXT will be + sent, as for strings.) +-- the symbol 'NULL (Indicates that there is no meaningful return value. + Empty 32-bit data with a type of 'NULL will be sent.) +-- a symbol (Will be converted into an atom. If the type is not specified, + a type of 'ATOM will be sent.) +-- an integer (Will be converted into a 16-bit or 32-bit integer depending + on the value. If the type is not specified, a type of + 'INTEGER will be sent.) +-- a cons (HIGH . LOW) of integers (Will be converted into a 32-bit integer. + If the type is not specified, a type of + 'INTEGER will be sent.) +-- a vector of symbols (Will be converted into a list of atoms. If the type + is not specified, a type of 'ATOM will be sent.) +-- a vector of integers (Will be converted into a list of 16-bit integers. + If the type is not specified, a type of 'INTEGER + will be sent.) +-- a vector of integers and/or conses (HIGH . LOW) of integers + (Will be converted into a list of 16-bit integers. + If the type is not specified, a type of 'INTEGER + will be sent.) +*/ ); + Vselection_converter_alist = Qnil; + + DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks /* +A function or functions to be called after the X server has notified us +that we have lost the selection. The function(s) will be called with one +argument, a symbol naming the selection (typically PRIMARY, SECONDARY, or +CLIPBOARD). +*/ ); + Vx_lost_selection_hooks = Qunbound; + + DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks /* +A function or functions to be called after we have responded to some +other client's request for the value of a selection that we own. The +function(s) will be called with four arguments: + - the name of the selection (typically PRIMARY, SECONDARY, or CLIPBOARD); + - the name of the selection-type which we were requested to convert the + selection into before sending (for example, STRING or LENGTH); + - and whether we successfully transmitted the selection. +We might have failed (and declined the request) for any number of reasons, +including being asked for a selection that we no longer own, or being asked +to convert into a type that we don't know about or that is inappropriate. +This hook doesn't let you change the behavior of emacs's selection replies, +it merely informs you that they have happened. +*/ ); + Vx_sent_selection_hooks = Qunbound; + + DEFVAR_INT ("x-selection-timeout", &x_selection_timeout /* +If the selection owner doesn't reply in this many seconds, we give up. +A value of 0 means wait as long as necessary. This is initialized from the +\"*selectionTimeout\" resource (which is expressed in milliseconds). +*/ ); + x_selection_timeout = 0; +} + +void +Xatoms_of_xselect (struct device *d) +{ + Display *D = DEVICE_X_DISPLAY (d); + + /* Non-predefined atoms that we might end up using a lot */ + DEVICE_XATOM_CLIPBOARD (d) = XInternAtom (D, "CLIPBOARD", False); + DEVICE_XATOM_TIMESTAMP (d) = XInternAtom (D, "TIMESTAMP", False); + DEVICE_XATOM_TEXT (d) = XInternAtom (D, "TEXT", False); + DEVICE_XATOM_DELETE (d) = XInternAtom (D, "DELETE", False); + DEVICE_XATOM_MULTIPLE (d) = XInternAtom (D, "MULTIPLE", False); + DEVICE_XATOM_INCR (d) = XInternAtom (D, "INCR", False); + DEVICE_XATOM_TARGETS (d) = XInternAtom (D, "TARGETS", False); + DEVICE_XATOM_NULL (d) = XInternAtom (D, "NULL", False); + DEVICE_XATOM_ATOM_PAIR (d) = XInternAtom (D, "ATOM_PAIR", False); + DEVICE_XATOM_COMPOUND_TEXT (d) = XInternAtom (D, "COMPOUND_TEXT", False); + DEVICE_XATOM_EMACS_TMP (d) = XInternAtom (D, "_EMACS_TMP_", False); +} diff -r 12e008d41344 -r 697ef44129c6 tests/ChangeLog --- a/tests/ChangeLog Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/ChangeLog Mon Aug 13 11:20:41 2007 +0200 @@ -1,170 +1,3 @@ -2000-07-19 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.35 is released. - -2000-06-17 Martin Buchholz <martin@xemacs.org> - - * automated/database-tests.el: Remove any previous .pag, .dir files. - -2000-05-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.34 is released. - -2000-05-01 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.33 is released. - -2000-03-20 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.32 is released. - -2000-03-10 Martin Buchholz <martin@xemacs.org> - - * automated/mule-tests.el: Check that (make-temp-name) returns - unique values. - -2000-03-06 Yoshiki Hayashi <yoshiki@xemacs.org> - - * gutter-test.el: Fix name of specifier. - -2000-02-23 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.31 is released. - -2000-02-21 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.30 is released. - -2000-02-17 Martin Buchholz <martin@xemacs.org> - - * automated/mule-tests.el: Added some fileio tests. - -2000-02-16 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.29 is released. - -2000-02-13 Martin Buchholz <martin@xemacs.org> - - * automated/lisp-tests.el: Add subseq tests. - -2000-02-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.28 is released. - -2000-02-07 Martin Buchholz <martin@xemacs.org> - - * automated/lisp-tests.el: Add plist manipulation tests. - -2000-02-02 Martin Buchholz <martin@xemacs.org> - - * automated/symbol-tests.el: Crashes fixed, so resurrect - makunbound test for dontusethis-set-symbol-value-handler. - Add more dontusethis-set-symbol-value-handler tests. - Should fix any lingering problems with gnus playing with - pathname-coding-system. - -2000-01-25 Martin Buchholz <martin@xemacs.org> - - * mule-tests.el: Add coding-system tests. - -2000-01-18 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.27 is released. - -1999-12-24 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> - - * automated/syntax-tests.el: New file. - Add test for scan_words using forward-word and backword-word. - -2000-01-08 Martin Buchholz <martin@xemacs.org> - - * automated/mule-tests.el: - Test resizing of small and big (> 8k bytes) strings. - -1999-12-31 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.26 is released. - -1999-12-24 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.25 is released. - -1999-12-21 Martin Buchholz <martin@xemacs.org> - - * automated/byte-compiler-tests.el: Add Jan's tests for equal - effect of bytecode and interpreted code. - - * automated/lisp-tests.el: Add tests for near-text functions. - -1999-12-19 Martin Buchholz <martin@xemacs.org> - - * automated/mule-tests.el: Add tests for fillarray, aset. - -1999-12-17 Martin Buchholz <martin@xemacs.org> - - * automated/lisp-tests.el: Add tests for mapcar1() crashes. - -1999-12-14 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.24 is released. - -1999-12-07 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.23 is released. - -1999-11-29 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.22 is released - -1999-11-28 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.21 is released. - -1999-11-10 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.20 is released - -1999-07-30 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.19 is released - -1999-07-13 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.18 is released - -1999-06-22 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.17 is released - -1999-06-11 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.16 is released - -1999-06-07 Hrvoje Niksic <hniksic@srce.hr> - - * automated/base64-tests.el: Check for error instead for nil where - error conditions are expected. - - * automated/base64-tests.el: Comment out (for now) the code that - causes crashes. - -1999-06-05 Hrvoje Niksic <hniksic@srce.hr> - - * automated/base64-tests.el: Check that the decoder handles - arbitrary characters. Cut down on the number of tests. - -1999-06-04 XEmacs Build Bot <builds@cvs.xemacs.org> - - * XEmacs 21.2.15 is released - -1999-06-02 Oscar Figueiredo <oscar@xemacs.org> - - * automated/lisp-tests.el: Test `split-string' - -1999-05-27 Hrvoje Niksic <hniksic@srce.hr> - - * automated/base64-tests.el: New file. - 1999-05-14 XEmacs Build Bot <builds@cvs.xemacs.org> * XEmacs 21.2.14 is released diff -r 12e008d41344 -r 697ef44129c6 tests/Dnd/droptest.sh --- a/tests/Dnd/droptest.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/Dnd/droptest.sh Mon Aug 13 11:20:41 2007 +0200 @@ -1,10 +1,8 @@ #!/bin/sh -TEMPDIR=/tmp +cat README > /tmp/DropTest.txt -cat README > $TEMPDIR/DropTest.txt - -cat > $TEMPDIR/DropTest.html <<EOF +cat > /tmp/DropTest.html <<EOF <HTML> <HEAD> <TITLE>DropTest Page @@ -16,7 +14,7 @@ EOF -cat > $TEMPDIR/DropTest.tex < /tmp/DropTest.tex < $TEMPDIR/DropTest.xpm < /tmp/DropTest.xpm < RET'. You will see a log of -passed and failed tests, which should allow you to investigate the -source of the error and ultimately fix the bug. - -Adding a new test file is trivial: just create a new file here and it -will be run. There is no need to byte-compile any of the files in -this directory -- the test-harness will take care of any necessary -byte-compilation. - -Look at the existing test cases for the examples of coding test cases. -It all boils down to your imagination and judicious use of the macros -`Assert', `Check-Error', `Check-Error-Message', and `Check-Message'. diff -r 12e008d41344 -r 697ef44129c6 tests/automated/base64-tests.el --- a/tests/automated/base64-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -;; Copyright (C) 1999 Free Software Foundation, Inc. - -;; Author: Hrvoje Niksic -;; Maintainer: Hrvoje Niksic -;; Created: 1999 -;; Keywords: tests - -;; 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: - -;; Test base64 functions. -;; See test-harness.el for instructions on how to run these tests. - -(eval-when-compile - (condition-case nil - (require 'test-harness) - (file-error - (push "." load-path) - (when (and (boundp 'load-file-name) (stringp load-file-name)) - (push (file-name-directory load-file-name) load-path)) - (require 'test-harness)))) - -;; We need to test the buffer and string functions. We do it by -;; testing them in various circumstances, asserting the same result, -;; and returning that result. - -(defvar bt-test-buffer (get-buffer-create " *base64-workhorse*")) - -(defun bt-base64-encode-string (string &optional no-line-break) - (let ((string-result (base64-encode-string string no-line-break)) - length) - (with-current-buffer bt-test-buffer - ;; the whole buffer - (erase-buffer) - (insert string) - (setq length (base64-encode-region (point-min) (point-max) no-line-break)) - (Assert (eq length (- (point-max) (point-min)))) - (Assert (equal (buffer-string) string-result)) - ;; partial - (erase-buffer) - (insert "random junk........\0\0';'eqwrkw[erpqf") - (let ((p1 (point)) p2) - (insert string) - (setq p2 (point-marker)) - (insert "...more random junk.q,f3/.qrm314.r,m2typ' 2436T@W$^@$#^T@") - (setq length (base64-encode-region p1 p2 no-line-break)) - (Assert (eq length (- p2 p1))) - (Assert (equal (buffer-substring p1 p2) string-result)))) - string-result)) - -(defun bt-base64-decode-string (string) - (let ((string-result (base64-decode-string string)) - length) - (with-current-buffer bt-test-buffer - ;; the whole buffer - (erase-buffer) - (insert string) - (setq length (base64-decode-region (point-min) (point-max))) - (cond (string-result - (Assert (eq length (- (point-max) (point-min)))) - (Assert (equal (buffer-string) string-result))) - (t - (Assert (null length)) - ;; The buffer should not have been modified. - (Assert (equal (buffer-string) string)))) - ;; partial - (erase-buffer) - (insert "random junk........\0\0';'eqwrkw[erpqf") - (let ((p1 (point)) p2) - (insert string) - (setq p2 (point-marker)) - (insert "...more random junk.q,f3/.qrm314.\0\0r,m2typ' 2436T@W$^@$#T@") - (setq length (base64-decode-region p1 p2)) - (cond (string-result - (Assert (eq length (- p2 p1))) - (Assert (equal (buffer-substring p1 p2) string-result))) - (t - (Assert (null length)) - ;; The buffer should not have been modified. - (Assert (equal (buffer-substring p1 p2) string)))))) - string-result)) - -(defun bt-remove-newlines (str) - (apply #'string (delete ?\n (mapcar #'identity str)))) - -(defconst bt-allchars - (let ((str (make-string 256 ?\0))) - (dotimes (i 256) - (aset str i (int-char i))) - str)) - -(defconst bt-test-strings - `(("" "") - ("foo" "Zm9v") - ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAx -MjM0NTY3ODk=") - (,bt-allchars - "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1 -Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWpr -bG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6Ch -oqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX -2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==") - )) - -;;----------------------------------------------------- -;; Encoding base64 -;;----------------------------------------------------- - -(loop for (raw encoded) in bt-test-strings do - (Assert (equal (bt-base64-encode-string raw) encoded)) - ;; test the NO-LINE-BREAK flag - (Assert (equal (bt-base64-encode-string raw t) (bt-remove-newlines encoded)))) - -;; When Mule is around, Lisp programmers should make sure that the -;; buffer contains only characters whose `char-int' is in the [0, 256) -;; range. If this condition is not satisfied for any character, an -;; error is signaled. -(when (featurep 'mule) - ;; #### remove subtraction of 128 -- no longer needed with make-char - ;; patch! - (let* ((mule-string (format "Hrvoje Nik%ci%c" - ;; scaron == 185 in Latin 2 - (make-char 'latin-iso8859-2 (- 185 128)) - ;; cacute == 230 in Latin 2 - (make-char 'latin-iso8859-2 (- 230 128))))) - (Check-Error-Message error "Non-ascii character in base64 input" - (bt-base64-encode-string mule-string)))) - -;;----------------------------------------------------- -;; Decoding base64 -;;----------------------------------------------------- - -(loop for (raw encoded) in bt-test-strings do - (Assert (equal (bt-base64-decode-string encoded) raw)) - (Assert (equal (bt-base64-decode-string (bt-remove-newlines encoded)) raw))) - -;; Test errors -(dolist (str `("foo" "AAC" "foo\0bar" "====" "Zm=9v" ,bt-allchars)) - (Check-Error error (base64-decode-string str))) - -;; base64-decode-string should ignore non-base64 characters anywhere -;; in the string. We test this in the cheesiest manner possible, by -;; inserting non-base64 chars at the beginning, at the end, and in the -;; middle of the string. - -(defconst bt-base64-chars '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J - ;; sometimes I hate Emacs indentation. - ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T - ?U ?V ?W ?X ?Y ?Z ?a ?b ?c ?d - ?e ?f ?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 ?+ ?/ ?=)) - -(defconst bt-nonbase64-chars (set-difference (mapcar #'identity bt-allchars) - bt-base64-chars)) - -(loop for (raw encoded) in bt-test-strings do - (unless (equal raw "") - (let* ((middlepos (/ (1+ (length encoded)) 2)) - (left (substring encoded 0 middlepos)) - (right (substring encoded middlepos))) - ;; Whitespace at the beginning, end, and middle. - (let ((mangled (concat bt-nonbase64-chars left bt-nonbase64-chars right - bt-nonbase64-chars))) - (Assert (equal (bt-base64-decode-string mangled) raw))) - - ;; Whitespace between every char. - (let ((mangled (concat bt-nonbase64-chars - ;; ENCODED with bt-nonbase64-chars - ;; between every character. - (mapconcat #'char-to-string encoded - (apply #'string bt-nonbase64-chars)) - bt-nonbase64-chars))) - (Assert (equal (bt-base64-decode-string mangled) raw)))))) - -;;----------------------------------------------------- -;; Mixed... -;;----------------------------------------------------- - -;; The whole point of base64 is to ensure that an arbitrary sequence -;; of bytes passes through gateway hellfire unscathed, protected by -;; the asbestos suit of base64. Here we test that -;; (base64-decode-string (base64-decode-string FOO)) equals FOO for -;; any FOO we can think of. The following stunts stress-test -;; practically all aspects of the encoding and decoding process. - -(loop for (raw ignored) in bt-test-strings do - (Assert (equal (bt-base64-decode-string - (bt-base64-encode-string raw)) - raw)) - (Assert (equal (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-encode-string - (bt-base64-encode-string raw)))) - raw)) - (Assert (equal (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-encode-string - (bt-base64-encode-string - (bt-base64-encode-string raw)))))) - raw)) - (Assert (equal (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-encode-string - (bt-base64-encode-string - (bt-base64-encode-string - (bt-base64-encode-string raw)))))))) - raw)) - (Assert (equal (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-decode-string - (bt-base64-encode-string - (bt-base64-encode-string - (bt-base64-encode-string - (bt-base64-encode-string - (bt-base64-encode-string raw)))))))))) - raw))) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/byte-compiler-tests.el --- a/tests/automated/byte-compiler-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/automated/byte-compiler-tests.el Mon Aug 13 11:20:41 2007 +0200 @@ -91,30 +91,3 @@ error "`let' bindings can have only one value-form" (eval '(let* ((x 1 2)) 3))) -(defmacro before-and-after-compile-equal (&rest form) - `(Assert (equal (funcall (quote (lambda () ,@form))) - (funcall (byte-compile (quote (lambda () ,@form))))))) - -(defvar simplyamarker (point-min-marker)) - -;; The byte optimizer must be careful with +/- with a single argument. - -(before-and-after-compile-equal (+)) -(before-and-after-compile-equal (+ 2 2)) -(before-and-after-compile-equal (+ 2 1)) -(before-and-after-compile-equal (+ 1 2)) -;; (+ 1) is OK. but (+1) signals an error. -(before-and-after-compile-equal (+ 1)) -(before-and-after-compile-equal (+ 3)) -(before-and-after-compile-equal (+ simplyamarker 1)) -;; The optimization (+ m) --> m is invalid when m is a marker. -;; Currently the following test fails - controversial. -;; (before-and-after-compile-equal (+ simplyamarker)) -;; Same tests for minus. -(before-and-after-compile-equal (- 2 2)) -(before-and-after-compile-equal (- 2 1)) -(before-and-after-compile-equal (- 1 2)) -(before-and-after-compile-equal (- 1)) -(before-and-after-compile-equal (- 3)) -(before-and-after-compile-equal (- simplyamarker 1)) -(before-and-after-compile-equal (- simplyamarker)) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/c-tests.el --- a/tests/automated/c-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -;; Copyright (C) 2000 Martin Buchholz - -;; Author: Martin Buchholz -;; Maintainer: Martin Buchholz -;; Created: 1998 -;; Keywords: tests - -;; 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: - -;;; Call tests in src/tests.c, which cannot be written using lisp only. -;;; See test-harness.el for instructions on how to run these tests. - -(eval-when-compile - (condition-case nil - (require 'test-harness) - (file-error - (push "." load-path) - (when (and (boundp 'load-file-name) (stringp load-file-name)) - (push (file-name-directory load-file-name) load-path)) - (require 'test-harness)))) - -(when (boundp 'test-function-list) ; Only if configure --debug - (loop for fun in test-function-list do - (Assert (eq 'PASS (funcall fun))))) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/database-tests.el --- a/tests/automated/database-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/automated/database-tests.el Mon Aug 13 11:20:41 2007 +0200 @@ -37,10 +37,7 @@ (require 'test-harness)))) (flet ((delete-database-files (filename) - (dolist (fn (list filename - (concat filename ".db") - (concat filename ".pag") - (concat filename ".dir"))) + (dolist (fn (list filename (concat filename ".db"))) (ignore-file-errors (delete-file fn)))) (test-database (db) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/hash-table-tests.el --- a/tests/automated/hash-table-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/automated/hash-table-tests.el Mon Aug 13 11:20:41 2007 +0200 @@ -37,41 +37,30 @@ (require 'test-harness)))) ;; Test all combinations of make-hash-table keywords -(dolist (test '(eq eql equal)) - (dolist (size '(0 1 100)) - (dolist (rehash-size '(1.1 9.9)) - (dolist (rehash-threshold '(0.2 .9)) - (dolist (weakness '(nil t key value)) +(dolist (type '(non-weak weak key-weak value-weak)) + (dolist (test '(eq eql equal)) + (dolist (size '(0 1 100)) + (dolist (rehash-size '(1.1 9.9)) + (dolist (rehash-threshold '(0.2 .9)) (dolist (data '(() (1 2) (1 2 3 4))) - (let ((ht (make-hash-table - :test test - :size size - :rehash-size rehash-size - :rehash-threshold rehash-threshold - :weakness weakness))) + (let ((ht (make-hash-table :test test + :type type + :size size + :rehash-size rehash-size + :rehash-threshold rehash-threshold))) (Assert (equal ht (car (let ((print-readably t)) (read-from-string (prin1-to-string ht)))))) (Assert (eq test (hash-table-test ht))) + (Assert (eq type (hash-table-type ht))) (Assert (<= size (hash-table-size ht))) (Assert (eql rehash-size (hash-table-rehash-size ht))) - (Assert (eql rehash-threshold (hash-table-rehash-threshold ht))) - (Assert (eq weakness (hash-table-weakness ht)))))))))) - -(loop for (fun weakness) in '((make-hashtable nil) - (make-weak-hashtable t) - (make-key-weak-hashtable key) - (make-value-weak-hashtable value)) - do (Assert (eq weakness (hash-table-weakness (funcall fun 10))))) + (Assert (eql rehash-threshold (hash-table-rehash-threshold ht)))))))))) -(loop for (type weakness) in '((non-weak nil) - (weak t) - (key-weak key) - (value-weak value)) - do (Assert (equal (make-hash-table :type type) - (make-hash-table :weakness weakness)))) - -(Assert (not (equal (make-hash-table :weakness nil) - (make-hash-table :weakness t)))) +(loop for (fun type) in '((make-hashtable non-weak) + (make-weak-hashtable weak) + (make-key-weak-hashtable key-weak) + (make-value-weak-hashtable value-weak)) + do (Assert (eq type (hash-table-type (funcall fun 10))))) (let ((ht (make-hash-table :size 20 :rehash-threshold .75 :test 'eq)) (size 80)) @@ -80,7 +69,6 @@ (Assert (eq 'eq (hash-table-test ht))) (Assert (eq 'non-weak (hash-table-type ht))) (Assert (eq 'non-weak (hashtable-type ht))) - (Assert (eq 'nil (hash-table-weakness ht))) (dotimes (j size) (puthash j (- j) ht) (Assert (eq (gethash j ht) (- j))) @@ -205,13 +193,13 @@ )) ;; Test that weak hash-tables are properly handled -(loop for (weakness expected-count expected-k-sum expected-v-sum) in - '((nil 6 38 25) - (t 3 6 9) - (key 4 38 9) - (value 4 6 25)) +(loop for (type expected-count expected-k-sum expected-v-sum) in + '((non-weak 6 38 25) + (weak 3 6 9) + (key-weak 4 38 9) + (value-weak 4 6 25)) do - (let* ((ht (make-hash-table :weakness weakness)) + (let* ((ht (make-hash-table :type type)) (my-obj (cons ht ht))) (garbage-collect) (puthash my-obj 1 ht) @@ -250,9 +238,9 @@ (Assert (= v-sum k-sum)))) ;;; Test reading and printing of hash-table objects -(let ((h1 #s(hashtable weakness t rehash-size 3.0 rehash-threshold .2 test eq data (1 2 3 4))) - (h2 #s(hash-table weakness t rehash-size 3.0 rehash-threshold .2 test eq data (1 2 3 4))) - (h3 (make-hash-table :weakness t :rehash-size 3.0 :rehash-threshold .2 :test 'eq))) +(let ((h1 #s(hashtable type weak rehash-size 3.0 rehash-threshold .2 test eq data (1 2 3 4))) + (h2 #s(hash-table type weak rehash-size 3.0 rehash-threshold .2 test eq data (1 2 3 4))) + (h3 (make-hash-table :type 'weak :rehash-size 3.0 :rehash-threshold .2 :test 'eq))) (Assert (equal h1 h2)) (Assert (not (equal h1 h3))) (puthash 1 2 h3) @@ -279,7 +267,3 @@ (clrhash h2) (Assert (equal h1 h2)) ) - -;;; Test sxhash -(Assert (= (sxhash "foo") (sxhash "foo"))) -(Assert (= (sxhash '(1 2 3)) (sxhash '(1 2 3)))) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/lisp-tests.el --- a/tests/automated/lisp-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/automated/lisp-tests.el Mon Aug 13 11:20:41 2007 +0200 @@ -229,8 +229,6 @@ (Assert (= (+ 1.0 1) 2.0)) (Assert (= (+ 1.0 1 1) 3.0)) (Assert (= (+ 1 1 1.0) 3.0)) -(Assert (eq (1+ most-positive-fixnum) most-negative-fixnum)) -(Assert (eq (+ most-positive-fixnum 1) most-negative-fixnum)) ;; Test `-' (Check-Error wrong-number-of-arguments (-)) @@ -255,9 +253,6 @@ (Assert (= (- 1.5 1) .5)) (Assert (= (- 1 1.5) (- .5))) -(Assert (eq (1- most-negative-fixnum) most-positive-fixnum)) -(Assert (eq (- most-negative-fixnum 1) most-positive-fixnum)) - ;; Test `/' ;; Test division by zero errors @@ -755,29 +750,6 @@ (Assert (equal (mapconcat #'identity '("1" "2" "3") "|") "1|2|3")) (Assert (equal (mapconcat #'identity ["1" "2" "3"] "|") "1|2|3")) -;; The following 2 functions used to crash XEmacs via mapcar1(). -;; We don't test the actual values of the mapcar, since they're undefined. -(Assert - (let ((x (list (cons 1 1) (cons 2 2) (cons 3 3)))) - (mapcar - (lambda (y) - "Devious evil mapping function" - (when (eq (car y) 2) ; go out onto a limb - (setcdr x nil) ; cut it off behind us - (garbage-collect)) ; are we riding a magic broomstick? - (car y)) ; sorry, hard landing - x))) - -(Assert - (let ((x (list (cons 1 1) (cons 2 2) (cons 3 3)))) - (mapcar - (lambda (y) - "Devious evil mapping function" - (when (eq (car y) 1) - (setcdr (cdr x) 42)) ; drop a brick wall onto the freeway - (car y)) - x))) - ;;----------------------------------------------------- ;; Test vector functions ;;----------------------------------------------------- @@ -813,128 +785,3 @@ (defun test-emacs-buffer-local-parameter (test-emacs-buffer-local-variable) (setq test-emacs-buffer-local-variable nil))) (test-emacs-buffer-local-parameter nil) - -;;----------------------------------------------------- -;; Test split-string -;;----------------------------------------------------- -;; Hrvoje didn't like these tests so I'm disabling them for now. -sb -;(Assert (equal (split-string "foo" "") '("" "f" "o" "o" ""))) -;(Assert (equal (split-string "foo" "^") '("" "foo"))) -;(Assert (equal (split-string "foo" "$") '("foo" ""))) -(Assert (equal (split-string "foo,bar" ",") '("foo" "bar"))) -(Assert (equal (split-string ",foo,bar," ",") '("" "foo" "bar" ""))) -(Assert (equal (split-string ",foo,bar," "^,") '("" "foo,bar,"))) -(Assert (equal (split-string ",foo,bar," ",$") '(",foo,bar" ""))) -(Assert (equal (split-string ",foo,,bar," ",") '("" "foo" "" "bar" ""))) -(Assert (equal (split-string "foo,,,bar" ",") '("foo" "" "" "bar"))) -(Assert (equal (split-string "foo,,bar,," ",") '("foo" "" "bar" "" ""))) -(Assert (equal (split-string "foo,,bar" ",+") '("foo" "bar"))) -(Assert (equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" ""))) - -;;----------------------------------------------------- -;; Test near-text buffer functions. -;;----------------------------------------------------- -(with-temp-buffer - (erase-buffer) - (Assert (eq (char-before) nil)) - (Assert (eq (char-before (point)) nil)) - (Assert (eq (char-before (point-marker)) nil)) - (Assert (eq (char-before (point) (current-buffer)) nil)) - (Assert (eq (char-before (point-marker) (current-buffer)) nil)) - (Assert (eq (char-after) nil)) - (Assert (eq (char-after (point)) nil)) - (Assert (eq (char-after (point-marker)) nil)) - (Assert (eq (char-after (point) (current-buffer)) nil)) - (Assert (eq (char-after (point-marker) (current-buffer)) nil)) - (Assert (eq (preceding-char) 0)) - (Assert (eq (preceding-char (current-buffer)) 0)) - (Assert (eq (following-char) 0)) - (Assert (eq (following-char (current-buffer)) 0)) - (insert "foobar") - (Assert (eq (char-before) ?r)) - (Assert (eq (char-after) nil)) - (Assert (eq (preceding-char) ?r)) - (Assert (eq (following-char) 0)) - (goto-char (point-min)) - (Assert (eq (char-before) nil)) - (Assert (eq (char-after) ?f)) - (Assert (eq (preceding-char) 0)) - (Assert (eq (following-char) ?f)) - ) - -;;----------------------------------------------------- -;; Test plist manipulation functions. -;;----------------------------------------------------- -(let ((sym (make-symbol "test-symbol"))) - (Assert (eq t (get* sym t t))) - (Assert (eq t (get sym t t))) - (Assert (eq t (getf nil t t))) - (Assert (eq t (plist-get nil t t))) - (put sym 'bar 'baz) - (Assert (eq 'baz (get sym 'bar))) - (Assert (eq 'baz (getf '(bar baz) 'bar))) - (Assert (eq 'baz (getf (symbol-plist sym) 'bar))) - (Assert (eq 2 (getf '(1 2) 1))) - (Assert (eq 4 (put sym 3 4))) - (Assert (eq 4 (get sym 3))) - (Assert (eq t (remprop sym 3))) - (Assert (eq nil (remprop sym 3))) - (Assert (eq 5 (get sym 3 5))) - ) - -(loop for obj in - (list (make-symbol "test-symbol") - "test-string" - (make-extent nil nil nil) - (make-face 'test-face)) - do - (Assert (eq 2 (get obj ?1 2))) - (Assert (eq 4 (put obj ?3 4))) - (Assert (eq 4 (get obj ?3))) - (when (or (stringp obj) (symbolp obj)) - (Assert (equal '(?3 4) (object-plist obj)))) - (Assert (eq t (remprop obj ?3))) - (when (or (stringp obj) (symbolp obj)) - (Assert (eq '() (object-plist obj)))) - (Assert (eq nil (remprop obj ?3))) - (when (or (stringp obj) (symbolp obj)) - (Assert (eq '() (object-plist obj)))) - (Assert (eq 5 (get obj ?3 5))) - ) - -(Check-Error-Message - error "Object type has no properties" - (get 2 'property)) - -(Check-Error-Message - error "Object type has no settable properties" - (put (current-buffer) 'property 'value)) - -(Check-Error-Message - error "Object type has no removable properties" - (remprop ?3 'property)) - -(Check-Error-Message - error "Object type has no properties" - (object-plist (symbol-function 'car))) - -(Check-Error-Message - error "Can't remove property from object" - (remprop (make-extent nil nil nil) 'detachable)) - -;;----------------------------------------------------- -;; Test subseq -;;----------------------------------------------------- -(Assert (equal (subseq nil 0) nil)) -(Assert (equal (subseq [1 2 3] 0) [1 2 3])) -(Assert (equal (subseq [1 2 3] 1 -1) [2])) -(Assert (equal (subseq "123" 0) "123")) -(Assert (equal (subseq "1234" -3 -1) "23")) -(Assert (equal (subseq #*0011 0) #*0011)) -(Assert (equal (subseq #*0011 -3 3) #*01)) -(Assert (equal (subseq '(1 2 3) 0) '(1 2 3))) -(Assert (equal (subseq '(1 2 3 4) -3 nil) '(2 3 4))) - -(Check-Error 'wrong-type-argument (subseq 3 2)) -(Check-Error 'args-out-of-range (subseq [1 2 3] -42)) -(Check-Error 'args-out-of-range (subseq [1 2 3] 0 42)) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/md5-tests.el --- a/tests/automated/md5-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/automated/md5-tests.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,7 @@ ;; Copyright (C) 1998 Free Software Foundation, Inc. -;; Author: Hrvoje Niksic -;; Maintainer: Hrvoje Niksic +;; Author: Hrvoje Niksic +;; Maintainer: Hrvoje Niksic ;; Created: 1998 ;; Keywords: tests diff -r 12e008d41344 -r 697ef44129c6 tests/automated/mule-tests.el --- a/tests/automated/mule-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -;; Copyright (C) 1999 Free Software Foundation, Inc. - -;; Author: Hrvoje Niksic -;; Maintainers: Hrvoje Niksic , -;; Martin Buchholz -;; Created: 1999 -;; Keywords: tests - -;; 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: - -;; Test some Mule functionality (most of these remain to be written) . -;; See test-harness.el for instructions on how to run these tests. - -;; This file will be (read)ed by a non-mule XEmacs, so don't use -;; literal non-Latin1 characters. Use (make-char) instead. - -;;----------------------------------------------------------------- -;; Test whether all legal chars may be safely inserted to a buffer. -;;----------------------------------------------------------------- - -(defun test-chars (&optional for-test-harness) - "Insert all characters in a buffer, to see if XEmacs will crash. -This is done by creating a string with all the legal characters -in [0, 2^19) range, inserting it into the buffer, and checking -that the buffer's contents are equivalent to the string. - -If FOR-TEST-HARNESS is specified, a temporary buffer is used, and -the Assert macro checks for correctness." - (let ((max (expt 2 (if (featurep 'mule) 19 8))) - (list nil) - (i 0)) - (while (< i max) - (and (not for-test-harness) - (zerop (% i 1000)) - (message "%d" i)) - (and (int-char i) - ;; Don't aset to a string directly because random string - ;; access is O(n) under Mule. - (setq list (cons (int-char i) list))) - (setq i (1+ i))) - (let ((string (apply #'string (nreverse list)))) - (if for-test-harness - ;; For use with test-harness, use Assert and a temporary - ;; buffer. - (with-temp-buffer - (insert string) - (Assert (equal (buffer-string) string))) - ;; For use without test harness: use a normal buffer, so that - ;; you can also test whether redisplay works. - (switch-to-buffer (get-buffer-create "test")) - (erase-buffer) - (buffer-disable-undo) - (insert string) - (assert (equal (buffer-string) string)))))) - -;; It would be really *really* nice if test-harness allowed a way to -;; run a test in byte-compiled mode only. It's tedious to have -;; time-consuming tests like this one run twice, once interpreted and -;; once compiled, for no good reason. -(test-chars t) - -;;----------------------------------------------------------------- -;; Test string modification functions that modify the length of a char. -;;----------------------------------------------------------------- - -(when (featurep 'mule) - ;;--------------------------------------------------------------- - ;; Test fillarray - ;;--------------------------------------------------------------- - (macrolet - ((fillarray-test - (charset1 charset2) - (let ((char1 (make-char charset1 69)) - (char2 (make-char charset2 69))) - `(let ((string (make-string 1000 ,char1))) - (fillarray string ,char2) - (Assert (eq (aref string 0) ,char2)) - (Assert (eq (aref string (1- (length string))) ,char2)) - (Assert (eq (length string) 1000)))))) - (fillarray-test ascii latin-iso8859-1) - (fillarray-test ascii latin-iso8859-2) - (fillarray-test latin-iso8859-1 ascii) - (fillarray-test latin-iso8859-2 ascii)) - - ;; Test aset - (let ((string (string (make-char 'ascii 69) (make-char 'latin-iso8859-2 69)))) - (aset string 0 (make-char 'latin-iso8859-2 42)) - (Assert (eq (aref string 1) (make-char 'latin-iso8859-2 69)))) - - ;;--------------------------------------------------------------- - ;; Test coding system functions - ;;--------------------------------------------------------------- - - ;; Create alias for coding system without subsidiaries - (Assert (coding-system-p (find-coding-system 'binary))) - (Assert (coding-system-canonical-name-p 'binary)) - (Assert (not (coding-system-alias-p 'binary))) - (Assert (not (coding-system-alias-p 'mule-tests-alias))) - (Assert (not (coding-system-canonical-name-p 'mule-tests-alias))) - (Check-Error-Message - error "Symbol is the canonical name of a coding system and cannot be redefined" - (define-coding-system-alias 'binary 'iso8859-2)) - (Check-Error-Message - error "Symbol is not a coding system alias" - (coding-system-aliasee 'binary)) - - (define-coding-system-alias 'mule-tests-alias 'binary) - (Assert (coding-system-alias-p 'mule-tests-alias)) - (Assert (not (coding-system-canonical-name-p 'mule-tests-alias))) - (Assert (eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias))) - (Assert (eq 'binary (coding-system-aliasee 'mule-tests-alias))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-unix))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-dos))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-mac))) - - (define-coding-system-alias 'mule-tests-alias (get-coding-system 'binary)) - (Assert (coding-system-alias-p 'mule-tests-alias)) - (Assert (not (coding-system-canonical-name-p 'mule-tests-alias))) - (Assert (eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias))) - (Assert (eq 'binary (coding-system-aliasee 'mule-tests-alias))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-unix))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-dos))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-mac))) - - (define-coding-system-alias 'nested-mule-tests-alias 'mule-tests-alias) - (Assert (coding-system-alias-p 'nested-mule-tests-alias)) - (Assert (not (coding-system-canonical-name-p 'nested-mule-tests-alias))) - (Assert (eq (get-coding-system 'binary) (get-coding-system 'nested-mule-tests-alias))) - (Assert (eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias)) - (Assert (eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias))) - (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-unix))) - (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-dos))) - (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-mac))) - - (Check-Error-Message - error "Attempt to create a coding system alias loop" - (define-coding-system-alias 'mule-tests-alias 'nested-mule-tests-alias)) - (Check-Error-Message - error "No such coding system" - (define-coding-system-alias 'no-such-coding-system 'no-such-coding-system)) - (Check-Error-Message - error "Attempt to create a coding system alias loop" - (define-coding-system-alias 'mule-tests-alias 'mule-tests-alias)) - - (define-coding-system-alias 'nested-mule-tests-alias nil) - (define-coding-system-alias 'mule-tests-alias nil) - (Assert (coding-system-p (find-coding-system 'binary))) - (Assert (coding-system-canonical-name-p 'binary)) - (Assert (not (coding-system-alias-p 'binary))) - (Assert (not (coding-system-alias-p 'mule-tests-alias))) - (Assert (not (coding-system-canonical-name-p 'mule-tests-alias))) - (Check-Error-Message - error "Symbol is the canonical name of a coding system and cannot be redefined" - (define-coding-system-alias 'binary 'iso8859-2)) - (Check-Error-Message - error "Symbol is not a coding system alias" - (coding-system-aliasee 'binary)) - - (define-coding-system-alias 'nested-mule-tests-alias nil) - (define-coding-system-alias 'mule-tests-alias nil) - - ;; Create alias for coding system with subsidiaries - (define-coding-system-alias 'mule-tests-alias 'iso-8859-7) - (Assert (coding-system-alias-p 'mule-tests-alias)) - (Assert (not (coding-system-canonical-name-p 'mule-tests-alias))) - (Assert (eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias))) - (Assert (eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias))) - (Assert (coding-system-alias-p 'mule-tests-alias-unix)) - (Assert (coding-system-alias-p 'mule-tests-alias-dos)) - (Assert (coding-system-alias-p 'mule-tests-alias-mac)) - - (define-coding-system-alias 'mule-tests-alias (get-coding-system 'iso-8859-7)) - (Assert (coding-system-alias-p 'mule-tests-alias)) - (Assert (not (coding-system-canonical-name-p 'mule-tests-alias))) - (Assert (eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias))) - (Assert (eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias))) - (Assert (coding-system-alias-p 'mule-tests-alias-unix)) - (Assert (coding-system-alias-p 'mule-tests-alias-dos)) - (Assert (coding-system-alias-p 'mule-tests-alias-mac)) - (Assert (eq (find-coding-system 'mule-tests-alias-mac) - (find-coding-system 'iso-8859-7-mac))) - - (define-coding-system-alias 'nested-mule-tests-alias 'mule-tests-alias) - (Assert (coding-system-alias-p 'nested-mule-tests-alias)) - (Assert (not (coding-system-canonical-name-p 'nested-mule-tests-alias))) - (Assert (eq (get-coding-system 'iso-8859-7) - (get-coding-system 'nested-mule-tests-alias))) - (Assert (eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias)) - (Assert (eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias))) - (Assert (coding-system-alias-p 'nested-mule-tests-alias-unix)) - (Assert (coding-system-alias-p 'nested-mule-tests-alias-dos)) - (Assert (coding-system-alias-p 'nested-mule-tests-alias-mac)) - (Assert (eq (find-coding-system 'nested-mule-tests-alias-unix) - (find-coding-system 'iso-8859-7-unix))) - - (Check-Error-Message - error "Attempt to create a coding system alias loop" - (define-coding-system-alias 'mule-tests-alias 'nested-mule-tests-alias)) - (Check-Error-Message - error "No such coding system" - (define-coding-system-alias 'no-such-coding-system 'no-such-coding-system)) - (Check-Error-Message - error "Attempt to create a coding system alias loop" - (define-coding-system-alias 'mule-tests-alias 'mule-tests-alias)) - - ;; Test dangling alias deletion - (define-coding-system-alias 'mule-tests-alias nil) - (Assert (not (coding-system-alias-p 'mule-tests-alias))) - (Assert (not (coding-system-alias-p 'mule-tests-alias-unix))) - (Assert (not (coding-system-alias-p 'nested-mule-tests-alias))) - (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-dos))) - - ;;--------------------------------------------------------------- - ;; Test strings waxing and waning across the 8k BIG_STRING limit (see alloc.c) - ;;--------------------------------------------------------------- - (defun charset-char-string (charset) - (let (lo hi string n) - (if (= (charset-chars charset) 94) - (setq lo 33 hi 126) - (setq lo 32 hi 127)) - (if (= (charset-dimension charset) 1) - (progn - (setq string (make-string (1+ (- hi lo)) ??)) - (setq n 0) - (loop for j from lo to hi do - (progn - (aset string n (make-char charset j)) - (incf n))) - string) - (progn - (setq string (make-string (* (1+ (- hi lo)) (1+ (- hi lo))) ??)) - (setq n 0) - (loop for j from lo to hi do - (loop for k from lo to hi do - (progn - (aset string n (make-char charset j k)) - (incf n)))) - string)))) - - ;; The following two used to crash xemacs! - (Assert (charset-char-string 'japanese-jisx0208)) - (aset (make-string 9003 ??) 1 (make-char 'latin-iso8859-1 77)) - - (let ((greek-string (charset-char-string 'greek-iso8859-7)) - (string (make-string (* 96 60) ??))) - (loop for j from 0 below (length string) do - (aset string j (aref greek-string (mod j 96)))) - (loop for k in '(0 1 58 59) do - (Assert (equal (substring string (* 96 k) (* 96 (1+ k))) greek-string)))) - - (let ((greek-string (charset-char-string 'greek-iso8859-7)) - (string (make-string (* 96 60) ??))) - (loop for j from (1- (length string)) downto 0 do - (aset string j (aref greek-string (mod j 96)))) - (loop for k in '(0 1 58 59) do - (Assert (equal (substring string (* 96 k) (* 96 (1+ k))) greek-string)))) - - (let ((ascii-string (charset-char-string 'ascii)) - (string (make-string (* 94 60) (make-char 'greek-iso8859-7 57)))) - (loop for j from 0 below (length string) do - (aset string j (aref ascii-string (mod j 94)))) - (loop for k in '(0 1 58 59) do - (Assert (equal (substring string (* 94 k) (+ 94 (* 94 k))) ascii-string)))) - - (let ((ascii-string (charset-char-string 'ascii)) - (string (make-string (* 94 60) (make-char 'greek-iso8859-7 57)))) - (loop for j from (1- (length string)) downto 0 do - (aset string j (aref ascii-string (mod j 94)))) - (loop for k in '(0 1 58 59) do - (Assert (equal (substring string (* 94 k) (* 94 (1+ k))) ascii-string)))) - - ;;--------------------------------------------------------------- - ;; Test file-system character conversion (and, en passant, file ops) - ;;--------------------------------------------------------------- - (let* ((scaron (make-char 'latin-iso8859-2 57)) - (latin2-string (make-string 4 scaron)) - (prefix (concat (file-name-as-directory (temp-directory)) latin2-string)) - (name1 (make-temp-name prefix)) - (name2 (make-temp-name prefix)) - (file-name-coding-system 'iso-8859-2)) - ;; This is how you suppress output from `message', called by `write-region' - (flet ((append-message (&rest args) ())) - (Assert (not (equal name1 name2))) - (Assert (not (file-exists-p name1))) - (write-region (point-min) (point-max) name1) - (Assert (file-exists-p name1)) - (when (fboundp 'make-symbolic-link) - (make-symbolic-link name1 name2) - (Assert (file-exists-p name2)) - (Assert (equal (file-truename name2) name1)) - (Assert (equal (file-truename name1) name1))) - - (ignore-file-errors (delete-file name1) (delete-file name2)))) - - ;; Add many more file operation tests here... - - ) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/symbol-tests.el --- a/tests/automated/symbol-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/automated/symbol-tests.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,7 +1,7 @@ ;; Copyright (C) 1999 Free Software Foundation, Inc. -;; Author: Hrvoje Niksic -;; Maintainer: Hrvoje Niksic +;; Author: Hrvoje Niksic +;; Maintainer: Hrvoje Niksic ;; Created: 1999 ;; Keywords: tests @@ -250,70 +250,33 @@ ;; Magic symbols ;;----------------------------------------------------- -;; Magic symbols are only half implemented. However, a subset of the -;; functionality is being used to implement backward compatibility or -;; clearer error messages for new features such as specifiers and -;; glyphs. These tests try to test that working subset. +;; Magic symbols are almost totally unimplemented. However, a +;; rudimentary subset of the functionality is being used to implement +;; backward compatibility or clearer error messages for new features +;; such as specifiers and glyphs. These tests try to test that +;; working subset. -(let ((mysym (make-symbol "test-symbol")) - save) +(let ((mysym (make-symbol "test-symbol"))) (dontusethis-set-symbol-value-handler mysym 'set-value (lambda (&rest args) (throw 'test-tag args))) - (Assert (not (boundp mysym))) (Assert (equal (catch 'test-tag (set mysym 'foo)) - `(,mysym (foo) set nil nil))) - (Assert (not (boundp mysym))) - (dontusethis-set-symbol-value-handler - mysym - 'set-value - (lambda (&rest args) (setq save (nth 1 args)))) - (set mysym 'foo) - (Assert (equal save '(foo))) - (Assert (eq (symbol-value mysym) 'foo)) - ) + `(,mysym (foo) set nil nil)))) + +;; #### These two make XEmacs crash! -(let ((mysym (make-symbol "test-symbol")) - save) - (dontusethis-set-symbol-value-handler - mysym - 'make-unbound - (lambda (&rest args) - (throw 'test-tag args))) - (Assert (equal (catch 'test-tag - (makunbound mysym)) - `(,mysym nil makunbound nil nil))) - (dontusethis-set-symbol-value-handler - mysym - 'make-unbound - (lambda (&rest args) (setq save (nth 2 args)))) - (Assert (not (boundp mysym))) - (set mysym 'bar) - (Assert (null save)) - (Assert (eq (symbol-value mysym) 'bar)) - (makunbound mysym) - (Assert (not (boundp mysym))) - (Assert (eq save 'makunbound)) - ) - -(when (featurep 'file-coding) - (Assert (eq pathname-coding-system file-name-coding-system)) - (let ((val1 file-name-coding-system) - (val2 pathname-coding-system)) - (Assert (eq val1 val2)) - (let ((file-name-coding-system 'no-conversion-dos)) - (Assert (eq file-name-coding-system 'no-conversion-dos)) - (Assert (eq pathname-coding-system file-name-coding-system))) - (let ((pathname-coding-system 'no-conversion-mac)) - (Assert (eq file-name-coding-system 'no-conversion-mac)) - (Assert (eq pathname-coding-system file-name-coding-system))) - (Assert (eq file-name-coding-system pathname-coding-system)) - (Assert (eq val1 file-name-coding-system))) - (Assert (eq pathname-coding-system file-name-coding-system))) - +;(let ((mysym (make-symbol "test-symbol"))) +; (dontusethis-set-symbol-value-handler +; mysym +; 'make-unbound +; (lambda (&rest args) +; (throw 'test-tag args))) +; (Assert (equal (catch 'test-tag +; (set mysym 'foo)) +; `(,mysym (foo) set nil nil)))) ;(let ((mysym (make-symbol "test-symbol"))) ; (dontusethis-set-symbol-value-handler @@ -323,4 +286,4 @@ ; (throw 'test-tag args))) ; (Assert (equal (catch 'test-tag ; (set mysym 'foo)) -; `(,mysym (foo) make-local nil nil)))) +; `(,mysym (foo) set nil nil)))) diff -r 12e008d41344 -r 697ef44129c6 tests/automated/syntax-tests.el --- a/tests/automated/syntax-tests.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -;; Copyright (C) 1999 Free Software Foundation, Inc. - -;; Author: Yoshiki Hayashi -;; Maintainer: Yoshiki Hayashi -;; Created: 1999 -;; Keywords: tests - -;; 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: - -;; Test syntax related functions. -;; Right now it tests scan_words using forward-word and backward-word. -;; See test-harness.el for instructions on how to run these tests. - -;;; Notation -;; W: word constituent character. -;; NW: non word constituent character. -;; -!-: current point. -;; EOB: end of buffer -;; BOB: beginning of buffer. - -;; Algorithm of scan_words is simple. It just searches SW and then -;; moves to NW. When with MULE, it also stops at word boundary. Word -;; boundary is tricky and listing all possible cases will be huge. -;; Those test are omitted here as it doesn't affect core -;; functionality. - -(defun test-forward-word (string stop) - (goto-char (point-max)) - (let ((point (point))) - (insert string) - (goto-char point) - (forward-word 1) - (Assert (eq (point) (+ point stop))))) - -(with-temp-buffer - ;; -!- W NW - (test-forward-word "W " 1) - (test-forward-word "WO " 2) - ;; -!- W EOB - (test-forward-word "W" 1) - (test-forward-word "WO" 2) - ;; -!- NW EOB - (test-forward-word " " 1) - (test-forward-word " !" 2) - ;; -!- NW W NW - (test-forward-word " W " 2) - (test-forward-word " WO " 3) - (test-forward-word " !W " 3) - (test-forward-word " !WO " 4) - ;; -!- NW W EOB - (test-forward-word " W" 2) - (test-forward-word " WO" 3) - (test-forward-word " !W" 3) - (test-forward-word " !WO" 4)) - -(defun test-backward-word (string stop) - (goto-char (point-min)) - (insert string) - (let ((point (point))) - (backward-word 1) - (Assert (eq (point) (- point stop))))) - -(with-temp-buffer - ;; NW W -!- - (test-backward-word " W" 1) - (test-backward-word " WO" 2) - ;; BOB W -!- - (test-backward-word "W" 1) - (test-backward-word "WO" 2) - ;; BOB NW -!- - ;; -!-NW EOB - (test-backward-word " " 1) - (test-backward-word " !" 2) - ;; NW W NW -!- - (test-backward-word " W " 2) - (test-backward-word " WO " 3) - (test-backward-word " W !" 3) - (test-backward-word " WO !" 4) - ;; BOB W NW -!- - (test-backward-word "W " 2) - (test-backward-word "WO " 3) - (test-backward-word "W !" 3) - (test-backward-word "WO !" 4)) diff -r 12e008d41344 -r 697ef44129c6 tests/glyph-test.el --- a/tests/glyph-test.el Mon Aug 13 11:19:22 2007 +0200 +++ b/tests/glyph-test.el Mon Aug 13 11:20:41 2007 +0200 @@ -1,89 +1,40 @@ -(set-extent-begin-glyph - (make-extent (point) (point)) - (setq im (make-glyph [xpm :file "xemacs-icon.xpm"]))) - (set-extent-begin-glyph (make-extent (point) (point)) - (make-glyph [string :data "xemacs"])) + (setq icon (make-glyph [xpm :file "../etc/xemacs-icon.xpm"]))) (defun foo () - (interactive) + (interactive) (setq ok-select (not ok-select))) -(defun fee () (interactive) (message "hello")) - ;; button in a group (setq ok-select nil) (set-extent-begin-glyph (make-extent (point) (point)) - (setq radio-button1 - (make-glyph - [button :face widget - :descriptor ["ok1" (setq ok-select t) - :style radio :selected ok-select]]))) + (make-glyph [button :descriptor ["ok " (setq ok-select t) + :style radio :selected ok-select]])) ;; button in a group (set-extent-begin-glyph (make-extent (point) (point)) - (setq radio-button2 - (make-glyph -` [button :descriptor ["ok2" (setq ok-select nil) :style radio - :selected (not ok-select)]]))) -;; toggle button -(set-extent-begin-glyph - (make-extent (point) (point)) - (setq tbutton - (make-glyph [button :descriptor ["ok3" (setq ok-select nil) - :style toggle - :selected (not ok-select)]]))) -(set-extent-begin-glyph - (make-extent (point) (point)) - (setq toggle-button - (make-glyph [button :descriptor ["ok4" :style toggle - :callback - (setq ok-select (not ok-select)) - :selected ok-select]]))) - + (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio + :selected (not ok-select)]])) ;; normal pushbutton (set-extent-begin-glyph (make-extent (point) (point)) - (setq push-button - (make-glyph [button :width 10 :height 2 - :face modeline-mousable - :descriptor "ok" :callback foo - :selected t]))) -;; tree view -(set-extent-begin-glyph - (make-extent (point) (point)) - (setq tree (make-glyph - [tree-view :width 10 - :descriptor "My Tree" - :properties (:items (["One" foo] - (["Two" foo] - ["Four" foo] - "Six") - "Three"))]))) - -;; tab control -(set-extent-begin-glyph - (make-extent (point) (point)) - (setq tab (make-glyph - [tab-control :descriptor "My Tab" - :face highlight - :orientation right - :properties (:items (["One" foo :selected t] - ["Two" fee :selected nil] - ["Three" foo :selected nil]))]))) - + (setq pbutton (make-glyph + [button :width 10 :height 2 + :face modeline-mousable + :descriptor "ok" :callback foo + :selected t]))) ;; progress gauge (set-extent-begin-glyph (make-extent (point) (point)) (setq pgauge (make-glyph - [progress-gauge :width 10 :height 2 - :descriptor "ok"]))) + [progress :width 10 :height 2 + :descriptor "ok"]))) ;; progress the progress ... (let ((x 0)) (while (<= x 100) - (set-image-instance-property (glyph-image-instance pgauge) :value x) + (set-image-instance-property (glyph-image-instance pgauge) :percent x) (setq x (+ x 5)) (sit-for 0.1))) @@ -91,12 +42,12 @@ (setq global-mode-string (cons (make-extent nil nil) (setq pg (make-glyph - [progress-gauge :width 5 :pixel-height 16 - :descriptor "ok"])))) + [progress :width 5 :pixel-height 16 + :descriptor "ok"])))) ;; progress the progress ... (let ((x 0)) (while (<= x 100) - (set-image-instance-property (glyph-image-instance pg) :value x) + (set-image-instance-property (glyph-image-instance pg) :percent x) (setq x (+ x 5)) (sit-for 0.1))) @@ -105,36 +56,30 @@ (make-glyph [button :face modeline-mousable :descriptor "ok" :callback foo - :image [xpm :file "../etc/xemacs-icon.xpm"]])) + :image (make-glyph + [xpm :file "../etc/xemacs-icon.xpm"])])) ;; normal pushbutton (set-extent-begin-glyph (make-extent (point) (point)) - (setq pbutton - (make-glyph [button :descriptor ["A Big Button" foo ]]))) - + (make-glyph [button :descriptor ["A Big Button" foo ]])) ;; edit box (set-extent-begin-glyph (make-extent (point) (point)) - (setq edit-field (make-glyph [edit-field :pixel-width 50 :pixel-height 30 - :face bold-italic - :descriptor ["Hello"]]))) + (setq hedit (make-glyph [edit :pixel-width 50 :pixel-height 30 + :face bold-italic + :descriptor ["Hello"]]))) ;; combo box (set-extent-begin-glyph (make-extent (point) (point)) - (setq combo-box (make-glyph - [combo-box :width 10 :descriptor ["Hello"] - :properties (:items ("One" "Two" "Three"))]))) + (setq hcombo (make-glyph + [combo :width 10 :height 3 :descriptor ["Hello"] + :properties (:items ("One" "Two" "Three"))]))) -;; label +;; line (set-extent-begin-glyph (make-extent (point) (point)) - (setq label (make-glyph [label :pixel-width 150 :descriptor "Hello"]))) - -;; string -(set-extent-begin-glyph - (make-extent (point) (point)) - (setq str (make-glyph [string :data "Hello There"]))) + (make-glyph [label :pixel-width 150 :descriptor "Hello"])) ;; scrollbar ;(set-extent-begin-glyph @@ -142,41 +87,6 @@ ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]])) ;; generic subwindow -(setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 70])) +(setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 50])) (set-extent-begin-glyph (make-extent (point) (point)) sw) -;; layout -(setq layout - (make-glyph - [layout :descriptor "The Layout" - :orientation vertical - :justify left - :border [string :data "Hello There Mrs"] - :items ([native-layout :orientation horizontal - :items (radio-button1 radio-button2)] - edit-field toggle-button label str)])) -(set-glyph-face layout 'gui-element) -(set-extent-begin-glyph - (make-extent (point) (point)) layout) - -(setq test-toggle-widget nil) - -(defun test-toggle (widget) - (set-extent-begin-glyph - (make-extent (point) (point)) - (make-glyph (vector 'button - :descriptor "ok" - :style 'toggle - :selected `(funcall test-toggle-value - ,widget) - :callback `(funcall test-toggle-action - ,widget))))) - -(defun test-toggle-action (widget &optional event) - (if widget - (message "Widget is t") - (message "Widget is nil"))) - -(defun test-toggle-value (widget) - (setq widget (not widget)) - (not widget)) diff -r 12e008d41344 -r 697ef44129c6 tests/gutter-test.el --- a/tests/gutter-test.el Mon Aug 13 11:19:22 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -(setq str "Hello\nAgain") -(setq str-ext (make-extent 0 5 str)) -(set-extent-begin-glyph - str-ext - (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])) -(set-extent-property str-ext 'mouse-face 'highlight) - -(setq str2 "Hello\n") -(setq str2-ext (make-extent 0 1 str2)) -(set-extent-begin-glyph - str2-ext - (make-glyph - [button :width 5 :height 1 - :face modeline-mousable - :callback (set-specifier bottom-gutter-visible-p '(str2)) - :descriptor "ok" :selected t])) - -(set-specifier bottom-gutter-height 'autodetect) -(set-specifier bottom-gutter-border-width 2) -(set-gutter-element bottom-gutter 'str str) -(set-gutter-element bottom-gutter 'str2 str2) -(set-gutter-element-visible-p bottom-gutter-visible-p 'str t) -(set-gutter-element-visible-p bottom-gutter-visible-p 'str2 t) diff -r 12e008d41344 -r 697ef44129c6 version.sh --- a/version.sh Mon Aug 13 11:19:22 2007 +0200 +++ b/version.sh Mon Aug 13 11:20:41 2007 +0200 @@ -1,9 +1,8 @@ #!/bin/sh -emacs_is_beta=t emacs_major_version=21 emacs_minor_version=2 -emacs_beta_version=35 -xemacs_codename="Nike" +emacs_beta_version=14 +xemacs_codename="Dionysos" infodock_major_version=4 infodock_minor_version=0 -infodock_build_version=8 +infodock_build_version=7